From 1721ef0720f33e36b9fa2995018dc1fed3166a41 Mon Sep 17 00:00:00 2001 From: Chicken Bones Date: Tue, 30 Jul 2013 11:20:06 +1000 Subject: [PATCH] Fix chunk index extracting negative y values Make parts lose their tile reference on being removed, fixes crash with tick scheduler --- codechicken/multipart/IRedstonePart.scala | 8 +++++++- codechicken/multipart/TileMultipart.scala | 1 + codechicken/multipart/handler/Proxies.scala | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/codechicken/multipart/IRedstonePart.scala b/codechicken/multipart/IRedstonePart.scala index 9a9c26a..75c942c 100644 --- a/codechicken/multipart/IRedstonePart.scala +++ b/codechicken/multipart/IRedstonePart.scala @@ -103,7 +103,13 @@ object RedstoneInteractions if(p.isInstanceOf[IRedstonePart] && p.asInstanceOf[IRedstonePart].canConnectRedstone(side)) { if(p.isInstanceOf[IFaceRedstonePart]) - return 1<>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 } \ No newline at end of file