Fixed RI not launching due to scala changes
This commit is contained in:
parent
1b4534ec83
commit
ae76cdfa3d
3 changed files with 48 additions and 25 deletions
|
@ -107,7 +107,7 @@ class ItemImprint extends Item
|
||||||
return false
|
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)
|
val filterItems: Set[ItemStack] = ItemImprint.getFilters(itemStack)
|
||||||
if (filterItems.size > 0)
|
if (filterItems.size > 0)
|
||||||
|
|
|
@ -27,7 +27,7 @@ object TilePlasmaHeater
|
||||||
@Config var plasmaHeatAmount: Int = 100
|
@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 tankInputDeuterium: FluidTank = new FluidTank(FluidContainerRegistry.BUCKET_VOLUME * 10)
|
||||||
final val tankInputTritium: 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
|
var rotation: Float = 0
|
||||||
|
|
||||||
//Constructor
|
//Constructor
|
||||||
energy.setCapacity(joules)
|
energy.setCapacity(TilePlasmaHeater.joules)
|
||||||
energy.setMaxTransfer(joules / 20)
|
energy.setMaxTransfer(TilePlasmaHeater.joules / 20)
|
||||||
normalRender(false)
|
normalRender(false)
|
||||||
isOpaqueCube(false)
|
isOpaqueCube(false)
|
||||||
|
|
||||||
|
|
|
@ -9,9 +9,9 @@ import net.minecraft.world.biome.{BiomeGenBase, BiomeGenOcean, BiomeGenPlains}
|
||||||
import net.minecraftforge.common.util.ForgeDirection
|
import net.minecraftforge.common.util.ForgeDirection
|
||||||
import resonant.content.prefab.itemblock.ItemBlockMetadata
|
import resonant.content.prefab.itemblock.ItemBlockMetadata
|
||||||
import resonant.lib.utility.inventory.InventoryUtility
|
import resonant.lib.utility.inventory.InventoryUtility
|
||||||
|
import resonant.lib.wrapper.WrapList._
|
||||||
import resonantinduction.core.Settings
|
import resonantinduction.core.Settings
|
||||||
import universalelectricity.core.transform.vector.Vector3
|
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
|
/** The vertical wind turbine collects airflow. The horizontal wind turbine collects steam from steam
|
||||||
* power plants.
|
* power plants.
|
||||||
|
@ -19,7 +19,6 @@ import resonant.lib.wrapper.WrapList._
|
||||||
* @author Calclavia */
|
* @author Calclavia */
|
||||||
class TileWindTurbine extends TileTurbine
|
class TileWindTurbine extends TileTurbine
|
||||||
{
|
{
|
||||||
|
|
||||||
private final val openBlockCache: Array[Byte] = new Array[Byte](224)
|
private final val openBlockCache: Array[Byte] = new Array[Byte](224)
|
||||||
private var checkCount: Int = 0
|
private var checkCount: Int = 0
|
||||||
private var efficiency: Float = 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)
|
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(x, y, z), 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(Items.stick, 3 + worldObj.rand.nextInt(8)))
|
||||||
worldObj.setBlockToAir(xCoord, yCoord, zCoord)
|
worldObj.setBlockToAir(xCoord, yCoord, zCoord)
|
||||||
return
|
|
||||||
}
|
}
|
||||||
if (!getMultiBlock.isPrimary) return
|
else if (!getMultiBlock.isPrimary)
|
||||||
if (getDirection.offsetY == 0)
|
|
||||||
{
|
{
|
||||||
maxPower = 3000
|
if (getDirection.offsetY == 0)
|
||||||
if (ticks % 20 == 0 && !worldObj.isRemote) computePower
|
{
|
||||||
getMultiBlock.get.power += windPower
|
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
|
private def computePower
|
||||||
|
@ -60,7 +69,7 @@ class TileWindTurbine extends TileTurbine
|
||||||
val deviation: Int = checkCount % 7
|
val deviation: Int = checkCount % 7
|
||||||
var checkDir: ForgeDirection = null
|
var checkDir: ForgeDirection = null
|
||||||
var check: Vector3 = null
|
var check: Vector3 = null
|
||||||
var cc = checkCount / 7 % 4
|
val cc: Int = checkCount / 7 % 4
|
||||||
|
|
||||||
if (cc == 0)
|
if (cc == 0)
|
||||||
{
|
{
|
||||||
|
@ -86,13 +95,28 @@ class TileWindTurbine extends TileTurbine
|
||||||
openAirBlocks += 1
|
openAirBlocks += 1
|
||||||
}
|
}
|
||||||
efficiency = efficiency - openBlockCache(checkCount) + openAirBlocks
|
efficiency = efficiency - openBlockCache(checkCount) + openAirBlocks
|
||||||
openBlockCache(checkCount) = openAirBlocks.asInstanceOf
|
openBlockCache(checkCount) = openAirBlocks.asInstanceOf[Byte]
|
||||||
checkCount = (checkCount + 1) % (openBlockCache.length - 1)
|
checkCount = (checkCount + 1) % (openBlockCache.length - 1)
|
||||||
val multiblockMultiplier: Float = (multiBlockRadius + 0.5f) * 2
|
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 biome: BiomeGenBase = worldObj.getBiomeGenForCoords(xCoord, zCoord)
|
||||||
val hasBonus: Boolean = biome.isInstanceOf[BiomeGenOcean] || biome.isInstanceOf[BiomeGenPlains] || biome == BiomeGenBase.river
|
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)
|
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]
|
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)
|
for (i <- 0 to 3)
|
||||||
{
|
{
|
||||||
par3List.add(new ItemStack(par1, 1, i))
|
par3List.add(new ItemStack(par1, 1, i))
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in a new issue