mirror of
https://github.com/GTNewHorizons/ForgeMultipart.git
synced 2026-11-14 01:14:19 +00:00
Revert interactions to default when interfacing with an empty tile
This commit is contained in:
1 parent
2a9541ecb9
commit
efee460921
2 files changed
+10
-18
No files matched your search
@@ -25,24 +25,16 @@ import scala.collection.JavaConversions._
|
||||
|
||||
object BlockMultipart
|
||||
{
|
||||
def getTile(world:IBlockAccess, x:Int, y:Int, z:Int):TileMultipart =
|
||||
{
|
||||
val tile = world.getTileEntity(x, y, z)
|
||||
if(tile.isInstanceOf[TileMultipart])
|
||||
tile.asInstanceOf[TileMultipart]
|
||||
else
|
||||
null
|
||||
def getTile(world:IBlockAccess, x:Int, y:Int, z:Int) = world.getTileEntity(x, y, z) match {
|
||||
case t:TileMultipart if !t.partList.isEmpty => t
|
||||
case _ => null
|
||||
}
|
||||
|
||||
def getClientTile(world:IBlockAccess, x:Int, y:Int, z:Int):TileMultipartClient =
|
||||
{
|
||||
val tile = world.getTileEntity(x, y, z)
|
||||
if(tile.isInstanceOf[TileMultipartClient])
|
||||
tile.asInstanceOf[TileMultipartClient]
|
||||
else
|
||||
null
|
||||
|
||||
def getClientTile(world:IBlockAccess, x:Int, y:Int, z:Int) = world.getTileEntity(x, y, z) match {
|
||||
case t:TileMultipartClient if !t.partList.isEmpty => t
|
||||
case _ => null
|
||||
}
|
||||
|
||||
|
||||
def reduceMOP(hit:MovingObjectPosition):(Int, ExtendedMOP) = {
|
||||
val ehit = hit.asInstanceOf[ExtendedMOP]
|
||||
val data:(Int, _) = ExtendedMOP.getData(hit)
|
||||
@@ -296,7 +288,7 @@ class BlockMultipart extends Block(Material.rock)
|
||||
override def getWeakChanges(world:IBlockAccess, x:Int, y:Int, z:Int) =
|
||||
getTile(world, x, y, z) match {
|
||||
case null => false
|
||||
case tile => tile.getWeakChanges()
|
||||
case tile => tile.getWeakChanges
|
||||
}
|
||||
|
||||
override def canProvidePower = true
|
||||
|
||||
@@ -173,7 +173,7 @@ class TileMultipart extends TileEntity
|
||||
/**
|
||||
* Blank implementation, overriden by TTileChangeTile
|
||||
*/
|
||||
def getWeakChanges() = false
|
||||
def getWeakChanges = false
|
||||
|
||||
def getLightValue = partList.view.map(_.getLightValue).max
|
||||
|
||||
|
||||
Reference in new issue
Block a user