mirror of
https://github.com/PaperMC/Paper.git
synced 2025-02-03 21:37:28 +01:00
Houston, we got a patch (#2731)
* Houston, we got a patch * is this the end of the beginning or the beginning of the end
This commit is contained in:
parent
12013028b5
commit
3360d06f76
125 changed files with 643 additions and 6035 deletions
Spigot-Server-Patches
Add-APIs-to-replace-OfflinePlayer-getLastPlayed.patchAdd-Heightmap-API.patchAdd-LivingEntity-getTargetEntity.patchAdd-PlayerConnectionCloseEvent.patchAdd-Velocity-IP-Forwarding-Support.patchAdd-more-Witch-API.patchAdd-more-Zombie-API.patchAdd-option-to-disable-pillager-patrols.patchAdd-option-to-prevent-players-from-moving-into-unloa.patchAdd-sun-related-API.patchAllow-Saving-of-Oversized-Chunks.patchAllow-chests-to-be-placed-with-NBT-data.patchAllow-setting-the-vex-s-summoner.patchAnti-Xray.patchAsynchronous-chunk-IO-and-loading.patchAvoid-dimension-id-collisions.patchAvoid-hopper-searches-if-there-are-no-items.patchBackport-MC-160177-fix-from-1.15.patchBlock-Entity-remove-from-being-called-on-Players.patchBlockDestroyEvent.patchBook-Size-Limits.patchCall-WhitelistToggleEvent-when-whitelist-is-toggled.patchCall-player-spectator-target-events.patchCatch-JsonParseException-in-Entity-and-TE-names.patchCatch-exceptions-from-dispenser-entity-spawns.patchCheck-Drowned-for-Villager-Aggression-Config.patchChunk-debug-command.patchChunkMapDistance-CME.patchConfigurable-Keep-Spawn-Loaded-range-per-world.patchConfigurable-connection-throttle-kick-message.patchConfigurable-projectile-relative-velocity.patchDo-less-work-if-we-have-a-custom-Bukkit-generator.patchDon-t-allow-digging-into-unloaded-chunks.patchDon-t-check-ConvertSigns-boolean-every-sign-save.patchDon-t-sleep-after-profile-lookups-if-not-needed.patchDuplicate-UUID-Resolve-Option.patchEntity-getEntitySpawnReason.patchExpose-the-internal-current-tick.patchFire-BlockPistonRetractEvent-for-all-empty-pistons.patchFire-event-on-GS4-query.patchFix-AssertionError-when-player-hand-set-to-empty-typ.patchFix-CB-call-to-changed-postToMainThread-method.patchFix-CraftServer-isPrimaryThread-and-MinecraftServer-.patchFix-Custom-Shapeless-Custom-Crafting-Recipes.patchFix-MC-158900.patchFix-MC-161754.patchFix-MC-93764.patchFix-PlayerEditBookEvent.patchFix-SpongeAbsortEvent-handling.patchFix-World-isChunkGenerated-calls.patchFix-issues-with-entity-loss-due-to-unloaded-chunks.patchFix-nether-portal-creation.patchFix-sign-edit-memory-leak.patchFix-some-generation-concurrency-issues.patchFix-sounds-when-item-frames-are-modified-MC-123450.patchFix-spawning-of-hanging-entities-that-are-not-ItemFr.patchFix-stuck-in-sneak-when-changing-worlds-MC-10657.patchFix-zero-tick-instant-grow-farms-MC-113809.patchFixed-MC-156852.patchGenerator-Settings.patchHandle-Excessive-Signs-in-Chunks-creating-too-large-.patchHandle-Large-Packets-disconnecting-client.patchHandle-bad-chunks-more-gracefully.patchHere-s-Johnny.patchHonor-EntityAgeable.ageLock.patchHook-into-CB-plugin-rewrites.patchImplement-CraftBlockSoundGroup.patchImplement-PlayerPostRespawnEvent.patchImplement-alternative-item-despawn-rate.patchImplement-an-API-for-CanPlaceOn-and-CanDestroy-NBT-v.patchImplement-furnace-cook-speed-multiplier-API.patchImplement-getters-and-setters-for-EntityItem-owner-a.patchImprove-POI-data-saving-logic.patchImprove-death-events.patchLazy-init-world-storage-in-CraftOfflinePlayer.patchLimit-Client-Sign-length-more.patchLimit-lightning-strike-effect-distance.patchLog-other-thread-in-DataPaletteBlock-lock-failure.patchMC-114618-Fix-EntityAreaEffectCloud-from-going-negat.patchMC-136865-Use-valid-item-for-enchantment-checks-on-b.patchMC-145260-Fix-Whitelist-On-Off-inconsistency.patchMC-50319-Check-other-worlds-for-shooter-of-projectil.patchMake-the-default-permission-message-configurable.patchMark-entities-as-being-ticked-when-notifying-navigat.patchMob-Pathfinding-API.patchMob-Spawner-API-Enhancements.patchOnly-count-Natural-Spawned-mobs-towards-natural-spaw.patchOptimize-Biome-Mob-Lookups-for-Mob-Spawning.patchOptimize-Captured-TileEntity-Lookup.patchOptimize-Server-World-Map.patchOptimize-World-Time-Updates.patchOptimize-redstone-algorithm.patchPer-Player-View-Distance-API-placeholders.patchPerformance-improvement-for-Chunk.getEntities.patchPlayerDeathEvent-getItemsToKeep.patchPreSpawnerSpawnEvent.patchPreserve-old-flush-on-save-flag-for-reliable-regionf.patchPrevent-Enderman-from-loading-chunks.patchPrevent-Mob-AI-Rules-from-Loading-Chunks.patchPrevent-chunk-loading-from-Fluid-Flowing.patch
|
@ -16,7 +16,7 @@ intent to remove) and replace it with two new methods, clearly named and
|
|||
documented as to their purpose.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
|
||||
index d3886a6e04..2d4021784f 100644
|
||||
index f41fd576d..1665a302a 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
|
||||
@@ -0,0 +0,0 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
|
@ -28,7 +28,7 @@ index d3886a6e04..2d4021784f 100644
|
|||
public boolean queueHealthUpdatePacket = false;
|
||||
public net.minecraft.server.PacketPlayOutUpdateHealth queuedHealthUpdatePacket;
|
||||
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
|
||||
index 049d702cb9..52aa83f51f 100644
|
||||
index e46436623..659ce2181 100644
|
||||
--- a/src/main/java/net/minecraft/server/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/PlayerList.java
|
||||
@@ -0,0 +0,0 @@ public abstract class PlayerList {
|
||||
|
@ -38,9 +38,9 @@ index 049d702cb9..52aa83f51f 100644
|
|||
+ entityplayer.loginTime = System.currentTimeMillis(); // Paper
|
||||
GameProfile gameprofile = entityplayer.getProfile();
|
||||
UserCache usercache = this.server.getUserCache();
|
||||
GameProfile gameprofile1 = usercache.a(gameprofile.getId());
|
||||
GameProfile gameprofile1 = usercache.getProfile(gameprofile.getId());
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java b/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java
|
||||
index c1ef1c950d..3824180ee5 100644
|
||||
index c1ef1c950..3824180ee 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java
|
||||
@@ -0,0 +0,0 @@ public class CraftOfflinePlayer implements OfflinePlayer, ConfigurationSerializa
|
||||
|
@ -106,7 +106,7 @@ index c1ef1c950d..3824180ee5 100644
|
|||
public Location getBedSpawnLocation() {
|
||||
NBTTagCompound data = getData();
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index 3d60e98749..ea4e569e5a 100644
|
||||
index ad70bd5ba..04fc8e233 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -0,0 +0,0 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
|
|
|
@ -5,10 +5,10 @@ Subject: [PATCH] Add Heightmap API
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
|
||||
index dd2a9c6e59..e3b4e30e65 100644
|
||||
index dfc695084..10bb06489 100644
|
||||
--- a/src/main/java/net/minecraft/server/World.java
|
||||
+++ b/src/main/java/net/minecraft/server/World.java
|
||||
@@ -0,0 +0,0 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
|
||||
@@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -20,7 +20,7 @@ index dd2a9c6e59..e3b4e30e65 100644
|
|||
|
||||
if (i >= -30000000 && j >= -30000000 && i < 30000000 && j < 30000000) {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
index 78a2c47c5a..95fdc3bf64 100644
|
||||
index 578fe8d19..12362d560 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
@@ -0,0 +0,0 @@ public class CraftWorld implements World {
|
||||
|
|
|
@ -46,7 +46,7 @@ index 4f60b931a..c950139c0 100644
|
|||
double[] adouble = new double[]{1.0D};
|
||||
double d0 = vec3d1.x - vec3d.x;
|
||||
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
|
||||
index 75da08596..046e7e031 100644
|
||||
index 0f2480521..2e8aedf5f 100644
|
||||
--- a/src/main/java/net/minecraft/server/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/server/Entity.java
|
||||
@@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
||||
|
@ -54,19 +54,19 @@ index 75da08596..046e7e031 100644
|
|||
}
|
||||
|
||||
+ public final Vec3D getEyePosition(float partialTicks) { return j(partialTicks); } // Paper - OBFHELPER
|
||||
public Vec3D j(float f) {
|
||||
public final Vec3D j(float f) {
|
||||
if (f == 1.0F) {
|
||||
return new Vec3D(this.locX, this.locY + (double) this.getHeadHeight(), this.locZ);
|
||||
return new Vec3D(this.locX(), this.getHeadY(), this.locZ());
|
||||
@@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
||||
return this.getPassengers().size() < 1;
|
||||
}
|
||||
|
||||
+ public final float getCollisionBorderSize() { return aS(); } // Paper - OBFHELPER
|
||||
public float aS() {
|
||||
+ public final float getCollisionBorderSize() { return aV(); } // Paper - OBFHELPER
|
||||
public float aV() {
|
||||
return 0.0F;
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
index d23968a7c..31d14b19b 100644
|
||||
index 317321395..1b5acf77e 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
@@ -0,0 +0,0 @@ public abstract class EntityLiving extends Entity {
|
||||
|
@ -108,7 +108,7 @@ index d23968a7c..31d14b19b 100644
|
|||
|
||||
public int getShieldBlockingDelay() {
|
||||
diff --git a/src/main/java/net/minecraft/server/IEntitySelector.java b/src/main/java/net/minecraft/server/IEntitySelector.java
|
||||
index 9bf191945..56488b78d 100644
|
||||
index c1f462d9d..498f38109 100644
|
||||
--- a/src/main/java/net/minecraft/server/IEntitySelector.java
|
||||
+++ b/src/main/java/net/minecraft/server/IEntitySelector.java
|
||||
@@ -0,0 +0,0 @@ public final class IEntitySelector {
|
||||
|
|
|
@ -34,7 +34,7 @@ how PlayerPreLoginEvent interacts with PlayerConnectionCloseEvent
|
|||
is undefined.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/LoginListener.java b/src/main/java/net/minecraft/server/LoginListener.java
|
||||
index 41b2c90c3a..a8773037e5 100644
|
||||
index c3d57461d..a6b22254a 100644
|
||||
--- a/src/main/java/net/minecraft/server/LoginListener.java
|
||||
+++ b/src/main/java/net/minecraft/server/LoginListener.java
|
||||
@@ -0,0 +0,0 @@ public class LoginListener implements PacketLoginInListener {
|
||||
|
@ -50,7 +50,7 @@ index 41b2c90c3a..a8773037e5 100644
|
|||
private SecretKey loginKey;
|
||||
private EntityPlayer l;
|
||||
diff --git a/src/main/java/net/minecraft/server/NetworkManager.java b/src/main/java/net/minecraft/server/NetworkManager.java
|
||||
index d4aad8a5b7..b1dededc15 100644
|
||||
index d4aad8a5b..b1dededc1 100644
|
||||
--- a/src/main/java/net/minecraft/server/NetworkManager.java
|
||||
+++ b/src/main/java/net/minecraft/server/NetworkManager.java
|
||||
@@ -0,0 +0,0 @@ public class NetworkManager extends SimpleChannelInboundHandler<Packet<?>> {
|
||||
|
|
|
@ -14,7 +14,7 @@ forwarding, and is integrated into the Minecraft login process by using the 1.13
|
|||
login plugin message packet.
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
||||
index d2c039ea2f..63d8602927 100644
|
||||
index 092bff78a..7e85a0224 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
||||
@@ -0,0 +0,0 @@ import java.io.IOException;
|
||||
|
@ -55,7 +55,7 @@ index d2c039ea2f..63d8602927 100644
|
|||
}
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/proxy/VelocityProxy.java b/src/main/java/com/destroystokyo/paper/proxy/VelocityProxy.java
|
||||
new file mode 100644
|
||||
index 0000000000..fdd8708f97
|
||||
index 000000000..fdd8708f9
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/com/destroystokyo/paper/proxy/VelocityProxy.java
|
||||
@@ -0,0 +0,0 @@
|
||||
|
@ -127,7 +127,7 @@ index 0000000000..fdd8708f97
|
|||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/net/minecraft/server/LoginListener.java b/src/main/java/net/minecraft/server/LoginListener.java
|
||||
index d6befec184..41b2c90c3a 100644
|
||||
index a985ae7ba..c3d57461d 100644
|
||||
--- a/src/main/java/net/minecraft/server/LoginListener.java
|
||||
+++ b/src/main/java/net/minecraft/server/LoginListener.java
|
||||
@@ -0,0 +0,0 @@ public class LoginListener implements PacketLoginInListener {
|
||||
|
@ -203,7 +203,7 @@ index d6befec184..41b2c90c3a 100644
|
|||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/NetworkManager.java b/src/main/java/net/minecraft/server/NetworkManager.java
|
||||
index 08e314af7c..046196d54d 100644
|
||||
index 08e314af7..046196d54 100644
|
||||
--- a/src/main/java/net/minecraft/server/NetworkManager.java
|
||||
+++ b/src/main/java/net/minecraft/server/NetworkManager.java
|
||||
@@ -0,0 +0,0 @@ public class NetworkManager extends SimpleChannelInboundHandler<Packet<?>> {
|
||||
|
@ -216,7 +216,7 @@ index 08e314af7c..046196d54d 100644
|
|||
public java.util.UUID spoofedUUID;
|
||||
public com.mojang.authlib.properties.Property[] spoofedProfile;
|
||||
diff --git a/src/main/java/net/minecraft/server/PacketDataSerializer.java b/src/main/java/net/minecraft/server/PacketDataSerializer.java
|
||||
index fa2d3ce8cb..dac560c63f 100644
|
||||
index 93ae6dcd7..fb9186b3f 100644
|
||||
--- a/src/main/java/net/minecraft/server/PacketDataSerializer.java
|
||||
+++ b/src/main/java/net/minecraft/server/PacketDataSerializer.java
|
||||
@@ -0,0 +0,0 @@ public class PacketDataSerializer extends ByteBuf {
|
||||
|
@ -244,7 +244,7 @@ index fa2d3ce8cb..dac560c63f 100644
|
|||
int j = this.i();
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/PacketLoginInCustomPayload.java b/src/main/java/net/minecraft/server/PacketLoginInCustomPayload.java
|
||||
index 4d1f441395..c1ca6f9501 100644
|
||||
index 4d1f44139..c1ca6f950 100644
|
||||
--- a/src/main/java/net/minecraft/server/PacketLoginInCustomPayload.java
|
||||
+++ b/src/main/java/net/minecraft/server/PacketLoginInCustomPayload.java
|
||||
@@ -0,0 +0,0 @@ import java.io.IOException;
|
||||
|
@ -259,7 +259,7 @@ index 4d1f441395..c1ca6f9501 100644
|
|||
public PacketLoginInCustomPayload() {}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/PacketLoginOutCustomPayload.java b/src/main/java/net/minecraft/server/PacketLoginOutCustomPayload.java
|
||||
index ae74dc9e18..7eb230f1b2 100644
|
||||
index ae74dc9e1..7eb230f1b 100644
|
||||
--- a/src/main/java/net/minecraft/server/PacketLoginOutCustomPayload.java
|
||||
+++ b/src/main/java/net/minecraft/server/PacketLoginOutCustomPayload.java
|
||||
@@ -0,0 +0,0 @@ public class PacketLoginOutCustomPayload implements Packet<PacketLoginOutListene
|
||||
|
@ -278,7 +278,7 @@ index ae74dc9e18..7eb230f1b2 100644
|
|||
public void a(PacketDataSerializer packetdataserializer) throws IOException {
|
||||
this.a = packetdataserializer.i();
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index d0834ecaab..145de4fe6e 100644
|
||||
index e1c9a9e12..7e810e008 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -0,0 +0,0 @@ public final class CraftServer implements Server {
|
||||
|
|
|
@ -5,7 +5,7 @@ Subject: [PATCH] Add more Witch API
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityWitch.java b/src/main/java/net/minecraft/server/EntityWitch.java
|
||||
index ff4e73fff3..0b849f37c5 100644
|
||||
index be6ecfb08..f1a4c10ad 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityWitch.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityWitch.java
|
||||
@@ -0,0 +0,0 @@
|
||||
|
@ -24,26 +24,26 @@ index ff4e73fff3..0b849f37c5 100644
|
|||
public class EntityWitch extends EntityRaider implements IRangedEntity {
|
||||
|
||||
private static final UUID b = UUID.fromString("5CD17E52-A79A-43D3-A529-90FDE04B181E");
|
||||
- private static final AttributeModifier bz = (new AttributeModifier(EntityWitch.b, "Drinking speed penalty", -0.25D, AttributeModifier.Operation.ADDITION)).a(false);
|
||||
+ private static final AttributeModifier bz = (new AttributeModifier(EntityWitch.b, "Drinking speed penalty", -0.25D, AttributeModifier.Operation.ADDITION)).a(false); private static final AttributeModifier DRINKING_SPEED = bz; // Paper - OBFHELPER
|
||||
private static final DataWatcherObject<Boolean> bA = DataWatcher.a(EntityWitch.class, DataWatcherRegistry.i);
|
||||
- private int bB;
|
||||
+ private int bB; public int getPotionUseTimeLeft() { return bB; } public void setPotionUseTimeLeft(int timeLeft) { bB = timeLeft; } // Paper - OBFHELPER
|
||||
private PathfinderGoalNearestHealableRaider<EntityRaider> bC;
|
||||
private PathfinderGoalNearestAttackableTargetWitch<EntityHuman> bD;
|
||||
- private static final AttributeModifier bw = (new AttributeModifier(EntityWitch.b, "Drinking speed penalty", -0.25D, AttributeModifier.Operation.ADDITION)).a(false);
|
||||
+ private static final AttributeModifier bw = (new AttributeModifier(EntityWitch.b, "Drinking speed penalty", -0.25D, AttributeModifier.Operation.ADDITION)).a(false); private static final AttributeModifier DRINKING_SPEED = bz; // Paper - OBFHELPER
|
||||
private static final DataWatcherObject<Boolean> bx = DataWatcher.a(EntityWitch.class, DataWatcherRegistry.i);
|
||||
- private int by;
|
||||
+ private int by; public int getPotionUseTimeLeft() { return by; } public void setPotionUseTimeLeft(int timeLeft) { by = timeLeft; } // Paper - OBFHELPER
|
||||
private PathfinderGoalNearestHealableRaider<EntityRaider> bz;
|
||||
private PathfinderGoalNearestAttackableTargetWitch<EntityHuman> bA;
|
||||
|
||||
@@ -0,0 +0,0 @@ public class EntityWitch extends EntityRaider implements IRangedEntity {
|
||||
return SoundEffects.ENTITY_WITCH_DEATH;
|
||||
}
|
||||
|
||||
+ public void setDrinkingPotion(boolean drinkingPotion) { s(drinkingPotion); } // Paper - OBFHELPER
|
||||
public void s(boolean flag) {
|
||||
this.getDataWatcher().set(EntityWitch.bA, flag);
|
||||
+ public void setDrinkingPotion(boolean drinkingPotion) { t(drinkingPotion); } // Paper - OBFHELPER
|
||||
public void t(boolean flag) {
|
||||
this.getDataWatcher().set(EntityWitch.bx, flag);
|
||||
}
|
||||
|
||||
+ public boolean isDrinkingPotion() { return l(); } // Paper - OBFHELPER
|
||||
public boolean l() {
|
||||
return (Boolean) this.getDataWatcher().get(EntityWitch.bA);
|
||||
return (Boolean) this.getDataWatcher().get(EntityWitch.bx);
|
||||
}
|
||||
@@ -0,0 +0,0 @@ public class EntityWitch extends EntityRaider implements IRangedEntity {
|
||||
}
|
||||
|
@ -67,13 +67,13 @@ index ff4e73fff3..0b849f37c5 100644
|
|||
+// attributeinstance.addModifier(EntityWitch.bz);
|
||||
+ this.setDrinkingPotion(PotionUtil.addPotionToItemStack(new ItemStack(Items.POTION), potionregistry));
|
||||
// Paper end
|
||||
- this.bB = this.getItemInMainHand().k();
|
||||
- this.s(true);
|
||||
- this.world.playSound((EntityHuman) null, this.locX, this.locY, this.locZ, SoundEffects.ENTITY_WITCH_DRINK, this.getSoundCategory(), 1.0F, 0.8F + this.random.nextFloat() * 0.4F);
|
||||
- this.by = this.getItemInMainHand().k();
|
||||
- this.t(true);
|
||||
- this.world.playSound((EntityHuman) null, this.locX(), this.locY(), this.locZ(), SoundEffects.ENTITY_WITCH_DRINK, this.getSoundCategory(), 1.0F, 0.8F + this.random.nextFloat() * 0.4F);
|
||||
- AttributeInstance attributeinstance = this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED);
|
||||
-
|
||||
- attributeinstance.removeModifier(EntityWitch.bz);
|
||||
- attributeinstance.addModifier(EntityWitch.bz);
|
||||
- attributeinstance.removeModifier(EntityWitch.bw);
|
||||
- attributeinstance.addModifier(EntityWitch.bw);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -86,7 +86,7 @@ index ff4e73fff3..0b849f37c5 100644
|
|||
+ setSlot(EnumItemSlot.MAINHAND, CraftItemStack.asNMSCopy(WitchReadyPotionEvent.process((Witch) getBukkitEntity(), CraftItemStack.asCraftMirror(potion))));
|
||||
+ setPotionUseTimeLeft(getItemInMainHand().getItemUseMaxDuration());
|
||||
+ setDrinkingPotion(true);
|
||||
+ world.sendSoundEffect(null, locX, locY, locZ, SoundEffects.ENTITY_WITCH_DRINK, getSoundCategory(), 1.0F, 0.8F + random.nextFloat() * 0.4F);
|
||||
+ world.sendSoundEffect(null, locX(), locY(), locZ(), SoundEffects.ENTITY_WITCH_DRINK, getSoundCategory(), 1.0F, 0.8F + random.nextFloat() * 0.4F);
|
||||
+ AttributeInstance attributeinstance = getAttributeInstance(GenericAttributes.MOVEMENT_SPEED);
|
||||
+ attributeinstance.removeModifier(EntityWitch.DRINKING_SPEED);
|
||||
+ attributeinstance.addModifier(EntityWitch.DRINKING_SPEED);
|
||||
|
@ -94,10 +94,10 @@ index ff4e73fff3..0b849f37c5 100644
|
|||
+ // Paper end
|
||||
+
|
||||
@Override
|
||||
public SoundEffect dV() {
|
||||
public SoundEffect eq() {
|
||||
return SoundEffects.ENTITY_WITCH_CELEBRATE;
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftWitch.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftWitch.java
|
||||
index bae107e76e..b43a2bbd5b 100644
|
||||
index bae107e76..b43a2bbd5 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftWitch.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftWitch.java
|
||||
@@ -0,0 +0,0 @@
|
||||
|
|
|
@ -5,7 +5,7 @@ Subject: [PATCH] Add more Zombie API
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java
|
||||
index 09112a8b0..d00e99cdb 100644
|
||||
index cbaed08f5..6bad1687f 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityInsentient.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityInsentient.java
|
||||
@@ -0,0 +0,0 @@ public abstract class EntityInsentient extends EntityLiving {
|
||||
|
@ -18,11 +18,11 @@ index 09112a8b0..d00e99cdb 100644
|
|||
byte b0 = (Byte) this.datawatcher.get(EntityInsentient.b);
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityZombie.java b/src/main/java/net/minecraft/server/EntityZombie.java
|
||||
index 832375f27..cdaa7f636 100644
|
||||
index c8e4dcdac..1c2c05ae3 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityZombie.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityZombie.java
|
||||
@@ -0,0 +0,0 @@ public class EntityZombie extends EntityMonster {
|
||||
private int bF;
|
||||
private int bC;
|
||||
public int drownedConversionTime;
|
||||
private int lastTick = MinecraftServer.currentTick; // CraftBukkit - add field
|
||||
+ private boolean shouldBurnInDay = true; // Paper
|
||||
|
@ -48,15 +48,15 @@ index 832375f27..cdaa7f636 100644
|
|||
+ }
|
||||
+ // Paper end
|
||||
+
|
||||
protected void ea() {
|
||||
protected void ev() {
|
||||
this.b(EntityTypes.DROWNED);
|
||||
this.world.a((EntityHuman) null, 1040, new BlockPosition(this), 0);
|
||||
@@ -0,0 +0,0 @@ public class EntityZombie extends EntityMonster {
|
||||
}
|
||||
}
|
||||
|
||||
+ public boolean shouldBurnInDay() { return I_(); } // Paper - OBFHELPER
|
||||
protected boolean I_() {
|
||||
+ public boolean shouldBurnInDay() { return K_(); } // Paper - OBFHELPER
|
||||
protected boolean K_() {
|
||||
- return true;
|
||||
+ return shouldBurnInDay;
|
||||
}
|
||||
|
@ -71,8 +71,8 @@ index 832375f27..cdaa7f636 100644
|
|||
public boolean damageEntity(DamageSource damagesource, float f) {
|
||||
if (super.damageEntity(damagesource, f)) {
|
||||
@@ -0,0 +0,0 @@ public class EntityZombie extends EntityMonster {
|
||||
nbttagcompound.setBoolean("CanBreakDoors", this.ed());
|
||||
nbttagcompound.setInt("InWaterTime", this.isInWater() ? this.bF : -1);
|
||||
nbttagcompound.setBoolean("CanBreakDoors", this.ey());
|
||||
nbttagcompound.setInt("InWaterTime", this.isInWater() ? this.bC : -1);
|
||||
nbttagcompound.setInt("DrownedConversionTime", this.isDrownConverting() ? this.drownedConversionTime : -1);
|
||||
+ nbttagcompound.setBoolean("Paper.ShouldBurnInDay", shouldBurnInDay); // Paper
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@ Subject: [PATCH] Add option to disable pillager patrols
|
|||
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
index 3e5571f7d..68d36a512 100644
|
||||
index 8648d9e3d..917dc6253 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
@@ -0,0 +0,0 @@ public class PaperWorldConfig {
|
||||
|
@ -19,7 +19,7 @@ index 3e5571f7d..68d36a512 100644
|
|||
+ }
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/MobSpawnerPatrol.java b/src/main/java/net/minecraft/server/MobSpawnerPatrol.java
|
||||
index a9d32ebdf..44c70e047 100644
|
||||
index 59161143b..f155179ad 100644
|
||||
--- a/src/main/java/net/minecraft/server/MobSpawnerPatrol.java
|
||||
+++ b/src/main/java/net/minecraft/server/MobSpawnerPatrol.java
|
||||
@@ -0,0 +0,0 @@ public class MobSpawnerPatrol {
|
||||
|
|
|
@ -6,12 +6,12 @@ Subject: [PATCH] Add option to prevent players from moving into unloaded
|
|||
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
index 3b24fbdbf..c7ff264cb 100644
|
||||
index fe3e78f36..4bcba0a2b 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
@@ -0,0 +0,0 @@ public class PaperWorldConfig {
|
||||
this.armorStandTick = this.getBoolean("armor-stands-tick", this.armorStandTick);
|
||||
log("ArmorStand ticking is " + (this.armorStandTick ? "enabled" : "disabled") + " by default");
|
||||
waterOverLavaFlowSpeed = getInt("water-over-lava-flow-speed", 5);
|
||||
log("Water over lava flow speed: " + waterOverLavaFlowSpeed);
|
||||
}
|
||||
+
|
||||
+ public boolean preventMovingIntoUnloadedChunks = false;
|
||||
|
@ -20,7 +20,7 @@ index 3b24fbdbf..c7ff264cb 100644
|
|||
+ }
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
index a814d8cae..b0fd4d800 100644
|
||||
index 77c375f71..ccad0a601 100644
|
||||
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
@@ -0,0 +0,0 @@ public class PlayerConnection implements PacketListenerPlayIn {
|
||||
|
@ -38,14 +38,14 @@ index a814d8cae..b0fd4d800 100644
|
|||
// CraftBukkit end
|
||||
PlayerConnection.LOGGER.warn("{} (vehicle of {}) moved too quickly! {},{},{}", entity.getDisplayName().getString(), this.player.getDisplayName().getString(), d6, d7, d8);
|
||||
@@ -0,0 +0,0 @@ public class PlayerConnection implements PacketListenerPlayIn {
|
||||
double d1 = this.player.locY;
|
||||
double d2 = this.player.locZ;
|
||||
double d3 = this.player.locY;
|
||||
- double d4 = packetplayinflying.a(this.player.locX);
|
||||
+ double d4 = packetplayinflying.a(this.player.locX);double toX = d4; // Paper - OBFHELPER
|
||||
double d5 = packetplayinflying.b(this.player.locY);
|
||||
- double d6 = packetplayinflying.c(this.player.locZ);
|
||||
+ double d6 = packetplayinflying.c(this.player.locZ);double toZ = d6; // Paper - OBFHELPER
|
||||
double d1 = this.player.locY();
|
||||
double d2 = this.player.locZ();
|
||||
double d3 = this.player.locY();
|
||||
- double d4 = packetplayinflying.a(this.player.locX());
|
||||
+ double d4 = packetplayinflying.a(this.player.locX());double toX = d4; // Paper - OBFHELPER
|
||||
double d5 = packetplayinflying.b(this.player.locY());
|
||||
- double d6 = packetplayinflying.c(this.player.locZ());
|
||||
+ double d6 = packetplayinflying.c(this.player.locZ());double toZ = d6; // Paper - OBFHELPER
|
||||
float f = packetplayinflying.a(this.player.yaw);
|
||||
float f1 = packetplayinflying.b(this.player.pitch);
|
||||
double d7 = d4 - this.l;
|
||||
|
@ -54,8 +54,8 @@ index a814d8cae..b0fd4d800 100644
|
|||
speed = player.abilities.walkSpeed * 10f;
|
||||
}
|
||||
+ // Paper start - Prevent moving into unloaded chunks
|
||||
+ if (player.world.paperConfig.preventMovingIntoUnloadedChunks && (this.player.locX != toX || this.player.locZ != toZ) && !worldserver.isChunkLoaded((int) Math.floor(toX) >> 4, (int) Math.floor(toZ) >> 4)) {
|
||||
+ this.internalTeleport(this.player.locX, this.player.locY, this.player.locZ, this.player.yaw, this.player.pitch, Collections.emptySet());
|
||||
+ if (player.world.paperConfig.preventMovingIntoUnloadedChunks && (this.player.locX() != toX || this.player.locZ() != toZ) && !worldserver.isChunkLoaded((int) Math.floor(toX) >> 4, (int) Math.floor(toZ) >> 4)) {
|
||||
+ this.internalTeleport(this.player.locX(), this.player.locY(), this.player.locZ(), this.player.yaw, this.player.pitch, Collections.emptySet());
|
||||
+ return;
|
||||
+ }
|
||||
+ // Paper end
|
||||
|
|
|
@ -5,31 +5,31 @@ Subject: [PATCH] Add sun related API
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java
|
||||
index a14d490ade..09112a8b0e 100644
|
||||
index eadac07f6..cbaed08f5 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityInsentient.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityInsentient.java
|
||||
@@ -0,0 +0,0 @@ public abstract class EntityInsentient extends EntityLiving {
|
||||
return flag;
|
||||
}
|
||||
|
||||
+ public boolean isInDaylight() { return this.dS(); } // Paper - OBFHELPER
|
||||
protected boolean dS() {
|
||||
+ public boolean isInDaylight() { return this.en(); } // Paper - OBFHELPER
|
||||
protected boolean en() {
|
||||
if (this.world.J() && !this.world.isClientSide) {
|
||||
float f = this.aF();
|
||||
float f = this.aI();
|
||||
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
|
||||
index c60279da8f..1c3285f5c0 100644
|
||||
index 9c23060bb..8e3367435 100644
|
||||
--- a/src/main/java/net/minecraft/server/World.java
|
||||
+++ b/src/main/java/net/minecraft/server/World.java
|
||||
@@ -0,0 +0,0 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
|
||||
@@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
|
||||
}
|
||||
}
|
||||
|
||||
+ public boolean isDayTime() { return J(); } // Paper - OBFHELPER
|
||||
public boolean J() {
|
||||
return this.u < 4;
|
||||
return this.worldProvider.getDimensionManager() == DimensionManager.OVERWORLD && this.c < 4;
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
index dc0a07c7cd..78a2c47c5a 100644
|
||||
index 182322752..578fe8d19 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
@@ -0,0 +0,0 @@ public class CraftWorld implements World {
|
||||
|
@ -47,7 +47,7 @@ index dc0a07c7cd..78a2c47c5a 100644
|
|||
public boolean createExplosion(double x, double y, double z, float power) {
|
||||
return createExplosion(x, y, z, power, false, true);
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java
|
||||
index 53c2d154ed..56c233872b 100644
|
||||
index 53c2d154e..56c233872 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java
|
||||
@@ -0,0 +0,0 @@ public abstract class CraftMob extends CraftLivingEntity implements Mob {
|
||||
|
|
|
@ -1,508 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Aikar <aikar@aikar.co>
|
||||
Date: Fri, 15 Feb 2019 01:08:19 -0500
|
||||
Subject: [PATCH] Allow Saving of Oversized Chunks
|
||||
|
||||
The Minecraft World Region File format has a hard cap of 1MB per chunk.
|
||||
This is due to the fact that the header of the file format only allocates
|
||||
a single byte for sector count, meaning a maximum of 256 sectors, at 4k per sector.
|
||||
|
||||
This limit can be reached fairly easily with books, resulting in the chunk being unable
|
||||
to save to the world. Worse off, is that nothing printed when this occured, and silently
|
||||
performed a chunk rollback on next load.
|
||||
|
||||
This leads to security risk with duplication and is being actively exploited.
|
||||
|
||||
This patch catches the too large scenario, falls back and moves any large Entity
|
||||
or Tile Entity into a new compound, and this compound is saved into a different file.
|
||||
|
||||
On Chunk Load, we check for oversized status, and if so, we load the extra file and
|
||||
merge the Entities and Tile Entities from the oversized chunk back into the level to
|
||||
then be loaded as normal.
|
||||
|
||||
Once a chunk is returned back to normal size, the oversized flag will clear, and no
|
||||
extra data file will exist.
|
||||
|
||||
This fix maintains compatability with all existing Anvil Region Format tools as it
|
||||
does not alter the save format. They will just not know about the extra entities.
|
||||
|
||||
This fix also maintains compatability if someone switches server jars to one without
|
||||
this fix, as the data will remain in the oversized file. Once the server returns
|
||||
to a jar with this fix, the data will be restored.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/NBTCompressedStreamTools.java b/src/main/java/net/minecraft/server/NBTCompressedStreamTools.java
|
||||
index 9fd8a75da..d49afd622 100644
|
||||
--- a/src/main/java/net/minecraft/server/NBTCompressedStreamTools.java
|
||||
+++ b/src/main/java/net/minecraft/server/NBTCompressedStreamTools.java
|
||||
@@ -0,0 +0,0 @@ public class NBTCompressedStreamTools {
|
||||
|
||||
}
|
||||
|
||||
+ public static NBTTagCompound readNBT(DataInputStream datainputstream) throws IOException { return a(datainputstream); } // Paper - OBFHELPER
|
||||
public static NBTTagCompound a(DataInputStream datainputstream) throws IOException {
|
||||
return a((DataInput) datainputstream, NBTReadLimiter.a);
|
||||
}
|
||||
@@ -0,0 +0,0 @@ public class NBTCompressedStreamTools {
|
||||
}
|
||||
}
|
||||
|
||||
+ public static void writeNBT(NBTTagCompound nbttagcompound, DataOutput dataoutput) throws IOException { a(nbttagcompound, dataoutput); } // Paper - OBFHELPER
|
||||
public static void a(NBTTagCompound nbttagcompound, DataOutput dataoutput) throws IOException {
|
||||
a((NBTBase) nbttagcompound, dataoutput);
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/NBTTagList.java b/src/main/java/net/minecraft/server/NBTTagList.java
|
||||
index b7c94fe23..80eea5dfb 100644
|
||||
--- a/src/main/java/net/minecraft/server/NBTTagList.java
|
||||
+++ b/src/main/java/net/minecraft/server/NBTTagList.java
|
||||
@@ -0,0 +0,0 @@ import java.util.Objects;
|
||||
|
||||
public class NBTTagList extends NBTList<NBTBase> {
|
||||
|
||||
- private List<NBTBase> list = Lists.newArrayList();
|
||||
+ List<NBTBase> list = Lists.newArrayList(); // Paper - private -> package
|
||||
private byte type = 0;
|
||||
|
||||
public NBTTagList() {}
|
||||
diff --git a/src/main/java/net/minecraft/server/RegionFile.java b/src/main/java/net/minecraft/server/RegionFile.java
|
||||
index e90ef45ee..ccc3d6c7a 100644
|
||||
--- a/src/main/java/net/minecraft/server/RegionFile.java
|
||||
+++ b/src/main/java/net/minecraft/server/RegionFile.java
|
||||
@@ -0,0 +0,0 @@ public class RegionFile implements AutoCloseable {
|
||||
// Minecraft is limited to 256 sections per chunk. So 1MB. This can easily be overriden.
|
||||
// So we extend this to use the REAL size when the count is maxed by seeking to that section and reading the length.
|
||||
private static final boolean ENABLE_EXTENDED_SAVE = Boolean.parseBoolean(System.getProperty("net.minecraft.server.RegionFile.enableExtendedSave", "true"));
|
||||
- private final File file;
|
||||
+ final File file; // Paper - private -> package
|
||||
// Spigot end
|
||||
private static final byte[] a = new byte[4096];
|
||||
private final RandomAccessFile b; private RandomAccessFile getDataFile() { return this.b; } // Paper - OBFHELPER // PAIL dataFile
|
||||
@@ -0,0 +0,0 @@ public class RegionFile implements AutoCloseable {
|
||||
|
||||
public RegionFile(File file) throws IOException {
|
||||
this.b = new RandomAccessFile(file, "rw");
|
||||
+ this.file = file; // Spigot // Paper - We need this earlier
|
||||
if (this.b.length() < 8192L) { // Paper - headers should be 8192
|
||||
this.b.write(RegionFile.a);
|
||||
this.b.write(RegionFile.a);
|
||||
@@ -0,0 +0,0 @@ public class RegionFile implements AutoCloseable {
|
||||
}
|
||||
((java.nio.Buffer) header).clear();
|
||||
java.nio.IntBuffer headerAsInts = header.asIntBuffer();
|
||||
+ initOversizedState();
|
||||
// Paper End
|
||||
|
||||
int k;
|
||||
@@ -0,0 +0,0 @@ public class RegionFile implements AutoCloseable {
|
||||
this.b.seek(j * 4 + 4); // Go back to where we were
|
||||
}
|
||||
}
|
||||
- if (k > 0 && (k >> 8) > 1 && (k >> 8) + (k & 255) <= this.e.size()) { // Paper >= 1 as 0/1 are the headers, and negative isnt valid
|
||||
+ if (k > 0 && (k >> 8) > 1 && (k >> 8) + (length) <= this.e.size()) { // Paper >= 1 as 0/1 are the headers, and negative isnt valid
|
||||
for (int l = 0; l < (length); ++l) {
|
||||
// Spigot end
|
||||
this.e.set((k >> 8) + l, false);
|
||||
@@ -0,0 +0,0 @@ public class RegionFile implements AutoCloseable {
|
||||
if (this.offsets[j] != 0) this.timestamps[j] = k; // Paper - don't set timestamp if it got 0'd above due to corruption
|
||||
}
|
||||
|
||||
- this.file = file; // Spigot
|
||||
+ // Paper - we need this earlier
|
||||
}
|
||||
|
||||
@Nullable
|
||||
- public synchronized DataInputStream a(ChunkCoordIntPair chunkcoordintpair) {
|
||||
+ public synchronized DataInputStream getReadStream(ChunkCoordIntPair chunkcoordintpair) { return this.a(chunkcoordintpair); } public synchronized DataInputStream a(ChunkCoordIntPair chunkcoordintpair) { // Paper - OBFHELPER
|
||||
try {
|
||||
int i = this.getOffset(chunkcoordintpair);
|
||||
|
||||
@@ -0,0 +0,0 @@ public class RegionFile implements AutoCloseable {
|
||||
}
|
||||
}
|
||||
|
||||
- public DataOutputStream c(ChunkCoordIntPair chunkcoordintpair) {
|
||||
- return new DataOutputStream(new BufferedOutputStream(new DeflaterOutputStream(new RegionFile.ChunkBuffer(chunkcoordintpair))));
|
||||
+ public DataOutputStream getWriteStream(ChunkCoordIntPair chunkcoordintpair) { return this.c(chunkcoordintpair); } public DataOutputStream c(ChunkCoordIntPair chunkcoordintpair) { // Paper - OBFHELPER
|
||||
+ return new DataOutputStream(new RegionFile.ChunkBuffer(chunkcoordintpair)); // Paper - remove middleware, move deflate to .close() for dynamic levels
|
||||
}
|
||||
|
||||
protected synchronized void a(ChunkCoordIntPair chunkcoordintpair, byte[] abyte, int i) {
|
||||
@@ -0,0 +0,0 @@ public class RegionFile implements AutoCloseable {
|
||||
|
||||
if (i1 >= 256) {
|
||||
// Spigot start
|
||||
- if (!ENABLE_EXTENDED_SAVE) throw new RuntimeException(String.format("Too big to save, %d > 1048576", i));
|
||||
+ if (!USE_SPIGOT_OVERSIZED_METHOD && !RegionFileCache.isOverzealous()) throw new ChunkTooLargeException(chunkcoordintpair.x, chunkcoordintpair.z, l); // Paper - throw error instead
|
||||
org.bukkit.Bukkit.getLogger().log(java.util.logging.Level.WARNING,"Large Chunk Detected: ({0}) Size: {1} {2}", new Object[]{chunkcoordintpair, i1, this.file});
|
||||
+ if (!ENABLE_EXTENDED_SAVE) throw new RuntimeException(String.format("Too big to save, %d > 1048576", i)); // Paper - move after our check
|
||||
// Spigot end
|
||||
}
|
||||
|
||||
@@ -0,0 +0,0 @@ public class RegionFile implements AutoCloseable {
|
||||
logger.error("Error backing up corrupt file" + file.getAbsolutePath(), e);
|
||||
}
|
||||
}
|
||||
+
|
||||
+ private final byte[] oversized = new byte[1024];
|
||||
+ private int oversizedCount = 0;
|
||||
+
|
||||
+ private synchronized void initOversizedState() throws IOException {
|
||||
+ File metaFile = getOversizedMetaFile();
|
||||
+ if (metaFile.exists()) {
|
||||
+ final byte[] read = java.nio.file.Files.readAllBytes(metaFile.toPath());
|
||||
+ System.arraycopy(read, 0, oversized, 0, oversized.length);
|
||||
+ for (byte temp : oversized) {
|
||||
+ oversizedCount += temp;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ private static int getChunkIndex(int x, int z) {
|
||||
+ return (x & 31) + (z & 31) * 32;
|
||||
+ }
|
||||
+ synchronized boolean isOversized(int x, int z) {
|
||||
+ return this.oversized[getChunkIndex(x, z)] == 1;
|
||||
+ }
|
||||
+ synchronized void setOversized(int x, int z, boolean oversized) throws IOException {
|
||||
+ final int offset = getChunkIndex(x, z);
|
||||
+ boolean previous = this.oversized[offset] == 1;
|
||||
+ this.oversized[offset] = (byte) (oversized ? 1 : 0);
|
||||
+ if (!previous && oversized) {
|
||||
+ oversizedCount++;
|
||||
+ } else if (!oversized && previous) {
|
||||
+ oversizedCount--;
|
||||
+ }
|
||||
+ if (previous && !oversized) {
|
||||
+ File oversizedFile = getOversizedFile(x, z);
|
||||
+ if (oversizedFile.exists()) {
|
||||
+ oversizedFile.delete();
|
||||
+ }
|
||||
+ }
|
||||
+ if (oversizedCount > 0) {
|
||||
+ if (previous != oversized) {
|
||||
+ writeOversizedMeta();
|
||||
+ }
|
||||
+ } else if (previous) {
|
||||
+ File oversizedMetaFile = getOversizedMetaFile();
|
||||
+ if (oversizedMetaFile.exists()) {
|
||||
+ oversizedMetaFile.delete();
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ private void writeOversizedMeta() throws IOException {
|
||||
+ java.nio.file.Files.write(getOversizedMetaFile().toPath(), oversized);
|
||||
+ }
|
||||
+
|
||||
+ private File getOversizedMetaFile() {
|
||||
+ return new File(this.file.getParentFile(), this.file.getName().replaceAll("\\.mca$", "") + ".oversized.nbt");
|
||||
+ }
|
||||
+
|
||||
+ private File getOversizedFile(int x, int z) {
|
||||
+ return new File(this.file.getParentFile(), this.file.getName().replaceAll("\\.mca$", "") + "_oversized_" + x + "_" + z + ".nbt");
|
||||
+ }
|
||||
+
|
||||
+ void writeOversizedData(int x, int z, NBTTagCompound oversizedData) throws IOException {
|
||||
+ File file = getOversizedFile(x, z);
|
||||
+ try (DataOutputStream out = new DataOutputStream(new BufferedOutputStream(new DeflaterOutputStream(new java.io.FileOutputStream(file), new java.util.zip.Deflater(java.util.zip.Deflater.BEST_COMPRESSION), 32 * 1024), 32 * 1024))) {
|
||||
+ NBTCompressedStreamTools.writeNBT(oversizedData, out);
|
||||
+ }
|
||||
+ this.setOversized(x, z, true);
|
||||
+
|
||||
+ }
|
||||
+
|
||||
+ synchronized NBTTagCompound getOversizedData(int x, int z) throws IOException {
|
||||
+ File file = getOversizedFile(x, z);
|
||||
+ try (DataInputStream out = new DataInputStream(new BufferedInputStream(new InflaterInputStream(new java.io.FileInputStream(file))))) {
|
||||
+ return NBTCompressedStreamTools.readNBT(out);
|
||||
+ }
|
||||
+
|
||||
+ }
|
||||
+
|
||||
+ private static final boolean USE_SPIGOT_OVERSIZED_METHOD = Boolean.getBoolean("Paper.useSpigotExtendedSaveMethod"); // Paper
|
||||
+ static {
|
||||
+ if (USE_SPIGOT_OVERSIZED_METHOD) {
|
||||
+ org.bukkit.Bukkit.getLogger().log(java.util.logging.Level.SEVERE, "====================================");
|
||||
+ org.bukkit.Bukkit.getLogger().log(java.util.logging.Level.SEVERE, "Using Spigot Oversized Chunk save method. Warning this will result in extremely fragmented chunks, as well as making the entire region file unable to be to used in any other software but Forge or Spigot (not usable in Vanilla or CraftBukkit). Paper's method is highly recommended.");
|
||||
+ org.bukkit.Bukkit.getLogger().log(java.util.logging.Level.SEVERE, "====================================");
|
||||
+ }
|
||||
+ }
|
||||
+ public class ChunkTooLargeException extends RuntimeException {
|
||||
+ public ChunkTooLargeException(int x, int z, int sectors) {
|
||||
+ super("Chunk " + x + "," + z + " of " + RegionFile.this.file.toString() + " is too large (" + sectors + "/255)");
|
||||
+ }
|
||||
+ }
|
||||
+ private static class DirectByteArrayOutputStream extends ByteArrayOutputStream {
|
||||
+ public DirectByteArrayOutputStream() {
|
||||
+ super();
|
||||
+ }
|
||||
+
|
||||
+ public DirectByteArrayOutputStream(int size) {
|
||||
+ super(size);
|
||||
+ }
|
||||
+
|
||||
+ public byte[] getBuffer() {
|
||||
+ return this.buf;
|
||||
+ }
|
||||
+ }
|
||||
// Paper end
|
||||
|
||||
class ChunkBuffer extends ByteArrayOutputStream {
|
||||
@@ -0,0 +0,0 @@ public class RegionFile implements AutoCloseable {
|
||||
this.b = chunkcoordintpair;
|
||||
}
|
||||
|
||||
- public void close() {
|
||||
- RegionFile.this.a(this.b, this.buf, this.count);
|
||||
+ public void close() throws IOException {
|
||||
+ // Paper start - apply dynamic compression
|
||||
+ int origLength = this.count;
|
||||
+ byte[] buf = this.buf;
|
||||
+ DirectByteArrayOutputStream out = compressData(buf, origLength);
|
||||
+ byte[] bytes = out.getBuffer();
|
||||
+ int length = out.size();
|
||||
+
|
||||
+ RegionFile.this.a(this.b, bytes, length); // Paper - change to bytes/length
|
||||
}
|
||||
}
|
||||
+
|
||||
+ private static final byte[] compressionBuffer = new byte[1024 * 64]; // 64k fits most standard chunks input size even, ideally 1 pass through zlib
|
||||
+ private static final java.util.zip.Deflater deflater = new java.util.zip.Deflater();
|
||||
+ // since file IO is single threaded, no benefit to using per-region file buffers/synchronization, we can change that later if it becomes viable.
|
||||
+ private static DirectByteArrayOutputStream compressData(byte[] buf, int length) throws IOException {
|
||||
+ synchronized (deflater) {
|
||||
+ deflater.setInput(buf, 0, length);
|
||||
+ deflater.finish();
|
||||
+
|
||||
+ DirectByteArrayOutputStream out = new DirectByteArrayOutputStream(length);
|
||||
+ while (!deflater.finished()) {
|
||||
+ out.write(compressionBuffer, 0, deflater.deflate(compressionBuffer));
|
||||
+ }
|
||||
+ out.close();
|
||||
+ deflater.reset();
|
||||
+ return out;
|
||||
+ }
|
||||
+ }
|
||||
+ // Paper end
|
||||
+
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/RegionFileCache.java b/src/main/java/net/minecraft/server/RegionFileCache.java
|
||||
index 871881165..c53518a47 100644
|
||||
--- a/src/main/java/net/minecraft/server/RegionFileCache.java
|
||||
+++ b/src/main/java/net/minecraft/server/RegionFileCache.java
|
||||
@@ -0,0 +0,0 @@ public abstract class RegionFileCache implements AutoCloseable {
|
||||
// Paper start
|
||||
}
|
||||
|
||||
+ public RegionFile getRegionFile(ChunkCoordIntPair chunkcoordintpair, boolean existingOnly) throws IOException { return this.a(chunkcoordintpair, existingOnly); } // Paper - OBFHELPER
|
||||
private RegionFile a(ChunkCoordIntPair chunkcoordintpair, boolean existingOnly) throws IOException { // CraftBukkit
|
||||
long i = ChunkCoordIntPair.pair(chunkcoordintpair.getRegionX(), chunkcoordintpair.getRegionZ());
|
||||
RegionFile regionfile = (RegionFile) this.cache.getAndMoveToFirst(i);
|
||||
@@ -0,0 +0,0 @@ public abstract class RegionFileCache implements AutoCloseable {
|
||||
public synchronized boolean hasRegionFile(File file, int i, int j) {
|
||||
return cache.containsKey(ChunkCoordIntPair.pair(i, j));
|
||||
}
|
||||
+ // Paper start
|
||||
+ private static void printOversizedLog(String msg, File file, int x, int z) {
|
||||
+ org.apache.logging.log4j.LogManager.getLogger().fatal(msg + " (" + file.toString().replaceAll(".+[\\\\/]", "") + " - " + x + "," + z + ") Go clean it up to remove this message. /minecraft:tp " + (x<<4)+" 128 "+(z<<4) + " - DO NOT REPORT THIS TO PAPER - You may ask for help on Discord, but do not file an issue. These error messages can not be removed.");
|
||||
+ }
|
||||
+
|
||||
+ private static final int DEFAULT_SIZE_THRESHOLD = 1024 * 8;
|
||||
+ private static final int OVERZEALOUS_TOTAL_THRESHOLD = 1024 * 64;
|
||||
+ private static final int OVERZEALOUS_THRESHOLD = 1024;
|
||||
+ private static int SIZE_THRESHOLD = DEFAULT_SIZE_THRESHOLD;
|
||||
+ private static void resetFilterThresholds() {
|
||||
+ SIZE_THRESHOLD = Math.max(1024 * 4, Integer.getInteger("Paper.FilterThreshhold", DEFAULT_SIZE_THRESHOLD));
|
||||
+ }
|
||||
+ static {
|
||||
+ resetFilterThresholds();
|
||||
+ }
|
||||
+
|
||||
+ static boolean isOverzealous() {
|
||||
+ return SIZE_THRESHOLD == OVERZEALOUS_THRESHOLD;
|
||||
+ }
|
||||
+
|
||||
+ private void writeRegion(ChunkCoordIntPair chunk, NBTTagCompound nbttagcompound) throws IOException {
|
||||
+ RegionFile regionfile = getRegionFile(chunk, false);
|
||||
+
|
||||
+ int chunkX = chunk.x;
|
||||
+ int chunkZ = chunk.z;
|
||||
+
|
||||
+ DataOutputStream out = regionfile.getWriteStream(chunk);
|
||||
+ try {
|
||||
+ NBTCompressedStreamTools.writeNBT(nbttagcompound, out);
|
||||
+ out.close();
|
||||
+ regionfile.setOversized(chunkX, chunkZ, false);
|
||||
+ } catch (RegionFile.ChunkTooLargeException ignored) {
|
||||
+ printOversizedLog("ChunkTooLarge! Someone is trying to duplicate.", regionfile.file, chunkX, chunkZ);
|
||||
+ // Clone as we are now modifying it, don't want to corrupt the pending save state
|
||||
+ nbttagcompound = nbttagcompound.clone();
|
||||
+ // Filter out TileEntities and Entities
|
||||
+ NBTTagCompound oversizedData = filterChunkData(nbttagcompound);
|
||||
+ //noinspection SynchronizationOnLocalVariableOrMethodParameter
|
||||
+ synchronized (regionfile) {
|
||||
+ out = regionfile.getWriteStream(chunk);
|
||||
+ NBTCompressedStreamTools.writeNBT(nbttagcompound, out);
|
||||
+ try {
|
||||
+ out.close();
|
||||
+ // 2048 is below the min allowed, so it means we enter overzealous mode below
|
||||
+ if (SIZE_THRESHOLD == OVERZEALOUS_THRESHOLD) {
|
||||
+ resetFilterThresholds();
|
||||
+ }
|
||||
+ } catch (RegionFile.ChunkTooLargeException e) {
|
||||
+ printOversizedLog("ChunkTooLarge even after reduction. Trying in overzealous mode.", regionfile.file, chunkX, chunkZ);
|
||||
+ // Eek, major fail. We have retry logic, so reduce threshholds and fall back
|
||||
+ SIZE_THRESHOLD = OVERZEALOUS_THRESHOLD;
|
||||
+ throw e;
|
||||
+ }
|
||||
+
|
||||
+ regionfile.writeOversizedData(chunkX, chunkZ, oversizedData);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ private static NBTTagCompound filterChunkData(NBTTagCompound chunk) {
|
||||
+ NBTTagCompound oversizedLevel = new NBTTagCompound();
|
||||
+ NBTTagCompound level = chunk.getCompound("Level");
|
||||
+ filterChunkList(level, oversizedLevel, "Entities");
|
||||
+ filterChunkList(level, oversizedLevel, "TileEntities");
|
||||
+ NBTTagCompound oversized = new NBTTagCompound();
|
||||
+ oversized.set("Level", oversizedLevel);
|
||||
+ return oversized;
|
||||
+ }
|
||||
+
|
||||
+ private static void filterChunkList(NBTTagCompound level, NBTTagCompound extra, String key) {
|
||||
+ NBTTagList list = level.getList(key, 10);
|
||||
+ NBTTagList newList = extra.getList(key, 10);
|
||||
+ int totalSize = 0;
|
||||
+ for (java.util.Iterator<NBTBase> iterator = list.list.iterator(); iterator.hasNext();) {
|
||||
+ NBTBase object = iterator.next();
|
||||
+ int nbtSize = getNBTSize(object);
|
||||
+ if (nbtSize > SIZE_THRESHOLD || (SIZE_THRESHOLD == OVERZEALOUS_THRESHOLD && totalSize > OVERZEALOUS_TOTAL_THRESHOLD)) {
|
||||
+ newList.add(object);
|
||||
+ iterator.remove();
|
||||
+ } else {
|
||||
+ totalSize += nbtSize;
|
||||
+ }
|
||||
+ }
|
||||
+ level.set(key, list);
|
||||
+ extra.set(key, newList);
|
||||
+ }
|
||||
+
|
||||
+
|
||||
+ private static NBTTagCompound readOversizedChunk(RegionFile regionfile, ChunkCoordIntPair chunkCoordinate) throws IOException {
|
||||
+ synchronized (regionfile) {
|
||||
+ try (DataInputStream datainputstream = regionfile.getReadStream(chunkCoordinate)) {
|
||||
+ NBTTagCompound oversizedData = regionfile.getOversizedData(chunkCoordinate.x, chunkCoordinate.z);
|
||||
+ NBTTagCompound chunk = NBTCompressedStreamTools.readNBT(datainputstream);
|
||||
+ if (oversizedData == null) {
|
||||
+ return chunk;
|
||||
+ }
|
||||
+ NBTTagCompound oversizedLevel = oversizedData.getCompound("Level");
|
||||
+ NBTTagCompound level = chunk.getCompound("Level");
|
||||
+
|
||||
+ mergeChunkList(level, oversizedLevel, "Entities");
|
||||
+ mergeChunkList(level, oversizedLevel, "TileEntities");
|
||||
+
|
||||
+ chunk.set("Level", level);
|
||||
+
|
||||
+ return chunk;
|
||||
+ } catch (Throwable throwable) {
|
||||
+ throwable.printStackTrace();
|
||||
+ throw throwable;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ private static void mergeChunkList(NBTTagCompound level, NBTTagCompound oversizedLevel, String key) {
|
||||
+ NBTTagList levelList = level.getList(key, 10);
|
||||
+ NBTTagList oversizedList = oversizedLevel.getList(key, 10);
|
||||
+
|
||||
+ if (!oversizedList.isEmpty()) {
|
||||
+ levelList.addAll(oversizedList);
|
||||
+ level.set(key, levelList);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ private static int getNBTSize(NBTBase nbtBase) {
|
||||
+ DataOutputStream test = new DataOutputStream(new org.apache.commons.io.output.NullOutputStream());
|
||||
+ try {
|
||||
+ nbtBase.write(test);
|
||||
+ return test.size();
|
||||
+ } catch (IOException e) {
|
||||
+ e.printStackTrace();
|
||||
+ return 0;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
// Paper End
|
||||
|
||||
@Nullable
|
||||
public NBTTagCompound read(ChunkCoordIntPair chunkcoordintpair) throws IOException {
|
||||
RegionFile regionfile = this.a(chunkcoordintpair, false); // CraftBukkit
|
||||
DataInputStream datainputstream = regionfile.a(chunkcoordintpair);
|
||||
+ // Paper start
|
||||
+ if (regionfile.isOversized(chunkcoordintpair.x, chunkcoordintpair.z)) {
|
||||
+ printOversizedLog("Loading Oversized Chunk!", regionfile.file, chunkcoordintpair.x, chunkcoordintpair.z);
|
||||
+ return readOversizedChunk(regionfile, chunkcoordintpair);
|
||||
+ }
|
||||
+ // Paper end
|
||||
Throwable throwable = null;
|
||||
|
||||
NBTTagCompound nbttagcompound;
|
||||
@@ -0,0 +0,0 @@ public abstract class RegionFileCache implements AutoCloseable {
|
||||
|
||||
protected void write(ChunkCoordIntPair chunkcoordintpair, NBTTagCompound nbttagcompound) throws IOException {
|
||||
int attempts = 0; Exception laste = null; while (attempts++ < 5) { try { // Paper
|
||||
- RegionFile regionfile = this.a(chunkcoordintpair, false); // CraftBukkit
|
||||
- DataOutputStream dataoutputstream = regionfile.c(chunkcoordintpair);
|
||||
- Throwable throwable = null;
|
||||
-
|
||||
- try {
|
||||
- NBTCompressedStreamTools.a(nbttagcompound, (DataOutput) dataoutputstream);
|
||||
- } catch (Throwable throwable1) {
|
||||
- throwable = throwable1;
|
||||
- throw throwable1;
|
||||
- } finally {
|
||||
- if (dataoutputstream != null) {
|
||||
- if (throwable != null) {
|
||||
- try {
|
||||
- dataoutputstream.close();
|
||||
- } catch (Throwable throwable2) {
|
||||
- throwable.addSuppressed(throwable2);
|
||||
- }
|
||||
- } else {
|
||||
- dataoutputstream.close();
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- }
|
||||
+ // Paper start
|
||||
+ this.writeRegion(chunkcoordintpair, nbttagcompound);
|
||||
+// RegionFile regionfile = this.a(chunkcoordintpair, false); // CraftBukkit
|
||||
+// DataOutputStream dataoutputstream = regionfile.c(chunkcoordintpair);
|
||||
+// Throwable throwable = null;
|
||||
+//
|
||||
+// try {
|
||||
+// NBTCompressedStreamTools.a(nbttagcompound, (DataOutput) dataoutputstream);
|
||||
+// } catch (Throwable throwable1) {
|
||||
+// throwable = throwable1;
|
||||
+// throw throwable1;
|
||||
+// } finally {
|
||||
+// if (dataoutputstream != null) {
|
||||
+// if (throwable != null) {
|
||||
+// try {
|
||||
+// dataoutputstream.close();
|
||||
+// } catch (Throwable throwable2) {
|
||||
+// throwable.addSuppressed(throwable2);
|
||||
+// }
|
||||
+// } else {
|
||||
+// dataoutputstream.close();
|
||||
+// }
|
||||
+// }
|
||||
+//
|
||||
+// }
|
||||
+ // Paper end
|
||||
|
||||
// Paper start
|
||||
return;
|
||||
--
|
|
@ -5,7 +5,7 @@ Subject: [PATCH] Allow chests to be placed with NBT data
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java
|
||||
index 1e23d77e72..0e164840fd 100644
|
||||
index 627fa465c..df85f9df0 100644
|
||||
--- a/src/main/java/net/minecraft/server/ItemStack.java
|
||||
+++ b/src/main/java/net/minecraft/server/ItemStack.java
|
||||
@@ -0,0 +0,0 @@ public final class ItemStack {
|
||||
|
@ -17,7 +17,7 @@ index 1e23d77e72..0e164840fd 100644
|
|||
for (BlockState blockstate : blocks) {
|
||||
blockstate.update(true, false);
|
||||
diff --git a/src/main/java/net/minecraft/server/TileEntityChest.java b/src/main/java/net/minecraft/server/TileEntityChest.java
|
||||
index 387e366130..6c10f0eb89 100644
|
||||
index c4766f729..b22bd06e2 100644
|
||||
--- a/src/main/java/net/minecraft/server/TileEntityChest.java
|
||||
+++ b/src/main/java/net/minecraft/server/TileEntityChest.java
|
||||
@@ -0,0 +0,0 @@ public class TileEntityChest extends TileEntityLootable { // Paper - Remove ITic
|
||||
|
|
|
@ -5,7 +5,7 @@ Subject: [PATCH] Allow setting the vex's summoner
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityVex.java b/src/main/java/net/minecraft/server/EntityVex.java
|
||||
index 25aea53150..51c05376da 100644
|
||||
index a46730460..cf274666c 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityVex.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityVex.java
|
||||
@@ -0,0 +0,0 @@ public class EntityVex extends EntityMonster {
|
||||
|
@ -17,7 +17,7 @@ index 25aea53150..51c05376da 100644
|
|||
this.c = entityinsentient;
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftVex.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftVex.java
|
||||
index 169c951ec3..2f7df3074f 100644
|
||||
index 169c951ec..2f7df3074 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftVex.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftVex.java
|
||||
@@ -0,0 +0,0 @@ public class CraftVex extends CraftMonster implements Vex {
|
||||
|
|
|
@ -5,7 +5,7 @@ Subject: [PATCH] Anti-Xray
|
|||
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
index 55b78f54c..cfc4156bc 100644
|
||||
index f5ed0a698..363676348 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
@@ -0,0 +0,0 @@
|
||||
|
@ -1181,7 +1181,7 @@ index 000000000..37093419c
|
|||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
|
||||
index 2003522d9..d604f96c1 100644
|
||||
index 14ec31f0a..863a2222f 100644
|
||||
--- a/src/main/java/net/minecraft/server/Chunk.java
|
||||
+++ b/src/main/java/net/minecraft/server/Chunk.java
|
||||
@@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess {
|
||||
|
@ -1194,7 +1194,7 @@ index 2003522d9..d604f96c1 100644
|
|||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
|
||||
index 73f93e494..a02807411 100644
|
||||
index 6371f2f5b..17cacafe7 100644
|
||||
--- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java
|
||||
+++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
|
||||
@@ -0,0 +0,0 @@ public class ChunkRegionLoader {
|
||||
|
@ -1213,10 +1213,10 @@ index 73f93e494..a02807411 100644
|
|||
- ProtoChunk protochunk = new ProtoChunk(chunkcoordintpair, chunkconverter, achunksection, protochunkticklist, protochunkticklist1);
|
||||
+ ProtoChunk protochunk = new ProtoChunk(chunkcoordintpair, chunkconverter, achunksection, protochunkticklist, protochunkticklist1, worldserver); // Paper - Anti-Xray
|
||||
|
||||
protochunk.a(biomestorage);
|
||||
object = protochunk;
|
||||
protochunk.a(abiomebase);
|
||||
diff --git a/src/main/java/net/minecraft/server/ChunkSection.java b/src/main/java/net/minecraft/server/ChunkSection.java
|
||||
index ca2bf8b77..584b3e639 100644
|
||||
index 0d5deee36..4526527ac 100644
|
||||
--- a/src/main/java/net/minecraft/server/ChunkSection.java
|
||||
+++ b/src/main/java/net/minecraft/server/ChunkSection.java
|
||||
@@ -0,0 +0,0 @@ public class ChunkSection {
|
||||
|
@ -1227,7 +1227,7 @@ index ca2bf8b77..584b3e639 100644
|
|||
+ short nonEmptyBlockCount; // Paper - private -> package-private
|
||||
private short tickingBlockCount;
|
||||
private short e;
|
||||
final DataPaletteBlock<IBlockData> blockIds; // Paper - package
|
||||
final DataPaletteBlock<IBlockData> blockIds;
|
||||
|
||||
public ChunkSection(int i) {
|
||||
- this(i, (short) 0, (short) 0, (short) 0);
|
||||
|
@ -1255,7 +1255,7 @@ index ca2bf8b77..584b3e639 100644
|
|||
|
||||
public IBlockData getType(int i, int j, int k) {
|
||||
diff --git a/src/main/java/net/minecraft/server/DataPaletteBlock.java b/src/main/java/net/minecraft/server/DataPaletteBlock.java
|
||||
index 1e2bca1e0..8fba1e2f3 100644
|
||||
index 2c1d1b1a5..44aed6727 100644
|
||||
--- a/src/main/java/net/minecraft/server/DataPaletteBlock.java
|
||||
+++ b/src/main/java/net/minecraft/server/DataPaletteBlock.java
|
||||
@@ -0,0 +0,0 @@ package net.minecraft.server;
|
||||
|
@ -1440,7 +1440,7 @@ index e156804f7..96a785af2 100644
|
|||
public void a() {
|
||||
this.o();
|
||||
diff --git a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java b/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java
|
||||
index ef71a1feb..483317608 100644
|
||||
index 47710067a..654474341 100644
|
||||
--- a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java
|
||||
+++ b/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java
|
||||
@@ -0,0 +0,0 @@
|
||||
|
@ -1451,9 +1451,9 @@ index ef71a1feb..483317608 100644
|
|||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.buffer.Unpooled;
|
||||
@@ -0,0 +0,0 @@ public class PacketPlayOutMapChunk implements Packet<PacketListenerPlayOut> {
|
||||
private byte[] e; private byte[] getData() { return this.e; } // Paper - OBFHELPER
|
||||
private List<NBTTagCompound> f;
|
||||
private boolean g;
|
||||
private byte[] f; private byte[] getData() { return this.f; } // Paper - OBFHELPER
|
||||
private List<NBTTagCompound> g;
|
||||
private boolean h;
|
||||
+ private volatile boolean ready; // Paper - Async-Anti-Xray - Ready flag for the network manager
|
||||
|
||||
- public PacketPlayOutMapChunk() {}
|
||||
|
@ -1479,37 +1479,33 @@ index ef71a1feb..483317608 100644
|
|||
@@ -0,0 +0,0 @@ public class PacketPlayOutMapChunk implements Packet<PacketListenerPlayOut> {
|
||||
}
|
||||
|
||||
this.e = new byte[this.a(chunk, i)];
|
||||
- this.c = this.a(new PacketDataSerializer(this.i()), chunk, i);
|
||||
this.f = new byte[this.a(chunk, i)];
|
||||
- this.c = this.a(new PacketDataSerializer(this.j()), chunk, i);
|
||||
+ // Paper start - Anti-Xray - Add chunk packet info
|
||||
+ if (chunkPacketInfo != null) {
|
||||
+ chunkPacketInfo.setData(this.getData());
|
||||
+ }
|
||||
+ // Paper end
|
||||
+ this.c = this.writeChunk(new PacketDataSerializer(this.i()), chunk, i, chunkPacketInfo); // Paper - Anti-Xray - Add chunk packet info
|
||||
this.f = Lists.newArrayList();
|
||||
+ this.c = this.writeChunk(new PacketDataSerializer(this.j()), chunk, i, chunkPacketInfo); // Paper - Anti-Xray - Add chunk packet info
|
||||
this.g = Lists.newArrayList();
|
||||
iterator = chunk.getTileEntities().entrySet().iterator();
|
||||
int totalSigns = 0; // Paper
|
||||
@@ -0,0 +0,0 @@ public class PacketPlayOutMapChunk implements Packet<PacketListenerPlayOut> {
|
||||
this.f.add(nbttagcompound);
|
||||
}
|
||||
}
|
||||
+ chunk.world.chunkPacketBlockController.modifyBlocks(this, chunkPacketInfo, forceLoad, null); // Paper - Anti-Xray - Modify blocks
|
||||
+ }
|
||||
|
||||
+ // Paper start - Async-Anti-Xray - Getter and Setter for the ready flag
|
||||
+ public boolean isReady() {
|
||||
+ return this.ready;
|
||||
}
|
||||
|
||||
+ }
|
||||
+
|
||||
+ public void setReady(boolean ready) {
|
||||
+ this.ready = ready;
|
||||
+ }
|
||||
}
|
||||
+ // Paper end
|
||||
+
|
||||
|
||||
@Override
|
||||
public void a(PacketDataSerializer packetdataserializer) throws IOException {
|
||||
this.a = packetdataserializer.readInt();
|
||||
@@ -0,0 +0,0 @@ public class PacketPlayOutMapChunk implements Packet<PacketListenerPlayOut> {
|
||||
|
||||
public int writeChunk(PacketDataSerializer packetDataSerializer, Chunk chunk, int chunkSectionSelector) { return this.a(packetDataSerializer, chunk, chunkSectionSelector); } // Paper - OBFHELPER
|
||||
|
@ -1531,9 +1527,13 @@ index ef71a1feb..483317608 100644
|
|||
+ chunksection.getBlocks().writeDataPaletteBlock(packetdataserializer, chunkPacketInfo, k); // Paper - Anti-Xray - Add chunk packet info
|
||||
}
|
||||
}
|
||||
+ chunk.world.chunkPacketBlockController.modifyBlocks(this, chunkPacketInfo, forceLoad, null); // Paper - Anti-Xray - Modify blocks
|
||||
+ }
|
||||
|
||||
return j;
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/PlayerChunk.java b/src/main/java/net/minecraft/server/PlayerChunk.java
|
||||
index 98590e233..af934ef8b 100644
|
||||
index 43d9a5634..615d27863 100644
|
||||
--- a/src/main/java/net/minecraft/server/PlayerChunk.java
|
||||
+++ b/src/main/java/net/minecraft/server/PlayerChunk.java
|
||||
@@ -0,0 +0,0 @@ public class PlayerChunk {
|
||||
|
@ -1558,7 +1558,7 @@ index 98590e233..af934ef8b 100644
|
|||
this.a(new PacketPlayOutMultiBlockChange(this.dirtyCount, this.dirtyBlocks, chunk), false);
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java
|
||||
index b04657356..a5df9fee6 100644
|
||||
index 93729eea2..fc6436c4f 100644
|
||||
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
|
||||
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
|
||||
@@ -0,0 +0,0 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
|
||||
|
@ -1580,7 +1580,7 @@ index b04657356..a5df9fee6 100644
|
|||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/PlayerInteractManager.java b/src/main/java/net/minecraft/server/PlayerInteractManager.java
|
||||
index a36aba015..f04fc366f 100644
|
||||
index 18ff6dd68..8720dd120 100644
|
||||
--- a/src/main/java/net/minecraft/server/PlayerInteractManager.java
|
||||
+++ b/src/main/java/net/minecraft/server/PlayerInteractManager.java
|
||||
@@ -0,0 +0,0 @@ public class PlayerInteractManager {
|
||||
|
@ -1591,9 +1591,9 @@ index a36aba015..f04fc366f 100644
|
|||
+ this.world.chunkPacketBlockController.onPlayerLeftClickBlock(this, blockposition, enumdirection); // Paper - Anti-Xray
|
||||
}
|
||||
|
||||
public void a(BlockPosition blockposition, PacketPlayInBlockDig.EnumPlayerDigType packetplayinblockdig_enumplayerdigtype) {
|
||||
public void a(BlockPosition blockposition, PacketPlayInBlockDig.EnumPlayerDigType packetplayinblockdig_enumplayerdigtype, String s) {
|
||||
diff --git a/src/main/java/net/minecraft/server/ProtoChunk.java b/src/main/java/net/minecraft/server/ProtoChunk.java
|
||||
index 6bdd7dda0..7bad12eb0 100644
|
||||
index 39339fa27..f376e2106 100644
|
||||
--- a/src/main/java/net/minecraft/server/ProtoChunk.java
|
||||
+++ b/src/main/java/net/minecraft/server/ProtoChunk.java
|
||||
@@ -0,0 +0,0 @@ public class ProtoChunk implements IChunkAccess {
|
||||
|
@ -1636,7 +1636,7 @@ index 6bdd7dda0..7bad12eb0 100644
|
|||
|
||||
return this.j[i];
|
||||
diff --git a/src/main/java/net/minecraft/server/TicketType.java b/src/main/java/net/minecraft/server/TicketType.java
|
||||
index 157ca6a7e..9c114d2d3 100644
|
||||
index a905a29e7..335b64435 100644
|
||||
--- a/src/main/java/net/minecraft/server/TicketType.java
|
||||
+++ b/src/main/java/net/minecraft/server/TicketType.java
|
||||
@@ -0,0 +0,0 @@ public class TicketType<T> {
|
||||
|
@ -1648,7 +1648,7 @@ index 157ca6a7e..9c114d2d3 100644
|
|||
public static <T> TicketType<T> a(String s, Comparator<T> comparator) {
|
||||
return new TicketType<>(s, comparator, 0L);
|
||||
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
|
||||
index 3f71ca9e4..e31ffdb0d 100644
|
||||
index 9ad76ab32..39725335d 100644
|
||||
--- a/src/main/java/net/minecraft/server/World.java
|
||||
+++ b/src/main/java/net/minecraft/server/World.java
|
||||
@@ -0,0 +0,0 @@ package net.minecraft.server;
|
||||
|
@ -1660,7 +1660,7 @@ index 3f71ca9e4..e31ffdb0d 100644
|
|||
import com.destroystokyo.paper.event.server.ServerExceptionEvent;
|
||||
import com.destroystokyo.paper.exception.ServerInternalException;
|
||||
import com.google.common.base.MoreObjects;
|
||||
@@ -0,0 +0,0 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
|
||||
@@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
|
||||
public final org.spigotmc.SpigotWorldConfig spigotConfig; // Spigot
|
||||
|
||||
public final com.destroystokyo.paper.PaperWorldConfig paperConfig; // Paper
|
||||
|
@ -1668,7 +1668,7 @@ index 3f71ca9e4..e31ffdb0d 100644
|
|||
|
||||
public final co.aikar.timings.WorldTimingsHandler timings; // Paper
|
||||
public static BlockPosition lastPhysicsProblem; // Spigot
|
||||
@@ -0,0 +0,0 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
|
||||
@@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
|
||||
protected World(WorldData worlddata, DimensionManager dimensionmanager, BiFunction<World, WorldProvider, IChunkProvider> bifunction, GameProfilerFiller gameprofilerfiller, boolean flag, org.bukkit.generator.ChunkGenerator gen, org.bukkit.World.Environment env) {
|
||||
this.spigotConfig = new org.spigotmc.SpigotWorldConfig( worlddata.getName() ); // Spigot
|
||||
this.paperConfig = new com.destroystokyo.paper.PaperWorldConfig(worlddata.getName(), this.spigotConfig); // Paper
|
||||
|
@ -1676,7 +1676,7 @@ index 3f71ca9e4..e31ffdb0d 100644
|
|||
this.generator = gen;
|
||||
this.world = new CraftWorld((WorldServer) this, gen, env);
|
||||
this.ticksPerAnimalSpawns = this.getServer().getTicksPerAnimalSpawns(); // CraftBukkit
|
||||
@@ -0,0 +0,0 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
|
||||
@@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
|
||||
// CraftBukkit end
|
||||
|
||||
IBlockData iblockdata1 = chunk.setType(blockposition, iblockdata, (i & 64) != 0, (i & 1024) == 0); // CraftBukkit custom NO_PLACE flag
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -8,7 +8,7 @@ we would reuse an existing dimension id, if some other dimension was
|
|||
unloaded before.
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index b0f4ef1b48..d0834ecaab 100644
|
||||
index 1ca9a7724..e1c9a9e12 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -0,0 +0,0 @@ public final class CraftServer implements Server {
|
||||
|
|
|
@ -14,7 +14,7 @@ And since minecart hoppers are used _very_ rarely near we can avoid alot of sear
|
|||
Combined, this adds up a lot.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
|
||||
index d604f96c1..67dc837f4 100644
|
||||
index 863a2222f..f2a04cb6a 100644
|
||||
--- a/src/main/java/net/minecraft/server/Chunk.java
|
||||
+++ b/src/main/java/net/minecraft/server/Chunk.java
|
||||
@@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess {
|
||||
|
@ -27,7 +27,7 @@ index d604f96c1..67dc837f4 100644
|
|||
+ private final int[] inventoryEntityCounts = new int[16];
|
||||
// Paper end
|
||||
|
||||
public Chunk(World world, ChunkCoordIntPair chunkcoordintpair, BiomeBase[] abiomebase, ChunkConverter chunkconverter, TickList<Block> ticklist, TickList<FluidType> ticklist1, long i, @Nullable ChunkSection[] achunksection, @Nullable Consumer<Chunk> consumer) {
|
||||
public Chunk(World world, ChunkCoordIntPair chunkcoordintpair, BiomeStorage biomestorage, ChunkConverter chunkconverter, TickList<Block> ticklist, TickList<FluidType> ticklist1, long i, @Nullable ChunkSection[] achunksection, @Nullable Consumer<Chunk> consumer) {
|
||||
@@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess {
|
||||
entity.chunkY = k;
|
||||
entity.chunkZ = this.loc.z;
|
||||
|
@ -54,22 +54,6 @@ index d604f96c1..67dc837f4 100644
|
|||
entityCounts.decrement(entity.getMinecraftKeyString());
|
||||
this.markDirty(); // Paper
|
||||
// Paper end
|
||||
@@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess {
|
||||
for (int k = i; k <= j; ++k) {
|
||||
Iterator iterator = this.entitySlices[k].iterator(); // Spigot
|
||||
|
||||
+ // Paper start - Don't search for inventories if we have none, and that is all we want
|
||||
+ /*
|
||||
+ * We check if they want inventories by seeing if it is the static `IEntitySelector.c`
|
||||
+ *
|
||||
+ * Make sure the inventory selector stays in sync.
|
||||
+ * It should be the one that checks `var1 instanceof IInventory && var1.isAlive()`
|
||||
+ */
|
||||
+ if (predicate == IEntitySelector.isInventory() && inventoryEntityCounts[k] <= 0) continue;
|
||||
+ // Paper end
|
||||
while (iterator.hasNext()) {
|
||||
Entity entity = (Entity) iterator.next();
|
||||
if (entity.shouldBeRemoved) continue; // Paper
|
||||
@@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess {
|
||||
i = MathHelper.clamp(i, 0, this.entitySlices.length - 1);
|
||||
j = MathHelper.clamp(j, 0, this.entitySlices.length - 1);
|
||||
|
@ -88,9 +72,20 @@ index d604f96c1..67dc837f4 100644
|
|||
+ if (counts != null && counts[k] <= 0) continue; // Paper - Don't check a chunk if it doesn't have the type we are looking for
|
||||
Iterator iterator = this.entitySlices[k].iterator(); // Spigot
|
||||
|
||||
+ // Paper start - Don't search for inventories if we have none, and that is all we want
|
||||
+ /*
|
||||
+ * We check if they want inventories by seeing if it is the static `IEntitySelector.c`
|
||||
+ *
|
||||
+ * Make sure the inventory selector stays in sync.
|
||||
+ * It should be the one that checks `var1 instanceof IInventory && var1.isAlive()`
|
||||
+ */
|
||||
+ if (predicate == IEntitySelector.isInventory() && inventoryEntityCounts[k] <= 0) continue;
|
||||
+ // Paper end
|
||||
while (iterator.hasNext()) {
|
||||
T t0 = (T) iterator.next(); // CraftBukkit - decompile error
|
||||
if (t0.shouldBeRemoved) continue; // Paper
|
||||
diff --git a/src/main/java/net/minecraft/server/IEntitySelector.java b/src/main/java/net/minecraft/server/IEntitySelector.java
|
||||
index 56488b78d..56739e6ed 100644
|
||||
index 498f38109..a2d1ef360 100644
|
||||
--- a/src/main/java/net/minecraft/server/IEntitySelector.java
|
||||
+++ b/src/main/java/net/minecraft/server/IEntitySelector.java
|
||||
@@ -0,0 +0,0 @@ public final class IEntitySelector {
|
||||
|
|
|
@ -1,32 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Gerrygames <gecam59@gmail.com>
|
||||
Date: Thu, 21 Nov 2019 14:56:51 +0100
|
||||
Subject: [PATCH] Backport MC-160177 fix from 1.15
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/PlayerInteractManager.java b/src/main/java/net/minecraft/server/PlayerInteractManager.java
|
||||
index bc03a82b..c77e812b 100644
|
||||
--- a/src/main/java/net/minecraft/server/PlayerInteractManager.java
|
||||
+++ b/src/main/java/net/minecraft/server/PlayerInteractManager.java
|
||||
@@ -0,0 +0,0 @@ public class PlayerInteractManager {
|
||||
this.l = -1;
|
||||
this.e = false;
|
||||
} else {
|
||||
- this.a(iblockdata, this.g);
|
||||
+ this.a(iblockdata, this.g, this.lastDigTick); // Paper - pass lastDigTick as an argument
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
- private float a(IBlockData iblockdata, BlockPosition blockposition) {
|
||||
- int i = this.currentTick - this.k;
|
||||
+ // Paper start - Add startTick parameter and use it
|
||||
+ private float a(IBlockData iblockdata, BlockPosition blockposition) { return this.a(iblockdata, blockposition, this.k); }
|
||||
+ private float a(IBlockData iblockdata, BlockPosition blockposition, int startTick) {
|
||||
+ int i = this.currentTick - startTick;
|
||||
+ // Paper end
|
||||
float f = iblockdata.getDamage(this.player, this.player.world, blockposition) * (float) (i + 1);
|
||||
int j = (int) (f * 10.0F);
|
||||
|
||||
--
|
|
@ -12,7 +12,7 @@ Player we will look at limiting the scope of this change. It appears to
|
|||
be unintentional in the few cases we've seen so far.
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index ea4e569e5a..15c874fc82 100644
|
||||
index 04fc8e233..4b847ddd8 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -0,0 +0,0 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
|
@ -28,7 +28,7 @@ index ea4e569e5a..15c874fc82 100644
|
|||
+ super.remove();
|
||||
+ }
|
||||
+ }
|
||||
//Paper end
|
||||
// Paper end
|
||||
|
||||
// Spigot start
|
||||
--
|
|
@ -11,10 +11,10 @@ floating in the air.
|
|||
This can replace many uses of BlockPhysicsEvent
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
|
||||
index ef561cd95b..dad0c893fd 100644
|
||||
index e8f83627c..61a3ddc4d 100644
|
||||
--- a/src/main/java/net/minecraft/server/World.java
|
||||
+++ b/src/main/java/net/minecraft/server/World.java
|
||||
@@ -0,0 +0,0 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
|
||||
@@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
|
||||
return false;
|
||||
} else {
|
||||
Fluid fluid = this.getFluid(blockposition);
|
||||
|
|
|
@ -6,7 +6,7 @@ Subject: [PATCH] Book Size Limits
|
|||
Puts some limits on the size of books.
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
||||
index 63d8602927..8feb0efdcd 100644
|
||||
index 7e85a0224..30f35304a 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
||||
@@ -0,0 +0,0 @@ public class PaperConfig {
|
||||
|
@ -22,7 +22,7 @@ index 63d8602927..8feb0efdcd 100644
|
|||
+ }
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
index 45c2777552..04b3791f36 100644
|
||||
index d263897da..e5db2de26 100644
|
||||
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
@@ -0,0 +0,0 @@ import java.util.Iterator;
|
||||
|
@ -73,7 +73,7 @@ index 45c2777552..04b3791f36 100644
|
|||
+ }
|
||||
+ }
|
||||
+ // Paper end
|
||||
// CraftBukkit start
|
||||
PlayerConnectionUtils.ensureMainThread(packetplayinbedit, this, this.player.getWorldServer());
|
||||
// CraftBukkit start
|
||||
if (this.lastBookTick + 20 > MinecraftServer.currentTick) {
|
||||
--
|
|
@ -5,7 +5,7 @@ Subject: [PATCH] Call WhitelistToggleEvent when whitelist is toggled
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
|
||||
index 0da3f95f89..65df0e7c8c 100644
|
||||
index 62d807597..9d715d891 100644
|
||||
--- a/src/main/java/net/minecraft/server/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/PlayerList.java
|
||||
@@ -0,0 +0,0 @@ public abstract class PlayerList {
|
||||
|
|
|
@ -5,17 +5,17 @@ Subject: [PATCH] Call player spectator target events
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
|
||||
index 898089983..ad5dcab78 100644
|
||||
index 26096afbe..bdb73b68a 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
|
||||
@@ -0,0 +0,0 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
private EnumChatVisibility ck;
|
||||
private boolean cl = true;
|
||||
private long cm = SystemUtils.getMonotonicMillis();
|
||||
private EnumChatVisibility ch;
|
||||
private boolean ci = true;
|
||||
private long cj = SystemUtils.getMonotonicMillis();
|
||||
- private Entity spectatedEntity;
|
||||
+ private Entity spectatedEntity; private void setSpectatorTargetField(Entity e) { this.spectatedEntity = e; } // Paper - OBFHELPER
|
||||
public boolean worldChangeInvuln;
|
||||
private boolean cp; private void setHasSeenCredits(boolean has) { this.cp = has; } // Paper - OBFHELPER
|
||||
private boolean cm; private void setHasSeenCredits(boolean has) { this.cm = has; } // Paper - OBFHELPER
|
||||
private final RecipeBookServer recipeBook;
|
||||
@@ -0,0 +0,0 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
return (Entity) (this.spectatedEntity == null ? this : this.spectatedEntity);
|
||||
|
@ -29,7 +29,7 @@ index 898089983..ad5dcab78 100644
|
|||
- this.spectatedEntity = (Entity) (entity == null ? this : entity);
|
||||
- if (entity1 != this.spectatedEntity) {
|
||||
- this.playerConnection.sendPacket(new PacketPlayOutCamera(this.spectatedEntity));
|
||||
- this.playerConnection.a(this.spectatedEntity.locX, this.spectatedEntity.locY, this.spectatedEntity.locZ, this.yaw, this.pitch, TeleportCause.SPECTATE); // CraftBukkit
|
||||
- this.playerConnection.a(this.spectatedEntity.locX(), this.spectatedEntity.locY(), this.spectatedEntity.locZ(), this.yaw, this.pitch, TeleportCause.SPECTATE); // CraftBukkit
|
||||
+ if (newSpectatorTarget == null) {
|
||||
+ newSpectatorTarget = this;
|
||||
}
|
||||
|
@ -53,9 +53,17 @@ index 898089983..ad5dcab78 100644
|
|||
+ setSpectatorTargetField(newSpectatorTarget);
|
||||
+
|
||||
+ this.playerConnection.sendPacket(new PacketPlayOutCamera(newSpectatorTarget));
|
||||
+ this.playerConnection.a(this.spectatedEntity.locX, this.spectatedEntity.locY, this.spectatedEntity.locZ, this.yaw, this.pitch, TeleportCause.SPECTATE); // CraftBukkit
|
||||
+ this.playerConnection.a(this.spectatedEntity.locY(), this.spectatedEntity.locY(), this.spectatedEntity.locZ(), this.yaw, this.pitch, TeleportCause.SPECTATE); // CraftBukkit
|
||||
+ // Paper end
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -0,0 +0,0 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
if (this.portalCooldown > 0 && !this.worldChangeInvuln) {
|
||||
--this.portalCooldown;
|
||||
}
|
||||
-
|
||||
}
|
||||
|
||||
@Override
|
||||
--
|
|
@ -13,24 +13,24 @@ Shulkers) may need to be changed in order for it to re-save properly
|
|||
No more crashing though.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/CommandBlockListenerAbstract.java b/src/main/java/net/minecraft/server/CommandBlockListenerAbstract.java
|
||||
index 6d85cd508e..23a69ba571 100644
|
||||
index e6bf34ab0..c447cf1ae 100644
|
||||
--- a/src/main/java/net/minecraft/server/CommandBlockListenerAbstract.java
|
||||
+++ b/src/main/java/net/minecraft/server/CommandBlockListenerAbstract.java
|
||||
@@ -0,0 +0,0 @@ public abstract class CommandBlockListenerAbstract implements ICommandListener {
|
||||
this.command = nbttagcompound.getString("Command");
|
||||
this.successCount = nbttagcompound.getInt("SuccessCount");
|
||||
if (nbttagcompound.hasKeyOfType("CustomName", 8)) {
|
||||
- this.customName = IChatBaseComponent.ChatSerializer.a(nbttagcompound.getString("CustomName"));
|
||||
+ this.customName = MCUtil.getBaseComponentFromNbt("CustomName", nbttagcompound); // Paper - Catch ParseException
|
||||
- this.setName(IChatBaseComponent.ChatSerializer.a(nbttagcompound.getString("CustomName")));
|
||||
+ this.setName(MCUtil.getBaseComponentFromNbt("CustomName", nbttagcompound)); // Paper - Catch ParseException
|
||||
}
|
||||
|
||||
if (nbttagcompound.hasKeyOfType("TrackOutput", 1)) {
|
||||
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
|
||||
index f9b097fd6f..4833a9652a 100644
|
||||
index b03316bc8..5d31068d7 100644
|
||||
--- a/src/main/java/net/minecraft/server/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/server/Entity.java
|
||||
@@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
||||
this.setPosition(this.locX, this.locY, this.locZ);
|
||||
this.Z();
|
||||
this.setYawPitch(this.yaw, this.pitch);
|
||||
if (nbttagcompound.hasKeyOfType("CustomName", 8)) {
|
||||
- this.setCustomName(IChatBaseComponent.ChatSerializer.a(nbttagcompound.getString("CustomName")));
|
||||
|
@ -39,7 +39,7 @@ index f9b097fd6f..4833a9652a 100644
|
|||
|
||||
this.setCustomNameVisible(nbttagcompound.getBoolean("CustomNameVisible"));
|
||||
diff --git a/src/main/java/net/minecraft/server/MCUtil.java b/src/main/java/net/minecraft/server/MCUtil.java
|
||||
index 6d278a0da5..ec3732193f 100644
|
||||
index 6d278a0da..ec3732193 100644
|
||||
--- a/src/main/java/net/minecraft/server/MCUtil.java
|
||||
+++ b/src/main/java/net/minecraft/server/MCUtil.java
|
||||
@@ -0,0 +0,0 @@ public final class MCUtil {
|
||||
|
@ -63,7 +63,7 @@ index 6d278a0da5..ec3732193f 100644
|
|||
+ }
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/TileEntityBanner.java b/src/main/java/net/minecraft/server/TileEntityBanner.java
|
||||
index 560330ba05..bfc58a7754 100644
|
||||
index 21a2415fb..7a911c5a5 100644
|
||||
--- a/src/main/java/net/minecraft/server/TileEntityBanner.java
|
||||
+++ b/src/main/java/net/minecraft/server/TileEntityBanner.java
|
||||
@@ -0,0 +0,0 @@ public class TileEntityBanner extends TileEntity implements INamableTileEntity {
|
||||
|
@ -76,7 +76,7 @@ index 560330ba05..bfc58a7754 100644
|
|||
|
||||
if (this.hasWorld()) {
|
||||
diff --git a/src/main/java/net/minecraft/server/TileEntityContainer.java b/src/main/java/net/minecraft/server/TileEntityContainer.java
|
||||
index 473ec2cbde..ab6b86e4e9 100644
|
||||
index 473ec2cbd..ab6b86e4e 100644
|
||||
--- a/src/main/java/net/minecraft/server/TileEntityContainer.java
|
||||
+++ b/src/main/java/net/minecraft/server/TileEntityContainer.java
|
||||
@@ -0,0 +0,0 @@ public abstract class TileEntityContainer extends TileEntity implements IInvento
|
||||
|
|
|
@ -5,7 +5,7 @@ Subject: [PATCH] Catch exceptions from dispenser entity spawns
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/IDispenseBehavior.java b/src/main/java/net/minecraft/server/IDispenseBehavior.java
|
||||
index 976c72208..fe3d9d5fa 100644
|
||||
index 8c4a8b4ba..83877d672 100644
|
||||
--- a/src/main/java/net/minecraft/server/IDispenseBehavior.java
|
||||
+++ b/src/main/java/net/minecraft/server/IDispenseBehavior.java
|
||||
@@ -0,0 +0,0 @@ public interface IDispenseBehavior {
|
||||
|
|
|
@ -5,16 +5,16 @@ Subject: [PATCH] Check Drowned for Villager Aggression Config
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityDrowned.java b/src/main/java/net/minecraft/server/EntityDrowned.java
|
||||
index fd10cf318a..6f0094e6dc 100644
|
||||
index 255b3d0cd..3a1928b22 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityDrowned.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityDrowned.java
|
||||
@@ -0,0 +0,0 @@ public class EntityDrowned extends EntityZombie implements IRangedEntity {
|
||||
this.goalSelector.a(7, new PathfinderGoalRandomStroll(this, 1.0D));
|
||||
this.targetSelector.a(1, (new PathfinderGoalHurtByTarget(this, new Class[]{EntityDrowned.class})).a(EntityPigZombie.class));
|
||||
this.targetSelector.a(2, new PathfinderGoalNearestAttackableTarget<>(this, EntityHuman.class, 10, true, false, this::h));
|
||||
this.targetSelector.a(2, new PathfinderGoalNearestAttackableTarget<>(this, EntityHuman.class, 10, true, false, this::i));
|
||||
- this.targetSelector.a(3, new PathfinderGoalNearestAttackableTarget<>(this, EntityVillagerAbstract.class, false));
|
||||
+ if ( world.spigotConfig.zombieAggressiveTowardsVillager ) this.targetSelector.a(3, new PathfinderGoalNearestAttackableTarget<>(this, EntityVillagerAbstract.class, false)); // Paper
|
||||
this.targetSelector.a(3, new PathfinderGoalNearestAttackableTarget<>(this, EntityIronGolem.class, true));
|
||||
this.targetSelector.a(5, new PathfinderGoalNearestAttackableTarget<>(this, EntityTurtle.class, 10, true, false, EntityTurtle.bz));
|
||||
this.targetSelector.a(5, new PathfinderGoalNearestAttackableTarget<>(this, EntityTurtle.class, 10, true, false, EntityTurtle.bw));
|
||||
}
|
||||
--
|
|
@ -185,7 +185,7 @@ index d704fc79c..09efbf725 100644
|
|||
* Ported from MinecraftForge - author: LexManos <LexManos@gmail.com> - License: LGPLv2.1
|
||||
*/
|
||||
diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java
|
||||
index 0ce2d6d0f..162700313 100644
|
||||
index 038b7b68d..9b2bafdbd 100644
|
||||
--- a/src/main/java/net/minecraft/server/ChunkProviderServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java
|
||||
@@ -0,0 +0,0 @@ import org.apache.logging.log4j.Logger;
|
||||
|
@ -399,7 +399,7 @@ index ec3732193..23d1935dd 100644
|
|||
+ }
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/PlayerChunk.java b/src/main/java/net/minecraft/server/PlayerChunk.java
|
||||
index 7407c1a56..14a176d61 100644
|
||||
index 3c6fe0596..43d9a5634 100644
|
||||
--- a/src/main/java/net/minecraft/server/PlayerChunk.java
|
||||
+++ b/src/main/java/net/minecraft/server/PlayerChunk.java
|
||||
@@ -0,0 +0,0 @@ public class PlayerChunk {
|
||||
|
@ -412,7 +412,7 @@ index 7407c1a56..14a176d61 100644
|
|||
private int dirtyCount;
|
||||
private int r;
|
||||
diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java
|
||||
index 67d011745..493770bf6 100644
|
||||
index 5fd001170..827831aab 100644
|
||||
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
|
||||
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
|
||||
@@ -0,0 +0,0 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
|
||||
|
@ -430,11 +430,11 @@ index 67d011745..493770bf6 100644
|
|||
public final WorldLoadListener worldLoadListener;
|
||||
- public final PlayerChunkMap.a chunkDistanceManager;
|
||||
+ public final PlayerChunkMap.a chunkDistanceManager; public final PlayerChunkMap.a getChunkMapDistanceManager() { return this.chunkDistanceManager; } // Paper - OBFHELPER
|
||||
private final AtomicInteger v;
|
||||
private final AtomicInteger u;
|
||||
private final DefinedStructureManager definedStructureManager;
|
||||
private final File x;
|
||||
private final File w;
|
||||
diff --git a/src/main/java/net/minecraft/server/Ticket.java b/src/main/java/net/minecraft/server/Ticket.java
|
||||
index 0430ca535..badbe6c19 100644
|
||||
index 77bb6b092..7a8397815 100644
|
||||
--- a/src/main/java/net/minecraft/server/Ticket.java
|
||||
+++ b/src/main/java/net/minecraft/server/Ticket.java
|
||||
@@ -0,0 +0,0 @@ public final class Ticket<T> implements Comparable<Ticket<?>> {
|
||||
|
@ -442,11 +442,11 @@ index 0430ca535..badbe6c19 100644
|
|||
private final TicketType<T> a;
|
||||
private final int b;
|
||||
- public final T identifier;
|
||||
- private final long d;
|
||||
- private long d;
|
||||
+ public final T identifier; public final T getObjectReason() { return this.identifier; } // Paper - OBFHELPER
|
||||
+ private final long d; public final long getCreationTick() { return this.d; } // Paper - OBFHELPER
|
||||
+ private long d; public final long getCreationTick() { return this.d; } // Paper - OBFHELPER
|
||||
|
||||
protected Ticket(TicketType<T> tickettype, int i, T t0, long j) {
|
||||
protected Ticket(TicketType<T> tickettype, int i, T t0) {
|
||||
this.a = tickettype;
|
||||
@@ -0,0 +0,0 @@ public final class Ticket<T> implements Comparable<Ticket<?>> {
|
||||
return this.a;
|
||||
|
|
|
@ -5,7 +5,7 @@ Subject: [PATCH] ChunkMapDistance CME
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/ChunkMapDistance.java b/src/main/java/net/minecraft/server/ChunkMapDistance.java
|
||||
index 101eb58ac..63a688725 100644
|
||||
index a35f0e18b..8c1945687 100644
|
||||
--- a/src/main/java/net/minecraft/server/ChunkMapDistance.java
|
||||
+++ b/src/main/java/net/minecraft/server/ChunkMapDistance.java
|
||||
@@ -0,0 +0,0 @@ public abstract class ChunkMapDistance {
|
||||
|
|
|
@ -6,7 +6,7 @@ Subject: [PATCH] Configurable Keep Spawn Loaded range per world
|
|||
This lets you disable it for some worlds and lower it for others.
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
index acc84eec1..9ff115294 100644
|
||||
index 14fa5fdb7..332f20ce8 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
@@ -0,0 +0,0 @@ public class PaperWorldConfig {
|
||||
|
@ -21,7 +21,7 @@ index acc84eec1..9ff115294 100644
|
|||
+ }
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index ee0200170..a6f112bd0 100644
|
||||
index 443e727dc..0a7648381 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -0,0 +0,0 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
|
@ -114,7 +114,7 @@ index 3868572ae..ae77805f7 100644
|
|||
@Override
|
||||
public void a(ChunkCoordIntPair chunkcoordintpair) {
|
||||
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
|
||||
index 29bb795f7..3acea575d 100644
|
||||
index d59eee27a..c28c0431a 100644
|
||||
--- a/src/main/java/net/minecraft/server/WorldServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/WorldServer.java
|
||||
@@ -0,0 +0,0 @@ public class WorldServer extends World {
|
||||
|
@ -207,7 +207,7 @@ index 29bb795f7..3acea575d 100644
|
|||
|
||||
public LongSet getForceLoadedChunks() {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
index f2a68ec36..e42bd2638 100644
|
||||
index 29c14c707..b1ae19be7 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
@@ -0,0 +0,0 @@ public class CraftWorld implements World {
|
||||
|
|
|
@ -5,7 +5,7 @@ Subject: [PATCH] Configurable connection throttle kick message
|
|||
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
||||
index ea3695b021..d2c039ea2f 100644
|
||||
index 559e6b42b..092bff78a 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
||||
@@ -0,0 +0,0 @@ public class PaperConfig {
|
||||
|
@ -21,7 +21,7 @@ index ea3695b021..d2c039ea2f 100644
|
|||
private static void savePlayerData() {
|
||||
savePlayerData = getBoolean("settings.save-player-data", savePlayerData);
|
||||
diff --git a/src/main/java/net/minecraft/server/HandshakeListener.java b/src/main/java/net/minecraft/server/HandshakeListener.java
|
||||
index 740c8d2728..9a8e5e1213 100644
|
||||
index 8928d93e4..0532f975b 100644
|
||||
--- a/src/main/java/net/minecraft/server/HandshakeListener.java
|
||||
+++ b/src/main/java/net/minecraft/server/HandshakeListener.java
|
||||
@@ -0,0 +0,0 @@ public class HandshakeListener implements PacketHandshakingInListener {
|
||||
|
|
|
@ -25,7 +25,7 @@ P3) Solutions for 1) and especially 2) might not be future-proof, while this
|
|||
server-internal fix makes this change future-proof.
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
index 59671c5c3..56ca65819 100644
|
||||
index 0a7e6fff1..097b623fd 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
@@ -0,0 +0,0 @@ public class PaperWorldConfig {
|
||||
|
@ -39,7 +39,7 @@ index 59671c5c3..56ca65819 100644
|
|||
+ }
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityArrow.java b/src/main/java/net/minecraft/server/EntityArrow.java
|
||||
index a9575d310..5f3e1ccb4 100644
|
||||
index 0c3664758..288259e49 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityArrow.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityArrow.java
|
||||
@@ -0,0 +0,0 @@ public abstract class EntityArrow extends Entity implements IProjectile {
|
||||
|
@ -52,7 +52,7 @@ index a9575d310..5f3e1ccb4 100644
|
|||
|
||||
@Override
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityProjectile.java b/src/main/java/net/minecraft/server/EntityProjectile.java
|
||||
index 18d28a151..bd4ca73f6 100644
|
||||
index 6c091b680..f5c8074dc 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityProjectile.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityProjectile.java
|
||||
@@ -0,0 +0,0 @@ public abstract class EntityProjectile extends Entity implements IProjectile {
|
||||
|
|
|
@ -7,19 +7,26 @@ If the Bukkit generator already has a spawn, use it immediately instead
|
|||
of spending time generating one that we won't use
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
|
||||
index 5df9b0ffda..1330956655 100644
|
||||
index 8ea9b34a1..7b89b509a 100644
|
||||
--- a/src/main/java/net/minecraft/server/WorldServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/WorldServer.java
|
||||
@@ -0,0 +0,0 @@ public class WorldServer extends World {
|
||||
} else if (this.worldData.getType() == WorldType.DEBUG_ALL_BLOCK_STATES) {
|
||||
this.worldData.setSpawn(BlockPosition.ZERO.up());
|
||||
} else {
|
||||
- WorldChunkManager worldchunkmanager = this.chunkProvider.getChunkGenerator().getWorldChunkManager();
|
||||
- WorldChunkManager worldchunkmanager = this.getChunkProvider().getChunkGenerator().getWorldChunkManager();
|
||||
- List<BiomeBase> list = worldchunkmanager.a();
|
||||
- Random random = new Random(this.getSeed());
|
||||
- BlockPosition blockposition = worldchunkmanager.a(0, 0, 256, list, random);
|
||||
- BlockPosition blockposition = worldchunkmanager.a(0, this.getSeaLevel(), 0, 256, list, random);
|
||||
- ChunkCoordIntPair chunkcoordintpair = blockposition == null ? new ChunkCoordIntPair(0, 0) : new ChunkCoordIntPair(blockposition);
|
||||
-
|
||||
+// Paper start - moved down
|
||||
+// WorldChunkManager worldchunkmanager = this.getChunkProvider().getChunkGenerator().getWorldChunkManager();
|
||||
+// List<BiomeBase> list = worldchunkmanager.a();
|
||||
+// Random random = new Random(this.getSeed());
|
||||
+// BlockPosition blockposition = worldchunkmanager.a(0, this.getSeaLevel(), 0, 256, list, random);
|
||||
+// ChunkCoordIntPair chunkcoordintpair = blockposition == null ? new ChunkCoordIntPair(0, 0) : new ChunkCoordIntPair(blockposition);
|
||||
+// Paper end
|
||||
// CraftBukkit start
|
||||
if (this.generator != null) {
|
||||
Random rand = new Random(this.getSeed());
|
||||
|
@ -31,10 +38,9 @@ index 5df9b0ffda..1330956655 100644
|
|||
+ WorldChunkManager worldchunkmanager = this.chunkProvider.getChunkGenerator().getWorldChunkManager();
|
||||
+ List<BiomeBase> list = worldchunkmanager.a();
|
||||
+ Random random = new Random(this.getSeed());
|
||||
+ BlockPosition blockposition = worldchunkmanager.a(0, 0, 256, list, random);
|
||||
+ BlockPosition blockposition = worldchunkmanager.a(0, this.getSeaLevel(), 0, 256, list, random);
|
||||
+ ChunkCoordIntPair chunkcoordintpair = blockposition == null ? new ChunkCoordIntPair(0, 0) : new ChunkCoordIntPair(blockposition);
|
||||
+ // Paper end
|
||||
+
|
||||
if (blockposition == null) {
|
||||
WorldServer.LOGGER.warn("Unable to find spawn biome");
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@ Subject: [PATCH] Don't allow digging into unloaded chunks
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
index 9eb6982508..45c2777552 100644
|
||||
index ccad0a601..d263897da 100644
|
||||
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
@@ -0,0 +0,0 @@ public class PlayerConnection implements PacketListenerPlayIn {
|
||||
|
|
|
@ -7,7 +7,7 @@ property lookups arent super cheap. they synchronize, validate
|
|||
and check security managers.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/TileEntitySign.java b/src/main/java/net/minecraft/server/TileEntitySign.java
|
||||
index c7aa3b350a..0a8d9b52dd 100644
|
||||
index f051f2d3c..5eb86c434 100644
|
||||
--- a/src/main/java/net/minecraft/server/TileEntitySign.java
|
||||
+++ b/src/main/java/net/minecraft/server/TileEntitySign.java
|
||||
@@ -0,0 +0,0 @@ public class TileEntitySign extends TileEntity implements ICommandListener { //
|
||||
|
|
|
@ -7,7 +7,7 @@ Mojang was sleeping even if we had no more requests to go after
|
|||
the current one finished, resulting in 100ms lost per profile lookup
|
||||
|
||||
diff --git a/src/main/java/com/mojang/authlib/yggdrasil/YggdrasilGameProfileRepository.java b/src/main/java/com/mojang/authlib/yggdrasil/YggdrasilGameProfileRepository.java
|
||||
index 71e48e87b4..23f1447cfc 100644
|
||||
index 71e48e87b..23f1447cf 100644
|
||||
--- a/src/main/java/com/mojang/authlib/yggdrasil/YggdrasilGameProfileRepository.java
|
||||
+++ b/src/main/java/com/mojang/authlib/yggdrasil/YggdrasilGameProfileRepository.java
|
||||
@@ -0,0 +0,0 @@ public class YggdrasilGameProfileRepository implements GameProfileRepository {
|
||||
|
|
|
@ -33,7 +33,7 @@ But for those who are ok with leaving this inconsistent behavior, you may use WA
|
|||
It is recommended you regenerate the entities, as these were legit entities, and deserve your love.
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
index cf9470057..2cf5ef8b7 100644
|
||||
index 3b1289099..14fa5fdb7 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
@@ -0,0 +0,0 @@ public class PaperWorldConfig {
|
||||
|
@ -81,7 +81,7 @@ index cf9470057..2cf5ef8b7 100644
|
|||
+ }
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
|
||||
index 09e010e67..ee8f80174 100644
|
||||
index c7c600b80..64c327669 100644
|
||||
--- a/src/main/java/net/minecraft/server/Chunk.java
|
||||
+++ b/src/main/java/net/minecraft/server/Chunk.java
|
||||
@@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess {
|
||||
|
@ -91,9 +91,9 @@ index 09e010e67..ee8f80174 100644
|
|||
+ return; // Paper
|
||||
}
|
||||
|
||||
int k = MathHelper.floor(entity.locY / 16.0D);
|
||||
int k = MathHelper.floor(entity.locY() / 16.0D);
|
||||
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
|
||||
index f87514a20..55c73ffca 100644
|
||||
index 96b0917a3..f0d1a5b14 100644
|
||||
--- a/src/main/java/net/minecraft/server/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/server/Entity.java
|
||||
@@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
||||
|
@ -103,9 +103,9 @@ index f87514a20..55c73ffca 100644
|
|||
+ public void setUUID(UUID uuid) { a(uuid); } // Paper - OBFHELPER
|
||||
public void a(UUID uuid) {
|
||||
this.uniqueID = uuid;
|
||||
this.ap = this.uniqueID.toString();
|
||||
this.am = this.uniqueID.toString();
|
||||
diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java
|
||||
index db938da25..82b7d328a 100644
|
||||
index a2b09597f..5fd001170 100644
|
||||
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
|
||||
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
|
||||
@@ -0,0 +0,0 @@
|
||||
|
@ -121,6 +121,7 @@ index db938da25..82b7d328a 100644
|
|||
import java.io.Writer;
|
||||
import java.util.ArrayList;
|
||||
+import java.util.HashMap; // Paper
|
||||
import java.util.Collection;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
+import java.util.Map; // Paper
|
||||
|
@ -209,15 +210,15 @@ index db938da25..82b7d328a 100644
|
|||
|
||||
if (list != null) {
|
||||
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
|
||||
index cc2c13990..29bb795f7 100644
|
||||
index 0138738b3..d59eee27a 100644
|
||||
--- a/src/main/java/net/minecraft/server/WorldServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/WorldServer.java
|
||||
@@ -0,0 +0,0 @@ package net.minecraft.server;
|
||||
|
||||
import co.aikar.timings.TimingHistory;
|
||||
import co.aikar.timings.Timings;
|
||||
import com.google.common.annotations.VisibleForTesting;
|
||||
import co.aikar.timings.TimingHistory; // Paper
|
||||
import co.aikar.timings.Timings; // Paper
|
||||
+
|
||||
+import com.destroystokyo.paper.PaperWorldConfig;
|
||||
+import com.destroystokyo.paper.PaperWorldConfig; // Paper
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.google.common.collect.Queues;
|
||||
|
|
|
@ -10,7 +10,7 @@ persistenting Living Entity, SPAWNER for spawners,
|
|||
or DEFAULT since data was not stored.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
|
||||
index 046e7e031c..f87514a200 100644
|
||||
index 2e8aedf5f..96b0917a3 100644
|
||||
--- a/src/main/java/net/minecraft/server/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/server/Entity.java
|
||||
@@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
||||
|
@ -19,8 +19,8 @@ index 046e7e031c..f87514a200 100644
|
|||
List<Entity> entitySlice = null;
|
||||
+ public org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason spawnReason;
|
||||
// Paper end
|
||||
static boolean isLevelAtLeast(NBTTagCompound tag, int level) {
|
||||
return tag.hasKey("Bukkit.updateLevel") && tag.getInt("Bukkit.updateLevel") >= level;
|
||||
|
||||
public com.destroystokyo.paper.loottable.PaperLootableInventoryData lootableData; // Paper
|
||||
@@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
||||
if (this.origin != null) {
|
||||
nbttagcompound.set("Paper.Origin", this.createList(origin.getX(), origin.getY(), origin.getZ()));
|
||||
|
@ -59,7 +59,7 @@ index 046e7e031c..f87514a200 100644
|
|||
|
||||
} catch (Throwable throwable) {
|
||||
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
|
||||
index 65df0e7c8c..abddc8895e 100644
|
||||
index 9d715d891..49437f212 100644
|
||||
--- a/src/main/java/net/minecraft/server/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/PlayerList.java
|
||||
@@ -0,0 +0,0 @@ public abstract class PlayerList {
|
||||
|
@ -72,7 +72,7 @@ index 65df0e7c8c..abddc8895e 100644
|
|||
});
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
|
||||
index dbd357f1a3..628ad8b839 100644
|
||||
index ecfcecfdc..63e7f2bce 100644
|
||||
--- a/src/main/java/net/minecraft/server/WorldServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/WorldServer.java
|
||||
@@ -0,0 +0,0 @@ public class WorldServer extends World {
|
||||
|
@ -84,7 +84,7 @@ index dbd357f1a3..628ad8b839 100644
|
|||
if (entity.valid) {
|
||||
MinecraftServer.LOGGER.error("Attempted Double World add on " + entity, new Throwable());
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
index 517e422180..31db42e9fb 100644
|
||||
index 915ccb180..dfa15372b 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
@@ -0,0 +0,0 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
|
||||
|
|
|
@ -5,7 +5,7 @@ Subject: [PATCH] Expose the internal current tick
|
|||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 7a8ab7d40..105d31906 100644
|
||||
index 18b76ed0f..f3da3a82d 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -0,0 +0,0 @@ public final class CraftServer implements Server {
|
||||
|
|
|
@ -24,7 +24,7 @@ Instead we opt to remove the check entirely so that the event fires for
|
|||
all piston types.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/BlockPiston.java b/src/main/java/net/minecraft/server/BlockPiston.java
|
||||
index e883c7ac98..de804348f3 100644
|
||||
index 1170a2810..b29525c40 100644
|
||||
--- a/src/main/java/net/minecraft/server/BlockPiston.java
|
||||
+++ b/src/main/java/net/minecraft/server/BlockPiston.java
|
||||
@@ -0,0 +0,0 @@ public class BlockPiston extends BlockDirectional {
|
||||
|
@ -44,5 +44,5 @@ index e883c7ac98..de804348f3 100644
|
|||
+ //} // Paper
|
||||
// PAIL: checkME - what happened to setTypeAndData?
|
||||
// CraftBukkit end
|
||||
world.playBlockAction(blockposition, this, b0, enumdirection.a());
|
||||
world.playBlockAction(blockposition, this, b0, enumdirection.b());
|
||||
--
|
|
@ -5,7 +5,7 @@ Subject: [PATCH] Fire event on GS4 query
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/RemoteConnectionThread.java b/src/main/java/net/minecraft/server/RemoteConnectionThread.java
|
||||
index 66bfbcf02b..d821ef9a75 100644
|
||||
index 66bfbcf02..d821ef9a7 100644
|
||||
--- a/src/main/java/net/minecraft/server/RemoteConnectionThread.java
|
||||
+++ b/src/main/java/net/minecraft/server/RemoteConnectionThread.java
|
||||
@@ -0,0 +0,0 @@ public abstract class RemoteConnectionThread implements Runnable {
|
||||
|
@ -26,7 +26,7 @@ index 66bfbcf02b..d821ef9a75 100644
|
|||
return this.b.getPlayerCount();
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/RemoteStatusListener.java b/src/main/java/net/minecraft/server/RemoteStatusListener.java
|
||||
index a556a71334..67e94a6f07 100644
|
||||
index 16bb89af0..1b084f211 100644
|
||||
--- a/src/main/java/net/minecraft/server/RemoteStatusListener.java
|
||||
+++ b/src/main/java/net/minecraft/server/RemoteStatusListener.java
|
||||
@@ -0,0 +0,0 @@ public class RemoteStatusListener extends RemoteConnectionThread {
|
||||
|
@ -184,7 +184,7 @@ index a556a71334..67e94a6f07 100644
|
|||
}
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/RemoteStatusReply.java b/src/main/java/net/minecraft/server/RemoteStatusReply.java
|
||||
index 848b5c3f0e..73efea7e13 100644
|
||||
index 848b5c3f0..73efea7e1 100644
|
||||
--- a/src/main/java/net/minecraft/server/RemoteStatusReply.java
|
||||
+++ b/src/main/java/net/minecraft/server/RemoteStatusReply.java
|
||||
@@ -0,0 +0,0 @@ public class RemoteStatusReply {
|
||||
|
|
|
@ -7,7 +7,7 @@ Fixes an AssertionError when setting the player's item in hand to null or a new
|
|||
Fixes GH-2718
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
index f675ad2f5..addbafe66 100644
|
||||
index d04ea03bc..5431f8a8d 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
@@ -0,0 +0,0 @@ public abstract class EntityLiving extends Entity {
|
||||
|
@ -19,7 +19,7 @@ index f675ad2f5..addbafe66 100644
|
|||
if (enumhand == EnumHand.MAIN_HAND) {
|
||||
return this.getEquipment(EnumItemSlot.MAINHAND);
|
||||
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
index ae17cdf23..c9872cbd0 100644
|
||||
index 8c54022e0..c559a7b95 100644
|
||||
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
@@ -0,0 +0,0 @@ public class PlayerConnection implements PacketListenerPlayIn {
|
||||
|
|
|
@ -5,7 +5,7 @@ Subject: [PATCH] Fix CB call to changed postToMainThread method
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
index 37b97438c..4a16d6c14 100644
|
||||
index 17eeecaf4..8c54022e0 100644
|
||||
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
@@ -0,0 +0,0 @@ public class PlayerConnection implements PacketListenerPlayIn {
|
||||
|
|
|
@ -16,7 +16,7 @@ handling that should have been handled synchronously will be handled
|
|||
synchronously when the server gets shut down.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index 24dccfb7a1..ee02001700 100644
|
||||
index c023848c7..443e727dc 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -0,0 +0,0 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
|
@ -29,7 +29,7 @@ index 24dccfb7a1..ee02001700 100644
|
|||
|
||||
@Deprecated
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index b89486beb1..7a8ab7d401 100644
|
||||
index 58b343259..18b76ed0f 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -0,0 +0,0 @@ public final class CraftServer implements Server {
|
||||
|
|
|
@ -10,7 +10,7 @@ This made the Bukkit RecipeChoice API not work for Shapeless.
|
|||
This reimplements vanilla logic using the same test logic as Shaped
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/ShapelessRecipes.java b/src/main/java/net/minecraft/server/ShapelessRecipes.java
|
||||
index 070fc1e3ec..691e697d68 100644
|
||||
index fe03a35cc..fb481e658 100644
|
||||
--- a/src/main/java/net/minecraft/server/ShapelessRecipes.java
|
||||
+++ b/src/main/java/net/minecraft/server/ShapelessRecipes.java
|
||||
@@ -0,0 +0,0 @@ public class ShapelessRecipes implements RecipeCrafting {
|
||||
|
|
|
@ -7,7 +7,7 @@ The problem was we were checking isExpired() on the entry, but if it
|
|||
was expired at that point, then it would be null.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
|
||||
index a183bb450..3cb443c4f 100644
|
||||
index 68e089a4b..f702619aa 100644
|
||||
--- a/src/main/java/net/minecraft/server/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/PlayerList.java
|
||||
@@ -0,0 +0,0 @@ public abstract class PlayerList {
|
||||
|
|
|
@ -9,7 +9,7 @@ We can use an entity valid check since this method is invoked for
|
|||
each inventory iteraction (thanks to CB) and on player tick (vanilla).
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/ContainerHorse.java b/src/main/java/net/minecraft/server/ContainerHorse.java
|
||||
index d1b9482d6..ad4e0a45c 100644
|
||||
index c95ce0124..18e1ae7f0 100644
|
||||
--- a/src/main/java/net/minecraft/server/ContainerHorse.java
|
||||
+++ b/src/main/java/net/minecraft/server/ContainerHorse.java
|
||||
@@ -0,0 +0,0 @@ public class ContainerHorse extends Container {
|
||||
|
|
|
@ -5,7 +5,7 @@ Subject: [PATCH] Fix MC-93764
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/WorldProviderTheEnd.java b/src/main/java/net/minecraft/server/WorldProviderTheEnd.java
|
||||
index 715faef171..b97408cffa 100644
|
||||
index 9d4fcf8bc..4b9760709 100644
|
||||
--- a/src/main/java/net/minecraft/server/WorldProviderTheEnd.java
|
||||
+++ b/src/main/java/net/minecraft/server/WorldProviderTheEnd.java
|
||||
@@ -0,0 +0,0 @@ public class WorldProviderTheEnd extends WorldProvider {
|
||||
|
|
|
@ -10,7 +10,7 @@ it impossible to properly cancel the event or modify the book meta
|
|||
cancelled writing
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
index 04b3791f36..4a1565f4f7 100644
|
||||
index e5db2de26..c3feccbd6 100644
|
||||
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
@@ -0,0 +0,0 @@ public class PlayerConnection implements PacketListenerPlayIn {
|
||||
|
|
|
@ -6,7 +6,7 @@ Subject: [PATCH] Fix SpongeAbsortEvent handling
|
|||
Only process drops when the block is actually going to be removed
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/Block.java b/src/main/java/net/minecraft/server/Block.java
|
||||
index f687e86c4..e077359b0 100644
|
||||
index 2262a8253..46490a943 100644
|
||||
--- a/src/main/java/net/minecraft/server/Block.java
|
||||
+++ b/src/main/java/net/minecraft/server/Block.java
|
||||
@@ -0,0 +0,0 @@ public class Block implements IMaterial {
|
||||
|
|
|
@ -1,377 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Spottedleaf <Spottedleaf@users.noreply.github.com>
|
||||
Date: Sat, 15 Jun 2019 08:54:33 -0700
|
||||
Subject: [PATCH] Fix World#isChunkGenerated calls
|
||||
|
||||
Optimize World#loadChunk() too
|
||||
This patch also adds a chunk status cache on region files (note that
|
||||
its only purpose is to cache the status on DISK)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java
|
||||
index 8689e0f9f..56761afdf 100644
|
||||
--- a/src/main/java/net/minecraft/server/ChunkProviderServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java
|
||||
@@ -0,0 +0,0 @@ public class ChunkProviderServer extends IChunkProvider {
|
||||
private final WorldServer world;
|
||||
private final Thread serverThread;
|
||||
private final LightEngineThreaded lightEngine;
|
||||
- private final ChunkProviderServer.a serverThreadQueue;
|
||||
+ public final ChunkProviderServer.a serverThreadQueue; // Paper private -> public
|
||||
public final PlayerChunkMap playerChunkMap;
|
||||
private final WorldPersistentData worldPersistentData;
|
||||
private long lastTickTime;
|
||||
@@ -0,0 +0,0 @@ public class ChunkProviderServer extends IChunkProvider {
|
||||
|
||||
return playerChunk.getFullChunk();
|
||||
}
|
||||
+
|
||||
+ @Nullable
|
||||
+ public IChunkAccess getChunkAtImmediately(int x, int z) {
|
||||
+ long k = ChunkCoordIntPair.pair(x, z);
|
||||
+
|
||||
+ // Note: Bypass cache to make this MT-Safe
|
||||
+
|
||||
+ PlayerChunk playerChunk = this.getChunk(k);
|
||||
+ if (playerChunk == null) {
|
||||
+ return null;
|
||||
+ }
|
||||
+
|
||||
+ return playerChunk.getAvailableChunkNow();
|
||||
+
|
||||
+ }
|
||||
// Paper end
|
||||
|
||||
@Nullable
|
||||
diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
|
||||
index e778c2e85..73f93e494 100644
|
||||
--- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java
|
||||
+++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
|
||||
@@ -0,0 +0,0 @@ public class ChunkRegionLoader {
|
||||
return nbttagcompound;
|
||||
}
|
||||
|
||||
+ // Paper start
|
||||
+ public static ChunkStatus getStatus(NBTTagCompound compound) {
|
||||
+ if (compound == null) {
|
||||
+ return null;
|
||||
+ }
|
||||
+
|
||||
+ // Note: Copied from below
|
||||
+ return ChunkStatus.getStatus(compound.getCompound("Level").getString("Status"));
|
||||
+ }
|
||||
+ // Paper end
|
||||
+
|
||||
public static ChunkStatus.Type a(@Nullable NBTTagCompound nbttagcompound) {
|
||||
if (nbttagcompound != null) {
|
||||
ChunkStatus chunkstatus = ChunkStatus.a(nbttagcompound.getCompound("Level").getString("Status"));
|
||||
diff --git a/src/main/java/net/minecraft/server/ChunkStatus.java b/src/main/java/net/minecraft/server/ChunkStatus.java
|
||||
index dd1822d6f..e324989b4 100644
|
||||
--- a/src/main/java/net/minecraft/server/ChunkStatus.java
|
||||
+++ b/src/main/java/net/minecraft/server/ChunkStatus.java
|
||||
@@ -0,0 +0,0 @@ public class ChunkStatus {
|
||||
return this.s;
|
||||
}
|
||||
|
||||
+ public ChunkStatus getPreviousStatus() { return this.e(); } // Paper - OBFHELPER
|
||||
public ChunkStatus e() {
|
||||
return this.u;
|
||||
}
|
||||
@@ -0,0 +0,0 @@ public class ChunkStatus {
|
||||
return this.y;
|
||||
}
|
||||
|
||||
+ // Paper start
|
||||
+ public static ChunkStatus getStatus(String name) {
|
||||
+ try {
|
||||
+ // We need this otherwise we return EMPTY for invalid names
|
||||
+ MinecraftKey key = new MinecraftKey(name);
|
||||
+ return IRegistry.CHUNK_STATUS.getOptional(key).orElse(null);
|
||||
+ } catch (Exception ex) {
|
||||
+ return null; // invalid name
|
||||
+ }
|
||||
+ }
|
||||
+ // Paper end
|
||||
public static ChunkStatus a(String s) {
|
||||
return (ChunkStatus) IRegistry.CHUNK_STATUS.get(MinecraftKey.a(s));
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/PlayerChunk.java b/src/main/java/net/minecraft/server/PlayerChunk.java
|
||||
index 14a176d61..98590e233 100644
|
||||
--- a/src/main/java/net/minecraft/server/PlayerChunk.java
|
||||
+++ b/src/main/java/net/minecraft/server/PlayerChunk.java
|
||||
@@ -0,0 +0,0 @@ public class PlayerChunk {
|
||||
Either<IChunkAccess, PlayerChunk.Failure> either = (Either<IChunkAccess, PlayerChunk.Failure>) statusFuture.getNow(null);
|
||||
return either == null ? null : (Chunk) either.left().orElse(null);
|
||||
}
|
||||
+
|
||||
+ public IChunkAccess getAvailableChunkNow() {
|
||||
+ // TODO can we just getStatusFuture(EMPTY)?
|
||||
+ for (ChunkStatus curr = ChunkStatus.FULL, next = curr.getPreviousStatus(); curr != next; curr = next, next = next.getPreviousStatus()) {
|
||||
+ CompletableFuture<Either<IChunkAccess, PlayerChunk.Failure>> future = this.getStatusFutureUnchecked(curr);
|
||||
+ Either<IChunkAccess, PlayerChunk.Failure> either = future.getNow(null);
|
||||
+ if (either == null || !either.left().isPresent()) {
|
||||
+ continue;
|
||||
+ }
|
||||
+ return either.left().get();
|
||||
+ }
|
||||
+ return null;
|
||||
+ }
|
||||
// Paper end
|
||||
|
||||
public CompletableFuture<Either<IChunkAccess, PlayerChunk.Failure>> getStatusFutureUnchecked(ChunkStatus chunkstatus) {
|
||||
diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java
|
||||
index 6f1e48ba4..eb49e9021 100644
|
||||
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
|
||||
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
|
||||
@@ -0,0 +0,0 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
|
||||
}
|
||||
|
||||
@Nullable
|
||||
- private NBTTagCompound readChunkData(ChunkCoordIntPair chunkcoordintpair) throws IOException {
|
||||
+ public NBTTagCompound readChunkData(ChunkCoordIntPair chunkcoordintpair) throws IOException { // Paper - private -> public
|
||||
NBTTagCompound nbttagcompound = this.read(chunkcoordintpair);
|
||||
|
||||
- return nbttagcompound == null ? null : this.getChunkData(this.world.getWorldProvider().getDimensionManager(), this.m, nbttagcompound, chunkcoordintpair, world); // CraftBukkit
|
||||
+ // Paper start - Cache chunk status on disk
|
||||
+ if (nbttagcompound == null) {
|
||||
+ return null;
|
||||
+ }
|
||||
+
|
||||
+ nbttagcompound = this.getChunkData(this.world.getWorldProvider().getDimensionManager(), this.m, nbttagcompound, chunkcoordintpair, world); // CraftBukkit
|
||||
+ if (nbttagcompound == null) {
|
||||
+ return null;
|
||||
+ }
|
||||
+
|
||||
+ this.updateChunkStatusOnDisk(chunkcoordintpair, nbttagcompound);
|
||||
+
|
||||
+ return nbttagcompound;
|
||||
+ // Paper end
|
||||
+ }
|
||||
+
|
||||
+ // Paper start - chunk status cache "api"
|
||||
+ public ChunkStatus getChunkStatusOnDiskIfCached(ChunkCoordIntPair chunkPos) {
|
||||
+ RegionFile regionFile = this.getRegionFileIfLoaded(chunkPos);
|
||||
+
|
||||
+ return regionFile == null ? null : regionFile.getStatusIfCached(chunkPos.x, chunkPos.z);
|
||||
+ }
|
||||
+
|
||||
+ public ChunkStatus getChunkStatusOnDisk(ChunkCoordIntPair chunkPos) throws IOException {
|
||||
+ RegionFile regionFile = this.getRegionFile(chunkPos, false);
|
||||
+
|
||||
+ if (!regionFile.chunkExists(chunkPos)) {
|
||||
+ return null;
|
||||
+ }
|
||||
+
|
||||
+ ChunkStatus status = regionFile.getStatusIfCached(chunkPos.x, chunkPos.z);
|
||||
+
|
||||
+ if (status != null) {
|
||||
+ return status;
|
||||
+ }
|
||||
+
|
||||
+ this.readChunkData(chunkPos);
|
||||
+
|
||||
+ return regionFile.getStatusIfCached(chunkPos.x, chunkPos.z);
|
||||
+ }
|
||||
+
|
||||
+ public void updateChunkStatusOnDisk(ChunkCoordIntPair chunkPos, @Nullable NBTTagCompound compound) throws IOException {
|
||||
+ RegionFile regionFile = this.getRegionFile(chunkPos, false);
|
||||
+
|
||||
+ regionFile.setStatus(chunkPos.x, chunkPos.z, ChunkRegionLoader.getStatus(compound));
|
||||
+ }
|
||||
+
|
||||
+ public IChunkAccess getUnloadingChunk(int chunkX, int chunkZ) {
|
||||
+ PlayerChunk chunkHolder = this.pendingUnload.get(ChunkCoordIntPair.pair(chunkX, chunkZ));
|
||||
+ return chunkHolder == null ? null : chunkHolder.getAvailableChunkNow();
|
||||
}
|
||||
+ // Paper end
|
||||
|
||||
boolean isOutsideOfRange(ChunkCoordIntPair chunkcoordintpair) {
|
||||
// Spigot start
|
||||
diff --git a/src/main/java/net/minecraft/server/RegionFile.java b/src/main/java/net/minecraft/server/RegionFile.java
|
||||
index ccc3d6c7a..b487e8060 100644
|
||||
--- a/src/main/java/net/minecraft/server/RegionFile.java
|
||||
+++ b/src/main/java/net/minecraft/server/RegionFile.java
|
||||
@@ -0,0 +0,0 @@ public class RegionFile implements AutoCloseable {
|
||||
private final int[] d = new int[1024]; private final int[] timestamps = d; // Paper - OBFHELPER
|
||||
private final List<Boolean> e; // PAIL freeSectors
|
||||
|
||||
+ // Paper start - Cache chunk status
|
||||
+ private final ChunkStatus[] statuses = new ChunkStatus[32 * 32];
|
||||
+
|
||||
+ private boolean closed;
|
||||
+
|
||||
+ // invoked on write/read
|
||||
+ public void setStatus(int x, int z, ChunkStatus status) {
|
||||
+ if (this.closed) {
|
||||
+ // We've used an invalid region file.
|
||||
+ throw new IllegalStateException("RegionFile is closed");
|
||||
+ }
|
||||
+ this.statuses[this.getChunkLocation(new ChunkCoordIntPair(x, z))] = status;
|
||||
+ }
|
||||
+
|
||||
+ public ChunkStatus getStatusIfCached(int x, int z) {
|
||||
+ if (this.closed) {
|
||||
+ // We've used an invalid region file.
|
||||
+ throw new IllegalStateException("RegionFile is closed");
|
||||
+ }
|
||||
+ final int location = this.getChunkLocation(new ChunkCoordIntPair(x, z));
|
||||
+ return this.statuses[location];
|
||||
+ }
|
||||
+ // Paper end
|
||||
+
|
||||
public RegionFile(File file) throws IOException {
|
||||
this.b = new RandomAccessFile(file, "rw");
|
||||
this.file = file; // Spigot // Paper - We need this earlier
|
||||
@@ -0,0 +0,0 @@ public class RegionFile implements AutoCloseable {
|
||||
return this.c[this.f(chunkcoordintpair)];
|
||||
}
|
||||
|
||||
+ public final boolean chunkExists(ChunkCoordIntPair chunkPos) { return this.d(chunkPos); } // Paper - OBFHELPER
|
||||
public boolean d(ChunkCoordIntPair chunkcoordintpair) {
|
||||
return this.getOffset(chunkcoordintpair) != 0;
|
||||
}
|
||||
@@ -0,0 +0,0 @@ public class RegionFile implements AutoCloseable {
|
||||
this.c[j] = i; // Spigot - move this to after the write
|
||||
}
|
||||
|
||||
+ private final int getChunkLocation(ChunkCoordIntPair chunkcoordintpair) { return this.f(chunkcoordintpair); } // Paper - OBFHELPER
|
||||
private int f(ChunkCoordIntPair chunkcoordintpair) {
|
||||
return chunkcoordintpair.j() + chunkcoordintpair.k() * 32;
|
||||
}
|
||||
@@ -0,0 +0,0 @@ public class RegionFile implements AutoCloseable {
|
||||
}
|
||||
|
||||
public void close() throws IOException {
|
||||
+ this.closed = true; // Paper
|
||||
this.b.close();
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/RegionFileCache.java b/src/main/java/net/minecraft/server/RegionFileCache.java
|
||||
index 6f34d8aea..d2b328945 100644
|
||||
--- a/src/main/java/net/minecraft/server/RegionFileCache.java
|
||||
+++ b/src/main/java/net/minecraft/server/RegionFileCache.java
|
||||
@@ -0,0 +0,0 @@ public abstract class RegionFileCache implements AutoCloseable {
|
||||
// Paper start
|
||||
}
|
||||
|
||||
+ // Paper start
|
||||
+ public RegionFile getRegionFileIfLoaded(ChunkCoordIntPair chunkcoordintpair) {
|
||||
+ return this.cache.getAndMoveToFirst(ChunkCoordIntPair.pair(chunkcoordintpair.getRegionX(), chunkcoordintpair.getRegionZ()));
|
||||
+ }
|
||||
+ // Paper end
|
||||
+
|
||||
public RegionFile getRegionFile(ChunkCoordIntPair chunkcoordintpair, boolean existingOnly) throws IOException { return this.a(chunkcoordintpair, existingOnly); } // Paper - OBFHELPER
|
||||
private RegionFile a(ChunkCoordIntPair chunkcoordintpair, boolean existingOnly) throws IOException { // CraftBukkit
|
||||
long i = ChunkCoordIntPair.pair(chunkcoordintpair.getRegionX(), chunkcoordintpair.getRegionZ());
|
||||
@@ -0,0 +0,0 @@ public abstract class RegionFileCache implements AutoCloseable {
|
||||
try {
|
||||
NBTCompressedStreamTools.writeNBT(nbttagcompound, out);
|
||||
out.close();
|
||||
+ regionfile.setStatus(chunk.x, chunk.z, ChunkRegionLoader.getStatus(nbttagcompound)); // Paper - cache status on disk
|
||||
regionfile.setOversized(chunkX, chunkZ, false);
|
||||
} catch (RegionFile.ChunkTooLargeException ignored) {
|
||||
printOversizedLog("ChunkTooLarge! Someone is trying to duplicate.", regionfile.file, chunkX, chunkZ);
|
||||
@@ -0,0 +0,0 @@ public abstract class RegionFileCache implements AutoCloseable {
|
||||
if (SIZE_THRESHOLD == OVERZEALOUS_THRESHOLD) {
|
||||
resetFilterThresholds();
|
||||
}
|
||||
+ regionfile.setStatus(chunk.x, chunk.z, ChunkRegionLoader.getStatus(nbttagcompound)); // Paper - cache status on disk
|
||||
} catch (RegionFile.ChunkTooLargeException e) {
|
||||
printOversizedLog("ChunkTooLarge even after reduction. Trying in overzealous mode.", regionfile.file, chunkX, chunkZ);
|
||||
// Eek, major fail. We have retry logic, so reduce threshholds and fall back
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
index e42bd2638..2227de3bf 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
@@ -0,0 +0,0 @@ import java.util.Objects;
|
||||
import java.util.Random;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
+import java.util.concurrent.CompletableFuture;
|
||||
import java.util.function.Predicate;
|
||||
import java.util.stream.Collectors;
|
||||
import it.unimi.dsi.fastutil.longs.Long2ObjectMap;
|
||||
@@ -0,0 +0,0 @@ public class CraftWorld implements World {
|
||||
|
||||
@Override
|
||||
public boolean isChunkGenerated(int x, int z) {
|
||||
+ // Paper start - Fix this method
|
||||
+ if (!Bukkit.isPrimaryThread()) {
|
||||
+ return CompletableFuture.supplyAsync(() -> {
|
||||
+ return CraftWorld.this.isChunkGenerated(x, z);
|
||||
+ }, world.getChunkProvider().serverThreadQueue).join();
|
||||
+ }
|
||||
+ IChunkAccess chunk = world.getChunkProvider().getChunkAtImmediately(x, z);
|
||||
+ if (chunk == null) {
|
||||
+ chunk = world.getChunkProvider().playerChunkMap.getUnloadingChunk(x, z);
|
||||
+ }
|
||||
+ if (chunk != null) {
|
||||
+ return chunk instanceof ProtoChunkExtension || chunk instanceof net.minecraft.server.Chunk;
|
||||
+ }
|
||||
try {
|
||||
- return world.getChunkProvider().getChunkAtIfCachedImmediately(x, z) != null || world.getChunkProvider().playerChunkMap.chunkExists(new ChunkCoordIntPair(x, z)); // Paper
|
||||
+ return world.getChunkProvider().playerChunkMap.getChunkStatusOnDisk(new ChunkCoordIntPair(x, z)) == ChunkStatus.FULL;
|
||||
+ // Paper end
|
||||
} catch (IOException ex) {
|
||||
throw new RuntimeException(ex);
|
||||
}
|
||||
@@ -0,0 +0,0 @@ public class CraftWorld implements World {
|
||||
@Override
|
||||
public boolean loadChunk(int x, int z, boolean generate) {
|
||||
org.spigotmc.AsyncCatcher.catchOp("chunk load"); // Spigot
|
||||
- IChunkAccess chunk = world.getChunkProvider().getChunkAt(x, z, generate || isChunkGenerated(x, z) ? ChunkStatus.FULL : ChunkStatus.EMPTY, true); // Paper
|
||||
+ // Paper start - Optimize this method
|
||||
+ ChunkCoordIntPair chunkPos = new ChunkCoordIntPair(x, z);
|
||||
|
||||
- // If generate = false, but the chunk already exists, we will get this back.
|
||||
- if (chunk instanceof ProtoChunkExtension) {
|
||||
- // We then cycle through again to get the full chunk immediately, rather than after the ticket addition
|
||||
- chunk = world.getChunkProvider().getChunkAt(x, z, ChunkStatus.FULL, true);
|
||||
- }
|
||||
+ if (!generate) {
|
||||
|
||||
- if (chunk instanceof net.minecraft.server.Chunk) {
|
||||
- world.getChunkProvider().addTicket(TicketType.PLUGIN, new ChunkCoordIntPair(x, z), 1, Unit.INSTANCE);
|
||||
- return true;
|
||||
+ IChunkAccess immediate = world.getChunkProvider().getChunkAtImmediately(x, z);
|
||||
+ if (immediate == null) {
|
||||
+ immediate = world.getChunkProvider().playerChunkMap.getUnloadingChunk(x, z);
|
||||
+ }
|
||||
+ if (immediate != null) {
|
||||
+ if (!(immediate instanceof ProtoChunkExtension) && !(immediate instanceof net.minecraft.server.Chunk)) {
|
||||
+ return false; // not full status
|
||||
+ }
|
||||
+ world.getChunkProvider().addTicket(TicketType.PLUGIN, chunkPos, 1, Unit.INSTANCE);
|
||||
+ world.getChunkAt(x, z); // make sure we're at ticket level 32 or lower
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
+ net.minecraft.server.RegionFile file;
|
||||
+ try {
|
||||
+ file = world.getChunkProvider().playerChunkMap.getRegionFile(chunkPos, false);
|
||||
+ } catch (IOException ex) {
|
||||
+ throw new RuntimeException(ex);
|
||||
+ }
|
||||
+
|
||||
+ ChunkStatus status = file.getStatusIfCached(x, z);
|
||||
+ if (!file.chunkExists(chunkPos) || (status != null && status != ChunkStatus.FULL)) {
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ IChunkAccess chunk = world.getChunkProvider().getChunkAt(x, z, ChunkStatus.EMPTY, true);
|
||||
+ if (!(chunk instanceof ProtoChunkExtension) && !(chunk instanceof net.minecraft.server.Chunk)) {
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ // fall through to load
|
||||
+ // we do this so we do not re-read the chunk data on disk
|
||||
}
|
||||
|
||||
- return false;
|
||||
+ world.getChunkProvider().addTicket(TicketType.PLUGIN, chunkPos, 1, Unit.INSTANCE);
|
||||
+ world.getChunkProvider().getChunkAt(x, z, ChunkStatus.FULL, true);
|
||||
+ return true;
|
||||
+ // Paper end
|
||||
}
|
||||
|
||||
@Override
|
||||
--
|
|
@ -19,15 +19,15 @@ This change ensures the chunks are always loaded when entities are
|
|||
added to the world, or a valid entity moves between chunks.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
|
||||
index 628ad8b839..cc2c139904 100644
|
||||
index 63e7f2bce..0138738b3 100644
|
||||
--- a/src/main/java/net/minecraft/server/WorldServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/WorldServer.java
|
||||
@@ -0,0 +0,0 @@ public class WorldServer extends World {
|
||||
this.getChunkAt(entity.chunkX, entity.chunkZ).a(entity, entity.chunkY);
|
||||
}
|
||||
|
||||
- if (!entity.bU() && !this.isChunkLoaded(i, k)) {
|
||||
+ if (!entity.valid && !entity.bU() && !this.isChunkLoaded(i, k)) { // Paper - always load chunks to register valid entities location
|
||||
- if (!entity.cc() && !this.isChunkLoaded(i, k)) {
|
||||
+ if (!entity.valid && !entity.cc() && !this.isChunkLoaded(i, k)) { // Paper - always load chunks to register valid entities location
|
||||
entity.inChunk = false;
|
||||
} else {
|
||||
this.getChunkAt(i, k).a(entity);
|
||||
|
@ -35,8 +35,8 @@ index 628ad8b839..cc2c139904 100644
|
|||
return false;
|
||||
}
|
||||
// CraftBukkit end
|
||||
- IChunkAccess ichunkaccess = this.getChunkAt(MathHelper.floor(entity.locX / 16.0D), MathHelper.floor(entity.locZ / 16.0D), ChunkStatus.FULL, entity.attachedToPlayer);
|
||||
+ IChunkAccess ichunkaccess = this.getChunkAt(MathHelper.floor(entity.locX / 16.0D), MathHelper.floor(entity.locZ / 16.0D), ChunkStatus.FULL, true); // Paper - always load chunks for entity adds
|
||||
- IChunkAccess ichunkaccess = this.getChunkAt(MathHelper.floor(entity.locX() / 16.0D), MathHelper.floor(entity.locZ() / 16.0D), ChunkStatus.FULL, entity.attachedToPlayer);
|
||||
+ IChunkAccess ichunkaccess = this.getChunkAt(MathHelper.floor(entity.locX() / 16.0D), MathHelper.floor(entity.locZ() / 16.0D), ChunkStatus.FULL, true); // Paper - always load chunks for entity adds
|
||||
|
||||
if (!(ichunkaccess instanceof Chunk)) {
|
||||
return false;
|
||||
|
|
|
@ -5,7 +5,7 @@ Subject: [PATCH] Fix nether portal creation
|
|||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/BlockStateListPopulator.java b/src/main/java/org/bukkit/craftbukkit/util/BlockStateListPopulator.java
|
||||
index 88fbfc01b..f66f8b323 100644
|
||||
index 60330f753..c22dbbfbe 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/util/BlockStateListPopulator.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/util/BlockStateListPopulator.java
|
||||
@@ -0,0 +0,0 @@ public class BlockStateListPopulator extends DummyGeneratorAccess {
|
||||
|
|
|
@ -6,7 +6,7 @@ Subject: [PATCH] Fix sign edit memory leak
|
|||
when a player edits a sign, a reference to their Entity is never cleand up.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
index 4a1565f4f7..6030766099 100644
|
||||
index c3feccbd6..c54e1c9a0 100644
|
||||
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
@@ -0,0 +0,0 @@ public class PlayerConnection implements PacketListenerPlayIn {
|
||||
|
@ -19,7 +19,7 @@ index 4a1565f4f7..6030766099 100644
|
|||
this.sendPacket(tileentity.getUpdatePacket()); // CraftBukkit
|
||||
return;
|
||||
diff --git a/src/main/java/net/minecraft/server/TileEntitySign.java b/src/main/java/net/minecraft/server/TileEntitySign.java
|
||||
index 1b01792730..c7aa3b350a 100644
|
||||
index 4c2273497..f051f2d3c 100644
|
||||
--- a/src/main/java/net/minecraft/server/TileEntitySign.java
|
||||
+++ b/src/main/java/net/minecraft/server/TileEntitySign.java
|
||||
@@ -0,0 +0,0 @@ public class TileEntitySign extends TileEntity implements ICommandListener { //
|
||||
|
@ -34,9 +34,9 @@ index 1b01792730..c7aa3b350a 100644
|
|||
}
|
||||
|
||||
public void a(EntityHuman entityhuman) {
|
||||
- this.j = entityhuman;
|
||||
- this.c = entityhuman;
|
||||
+ // Paper start
|
||||
+ //this.g = entityhuman;
|
||||
+ //this.c = entityhuman;
|
||||
+ signEditor = entityhuman != null ? entityhuman.getUniqueID() : null;
|
||||
+ // Paper end
|
||||
}
|
||||
|
|
|
@ -5,10 +5,10 @@ Subject: [PATCH] Fix some generation concurrency issues
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
|
||||
index e3b4e30e6..10c149fae 100644
|
||||
index 10bb06489..9ad76ab32 100644
|
||||
--- a/src/main/java/net/minecraft/server/World.java
|
||||
+++ b/src/main/java/net/minecraft/server/World.java
|
||||
@@ -0,0 +0,0 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
|
||||
@@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
|
||||
private int tileTickPosition;
|
||||
public final Map<Explosion.CacheKey, Float> explosionDensityCache = new HashMap<>(); // Paper - Optimize explosions
|
||||
public java.util.ArrayDeque<BlockRedstoneTorch.RedstoneUpdateInfo> redstoneUpdateInfos; // Paper - Move from Map in BlockRedstoneTorch to here
|
||||
|
@ -33,7 +33,7 @@ index e3b4e30e6..10c149fae 100644
|
|||
public CraftWorld getWorld() {
|
||||
return this.world;
|
||||
diff --git a/src/main/java/net/minecraft/server/WorldGenStronghold.java b/src/main/java/net/minecraft/server/WorldGenStronghold.java
|
||||
index ddf726867..c2188ceef 100644
|
||||
index b34a0683a..e002ed53f 100644
|
||||
--- a/src/main/java/net/minecraft/server/WorldGenStronghold.java
|
||||
+++ b/src/main/java/net/minecraft/server/WorldGenStronghold.java
|
||||
@@ -0,0 +0,0 @@ import javax.annotation.Nullable;
|
||||
|
@ -42,20 +42,20 @@ index ddf726867..c2188ceef 100644
|
|||
|
||||
+ /* // Paper start - no shared state
|
||||
private boolean a;
|
||||
private ChunkCoordIntPair[] aS;
|
||||
private final List<StructureStart> aT = Lists.newArrayList();
|
||||
private long aU;
|
||||
+ */
|
||||
private ChunkCoordIntPair[] aq;
|
||||
private final List<StructureStart> ar = Lists.newArrayList();
|
||||
private long as;
|
||||
+ */
|
||||
|
||||
public WorldGenStronghold(Function<Dynamic<?>, ? extends WorldGenFeatureEmptyConfiguration> function) {
|
||||
super(function);
|
||||
@@ -0,0 +0,0 @@ public class WorldGenStronghold extends StructureGenerator<WorldGenFeatureEmptyC
|
||||
|
||||
@Override
|
||||
public boolean a(ChunkGenerator<?> chunkgenerator, Random random, int i, int j) {
|
||||
public boolean a(BiomeManager biomemanager, ChunkGenerator<?> chunkgenerator, Random random, int i, int j, BiomeBase biomebase) {
|
||||
+ // Paper start
|
||||
+ /*
|
||||
if (this.aU != chunkgenerator.getSeed()) {
|
||||
if (this.as != chunkgenerator.getSeed()) {
|
||||
this.d();
|
||||
}
|
||||
+ */
|
||||
|
@ -71,7 +71,7 @@ index ddf726867..c2188ceef 100644
|
|||
+ }}
|
||||
+ // Paper end
|
||||
|
||||
- ChunkCoordIntPair[] achunkcoordintpair = this.aS;
|
||||
- ChunkCoordIntPair[] achunkcoordintpair = this.aq;
|
||||
+ ChunkCoordIntPair[] achunkcoordintpair = world.strongholdCoords; // Paper
|
||||
int k = achunkcoordintpair.length;
|
||||
|
||||
|
@ -82,9 +82,9 @@ index ddf726867..c2188ceef 100644
|
|||
private void d() {
|
||||
+ /* // Paper
|
||||
this.a = false;
|
||||
this.aS = null;
|
||||
this.aT.clear();
|
||||
+ */ // Paper
|
||||
this.aq = null;
|
||||
this.ar.clear();
|
||||
+ */ // Paper
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -101,7 +101,7 @@ index ddf726867..c2188ceef 100644
|
|||
} else {
|
||||
+ // Paper start - no shared state
|
||||
+ /*
|
||||
if (this.aU != world.getSeed()) {
|
||||
if (this.as != world.getSeed()) {
|
||||
this.d();
|
||||
}
|
||||
+ */
|
||||
|
@ -120,7 +120,7 @@ index ddf726867..c2188ceef 100644
|
|||
BlockPosition blockposition1 = null;
|
||||
BlockPosition.MutableBlockPosition blockposition_mutableblockposition = new BlockPosition.MutableBlockPosition();
|
||||
double d0 = Double.MAX_VALUE;
|
||||
- ChunkCoordIntPair[] achunkcoordintpair = this.aS;
|
||||
- ChunkCoordIntPair[] achunkcoordintpair = this.aq;
|
||||
+ ChunkCoordIntPair[] achunkcoordintpair = world.strongholdCoords; // Paper
|
||||
int j = achunkcoordintpair.length;
|
||||
|
||||
|
@ -129,8 +129,8 @@ index ddf726867..c2188ceef 100644
|
|||
}
|
||||
|
||||
private void a(ChunkGenerator<?> chunkgenerator) {
|
||||
- this.aU = chunkgenerator.getSeed();
|
||||
+ //this.aU = chunkgenerator.getSeed(); // Paper
|
||||
- this.as = chunkgenerator.getSeed();
|
||||
+ //this.as = chunkgenerator.getSeed(); // Paper
|
||||
List<BiomeBase> list = Lists.newArrayList();
|
||||
Iterator iterator = IRegistry.BIOME.iterator();
|
||||
|
||||
|
@ -138,17 +138,17 @@ index ddf726867..c2188ceef 100644
|
|||
int j = chunkgenerator.getSettings().f();
|
||||
int k = chunkgenerator.getSettings().g();
|
||||
|
||||
- this.aS = new ChunkCoordIntPair[j];
|
||||
- this.aq = new ChunkCoordIntPair[j];
|
||||
+ ChunkCoordIntPair[] strongholdCoords = chunkgenerator.getWorld().strongholdCoords = new ChunkCoordIntPair[j]; // Paper
|
||||
int l = 0;
|
||||
- Iterator iterator1 = this.aT.iterator();
|
||||
- Iterator iterator1 = this.ar.iterator();
|
||||
+ Iterator iterator1 = chunkgenerator.getWorld().strongholdStuctures.iterator(); // Paper
|
||||
|
||||
while (iterator1.hasNext()) {
|
||||
StructureStart structurestart = (StructureStart) iterator1.next();
|
||||
|
||||
- if (l < this.aS.length) {
|
||||
- this.aS[l++] = new ChunkCoordIntPair(structurestart.f(), structurestart.g());
|
||||
- if (l < this.aq.length) {
|
||||
- this.aq[l++] = new ChunkCoordIntPair(structurestart.f(), structurestart.g());
|
||||
+ if (l < strongholdCoords.length) { // Paper
|
||||
+ strongholdCoords[l++] = new ChunkCoordIntPair(structurestart.f(), structurestart.g()); // Paper
|
||||
}
|
||||
|
@ -158,12 +158,12 @@ index ddf726867..c2188ceef 100644
|
|||
double d0 = random.nextDouble() * 3.141592653589793D * 2.0D;
|
||||
int i1 = l;
|
||||
|
||||
- if (l < this.aS.length) {
|
||||
- if (l < this.aq.length) {
|
||||
+ if (l < strongholdCoords.length) { // Paper
|
||||
int j1 = 0;
|
||||
int k1 = 0;
|
||||
|
||||
- for (int l1 = 0; l1 < this.aS.length; ++l1) {
|
||||
- for (int l1 = 0; l1 < this.aq.length; ++l1) {
|
||||
+ for (int l1 = 0; l1 < strongholdCoords.length; ++l1) { // Paper
|
||||
double d1 = (double) (4 * i + i * k1 * 6) + (random.nextDouble() - 0.5D) * (double) i * 2.5D;
|
||||
int i2 = (int) Math.round(Math.cos(d0) * d1);
|
||||
|
@ -172,7 +172,7 @@ index ddf726867..c2188ceef 100644
|
|||
}
|
||||
|
||||
if (l1 >= i1) {
|
||||
- this.aS[l1] = new ChunkCoordIntPair(i2, j2);
|
||||
- this.aq[l1] = new ChunkCoordIntPair(i2, j2);
|
||||
+ strongholdCoords[l1] = new ChunkCoordIntPair(i2, j2); // Paper
|
||||
}
|
||||
|
||||
|
@ -181,8 +181,8 @@ index ddf726867..c2188ceef 100644
|
|||
++k1;
|
||||
j1 = 0;
|
||||
k += 2 * k / (k1 + 1);
|
||||
- k = Math.min(k, this.aS.length - l1);
|
||||
+ k = Math.min(k, strongholdCoords.length - l1);
|
||||
- k = Math.min(k, this.aq.length - l1);
|
||||
+ k = Math.min(k, strongholdCoords.length - l1); // Paper
|
||||
d0 += random.nextDouble() * 3.141592653589793D * 2.0D;
|
||||
}
|
||||
}
|
||||
|
@ -190,7 +190,7 @@ index ddf726867..c2188ceef 100644
|
|||
this.a(chunkgenerator.getSeaLevel(), this.d, 10);
|
||||
} while (this.b.isEmpty() || worldgenstrongholdpieces_worldgenstrongholdstart.b == null);
|
||||
|
||||
- ((WorldGenStronghold) this.k()).aT.add(this);
|
||||
- ((WorldGenStronghold) this.l()).ar.add(this);
|
||||
+ chunkgenerator.getWorld().strongholdStuctures.add(this); // Paper - this worries me, this is never cleared, even in vanilla (world seed never changes "world", and that appears to be the only relevant world)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@ Subject: [PATCH] Fix sounds when item frames are modified (MC-123450)
|
|||
This also fixes the adding sound playing when the item frame direction is changed.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityItemFrame.java b/src/main/java/net/minecraft/server/EntityItemFrame.java
|
||||
index 6f6837ec4..b078435c6 100644
|
||||
index 9b1e07452..f8a2f32f1 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityItemFrame.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityItemFrame.java
|
||||
@@ -0,0 +0,0 @@ public class EntityItemFrame extends EntityHanging {
|
||||
|
|
|
@ -6,7 +6,7 @@ Subject: [PATCH] Fix spawning of hanging entities that are not ItemFrames and
|
|||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
index 243722b6..f33d9c8b 100644
|
||||
index b1ae19be7..cd519a546 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
@@ -0,0 +0,0 @@ public class CraftWorld implements World {
|
||||
|
|
|
@ -5,7 +5,7 @@ Subject: [PATCH] Fix stuck in sneak when changing worlds (MC-10657)
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
|
||||
index 7801879c8..8541dbe8d 100644
|
||||
index 19ba79c65..453f02561 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
|
||||
@@ -0,0 +0,0 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
|
@ -18,7 +18,7 @@ index 7801879c8..8541dbe8d 100644
|
|||
PlayerChangedWorldEvent changeEvent = new PlayerChangedWorldEvent(this.getBukkitEntity(), worldserver.getWorld());
|
||||
this.world.getServer().getPluginManager().callEvent(changeEvent);
|
||||
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
|
||||
index 3cb443c4f..4ba349e1a 100644
|
||||
index f702619aa..7b79ee4fe 100644
|
||||
--- a/src/main/java/net/minecraft/server/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/PlayerList.java
|
||||
@@ -0,0 +0,0 @@ public abstract class PlayerList {
|
||||
|
@ -28,8 +28,6 @@ index 3cb443c4f..4ba349e1a 100644
|
|||
+ entityplayer.setSneaking(false); // Paper - fix MC-10657
|
||||
+
|
||||
// Fire advancement trigger
|
||||
entityplayer.b(((CraftWorld) fromWorld).getHandle());
|
||||
entityplayer.triggerDimensionAdvancements(((CraftWorld) fromWorld).getHandle());
|
||||
|
||||
--
|
||||
2.23.0.rc1
|
||||
|
||||
--
|
|
@ -5,7 +5,7 @@ Subject: [PATCH] Fix zero-tick instant grow farms MC-113809
|
|||
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
index 7723b1c15..af07f9a16 100644
|
||||
index fd9bedf5a..8648d9e3d 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
@@ -0,0 +0,0 @@ public class PaperWorldConfig {
|
||||
|
@ -21,77 +21,77 @@ index 7723b1c15..af07f9a16 100644
|
|||
public Map<Material, Integer> altItemDespawnRateMap;
|
||||
private void altItemDespawnRate() {
|
||||
diff --git a/src/main/java/net/minecraft/server/Block.java b/src/main/java/net/minecraft/server/Block.java
|
||||
index e077359b0..619237d68 100644
|
||||
index 46490a943..54a61283e 100644
|
||||
--- a/src/main/java/net/minecraft/server/Block.java
|
||||
+++ b/src/main/java/net/minecraft/server/Block.java
|
||||
@@ -0,0 +0,0 @@ public class Block implements IMaterial {
|
||||
private final float frictionFactor;
|
||||
private final float g;
|
||||
protected final BlockStateList<Block, IBlockData> blockStateList;
|
||||
private IBlockData blockData;
|
||||
+ public boolean randomTick = false; // Paper - fix MC-113809
|
||||
protected final boolean v;
|
||||
private final boolean g;
|
||||
@Nullable
|
||||
private final boolean i;
|
||||
private final boolean j;
|
||||
diff --git a/src/main/java/net/minecraft/server/BlockBamboo.java b/src/main/java/net/minecraft/server/BlockBamboo.java
|
||||
index ffb65776c..3a9c3b54a 100644
|
||||
index c482aad3e..02c548dd9 100644
|
||||
--- a/src/main/java/net/minecraft/server/BlockBamboo.java
|
||||
+++ b/src/main/java/net/minecraft/server/BlockBamboo.java
|
||||
@@ -0,0 +0,0 @@ public class BlockBamboo extends Block implements IBlockFragilePlantElement {
|
||||
if (!iblockdata.canPlace(world, blockposition)) {
|
||||
world.b(blockposition, true);
|
||||
if (!iblockdata.canPlace(worldserver, blockposition)) {
|
||||
worldserver.b(blockposition, true);
|
||||
} else if ((Integer) iblockdata.get(BlockBamboo.f) == 0) {
|
||||
+ if (world.paperConfig.fixZeroTickInstantGrowFarms && !randomTick) return; // Paper - fix MC-113809
|
||||
if (world.random.nextInt(Math.max(1, (int) (100.0F / world.spigotConfig.bambooModifier) * 3)) == 0 && world.isEmpty(blockposition.up()) && world.getLightLevel(blockposition.up(), 0) >= 9) { // Spigot
|
||||
int i = this.b((IBlockAccess) world, blockposition) + 1;
|
||||
+ if (worldserver.paperConfig.fixZeroTickInstantGrowFarms && !randomTick) return; // Paper - fix MC-113809
|
||||
if (random.nextInt(Math.max(1, (int) (100.0F / worldserver.spigotConfig.bambooModifier) * 3)) == 0 && worldserver.isEmpty(blockposition.up()) && worldserver.getLightLevel(blockposition.up(), 0) >= 9) { // Spigot
|
||||
int i = this.b(worldserver, blockposition) + 1;
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/BlockCactus.java b/src/main/java/net/minecraft/server/BlockCactus.java
|
||||
index 29f9ff6c1..124b4b4b0 100644
|
||||
index 4c82fe335..728491dd9 100644
|
||||
--- a/src/main/java/net/minecraft/server/BlockCactus.java
|
||||
+++ b/src/main/java/net/minecraft/server/BlockCactus.java
|
||||
@@ -0,0 +0,0 @@ public class BlockCactus extends Block {
|
||||
if (!iblockdata.canPlace(world, blockposition)) {
|
||||
world.b(blockposition, true);
|
||||
if (!iblockdata.canPlace(worldserver, blockposition)) {
|
||||
worldserver.b(blockposition, true);
|
||||
} else {
|
||||
+ if (world.paperConfig.fixZeroTickInstantGrowFarms && !randomTick) return; // Paper - fix MC-113809
|
||||
BlockPosition blockposition1 = blockposition.up();
|
||||
|
||||
if (world.isEmpty(blockposition1)) {
|
||||
if (worldserver.isEmpty(blockposition1)) {
|
||||
diff --git a/src/main/java/net/minecraft/server/BlockChorusFlower.java b/src/main/java/net/minecraft/server/BlockChorusFlower.java
|
||||
index 74fa4889f..cde2524ca 100644
|
||||
index d70b52cad..ff0ba15f8 100644
|
||||
--- a/src/main/java/net/minecraft/server/BlockChorusFlower.java
|
||||
+++ b/src/main/java/net/minecraft/server/BlockChorusFlower.java
|
||||
@@ -0,0 +0,0 @@ public class BlockChorusFlower extends Block {
|
||||
if (!iblockdata.canPlace(world, blockposition)) {
|
||||
world.b(blockposition, true);
|
||||
if (!iblockdata.canPlace(worldserver, blockposition)) {
|
||||
worldserver.b(blockposition, true);
|
||||
} else {
|
||||
+ if (world.paperConfig.fixZeroTickInstantGrowFarms && !randomTick) return; // Paper - fix MC-113809
|
||||
BlockPosition blockposition1 = blockposition.up();
|
||||
|
||||
if (world.isEmpty(blockposition1) && blockposition1.getY() < 256) {
|
||||
if (worldserver.isEmpty(blockposition1) && blockposition1.getY() < 256) {
|
||||
diff --git a/src/main/java/net/minecraft/server/BlockReed.java b/src/main/java/net/minecraft/server/BlockReed.java
|
||||
index ff674a9d5..a4850c070 100644
|
||||
index baa2ed2b6..083b7ee59 100644
|
||||
--- a/src/main/java/net/minecraft/server/BlockReed.java
|
||||
+++ b/src/main/java/net/minecraft/server/BlockReed.java
|
||||
@@ -0,0 +0,0 @@ public class BlockReed extends Block {
|
||||
if (!iblockdata.canPlace(world, blockposition)) {
|
||||
world.b(blockposition, true);
|
||||
} else if (world.isEmpty(blockposition.up())) {
|
||||
+ if (world.paperConfig.fixZeroTickInstantGrowFarms && !randomTick) return; // Paper - fix MC-113809
|
||||
if (!iblockdata.canPlace(worldserver, blockposition)) {
|
||||
worldserver.b(blockposition, true);
|
||||
} else if (worldserver.isEmpty(blockposition.up())) {
|
||||
+ if (worldserver.paperConfig.fixZeroTickInstantGrowFarms && !randomTick) return; // Paper - fix MC-113809
|
||||
int i;
|
||||
|
||||
for (i = 1; world.getType(blockposition.down(i)).getBlock() == this; ++i) {
|
||||
for (i = 1; worldserver.getType(blockposition.down(i)).getBlock() == this; ++i) {
|
||||
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
|
||||
index bd1e4dbae..5b18f4bd5 100644
|
||||
index fd42390d4..4c53f8063 100644
|
||||
--- a/src/main/java/net/minecraft/server/WorldServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/WorldServer.java
|
||||
@@ -0,0 +0,0 @@ public class WorldServer extends World {
|
||||
IBlockData iblockdata = chunksection.getType(blockposition2.getX() - j, blockposition2.getY() - j1, blockposition2.getZ() - k);
|
||||
IBlockData iblockdata = this.getType(nextticklistentry.a);
|
||||
|
||||
if (iblockdata.q()) {
|
||||
+ iblockdata.getBlock().randomTick = true; // Paper - fix MC-113809
|
||||
iblockdata.b((World) this, blockposition2, this.random);
|
||||
+ iblockdata.getBlock().randomTick = false; // Paper - fix MC-113809
|
||||
}
|
||||
if (iblockdata.getBlock() == nextticklistentry.b()) {
|
||||
+ iblockdata.getBlock().randomTick = true; // Paper - fix MC-113809
|
||||
iblockdata.a(this, nextticklistentry.a, this.random);
|
||||
+ iblockdata.getBlock().randomTick = false; // Paper - fix MC-113809
|
||||
}
|
||||
|
||||
Fluid fluid = iblockdata.p();
|
||||
}
|
||||
--
|
|
@ -12,15 +12,16 @@ issue in 1.8-1.12.
|
|||
Originally solved by Gnembon on MC-5694 at bugs.mojang.com
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/PlayerInteractManager.java b/src/main/java/net/minecraft/server/PlayerInteractManager.java
|
||||
index e5e9de542..c96564a59 100644
|
||||
index 8720dd120..cc77dd8e5 100644
|
||||
--- a/src/main/java/net/minecraft/server/PlayerInteractManager.java
|
||||
+++ b/src/main/java/net/minecraft/server/PlayerInteractManager.java
|
||||
@@ -0,0 +0,0 @@ public class PlayerInteractManager {
|
||||
int j = (int) (f * 10.0F);
|
||||
|
||||
this.world.a(this.player.getId(), blockposition, j);
|
||||
- this.player.playerConnection.sendPacket(new PacketPlayOutBlockBreak(blockposition, this.world.getType(blockposition), packetplayinblockdig_enumplayerdigtype, true, "actual start of destroying"));
|
||||
+ this.player.playerConnection.sendPacket(new PacketPlayOutBlockChange(this.world, blockposition)); // Paper - fixes MC-156852
|
||||
this.player.playerConnection.sendPacket(new PacketPlayOutBlockBreak(blockposition, this.world.getType(blockposition), packetplayinblockdig_enumplayerdigtype, true));
|
||||
this.l = j;
|
||||
}
|
||||
} else if (packetplayinblockdig_enumplayerdigtype == PacketPlayInBlockDig.EnumPlayerDigType.STOP_DESTROY_BLOCK) {
|
||||
--
|
|
@ -5,7 +5,7 @@ Subject: [PATCH] Generator Settings
|
|||
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
index 09c8ea2ed..7723b1c15 100644
|
||||
index f63525d67..fd9bedf5a 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
@@ -0,0 +0,0 @@ public class PaperWorldConfig {
|
||||
|
@ -19,7 +19,7 @@ index 09c8ea2ed..7723b1c15 100644
|
|||
+ }
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/ChunkGeneratorAbstract.java b/src/main/java/net/minecraft/server/ChunkGeneratorAbstract.java
|
||||
index 096866b2b..338b67c3c 100644
|
||||
index af81a8414..2268fbdd8 100644
|
||||
--- a/src/main/java/net/minecraft/server/ChunkGeneratorAbstract.java
|
||||
+++ b/src/main/java/net/minecraft/server/ChunkGeneratorAbstract.java
|
||||
@@ -0,0 +0,0 @@ public abstract class ChunkGeneratorAbstract<T extends GeneratorSettingsDefault>
|
||||
|
|
|
@ -11,7 +11,7 @@ Use -DPaper.excessiveSignsLimit=500 to configure that limit, or -1
|
|||
to disable the limit and let your players be abused.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/NetworkManager.java b/src/main/java/net/minecraft/server/NetworkManager.java
|
||||
index b1dededc15..e156804f7a 100644
|
||||
index b1dededc1..e156804f7 100644
|
||||
--- a/src/main/java/net/minecraft/server/NetworkManager.java
|
||||
+++ b/src/main/java/net/minecraft/server/NetworkManager.java
|
||||
@@ -0,0 +0,0 @@ public class NetworkManager extends SimpleChannelInboundHandler<Packet<?>> {
|
||||
|
@ -31,7 +31,7 @@ index b1dededc15..e156804f7a 100644
|
|||
|
||||
private void sendPacketQueue() { this.o(); } // Paper - OBFHELPER
|
||||
diff --git a/src/main/java/net/minecraft/server/Packet.java b/src/main/java/net/minecraft/server/Packet.java
|
||||
index 2d8e6a2f4a..8d0965a053 100644
|
||||
index 2d8e6a2f4..8d0965a05 100644
|
||||
--- a/src/main/java/net/minecraft/server/Packet.java
|
||||
+++ b/src/main/java/net/minecraft/server/Packet.java
|
||||
@@ -0,0 +0,0 @@ public interface Packet<T extends PacketListener> {
|
||||
|
@ -43,7 +43,7 @@ index 2d8e6a2f4a..8d0965a053 100644
|
|||
return false;
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java b/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java
|
||||
index 58eccd9c63..ef71a1feb3 100644
|
||||
index a0b87f89d..47710067a 100644
|
||||
--- a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java
|
||||
+++ b/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java
|
||||
@@ -0,0 +0,0 @@ public class PacketPlayOutMapChunk implements Packet<PacketListenerPlayOut> {
|
||||
|
@ -63,8 +63,8 @@ index 58eccd9c63..ef71a1feb3 100644
|
|||
ChunkCoordIntPair chunkcoordintpair = chunk.getPos();
|
||||
|
||||
@@ -0,0 +0,0 @@ public class PacketPlayOutMapChunk implements Packet<PacketListenerPlayOut> {
|
||||
this.c = this.a(new PacketDataSerializer(this.i()), chunk, i);
|
||||
this.f = Lists.newArrayList();
|
||||
this.c = this.a(new PacketDataSerializer(this.j()), chunk, i);
|
||||
this.g = Lists.newArrayList();
|
||||
iterator = chunk.getTileEntities().entrySet().iterator();
|
||||
+ int totalSigns = 0; // Paper
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ If a players inventory is too big to send in a single packet,
|
|||
split the inventory set into multiple packets instead.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/NetworkManager.java b/src/main/java/net/minecraft/server/NetworkManager.java
|
||||
index 046196d54d..d4aad8a5b7 100644
|
||||
index 046196d54..d4aad8a5b 100644
|
||||
--- a/src/main/java/net/minecraft/server/NetworkManager.java
|
||||
+++ b/src/main/java/net/minecraft/server/NetworkManager.java
|
||||
@@ -0,0 +0,0 @@ public class NetworkManager extends SimpleChannelInboundHandler<Packet<?>> {
|
||||
|
@ -27,7 +27,7 @@ index 046196d54d..d4aad8a5b7 100644
|
|||
NetworkManager.LOGGER.debug("Skipping packet due to errors", throwable.getCause());
|
||||
} else {
|
||||
diff --git a/src/main/java/net/minecraft/server/Packet.java b/src/main/java/net/minecraft/server/Packet.java
|
||||
index 601d4d0fa2..2d8e6a2f4a 100644
|
||||
index 601d4d0fa..2d8e6a2f4 100644
|
||||
--- a/src/main/java/net/minecraft/server/Packet.java
|
||||
+++ b/src/main/java/net/minecraft/server/Packet.java
|
||||
@@ -0,0 +0,0 @@ public interface Packet<T extends PacketListener> {
|
||||
|
@ -44,7 +44,7 @@ index 601d4d0fa2..2d8e6a2f4a 100644
|
|||
return false;
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/PacketEncoder.java b/src/main/java/net/minecraft/server/PacketEncoder.java
|
||||
index 63c4dbd327..b0cfef52cb 100644
|
||||
index 63c4dbd32..b0cfef52c 100644
|
||||
--- a/src/main/java/net/minecraft/server/PacketEncoder.java
|
||||
+++ b/src/main/java/net/minecraft/server/PacketEncoder.java
|
||||
@@ -0,0 +0,0 @@ public class PacketEncoder extends MessageToByteEncoder<Packet<?>> {
|
||||
|
@ -80,20 +80,20 @@ index 63c4dbd327..b0cfef52cb 100644
|
|||
+ // Paper end
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java b/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java
|
||||
index d19a30ad87..58eccd9c63 100644
|
||||
index 1fcbbd698..a0b87f89d 100644
|
||||
--- a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java
|
||||
+++ b/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java
|
||||
@@ -0,0 +0,0 @@ public class PacketPlayOutMapChunk implements Packet<PacketListenerPlayOut> {
|
||||
this.d = packetdataserializer.l();
|
||||
|
||||
int i = packetdataserializer.i();
|
||||
|
||||
- if (i > 2097152) {
|
||||
+ if (i > 2097152) { // Paper - if this changes, update PacketEncoder
|
||||
throw new RuntimeException("Chunk Packet trying to allocate too much memory on read.");
|
||||
} else {
|
||||
this.e = new byte[i];
|
||||
this.f = new byte[i];
|
||||
diff --git a/src/main/java/net/minecraft/server/PacketPlayOutWindowItems.java b/src/main/java/net/minecraft/server/PacketPlayOutWindowItems.java
|
||||
index f7c3655671..631234324d 100644
|
||||
index f7c365567..631234324 100644
|
||||
--- a/src/main/java/net/minecraft/server/PacketPlayOutWindowItems.java
|
||||
+++ b/src/main/java/net/minecraft/server/PacketPlayOutWindowItems.java
|
||||
@@ -0,0 +0,0 @@ public class PacketPlayOutWindowItems implements Packet<PacketListenerPlayOut> {
|
||||
|
|
|
@ -1,61 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Shane Freeder <theboyetronic@gmail.com>
|
||||
Date: Mon, 15 Apr 2019 02:24:52 +0100
|
||||
Subject: [PATCH] Handle bad chunks more gracefully
|
||||
|
||||
Prior to this change the server would crash when attempting to load a
|
||||
chunk from a region with bad data.
|
||||
|
||||
After this change the server will defer back to vanilla behavior. At
|
||||
this time, that means attempting to generate a chunk in its place
|
||||
(and occasionally just not generating anything and leaving small
|
||||
holes in the world (This statement might not be accurate as of 1.13.x)).
|
||||
|
||||
Should Mojang choose to alter this behavior in the future, this change
|
||||
will simply defer to whatever that new behavior is.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/RegionFileCache.java b/src/main/java/net/minecraft/server/RegionFileCache.java
|
||||
index c53518a47..6f34d8aea 100644
|
||||
--- a/src/main/java/net/minecraft/server/RegionFileCache.java
|
||||
+++ b/src/main/java/net/minecraft/server/RegionFileCache.java
|
||||
@@ -0,0 +0,0 @@ public abstract class RegionFileCache implements AutoCloseable {
|
||||
private static NBTTagCompound readOversizedChunk(RegionFile regionfile, ChunkCoordIntPair chunkCoordinate) throws IOException {
|
||||
synchronized (regionfile) {
|
||||
try (DataInputStream datainputstream = regionfile.getReadStream(chunkCoordinate)) {
|
||||
- NBTTagCompound oversizedData = regionfile.getOversizedData(chunkCoordinate.x, chunkCoordinate.z);
|
||||
- NBTTagCompound chunk = NBTCompressedStreamTools.readNBT(datainputstream);
|
||||
+ // Paper start - Handle bad chunks more gracefully - also handle similarly with oversized data
|
||||
+ NBTTagCompound oversizedData = null;
|
||||
+
|
||||
+ try {
|
||||
+ oversizedData = regionfile.getOversizedData(chunkCoordinate.x, chunkCoordinate.z);
|
||||
+ } catch (Exception ex) {}
|
||||
+
|
||||
+ NBTTagCompound chunk;
|
||||
+
|
||||
+ try {
|
||||
+ chunk = NBTCompressedStreamTools.readNBT(datainputstream);
|
||||
+ } catch (final Exception ex) {
|
||||
+ return null;
|
||||
+ }
|
||||
+ // Paper end
|
||||
if (oversizedData == null) {
|
||||
return chunk;
|
||||
}
|
||||
@@ -0,0 +0,0 @@ public abstract class RegionFileCache implements AutoCloseable {
|
||||
|
||||
try {
|
||||
if (datainputstream != null) {
|
||||
- nbttagcompound = NBTCompressedStreamTools.a(datainputstream);
|
||||
- return nbttagcompound;
|
||||
+ // Paper start - Handle bad chunks more gracefully
|
||||
+ try {
|
||||
+ return NBTCompressedStreamTools.a(datainputstream);
|
||||
+ } catch (Exception ex) {
|
||||
+ return null;
|
||||
+ }
|
||||
+ // Paper end
|
||||
}
|
||||
|
||||
nbttagcompound = null;
|
||||
--
|
|
@ -5,20 +5,20 @@ Subject: [PATCH] Here's Johnny!
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityVindicator.java b/src/main/java/net/minecraft/server/EntityVindicator.java
|
||||
index 06918b8c91..ffbd6e9269 100644
|
||||
index 73ecdd22e..c974c02e9 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityVindicator.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityVindicator.java
|
||||
@@ -0,0 +0,0 @@ public class EntityVindicator extends EntityIllagerAbstract {
|
||||
private static final Predicate<EnumDifficulty> b = (enumdifficulty) -> {
|
||||
return enumdifficulty == EnumDifficulty.NORMAL || enumdifficulty == EnumDifficulty.HARD;
|
||||
};
|
||||
- private boolean bz;
|
||||
+ private boolean bz; public boolean isJohnny() { return bz; } public void setJohnny(boolean johnny) { bz = johnny; } // Paper - OBFHELPER
|
||||
- private boolean bw;
|
||||
+ private boolean bw; public boolean isJohnny() { return bw; } public void setJohnny(boolean johnny) { bw = johnny; } // Paper - OBFHELPER
|
||||
|
||||
public EntityVindicator(EntityTypes<? extends EntityVindicator> entitytypes, World world) {
|
||||
super(entitytypes, world);
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftVindicator.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftVindicator.java
|
||||
index 951d479298..5ff957ced7 100644
|
||||
index 951d47929..5ff957ced 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftVindicator.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftVindicator.java
|
||||
@@ -0,0 +0,0 @@ public class CraftVindicator extends CraftIllager implements Vindicator {
|
||||
|
|
|
@ -5,7 +5,7 @@ Subject: [PATCH] Honor EntityAgeable.ageLock
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityAgeable.java b/src/main/java/net/minecraft/server/EntityAgeable.java
|
||||
index da9740a99e..e87754ef33 100644
|
||||
index cec938436..3d27f0964 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityAgeable.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityAgeable.java
|
||||
@@ -0,0 +0,0 @@ public abstract class EntityAgeable extends EntityCreature {
|
||||
|
|
|
@ -8,7 +8,7 @@ our own relocation. Also lets us rewrite NMS calls for when we're
|
|||
debugging in an IDE pre-relocate.
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java
|
||||
index 467b2d9385..61f1023557 100644
|
||||
index 467b2d938..61f102355 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java
|
||||
@@ -0,0 +0,0 @@ import java.io.FileOutputStream;
|
||||
|
|
|
@ -49,7 +49,7 @@ index 000000000..99f99330d
|
|||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/net/minecraft/server/IBlockData.java b/src/main/java/net/minecraft/server/IBlockData.java
|
||||
index 9fd1b4915..21f734a73 100644
|
||||
index 8fb0b5af0..276f207a8 100644
|
||||
--- a/src/main/java/net/minecraft/server/IBlockData.java
|
||||
+++ b/src/main/java/net/minecraft/server/IBlockData.java
|
||||
@@ -0,0 +0,0 @@ public class IBlockData extends BlockDataAbstract<Block, IBlockData> implements
|
||||
|
@ -61,42 +61,42 @@ index 9fd1b4915..21f734a73 100644
|
|||
return this.getBlock().getStepSound(this);
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/SoundEffectType.java b/src/main/java/net/minecraft/server/SoundEffectType.java
|
||||
index 5460d409b..ccd5b0529 100644
|
||||
index b774d2d8d..0184bf3fc 100644
|
||||
--- a/src/main/java/net/minecraft/server/SoundEffectType.java
|
||||
+++ b/src/main/java/net/minecraft/server/SoundEffectType.java
|
||||
@@ -0,0 +0,0 @@ public class SoundEffectType {
|
||||
public static final SoundEffectType v = new SoundEffectType(1.0F, 1.0F, SoundEffects.BLOCK_LANTERN_BREAK, SoundEffects.BLOCK_LANTERN_STEP, SoundEffects.BLOCK_LANTERN_PLACE, SoundEffects.BLOCK_LANTERN_HIT, SoundEffects.BLOCK_LANTERN_FALL);
|
||||
public final float w;
|
||||
public static final SoundEffectType w = new SoundEffectType(1.0F, 1.0F, SoundEffects.BLOCK_LANTERN_BREAK, SoundEffects.BLOCK_LANTERN_STEP, SoundEffects.BLOCK_LANTERN_PLACE, SoundEffects.BLOCK_LANTERN_HIT, SoundEffects.BLOCK_LANTERN_FALL);
|
||||
public final float x;
|
||||
- private final SoundEffect y;
|
||||
+ private final SoundEffect y; public final SoundEffect getBreakSound() { return this.y; } // Paper - OBFHELPER
|
||||
private final SoundEffect z;
|
||||
public final float y;
|
||||
- private final SoundEffect z;
|
||||
+ private final SoundEffect z; public final SoundEffect getBreakSound() { return this.z; } // Paper - OBFHELPER
|
||||
private final SoundEffect A;
|
||||
- private final SoundEffect B;
|
||||
+ private final SoundEffect B; public final SoundEffect getHitSound() { return this.B; } // Paper - OBFHELPER
|
||||
private final SoundEffect C;
|
||||
private final SoundEffect B;
|
||||
- private final SoundEffect C;
|
||||
+ private final SoundEffect C; public final SoundEffect getHitSound() { return this.B; } // Paper - OBFHELPER
|
||||
private final SoundEffect D;
|
||||
|
||||
public SoundEffectType(float f, float f1, SoundEffect soundeffect, SoundEffect soundeffect1, SoundEffect soundeffect2, SoundEffect soundeffect3, SoundEffect soundeffect4) {
|
||||
@@ -0,0 +0,0 @@ public class SoundEffectType {
|
||||
return this.x;
|
||||
return this.y;
|
||||
}
|
||||
|
||||
+ public final SoundEffect getStepSound() { return this.d(); } // Paper - OBFHELPER
|
||||
public SoundEffect d() {
|
||||
return this.z;
|
||||
return this.A;
|
||||
}
|
||||
|
||||
+ public final SoundEffect getPlaceSound() { return this.e(); } // Paper - OBFHELPER
|
||||
public SoundEffect e() {
|
||||
return this.A;
|
||||
return this.B;
|
||||
}
|
||||
|
||||
+ public final SoundEffect getFallSound() { return this.g(); } // Paper - OBFHELPER
|
||||
public SoundEffect g() {
|
||||
return this.C;
|
||||
return this.D;
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
|
||||
index da3c50c70..d9749adb7 100644
|
||||
index 887ade5e8..aef8dd169 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
|
||||
@@ -0,0 +0,0 @@ public class CraftBlock implements Block {
|
||||
|
|
|
@ -5,7 +5,7 @@ Subject: [PATCH] Implement PlayerPostRespawnEvent
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
|
||||
index abddc8895e..a183bb450d 100644
|
||||
index 49437f212..68e089a4b 100644
|
||||
--- a/src/main/java/net/minecraft/server/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/PlayerList.java
|
||||
@@ -0,0 +0,0 @@ public abstract class PlayerList {
|
||||
|
|
|
@ -5,7 +5,7 @@ Subject: [PATCH] Implement alternative item-despawn-rate
|
|||
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
index 56ca65819..b1ad22c9f 100644
|
||||
index 097b623fd..d0f5b2ab7 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
@@ -0,0 +0,0 @@
|
||||
|
@ -80,10 +80,10 @@ index 56ca65819..b1ad22c9f 100644
|
|||
+ }
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityItem.java b/src/main/java/net/minecraft/server/EntityItem.java
|
||||
index bc7e706d1..df26cef6a 100644
|
||||
index a0d1e7fd2..e61af3f5e 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityItem.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityItem.java
|
||||
@@ -0,0 +0,0 @@ import java.util.List;
|
||||
@@ -0,0 +0,0 @@ import java.util.Objects;
|
||||
import java.util.UUID;
|
||||
import javax.annotation.Nullable;
|
||||
// CraftBukkit start
|
||||
|
@ -111,8 +111,8 @@ index bc7e706d1..df26cef6a 100644
|
|||
this.age = 0;
|
||||
@@ -0,0 +0,0 @@ public class EntityItem extends Entity {
|
||||
|
||||
public void u() {
|
||||
this.p();
|
||||
public void s() {
|
||||
this.o();
|
||||
- this.age = world.spigotConfig.itemDespawnRate - 1; // Spigot
|
||||
+ this.age = this.getDespawnRate() - 1; // Spigot // Paper
|
||||
}
|
||||
|
@ -125,6 +125,6 @@ index bc7e706d1..df26cef6a 100644
|
|||
+ // Paper end
|
||||
+
|
||||
@Override
|
||||
public Packet<?> N() {
|
||||
public Packet<?> L() {
|
||||
return new PacketPlayOutSpawnEntity(this);
|
||||
--
|
|
@ -5,7 +5,7 @@ Subject: [PATCH] Implement an API for CanPlaceOn and CanDestroy NBT values
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/ArgumentBlock.java b/src/main/java/net/minecraft/server/ArgumentBlock.java
|
||||
index 005ebec266..97d85f8451 100644
|
||||
index 005ebec26..97d85f845 100644
|
||||
--- a/src/main/java/net/minecraft/server/ArgumentBlock.java
|
||||
+++ b/src/main/java/net/minecraft/server/ArgumentBlock.java
|
||||
@@ -0,0 +0,0 @@ public class ArgumentBlock {
|
||||
|
@ -32,7 +32,7 @@ index 005ebec266..97d85f8451 100644
|
|||
this.s = this::l;
|
||||
if (this.i.canRead() && this.i.peek() == '#') {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
|
||||
index 6a6b80b5bd..dbb4e5258c 100644
|
||||
index 1eede4bcc..8a9a48bb8 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
|
||||
@@ -0,0 +0,0 @@ import org.bukkit.persistence.PersistentDataContainer;
|
||||
|
@ -284,9 +284,9 @@ index 6a6b80b5bd..dbb4e5258c 100644
|
|||
));
|
||||
}
|
||||
@@ -0,0 +0,0 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
return spigot;
|
||||
}
|
||||
// Spigot end
|
||||
// Paper end
|
||||
|
||||
+ // Paper start - Implement an API for CanPlaceOn and CanDestroy NBT values
|
||||
+ @Override
|
||||
+ @SuppressWarnings("deprecation")
|
||||
|
|
|
@ -6,7 +6,7 @@ Subject: [PATCH] Implement furnace cook speed multiplier API
|
|||
Signed-off-by: Tassu <git@tassu.me>
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/TileEntityFurnace.java b/src/main/java/net/minecraft/server/TileEntityFurnace.java
|
||||
index 2bbd3663a7..55b5646103 100644
|
||||
index 0419aea92..04849c3da 100644
|
||||
--- a/src/main/java/net/minecraft/server/TileEntityFurnace.java
|
||||
+++ b/src/main/java/net/minecraft/server/TileEntityFurnace.java
|
||||
@@ -0,0 +0,0 @@ import java.util.Map;
|
||||
|
@ -57,7 +57,7 @@ index 2bbd3663a7..55b5646103 100644
|
|||
this.cookTimeTotal = this.getRecipeCookingTime();
|
||||
this.burn(irecipe);
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftFurnace.java b/src/main/java/org/bukkit/craftbukkit/block/CraftFurnace.java
|
||||
index 9cc67915ca..1ce10ea049 100644
|
||||
index 9cc67915c..1ce10ea04 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftFurnace.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftFurnace.java
|
||||
@@ -0,0 +0,0 @@ public class CraftFurnace<T extends TileEntityFurnace> extends CraftContainer<T>
|
||||
|
|
|
@ -6,7 +6,7 @@ Subject: [PATCH] Implement getters and setters for EntityItem owner and
|
|||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java
|
||||
index 3f552b5905..cb756b1ba0 100644
|
||||
index 3f552b590..cb756b1ba 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java
|
||||
@@ -0,0 +0,0 @@ import org.bukkit.entity.EntityType;
|
||||
|
|
|
@ -1,28 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Spottedleaf <Spottedleaf@users.noreply.github.com>
|
||||
Date: Mon, 19 Aug 2019 06:33:17 -0700
|
||||
Subject: [PATCH] Improve POI data saving logic
|
||||
|
||||
- Do not unload data if world saving is disabled
|
||||
- Aggressively target unloading
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/VillagePlace.java b/src/main/java/net/minecraft/server/VillagePlace.java
|
||||
index 0e98b7803..fb99b4306 100644
|
||||
--- a/src/main/java/net/minecraft/server/VillagePlace.java
|
||||
+++ b/src/main/java/net/minecraft/server/VillagePlace.java
|
||||
@@ -0,0 +0,0 @@ public class VillagePlace extends RegionFileSection<VillagePlaceSection> {
|
||||
// Paper start - async chunk io
|
||||
if (this.world == null) {
|
||||
super.a(booleansupplier);
|
||||
- } else {
|
||||
+ } else if (!this.world.isSavingDisabled()) { // Paper - only save if saving is enabled
|
||||
//super.a(booleansupplier); // re-implement below
|
||||
- while (!((RegionFileSection)this).d.isEmpty() && booleansupplier.getAsBoolean()) {
|
||||
+ // Paper start - target unloading aggressively
|
||||
+ int queueTarget = Math.min(this.d.size() - 100, (int)(this.d.size() * 0.96));
|
||||
+ while (!((RegionFileSection)this).d.isEmpty() && (this.d.size() > queueTarget || booleansupplier.getAsBoolean())) {
|
||||
+ // Paper end
|
||||
ChunkCoordIntPair chunkcoordintpair = SectionPosition.a(((RegionFileSection)this).d.firstLong()).u();
|
||||
|
||||
NBTTagCompound data;
|
||||
--
|
|
@ -15,7 +15,7 @@ items and experience which is otherwise only properly possible by using
|
|||
internal code.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/CombatTracker.java b/src/main/java/net/minecraft/server/CombatTracker.java
|
||||
index 84c3ea9d00..f563a7b630 100644
|
||||
index 6daa400d2..38fe29f8a 100644
|
||||
--- a/src/main/java/net/minecraft/server/CombatTracker.java
|
||||
+++ b/src/main/java/net/minecraft/server/CombatTracker.java
|
||||
@@ -0,0 +0,0 @@ public class CombatTracker {
|
||||
|
@ -27,7 +27,7 @@ index 84c3ea9d00..f563a7b630 100644
|
|||
int i = this.f ? 300 : 100;
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
|
||||
index 7811beb807..f9b097fd6f 100644
|
||||
index 75343a438..b03316bc8 100644
|
||||
--- a/src/main/java/net/minecraft/server/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/server/Entity.java
|
||||
@@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
||||
|
@ -45,9 +45,9 @@ index 7811beb807..f9b097fd6f 100644
|
|||
+ public void onKill(EntityLiving entityLiving) { this.b(entityLiving); } // Paper - OBFHELPER
|
||||
public void b(EntityLiving entityliving) {}
|
||||
|
||||
protected void i(double d0, double d1, double d2) {
|
||||
protected void k(double d0, double d1, double d2) {
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityArmorStand.java b/src/main/java/net/minecraft/server/EntityArmorStand.java
|
||||
index 85fc48371d..02595cfccd 100644
|
||||
index b51662ee9..e6032e3ed 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityArmorStand.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityArmorStand.java
|
||||
@@ -0,0 +0,0 @@ public class EntityArmorStand extends EntityLiving {
|
||||
|
@ -61,7 +61,7 @@ index 85fc48371d..02595cfccd 100644
|
|||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityFox.java b/src/main/java/net/minecraft/server/EntityFox.java
|
||||
index e22e99df38..ca38ccf768 100644
|
||||
index ac8eaffb9..7495af8e3 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityFox.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityFox.java
|
||||
@@ -0,0 +0,0 @@ public class EntityFox extends EntityAnimal {
|
||||
|
@ -94,7 +94,7 @@ index e22e99df38..ca38ccf768 100644
|
|||
|
||||
public static boolean a(EntityFox entityfox, EntityLiving entityliving) {
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityHorseChestedAbstract.java b/src/main/java/net/minecraft/server/EntityHorseChestedAbstract.java
|
||||
index 2483cfd28a..2a988366cd 100644
|
||||
index 80717ad9a..53aac5bcc 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityHorseChestedAbstract.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityHorseChestedAbstract.java
|
||||
@@ -0,0 +0,0 @@ public abstract class EntityHorseChestedAbstract extends EntityHorseAbstract {
|
||||
|
@ -119,18 +119,18 @@ index 2483cfd28a..2a988366cd 100644
|
|||
public void b(NBTTagCompound nbttagcompound) {
|
||||
super.b(nbttagcompound);
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
index b09712ca91..1e53af2cce 100644
|
||||
index ac85a5d23..c6bd68919 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
@@ -0,0 +0,0 @@ public abstract class EntityLiving extends Entity {
|
||||
protected float aT;
|
||||
protected float aU;
|
||||
protected float aV;
|
||||
protected float aW;
|
||||
protected float aX;
|
||||
- protected int aY;
|
||||
+ protected int aY; protected int getKillCount() { return this.aY; } // Paper - OBFHELPER
|
||||
- protected int aW;
|
||||
+ protected int aW; protected int getKillCount() { return this.aW; } // Paper - OBFHELPER
|
||||
public float lastDamage;
|
||||
protected boolean jumping;
|
||||
public float bb;
|
||||
public float aZ;
|
||||
@@ -0,0 +0,0 @@ public abstract class EntityLiving extends Entity {
|
||||
public boolean collides = true;
|
||||
public boolean canPickUpLoot;
|
||||
|
@ -148,11 +148,11 @@ index b09712ca91..1e53af2cce 100644
|
|||
+ //SoundEffect soundeffect = this.getSoundDeath();
|
||||
|
||||
- if (flag1 && soundeffect != null) {
|
||||
- this.a(soundeffect, this.getSoundVolume(), this.cV());
|
||||
- this.a(soundeffect, this.getSoundVolume(), this.dn());
|
||||
- }
|
||||
+ //if (flag1 && soundeffect != null) {
|
||||
+ // this.a(soundeffect, this.getSoundVolume(), this.cV());
|
||||
+ //}
|
||||
+// if (flag1 && soundeffect != null) {
|
||||
+// this.a(soundeffect, this.getSoundVolume(), this.dn());
|
||||
+// }
|
||||
+ this.silentDeath = !flag1; // mark entity as dying silently
|
||||
+ // Paper end
|
||||
|
||||
|
@ -166,12 +166,12 @@ index b09712ca91..1e53af2cce 100644
|
|||
EntityLiving entityliving = this.getKillingEntity();
|
||||
|
||||
+ /* // Paper - move down to make death event cancellable
|
||||
if (this.aY >= 0 && entityliving != null) {
|
||||
entityliving.a(this, this.aY, damagesource);
|
||||
if (this.aW >= 0 && entityliving != null) {
|
||||
entityliving.a(this, this.aW, damagesource);
|
||||
}
|
||||
@@ -0,0 +0,0 @@ public abstract class EntityLiving extends Entity {
|
||||
if (this.isSleeping()) {
|
||||
this.dy();
|
||||
this.entityWakeup();
|
||||
}
|
||||
+ */ // Paper
|
||||
|
||||
|
@ -198,15 +198,7 @@ index b09712ca91..1e53af2cce 100644
|
|||
+ }
|
||||
+ // Paper end
|
||||
+
|
||||
boolean flag = false;
|
||||
|
||||
- if (entityliving instanceof EntityWither) {
|
||||
+ if (this.killed && entityliving instanceof EntityWither) {
|
||||
if (this.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING)) {
|
||||
BlockPosition blockposition = new BlockPosition(this.locX, this.locY, this.locZ);
|
||||
IBlockData iblockdata = Blocks.WITHER_ROSE.getBlockData();
|
||||
@@ -0,0 +0,0 @@ public abstract class EntityLiving extends Entity {
|
||||
}
|
||||
this.f(entityliving);
|
||||
}
|
||||
|
||||
+ if (this.killed) { // Paper
|
||||
|
@ -216,6 +208,19 @@ index b09712ca91..1e53af2cce 100644
|
|||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +0,0 @@ public abstract class EntityLiving extends Entity {
|
||||
if (!this.world.isClientSide) {
|
||||
boolean flag = false;
|
||||
|
||||
- if (entityliving instanceof EntityWither) {
|
||||
+ if (this.killed && entityliving instanceof EntityWither) { // Paper
|
||||
if (this.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING)) {
|
||||
BlockPosition blockposition = new BlockPosition(this);
|
||||
IBlockData iblockdata = Blocks.WITHER_ROSE.getBlockData();
|
||||
@@ -0,0 +0,0 @@ public abstract class EntityLiving extends Entity {
|
||||
}
|
||||
}
|
||||
|
||||
- protected void d(DamageSource damagesource) {
|
||||
+ protected org.bukkit.event.entity.EntityDeathEvent processDeath(DamageSource damagesource) { return d(damagesource); } // Paper - OBFHELPER
|
||||
+ protected org.bukkit.event.entity.EntityDeathEvent d(DamageSource damagesource) { // Paper
|
||||
|
@ -225,7 +230,7 @@ index b09712ca91..1e53af2cce 100644
|
|||
@@ -0,0 +0,0 @@ public abstract class EntityLiving extends Entity {
|
||||
boolean flag = this.lastDamageByPlayerTime > 0;
|
||||
|
||||
this.cF(); // CraftBukkit - from below // PAIL
|
||||
this.dropInventory(); // CraftBukkit - from below
|
||||
+ org.bukkit.event.entity.EntityDeathEvent deathEvent; // Paper
|
||||
if (this.isDropExperience() && this.world.getGameRules().getBoolean(GameRules.DO_MOB_LOOT)) {
|
||||
this.a(damagesource, flag);
|
||||
|
@ -242,15 +247,16 @@ index b09712ca91..1e53af2cce 100644
|
|||
+ this.postDeathDropItems(deathEvent); // Paper
|
||||
+ this.drops = new ArrayList<>(); // Paper
|
||||
|
||||
- // this.cF();// CraftBukkit - moved up
|
||||
// this.dropInventory();// CraftBukkit - moved up
|
||||
- this.dropExperience();
|
||||
+ return deathEvent; // Paper
|
||||
}
|
||||
|
||||
protected void cF() {}
|
||||
protected void dropInventory() {}
|
||||
+ protected void postDeathDropItems(org.bukkit.event.entity.EntityDeathEvent event) {} // Paper - method for post death logic that cannot be ran before the event is potentially cancelled
|
||||
|
||||
protected void dropDeathLoot(DamageSource damagesource, int i, boolean flag) {}
|
||||
|
||||
// CraftBukkit start
|
||||
public int getExpReward() {
|
||||
@@ -0,0 +0,0 @@ public abstract class EntityLiving extends Entity {
|
||||
return SoundEffects.ENTITY_GENERIC_HURT;
|
||||
}
|
||||
|
@ -268,12 +274,12 @@ index b09712ca91..1e53af2cce 100644
|
|||
return 1.0F;
|
||||
}
|
||||
|
||||
+ public float getSoundPitch() { return cV();} // Paper - OBFHELPER
|
||||
protected float cV() {
|
||||
+ public float getSoundPitch() { return dn();} // Paper - OBFHELPER
|
||||
protected float dn() {
|
||||
return this.isBaby() ? (this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.5F : (this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.0F;
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
|
||||
index 7e37164c0e..1b35e6c478 100644
|
||||
index bb2a0b7e6..26096afbe 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
|
||||
@@ -0,0 +0,0 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
|
@ -324,7 +330,7 @@ index 7e37164c0e..1b35e6c478 100644
|
|||
}
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftSound.java b/src/main/java/org/bukkit/craftbukkit/CraftSound.java
|
||||
index 73cb64e09d..9f317ff2e8 100644
|
||||
index 90fdf89c8..b761a41dc 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftSound.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftSound.java
|
||||
@@ -0,0 +0,0 @@ public enum CraftSound {
|
||||
|
@ -351,7 +357,7 @@ index 73cb64e09d..9f317ff2e8 100644
|
|||
this.minecraftKey = minecraftKey;
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index 2c99a1e9df..e9458dc65f 100644
|
||||
index 9e0be10d7..ad70bd5ba 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -0,0 +0,0 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
|
@ -372,7 +378,7 @@ index 2c99a1e9df..e9458dc65f 100644
|
|||
|
||||
public void injectScaledMaxHealth(Collection<AttributeInstance> collection, boolean force) {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
index 84c292168e..dc15703fd4 100644
|
||||
index 844781f4e..4fb1092ce 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
@@ -0,0 +0,0 @@ public class CraftEventFactory {
|
||||
|
|
|
@ -8,7 +8,7 @@ worlds loaded. This is typically a rare occurrence but probably one that
|
|||
should be covered as best we can.
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java b/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java
|
||||
index 6a448c02ec..c1ef1c950d 100644
|
||||
index 6a448c02e..c1ef1c950 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java
|
||||
@@ -0,0 +0,0 @@ import org.bukkit.plugin.Plugin;
|
||||
|
|
|
@ -22,7 +22,7 @@ it only impacts data sent from the client.
|
|||
Set -DPaper.maxSignLength=XX to change limit or -1 to disable
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
index 6030766099..b030269f0a 100644
|
||||
index c54e1c9a0..bd2ee459f 100644
|
||||
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
@@ -0,0 +0,0 @@ public class PlayerConnection implements PacketListenerPlayIn {
|
||||
|
|
|
@ -5,14 +5,13 @@ Subject: [PATCH] Limit lightning strike effect distance
|
|||
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
index 4a4e9d715..3b24fbdbf 100644
|
||||
index e49318a19..fe3e78f36 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
@@ -0,0 +0,0 @@ public class PaperWorldConfig {
|
||||
skeleHorseSpawnChance = 0.01D; // Vanilla value
|
||||
}
|
||||
}
|
||||
+
|
||||
|
||||
+ public double sqrMaxThunderDistance;
|
||||
+ public double sqrMaxLightningImpactSoundDistance;
|
||||
+ public double maxLightningFlashDistance;
|
||||
|
@ -34,16 +33,17 @@ index 4a4e9d715..3b24fbdbf 100644
|
|||
+ maxLightningFlashDistance = 512; // Vanilla value
|
||||
+ }
|
||||
+ }
|
||||
|
||||
+
|
||||
public int fixedInhabitedTime;
|
||||
private void fixedInhabitedTime() {
|
||||
if (PaperConfig.version < 16) {
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityLightning.java b/src/main/java/net/minecraft/server/EntityLightning.java
|
||||
index 2ceee79cf..27bf271bb 100644
|
||||
index 7c518983a..0bd67395e 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityLightning.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityLightning.java
|
||||
@@ -0,0 +0,0 @@ public class EntityLightning extends Entity {
|
||||
double deltaX = this.locX - player.locX;
|
||||
double deltaZ = this.locZ - player.locZ;
|
||||
double deltaX = this.locX() - player.locX();
|
||||
double deltaZ = this.locZ() - player.locZ();
|
||||
double distanceSquared = deltaX * deltaX + deltaZ * deltaZ;
|
||||
+ // Paper start - Limit lightning strike effect distance
|
||||
+ if (distanceSquared <= this.world.paperConfig.sqrMaxLightningImpactSoundDistance) {
|
||||
|
@ -58,26 +58,26 @@ index 2ceee79cf..27bf271bb 100644
|
|||
+ // Paper end
|
||||
if (distanceSquared > viewDistance * viewDistance) {
|
||||
double deltaLength = Math.sqrt(distanceSquared);
|
||||
double relativeX = player.locX + (deltaX / deltaLength) * viewDistance;
|
||||
double relativeX = player.locX() + (deltaX / deltaLength) * viewDistance;
|
||||
@@ -0,0 +0,0 @@ public class EntityLightning extends Entity {
|
||||
}
|
||||
}
|
||||
// CraftBukkit end
|
||||
- this.world.playSound((EntityHuman) null, this.locX, this.locY, this.locZ, SoundEffects.ENTITY_LIGHTNING_BOLT_IMPACT, SoundCategory.WEATHER, 2.0F, 0.5F + this.random.nextFloat() * 0.2F);
|
||||
+ //this.world.playSound((EntityHuman) null, this.locX, this.locY, this.locZ, SoundEffects.ENTITY_LIGHTNING_BOLT_IMPACT, SoundCategory.WEATHER, 2.0F, 0.5F + this.random.nextFloat() * 0.2F); // Paper - Limit lightning strike effect distance (the packet is now sent from inside the loop)
|
||||
- this.world.playSound((EntityHuman) null, this.locX(), this.locY(), this.locZ(), SoundEffects.ENTITY_LIGHTNING_BOLT_IMPACT, SoundCategory.WEATHER, 2.0F, 0.5F + this.random.nextFloat() * 0.2F);
|
||||
+ //this.world.playSound((EntityHuman) null, this.locX(), this.locY(), this.locZ(), SoundEffects.ENTITY_LIGHTNING_BOLT_IMPACT, SoundCategory.WEATHER, 2.0F, 0.5F + this.random.nextFloat() * 0.2F); // Paper - Limit lightning strike effect distance (the packet is now sent from inside the loop)
|
||||
}
|
||||
|
||||
--this.lifeTicks;
|
||||
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
|
||||
index 8b55879c6..dbd357f1a 100644
|
||||
index a0c714129..ecfcecfdc 100644
|
||||
--- a/src/main/java/net/minecraft/server/WorldServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/WorldServer.java
|
||||
@@ -0,0 +0,0 @@ public class WorldServer extends World {
|
||||
}
|
||||
// CraftBukkit end
|
||||
this.globalEntityList.add(entitylightning);
|
||||
- this.server.getPlayerList().sendPacketNearby((EntityHuman) null, entitylightning.locX, entitylightning.locY, entitylightning.locZ, 512.0D, this, new PacketPlayOutSpawnEntityWeather(entitylightning)); // Paper - use world instead of dimension
|
||||
+ this.server.getPlayerList().sendPacketNearby((EntityHuman) null, entitylightning.locX, entitylightning.locY, entitylightning.locZ, paperConfig.maxLightningFlashDistance, this, new PacketPlayOutSpawnEntityWeather(entitylightning)); // Paper - use world instead of dimension, limit lightning strike effect distance
|
||||
- this.server.getPlayerList().sendPacketNearby((EntityHuman) null, entitylightning.locX(), entitylightning.locY(), entitylightning.locZ(), 512.0D, this, new PacketPlayOutSpawnEntityWeather(entitylightning)); // Paper - use world instead of dimension
|
||||
+ this.server.getPlayerList().sendPacketNearby((EntityHuman) null, entitylightning.locX(), entitylightning.locY(), entitylightning.locZ(), paperConfig.maxLightningFlashDistance, this, new PacketPlayOutSpawnEntityWeather(entitylightning)); // Paper - use world instead of dimension, limit lightning strike effect distance
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -22,7 +22,7 @@ index 000000000..a3b174618
|
|||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/net/minecraft/server/DataPaletteBlock.java b/src/main/java/net/minecraft/server/DataPaletteBlock.java
|
||||
index a3bb2e877..1e2bca1e0 100644
|
||||
index d5f5a5187..2c1d1b1a5 100644
|
||||
--- a/src/main/java/net/minecraft/server/DataPaletteBlock.java
|
||||
+++ b/src/main/java/net/minecraft/server/DataPaletteBlock.java
|
||||
@@ -0,0 +0,0 @@ public class DataPaletteBlock<T> implements DataPaletteExpandable<T> {
|
||||
|
|
|
@ -6,7 +6,7 @@ Subject: [PATCH] MC-114618 - Fix EntityAreaEffectCloud from going negative
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityAreaEffectCloud.java b/src/main/java/net/minecraft/server/EntityAreaEffectCloud.java
|
||||
index 3a8e10533..fe527aba5 100644
|
||||
index e8f3e55fd..44289c230 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityAreaEffectCloud.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityAreaEffectCloud.java
|
||||
@@ -0,0 +0,0 @@ public class EntityAreaEffectCloud extends Entity {
|
||||
|
|
|
@ -1,31 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: MisterVector <whizkid3000@hotmail.com>
|
||||
Date: Thu, 1 Nov 2018 14:50:05 -0700
|
||||
Subject: [PATCH] MC-136865: Use valid item for enchantment checks on block
|
||||
break
|
||||
|
||||
When an itemstack runs out of durability, the amount is reduced to
|
||||
0 which then marks the item as invalid. This causes the last unit
|
||||
of durability to not apply enchantments as the enchantment level
|
||||
check sees the item as a dud.
|
||||
|
||||
keep the clone of the item used to a non empty value so it represents
|
||||
the item used.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/PlayerInteractManager.java b/src/main/java/net/minecraft/server/PlayerInteractManager.java
|
||||
index a898535d1b..f953bd7ceb 100644
|
||||
--- a/src/main/java/net/minecraft/server/PlayerInteractManager.java
|
||||
+++ b/src/main/java/net/minecraft/server/PlayerInteractManager.java
|
||||
@@ -0,0 +0,0 @@ public class PlayerInteractManager {
|
||||
ItemStack itemstack = this.player.getItemInMainHand();
|
||||
boolean flag1 = this.player.hasBlock(iblockdata);
|
||||
|
||||
+ ItemStack itemstack1 = flag && flag1 && event.isDropItems() && !itemstack.isEmpty() ? itemstack.cloneItemStack() : ItemStack.a; // Paper - MC-136865 - clone before use
|
||||
itemstack.a(this.world, iblockdata, blockposition, this.player);
|
||||
if (flag && flag1 && event.isDropItems()) { // CraftBukkit - Check if block should drop items
|
||||
- ItemStack itemstack1 = itemstack.isEmpty() ? ItemStack.a : itemstack.cloneItemStack();
|
||||
+ //ItemStack itemstack1 = itemstack.isEmpty() ? ItemStack.a : itemstack.cloneItemStack(); // Paper - MC-136865 - move up
|
||||
|
||||
block.a(this.world, this.player, blockposition, iblockdata, tileentity, itemstack1);
|
||||
}
|
||||
--
|
|
@ -11,7 +11,7 @@ everything to the Whitelist object.
|
|||
https://github.com/PaperMC/Paper/issues/1880
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/JsonList.java b/src/main/java/net/minecraft/server/JsonList.java
|
||||
index 8570e38f42..c97be42dd7 100644
|
||||
index 8570e38f4..c97be42dd 100644
|
||||
--- a/src/main/java/net/minecraft/server/JsonList.java
|
||||
+++ b/src/main/java/net/minecraft/server/JsonList.java
|
||||
@@ -0,0 +0,0 @@ public class JsonList<K, V extends JsonListEntry<K>> {
|
||||
|
@ -23,7 +23,7 @@ index 8570e38f42..c97be42dd7 100644
|
|||
this.e = flag;
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
|
||||
index 52aa83f51f..0da3f95f89 100644
|
||||
index 659ce2181..62d807597 100644
|
||||
--- a/src/main/java/net/minecraft/server/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/PlayerList.java
|
||||
@@ -0,0 +0,0 @@ public abstract class PlayerList {
|
||||
|
|
|
@ -11,12 +11,12 @@ If the projectile fails to find the shooter in the current world, check
|
|||
other worlds.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityProjectile.java b/src/main/java/net/minecraft/server/EntityProjectile.java
|
||||
index f2f4b2d929..18d28a151a 100644
|
||||
index 9eed1dce3..6c091b680 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityProjectile.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityProjectile.java
|
||||
@@ -0,0 +0,0 @@ public abstract class EntityProjectile extends Entity implements IProjectile {
|
||||
public EntityLiving getShooter() {
|
||||
if (this.shooter == null && this.shooterId != null && this.world instanceof WorldServer) {
|
||||
if ((this.shooter == null || this.shooter.dead) && this.shooterId != null && this.world instanceof WorldServer) {
|
||||
Entity entity = ((WorldServer) this.world).getEntity(this.shooterId);
|
||||
+ // Paper start - MC-50319 - shooter might be in another world (arrows through portals)
|
||||
+ if (entity == null) {
|
||||
|
@ -31,10 +31,4 @@ index f2f4b2d929..18d28a151a 100644
|
|||
|
||||
if (entity instanceof EntityLiving) {
|
||||
this.shooter = (EntityLiving) entity;
|
||||
} else {
|
||||
- this.shooterId = null;
|
||||
+ //this.shooterId = null; // Paper - don't unset shooterId
|
||||
}
|
||||
}
|
||||
|
||||
--
|
|
@ -5,7 +5,7 @@ Subject: [PATCH] Make the default permission message configurable
|
|||
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
||||
index 8feb0efdcd..81987e4ad9 100644
|
||||
index 30f35304a..546a1cfe0 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
||||
@@ -0,0 +0,0 @@ import java.util.regex.Pattern;
|
||||
|
@ -29,7 +29,7 @@ index 8feb0efdcd..81987e4ad9 100644
|
|||
private static void savePlayerData() {
|
||||
savePlayerData = getBoolean("settings.save-player-data", savePlayerData);
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index dfa78653aa..b89486beb1 100644
|
||||
index 7e810e008..58b343259 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -0,0 +0,0 @@ public final class CraftServer implements Server {
|
||||
|
|
|
@ -5,7 +5,7 @@ Subject: [PATCH] Mark entities as being ticked when notifying navigation
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
|
||||
index 0761f705be..5df9b0ffda 100644
|
||||
index a5cce8f4e..8ea9b34a1 100644
|
||||
--- a/src/main/java/net/minecraft/server/WorldServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/WorldServer.java
|
||||
@@ -0,0 +0,0 @@ public class WorldServer extends World {
|
||||
|
@ -13,7 +13,7 @@ index 0761f705be..5df9b0ffda 100644
|
|||
|
||||
if (VoxelShapes.c(voxelshape, voxelshape1, OperatorBoolean.NOT_SAME)) {
|
||||
+ boolean wasTicking = this.tickingEntities; this.tickingEntities = true; // Paper
|
||||
Iterator iterator = this.H.iterator();
|
||||
Iterator iterator = this.navigators.iterator();
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
@@ -0,0 +0,0 @@ public class WorldServer extends World {
|
||||
|
|
|
@ -7,7 +7,7 @@ Implements Pathfinding API for mobs
|
|||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/entity/PaperPathfinder.java b/src/main/java/com/destroystokyo/paper/entity/PaperPathfinder.java
|
||||
new file mode 100644
|
||||
index 0000000000..f68a07cb96
|
||||
index 000000000..f68a07cb9
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/com/destroystokyo/paper/entity/PaperPathfinder.java
|
||||
@@ -0,0 +0,0 @@
|
||||
|
@ -123,7 +123,7 @@ index 0000000000..f68a07cb96
|
|||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/net/minecraft/server/NavigationAbstract.java b/src/main/java/net/minecraft/server/NavigationAbstract.java
|
||||
index be6aa59749..66e10108d6 100644
|
||||
index bdd092e49..1cb03d464 100644
|
||||
--- a/src/main/java/net/minecraft/server/NavigationAbstract.java
|
||||
+++ b/src/main/java/net/minecraft/server/NavigationAbstract.java
|
||||
@@ -0,0 +0,0 @@ public abstract class NavigationAbstract {
|
||||
|
@ -158,11 +158,11 @@ index be6aa59749..66e10108d6 100644
|
|||
|
||||
- @Nullable
|
||||
+ @Nullable public PathEntity getPathEntity() { return l(); } @Nullable // Paper - OBFHELPER
|
||||
public PathEntity l() {
|
||||
public PathEntity k() {
|
||||
return this.c;
|
||||
}
|
||||
@@ -0,0 +0,0 @@ public abstract class NavigationAbstract {
|
||||
return this.c == null || this.c.b();
|
||||
return !this.m();
|
||||
}
|
||||
|
||||
+ public void stopPathfinding() { o(); } // Paper - OBFHELPER
|
||||
|
@ -170,7 +170,7 @@ index be6aa59749..66e10108d6 100644
|
|||
this.c = null;
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/PathEntity.java b/src/main/java/net/minecraft/server/PathEntity.java
|
||||
index 312352ef84..dcb4e25080 100644
|
||||
index 312352ef8..dcb4e2508 100644
|
||||
--- a/src/main/java/net/minecraft/server/PathEntity.java
|
||||
+++ b/src/main/java/net/minecraft/server/PathEntity.java
|
||||
@@ -0,0 +0,0 @@ import javax.annotation.Nullable;
|
||||
|
@ -210,7 +210,7 @@ index 312352ef84..dcb4e25080 100644
|
|||
|
||||
return new Vec3D((double) pathpoint.a, (double) pathpoint.b, (double) pathpoint.c);
|
||||
diff --git a/src/main/java/net/minecraft/server/PathPoint.java b/src/main/java/net/minecraft/server/PathPoint.java
|
||||
index b1db95daa9..18cdd2a6f2 100644
|
||||
index b1db95daa..18cdd2a6f 100644
|
||||
--- a/src/main/java/net/minecraft/server/PathPoint.java
|
||||
+++ b/src/main/java/net/minecraft/server/PathPoint.java
|
||||
@@ -0,0 +0,0 @@ package net.minecraft.server;
|
||||
|
@ -227,7 +227,7 @@ index b1db95daa9..18cdd2a6f2 100644
|
|||
public int d = -1;
|
||||
public float e;
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java
|
||||
index 5bf1cd06fa..53c2d154ed 100644
|
||||
index 5bf1cd06f..53c2d154e 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java
|
||||
@@ -0,0 +0,0 @@ import org.bukkit.loot.LootTable;
|
||||
|
|
|
@ -5,7 +5,7 @@ Subject: [PATCH] Mob Spawner API Enhancements
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/MobSpawnerAbstract.java b/src/main/java/net/minecraft/server/MobSpawnerAbstract.java
|
||||
index 079099e30..b05f6c2f2 100644
|
||||
index 90ca1ee14..b179893a1 100644
|
||||
--- a/src/main/java/net/minecraft/server/MobSpawnerAbstract.java
|
||||
+++ b/src/main/java/net/minecraft/server/MobSpawnerAbstract.java
|
||||
@@ -0,0 +0,0 @@ public abstract class MobSpawnerAbstract {
|
||||
|
|
|
@ -17,7 +17,7 @@ This should fully solve all of the issues around it so that only natural
|
|||
influences natural spawns.
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
index e9d1b47ad..59671c5c3 100644
|
||||
index 363676348..0a7e6fff1 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
@@ -0,0 +0,0 @@ public class PaperWorldConfig {
|
||||
|
@ -38,7 +38,7 @@ index e9d1b47ad..59671c5c3 100644
|
|||
public boolean asynchronous;
|
||||
public EngineMode engineMode;
|
||||
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
|
||||
index 7c5349b17..0761f705b 100644
|
||||
index 0fd3cb54b..a5cce8f4e 100644
|
||||
--- a/src/main/java/net/minecraft/server/WorldServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/WorldServer.java
|
||||
@@ -0,0 +0,0 @@ public class WorldServer extends World {
|
||||
|
|
|
@ -6,24 +6,24 @@ Subject: [PATCH] Optimize Biome Mob Lookups for Mob Spawning
|
|||
Uses an EnumMap as well as a Set paired List for O(1) contains calls.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/BiomeBase.java b/src/main/java/net/minecraft/server/BiomeBase.java
|
||||
index 65daa76bc1..a86ece8344 100644
|
||||
index 253890e53..0102a170d 100644
|
||||
--- a/src/main/java/net/minecraft/server/BiomeBase.java
|
||||
+++ b/src/main/java/net/minecraft/server/BiomeBase.java
|
||||
@@ -0,0 +0,0 @@ public abstract class BiomeBase {
|
||||
protected final Map<WorldGenStage.Decoration, List<WorldGenFeatureConfigured<?>>> r = Maps.newHashMap();
|
||||
protected final List<WorldGenFeatureConfigured<?>> s = Lists.newArrayList();
|
||||
protected final Map<WorldGenStage.Decoration, List<WorldGenFeatureConfigured<?, ?>>> r = Maps.newHashMap();
|
||||
protected final List<WorldGenFeatureConfigured<?, ?>> s = Lists.newArrayList();
|
||||
protected final Map<StructureGenerator<?>, WorldGenFeatureConfiguration> t = Maps.newHashMap();
|
||||
- private final Map<EnumCreatureType, List<BiomeBase.BiomeMeta>> u = Maps.newHashMap();
|
||||
+ private final java.util.EnumMap<EnumCreatureType, List<BiomeBase.BiomeMeta>> u = Maps.newEnumMap(EnumCreatureType.class); // Paper
|
||||
private final ThreadLocal<Long2FloatLinkedOpenHashMap> v = ThreadLocal.withInitial(() -> {
|
||||
- private final Map<EnumCreatureType, List<BiomeBase.BiomeMeta>> v = Maps.newHashMap();
|
||||
+ private final java.util.EnumMap<EnumCreatureType, List<BiomeBase.BiomeMeta>> v = Maps.newEnumMap(EnumCreatureType.class); // Paper
|
||||
private final ThreadLocal<Long2FloatLinkedOpenHashMap> w = ThreadLocal.withInitial(() -> {
|
||||
return (Long2FloatLinkedOpenHashMap) SystemUtils.a(() -> {
|
||||
Long2FloatLinkedOpenHashMap long2floatlinkedopenhashmap = new Long2FloatLinkedOpenHashMap(1024, 0.25F) {
|
||||
@@ -0,0 +0,0 @@ public abstract class BiomeBase {
|
||||
for (j = 0; j < i; ++j) {
|
||||
EnumCreatureType enumcreaturetype = aenumcreaturetype[j];
|
||||
|
||||
- this.u.put(enumcreaturetype, Lists.newArrayList());
|
||||
+ this.u.put(enumcreaturetype, new MobList()); // Paper
|
||||
- this.v.put(enumcreaturetype, Lists.newArrayList());
|
||||
+ this.v.put(enumcreaturetype, new MobList()); // Paper
|
||||
}
|
||||
|
||||
} else {
|
||||
|
|
|
@ -10,10 +10,10 @@ Optimize to check if the captured list even has values in it, and also to
|
|||
just do a get call since the value can never be null.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
|
||||
index dad0c893f..dd2a9c6e5 100644
|
||||
index 61a3ddc4d..dfc695084 100644
|
||||
--- a/src/main/java/net/minecraft/server/World.java
|
||||
+++ b/src/main/java/net/minecraft/server/World.java
|
||||
@@ -0,0 +0,0 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
|
||||
@@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
|
||||
return null;
|
||||
} else {
|
||||
// CraftBukkit start
|
||||
|
@ -29,5 +29,5 @@ index dad0c893f..dd2a9c6e5 100644
|
|||
+ //TileEntity tileentity = null; // Paper - move up
|
||||
|
||||
if (this.tickingTileEntities) {
|
||||
tileentity = this.A(blockposition);
|
||||
tileentity = this.e(blockposition);
|
||||
--
|
|
@ -21,7 +21,7 @@ known NMS used methods, but we can add more if naughty plugins are found later.
|
|||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldMap.java b/src/main/java/com/destroystokyo/paper/PaperWorldMap.java
|
||||
new file mode 100644
|
||||
index 0000000000..6bb2f98b45
|
||||
index 000000000..6bb2f98b4
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldMap.java
|
||||
@@ -0,0 +0,0 @@
|
||||
|
@ -217,7 +217,7 @@ index 0000000000..6bb2f98b45
|
|||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index de423de63b..a5447c6501 100644
|
||||
index ec575bc8f..3120f91de 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -0,0 +0,0 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
|
|
|
@ -8,7 +8,7 @@ the updates per world, so that we can re-use the same packet
|
|||
object for every player unless they have per-player time enabled.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index 40260dbd48..a7b63ab421 100644
|
||||
index 3120f91de..8fc55d31a 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -0,0 +0,0 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
|
|
|
@ -19,7 +19,7 @@ Aside from making the obvious class/function renames and obfhelpers I didn't nee
|
|||
Just added Bukkit's event system and took a few liberties with dead code and comment misspellings.
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
index c7ff264cb..1ad6d6483 100644
|
||||
index 4bcba0a2b..3b1289099 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
@@ -0,0 +0,0 @@ public class PaperWorldConfig {
|
||||
|
@ -956,7 +956,7 @@ index 000000000..cf5661f1c
|
|||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/net/minecraft/server/BlockRedstoneWire.java b/src/main/java/net/minecraft/server/BlockRedstoneWire.java
|
||||
index cffb8de4f..337c03d1d 100644
|
||||
index 5bf2fc0b3..52a4982ec 100644
|
||||
--- a/src/main/java/net/minecraft/server/BlockRedstoneWire.java
|
||||
+++ b/src/main/java/net/minecraft/server/BlockRedstoneWire.java
|
||||
@@ -0,0 +0,0 @@
|
||||
|
@ -968,7 +968,7 @@ index cffb8de4f..337c03d1d 100644
|
|||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Maps;
|
||||
@@ -0,0 +0,0 @@ public class BlockRedstoneWire extends Block {
|
||||
public static final BlockStateInteger POWER = BlockProperties.as;
|
||||
public static final BlockStateInteger POWER = BlockProperties.at;
|
||||
public static final Map<EnumDirection, BlockStateEnum<BlockPropertyRedstoneSide>> f = Maps.newEnumMap(ImmutableMap.of(EnumDirection.NORTH, BlockRedstoneWire.NORTH, EnumDirection.EAST, BlockRedstoneWire.EAST, EnumDirection.SOUTH, BlockRedstoneWire.SOUTH, EnumDirection.WEST, BlockRedstoneWire.WEST));
|
||||
protected static final VoxelShape[] g = new VoxelShape[]{Block.a(3.0D, 0.0D, 3.0D, 13.0D, 1.0D, 13.0D), Block.a(3.0D, 0.0D, 3.0D, 13.0D, 1.0D, 16.0D), Block.a(0.0D, 0.0D, 3.0D, 13.0D, 1.0D, 13.0D), Block.a(0.0D, 0.0D, 3.0D, 13.0D, 1.0D, 16.0D), Block.a(3.0D, 0.0D, 0.0D, 13.0D, 1.0D, 13.0D), Block.a(3.0D, 0.0D, 0.0D, 13.0D, 1.0D, 16.0D), Block.a(0.0D, 0.0D, 0.0D, 13.0D, 1.0D, 13.0D), Block.a(0.0D, 0.0D, 0.0D, 13.0D, 1.0D, 16.0D), Block.a(3.0D, 0.0D, 3.0D, 16.0D, 1.0D, 13.0D), Block.a(3.0D, 0.0D, 3.0D, 16.0D, 1.0D, 16.0D), Block.a(0.0D, 0.0D, 3.0D, 16.0D, 1.0D, 13.0D), Block.a(0.0D, 0.0D, 3.0D, 16.0D, 1.0D, 16.0D), Block.a(3.0D, 0.0D, 0.0D, 16.0D, 1.0D, 13.0D), Block.a(3.0D, 0.0D, 0.0D, 16.0D, 1.0D, 16.0D), Block.a(0.0D, 0.0D, 0.0D, 16.0D, 1.0D, 13.0D), Block.a(0.0D, 0.0D, 0.0D, 16.0D, 1.0D, 16.0D)};
|
||||
- private boolean h = true;
|
||||
|
@ -1124,10 +1124,10 @@ index cffb8de4f..337c03d1d 100644
|
|||
c(iblockdata, world, blockposition);
|
||||
world.a(blockposition, false);
|
||||
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
|
||||
index dc0d89ee6..6189935bd 100644
|
||||
index 8e3367435..e8f83627c 100644
|
||||
--- a/src/main/java/net/minecraft/server/World.java
|
||||
+++ b/src/main/java/net/minecraft/server/World.java
|
||||
@@ -0,0 +0,0 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
|
||||
@@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
|
||||
|
||||
}
|
||||
|
||||
|
@ -1135,7 +1135,7 @@ index dc0d89ee6..6189935bd 100644
|
|||
public void a(BlockPosition blockposition, Block block, BlockPosition blockposition1) {
|
||||
if (!this.isClientSide) {
|
||||
IBlockData iblockdata = this.getType(blockposition);
|
||||
@@ -0,0 +0,0 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
|
||||
@@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
|
||||
return this.getBlockFacePower(blockposition.down(), EnumDirection.DOWN) > 0 ? true : (this.getBlockFacePower(blockposition.up(), EnumDirection.UP) > 0 ? true : (this.getBlockFacePower(blockposition.north(), EnumDirection.NORTH) > 0 ? true : (this.getBlockFacePower(blockposition.south(), EnumDirection.SOUTH) > 0 ? true : (this.getBlockFacePower(blockposition.west(), EnumDirection.WEST) > 0 ? true : this.getBlockFacePower(blockposition.east(), EnumDirection.EAST) > 0))));
|
||||
}
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ I hope to look at this more in-depth soon. It appears doable.
|
|||
However this should not block the update.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityEnderDragon.java b/src/main/java/net/minecraft/server/EntityEnderDragon.java
|
||||
index c2f35f89d..c8c74f2b3 100644
|
||||
index 3df8e30ec..9acdd6e56 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityEnderDragon.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityEnderDragon.java
|
||||
@@ -0,0 +0,0 @@ public class EntityEnderDragon extends EntityInsentient implements IMonster {
|
||||
|
@ -20,10 +20,10 @@ index c2f35f89d..c8c74f2b3 100644
|
|||
- final int viewDistance = player.getViewDistance(); // TODO apply view distance api patch
|
||||
+ //final int viewDistance = player.getViewDistance(); // TODO apply view distance api patch
|
||||
// Paper end
|
||||
double deltaX = this.locX - player.locX;
|
||||
double deltaZ = this.locZ - player.locZ;
|
||||
double deltaX = this.locX() - player.locX();
|
||||
double deltaZ = this.locZ() - player.locZ();
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityWither.java b/src/main/java/net/minecraft/server/EntityWither.java
|
||||
index 18151acd5..8b3052b11 100644
|
||||
index 2e95069c1..8977c3516 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityWither.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityWither.java
|
||||
@@ -0,0 +0,0 @@ public class EntityWither extends EntityMonster implements IRangedEntity {
|
||||
|
@ -36,10 +36,10 @@ index 18151acd5..8b3052b11 100644
|
|||
- final int viewDistance = player.getViewDistance(); // TODO apply view distance api patch
|
||||
+ //final int viewDistance = player.getViewDistance(); // TODO apply view distance api patch
|
||||
// Paper end
|
||||
double deltaX = this.locX - player.locX;
|
||||
double deltaZ = this.locZ - player.locZ;
|
||||
double deltaX = this.locX() - player.locX();
|
||||
double deltaZ = this.locZ() - player.locZ();
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index 9fa55ef6f..e920545df 100644
|
||||
index 4b847ddd8..049ebf4c4 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -0,0 +0,0 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
|
@ -56,7 +56,7 @@ index 9fa55ef6f..e920545df 100644
|
|||
+ public void setViewDistance(int viewDistance) {
|
||||
+ throw new NotImplementedException("Per-Player View Distance APIs need further understanding to properly implement"); // TODO
|
||||
+ }
|
||||
//Paper end
|
||||
// Paper end
|
||||
|
||||
// Spigot start
|
||||
--
|
|
@ -10,7 +10,7 @@ operation. This patch will reduce the load of plugins which for example
|
|||
implement custom moblimits and depend on Chunk.getEntities().
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java
|
||||
index b4551614..373bea4b 100644
|
||||
index 9dcba4d15..c8b49a389 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java
|
||||
@@ -0,0 +0,0 @@ public class CraftChunk implements Chunk {
|
||||
|
|
|
@ -8,7 +8,7 @@ Exposes a mutable array on items a player should keep on death
|
|||
Example Usage: https://gist.github.com/aikar/5bb202de6057a051a950ce1f29feb0b4
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
|
||||
index a191d6246..18695d9b5 100644
|
||||
index cc9e69651..ca2398386 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
|
||||
@@ -0,0 +0,0 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
|
|
|
@ -9,22 +9,22 @@ SpawnerSpawnEvent gets called instead of the CreatureSpawnEvent for
|
|||
spawners.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/MobSpawnerAbstract.java b/src/main/java/net/minecraft/server/MobSpawnerAbstract.java
|
||||
index 6f5d8b0315..079099e308 100644
|
||||
index fe8bc7f75..90ca1ee14 100644
|
||||
--- a/src/main/java/net/minecraft/server/MobSpawnerAbstract.java
|
||||
+++ b/src/main/java/net/minecraft/server/MobSpawnerAbstract.java
|
||||
@@ -0,0 +0,0 @@ public abstract class MobSpawnerAbstract {
|
||||
|
||||
org.bukkit.entity.EntityType type = org.bukkit.entity.EntityType.fromName(key);
|
||||
if (type != null) {
|
||||
- com.destroystokyo.paper.event.entity.PreCreatureSpawnEvent event;
|
||||
- event = new com.destroystokyo.paper.event.entity.PreCreatureSpawnEvent(
|
||||
org.bukkit.entity.EntityType type = org.bukkit.entity.EntityType.fromName(key);
|
||||
if (type != null) {
|
||||
- com.destroystokyo.paper.event.entity.PreCreatureSpawnEvent event;
|
||||
- event = new com.destroystokyo.paper.event.entity.PreCreatureSpawnEvent(
|
||||
+ com.destroystokyo.paper.event.entity.PreSpawnerSpawnEvent event;
|
||||
+ event = new com.destroystokyo.paper.event.entity.PreSpawnerSpawnEvent(
|
||||
MCUtil.toLocation(world, d3, d4, d5),
|
||||
type,
|
||||
- org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.SPAWNER
|
||||
MCUtil.toLocation(world, d3, d4, d5),
|
||||
type,
|
||||
- org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.SPAWNER
|
||||
+ MCUtil.toLocation(world, blockposition)
|
||||
);
|
||||
if (!event.callEvent()) {
|
||||
flag = true;
|
||||
);
|
||||
if (!event.callEvent()) {
|
||||
flag = true;
|
||||
--
|
|
@ -1,21 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Spottedleaf <Spottedleaf@users.noreply.github.com>
|
||||
Date: Mon, 5 Aug 2019 08:24:01 -0700
|
||||
Subject: [PATCH] Preserve old flush on save flag for reliable regionfiles
|
||||
|
||||
Originally this patch was in paper
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/RegionFile.java b/src/main/java/net/minecraft/server/RegionFile.java
|
||||
index b487e8060..a8c8ace46 100644
|
||||
--- a/src/main/java/net/minecraft/server/RegionFile.java
|
||||
+++ b/src/main/java/net/minecraft/server/RegionFile.java
|
||||
@@ -0,0 +0,0 @@ public class RegionFile implements AutoCloseable {
|
||||
}
|
||||
|
||||
// Spigot start - Make region files reliable
|
||||
- private static final boolean FLUSH_ON_SAVE = Boolean.getBoolean("spigot.flush-on-save");
|
||||
+ private static final boolean FLUSH_ON_SAVE = Boolean.getBoolean("spigot.flush-on-save") || Boolean.getBoolean("paper.flush-on-save"); // Paper - preserve old flag
|
||||
private void syncRegionFile() throws IOException {
|
||||
if (!FLUSH_ON_SAVE) {
|
||||
return;
|
||||
--
|
|
@ -5,22 +5,22 @@ Subject: [PATCH] Prevent Enderman from loading chunks
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityEnderman.java b/src/main/java/net/minecraft/server/EntityEnderman.java
|
||||
index 2d29da8560..a94ed1ae08 100644
|
||||
index 9783576e3..13507edbc 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityEnderman.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityEnderman.java
|
||||
@@ -0,0 +0,0 @@ public class EntityEnderman extends EntityMonster {
|
||||
int j = MathHelper.floor(this.enderman.locY + random.nextDouble() * 3.0D);
|
||||
int k = MathHelper.floor(this.enderman.locZ - 2.0D + random.nextDouble() * 4.0D);
|
||||
int j = MathHelper.floor(this.enderman.locY() + random.nextDouble() * 3.0D);
|
||||
int k = MathHelper.floor(this.enderman.locZ() - 2.0D + random.nextDouble() * 4.0D);
|
||||
BlockPosition blockposition = new BlockPosition(i, j, k);
|
||||
- IBlockData iblockdata = world.getType(blockposition);
|
||||
+ IBlockData iblockdata = world.getTypeIfLoaded(blockposition); // Paper
|
||||
+ if (iblockdata == null) return; // Paper
|
||||
Block block = iblockdata.getBlock();
|
||||
Vec3D vec3d = new Vec3D((double) MathHelper.floor(this.enderman.locX) + 0.5D, (double) j + 0.5D, (double) MathHelper.floor(this.enderman.locZ) + 0.5D);
|
||||
Vec3D vec3d = new Vec3D((double) MathHelper.floor(this.enderman.locX()) + 0.5D, (double) j + 0.5D, (double) MathHelper.floor(this.enderman.locZ()) + 0.5D);
|
||||
Vec3D vec3d1 = new Vec3D((double) i + 0.5D, (double) j + 0.5D, (double) k + 0.5D);
|
||||
@@ -0,0 +0,0 @@ public class EntityEnderman extends EntityMonster {
|
||||
int j = MathHelper.floor(this.a.locY + random.nextDouble() * 2.0D);
|
||||
int k = MathHelper.floor(this.a.locZ - 1.0D + random.nextDouble() * 2.0D);
|
||||
int j = MathHelper.floor(this.a.locY() + random.nextDouble() * 2.0D);
|
||||
int k = MathHelper.floor(this.a.locZ() - 1.0D + random.nextDouble() * 2.0D);
|
||||
BlockPosition blockposition = new BlockPosition(i, j, k);
|
||||
- IBlockData iblockdata = world.getType(blockposition);
|
||||
+ IBlockData iblockdata = world.getTypeIfLoaded(blockposition); // Paper
|
||||
|
|
|
@ -5,7 +5,7 @@ Subject: [PATCH] Prevent Mob AI Rules from Loading Chunks
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/PathfinderGoalRemoveBlock.java b/src/main/java/net/minecraft/server/PathfinderGoalRemoveBlock.java
|
||||
index bf8ca9b32a..7ccb3d5c06 100644
|
||||
index bf8ca9b32..7ccb3d5c0 100644
|
||||
--- a/src/main/java/net/minecraft/server/PathfinderGoalRemoveBlock.java
|
||||
+++ b/src/main/java/net/minecraft/server/PathfinderGoalRemoveBlock.java
|
||||
@@ -0,0 +0,0 @@ public class PathfinderGoalRemoveBlock extends PathfinderGoalGotoTarget {
|
||||
|
@ -52,24 +52,25 @@ index bf8ca9b32a..7ccb3d5c06 100644
|
|||
return ichunkaccess == null ? false : ichunkaccess.getType(blockposition).getBlock() == this.g && ichunkaccess.getType(blockposition.up()).isAir() && ichunkaccess.getType(blockposition.up(2)).isAir();
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/RandomPositionGenerator.java b/src/main/java/net/minecraft/server/RandomPositionGenerator.java
|
||||
index 6e4da70b7e..643dc0241d 100644
|
||||
index d4cd50918..d6a3b9933 100644
|
||||
--- a/src/main/java/net/minecraft/server/RandomPositionGenerator.java
|
||||
+++ b/src/main/java/net/minecraft/server/RandomPositionGenerator.java
|
||||
@@ -0,0 +0,0 @@ public class RandomPositionGenerator {
|
||||
}
|
||||
|
||||
blockposition2 = new BlockPosition((double) l + entitycreature.locX, (double) i1 + entitycreature.locY, (double) j1 + entitycreature.locZ);
|
||||
blockposition2 = new BlockPosition((double) k1 + entitycreature.locX(), (double) l1 + entitycreature.locY(), (double) i2 + entitycreature.locZ());
|
||||
+ if (!entitycreature.world.isLoaded(blockposition2)) continue; // Paper
|
||||
if ((!flag1 || entitycreature.a(blockposition2)) && navigationabstract.a(blockposition2)) {
|
||||
if (!flag) {
|
||||
blockposition2 = a(blockposition2, entitycreature);
|
||||
if (blockposition2.getY() >= 0 && blockposition2.getY() <= entitycreature.world.getBuildHeight() && (!flag3 || entitycreature.a(blockposition2)) && (!flag2 || navigationabstract.a(blockposition2))) {
|
||||
if (flag1) {
|
||||
blockposition2 = a(blockposition2, random.nextInt(l + 1) + i1, entitycreature.world.getBuildHeight(), (blockposition3) -> {
|
||||
@@ -0,0 +0,0 @@ public class RandomPositionGenerator {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private static boolean b(BlockPosition blockposition, EntityCreature entitycreature) {
|
||||
- return entitycreature.world.getFluid(blockposition).a(TagsFluid.WATER);
|
||||
+ Fluid fluid = entitycreature.world.getFluidIfLoaded(blockposition); // Paper
|
||||
+ return fluid != null && fluid.a(TagsFluid.WATER); // Paper
|
||||
}
|
||||
}
|
||||
- if (flag || !entitycreature.world.getFluid(blockposition2).a(TagsFluid.WATER)) {
|
||||
+ Fluid fluid = entitycreature.world.getFluidIfLoaded(blockposition2); // Paper
|
||||
+ if (flag || (fluid != null && !fluid.a(TagsFluid.WATER))) { // Paper
|
||||
PathType pathtype = PathfinderNormal.b(entitycreature.world, blockposition2.getX(), blockposition2.getY(), blockposition2.getZ());
|
||||
|
||||
if (entitycreature.a(pathtype) == 0.0F) {
|
||||
--
|
|
@ -5,7 +5,7 @@ Subject: [PATCH] Prevent chunk loading from Fluid Flowing
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/FluidTypeFlowing.java b/src/main/java/net/minecraft/server/FluidTypeFlowing.java
|
||||
index 3e9433e283..4660b95389 100644
|
||||
index 3099a5e65..376dca188 100644
|
||||
--- a/src/main/java/net/minecraft/server/FluidTypeFlowing.java
|
||||
+++ b/src/main/java/net/minecraft/server/FluidTypeFlowing.java
|
||||
@@ -0,0 +0,0 @@ public abstract class FluidTypeFlowing extends FluidType {
|
||||
|
@ -25,7 +25,7 @@ index 3e9433e283..4660b95389 100644
|
|||
- IBlockData iblockdata1 = iworldreader.getType(blockposition1);
|
||||
+ IBlockData iblockdata1 = iworldreader.getTypeIfLoaded(blockposition1); // Paper
|
||||
+ if (iblockdata1 == null) continue; // Paper
|
||||
Fluid fluid = iblockdata1.p();
|
||||
Fluid fluid = iblockdata1.getFluid();
|
||||
|
||||
if (fluid.getType().a((FluidType) this) && this.a(enumdirection, (IBlockAccess) iworldreader, blockposition, iblockdata, blockposition1, iblockdata1)) {
|
||||
@@ -0,0 +0,0 @@ public abstract class FluidTypeFlowing extends FluidType {
|
||||
|
@ -42,11 +42,10 @@ index 3e9433e283..4660b95389 100644
|
|||
+ continue;
|
||||
+ }
|
||||
|
||||
- return Pair.of(iblockdata1, iblockdata1.p());
|
||||
- return Pair.of(iblockdata1, iblockdata1.getFluid());
|
||||
- });
|
||||
+ pair = Pair.of(iblockdatax, iblockdatax.p());
|
||||
+ pair = Pair.of(iblockdatax, iblockdatax.getFluid());
|
||||
+ short2objectmap.put(short0, pair);
|
||||
+
|
||||
+ }
|
||||
+ // Paper end
|
||||
IBlockData iblockdata1 = (IBlockData) pair.getFirst();
|
||||
|
@ -59,7 +58,7 @@ index 3e9433e283..4660b95389 100644
|
|||
- Pair<IBlockData, Fluid> pair = (Pair) short2objectmap.computeIfAbsent(short0, (j) -> {
|
||||
- IBlockData iblockdata1 = iworldreader.getType(blockposition1);
|
||||
-
|
||||
- return Pair.of(iblockdata1, iblockdata1.p());
|
||||
- return Pair.of(iblockdata1, iblockdata1.getFluid());
|
||||
- });
|
||||
+ // Paper start
|
||||
+ Pair pair = (Pair) short2objectmap.get(short0);
|
||||
|
@ -67,7 +66,7 @@ index 3e9433e283..4660b95389 100644
|
|||
+ IBlockData iblockdatax = iworldreader.getTypeIfLoaded(blockposition1);
|
||||
+ if (iblockdatax == null) continue;
|
||||
+
|
||||
+ pair = Pair.of(iblockdatax, iblockdatax.p());
|
||||
+ pair = Pair.of(iblockdatax, iblockdatax.getFluid());
|
||||
+ short2objectmap.put(short0, pair);
|
||||
+ }
|
||||
+ // Paper end
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue