mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-12 08:50:04 -04:00
fix #3591, possibly
This commit is contained in:
parent
25773cc5eb
commit
f8cb77e441
@ -26,7 +26,8 @@
|
||||
* forceNativeLibPathFirst allows choosing a directory to check for natives in, instead of always searching in the jar for one. This allows custom natives to be used without packing them into the mod jar first, which should be much easier for end users.
|
||||
* Changed: The game now crashes instead of reloading defaults if a config file is present but invalid.
|
||||
* Fixed: [#3588] Renaming over other files does not properly free space.
|
||||
* Removed: Native Lua library support for x86 macOS.
|
||||
* Fixed: [#3591] Memory leak with wrapped worlds from other mods.
|
||||
* Removed: Native Lua library support for x86 (32-bit) macOS.
|
||||
* (1.7.10) Fixed: [#3239] Inconsistencies in Robot block clicking.
|
||||
|
||||
## OpenOS fixes/improvements
|
||||
|
@ -9,7 +9,6 @@ import java.util.concurrent.ConcurrentLinkedDeque
|
||||
import java.util.concurrent.Future
|
||||
import java.util.concurrent.TimeUnit
|
||||
import java.util.concurrent.TimeoutException
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.EventPriority
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent
|
||||
import li.cil.oc.OpenComputers
|
||||
@ -21,8 +20,7 @@ import li.cil.oc.util.SafeThreadPool
|
||||
import li.cil.oc.util.ThreadPoolFactory
|
||||
import net.minecraft.nbt.CompressedStreamTools
|
||||
import net.minecraft.nbt.NBTTagCompound
|
||||
import net.minecraft.world.ChunkCoordIntPair
|
||||
import net.minecraft.world.World
|
||||
import net.minecraft.world.{ChunkCoordIntPair, World, WorldServer}
|
||||
import net.minecraftforge.common.DimensionManager
|
||||
import net.minecraftforge.event.world.WorldEvent
|
||||
import org.apache.commons.lang3.JavaVersion
|
||||
@ -101,6 +99,9 @@ object SaveHandler {
|
||||
|
||||
def scheduleSave(position: BlockPosition, nbt: NBTTagCompound, name: String, data: Array[Byte]) {
|
||||
val world = position.world.get
|
||||
|
||||
// Try to exclude wrapped/client-side worlds.
|
||||
if (world.isInstanceOf[WorldServer]) {
|
||||
val dimension = world.provider.dimensionId
|
||||
val chunk = new ChunkCoordIntPair(position.x >> 4, position.z >> 4)
|
||||
|
||||
@ -112,6 +113,7 @@ object SaveHandler {
|
||||
|
||||
scheduleSave(dimension, chunk, name, data)
|
||||
}
|
||||
}
|
||||
|
||||
private def writeNBT(save: NBTTagCompound => Unit) = {
|
||||
val tmpNbt = new NBTTagCompound()
|
||||
|
Loading…
x
Reference in New Issue
Block a user