From 463e6f351ee6b9876342638b64285595d4488b0e Mon Sep 17 00:00:00 2001 From: md_5 Date: Sat, 21 Jun 2014 16:30:09 +1000 Subject: [PATCH] Shave nearly 2mb off jar size by not embedding our copy of trove since Minecraft now includes it. --- CraftBukkit-Patches/0001-POM-Changes.patch | 17 ++++------------- .../0006-Better-Chunk-Tick-Selection.patch | 12 ++++++------ ...Mob-Spawning-Relative-to-View-Distance.patch | 6 +++--- CraftBukkit-Patches/0063-Orebfuscator.patch | 10 +++++----- .../0064-Optimize-DataWatcher.patch | 12 ++++++------ ...Allow-statistics-to-be-disabled-forced.patch | 6 +++--- ...commands-to-be-the-main-version-of-a-c.patch | 6 +++--- .../0107-Guard-Entity-List.patch | 6 +++--- 8 files changed, 33 insertions(+), 42 deletions(-) diff --git a/CraftBukkit-Patches/0001-POM-Changes.patch b/CraftBukkit-Patches/0001-POM-Changes.patch index c7cca7bf8..9512f0e47 100644 --- a/CraftBukkit-Patches/0001-POM-Changes.patch +++ b/CraftBukkit-Patches/0001-POM-Changes.patch @@ -1,11 +1,11 @@ -From ae912a83567434a436fad96553d8f1ff5114db6a Mon Sep 17 00:00:00 2001 +From 4c0a6720e1aa3018860c091f0eab1744a7009ec6 Mon Sep 17 00:00:00 2001 From: md_5 Date: Tue, 2 Jul 2013 13:07:39 +1000 Subject: [PATCH] POM Changes diff --git a/pom.xml b/pom.xml -index b2e2002..c1073e5 100644 +index b2e2002..df02bd3 100644 --- a/pom.xml +++ b/pom.xml @@ -1,12 +1,12 @@ @@ -101,16 +101,7 @@ index b2e2002..c1073e5 100644 junit -@@ -147,19 +108,24 @@ - 1.3 - test - -+ -+ net.sf.trove4j -+ trove4j -+ 3.0.3 -+ - +@@ -151,15 +112,15 @@ @@ -129,7 +120,7 @@ index b2e2002..c1073e5 100644 -@@ -212,7 +178,7 @@ +@@ -212,7 +173,7 @@ org.apache.maven.plugins maven-shade-plugin diff --git a/CraftBukkit-Patches/0006-Better-Chunk-Tick-Selection.patch b/CraftBukkit-Patches/0006-Better-Chunk-Tick-Selection.patch index 46b88c6eb..372e77cef 100644 --- a/CraftBukkit-Patches/0006-Better-Chunk-Tick-Selection.patch +++ b/CraftBukkit-Patches/0006-Better-Chunk-Tick-Selection.patch @@ -1,11 +1,11 @@ -From e380a7c833bf83afcc83bbc477466f1266441288 Mon Sep 17 00:00:00 2001 +From 4973ff00be3ca5a6c77b3e8b2877efd627c72df3 Mon Sep 17 00:00:00 2001 From: md_5 Date: Tue, 11 Jun 2013 12:56:02 +1000 Subject: [PATCH] Better Chunk Tick Selection diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index fab5025..93b7a72 100644 +index fab5025..870bddc 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -62,7 +62,7 @@ public abstract class World implements IBlockAccess { @@ -22,7 +22,7 @@ index fab5025..93b7a72 100644 int[] I; + // Spigot start -+ protected final gnu.trove.map.hash.TLongShortHashMap chunkTickList; ++ protected final net.minecraft.util.gnu.trove.map.hash.TLongShortHashMap chunkTickList; + protected float growthOdds = 100; + protected float modifiedOdds = 100; + private final byte chunkTickRadius; @@ -54,7 +54,7 @@ index fab5025..93b7a72 100644 // CraftBukkit end + // Spigot start + this.chunkTickRadius = (byte) ( ( this.getServer().getViewDistance() < 7 ) ? this.getServer().getViewDistance() : 7 ); -+ this.chunkTickList = new gnu.trove.map.hash.TLongShortHashMap( spigotConfig.chunksPerTick * 5, 0.7f, Long.MIN_VALUE, Short.MIN_VALUE ); ++ this.chunkTickList = new net.minecraft.util.gnu.trove.map.hash.TLongShortHashMap( spigotConfig.chunksPerTick * 5, 0.7f, Long.MIN_VALUE, Short.MIN_VALUE ); + this.chunkTickList.setAutoCompactionFactor( 0 ); + // Spigot end @@ -115,7 +115,7 @@ index fab5025..93b7a72 100644 this.methodProfiler.b(); diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index 3fa3a81..9b5b370 100644 +index 3fa3a81..a30b79e 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java @@ -307,10 +307,20 @@ public class WorldServer extends World { @@ -124,7 +124,7 @@ index 3fa3a81..9b5b370 100644 - for (long chunkCoord : this.chunkTickList.popAll()) { + // Spigot start -+ for (gnu.trove.iterator.TLongShortIterator iter = chunkTickList.iterator(); iter.hasNext();) { ++ for (net.minecraft.util.gnu.trove.iterator.TLongShortIterator iter = chunkTickList.iterator(); iter.hasNext();) { + iter.advance(); + long chunkCoord = iter.key(); + int chunkX = World.keyToX(chunkCoord); diff --git a/CraftBukkit-Patches/0015-Fix-Mob-Spawning-Relative-to-View-Distance.patch b/CraftBukkit-Patches/0015-Fix-Mob-Spawning-Relative-to-View-Distance.patch index df85c9b90..5a66d8da6 100644 --- a/CraftBukkit-Patches/0015-Fix-Mob-Spawning-Relative-to-View-Distance.patch +++ b/CraftBukkit-Patches/0015-Fix-Mob-Spawning-Relative-to-View-Distance.patch @@ -1,18 +1,18 @@ -From ce050d2da89fea40fc1459aaa5a03ba3f9e6172c Mon Sep 17 00:00:00 2001 +From e71213a20ac3894089923747de1bf84f672beb31 Mon Sep 17 00:00:00 2001 From: md_5 Date: Fri, 21 Jun 2013 17:29:54 +1000 Subject: [PATCH] Fix Mob Spawning Relative to View Distance diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index ade0c35..0eabadf 100644 +index ade0c35..1ac9804 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java @@ -40,6 +40,7 @@ public class Chunk { public int r; public long s; private int x; -+ protected gnu.trove.map.hash.TObjectIntHashMap entityCount = new gnu.trove.map.hash.TObjectIntHashMap(); // Spigot ++ protected net.minecraft.util.gnu.trove.map.hash.TObjectIntHashMap entityCount = new net.minecraft.util.gnu.trove.map.hash.TObjectIntHashMap(); // Spigot public Chunk(World world, int i, int j) { this.sections = new ChunkSection[16]; diff --git a/CraftBukkit-Patches/0063-Orebfuscator.patch b/CraftBukkit-Patches/0063-Orebfuscator.patch index 10e67e6be..6f80ea824 100644 --- a/CraftBukkit-Patches/0063-Orebfuscator.patch +++ b/CraftBukkit-Patches/0063-Orebfuscator.patch @@ -1,4 +1,4 @@ -From 37f3e3718d4d554cf96839442b7f07be32cb80d0 Mon Sep 17 00:00:00 2001 +From 9e11fada287c50bda72a5b4a38b871d6ab5a9de9 Mon Sep 17 00:00:00 2001 From: md_5 Date: Thu, 16 May 2013 18:51:05 +1000 Subject: [PATCH] Orebfuscator @@ -115,7 +115,7 @@ index 2db45ad..97fe53c 100644 } diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 6da7de6..84fe64c 100644 +index abfa88b..3dfa0ec 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -233,9 +233,16 @@ public abstract class World implements IBlockAccess { @@ -147,14 +147,14 @@ index 6da7de6..84fe64c 100644 public void b(int i, int j, int k, Block block, int l) { diff --git a/src/main/java/org/spigotmc/AntiXray.java b/src/main/java/org/spigotmc/AntiXray.java new file mode 100644 -index 0000000..d326d18 +index 0000000..d0fc0a9 --- /dev/null +++ b/src/main/java/org/spigotmc/AntiXray.java @@ -0,0 +1,227 @@ +package org.spigotmc; + -+import gnu.trove.set.TByteSet; -+import gnu.trove.set.hash.TByteHashSet; ++import net.minecraft.util.gnu.trove.set.TByteSet; ++import net.minecraft.util.gnu.trove.set.hash.TByteHashSet; +import net.minecraft.server.Block; +import net.minecraft.server.Blocks; +import net.minecraft.server.World; diff --git a/CraftBukkit-Patches/0064-Optimize-DataWatcher.patch b/CraftBukkit-Patches/0064-Optimize-DataWatcher.patch index f75230e68..7d6937c14 100644 --- a/CraftBukkit-Patches/0064-Optimize-DataWatcher.patch +++ b/CraftBukkit-Patches/0064-Optimize-DataWatcher.patch @@ -1,4 +1,4 @@ -From 0b941f57067c60c8c616fd9e1ad80e6e68cc392e Mon Sep 17 00:00:00 2001 +From 3cdcdf3689a73973e3cb39db068e568b1eb82832 Mon Sep 17 00:00:00 2001 From: md_5 Date: Fri, 13 Dec 2013 11:45:47 +1100 Subject: [PATCH] Optimize DataWatcher @@ -6,7 +6,7 @@ Subject: [PATCH] Optimize DataWatcher Use primitive orientated collections, as well as more effective copies across collections. diff --git a/src/main/java/net/minecraft/server/DataWatcher.java b/src/main/java/net/minecraft/server/DataWatcher.java -index 90a2a80..cca6bd9 100644 +index 90a2a80..f30e9f8 100644 --- a/src/main/java/net/minecraft/server/DataWatcher.java +++ b/src/main/java/net/minecraft/server/DataWatcher.java @@ -14,8 +14,13 @@ public class DataWatcher { @@ -16,11 +16,11 @@ index 90a2a80..cca6bd9 100644 - private static final HashMap c = new HashMap(); - private final Map d = new HashMap(); + // Spigot Start -+ private static final gnu.trove.map.TObjectIntMap classToId = new gnu.trove.map.hash.TObjectIntHashMap( 10, 0.5f, -1 ); -+ private final gnu.trove.map.TIntObjectMap dataValues = new gnu.trove.map.hash.TIntObjectHashMap( 10, 0.5f, -1 ); ++ private static final net.minecraft.util.gnu.trove.map.TObjectIntMap classToId = new net.minecraft.util.gnu.trove.map.hash.TObjectIntHashMap( 10, 0.5f, -1 ); ++ private final net.minecraft.util.gnu.trove.map.TIntObjectMap dataValues = new net.minecraft.util.gnu.trove.map.hash.TIntObjectHashMap( 10, 0.5f, -1 ); + // These exist as an attempt at backwards compatability for (broken) NMS plugins -+ private static final Map c = gnu.trove.TDecorators.wrap( classToId ); -+ private final Map d = gnu.trove.TDecorators.wrap( dataValues ); ++ private static final Map c = net.minecraft.util.gnu.trove.TDecorators.wrap( classToId ); ++ private final Map d = net.minecraft.util.gnu.trove.TDecorators.wrap( dataValues ); + // Spigot End private boolean e; private ReadWriteLock f = new ReentrantReadWriteLock(); diff --git a/CraftBukkit-Patches/0079-Allow-statistics-to-be-disabled-forced.patch b/CraftBukkit-Patches/0079-Allow-statistics-to-be-disabled-forced.patch index c4f0d93e2..c909261cd 100644 --- a/CraftBukkit-Patches/0079-Allow-statistics-to-be-disabled-forced.patch +++ b/CraftBukkit-Patches/0079-Allow-statistics-to-be-disabled-forced.patch @@ -1,4 +1,4 @@ -From 16561bbd9dae7bc87542e67953ced80164fc7f9c Mon Sep 17 00:00:00 2001 +From ac7a5cda836e537f9e65b102669c14c3125042cd Mon Sep 17 00:00:00 2001 From: Thinkofdeath Date: Tue, 7 Jan 2014 15:56:26 +0000 Subject: [PATCH] Allow statistics to be disabled/forced @@ -40,7 +40,7 @@ index 819896f..897e88b 100644 super.setStatistic(entityhuman, statistic, i); diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java -index af73544..54d9117 100644 +index af73544..ca87886 100644 --- a/src/main/java/org/spigotmc/SpigotConfig.java +++ b/src/main/java/org/spigotmc/SpigotConfig.java @@ -10,10 +10,13 @@ import java.util.HashMap; @@ -48,7 +48,7 @@ index af73544..54d9117 100644 import java.util.Map; import java.util.logging.Level; + -+import gnu.trove.map.hash.TObjectIntHashMap; ++import net.minecraft.util.gnu.trove.map.hash.TObjectIntHashMap; import net.minecraft.server.MinecraftServer; import org.bukkit.Bukkit; import org.bukkit.ChatColor; diff --git a/CraftBukkit-Patches/0102-Allow-vanilla-commands-to-be-the-main-version-of-a-c.patch b/CraftBukkit-Patches/0102-Allow-vanilla-commands-to-be-the-main-version-of-a-c.patch index af0896e60..ad220feea 100644 --- a/CraftBukkit-Patches/0102-Allow-vanilla-commands-to-be-the-main-version-of-a-c.patch +++ b/CraftBukkit-Patches/0102-Allow-vanilla-commands-to-be-the-main-version-of-a-c.patch @@ -1,4 +1,4 @@ -From 1773a7d0466bd589b631eb382ba152ef7f59fc58 Mon Sep 17 00:00:00 2001 +From 79629b915ac0ca95348c8666cdcde4443b0f7104 Mon Sep 17 00:00:00 2001 From: Thinkofdeath Date: Wed, 12 Feb 2014 20:44:14 +0000 Subject: [PATCH] Allow vanilla commands to be the main version of a command @@ -138,7 +138,7 @@ index 4c13657..66094ed 100644 private void loadPlugin(Plugin plugin) { try { diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java -index 0d0c7b0..4703768 100644 +index 95e9f72..b40801e 100644 --- a/src/main/java/org/spigotmc/SpigotConfig.java +++ b/src/main/java/org/spigotmc/SpigotConfig.java @@ -8,8 +8,10 @@ import java.lang.reflect.Method; @@ -151,7 +151,7 @@ index 0d0c7b0..4703768 100644 +import java.util.Set; import java.util.logging.Level; - import gnu.trove.map.hash.TObjectIntHashMap; + import net.minecraft.util.gnu.trove.map.hash.TObjectIntHashMap; @@ -284,4 +286,16 @@ public class SpigotConfig { filterCreativeItems = getBoolean( "settings.filter-creative-items", true ); diff --git a/CraftBukkit-Patches/0107-Guard-Entity-List.patch b/CraftBukkit-Patches/0107-Guard-Entity-List.patch index be88e93f7..369fc4f68 100644 --- a/CraftBukkit-Patches/0107-Guard-Entity-List.patch +++ b/CraftBukkit-Patches/0107-Guard-Entity-List.patch @@ -1,11 +1,11 @@ -From 6b67defb92e04c855fb01fe6a1bddd7ebe746cd4 Mon Sep 17 00:00:00 2001 +From 129b22a1e1c40e55fede0417d3bef984844b4c3f Mon Sep 17 00:00:00 2001 From: md_5 Date: Mon, 10 Mar 2014 09:03:28 +1100 Subject: [PATCH] Guard Entity List diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index e557b4f..091b04d 100644 +index 1d8caf9..3ad24a3 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -31,7 +31,32 @@ import org.bukkit.event.weather.ThunderChangeEvent; @@ -47,7 +47,7 @@ index e557b4f..091b04d 100644 // Spigot start + private boolean guardEntityList; - protected final gnu.trove.map.hash.TLongShortHashMap chunkTickList; + protected final net.minecraft.util.gnu.trove.map.hash.TLongShortHashMap chunkTickList; protected float growthOdds = 100; protected float modifiedOdds = 100; @@ -1354,6 +1380,7 @@ public abstract class World implements IBlockAccess {