mirror of
https://github.com/GTNewHorizons/ForgeMultipart.git
synced 2026-11-27 23:45:52 +00:00
Set blockID on descPacket received for compatiblity with save/load style frame mods.
Added MultipartSaveLoad.loadingWorld for parts that want to access the world during NBT load
This commit is contained in:
1 parent
6ae0278511
commit
982c21a97b
2 files changed
+7
-1
No files matched your search
@@ -641,8 +641,10 @@ object TileMultipart
|
||||
|
||||
val t = world.getBlockTileEntity(pos.x, pos.y, pos.z)
|
||||
val tilemp = MultipartGenerator.generateCompositeTile(t, parts, true)
|
||||
if(tilemp != t)
|
||||
if(tilemp != t) {
|
||||
world.setBlock(pos.x, pos.y, pos.z, MultipartProxy.block.blockID)
|
||||
world.setBlockTileEntity(pos.x, pos.y, pos.z, tilemp)
|
||||
}
|
||||
|
||||
tilemp.loadParts(parts)
|
||||
tilemp.markRender()
|
||||
|
||||
@@ -7,12 +7,15 @@ import net.minecraft.world.chunk.Chunk
|
||||
import net.minecraft.world.ChunkPosition
|
||||
import codechicken.multipart.TileMultipart
|
||||
import codechicken.lib.asm.ObfMapping
|
||||
import net.minecraft.world.World
|
||||
|
||||
/**
|
||||
* Hack due to lack of TileEntityLoadEvent in forge
|
||||
*/
|
||||
object MultipartSaveLoad
|
||||
{
|
||||
var loadingWorld:World = _
|
||||
|
||||
class TileNBTContainer extends TileEntity
|
||||
{
|
||||
var tag:NBTTagCompound = _
|
||||
@@ -52,6 +55,7 @@ object MultipartSaveLoad
|
||||
|
||||
def loadTiles(chunk:Chunk)
|
||||
{
|
||||
loadingWorld = chunk.worldObj
|
||||
val iterator = chunk.chunkTileEntityMap.asInstanceOf[Map[ChunkPosition, TileEntity]].entrySet.iterator
|
||||
while(iterator.hasNext)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user