Fix chunk index extracting negative y values

Make parts lose their tile reference on being removed, fixes crash with tick scheduler
This commit is contained in:
Chicken Bones committed 2013-07-30 11:20:06 +10:00
1 parent 9f93d2cbde
commit 1721ef0720
3 files changed
+9 -2

No files matched your search

+7 -1
View File
@@ -103,7 +103,13 @@ object RedstoneInteractions
if(p.isInstanceOf[IRedstonePart] && p.asInstanceOf[IRedstonePart].canConnectRedstone(side))
{
if(p.isInstanceOf[IFaceRedstonePart])
return 1<<rotationTo(side&6, p.asInstanceOf[IFaceRedstonePart].getFace)
{
val fside = p.asInstanceOf[IFaceRedstonePart].getFace
if((side&6) == (fside&6))
return 0x10
return 1<<rotationTo(side&6, fside)
}
return 0x1F
}
return 0
@@ -261,6 +261,7 @@ class TileMultipart extends TileEntity
partRemoved(part, r)
part.onRemoved()
part.tile = null
if(partList.isEmpty)
{
+1 -1
View File
@@ -94,6 +94,6 @@ object MultipartProxy extends MultipartProxy_clientImpl
var block:BlockMultipart = _
var config:ConfigFile = _
def indexInChunk(cc:ChunkCoordIntPair, i:Int) = new BlockCoord(cc.chunkXPos<<4|i&0xF, i>>8, cc.chunkZPos<<4|(i&0xF0)>>4)
def indexInChunk(cc:ChunkCoordIntPair, i:Int) = new BlockCoord(cc.chunkXPos<<4|i&0xF, (i>>8)&0xFF, cc.chunkZPos<<4|(i&0xF0)>>4)
def indexInChunk(pos:BlockCoord) = pos.x&0xF|pos.y<<8|(pos.z&0xF)<<4
}