mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-05 10:20:53 +01:00
cab333b217
Don't send requests of every player was found in the global api cache SpigotMC/Spigot@841270ff1e Correctly set the response code for the cached lookups and return the ... SpigotMC/Spigot@f170b7899c Don't try and re-set the global api cache on reload SpigotMC/Spigot@b410a00a66 Use a compile time sneaky throw hack. SpigotMC/Spigot@508462b96b Fix a missed rename in WorldGenGroundBush SpigotMC/Spigot@0614d8fae9
64 lines
2.5 KiB
Diff
64 lines
2.5 KiB
Diff
From 9e5892607bf08eba04161c8784661cb99f00cdd6 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 4684e89..e9469a5 100644
|
|
--- a/src/main/java/net/minecraft/server/PersistentCollection.java
|
|
+++ b/src/main/java/net/minecraft/server/PersistentCollection.java
|
|
@@ -18,7 +18,7 @@ public class PersistentCollection {
|
|
|
|
private IDataManager a;
|
|
private Map b = new HashMap();
|
|
- private List c = new ArrayList();
|
|
+ public List c = new ArrayList(); // Spigot
|
|
private Map d = new HashMap();
|
|
|
|
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 6100297..7a547da 100644
|
|
--- a/src/main/java/net/minecraft/server/World.java
|
|
+++ b/src/main/java/net/minecraft/server/World.java
|
|
@@ -1170,6 +1170,23 @@ 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<WorldMapHumanTracker> iter = (Iterator<WorldMapHumanTracker>) map.f.iterator(); iter.hasNext(); )
|
|
+ {
|
|
+ if ( iter.next().trackee == entity )
|
|
+ {
|
|
+ iter.remove();
|
|
+ }
|
|
+ }
|
|
+ }
|
|
+ }
|
|
+ // Spigot end
|
|
this.everyoneSleeping();
|
|
}
|
|
}
|
|
diff --git a/src/main/java/net/minecraft/server/WorldMap.java b/src/main/java/net/minecraft/server/WorldMap.java
|
|
index bd5cfca..3254b87 100644
|
|
--- a/src/main/java/net/minecraft/server/WorldMap.java
|
|
+++ b/src/main/java/net/minecraft/server/WorldMap.java
|
|
@@ -22,7 +22,7 @@ public class WorldMap extends PersistentBase {
|
|
public byte scale;
|
|
public byte[] colors = new byte[16384];
|
|
public List f = new ArrayList();
|
|
- private Map i = new HashMap();
|
|
+ public Map i = new HashMap(); // Spigot
|
|
public Map decorations = new LinkedHashMap();
|
|
|
|
// CraftBukkit start
|
|
--
|
|
1.9.1
|
|
|