From 07f2e76bc3f5390f2a5700c2eb48812d37ead3fa Mon Sep 17 00:00:00 2001 From: Calclavia Date: Wed, 10 Dec 2014 21:20:56 +0800 Subject: [PATCH] Fixed water tubrine reflection crash --- .../mechanical/mech/grid/MechanicalGrid.scala | 2 +- .../mechanical/mech/process/grinder/NodeGrinder.scala | 4 ++-- .../mechanical/mech/turbine/TileWaterTurbine.scala | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/scala/resonantinduction/mechanical/mech/grid/MechanicalGrid.scala b/src/main/scala/resonantinduction/mechanical/mech/grid/MechanicalGrid.scala index 1164122f2..d61b58982 100644 --- a/src/main/scala/resonantinduction/mechanical/mech/grid/MechanicalGrid.scala +++ b/src/main/scala/resonantinduction/mechanical/mech/grid/MechanicalGrid.scala @@ -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 } } } diff --git a/src/main/scala/resonantinduction/mechanical/mech/process/grinder/NodeGrinder.scala b/src/main/scala/resonantinduction/mechanical/mech/process/grinder/NodeGrinder.scala index 6157f19ef..3483c0d7c 100644 --- a/src/main/scala/resonantinduction/mechanical/mech/process/grinder/NodeGrinder.scala +++ b/src/main/scala/resonantinduction/mechanical/mech/process/grinder/NodeGrinder.scala @@ -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) } \ No newline at end of file diff --git a/src/main/scala/resonantinduction/mechanical/mech/turbine/TileWaterTurbine.scala b/src/main/scala/resonantinduction/mechanical/mech/turbine/TileWaterTurbine.scala index 4c6ac5eec..dffd72d63 100644 --- a/src/main/scala/resonantinduction/mechanical/mech/turbine/TileWaterTurbine.scala +++ b/src/main/scala/resonantinduction/mechanical/mech/turbine/TileWaterTurbine.scala @@ -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)