mirror of
https://github.com/webbukkit/dynmap.git
synced 2024-12-28 19:47:45 +01:00
Revert "Remove duplicate removeEntities - Fixes #1838"
This reverts commit 0253a644bf
.
This commit is contained in:
parent
94fc53ef91
commit
834d315545
@ -88,6 +88,10 @@ public abstract class BukkitVersionHelper {
|
||||
* Test if normal chunk snapshot
|
||||
*/
|
||||
// public abstract boolean isCraftChunkSnapshot(ChunkSnapshot css);
|
||||
/**
|
||||
* Remove entities from given chunk
|
||||
*/
|
||||
public abstract void removeEntitiesFromChunk(Chunk c);
|
||||
/**
|
||||
* Get inhabited ticks count from chunk
|
||||
*/
|
||||
|
@ -102,6 +102,7 @@ public class BukkitVersionHelperCB extends BukkitVersionHelperGeneric {
|
||||
}
|
||||
/** n.m.s.Chunk */
|
||||
nmschunk = getNMSClass("net.minecraft.server.Chunk");
|
||||
nmsc_removeentities = getMethod(nmschunk, new String[] { "removeEntities" }, nulltypes);
|
||||
nmsc_tileentities = getField(nmschunk, new String[] { "tileEntities" }, Map.class);
|
||||
nmsc_inhabitedticks = getFieldNoFail(nmschunk, new String[] { "s", "q", "u", "v" }, long.class);
|
||||
if (nmsc_inhabitedticks == null) {
|
||||
@ -156,6 +157,7 @@ public class BukkitVersionHelperCB extends BukkitVersionHelperGeneric {
|
||||
}
|
||||
@Override
|
||||
public void unloadChunkNoSave(World w, Chunk c, int cx, int cz) {
|
||||
this.removeEntitiesFromChunk(c);
|
||||
w.unloadChunk(cx, cz, false, false);
|
||||
}
|
||||
/**
|
||||
|
@ -54,6 +54,7 @@ public abstract class BukkitVersionHelperGeneric extends BukkitVersionHelper {
|
||||
protected Method lhs_containskey;
|
||||
/** n.m.s.Chunk */
|
||||
protected Class<?> nmschunk;
|
||||
protected Method nmsc_removeentities;
|
||||
protected Field nmsc_tileentities;
|
||||
protected Field nmsc_inhabitedticks;
|
||||
/** nbt classes */
|
||||
@ -335,7 +336,13 @@ public abstract class BukkitVersionHelperGeneric extends BukkitVersionHelper {
|
||||
// }
|
||||
// return false;
|
||||
// }
|
||||
|
||||
/** Remove entities from given chunk */
|
||||
public void removeEntitiesFromChunk(Chunk c) {
|
||||
Object omsc = callMethod(c, cc_gethandle, nullargs, null);
|
||||
if(omsc != null) {
|
||||
callMethod(omsc, nmsc_removeentities, nullargs, null);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Get inhabited ticks count from chunk
|
||||
*/
|
||||
|
@ -91,6 +91,12 @@ public class BukkitVersionHelperGlowstone extends BukkitVersionHelper {
|
||||
return b;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeEntitiesFromChunk(Chunk c) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getInhabitedTicks(Chunk c) {
|
||||
// TODO Auto-generated method stub
|
||||
|
Loading…
Reference in New Issue
Block a user