Fixed RI not launching due to scala changes

This commit is contained in:
Robert S 2014-09-30 19:29:17 -04:00
parent 1b4534ec83
commit ae76cdfa3d
3 changed files with 48 additions and 25 deletions

View file

@ -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)

View file

@ -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)

View file

@ -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))
}
}
}