Fixed water tubrine reflection crash

This commit is contained in:
Calclavia 2014-12-10 21:20:56 +08:00
parent fb60f3c638
commit 07f2e76bc3
3 changed files with 5 additions and 5 deletions

View file

@ -123,7 +123,7 @@ class MechanicalGrid extends GridNode[NodeMechanical](classOf[NodeMechanical]) w
if (Math.signum(c.angularVelocity) != sudoInvert * Math.signum(addVel))
{
isLocked = true
isLocked = false
}
}
}

View file

@ -10,11 +10,11 @@ import resonantinduction.mechanical.mech.grid.NodeMechanical
*/
class NodeGrinder(parent: TileGrindingWheel) extends NodeMechanical(parent: TileGrindingWheel)
{
override def getLoad = 1000d * angularVelocity
override def getLoad = 1000d * Math.abs(angularVelocity)
override def canConnect[B <: NodeMechanical](other: B, from: ForgeDirection): Boolean = parent.getDirection == from || parent.getDirection.getOpposite == from
override def inverseRotation(other: TNodeMechanical): Boolean = if (other.isInstanceOf[NodeGear]) (toVector3 - other.asInstanceOf[NodeMechanical].toVector3).toArray.sum < 0 else false
override def inverseNext(other: TNodeMechanical): Boolean = if (other.isInstanceOf[NodeGear]) (toVector3 - other.asInstanceOf[NodeMechanical].toVector3).toArray.sum < 0 else super.inverseNext(other)
override def inverseNext(other: TNodeMechanical): Boolean = super.inverseNext(other) //if (other.isInstanceOf[NodeGear]) (toVector3 - other.asInstanceOf[NodeMechanical].toVector3).toArray.sum < 0 else super.inverseNext(other)
}

View file

@ -3,7 +3,7 @@ package resonantinduction.mechanical.mech.turbine
import java.util.List
import cpw.mods.fml.relauncher.ReflectionHelper
import net.minecraft.block.{BlockLiquid, Block, BlockDynamicLiquid}
import net.minecraft.block.{Block, BlockLiquid}
import net.minecraft.creativetab.CreativeTabs
import net.minecraft.init.Blocks
import net.minecraft.item.{Item, ItemStack}
@ -90,7 +90,7 @@ class TileWaterTurbine extends TileTurbine
{
val m = ReflectionHelper.findMethod(classOf[BlockLiquid], null, Array[String]("getFlowVector", "func_72202_i"), classOf[IBlockAccess], Integer.TYPE, Integer.TYPE, Integer.TYPE)
val vector = new Vector3(m.invoke(Blocks.water, Array(worldObj, check.xi, check.yi, check.zi)).asInstanceOf[Vec3])
val vector = new Vector3(m.invoke(Blocks.water, worldObj, check.xi: Integer, check.yi: Integer, check.zi: Integer).asInstanceOf[Vec3])
val invert = (currentDir.offsetZ > 0 && vector.x < 0) || (currentDir.offsetZ < 0 && vector.x > 0) || (currentDir.offsetX > 0 && vector.z > 0) || (currentDir.offsetX < 0 && vector.z < 0)
if (getDirection.offsetX != 0)