diff --git a/src/main/scala/resonantinduction/archaic/blocks/ItemImprint.scala b/src/main/scala/resonantinduction/archaic/blocks/ItemImprint.scala index 121512f36..be46015d9 100644 --- a/src/main/scala/resonantinduction/archaic/blocks/ItemImprint.scala +++ b/src/main/scala/resonantinduction/archaic/blocks/ItemImprint.scala @@ -107,7 +107,7 @@ class ItemImprint extends Item return false } - override def addInformation(itemStack: ItemStack, par2EntityPlayer: EntityPlayer, list: List[_], par4: Boolean) + override def addInformation(itemStack: ItemStack, par2EntityPlayer: EntityPlayer, list: java.util.List[_], par4: Boolean) { val filterItems: Set[ItemStack] = ItemImprint.getFilters(itemStack) if (filterItems.size > 0) diff --git a/src/main/scala/resonantinduction/atomic/machine/plasma/TilePlasmaHeater.scala b/src/main/scala/resonantinduction/atomic/machine/plasma/TilePlasmaHeater.scala index 340603b3a..ba886d9d1 100644 --- a/src/main/scala/resonantinduction/atomic/machine/plasma/TilePlasmaHeater.scala +++ b/src/main/scala/resonantinduction/atomic/machine/plasma/TilePlasmaHeater.scala @@ -27,7 +27,7 @@ object TilePlasmaHeater @Config var plasmaHeatAmount: Int = 100 } -class TilePlasmaHeater(joules: Double) extends TileElectric(Material.iron) with IPacketReceiver with ITagRender with IFluidHandler +class TilePlasmaHeater extends TileElectric(Material.iron) with IPacketReceiver with ITagRender with IFluidHandler { final val tankInputDeuterium: FluidTank = new FluidTank(FluidContainerRegistry.BUCKET_VOLUME * 10) final val tankInputTritium: FluidTank = new FluidTank(FluidContainerRegistry.BUCKET_VOLUME * 10) @@ -35,8 +35,8 @@ class TilePlasmaHeater(joules: Double) extends TileElectric(Material.iron) with var rotation: Float = 0 //Constructor - energy.setCapacity(joules) - energy.setMaxTransfer(joules / 20) + energy.setCapacity(TilePlasmaHeater.joules) + energy.setMaxTransfer(TilePlasmaHeater.joules / 20) normalRender(false) isOpaqueCube(false) diff --git a/src/main/scala/resonantinduction/mechanical/mech/turbine/TileWindTurbine.scala b/src/main/scala/resonantinduction/mechanical/mech/turbine/TileWindTurbine.scala index 736310bf3..5aeef6350 100644 --- a/src/main/scala/resonantinduction/mechanical/mech/turbine/TileWindTurbine.scala +++ b/src/main/scala/resonantinduction/mechanical/mech/turbine/TileWindTurbine.scala @@ -9,9 +9,9 @@ import net.minecraft.world.biome.{BiomeGenBase, BiomeGenOcean, BiomeGenPlains} import net.minecraftforge.common.util.ForgeDirection import resonant.content.prefab.itemblock.ItemBlockMetadata import resonant.lib.utility.inventory.InventoryUtility +import resonant.lib.wrapper.WrapList._ import resonantinduction.core.Settings import universalelectricity.core.transform.vector.Vector3 -import resonant.lib.wrapper.WrapList._ /** The vertical wind turbine collects airflow. The horizontal wind turbine collects steam from steam * power plants. @@ -19,7 +19,6 @@ import resonant.lib.wrapper.WrapList._ * @author Calclavia */ class TileWindTurbine extends TileTurbine { - private final val openBlockCache: Array[Byte] = new Array[Byte](224) private var checkCount: Int = 0 private var efficiency: Float = 0 @@ -32,25 +31,35 @@ class TileWindTurbine extends TileTurbine { if (tier == 0 && getDirection.offsetY == 0 && worldObj.isRaining && worldObj.isThundering && worldObj.rand.nextFloat < 0.00000008) { - InventoryUtility.dropItemStack(worldObj, new Vector3(this), new ItemStack(Blocks.wool, 1 + worldObj.rand.nextInt(2))) - InventoryUtility.dropItemStack(worldObj, new Vector3(this), new ItemStack(Items.stick, 3 + worldObj.rand.nextInt(8))) + InventoryUtility.dropItemStack(worldObj, new Vector3(x, y, z), new ItemStack(Blocks.wool, 1 + worldObj.rand.nextInt(2))) + InventoryUtility.dropItemStack(worldObj, new Vector3(x, y, z), new ItemStack(Items.stick, 3 + worldObj.rand.nextInt(8))) worldObj.setBlockToAir(xCoord, yCoord, zCoord) - return } - if (!getMultiBlock.isPrimary) return - if (getDirection.offsetY == 0) + else if (!getMultiBlock.isPrimary) { - maxPower = 3000 - if (ticks % 20 == 0 && !worldObj.isRemote) computePower - getMultiBlock.get.power += windPower + if (getDirection.offsetY == 0) + { + maxPower = 3000 + if (ticks % 20 == 0 && !worldObj.isRemote) + { + computePower + } + getMultiBlock.get.power += windPower + } + else + { + maxPower = 10000 + } + if (getMultiBlock.isConstructed) + { + mechanicalNode.torque = (defaultTorque / (9d / multiBlockRadius)).asInstanceOf[Long] + } + else + { + mechanicalNode.torque = defaultTorque / 12 + } + super.update } - else - { - maxPower = 10000 - } - if (getMultiBlock.isConstructed) mechanicalNode.torque = (defaultTorque / (9d / multiBlockRadius)).asInstanceOf[Long] - else mechanicalNode.torque = defaultTorque / 12 - super.update } private def computePower @@ -60,7 +69,7 @@ class TileWindTurbine extends TileTurbine val deviation: Int = checkCount % 7 var checkDir: ForgeDirection = null var check: Vector3 = null - var cc = checkCount / 7 % 4 + val cc: Int = checkCount / 7 % 4 if (cc == 0) { @@ -86,13 +95,28 @@ class TileWindTurbine extends TileTurbine openAirBlocks += 1 } efficiency = efficiency - openBlockCache(checkCount) + openAirBlocks - openBlockCache(checkCount) = openAirBlocks.asInstanceOf + openBlockCache(checkCount) = openAirBlocks.asInstanceOf[Byte] checkCount = (checkCount + 1) % (openBlockCache.length - 1) val multiblockMultiplier: Float = (multiBlockRadius + 0.5f) * 2 - val materialMultiplier: Float = if (tier == 0) 1.1f else if (tier == 1) 0.9f else 1 + + var materialMultiplier: Float = 1 + if (tier == 0) + { + materialMultiplier = 1.1f + } + else if (tier == 1) + { + materialMultiplier = 0.9f + } + else + { + materialMultiplier = 1 + } + val biome: BiomeGenBase = worldObj.getBiomeGenForCoords(xCoord, zCoord) val hasBonus: Boolean = biome.isInstanceOf[BiomeGenOcean] || biome.isInstanceOf[BiomeGenPlains] || biome == BiomeGenBase.river val windSpeed: Float = (worldObj.rand.nextFloat / 8) + (yCoord / 256f) * (if (hasBonus) 1.2f else 1) + worldObj.getRainStrength(1.5f) + windPower = Math.min(materialMultiplier * multiblockMultiplier * windSpeed * efficiency * Settings.WIND_POWER_RATIO, maxPower * Settings.WIND_POWER_RATIO).asInstanceOf[Long] } @@ -101,7 +125,6 @@ class TileWindTurbine extends TileTurbine for (i <- 0 to 3) { par3List.add(new ItemStack(par1, 1, i)) - } } } \ No newline at end of file