mirror of
https://github.com/GTNewHorizons/Chisel.git
synced 2026-11-14 01:04:05 +00:00
Clear render block instances on world unload to not leak the world
This commit is contained in:
1 parent
df216f68b4
commit
966fad56ca
2 files changed
+15
No files matched your search
@@ -84,4 +84,9 @@ public class SubmapManagerSpecialMaterial extends SubmapManagerBase {
|
||||
renderBlocksFullbright.submapSmall = submapSmall;
|
||||
return renderBlocksFullbright;
|
||||
}
|
||||
|
||||
public static void clearRenderBlocksInstance() {
|
||||
renderBlocksFullbright = null;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -11,6 +11,7 @@ import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
|
||||
import net.minecraftforge.event.world.BlockEvent;
|
||||
import net.minecraftforge.event.world.WorldEvent;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
import com.cricketcraft.chisel.api.IChiselItem;
|
||||
@@ -25,6 +26,7 @@ import cpw.mods.fml.common.gameevent.TickEvent.Phase;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent.ServerTickEvent;
|
||||
import team.chisel.Chisel;
|
||||
import team.chisel.carving.Carving;
|
||||
import team.chisel.client.render.SubmapManagerSpecialMaterial;
|
||||
import team.chisel.utils.General;
|
||||
|
||||
public final class ChiselController {
|
||||
@@ -160,4 +162,12 @@ public final class ChiselController {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onWorldUnload(WorldEvent.Unload event) {
|
||||
if (event.world.isRemote) {
|
||||
SubmapManagerSpecialMaterial.clearRenderBlocksInstance();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user