Update from upstream SpigotMC
Add unbreakable API to item meta SpigotMC/Spigot@b1af008222 Configure how often EntityHangings calculate if they should die. SpigotMC/Spigot@ac6e1fc32d Copy ItemStacks in DataWatcher to prevent ConcurrentModificationExcep… SpigotMC/Spigot@2af28ffbd1 Add the spigot.yml into the timings paste SpigotMC/Spigot@d61f38bd58 Note: This commit moves the entity-hanging tick into Spigot's spigot.yml and out of our paper.yml
This commit is contained in:
@@ -4,6 +4,50 @@ Date: Wed, 2 Jul 2014 23:35:51 +0100
|
||||
Subject: [PATCH] Better item validation
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/DataWatcher.java b/src/main/java/net/minecraft/server/DataWatcher.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/DataWatcher.java
|
||||
+++ b/src/main/java/net/minecraft/server/DataWatcher.java
|
||||
@@ -0,0 +0,0 @@ public class DataWatcher {
|
||||
arraylist = new ArrayList();
|
||||
}
|
||||
|
||||
+ // Spigot start - copy ItemStacks to prevent ConcurrentModificationExceptions
|
||||
+ if ( watchableobject.b() instanceof ItemStack )
|
||||
+ {
|
||||
+ watchableobject = new WatchableObject(
|
||||
+ watchableobject.c(),
|
||||
+ watchableobject.a(),
|
||||
+ ( (ItemStack) watchableobject.b() ).cloneItemStack()
|
||||
+ );
|
||||
+ }
|
||||
+ // Spigot end
|
||||
+
|
||||
arraylist.add(watchableobject);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +0,0 @@ public class DataWatcher {
|
||||
this.f.readLock().lock();
|
||||
|
||||
arraylist.addAll(this.dataValues.valueCollection()); // Spigot
|
||||
+ // Spigot start - copy ItemStacks to prevent ConcurrentModificationExceptions
|
||||
+ for ( int i = 0; i < arraylist.size(); i++ )
|
||||
+ {
|
||||
+ WatchableObject watchableobject = (WatchableObject) arraylist.get( i );
|
||||
+ if ( watchableobject.b() instanceof ItemStack )
|
||||
+ {
|
||||
+ watchableobject = new WatchableObject(
|
||||
+ watchableobject.c(),
|
||||
+ watchableobject.a(),
|
||||
+ ( (ItemStack) watchableobject.b() ).cloneItemStack()
|
||||
+ );
|
||||
+ arraylist.set( i, watchableobject );
|
||||
+ }
|
||||
+ }
|
||||
+ // Spigot end
|
||||
|
||||
this.f.readLock().unlock();
|
||||
return arraylist;
|
||||
diff --git a/src/main/java/net/minecraft/server/PacketDataSerializer.java b/src/main/java/net/minecraft/server/PacketDataSerializer.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/PacketDataSerializer.java
|
||||
|
||||
Reference in New Issue
Block a user