From 8db749d66b4df317b21dce8ab5891af78ec64253 Mon Sep 17 00:00:00 2001 From: Zach Brown <1254957+zachbr@users.noreply.github.com> Date: Mon, 7 Mar 2016 15:54:14 -0600 Subject: [PATCH] Rebuild patches --- ...dd-configurable-portal-search-radius.patch | 60 +++++++++---------- ...ctus-and-reed-natural-growth-heights.patch | 4 +- 2 files changed, 30 insertions(+), 34 deletions(-) diff --git a/Spigot-Server-Patches/Add-configurable-portal-search-radius.patch b/Spigot-Server-Patches/Add-configurable-portal-search-radius.patch index acc8283e85..9bde14d314 100644 --- a/Spigot-Server-Patches/Add-configurable-portal-search-radius.patch +++ b/Spigot-Server-Patches/Add-configurable-portal-search-radius.patch @@ -22,39 +22,35 @@ diff --git a/src/main/java/net/minecraft/server/PortalTravelAgent.java b/src/mai index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/PortalTravelAgent.java +++ b/src/main/java/net/minecraft/server/PortalTravelAgent.java -@@ -0,0 +0,0 @@ public class PortalTravelAgent { - return true; - } +@@ -0,0 +0,0 @@ import java.util.Random; -- public BlockPosition findPortal(double x, double y, double z, int short1) { -+ public BlockPosition findPortal(double x, double y, double z, int searchRadius) { // Paper - short1 -> searchRadius - if (this.world.getWorld().getEnvironment() == org.bukkit.World.Environment.THE_END) { - return this.findEndPortal(this.world.worldProvider.h()); + public class PortalTravelAgent { + +- private final WorldServer world; ++ protected final WorldServer world; // Paper - private -> protected + private final Random b; + private final LongHashMap c = new LongHashMap(); + private final List d = Lists.newArrayList(); +@@ -0,0 +0,0 @@ public class PortalTravelAgent { + + public boolean b(Entity entity, float f) { + // CraftBukkit start - Modularize portal search process and entity teleportation +- BlockPosition found = this.findPortal(entity.locX, entity.locY, entity.locZ, 128); ++ BlockPosition found = this.findPortal(entity.locX, entity.locY, entity.locZ, world.paperConfig.portalSearchRadius); // Paper - Configurable search radius + if (found == null) { + return false; } -@@ -0,0 +0,0 @@ public class PortalTravelAgent { - } else { - BlockPosition blockposition = new BlockPosition(x, y, z); // CraftBukkit - -- for (int l = -128; l <= 128; ++l) { -+ for (int l = -searchRadius; l <= searchRadius; ++l) { // Paper - actually use search radiusfor (int l = -128; l <= 128; ++l) { - BlockPosition blockposition1; - -- for (int i1 = -128; i1 <= 128; ++i1) { -+ for (int i1 = -searchRadius; i1 <= searchRadius; ++i1) { // Paper - actually use search radius - for (BlockPosition blockposition2 = blockposition.a(l, this.world.Z() - 1 - blockposition.getY(), i1); blockposition2.getY() >= 0; blockposition2 = blockposition1) { - blockposition1 = blockposition2.down(); - if (this.world.getType(blockposition2).getBlock() == Blocks.PORTAL) { -diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java +diff --git a/src/main/java/org/bukkit/craftbukkit/CraftTravelAgent.java b/src/main/java/org/bukkit/craftbukkit/CraftTravelAgent.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 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 implements IAsyncTaskHandler { - this.manager = new PlayerChunkMap(this, spigotConfig.viewDistance); // Spigot - this.worldProvider.a((World) this); - this.chunkProvider = this.n(); -- this.portalTravelAgent = new org.bukkit.craftbukkit.CraftTravelAgent(this); // CraftBukkit -+ this.portalTravelAgent = ((org.bukkit.craftbukkit.CraftTravelAgent) new org.bukkit.craftbukkit.CraftTravelAgent(this).setSearchRadius(paperConfig.portalSearchRadius)); // CraftBukkit // Paper - configurable search radius - this.H(); - this.I(); - this.getWorldBorder().a(minecraftserver.aD()); +--- a/src/main/java/org/bukkit/craftbukkit/CraftTravelAgent.java ++++ b/src/main/java/org/bukkit/craftbukkit/CraftTravelAgent.java +@@ -0,0 +0,0 @@ public class CraftTravelAgent extends PortalTravelAgent implements TravelAgent { + + public static TravelAgent DEFAULT = null; + +- private int searchRadius = 128; ++ private int searchRadius = world.paperConfig.portalSearchRadius; // Paper - Configurable search radius + private int creationRadius = 16; + private boolean canCreatePortal = true; + -- \ No newline at end of file diff --git a/Spigot-Server-Patches/Configurable-cactus-and-reed-natural-growth-heights.patch b/Spigot-Server-Patches/Configurable-cactus-and-reed-natural-growth-heights.patch index 5e8bf55663..02744a567a 100644 --- a/Spigot-Server-Patches/Configurable-cactus-and-reed-natural-growth-heights.patch +++ b/Spigot-Server-Patches/Configurable-cactus-and-reed-natural-growth-heights.patch @@ -34,7 +34,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + if (i < world.paperConfig.cactusMaxHeight) { // Paper - Configurable growth height int j = ((Integer) iblockdata.get(BlockCactus.AGE)).intValue(); - if (j >= (byte) range(3, (world.spigotConfig.cactusModifier / 100 * 15) + 0.5F, 15)) { // Spigot + if (j >= (byte) range(3, ((100 / world.spigotConfig.cactusModifier) * 15) + 0.5F, 15)) { // Spigot diff --git a/src/main/java/net/minecraft/server/BlockReed.java b/src/main/java/net/minecraft/server/BlockReed.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/BlockReed.java @@ -47,5 +47,5 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + if (i < world.paperConfig.reedMaxHeight) { // Paper - Configurable growth height int j = ((Integer) iblockdata.get(BlockReed.AGE)).intValue(); - if (j >= (byte) range(3, (world.spigotConfig.caneModifier /100 * 15) + 0.5F, 15)) { // Spigot + if (j >= (byte) range(3, ((100 / world.spigotConfig.caneModifier) * 15) + 0.5F, 15)) { // Spigot -- \ No newline at end of file