mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-25 12:05:53 +01:00
[1.16] Make it run (#3626)
* She compiles! Also readded the armorstand ticking patch, thanks cat * Update mob goal api * Misc fixes to make it run drop per playing mob spawns for now
This commit is contained in:
parent
68636aee72
commit
c3640b1dc0
@ -223,10 +223,10 @@ index 0000000000000000000000000000000000000000..e21f7574763dd4f13794f91bbef192ef
|
||||
+}
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java b/src/main/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..d23ad96ee436ae57231bbf88eed19487dec06780
|
||||
index 0000000000000000000000000000000000000000..d7f1b2c84aebe8ed04084b9249ed08d5e52a6ecd
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java
|
||||
@@ -0,0 +1,198 @@
|
||||
@@ -0,0 +1,208 @@
|
||||
+package com.destroystokyo.paper.entity.ai;
|
||||
+
|
||||
+import com.destroystokyo.paper.entity.RangedEntity;
|
||||
@ -315,7 +315,15 @@ index 0000000000000000000000000000000000000000..d23ad96ee436ae57231bbf88eed19487
|
||||
+ GoalKey<Phantom> PHANTOM_ATTACK_STRATEGY = GoalKey.of(Phantom.class, NamespacedKey.minecraft("phantom_attack_strategy"));
|
||||
+ GoalKey<Phantom> PHANTOM_CIRCLE_AROUND_ANCHOR = GoalKey.of(Phantom.class, NamespacedKey.minecraft("phantom_circle_around_anchor"));
|
||||
+ GoalKey<Phantom> PHANTOM_SWEEP_ATTACK = GoalKey.of(Phantom.class, NamespacedKey.minecraft("phantom_sweep_attack"));
|
||||
+ /**
|
||||
+ * @deprecated removed in 1.16
|
||||
+ */
|
||||
+ @Deprecated
|
||||
+ GoalKey<PigZombie> ANGER = GoalKey.of(PigZombie.class, NamespacedKey.minecraft("anger"));
|
||||
+ /**
|
||||
+ * @deprecated removed in 1.16
|
||||
+ */
|
||||
+ @Deprecated
|
||||
+ GoalKey<PigZombie> ANGER_OTHER = GoalKey.of(PigZombie.class, NamespacedKey.minecraft("anger_other"));
|
||||
+ GoalKey<PolarBear> POLARBEAR_ATTACK_PLAYERS = GoalKey.of(PolarBear.class, NamespacedKey.minecraft("polarbear_attack_players"));
|
||||
+ GoalKey<PolarBear> POLARBEAR_HURT_BY = GoalKey.of(PolarBear.class, NamespacedKey.minecraft("polarbear_hurt_by"));
|
||||
@ -424,6 +432,8 @@ index 0000000000000000000000000000000000000000..d23ad96ee436ae57231bbf88eed19487
|
||||
+ GoalKey<Creature> WATER = GoalKey.of(Creature.class, NamespacedKey.minecraft("water"));
|
||||
+ GoalKey<Dolphin> WATER_JUMP = GoalKey.of(Dolphin.class, NamespacedKey.minecraft("water_jump"));
|
||||
+ GoalKey<Zombie> ZOMBIE_ATTACK = GoalKey.of(Zombie.class, NamespacedKey.minecraft("zombie_attack"));
|
||||
+ GoalKey<Creature> STROLL_VILLAGE_GOLEM = GoalKey.of(Creature.class, NamespacedKey.minecraft("stroll_village_golem"));
|
||||
+ GoalKey<Mob> UNIVERSAL_ANGER_RESET = GoalKey.of(Mob.class, NamespacedKey.minecraft("universal_anger_reset"));
|
||||
+}
|
||||
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
|
||||
index 95ad0122605b40e28352fa6205528eeb5c453a50..a9c10228eeeaac89361c695a5ab90161b6358ca1 100644
|
||||
|
@ -8,21 +8,13 @@ Adds a new method to fetch the location of a player's bed without generating any
|
||||
getPotentialBedLocation - Gets the last known location of a player's bed. This does not preform any check if the bed is still valid and does not load any chunks.
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/entity/HumanEntity.java b/src/main/java/org/bukkit/entity/HumanEntity.java
|
||||
index 1f94cbee36b6a952b2ecca8efbeaf7deee640a81..c0d38f5a39610cbc523d210b76f17fa17c0d7e62 100644
|
||||
index 1f94cbee36b6a952b2ecca8efbeaf7deee640a81..e6cdd4bc2d934ab932651e17f144d7004835bdc3 100644
|
||||
--- a/src/main/java/org/bukkit/entity/HumanEntity.java
|
||||
+++ b/src/main/java/org/bukkit/entity/HumanEntity.java
|
||||
@@ -239,6 +239,43 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder
|
||||
@@ -239,6 +239,19 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder
|
||||
*/
|
||||
public int getSleepTicks();
|
||||
|
||||
+ /**
|
||||
+ * Gets the Location where the player will spawn at their bed, null if
|
||||
+ * they have not slept in one or their current bed spawn is invalid.
|
||||
+ *
|
||||
+ * @return Bed Spawn Location if bed exists, otherwise null.
|
||||
+ */
|
||||
+ @Nullable
|
||||
+ public Location getBedSpawnLocation();
|
||||
+
|
||||
+ // Paper start - Potential bed api
|
||||
+ /**
|
||||
@ -35,22 +27,6 @@ index 1f94cbee36b6a952b2ecca8efbeaf7deee640a81..c0d38f5a39610cbc523d210b76f17fa1
|
||||
+ @Nullable
|
||||
+ public Location getPotentialBedLocation();
|
||||
+ // Paper end
|
||||
+
|
||||
+ /**
|
||||
+ * Sets the Location where the player will spawn at their bed.
|
||||
+ *
|
||||
+ * @param location where to set the respawn location
|
||||
+ */
|
||||
+ public void setBedSpawnLocation(@Nullable Location location);
|
||||
+
|
||||
+ /**
|
||||
+ * Sets the Location where the player will spawn at their bed.
|
||||
+ *
|
||||
+ * @param location where to set the respawn location
|
||||
+ * @param force whether to forcefully set the respawn location even if a
|
||||
+ * valid bed is not present
|
||||
+ */
|
||||
+ public void setBedSpawnLocation(@Nullable Location location, boolean force);
|
||||
+
|
||||
/**
|
||||
* Attempts to make the entity sleep at the given location.
|
||||
|
@ -555,7 +555,7 @@ index 062a82c37723b7f032103ba2904877ae79b1ae01..5585b5646b5f3650aa3b795be06f9206
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java
|
||||
index 27e6872c675647d7e61040b76183dac4e347a40c..1964130ae411ff7d5e1b456a23629804d294a5d0 100644
|
||||
index 27e6872c675647d7e61040b76183dac4e347a40c..aa68eb71b131c1d529ded6c651621cfab071b3c4 100644
|
||||
--- a/src/main/java/net/minecraft/server/DedicatedServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/DedicatedServer.java
|
||||
@@ -148,6 +148,15 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
|
||||
@ -564,7 +564,7 @@ index 27e6872c675647d7e61040b76183dac4e347a40c..1964130ae411ff7d5e1b456a23629804
|
||||
// Spigot end
|
||||
+ // Paper start
|
||||
+ try {
|
||||
+ com.destroystokyo.paper.PaperConfig.init((File) options.valueOf("paper-settings"));
|
||||
+ com.destroystokyo.paper.PaperConfig.init((java.io.File) options.valueOf("paper-settings"));
|
||||
+ } catch (Exception e) {
|
||||
+ DedicatedServer.LOGGER.error("Unable to load server configuration", e);
|
||||
+ return false;
|
||||
|
@ -193,6 +193,19 @@ index 6c2ed9c1b8567abcdb11bdc3dbaeed217a2f61e7..ae0ac8d383ca11a683465d8c83a8b8a6
|
||||
|
||||
return this.getTemperature() - (f + (float) blockposition.getY() - 64.0F) * 0.05F / 30.0F;
|
||||
} else {
|
||||
diff --git a/src/main/java/net/minecraft/server/Biomes.java b/src/main/java/net/minecraft/server/Biomes.java
|
||||
index 0aa66addb2cb472b2ab90000d3f0e0f967353e0f..eaa527f4fe289a9492b12591154a60e5aa045252 100644
|
||||
--- a/src/main/java/net/minecraft/server/Biomes.java
|
||||
+++ b/src/main/java/net/minecraft/server/Biomes.java
|
||||
@@ -88,7 +88,7 @@ public abstract class Biomes {
|
||||
private static BiomeBase a(int i, String s, BiomeBase biomebase) {
|
||||
IRegistry.a(IRegistry.BIOME, i, s, biomebase);
|
||||
if (biomebase.b()) {
|
||||
- BiomeBase.d.a(biomebase, IRegistry.BIOME.a(IRegistry.BIOME.get(new MinecraftKey(biomebase.l))));
|
||||
+ BiomeBase.reg.a(biomebase, IRegistry.BIOME.a(IRegistry.BIOME.get(new MinecraftKey(biomebase.l))));
|
||||
}
|
||||
|
||||
return biomebase;
|
||||
diff --git a/src/main/java/net/minecraft/server/BlockStateEnum.java b/src/main/java/net/minecraft/server/BlockStateEnum.java
|
||||
index 771841e08591955e61c7bcc5b09c8457652c1b9c..8162c11d14b8e88c2b572f9ddf6b7a15977047f8 100644
|
||||
--- a/src/main/java/net/minecraft/server/BlockStateEnum.java
|
||||
@ -403,6 +416,19 @@ index 8b1f9116afd92b13426eb0e97066297705d202fb..a9dc8466278f9ec2becbcb643e6e1c97
|
||||
this.b();
|
||||
this.g.set(false);
|
||||
}));
|
||||
diff --git a/src/main/java/net/minecraft/server/LootEntryAbstract.java b/src/main/java/net/minecraft/server/LootEntryAbstract.java
|
||||
index 8cc8c60d3297a4ed98f3950a3971d83499ad1dfa..788078c209b8bcbd551cf0a52eb6172928d7b5f9 100644
|
||||
--- a/src/main/java/net/minecraft/server/LootEntryAbstract.java
|
||||
+++ b/src/main/java/net/minecraft/server/LootEntryAbstract.java
|
||||
@@ -36,7 +36,7 @@ public abstract class LootEntryAbstract implements LootEntryChildren {
|
||||
|
||||
// CraftBukkit start
|
||||
@Override
|
||||
- public final void a(JsonObject jsonobject, T t0, JsonSerializationContext jsonserializationcontext) {
|
||||
+ public void a(JsonObject jsonobject, T t0, JsonSerializationContext jsonserializationcontext) { // Paper - remove final
|
||||
if (!org.apache.commons.lang3.ArrayUtils.isEmpty(t0.d)) {
|
||||
jsonobject.add("conditions", jsonserializationcontext.serialize(t0.d));
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/LootItemFunctionExplorationMap.java b/src/main/java/net/minecraft/server/LootItemFunctionExplorationMap.java
|
||||
index 3aa5cc4281cdba8738890e9ffd5c7a129e60c310..32a98e758b9df48005ddc5283eacdc5123a32c39 100644
|
||||
--- a/src/main/java/net/minecraft/server/LootItemFunctionExplorationMap.java
|
||||
@ -473,6 +499,27 @@ index 829a7ae0a2b77205fb8e8c5754d0d4333afa224d..8b9e47b4c7f5dc464fa617a59583df9e
|
||||
|
||||
default String asString() {
|
||||
return this.toString();
|
||||
diff --git a/src/main/java/net/minecraft/server/NBTCompressedStreamTools.java b/src/main/java/net/minecraft/server/NBTCompressedStreamTools.java
|
||||
index db66d4ac7dc1bede8b674cd9ad8f56dd989b6693..c9be8c7f40917056091f63d36311a10d6302acbb 100644
|
||||
--- a/src/main/java/net/minecraft/server/NBTCompressedStreamTools.java
|
||||
+++ b/src/main/java/net/minecraft/server/NBTCompressedStreamTools.java
|
||||
@@ -11,6 +11,7 @@ import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.util.zip.GZIPInputStream;
|
||||
import java.util.zip.GZIPOutputStream;
|
||||
+import io.netty.buffer.ByteBufInputStream; // Paper
|
||||
|
||||
public class NBTCompressedStreamTools {
|
||||
|
||||
@@ -75,7 +76,7 @@ public class NBTCompressedStreamTools {
|
||||
|
||||
public static NBTTagCompound a(DataInput datainput, NBTReadLimiter nbtreadlimiter) throws IOException {
|
||||
// Spigot start
|
||||
- if ( datainput instanceof io.netty.buffer.ByteBufInputStream )
|
||||
+ if ( datainput instanceof ByteBufInputStream) // Paper
|
||||
{
|
||||
datainput = new DataInputStream(new org.spigotmc.LimitStream((InputStream) datainput, nbtreadlimiter));
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/NBTTagList.java b/src/main/java/net/minecraft/server/NBTTagList.java
|
||||
index b8bb5027ecccfc9b664145a1bfe3755f1a8af3eb..ad8a506bb430b26fe147a657a2f826daf9bf4d45 100644
|
||||
--- a/src/main/java/net/minecraft/server/NBTTagList.java
|
||||
@ -549,6 +596,19 @@ index 2dc20b5c930c6845af41b35d69cdb03db639d63e..6cdd4d46d987132c3c241800b5d59cee
|
||||
this.e = 0;
|
||||
this.f = 0;
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/StructureGenerator.java b/src/main/java/net/minecraft/server/StructureGenerator.java
|
||||
index 68510457b527e61bf60bf1e7dfd664578172c00a..eefad79a01de61eff5e0bd3f709bfda030ebe20d 100644
|
||||
--- a/src/main/java/net/minecraft/server/StructureGenerator.java
|
||||
+++ b/src/main/java/net/minecraft/server/StructureGenerator.java
|
||||
@@ -42,7 +42,7 @@ public abstract class StructureGenerator<C extends WorldGenFeatureConfiguration>
|
||||
private static <F extends StructureGenerator<?>> F a(String s, F f0, WorldGenStage.Decoration worldgenstage_decoration) {
|
||||
StructureGenerator.a.put(s.toLowerCase(Locale.ROOT), f0);
|
||||
StructureGenerator.u.put(f0, worldgenstage_decoration);
|
||||
- return (StructureGenerator) IRegistry.a(IRegistry.STRUCTURE_FEATURE, s.toLowerCase(Locale.ROOT), (Object) f0);
|
||||
+ return (F) IRegistry.<StructureGenerator<?>>a(IRegistry.STRUCTURE_FEATURE, s.toLowerCase(Locale.ROOT), f0); // Paper - decomp fix
|
||||
}
|
||||
|
||||
public StructureGenerator(Codec<C> codec) {
|
||||
diff --git a/src/main/java/net/minecraft/server/SystemUtils.java b/src/main/java/net/minecraft/server/SystemUtils.java
|
||||
index a1a5460e429356b52a75037c809cec85bd99084a..80ee8d196436e271833503a0e123401d1b3314a9 100644
|
||||
--- a/src/main/java/net/minecraft/server/SystemUtils.java
|
||||
|
@ -544,13 +544,14 @@ index 0000000000000000000000000000000000000000..d4ebcf8f66197299256bd6b65710a148
|
||||
+}
|
||||
diff --git a/src/main/java/co/aikar/timings/WorldTimingsHandler.java b/src/main/java/co/aikar/timings/WorldTimingsHandler.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..03bb2102d6952df04753ba9986aad9b494568e2d
|
||||
index 0000000000000000000000000000000000000000..944fd203e9f39d6c6fc9e270940c76c98067273a
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/co/aikar/timings/WorldTimingsHandler.java
|
||||
@@ -0,0 +1,118 @@
|
||||
@@ -0,0 +1,119 @@
|
||||
+package co.aikar.timings;
|
||||
+
|
||||
+import net.minecraft.server.World;
|
||||
+import net.minecraft.server.WorldDataServer;
|
||||
+import net.minecraft.server.WorldServer;
|
||||
+
|
||||
+/**
|
||||
@ -608,7 +609,7 @@ index 0000000000000000000000000000000000000000..03bb2102d6952df04753ba9986aad9b4
|
||||
+ public final Timing miscMobSpawning;
|
||||
+
|
||||
+ public WorldTimingsHandler(World server) {
|
||||
+ String name = server.getWorld().getName() +" - ";
|
||||
+ String name = ((WorldDataServer) server.getWorldData()).getName() + " - ";
|
||||
+
|
||||
+ mobSpawn = Timings.ofSafe(name + "mobSpawn");
|
||||
+ doChunkUnload = Timings.ofSafe(name + "doChunkUnload");
|
||||
@ -663,7 +664,7 @@ index 0000000000000000000000000000000000000000..03bb2102d6952df04753ba9986aad9b4
|
||||
+ }
|
||||
+
|
||||
+ public static Timing getTickList(WorldServer worldserver, String timingsType) {
|
||||
+ return Timings.ofSafe(worldserver.getWorld().getName() + " - Scheduled " + timingsType);
|
||||
+ return Timings.ofSafe(((WorldDataServer) worldserver.getWorldData()).getName() + " - Scheduled " + timingsType);
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
||||
@ -923,7 +924,7 @@ index 903cbd10fba18e61a4dc3ced71e22a665b78f177..423e4d12aba9197b936e69dfd4146cee
|
||||
int k = 0;
|
||||
CustomFunction.c[] acustomfunction_c = customfunction.b();
|
||||
diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java
|
||||
index 1964130ae411ff7d5e1b456a23629804d294a5d0..4cf4ef11ce295aec3b7d0bf07b64a1ecdca3c39a 100644
|
||||
index aa68eb71b131c1d529ded6c651621cfab071b3c4..9cba62efdb051c9850bbf28b0be17a7e00ed83c9 100644
|
||||
--- a/src/main/java/net/minecraft/server/DedicatedServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/DedicatedServer.java
|
||||
@@ -28,7 +28,7 @@ import org.apache.logging.log4j.Level;
|
||||
|
@ -4,8 +4,45 @@ Date: Sun, 8 Mar 2015 22:55:25 -0600
|
||||
Subject: [PATCH] Optimize TileEntity Ticking
|
||||
|
||||
|
||||
diff --git a/src/main/java/co/aikar/timings/TimingsExport.java b/src/main/java/co/aikar/timings/TimingsExport.java
|
||||
index d4ebcf8f66197299256bd6b65710a1488c90ea41..c9164dfdb27ddf3709129c8aec54903a1df121ff 100644
|
||||
--- a/src/main/java/co/aikar/timings/TimingsExport.java
|
||||
+++ b/src/main/java/co/aikar/timings/TimingsExport.java
|
||||
@@ -109,7 +109,7 @@ public class TimingsExport extends Thread {
|
||||
pair("end", System.currentTimeMillis() / 1000),
|
||||
pair("online-mode", Bukkit.getServer().getOnlineMode()),
|
||||
pair("sampletime", (System.currentTimeMillis() - TimingsManager.timingStart) / 1000),
|
||||
- pair("datapacks", toArrayMapper(MinecraftServer.getServer().getResourcePackRepository().d(), pack -> {
|
||||
+ pair("datapacks", toArrayMapper(MinecraftServer.getServer().getResourcePackRepository().e(), pack -> {
|
||||
// Don't feel like obf helper'ing these, non fatal if its temp missed.
|
||||
return ChatColor.stripColor(CraftChatMessage.fromComponent(pack.a(true)));
|
||||
}))
|
||||
@@ -148,8 +148,8 @@ public class TimingsExport extends Thread {
|
||||
);
|
||||
|
||||
parent.put("worlds", toObjectMapper(MinecraftServer.getServer().getWorlds(), world -> {
|
||||
- if (world.getWorldData().getName().equals("worldeditregentempworld")) return null;
|
||||
- return pair(world.getWorldData().getName(), createObject(
|
||||
+ if (world.getWorld().getName().equals("worldeditregentempworld")) return null;
|
||||
+ return pair(world.getWorld().getName(), createObject(
|
||||
pair("gamerules", toObjectMapper(world.getWorld().getGameRules(), rule -> {
|
||||
return pair(rule, world.getWorld().getGameRuleValue(rule));
|
||||
})),
|
||||
diff --git a/src/main/java/net/minecraft/server/BlockChest.java b/src/main/java/net/minecraft/server/BlockChest.java
|
||||
index 1441d096d44ea653539ba20ccda94eb62ffc32df..b9d0d2d42850c3a5d093429cd0d02ac47848f04b 100644
|
||||
--- a/src/main/java/net/minecraft/server/BlockChest.java
|
||||
+++ b/src/main/java/net/minecraft/server/BlockChest.java
|
||||
@@ -11,7 +11,7 @@ public class BlockChest extends BlockChestAbstract<TileEntityChest> implements I
|
||||
|
||||
public static final BlockStateDirection FACING = BlockFacingHorizontal.FACING;
|
||||
public static final BlockStateEnum<BlockPropertyChestType> c = BlockProperties.aF;
|
||||
- public static final BlockStateBoolean d = BlockProperties.C;
|
||||
+ public static final BlockStateBoolean d = BlockProperties.C; public static final BlockStateBoolean waterlogged() { return d; } // Paper OBFHELPER
|
||||
protected static final VoxelShape e = Block.a(1.0D, 0.0D, 0.0D, 15.0D, 14.0D, 15.0D);
|
||||
protected static final VoxelShape f = Block.a(1.0D, 0.0D, 1.0D, 15.0D, 14.0D, 16.0D);
|
||||
protected static final VoxelShape g = Block.a(0.0D, 0.0D, 1.0D, 15.0D, 14.0D, 15.0D);
|
||||
diff --git a/src/main/java/net/minecraft/server/TileEntityChest.java b/src/main/java/net/minecraft/server/TileEntityChest.java
|
||||
index 58b1fd7415fdc67be7dc33e7f55c59df83bc996a..cc15686573f3a54ff0145b3486679b772157d191 100644
|
||||
index 58b1fd7415fdc67be7dc33e7f55c59df83bc996a..832fe1d41d69f44e4de1a6f4d037d3e104cac7af 100644
|
||||
--- a/src/main/java/net/minecraft/server/TileEntityChest.java
|
||||
+++ b/src/main/java/net/minecraft/server/TileEntityChest.java
|
||||
@@ -7,7 +7,7 @@ import org.bukkit.craftbukkit.entity.CraftHumanEntity;
|
||||
@ -70,7 +107,7 @@ index 58b1fd7415fdc67be7dc33e7f55c59df83bc996a..cc15686573f3a54ff0145b3486679b77
|
||||
}
|
||||
|
||||
private void a(SoundEffect soundeffect) {
|
||||
+ if (!this.getBlock().hasProperty(BlockChest.c)) { return; } // Paper - this can be delayed, double check exists - Fixes GH-2074
|
||||
+ if (!this.getBlock().get(BlockChest.waterlogged())) { return; } // Paper - this can be delayed, double check exists - Fixes GH-2074
|
||||
BlockPropertyChestType blockpropertychesttype = (BlockPropertyChestType) this.getBlock().get(BlockChest.c);
|
||||
|
||||
if (blockpropertychesttype != BlockPropertyChestType.LEFT) {
|
||||
|
@ -57,7 +57,7 @@ index d1581c9d9838797eb425020d21bd0fba432e5652..99dc43159f240135957aee35f6129f19
|
||||
packetdataserializer.a(this.c);
|
||||
packetdataserializer.a(this.d);
|
||||
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
|
||||
index 42e7394326237fcb466ac9727b5ac732518cf1b9..32be0e35918398f2fd5f62c2cb87c4597985b7b3 100644
|
||||
index 42e7394326237fcb466ac9727b5ac732518cf1b9..5ed9122da69b8253c71744700ee9892a6326c8d9 100644
|
||||
--- a/src/main/java/net/minecraft/server/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/PlayerList.java
|
||||
@@ -75,6 +75,7 @@ public abstract class PlayerList {
|
||||
@ -73,7 +73,7 @@ index 42e7394326237fcb466ac9727b5ac732518cf1b9..32be0e35918398f2fd5f62c2cb87c459
|
||||
|
||||
entityplayer.syncInventory();
|
||||
+ // Paper start - Add to collideRule team if needed
|
||||
+ final Scoreboard scoreboard = this.getServer().getWorldServer(DimensionManager.OVERWORLD).getScoreboard();
|
||||
+ final Scoreboard scoreboard = this.getServer().getWorldServer(World.OVERWORLD).getScoreboard();
|
||||
+ final ScoreboardTeam collideRuleTeam = scoreboard.getTeam(collideRuleTeamName);
|
||||
+ if (this.collideRuleTeamName != null && collideRuleTeam != null && entityplayer.getScoreboardTeam() == null) {
|
||||
+ scoreboard.addPlayerToTeam(entityplayer.getName(), collideRuleTeam);
|
||||
@ -88,7 +88,7 @@ index 42e7394326237fcb466ac9727b5ac732518cf1b9..32be0e35918398f2fd5f62c2cb87c459
|
||||
|
||||
+ // Paper start - Remove from collideRule team if needed
|
||||
+ if (this.collideRuleTeamName != null) {
|
||||
+ final Scoreboard scoreBoard = this.server.getWorldServer(DimensionManager.OVERWORLD).getScoreboard();
|
||||
+ final Scoreboard scoreBoard = this.server.getWorldServer(World.OVERWORLD).getScoreboard();
|
||||
+ final ScoreboardTeam team = scoreBoard.getTeam(this.collideRuleTeamName);
|
||||
+ if (entityplayer.getScoreboardTeam() == team && team != null) {
|
||||
+ scoreBoard.removePlayerFromTeam(entityplayer.getName(), team);
|
||||
@ -105,7 +105,7 @@ index 42e7394326237fcb466ac9727b5ac732518cf1b9..32be0e35918398f2fd5f62c2cb87c459
|
||||
|
||||
+ // Paper start - Remove collideRule team if it exists
|
||||
+ if (this.collideRuleTeamName != null) {
|
||||
+ final Scoreboard scoreboard = this.getServer().getWorldServer(DimensionManager.OVERWORLD).getScoreboard();
|
||||
+ final Scoreboard scoreboard = this.getServer().getWorldServer(World.OVERWORLD).getScoreboard();
|
||||
+ final ScoreboardTeam team = scoreboard.getTeam(this.collideRuleTeamName);
|
||||
+ if (team != null) scoreboard.removeTeam(team);
|
||||
+ }
|
||||
|
@ -5,7 +5,7 @@ Subject: [PATCH] Remove FishingHook reference on Craft Entity removal
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftFishHook.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftFishHook.java
|
||||
index 591650712199f904af2c66b0d7e36ce31d87e1a3..f7b5320fc6c8a9dec40c69907c020d96fd3bfa00 100644
|
||||
index 591650712199f904af2c66b0d7e36ce31d87e1a3..b3c293a55e199d862526d35b6e85afc760f2b6fb 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftFishHook.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftFishHook.java
|
||||
@@ -48,4 +48,15 @@ public class CraftFishHook extends CraftProjectile implements FishHook {
|
||||
@ -17,10 +17,10 @@ index 591650712199f904af2c66b0d7e36ce31d87e1a3..f7b5320fc6c8a9dec40c69907c020d96
|
||||
+ @Override
|
||||
+ public void remove() {
|
||||
+ super.remove();
|
||||
+ if (getHandle().owner != null) {
|
||||
+ getHandle().owner.hookedFish = null;
|
||||
+ if (getHandle().getOwner() != null) {
|
||||
+ getHandle().getOwner().hookedFish = null;
|
||||
+ }
|
||||
+ }
|
||||
+ // Paper end
|
||||
+
|
||||
+
|
||||
}
|
||||
|
@ -4,8 +4,21 @@ Date: Tue, 27 Dec 2016 15:02:42 -0500
|
||||
Subject: [PATCH] String based Action Bar API
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/SystemUtils.java b/src/main/java/net/minecraft/server/SystemUtils.java
|
||||
index 275c1d2d1eb2649de9a9b5aece6e88c21362efba..d72ba7f76c42fd525a5b59a999a0c08e35d0ef78 100644
|
||||
--- a/src/main/java/net/minecraft/server/SystemUtils.java
|
||||
+++ b/src/main/java/net/minecraft/server/SystemUtils.java
|
||||
@@ -48,7 +48,7 @@ public class SystemUtils {
|
||||
private static final ExecutorService e = a("Main");
|
||||
private static final ExecutorService f = n();
|
||||
public static LongSupplier a = System::nanoTime;
|
||||
- public static final UUID b = new UUID(0L, 0L);
|
||||
+ public static final UUID b = new UUID(0L, 0L); public static final UUID getNullUUID() {return b;} // Paper OBFHELPER
|
||||
private static final Logger LOGGER = LogManager.getLogger();
|
||||
|
||||
public static <K, V> Collector<Entry<? extends K, ? extends V>, ?, Map<K, V>> a() {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index 20cb63419a049ce9dcaf2f0c99274501ebf9aa8c..527c116c23a505eead00e73a39ce9f932eb4ad8d 100644
|
||||
index 20cb63419a049ce9dcaf2f0c99274501ebf9aa8c..2118f7a8ea87191fd6fb5324c3c29f8beb43f3f3 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -219,6 +219,18 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@ -15,7 +28,7 @@ index 20cb63419a049ce9dcaf2f0c99274501ebf9aa8c..527c116c23a505eead00e73a39ce9f93
|
||||
+ @Override
|
||||
+ public void sendActionBar(String message) {
|
||||
+ if (getHandle().playerConnection == null || message == null || message.isEmpty()) return;
|
||||
+ getHandle().playerConnection.sendPacket(new PacketPlayOutChat(new net.minecraft.server.ChatComponentText(message), net.minecraft.server.ChatMessageType.GAME_INFO));
|
||||
+ getHandle().playerConnection.sendPacket(new PacketPlayOutChat(new net.minecraft.server.ChatComponentText(message), net.minecraft.server.ChatMessageType.GAME_INFO, SystemUtils.getNullUUID()));
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
|
@ -32,7 +32,7 @@ index 0000000000000000000000000000000000000000..696660b089ba355f865e5051237eefd0
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/net/minecraft/server/IRangedEntity.java b/src/main/java/net/minecraft/server/IRangedEntity.java
|
||||
index b4178ce1e86ad40b64a229e066f058a8e848324d..9b79ac77db880930fcb86744924bf0baa92bef31 100644
|
||||
index b4178ce1e86ad40b64a229e066f058a8e848324d..fbfed5140539384bdd31e0f2777a3f92690d2576 100644
|
||||
--- a/src/main/java/net/minecraft/server/IRangedEntity.java
|
||||
+++ b/src/main/java/net/minecraft/server/IRangedEntity.java
|
||||
@@ -2,5 +2,8 @@ package net.minecraft.server;
|
||||
@ -43,7 +43,7 @@ index b4178ce1e86ad40b64a229e066f058a8e848324d..9b79ac77db880930fcb86744924bf0ba
|
||||
+ void a(EntityLiving entityliving, float f); default void rangedAttack(EntityLiving entityliving, float f) { a(entityliving, f); } // Paper - OBFHELPER
|
||||
+
|
||||
+ // - see EntitySkeletonAbstract melee goal
|
||||
+ void q(boolean flag); default void setChargingAttack(boolean charging) { q(charging); }; // Paper
|
||||
+ void setAggressive(boolean flag); default void setChargingAttack(boolean charging) { setAggressive(charging); }; // Paper
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftDrowned.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftDrowned.java
|
||||
index 6e41dfd92344e3de71642879993cf25a5dd8b30a..390183fffd952e583a7d7df9ae618458fb48d278 100644
|
||||
|
@ -115,7 +115,7 @@ index c6fe9c1f7ef06c4524533130b493ca5e72bd1693..7b601955f3fd36f06c838b896b455a60
|
||||
world.a(blockposition, false);
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityEnderDragon.java b/src/main/java/net/minecraft/server/EntityEnderDragon.java
|
||||
index 05b7cdb33b45a4f503cd7fe4130b54d59e7b6452..279807dc5045e765fe7496315494b2cb231d08f9 100644
|
||||
index 05b7cdb33b45a4f503cd7fe4130b54d59e7b6452..3cb8ce58c4675564fb239338d6c40ea511a9a97c 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityEnderDragon.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityEnderDragon.java
|
||||
@@ -11,6 +11,7 @@ import org.bukkit.craftbukkit.block.CraftBlock;
|
||||
@ -131,7 +131,7 @@ index 05b7cdb33b45a4f503cd7fe4130b54d59e7b6452..279807dc5045e765fe7496315494b2cb
|
||||
craftBlock.getNMS().dropNaturally(world, blockposition, ItemStack.b);
|
||||
}
|
||||
+ // Paper start - TNTPrimeEvent
|
||||
+ org.bukkit.block.Block tntBlock = world.getWorld().getBlockAt(blockposition.x, blockposition.y, blockposition.z);
|
||||
+ org.bukkit.block.Block tntBlock = world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ());
|
||||
+ if(!new TNTPrimeEvent(tntBlock, TNTPrimeEvent.PrimeReason.EXPLOSION, explosionSource.getSource().getBukkitEntity()).callEvent())
|
||||
+ continue;
|
||||
+ // Paper end
|
||||
|
@ -0,0 +1,176 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: kashike <kashike@vq.lc>
|
||||
Date: Wed, 15 Aug 2018 01:26:09 -0700
|
||||
Subject: [PATCH] Allow disabling armour stand ticking
|
||||
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
index eaaa51e4bf761f41fd516402ce1ad0f903c6ab71..bc3df01aab3e79be9c2836820e0eacc69ea6c1f4 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
@@ -393,4 +393,10 @@ public class PaperWorldConfig {
|
||||
private void armorStandEntityLookups() {
|
||||
armorStandEntityLookups = getBoolean("armor-stands-do-collision-entity-lookups", true);
|
||||
}
|
||||
+
|
||||
+ public boolean armorStandTick = true;
|
||||
+ private void armorStandTick() {
|
||||
+ this.armorStandTick = this.getBoolean("armor-stands-tick", this.armorStandTick);
|
||||
+ log("ArmorStand ticking is " + (this.armorStandTick ? "enabled" : "disabled") + " by default");
|
||||
+ }
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityArmorStand.java b/src/main/java/net/minecraft/server/EntityArmorStand.java
|
||||
index a70b1a17fe884980ef7c3c0a36e567a0e69ef7f0..d5c09152acc93b25d626284071599afdbd76b709 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityArmorStand.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityArmorStand.java
|
||||
@@ -44,6 +44,12 @@ public class EntityArmorStand extends EntityLiving {
|
||||
public Vector3f leftLegPose;
|
||||
public Vector3f rightLegPose;
|
||||
public boolean canMove = true; // Paper
|
||||
+ // Paper start - Allow ArmorStands not to tick
|
||||
+ public boolean canTick = true;
|
||||
+ public boolean canTickSetByAPI = false;
|
||||
+ private boolean noTickPoseDirty = false;
|
||||
+ private boolean noTickEquipmentDirty = false;
|
||||
+ // Paper end
|
||||
|
||||
public EntityArmorStand(EntityTypes<? extends EntityArmorStand> entitytypes, World world) {
|
||||
super(entitytypes, world);
|
||||
@@ -55,6 +61,7 @@ public class EntityArmorStand extends EntityLiving {
|
||||
this.rightArmPose = EntityArmorStand.bt;
|
||||
this.leftLegPose = EntityArmorStand.bu;
|
||||
this.rightLegPose = EntityArmorStand.bv;
|
||||
+ if (world != null) this.canTick = world.paperConfig.armorStandTick; // Paper - armour stand ticking
|
||||
this.G = 0.0F;
|
||||
}
|
||||
|
||||
@@ -135,6 +142,7 @@ public class EntityArmorStand extends EntityLiving {
|
||||
this.armorItems.set(enumitemslot.b(), itemstack);
|
||||
}
|
||||
|
||||
+ this.noTickEquipmentDirty = true; // Paper - Allow equipment to be updated even when tick disabled
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -215,6 +223,7 @@ public class EntityArmorStand extends EntityLiving {
|
||||
}
|
||||
|
||||
nbttagcompound.set("Pose", this.B());
|
||||
+ if (this.canTickSetByAPI) nbttagcompound.setBoolean("Paper.CanTickOverride", this.canTick); // Paper - persist no tick setting
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -246,6 +255,12 @@ public class EntityArmorStand extends EntityLiving {
|
||||
this.setBasePlate(nbttagcompound.getBoolean("NoBasePlate"));
|
||||
this.setMarker(nbttagcompound.getBoolean("Marker"));
|
||||
this.noclip = !this.A();
|
||||
+ // Paper start - persist no tick
|
||||
+ if (nbttagcompound.hasKey("Paper.CanTickOverride")) {
|
||||
+ this.canTick = nbttagcompound.getBoolean("Paper.CanTickOverride");
|
||||
+ this.canTickSetByAPI = true;
|
||||
+ }
|
||||
+ // Paper end
|
||||
NBTTagCompound nbttagcompound1 = nbttagcompound.getCompound("Pose");
|
||||
|
||||
this.g(nbttagcompound1);
|
||||
@@ -600,7 +615,29 @@ public class EntityArmorStand extends EntityLiving {
|
||||
|
||||
@Override
|
||||
public void tick() {
|
||||
+ // Paper start
|
||||
+ if (!this.canTick) {
|
||||
+ if (this.noTickPoseDirty) {
|
||||
+ this.noTickPoseDirty = false;
|
||||
+ this.updatePose();
|
||||
+ }
|
||||
+
|
||||
+ if (this.noTickEquipmentDirty) {
|
||||
+ this.noTickEquipmentDirty = false;
|
||||
+ this.updateEntityEquipment();
|
||||
+ }
|
||||
+
|
||||
+ return;
|
||||
+ }
|
||||
+ // Paper end
|
||||
+
|
||||
super.tick();
|
||||
+ // Paper start - Split into separate method
|
||||
+ updatePose();
|
||||
+ }
|
||||
+
|
||||
+ public void updatePose() {
|
||||
+ // Paper end
|
||||
Vector3f vector3f = (Vector3f) this.datawatcher.get(EntityArmorStand.c);
|
||||
|
||||
if (!this.headPose.equals(vector3f)) {
|
||||
@@ -723,31 +760,37 @@ public class EntityArmorStand extends EntityLiving {
|
||||
public void setHeadPose(Vector3f vector3f) {
|
||||
this.headPose = vector3f;
|
||||
this.datawatcher.set(EntityArmorStand.c, vector3f);
|
||||
+ this.noTickPoseDirty = true; // Paper - Allow updates when not ticking
|
||||
}
|
||||
|
||||
public void setBodyPose(Vector3f vector3f) {
|
||||
this.bodyPose = vector3f;
|
||||
this.datawatcher.set(EntityArmorStand.d, vector3f);
|
||||
+ this.noTickPoseDirty = true; // Paper - Allow updates when not ticking
|
||||
}
|
||||
|
||||
public void setLeftArmPose(Vector3f vector3f) {
|
||||
this.leftArmPose = vector3f;
|
||||
this.datawatcher.set(EntityArmorStand.e, vector3f);
|
||||
+ this.noTickPoseDirty = true; // Paper - Allow updates when not ticking
|
||||
}
|
||||
|
||||
public void setRightArmPose(Vector3f vector3f) {
|
||||
this.rightArmPose = vector3f;
|
||||
this.datawatcher.set(EntityArmorStand.f, vector3f);
|
||||
+ this.noTickPoseDirty = true; // Paper - Allow updates when not ticking
|
||||
}
|
||||
|
||||
public void setLeftLegPose(Vector3f vector3f) {
|
||||
this.leftLegPose = vector3f;
|
||||
this.datawatcher.set(EntityArmorStand.g, vector3f);
|
||||
+ this.noTickPoseDirty = true; // Paper - Allow updates when not ticking
|
||||
}
|
||||
|
||||
public void setRightLegPose(Vector3f vector3f) {
|
||||
this.rightLegPose = vector3f;
|
||||
this.datawatcher.set(EntityArmorStand.bo, vector3f);
|
||||
+ this.noTickPoseDirty = true; // Paper - Allow updates when not ticking
|
||||
}
|
||||
|
||||
public Vector3f r() {
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
index b80068b184b32256f1944b9863454726852cd502..f65a0b943843ea365384825c5a848305f303d8f9 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
@@ -2503,6 +2503,7 @@ public abstract class EntityLiving extends Entity {
|
||||
}
|
||||
}
|
||||
|
||||
+ public void updateEntityEquipment() { q(); }; // Paper
|
||||
private void q() {
|
||||
Map<EnumItemSlot, ItemStack> map = this.r();
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java
|
||||
index d1d689e5d78c569313c4059c4652724605dc07d2..ac105270d5c7e2070f52782fc7dbdcd381db33a5 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java
|
||||
@@ -297,5 +297,16 @@ public class CraftArmorStand extends CraftLivingEntity implements ArmorStand {
|
||||
public boolean isSlotDisabled(org.bukkit.inventory.EquipmentSlot slot) {
|
||||
return getHandle().isSlotDisabled(org.bukkit.craftbukkit.CraftEquipmentSlot.getNMS(slot));
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean canTick() {
|
||||
+ return this.getHandle().canTick;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void setCanTick(final boolean tick) {
|
||||
+ this.getHandle().canTick = tick;
|
||||
+ this.getHandle().canTickSetByAPI = true;
|
||||
+ }
|
||||
// Paper end
|
||||
}
|
@ -5,12 +5,12 @@ Subject: [PATCH] Configurable speed for water flowing over lava
|
||||
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
index eaaa51e4bf761f41fd516402ce1ad0f903c6ab71..3c28dc61f97a65a0440c122ac5777cb9e24cdb3a 100644
|
||||
index bc3df01aab3e79be9c2836820e0eacc69ea6c1f4..487b0d5cd608e84a793eba5fdbd50a9f3d95c79b 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
@@ -393,4 +393,10 @@ public class PaperWorldConfig {
|
||||
private void armorStandEntityLookups() {
|
||||
armorStandEntityLookups = getBoolean("armor-stands-do-collision-entity-lookups", true);
|
||||
@@ -399,4 +399,10 @@ public class PaperWorldConfig {
|
||||
this.armorStandTick = this.getBoolean("armor-stands-tick", this.armorStandTick);
|
||||
log("ArmorStand ticking is " + (this.armorStandTick ? "enabled" : "disabled") + " by default");
|
||||
}
|
||||
+
|
||||
+ public int waterOverLavaFlowSpeed;
|
@ -8,7 +8,7 @@ Use larger initial sizes to increase bucket capacity on the BiMap
|
||||
BiMap.get was seen to be using a good bit of CPU time.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/RegistryMaterials.java b/src/main/java/net/minecraft/server/RegistryMaterials.java
|
||||
index c60140a283df47edf23fe4f54a2c1d2fca7593f8..7189204ee57343b3381e8c83eb5a5281a0e0962f 100644
|
||||
index c60140a283df47edf23fe4f54a2c1d2fca7593f8..79817e3ffcac372e00b92c5b6bcb44653fcb73db 100644
|
||||
--- a/src/main/java/net/minecraft/server/RegistryMaterials.java
|
||||
+++ b/src/main/java/net/minecraft/server/RegistryMaterials.java
|
||||
@@ -25,9 +25,9 @@ import org.apache.logging.log4j.Logger;
|
||||
@ -42,3 +42,12 @@ index c60140a283df47edf23fe4f54a2c1d2fca7593f8..7189204ee57343b3381e8c83eb5a5281
|
||||
|
||||
builder.add(Pair.of(registrymaterials.c(t0).get(), t0));
|
||||
}
|
||||
@@ -191,7 +191,7 @@ public class RegistryMaterials<T> extends IRegistryWritable<T> {
|
||||
|
||||
registrymaterials.bb.entrySet().stream().filter((entry) -> {
|
||||
return registrymaterials.c((ResourceKey) entry.getKey());
|
||||
- }).forEach(com_google_common_collect_immutablemap_builder::put);
|
||||
+ }).forEach(entry1 -> com_google_common_collect_immutablemap_builder.put((java.util.Map.Entry<? extends net.minecraft.server.ResourceKey<T>,? extends T>) entry1)); // Paper - compiler fix (expand method reference + add cast)
|
||||
return com_google_common_collect_immutablemap_builder.build();
|
||||
});
|
||||
}
|
@ -5,10 +5,10 @@ Subject: [PATCH] Add ray tracing methods to LivingEntity
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
index b80068b184b32256f1944b9863454726852cd502..12e7b1b5d15e94068c85f189c4ad1c5b5fab5e38 100644
|
||||
index f65a0b943843ea365384825c5a848305f303d8f9..c3f3a392f2b15a806c706b1e518282225b45bbc3 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
@@ -3441,6 +3441,23 @@ public abstract class EntityLiving extends Entity {
|
||||
@@ -3442,6 +3442,23 @@ public abstract class EntityLiving extends Entity {
|
||||
this.broadcastItemBreak(enumhand == EnumHand.MAIN_HAND ? EnumItemSlot.MAINHAND : EnumItemSlot.OFFHAND);
|
||||
}
|
||||
// Paper start
|
@ -27,7 +27,7 @@ index 1249a7ae8fa8d6ea33cbc276717f1e4553f73b85..af554396fdb25719c158a81ccab76e91
|
||||
this.aA = 0;
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index 0ba5b2a444660f280b673dbd0db9ded38fa6a839..7b9b7b55c0b726648cfa4b9b87ad70c91fad2d75 100644
|
||||
index 071a95a6ce704a8d3828cfb01ab7dc666a4622a0..8a6cda5df562baefb2bc245192e9ab539e1b6022 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -1945,6 +1945,20 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
@ -47,10 +47,10 @@ index 413dd5456d14842ab48143b6ee35e37dcb5ca3db..a704feb0c19b56964d017f9e0ea3f26b
|
||||
|
||||
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 a70b1a17fe884980ef7c3c0a36e567a0e69ef7f0..74c58c3f82a94a3ec5e53c7f92e54cee80dc9e8a 100644
|
||||
index d5c09152acc93b25d626284071599afdbd76b709..51e9f4a6e09474a7489d2872a800308ee3f02e46 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityArmorStand.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityArmorStand.java
|
||||
@@ -664,7 +664,8 @@ public class EntityArmorStand extends EntityLiving {
|
||||
@@ -701,7 +701,8 @@ public class EntityArmorStand extends EntityLiving {
|
||||
|
||||
@Override
|
||||
public void killEntity() {
|
||||
@ -119,7 +119,7 @@ index c2a3bd8f25e91f79723074d93f6a646a8ce76d8c..4934e71225fe1242615660a379e797e2
|
||||
public void saveData(NBTTagCompound nbttagcompound) {
|
||||
super.saveData(nbttagcompound);
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
index 12e7b1b5d15e94068c85f189c4ad1c5b5fab5e38..c00031656bb6d2f986f555c68bb2fa9b9b0c0e6d 100644
|
||||
index c3f3a392f2b15a806c706b1e518282225b45bbc3..f5f043f0a5bafb7e432a541f9ef6db0956a52f31 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
@@ -95,7 +95,7 @@ public abstract class EntityLiving extends Entity {
|
||||
@ -357,7 +357,7 @@ index 7b565ddfffd0b9c78392ee115ef9c20ab89a3380..d78b9fd608da691220f1edeff506b36e
|
||||
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 7b9b7b55c0b726648cfa4b9b87ad70c91fad2d75..51e7c6d82248b5c0938d37607c64a9c10cb4de4d 100644
|
||||
index 8a6cda5df562baefb2bc245192e9ab539e1b6022..0e1f5c75b6ab37ce3cfbeaecdc3dd64e8c05e18e 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -1739,7 +1739,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
@ -130,10 +130,18 @@ index 0000000000000000000000000000000000000000..fdd8708f974700c7cde6e436c2f189d9
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/net/minecraft/server/LoginListener.java b/src/main/java/net/minecraft/server/LoginListener.java
|
||||
index e0f0a1e91a037f93b239e779aa8fd92be8a8c01f..57520943befea80b334ccf2385057b88131ddd8e 100644
|
||||
index e0f0a1e91a037f93b239e779aa8fd92be8a8c01f..7d65ce89622b00a121ce0353f697b07d9e99d0ce 100644
|
||||
--- a/src/main/java/net/minecraft/server/LoginListener.java
|
||||
+++ b/src/main/java/net/minecraft/server/LoginListener.java
|
||||
@@ -41,6 +41,7 @@ public class LoginListener implements PacketLoginInListener {
|
||||
@@ -25,6 +25,7 @@ import org.bukkit.craftbukkit.util.Waitable;
|
||||
import org.bukkit.event.player.AsyncPlayerPreLoginEvent;
|
||||
import org.bukkit.event.player.PlayerPreLoginEvent;
|
||||
// CraftBukkit end
|
||||
+import io.netty.buffer.Unpooled; // Paper
|
||||
|
||||
public class LoginListener implements PacketLoginInListener {
|
||||
|
||||
@@ -41,6 +42,7 @@ public class LoginListener implements PacketLoginInListener {
|
||||
private SecretKey loginKey;
|
||||
private EntityPlayer l;
|
||||
public String hostname = ""; // CraftBukkit - add field
|
||||
@ -141,14 +149,14 @@ index e0f0a1e91a037f93b239e779aa8fd92be8a8c01f..57520943befea80b334ccf2385057b88
|
||||
|
||||
public LoginListener(MinecraftServer minecraftserver, NetworkManager networkmanager) {
|
||||
this.g = LoginListener.EnumProtocolState.HELLO;
|
||||
@@ -192,6 +193,14 @@ public class LoginListener implements PacketLoginInListener {
|
||||
@@ -192,6 +194,14 @@ public class LoginListener implements PacketLoginInListener {
|
||||
this.g = LoginListener.EnumProtocolState.KEY;
|
||||
this.networkManager.sendPacket(new PacketLoginOutEncryptionBegin("", this.server.getKeyPair().getPublic(), this.e));
|
||||
} else {
|
||||
+ // Paper start - Velocity support
|
||||
+ if (com.destroystokyo.paper.PaperConfig.velocitySupport) {
|
||||
+ this.velocityLoginMessageId = java.util.concurrent.ThreadLocalRandom.current().nextInt();
|
||||
+ PacketLoginOutCustomPayload packet = new PacketLoginOutCustomPayload(this.velocityLoginMessageId, com.destroystokyo.paper.proxy.VelocityProxy.PLAYER_INFO_CHANNEL, new PacketDataSerializer(io.netty.buffer.Unpooled.EMPTY_BUFFER));
|
||||
+ PacketLoginOutCustomPayload packet = new PacketLoginOutCustomPayload(this.velocityLoginMessageId, com.destroystokyo.paper.proxy.VelocityProxy.PLAYER_INFO_CHANNEL, new PacketDataSerializer(Unpooled.EMPTY_BUFFER));
|
||||
+ this.networkManager.sendPacket(packet);
|
||||
+ return;
|
||||
+ }
|
||||
@ -156,7 +164,7 @@ index e0f0a1e91a037f93b239e779aa8fd92be8a8c01f..57520943befea80b334ccf2385057b88
|
||||
// Spigot start
|
||||
// Paper start - Cache authenticator threads
|
||||
authenticatorPool.execute(new Runnable() {
|
||||
@@ -284,6 +293,12 @@ public class LoginListener implements PacketLoginInListener {
|
||||
@@ -284,6 +294,12 @@ public class LoginListener implements PacketLoginInListener {
|
||||
public class LoginHandler {
|
||||
|
||||
public void fireEvents() throws Exception {
|
||||
@ -169,7 +177,7 @@ index e0f0a1e91a037f93b239e779aa8fd92be8a8c01f..57520943befea80b334ccf2385057b88
|
||||
String playerName = i.getName();
|
||||
java.net.InetAddress address = ((java.net.InetSocketAddress) networkManager.getSocketAddress()).getAddress();
|
||||
java.util.UUID uniqueId = i.getId();
|
||||
@@ -331,6 +346,35 @@ public class LoginListener implements PacketLoginInListener {
|
||||
@@ -331,6 +347,35 @@ public class LoginListener implements PacketLoginInListener {
|
||||
// Spigot end
|
||||
|
||||
public void a(PacketLoginInCustomPayload packetloginincustompayload) {
|
@ -6,10 +6,10 @@ 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 3c28dc61f97a65a0440c122ac5777cb9e24cdb3a..6f660388aa0d56577ad1c3f463c96d925c964821 100644
|
||||
index 487b0d5cd608e84a793eba5fdbd50a9f3d95c79b..b49a1a6f5017c9e183a7d08b16e89899c25a9717 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
@@ -399,4 +399,9 @@ public class PaperWorldConfig {
|
||||
@@ -405,4 +405,9 @@ public class PaperWorldConfig {
|
||||
waterOverLavaFlowSpeed = getInt("water-over-lava-flow-speed", 5);
|
||||
log("Water over lava flow speed: " + waterOverLavaFlowSpeed);
|
||||
}
|
@ -12,7 +12,7 @@ server threads
|
||||
Allow usage of a single thread executor by not using ForkJoin so single core CPU's.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index a7be2875faa968d2e3939974f62c977ca03e9c5b..29f7e78fc21ccca1a080055fe616996d1ede666f 100644
|
||||
index f33624e65a56bd7cf4432eecdd6834fa3f32cda5..4d6b4c26029ea72d92934fff35211ef562c17a4b 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -176,6 +176,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
@ -54,7 +54,7 @@ index 0000000000000000000000000000000000000000..59cfb76d737f923c7e424743ef370c96
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/net/minecraft/server/SystemUtils.java b/src/main/java/net/minecraft/server/SystemUtils.java
|
||||
index 275c1d2d1eb2649de9a9b5aece6e88c21362efba..3299ac0b0115cb1166c1ee449bd49292e553b7af 100644
|
||||
index d72ba7f76c42fd525a5b59a999a0c08e35d0ef78..5579044782f155f587de1e2ea5115bde6053f722 100644
|
||||
--- a/src/main/java/net/minecraft/server/SystemUtils.java
|
||||
+++ b/src/main/java/net/minecraft/server/SystemUtils.java
|
||||
@@ -76,14 +76,17 @@ public class SystemUtils {
|
@ -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 29f7e78fc21ccca1a080055fe616996d1ede666f..b336cd541b8e3a9ebe3d89a487160d18a294dade 100644
|
||||
index 4d6b4c26029ea72d92934fff35211ef562c17a4b..6b288bc8d4153e12b35f422f171e15a2ef7d0851 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -1197,12 +1197,24 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
@ -7,15 +7,23 @@ 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 2916119507ec5ecd9266569b0003d0504a79f6c4..cd97b6a24010165d9435a5c62b6f896278674418 100644
|
||||
index 2916119507ec5ecd9266569b0003d0504a79f6c4..e7b4c7f2d7b0eed4c145f6476f35b637d861551e 100644
|
||||
--- a/src/main/java/net/minecraft/server/NetworkManager.java
|
||||
+++ b/src/main/java/net/minecraft/server/NetworkManager.java
|
||||
@@ -97,6 +97,15 @@ public class NetworkManager extends SimpleChannelInboundHandler<Packet<?>> {
|
||||
@@ -12,6 +12,7 @@ import io.netty.channel.epoll.EpollEventLoopGroup;
|
||||
import io.netty.channel.local.LocalChannel;
|
||||
import io.netty.channel.local.LocalServerChannel;
|
||||
import io.netty.channel.nio.NioEventLoopGroup;
|
||||
+import io.netty.handler.codec.EncoderException; // Paper
|
||||
import io.netty.handler.timeout.TimeoutException;
|
||||
import io.netty.util.AttributeKey;
|
||||
import io.netty.util.concurrent.Future;
|
||||
@@ -97,6 +98,15 @@ public class NetworkManager extends SimpleChannelInboundHandler<Packet<?>> {
|
||||
}
|
||||
|
||||
public void exceptionCaught(ChannelHandlerContext channelhandlercontext, Throwable throwable) {
|
||||
+ // Paper start
|
||||
+ if (throwable instanceof io.netty.handler.codec.EncoderException && throwable.getCause() instanceof PacketEncoder.PacketTooLargeException) {
|
||||
+ if (throwable instanceof EncoderException && throwable.getCause() instanceof PacketEncoder.PacketTooLargeException) {
|
||||
+ if (((PacketEncoder.PacketTooLargeException) throwable.getCause()).getPacket().packetTooLarge(this)) {
|
||||
+ return;
|
||||
+ } else {
|
@ -91,10 +91,10 @@ index af554396fdb25719c158a81ccab76e91f5df2ff5..5ef91da9733fd9276e7bd819a11a0548
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
index c00031656bb6d2f986f555c68bb2fa9b9b0c0e6d..0b4e39d93f28ec5c7835bace2ea969a6e99ac2a3 100644
|
||||
index f5f043f0a5bafb7e432a541f9ef6db0956a52f31..ed001440151078e20a449ba073d71e873ff0ad9a 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
@@ -2891,11 +2891,13 @@ public abstract class EntityLiving extends Entity {
|
||||
@@ -2892,11 +2892,13 @@ public abstract class EntityLiving extends Entity {
|
||||
return ((Byte) this.datawatcher.get(EntityLiving.an) & 4) != 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 df98f2244a161c0e66e80f92c91760409734dc69..081baca9a101d188e4810d04f69811d52de7a107 100644
|
||||
index 7c9b437d950623a978ca3d45c8ca57b39a897179..dbd7850df45fb9ee550ce33f97bdfe9cf5bfcd34 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityInsentient.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityInsentient.java
|
||||
@@ -1423,6 +1423,8 @@ public abstract class EntityInsentient extends EntityLiving {
|
@ -34,10 +34,10 @@ 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 57520943befea80b334ccf2385057b88131ddd8e..8c5c57ecd98a286a4992a36effae95596b37fc8a 100644
|
||||
index 7d65ce89622b00a121ce0353f697b07d9e99d0ce..50163f7291474062bde81631c9220e8a9f5bb718 100644
|
||||
--- a/src/main/java/net/minecraft/server/LoginListener.java
|
||||
+++ b/src/main/java/net/minecraft/server/LoginListener.java
|
||||
@@ -34,9 +34,9 @@ public class LoginListener implements PacketLoginInListener {
|
||||
@@ -35,9 +35,9 @@ public class LoginListener implements PacketLoginInListener {
|
||||
private final byte[] e = new byte[4];
|
||||
private final MinecraftServer server;
|
||||
public final NetworkManager networkManager;
|
||||
@ -50,10 +50,10 @@ index 57520943befea80b334ccf2385057b88131ddd8e..8c5c57ecd98a286a4992a36effae9559
|
||||
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 cd97b6a24010165d9435a5c62b6f896278674418..64d61eca4bbb4a9e18d78c8d2a55114134f56b6f 100644
|
||||
index e7b4c7f2d7b0eed4c145f6476f35b637d861551e..c84ee96cbed69cca311dd546e562a5322a03fd20 100644
|
||||
--- a/src/main/java/net/minecraft/server/NetworkManager.java
|
||||
+++ b/src/main/java/net/minecraft/server/NetworkManager.java
|
||||
@@ -335,6 +335,26 @@ public class NetworkManager extends SimpleChannelInboundHandler<Packet<?>> {
|
||||
@@ -336,6 +336,26 @@ public class NetworkManager extends SimpleChannelInboundHandler<Packet<?>> {
|
||||
this.i().a(new ChatMessage("multiplayer.disconnect.generic"));
|
||||
}
|
||||
this.packetQueue.clear(); // Free up packet queue.
|
@ -28,7 +28,7 @@ index 80a9faf3b02c51efc1f55beebce173309628b9ab..ccf1a64d33038a73360f68a814bd4602
|
||||
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 8c1d836538c678feca56076753e8781eadcd6d1d..a6606eff5ac89c54bdcbee0d3bf124d737d9735b 100644
|
||||
index e9e6e89145cc3d6b2b497132030c47515bfee5ab..a6f0b39717164d6b3ab15843b13ef52a24dde5d6 100644
|
||||
--- a/src/main/java/net/minecraft/server/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/PlayerList.java
|
||||
@@ -97,6 +97,7 @@ public abstract class PlayerList {
|
||||
@ -106,7 +106,7 @@ index 00333548b470435aa89fb0f4b29047eb1461e992..5770d4183c1b9ab6119a25930283c023
|
||||
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 51e7c6d82248b5c0938d37607c64a9c10cb4de4d..d61a255abede0ae19519d83117a877d1a04307bf 100644
|
||||
index 0e1f5c75b6ab37ce3cfbeaecdc3dd64e8c05e18e..13636096a166150e1e3c0d88a31badf202f702d7 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -143,6 +143,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
@ -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 d61a255abede0ae19519d83117a877d1a04307bf..b9dcd216dd9e4eeee824b252446afdac3ca44d24 100644
|
||||
index 13636096a166150e1e3c0d88a31badf202f702d7..64c48af6dcdb6e8121d55a015fdeed63ef3f5ec3 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -1990,6 +1990,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
@ -11,7 +11,7 @@ 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 f0b3de717d5e425fb08c5afdfb3571fb6b8ab556..5e253b3609de30ac6a0a8f156c6f6d07a5bb99ce 100644
|
||||
index 7b7785f79ed176967d4c91c2d77c6f6ce73b30b8..d683ec109b23ae4c14efaa23bfe923cf2c453f87 100644
|
||||
--- a/src/main/java/net/minecraft/server/World.java
|
||||
+++ b/src/main/java/net/minecraft/server/World.java
|
||||
@@ -533,8 +533,20 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
|
@ -28,10 +28,10 @@ and then catch exceptions and close if they fire.
|
||||
Part of this commit was authored by: Spottedleaf
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/NetworkManager.java b/src/main/java/net/minecraft/server/NetworkManager.java
|
||||
index 64d61eca4bbb4a9e18d78c8d2a55114134f56b6f..020dce1a42e8e083c21fdcb7b954bc40e4902f29 100644
|
||||
index c84ee96cbed69cca311dd546e562a5322a03fd20..e27c96a1f53f6a2929b8daed9844320da6c57234 100644
|
||||
--- a/src/main/java/net/minecraft/server/NetworkManager.java
|
||||
+++ b/src/main/java/net/minecraft/server/NetworkManager.java
|
||||
@@ -64,6 +64,10 @@ public class NetworkManager extends SimpleChannelInboundHandler<Packet<?>> {
|
||||
@@ -65,6 +65,10 @@ public class NetworkManager extends SimpleChannelInboundHandler<Packet<?>> {
|
||||
public int protocolVersion;
|
||||
public java.net.InetSocketAddress virtualHost;
|
||||
private static boolean enableExplicitFlush = Boolean.getBoolean("paper.explicit-flush");
|
||||
@ -42,7 +42,7 @@ index 64d61eca4bbb4a9e18d78c8d2a55114134f56b6f..020dce1a42e8e083c21fdcb7b954bc40
|
||||
// Paper end
|
||||
|
||||
public NetworkManager(EnumProtocolDirection enumprotocoldirection) {
|
||||
@@ -87,6 +91,7 @@ public class NetworkManager extends SimpleChannelInboundHandler<Packet<?>> {
|
||||
@@ -88,6 +92,7 @@ public class NetworkManager extends SimpleChannelInboundHandler<Packet<?>> {
|
||||
}
|
||||
|
||||
public void setProtocol(EnumProtocol enumprotocol) {
|
||||
@ -50,7 +50,7 @@ index 64d61eca4bbb4a9e18d78c8d2a55114134f56b6f..020dce1a42e8e083c21fdcb7b954bc40
|
||||
this.channel.attr(NetworkManager.c).set(enumprotocol);
|
||||
this.channel.config().setAutoRead(true);
|
||||
NetworkManager.LOGGER.debug("Enabled auto read");
|
||||
@@ -157,19 +162,82 @@ public class NetworkManager extends SimpleChannelInboundHandler<Packet<?>> {
|
||||
@@ -158,19 +163,82 @@ public class NetworkManager extends SimpleChannelInboundHandler<Packet<?>> {
|
||||
Validate.notNull(packetlistener, "packetListener", new Object[0]);
|
||||
this.packetListener = packetlistener;
|
||||
}
|
||||
@ -138,7 +138,7 @@ index 64d61eca4bbb4a9e18d78c8d2a55114134f56b6f..020dce1a42e8e083c21fdcb7b954bc40
|
||||
}
|
||||
|
||||
private void dispatchPacket(Packet<?> packet, @Nullable GenericFutureListener<? extends Future<? super Void>> genericFutureListener) { this.b(packet, genericFutureListener); } // Paper - OBFHELPER
|
||||
@@ -183,51 +251,116 @@ public class NetworkManager extends SimpleChannelInboundHandler<Packet<?>> {
|
||||
@@ -184,51 +252,116 @@ public class NetworkManager extends SimpleChannelInboundHandler<Packet<?>> {
|
||||
this.channel.config().setAutoRead(false);
|
||||
}
|
||||
|
||||
@ -265,7 +265,7 @@ index 64d61eca4bbb4a9e18d78c8d2a55114134f56b6f..020dce1a42e8e083c21fdcb7b954bc40
|
||||
|
||||
public void a() {
|
||||
this.o();
|
||||
@@ -256,9 +389,21 @@ public class NetworkManager extends SimpleChannelInboundHandler<Packet<?>> {
|
||||
@@ -257,9 +390,21 @@ public class NetworkManager extends SimpleChannelInboundHandler<Packet<?>> {
|
||||
return this.socketAddress;
|
||||
}
|
||||
|
||||
@ -287,7 +287,7 @@ index 64d61eca4bbb4a9e18d78c8d2a55114134f56b6f..020dce1a42e8e083c21fdcb7b954bc40
|
||||
// Spigot End
|
||||
if (this.channel.isOpen()) {
|
||||
this.channel.close(); // We can't wait as this may be called from an event loop.
|
||||
@@ -326,7 +471,7 @@ public class NetworkManager extends SimpleChannelInboundHandler<Packet<?>> {
|
||||
@@ -327,7 +472,7 @@ public class NetworkManager extends SimpleChannelInboundHandler<Packet<?>> {
|
||||
public void handleDisconnection() {
|
||||
if (this.channel != null && !this.channel.isOpen()) {
|
||||
if (this.o) {
|
||||
@ -296,7 +296,7 @@ index 64d61eca4bbb4a9e18d78c8d2a55114134f56b6f..020dce1a42e8e083c21fdcb7b954bc40
|
||||
} else {
|
||||
this.o = true;
|
||||
if (this.j() != null) {
|
||||
@@ -334,7 +479,7 @@ public class NetworkManager extends SimpleChannelInboundHandler<Packet<?>> {
|
||||
@@ -335,7 +480,7 @@ public class NetworkManager extends SimpleChannelInboundHandler<Packet<?>> {
|
||||
} else if (this.i() != null) {
|
||||
this.i().a(new ChatMessage("multiplayer.disconnect.generic"));
|
||||
}
|
||||
@ -338,7 +338,7 @@ index 2d8e6a2f4a0c3c5d74a647d7164b0028781d3bf5..545dbe6ddcce1d172f465b4a7ab85654
|
||||
return false;
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
|
||||
index a6606eff5ac89c54bdcbee0d3bf124d737d9735b..7b3ac5620d5556a55838f1d57b3cbc11955a5712 100644
|
||||
index a6f0b39717164d6b3ab15843b13ef52a24dde5d6..3a5641f9187fc21f367f7a3cd12cec8e4c80dd97 100644
|
||||
--- a/src/main/java/net/minecraft/server/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/PlayerList.java
|
||||
@@ -166,6 +166,7 @@ public abstract class PlayerList {
|
||||
@ -358,10 +358,18 @@ index a6606eff5ac89c54bdcbee0d3bf124d737d9735b..7b3ac5620d5556a55838f1d57b3cbc11
|
||||
entityplayer.getStatisticManager().c();
|
||||
entityplayer.B().a(entityplayer);
|
||||
diff --git a/src/main/java/net/minecraft/server/ServerConnection.java b/src/main/java/net/minecraft/server/ServerConnection.java
|
||||
index 7abb122943b8a5ce0e888d16d1592a127bb9bb6f..8055a8aab682cfd81fc45f587d3578e25a2128f0 100644
|
||||
index 7abb122943b8a5ce0e888d16d1592a127bb9bb6f..0438126662e7c635d9a4f7b8c54fe7c50403ffe8 100644
|
||||
--- a/src/main/java/net/minecraft/server/ServerConnection.java
|
||||
+++ b/src/main/java/net/minecraft/server/ServerConnection.java
|
||||
@@ -40,10 +40,12 @@ public class ServerConnection {
|
||||
@@ -15,6 +15,7 @@ import io.netty.channel.epoll.EpollServerSocketChannel;
|
||||
import io.netty.channel.nio.NioEventLoopGroup;
|
||||
import io.netty.channel.socket.ServerSocketChannel;
|
||||
import io.netty.channel.socket.nio.NioServerSocketChannel;
|
||||
+import io.netty.handler.flush.FlushConsolidationHandler; // Paper
|
||||
import io.netty.handler.timeout.ReadTimeoutHandler;
|
||||
import java.io.IOException;
|
||||
import java.net.InetAddress;
|
||||
@@ -40,10 +41,12 @@ public class ServerConnection {
|
||||
private final List<NetworkManager> connectedChannels = Collections.synchronizedList(Lists.newArrayList());
|
||||
// Paper start - prevent blocking on adding a new network manager while the server is ticking
|
||||
private final java.util.Queue<NetworkManager> pending = new java.util.concurrent.ConcurrentLinkedQueue<>();
|
||||
@ -374,11 +382,11 @@ index 7abb122943b8a5ce0e888d16d1592a127bb9bb6f..8055a8aab682cfd81fc45f587d3578e2
|
||||
}
|
||||
}
|
||||
// Paper end
|
||||
@@ -78,6 +80,7 @@ public class ServerConnection {
|
||||
@@ -78,6 +81,7 @@ public class ServerConnection {
|
||||
;
|
||||
}
|
||||
|
||||
+ if (!disableFlushConsolidation) channel.pipeline().addFirst(new io.netty.handler.flush.FlushConsolidationHandler()); // Paper
|
||||
+ if (!disableFlushConsolidation) channel.pipeline().addFirst(new FlushConsolidationHandler()); // Paper
|
||||
channel.pipeline().addLast("timeout", new ReadTimeoutHandler(30)).addLast("legacy_query", new LegacyPingHandler(ServerConnection.this)).addLast("splitter", new PacketSplitter()).addLast("decoder", new PacketDecoder(EnumProtocolDirection.SERVERBOUND)).addLast("prepender", new PacketPrepender()).addLast("encoder", new PacketEncoder(EnumProtocolDirection.CLIENTBOUND));
|
||||
NetworkManager networkmanager = new NetworkManager(EnumProtocolDirection.SERVERBOUND);
|
||||
|
@ -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/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
|
||||
index 7b3ac5620d5556a55838f1d57b3cbc11955a5712..ce2cf5f9432c9e20d351914646a78974d1f17b03 100644
|
||||
index 3a5641f9187fc21f367f7a3cd12cec8e4c80dd97..5c6ea9df899a0649abde8c54e6f844eaf53d27dd 100644
|
||||
--- a/src/main/java/net/minecraft/server/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/PlayerList.java
|
||||
@@ -931,9 +931,9 @@ public abstract class PlayerList {
|
@ -31,10 +31,10 @@ 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 db66d4ac7dc1bede8b674cd9ad8f56dd989b6693..2322c0c8c5aacebb6317eab8ce4245554f6d9d55 100644
|
||||
index c9be8c7f40917056091f63d36311a10d6302acbb..f48b62af436de47484eb1cf496e97a29168586b0 100644
|
||||
--- a/src/main/java/net/minecraft/server/NBTCompressedStreamTools.java
|
||||
+++ b/src/main/java/net/minecraft/server/NBTCompressedStreamTools.java
|
||||
@@ -69,6 +69,7 @@ public class NBTCompressedStreamTools {
|
||||
@@ -70,6 +70,7 @@ public class NBTCompressedStreamTools {
|
||||
|
||||
}
|
||||
|
||||
@ -42,7 +42,7 @@ index db66d4ac7dc1bede8b674cd9ad8f56dd989b6693..2322c0c8c5aacebb6317eab8ce424555
|
||||
public static NBTTagCompound a(DataInputStream datainputstream) throws IOException {
|
||||
return a((DataInput) datainputstream, NBTReadLimiter.a);
|
||||
}
|
||||
@@ -89,6 +90,7 @@ public class NBTCompressedStreamTools {
|
||||
@@ -90,6 +91,7 @@ public class NBTCompressedStreamTools {
|
||||
}
|
||||
}
|
||||
|
@ -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 ce2cf5f9432c9e20d351914646a78974d1f17b03..e4651eb2a94080bfa431b0b775ae8019fc922538 100644
|
||||
index 5c6ea9df899a0649abde8c54e6f844eaf53d27dd..d4048812723bed08e5bb2aadc651a92570d4bb2a 100644
|
||||
--- a/src/main/java/net/minecraft/server/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/PlayerList.java
|
||||
@@ -1049,6 +1049,7 @@ public abstract class PlayerList {
|
@ -66,10 +66,10 @@ index 505ba8e298a825ce69cc60c76cb040edeb0acdbd..e87fa15250a57c9b7ed4f4b530289b7b
|
||||
return 0.0F;
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
index 0b4e39d93f28ec5c7835bace2ea969a6e99ac2a3..4c011f93c600d87951fe1dc8bf6b84fac7a532cb 100644
|
||||
index ed001440151078e20a449ba073d71e873ff0ad9a..f74e9ffda092ef4a2e30c316e682af154921b5df 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
@@ -3494,6 +3494,37 @@ public abstract class EntityLiving extends Entity {
|
||||
@@ -3495,6 +3495,37 @@ public abstract class EntityLiving extends Entity {
|
||||
return world.rayTrace(raytrace);
|
||||
}
|
||||
|
@ -59,7 +59,7 @@ index e87fa15250a57c9b7ed4f4b530289b7b28bb7c9c..83dda2bb95d38ff248d635420c0bf12e
|
||||
|
||||
} catch (Throwable throwable) {
|
||||
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
|
||||
index e4651eb2a94080bfa431b0b775ae8019fc922538..4b8dd6c1a9c796ded5ee0a63ccecebca9ac2b8ca 100644
|
||||
index d4048812723bed08e5bb2aadc651a92570d4bb2a..5f520d8a7ad4753bc106ebf9567fbbb8a36ac1d1 100644
|
||||
--- a/src/main/java/net/minecraft/server/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/PlayerList.java
|
||||
@@ -263,7 +263,7 @@ public abstract class PlayerList {
|
@ -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 4b8dd6c1a9c796ded5ee0a63ccecebca9ac2b8ca..8d067082ad52397d11822277438f00a43d7f3e09 100644
|
||||
index 5f520d8a7ad4753bc106ebf9567fbbb8a36ac1d1..5b3d2bd35ca3f98b8c04ea841023d68b24b91718 100644
|
||||
--- a/src/main/java/net/minecraft/server/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/PlayerList.java
|
||||
@@ -665,9 +665,14 @@ public abstract class PlayerList {
|
@ -6,7 +6,7 @@ Subject: [PATCH] Server Tick Events
|
||||
Fires event at start and end of a server tick
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index b336cd541b8e3a9ebe3d89a487160d18a294dade..544bc9660b1104e7782bd9e06252d0bd9b2e700d 100644
|
||||
index 6b288bc8d4153e12b35f422f171e15a2ef7d0851..060d64c207dc353d6103080f6756ac9501a4ed04 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -1120,6 +1120,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
@ -10,7 +10,7 @@ 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 5e253b3609de30ac6a0a8f156c6f6d07a5bb99ce..eee2cb4d95ff11c93d34472c563fac137df3b6f9 100644
|
||||
index d683ec109b23ae4c14efaa23bfe923cf2c453f87..260f0639f7568faf443eb6c036d27aa8f074979c 100644
|
||||
--- a/src/main/java/net/minecraft/server/World.java
|
||||
+++ b/src/main/java/net/minecraft/server/World.java
|
||||
@@ -943,12 +943,13 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
|
@ -5,7 +5,7 @@ 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 eee2cb4d95ff11c93d34472c563fac137df3b6f9..feb59eebc09bf1c83d8dbe0a893248a19377ebd5 100644
|
||||
index 260f0639f7568faf443eb6c036d27aa8f074979c..c40d7ef4682c686282094330a0954bd09596c9d5 100644
|
||||
--- a/src/main/java/net/minecraft/server/World.java
|
||||
+++ b/src/main/java/net/minecraft/server/World.java
|
||||
@@ -643,8 +643,8 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
|
@ -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 279807dc5045e765fe7496315494b2cb231d08f9..ac12d782539a5f502e8996eb39eb2ddbab46f756 100644
|
||||
index 3cb8ce58c4675564fb239338d6c40ea511a9a97c..96f898acdeae1917a4aaf99ec4a48bccf3904488 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityEnderDragon.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityEnderDragon.java
|
||||
@@ -576,9 +576,10 @@ public class EntityEnderDragon extends EntityInsentient implements IMonster {
|
||||
@ -40,7 +40,7 @@ index 9331f96f68f121b41ce74904d624520291b7c72e..1074995e8c8a83f6cdb94019123fbffa
|
||||
double deltaZ = this.locZ() - player.locZ();
|
||||
double distanceSquared = deltaX * deltaX + deltaZ * deltaZ;
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index b9dcd216dd9e4eeee824b252446afdac3ca44d24..021345ddef4d382021ab8cbba91f4b58851aeabd 100644
|
||||
index 64c48af6dcdb6e8121d55a015fdeed63ef3f5ec3..da57b00affb56766ebe25774323d49fed3374af0 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -1999,6 +1999,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
@ -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 544bc9660b1104e7782bd9e06252d0bd9b2e700d..59099a93f5fad12e348f435a29e5ededeb6faefd 100644
|
||||
index 060d64c207dc353d6103080f6756ac9501a4ed04..21d014f1cae27c769471caad7f9e28f727213e07 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -2065,7 +2065,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
@ -33,10 +33,10 @@ 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 6f660388aa0d56577ad1c3f463c96d925c964821..36df7068075e3ead6c7669a448fb885ad94c9fa3 100644
|
||||
index b49a1a6f5017c9e183a7d08b16e89899c25a9717..2debafdc1bb539a49c3f0723b696ea56e9b3eb16 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
@@ -404,4 +404,43 @@ public class PaperWorldConfig {
|
||||
@@ -410,4 +410,43 @@ public class PaperWorldConfig {
|
||||
private void preventMovingIntoUnloadedChunks() {
|
||||
preventMovingIntoUnloadedChunks = getBoolean("prevent-moving-into-unloaded-chunks", false);
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user