Update to 1.8.4
This commit is contained in:
61
CraftBukkit-Patches/0142-Plug-WorldMap-Memory-Leak.patch
Normal file
61
CraftBukkit-Patches/0142-Plug-WorldMap-Memory-Leak.patch
Normal file
@@ -0,0 +1,61 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: md_5 <git@md-5.net>
|
||||
Date: Fri, 8 Aug 2014 19:57:03 +1000
|
||||
Subject: [PATCH] Plug WorldMap Memory Leak
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/PersistentCollection.java b/src/main/java/net/minecraft/server/PersistentCollection.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/PersistentCollection.java
|
||||
+++ b/src/main/java/net/minecraft/server/PersistentCollection.java
|
||||
@@ -0,0 +0,0 @@ public class PersistentCollection {
|
||||
|
||||
private IDataManager b;
|
||||
protected Map<String, PersistentBase> a = Maps.newHashMap();
|
||||
- private List<PersistentBase> c = Lists.newArrayList();
|
||||
+ public List<PersistentBase> c = Lists.newArrayList(); // Spigot
|
||||
private Map<String, Short> d = Maps.newHashMap();
|
||||
|
||||
public PersistentCollection(IDataManager idatamanager) {
|
||||
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/World.java
|
||||
+++ b/src/main/java/net/minecraft/server/World.java
|
||||
@@ -0,0 +0,0 @@ public abstract class World implements IBlockAccess {
|
||||
entity.die();
|
||||
if (entity instanceof EntityHuman) {
|
||||
this.players.remove(entity);
|
||||
+ // Spigot start
|
||||
+ for ( Object o : worldMaps.c )
|
||||
+ {
|
||||
+ if ( o instanceof WorldMap )
|
||||
+ {
|
||||
+ WorldMap map = (WorldMap) o;
|
||||
+ map.i.remove( entity );
|
||||
+ for ( Iterator<WorldMap.WorldMapHumanTracker> iter = (Iterator<WorldMap.WorldMapHumanTracker>) map.g.iterator(); iter.hasNext(); )
|
||||
+ {
|
||||
+ if ( iter.next().trackee == entity )
|
||||
+ {
|
||||
+ iter.remove();
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ // Spigot end
|
||||
this.everyoneSleeping();
|
||||
this.b(entity);
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/WorldMap.java b/src/main/java/net/minecraft/server/WorldMap.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/WorldMap.java
|
||||
+++ b/src/main/java/net/minecraft/server/WorldMap.java
|
||||
@@ -0,0 +0,0 @@ public class WorldMap extends PersistentBase {
|
||||
public byte scale;
|
||||
public byte[] colors = new byte[16384];
|
||||
public List<WorldMap.WorldMapHumanTracker> g = Lists.newArrayList();
|
||||
- private Map<EntityHuman, WorldMap.WorldMapHumanTracker> i = Maps.newHashMap();
|
||||
+ public Map<EntityHuman, WorldMap.WorldMapHumanTracker> i = Maps.newHashMap(); // Spigot
|
||||
public Map<String, MapIcon> decorations = Maps.newLinkedHashMap();
|
||||
|
||||
// CraftBukkit start
|
||||
--
|
||||
Reference in New Issue
Block a user