mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-15 07:01:36 +08:00
c95273f973
Minecraft ineffeciently uses OutputStreams by calling .write(int) on the stream. For Chunks, this is a DeflaterOutputStream, which allocates a single byte EVERY write. This is causing the server to allocate tons of new byte[1] objects. Additionally, this is very ineffecient for the Deflate process. By Buffering Writes the same way it already is Buffering Reads, we will write to the stream much more effeciently. Also a more effecient RegionFile zero'ing for new chunks to speed up new chunk generation.
26 lines
889 B
Diff
26 lines
889 B
Diff
From af0d91f09d43929fbb2cc2e49892dd1065decb39 Mon Sep 17 00:00:00 2001
|
|
From: DerFlash <bte@freenet.de>
|
|
Date: Sat, 3 Aug 2013 19:53:48 +1000
|
|
Subject: [PATCH] Add Getter for Entity Invulnerability
|
|
|
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
|
index 93193ac..89cbb45 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
|
@@ -541,6 +541,11 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
|
|
// Spigot start
|
|
private final Spigot spigot = new Spigot()
|
|
{
|
|
+ @Override
|
|
+ public boolean isInvulnerable()
|
|
+ {
|
|
+ return getHandle().isInvulnerable(net.minecraft.server.DamageSource.GENERIC);
|
|
+ }
|
|
};
|
|
|
|
public Spigot spigot()
|
|
--
|
|
2.1.4
|
|
|