Compiles
This commit is contained in:
parent
b090a1c933
commit
56f66a7704
48 changed files with 211 additions and 250 deletions
85
build.gradle
85
build.gradle
|
@ -22,6 +22,9 @@ apply plugin: 'maven-publish'
|
|||
|
||||
ext.buildProps = file "build.properties"
|
||||
|
||||
project.sourceCompatibility = '1.8'
|
||||
project.targetCompatibility = '1.8'
|
||||
|
||||
buildProps.withReader {
|
||||
def prop = new Properties()
|
||||
prop.load(it)
|
||||
|
@ -29,17 +32,12 @@ buildProps.withReader {
|
|||
}
|
||||
|
||||
version = "${config.version.mod.major}.${config.version.mod.minor}.${config.version.mod.revis}"
|
||||
group = "dev.calclavia.electrodynamics"
|
||||
archivesBaseName = "electrodynamics"
|
||||
|
||||
if (System.getenv("TEAMCITY_BUILDCONF_NAME")?.equalsIgnoreCase("Production")) {
|
||||
group = "com.calclavia.electrodynamics"
|
||||
archivesBaseName = System.getenv("TEAMCITY_PROJECT_NAME")?.replaceAll(" ", "-")
|
||||
} else {
|
||||
group = "dev.calclavia.electrodynamics"
|
||||
archivesBaseName = System.getenv("TEAMCITY_PROJECT_NAME")?.replaceAll(" ", "-") + "-" + System.getenv("TEAMCITY_BUILDCONF_NAME")
|
||||
}
|
||||
|
||||
minecraft {
|
||||
version = "${config.version.minecraft}-${config.version.forge}"
|
||||
version = "${config.version.minecraft}-${config.version.forge}-${config.version.minecraft}"
|
||||
|
||||
replaceIn "References.scala"
|
||||
replace "@MAJOR@", config.version.mod.major
|
||||
|
@ -74,47 +72,9 @@ task copyBuildXml(type: Copy) {
|
|||
into 'output'
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates a TeamCity XML changelog via the REST API.
|
||||
*/
|
||||
task("createChangelog").doLast {
|
||||
|
||||
def teamCityURL = "http://ci.calclavia.com/"
|
||||
|
||||
/**
|
||||
* Create a new file
|
||||
*/
|
||||
def file = new FileOutputStream("output/changelog.xml")
|
||||
def out = new BufferedOutputStream(file)
|
||||
|
||||
/**
|
||||
* Grab the build first, parse the XML to find the changelog XML URL
|
||||
*/
|
||||
def changesXML = new XmlSlurper().parse(teamCityURL + "guestAuth/app/rest/changes?locator=build:(id:" + teamcity["teamcity.build.id"] + ")")
|
||||
def changes = changesXML.change
|
||||
|
||||
/**
|
||||
* Add the XML definition header in the front of the file and remove all other occurrences of the XML header
|
||||
*/
|
||||
out << ("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><changes>")
|
||||
|
||||
println("createChangelog: Identified " + changes.size() + " changes to be written into the changelog.")
|
||||
|
||||
for (int i = 0; i < changes.size(); i++) {
|
||||
/**
|
||||
* Write each changelog XML into the URL
|
||||
*/
|
||||
def changelogURL = teamCityURL + "guestAuth/app/rest/changes/id:" + changes[i].@id.text()
|
||||
out << new URL(changelogURL).getText().replaceAll("<\\?xml version=\"1\\.0\" encoding=\"UTF-8\" standalone=\"yes\"\\?>", "")
|
||||
}
|
||||
|
||||
out << "</changes>"
|
||||
|
||||
out.close()
|
||||
}
|
||||
|
||||
jar {
|
||||
dependsOn copyBuildXml, createChangelog
|
||||
dependsOn copyBuildXml
|
||||
classifier = 'core'
|
||||
destinationDir = file 'output'
|
||||
}
|
||||
|
@ -144,12 +104,12 @@ publishing {
|
|||
|
||||
repositories {
|
||||
maven {
|
||||
name "Calclavia Maven"
|
||||
url "http://calclavia.com/maven"
|
||||
name "tilera Maven"
|
||||
url "https://data.tilera.xyz/maven"
|
||||
}
|
||||
maven {
|
||||
name = "forge"
|
||||
url = "http://files.minecraftforge.net/maven"
|
||||
url = "https://files.minecraftforge.net/maven"
|
||||
}
|
||||
maven {
|
||||
name "Mobius Repo"
|
||||
|
@ -157,13 +117,13 @@ repositories {
|
|||
}
|
||||
maven {
|
||||
name "chickenbones"
|
||||
url "http://chickenbones.net/maven"
|
||||
url "https://chickenbones.net/maven"
|
||||
}
|
||||
maven {
|
||||
maven {
|
||||
name 'OC Maven'
|
||||
url = "http://maven.cil.li/"
|
||||
url = "https://maven.cil.li/"
|
||||
}
|
||||
|
||||
|
||||
mavenCentral()
|
||||
maven {
|
||||
name = "ic2"
|
||||
|
@ -172,22 +132,15 @@ repositories {
|
|||
}
|
||||
|
||||
dependencies {
|
||||
if (System.getenv("TEAMCITY_BUILDCONF_NAME") == "Development")
|
||||
{
|
||||
compile group: 'dev.calclavia.resonantengine', name: 'resonant-engine', version: "${config.version.resonantengine}", classifier: "dev"
|
||||
}
|
||||
else
|
||||
{
|
||||
compile group: 'com.calclavia.resonantengine', name: 'resonant-engine', version: "${config.version.resonantengine}", classifier: "dev"
|
||||
}
|
||||
|
||||
|
||||
compile group: 'resonant', name: 'Resonant-Engine', version: "${config.version.resonantengine}", classifier: "dev"
|
||||
testCompile 'junit:junit:4.11'
|
||||
testCompile 'jmock:jmock:1.1.0'
|
||||
compile "li.cil.oc:OpenComputers:MC1.7.10-1.4.0.+:api"
|
||||
compile "li.cil.oc:OpenComputers:MC1.7.10-1.7.5.1356:api"
|
||||
compile "codechicken:CodeChickenLib:${config.version.minecraft}-${config.version.cclib}:dev"
|
||||
compile "codechicken:ForgeMultipart:${config.version.minecraft}-${config.version.fmp}:dev"
|
||||
compile "codechicken:CodeChickenCore:${config.version.minecraft}-${config.version.cccore}:dev"
|
||||
compile "codechicken:NotEnoughItems:${config.version.minecraft}-${config.version.nei}:dev"
|
||||
compile "mcp.mobius.waila:Waila:1.5.6_dev1_1.7.10"
|
||||
compile "mcp.mobius.waila:Waila:1.5.8_dev3_1.7.10"
|
||||
compile "net.industrial-craft:industrialcraft-2:2.2.654-experimental:dev"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
dir.development=./
|
||||
dir.mcp=${dir.development}forge/mcp
|
||||
version.minecraft=1.7.10
|
||||
version.forge=10.13.2.1230
|
||||
version.resonantengine=3.3.+
|
||||
version.forge=10.13.4.1614
|
||||
version.resonantengine=3.3.0.437
|
||||
version.cclib=1.1.1.99
|
||||
version.cccore=1.0.3.25
|
||||
version.cccore=1.0.7.47
|
||||
version.fmp=1.1.0.300
|
||||
version.nei=1.0.3.51
|
||||
version.nei=1.0.5.120
|
||||
version.mod.major=0
|
||||
version.mod.minor=3
|
||||
version.mod.revis=5
|
||||
version.mod.revis=5
|
||||
|
|
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
|
@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
|
|||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-2.0-rc-2-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14-all.zip
|
||||
|
|
|
@ -370,12 +370,12 @@ class TileImprinter extends ResonantTile(Material.circuits) with ISidedInventory
|
|||
InventoryUtility.dropItemStack(world, new Vector3(player), checkStack, 0)
|
||||
inventory(slotID) = null
|
||||
}
|
||||
world.markBlockForUpdate(x, y, z)
|
||||
world.markBlockForUpdate(x.toInt, y.toInt, z.toInt)
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
world.markBlockForUpdate(x, y, z)
|
||||
world.markBlockForUpdate(x.toInt, y.toInt, z.toInt)
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
@ -398,10 +398,10 @@ class TileImprinter extends ResonantTile(Material.circuits) with ISidedInventory
|
|||
|
||||
override def onNeighborChanged(block: Block)
|
||||
{
|
||||
val b: Block = (position + ForgeDirection.getOrientation(1)).getBlock
|
||||
val b: Block = (toVectorWorld + ForgeDirection.getOrientation(1)).getBlock
|
||||
if (Blocks.piston_head eq b)
|
||||
{
|
||||
onInventoryChanged
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -36,7 +36,7 @@ class TileTurntable extends ResonantBlock(Material.piston) with TRotatable
|
|||
|
||||
override def update()
|
||||
{
|
||||
updateTurntableState(world, x, y, z)
|
||||
updateTurntableState(world, x.toInt, y.toInt, z.toInt)
|
||||
}
|
||||
|
||||
private def updateTurntableState(world: World, x: Int, y: Int, z: Int)
|
||||
|
|
|
@ -92,7 +92,7 @@ class TileGrate extends TileFluidProvider(Material.rock) with TRotatable
|
|||
if (gratePath == null)
|
||||
{
|
||||
gratePath = new GratePathfinder(true)
|
||||
gratePath.startFill(position, fluidNode.getFluid.getFluid.getID)
|
||||
gratePath.startFill(toVectorWorld, fluidNode.getFluid.getFluid.getID)
|
||||
}
|
||||
val filledInWorld = gratePath.tryFill(fluidNode.getFluidAmount, blockEffect)
|
||||
fluidNode.drain(filledInWorld, true)
|
||||
|
@ -107,7 +107,7 @@ class TileGrate extends TileFluidProvider(Material.rock) with TRotatable
|
|||
if (gratePath == null)
|
||||
{
|
||||
gratePath = new GratePathfinder(false)
|
||||
if (!gratePath.startDrain(position))
|
||||
if (!gratePath.startDrain(toVectorWorld))
|
||||
{
|
||||
resetPath()
|
||||
}
|
||||
|
|
|
@ -102,7 +102,7 @@ class TileGutter extends TileFluidProvider(Material.rock)
|
|||
{
|
||||
val dir: ForgeDirection = ForgeDirection.getOrientation(i)
|
||||
val pressure: Int = fluidNode.asInstanceOf[NodeFluidPressure].pressure(dir)
|
||||
val pos: Vector3 = position.add(dir)
|
||||
val pos: Vector3 = toVectorWorld.add(dir)
|
||||
val checkTile: TileEntity = pos.getTileEntity(world)
|
||||
|
||||
if (checkTile.isInstanceOf[TileGutter])
|
||||
|
@ -147,7 +147,7 @@ class TileGutter extends TileFluidProvider(Material.rock)
|
|||
{
|
||||
if (!world.isRemote)
|
||||
{
|
||||
val posAbove = position + new Vector3(0, 1, 0)
|
||||
val posAbove = toVectorWorld + new Vector3(0, 1, 0)
|
||||
val blockAbove = posAbove.getBlock
|
||||
val tanks = findAllTanks
|
||||
|
||||
|
@ -264,10 +264,10 @@ class TileGutter extends TileFluidProvider(Material.rock)
|
|||
{
|
||||
GL11.glPushMatrix()
|
||||
GL11.glScaled(0.99, 0.99, 0.99)
|
||||
val ySouthEast = FluidUtility.getAveragePercentageFilledForSides(classOf[TileGutter], percentageFilled, world, position, ForgeDirection.SOUTH, ForgeDirection.EAST)
|
||||
val yNorthEast = FluidUtility.getAveragePercentageFilledForSides(classOf[TileGutter], percentageFilled, world, position, ForgeDirection.NORTH, ForgeDirection.EAST)
|
||||
val ySouthWest = FluidUtility.getAveragePercentageFilledForSides(classOf[TileGutter], percentageFilled, world, position, ForgeDirection.SOUTH, ForgeDirection.WEST)
|
||||
val yNorthWest = FluidUtility.getAveragePercentageFilledForSides(classOf[TileGutter], percentageFilled, world, position, ForgeDirection.NORTH, ForgeDirection.WEST)
|
||||
val ySouthEast = FluidUtility.getAveragePercentageFilledForSides(classOf[TileGutter], percentageFilled, world, toVectorWorld, ForgeDirection.SOUTH, ForgeDirection.EAST)
|
||||
val yNorthEast = FluidUtility.getAveragePercentageFilledForSides(classOf[TileGutter], percentageFilled, world, toVectorWorld, ForgeDirection.NORTH, ForgeDirection.EAST)
|
||||
val ySouthWest = FluidUtility.getAveragePercentageFilledForSides(classOf[TileGutter], percentageFilled, world, toVectorWorld, ForgeDirection.SOUTH, ForgeDirection.WEST)
|
||||
val yNorthWest = FluidUtility.getAveragePercentageFilledForSides(classOf[TileGutter], percentageFilled, world, toVectorWorld, ForgeDirection.NORTH, ForgeDirection.WEST)
|
||||
FluidRenderUtility.renderFluidTesselation(tank, ySouthEast, yNorthEast, ySouthWest, yNorthWest)
|
||||
GL11.glPopMatrix()
|
||||
}
|
||||
|
@ -337,4 +337,4 @@ class TileGutter extends TileFluidProvider(Material.rock)
|
|||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -55,7 +55,7 @@ class TileTank extends TileFluidProvider(Material.iron) with ISneakPickup with R
|
|||
|
||||
if (result == 0)
|
||||
{
|
||||
val tile = (position + new Vector3(0, 1, 0)).getTileEntity
|
||||
val tile = (toVectorWorld + new Vector3(0, 1, 0)).getTileEntity
|
||||
|
||||
if (tile.isInstanceOf[TileTank])
|
||||
{
|
||||
|
@ -77,7 +77,7 @@ class TileTank extends TileFluidProvider(Material.iron) with ISneakPickup with R
|
|||
{
|
||||
if (!world.isRemote)
|
||||
{
|
||||
return FluidUtility.playerActivatedFluidItem(world, x, y, z, player, side)
|
||||
return FluidUtility.playerActivatedFluidItem(world, x.toInt, y.toInt, z.toInt, player, side)
|
||||
}
|
||||
|
||||
return true
|
||||
|
@ -124,10 +124,10 @@ class TileTank extends TileFluidProvider(Material.iron) with ISneakPickup with R
|
|||
GL11.glScaled(0.99, 0.99, 0.99)
|
||||
val tank: IFluidTank = fluidNode.getTank
|
||||
val percentageFilled: Double = tank.getFluidAmount.toDouble / tank.getCapacity.toDouble
|
||||
val ySouthEast = FluidUtility.getAveragePercentageFilledForSides(classOf[TileTank], percentageFilled, world, position, ForgeDirection.SOUTH, ForgeDirection.EAST)
|
||||
val yNorthEast = FluidUtility.getAveragePercentageFilledForSides(classOf[TileTank], percentageFilled, world, position, ForgeDirection.NORTH, ForgeDirection.EAST)
|
||||
val ySouthWest = FluidUtility.getAveragePercentageFilledForSides(classOf[TileTank], percentageFilled, world, position, ForgeDirection.SOUTH, ForgeDirection.WEST)
|
||||
val yNorthWest = FluidUtility.getAveragePercentageFilledForSides(classOf[TileTank], percentageFilled, world, position, ForgeDirection.NORTH, ForgeDirection.WEST)
|
||||
val ySouthEast = FluidUtility.getAveragePercentageFilledForSides(classOf[TileTank], percentageFilled, world, toVectorWorld, ForgeDirection.SOUTH, ForgeDirection.EAST)
|
||||
val yNorthEast = FluidUtility.getAveragePercentageFilledForSides(classOf[TileTank], percentageFilled, world, toVectorWorld, ForgeDirection.NORTH, ForgeDirection.EAST)
|
||||
val ySouthWest = FluidUtility.getAveragePercentageFilledForSides(classOf[TileTank], percentageFilled, world, toVectorWorld, ForgeDirection.SOUTH, ForgeDirection.WEST)
|
||||
val yNorthWest = FluidUtility.getAveragePercentageFilledForSides(classOf[TileTank], percentageFilled, world, toVectorWorld, ForgeDirection.NORTH, ForgeDirection.WEST)
|
||||
FluidRenderUtility.renderFluidTesselation(tank, ySouthEast, yNorthEast, ySouthWest, yNorthWest)
|
||||
}
|
||||
GL11.glPopMatrix()
|
||||
|
@ -211,4 +211,4 @@ class TileTank extends TileFluidProvider(Material.iron) with ISneakPickup with R
|
|||
}
|
||||
return drops
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -90,7 +90,7 @@ class TileGlassJar extends ResonantTile(Material.wood) with TPacketReceiver with
|
|||
|
||||
override def onRemove(block: Block, par6: Int)
|
||||
{
|
||||
val stack: ItemStack = ItemBlockSaved.getItemStackWithNBT(block, world, x, y, z)
|
||||
val stack: ItemStack = ItemBlockSaved.getItemStackWithNBT(block, world, x.toInt, y.toInt, z.toInt)
|
||||
InventoryUtility.dropItemStack(world, center, stack)
|
||||
}
|
||||
|
||||
|
|
|
@ -107,7 +107,7 @@ class TileSieve extends ResonantTile(Material.wood) with TInventory with TPacket
|
|||
|
||||
override def onRemove(block: Block, par6: Int)
|
||||
{
|
||||
val stack: ItemStack = ItemBlockSaved.getItemStackWithNBT(block, world, x, y, z)
|
||||
val stack: ItemStack = ItemBlockSaved.getItemStackWithNBT(block, world, x.toInt, y.toInt, z.toInt)
|
||||
InventoryUtility.dropItemStack(world, center, stack)
|
||||
}
|
||||
|
||||
|
@ -125,4 +125,4 @@ class TileSieve extends ResonantTile(Material.wood) with TInventory with TPacket
|
|||
super.read(buf, id, packetType)
|
||||
buf >>>> readFromNBT
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -144,7 +144,7 @@ class TileCastingMold extends TileInventory(Material.rock) with IFluidHandler wi
|
|||
|
||||
override def update
|
||||
{
|
||||
val checkPos: Vector3 = position.add(0, 1, 0)
|
||||
val checkPos: Vector3 = toVectorWorld.add(0, 1, 0)
|
||||
val drainStack: FluidStack = FluidUtility.drainBlock(worldObj, checkPos, false)
|
||||
if (MachineRecipes.instance.getOutput(RecipeType.SMELTER.name, drainStack).length > 0)
|
||||
{
|
||||
|
@ -163,4 +163,4 @@ class TileCastingMold extends TileInventory(Material.rock) with IFluidHandler wi
|
|||
tank.drain(amountPerIngot, true)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -65,7 +65,7 @@ class TileFirebox extends ResonantTile(Material.rock) with IFluidHandler with TI
|
|||
{
|
||||
val drainFluid = tank.drain(FluidContainerRegistry.BUCKET_VOLUME, false)
|
||||
|
||||
if (drainFluid != null && drainFluid.amount == FluidContainerRegistry.BUCKET_VOLUME && drainFluid.fluidID == FluidRegistry.LAVA.getID)
|
||||
if (drainFluid != null && drainFluid.amount == FluidContainerRegistry.BUCKET_VOLUME && drainFluid.getFluidID == FluidRegistry.LAVA.getID)
|
||||
{
|
||||
if (burnTime == 0)
|
||||
{
|
||||
|
@ -97,7 +97,7 @@ class TileFirebox extends ResonantTile(Material.rock) with IFluidHandler with TI
|
|||
|
||||
if (burnTime > 0)
|
||||
{
|
||||
if (block.isAir(world, x, y + 1, z))
|
||||
if (block.isAir(world, x.toInt, y.toInt + 1, z.toInt))
|
||||
{
|
||||
worldObj.setBlock(xCoord, yCoord + 1, zCoord, Blocks.fire)
|
||||
}
|
||||
|
@ -114,7 +114,7 @@ class TileFirebox extends ResonantTile(Material.rock) with IFluidHandler with TI
|
|||
{
|
||||
if (FluidRegistry.getFluid("steam") != null)
|
||||
{
|
||||
MinecraftForge.EVENT_BUS.post(new BoilEvent(worldObj, position.add(0, 1, 0), new FluidStack(FluidRegistry.WATER, volume), new FluidStack(FluidRegistry.getFluid("steam"), volume), 2, false))
|
||||
MinecraftForge.EVENT_BUS.post(new BoilEvent(worldObj, toVectorWorld.add(0, 1, 0), new FluidStack(FluidRegistry.WATER, volume), new FluidStack(FluidRegistry.getFluid("steam"), volume), 2, false))
|
||||
boiledVolume += volume
|
||||
}
|
||||
if (boiledVolume >= FluidContainerRegistry.BUCKET_VOLUME)
|
||||
|
@ -192,7 +192,7 @@ class TileFirebox extends ResonantTile(Material.rock) with IFluidHandler with TI
|
|||
|
||||
def getMeltIronEnergy(volume: Float): Double =
|
||||
{
|
||||
val temperatureChange: Float = 1811 - ThermalPhysics.getDefaultTemperature(position)
|
||||
val temperatureChange: Float = 1811 - ThermalPhysics.getDefaultTemperature(toVectorWorld)
|
||||
val mass: Float = ThermalPhysics.getMass(volume, 7.9f)
|
||||
return ThermalPhysics.getEnergyForTemperatureChange(mass, 450, temperatureChange) + ThermalPhysics.getEnergyForStateChange(mass, 272000)
|
||||
}
|
||||
|
@ -307,7 +307,7 @@ class TileFirebox extends ResonantTile(Material.rock) with IFluidHandler with TI
|
|||
|
||||
override def use(player: EntityPlayer, side: Int, hit: Vector3): Boolean =
|
||||
{
|
||||
if (FluidUtility.playerActivatedFluidItem(world, x, y, z, player, side))
|
||||
if (FluidUtility.playerActivatedFluidItem(world, x.toInt, y.toInt, z.toInt, player, side))
|
||||
{
|
||||
return true
|
||||
}
|
||||
|
@ -319,4 +319,4 @@ class TileFirebox extends ResonantTile(Material.rock) with IFluidHandler with TI
|
|||
par3List.add(new ItemStack(par1, 1, 0))
|
||||
par3List.add(new ItemStack(par1, 1, 1))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -186,7 +186,7 @@ class TileHotPlate extends ResonantTile(Material.iron) with TInventory with TPac
|
|||
*/
|
||||
override def getIcon(access: IBlockAccess, side: Int): IIcon =
|
||||
{
|
||||
return if (access.getBlockMetadata(x, y, z) == 1) ResonantBlock.icon.get("electricHotPlate") else (if (canRun) ResonantBlock.icon.get("hotPlate_on") else ResonantBlock.icon.get(getTextureName))
|
||||
return if (access.getBlockMetadata(x.toInt, y.toInt, z.toInt) == 1) ResonantBlock.icon.get("electricHotPlate") else (if (canRun) ResonantBlock.icon.get("hotPlate_on") else ResonantBlock.icon.get(getTextureName))
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
|
@ -255,4 +255,4 @@ class TileHotPlate extends ResonantTile(Material.iron) with TInventory with TPac
|
|||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,8 +4,11 @@ import java.util.List
|
|||
|
||||
import edx.basic.fluid.tank.TileTank
|
||||
import mcp.mobius.waila.api.{IWailaConfigHandler, IWailaDataAccessor, IWailaDataProvider}
|
||||
import net.minecraft.entity.player.EntityPlayerMP
|
||||
import net.minecraft.item.ItemStack
|
||||
import net.minecraft.nbt.NBTTagCompound
|
||||
import net.minecraft.tileentity.TileEntity
|
||||
import net.minecraft.world.World
|
||||
import net.minecraftforge.fluids.IFluidTank
|
||||
import resonantengine.lib.utility.LanguageUtility
|
||||
|
||||
|
@ -45,4 +48,9 @@ class WailaFluidTank extends IWailaDataProvider
|
|||
{
|
||||
return currenttip
|
||||
}
|
||||
}
|
||||
|
||||
override def getNBTData(player: EntityPlayerMP, te: TileEntity, tag: NBTTagCompound, world: World, x: Int, y: Int, z: Int): NBTTagCompound =
|
||||
{
|
||||
return tag
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@ import net.minecraft.item.{Item, ItemStack}
|
|||
class ItemAlloyDust extends Item with TAlloyItem
|
||||
{
|
||||
//TODO: Check creative tab correctness
|
||||
setCreativeTab(null)
|
||||
//setCreativeTab(null)
|
||||
setTextureName(Reference.prefix + "oreDust")
|
||||
setUnlocalizedName(Reference.prefix + "alloyDust")
|
||||
|
||||
|
|
|
@ -30,13 +30,13 @@ class TileSiren extends ResonantTile(Material.wood) with TBlockNodeProvider
|
|||
{
|
||||
if (world != null)
|
||||
{
|
||||
val metadata: Int = world.getBlockMetadata(x, y, z)
|
||||
if (world.getBlockPowerInput(x, y, z) > 0)
|
||||
val metadata: Int = world.getBlockMetadata(x.toInt, y.toInt, z.toInt)
|
||||
if (world.getBlockPowerInput(x.toInt, y.toInt, z.toInt) > 0)
|
||||
{
|
||||
var volume: Float = 0.5f
|
||||
for (i <- 0 to 6)
|
||||
{
|
||||
val check: Vector3 = position.add(ForgeDirection.getOrientation(i))
|
||||
val check: Vector3 = toVectorWorld.add(ForgeDirection.getOrientation(i))
|
||||
if (check.getBlock(world) == getBlockType)
|
||||
{
|
||||
volume *= 1.5f
|
||||
|
@ -56,7 +56,7 @@ class TileSiren extends ResonantTile(Material.wood) with TBlockNodeProvider
|
|||
|
||||
override def configure(player: EntityPlayer, side: Int, hit: Vector3): Boolean =
|
||||
{
|
||||
var metadata: Int = world.getBlockMetadata(x, y, z)
|
||||
var metadata: Int = world.getBlockMetadata(x.toInt, y.toInt, z.toInt)
|
||||
if (player.isSneaking)
|
||||
{
|
||||
metadata -= 1
|
||||
|
@ -66,7 +66,7 @@ class TileSiren extends ResonantTile(Material.wood) with TBlockNodeProvider
|
|||
metadata += 1
|
||||
}
|
||||
metadata = Math.max(metadata % 16, 0)
|
||||
world.setBlockMetadataWithNotify(x, y, z, metadata, 2)
|
||||
world.setBlockMetadataWithNotify(x.toInt, y.toInt, z.toInt, metadata, 2)
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -57,8 +57,8 @@ class TileLaserEmitter extends ResonantTile(Material.iron) with ILaserHandler wi
|
|||
*/
|
||||
override def onPlaced(entityLiving: EntityLivingBase, itemStack: ItemStack)
|
||||
{
|
||||
val l = BlockPistonBase.determineOrientation(world, x, y, z, entityLiving)
|
||||
world.setBlockMetadataWithNotify(x, y, z, l, 2)
|
||||
val l = BlockPistonBase.determineOrientation(world, x.toInt, y.toInt, z.toInt, entityLiving)
|
||||
world.setBlockMetadataWithNotify(x.toInt, y.toInt, z.toInt, l, 2)
|
||||
}
|
||||
|
||||
override def getLightValue(access: IBlockAccess): Int = ((electricNode.power / Laser.maxEnergy) * 15).toInt
|
||||
|
@ -71,7 +71,7 @@ class TileLaserEmitter extends ResonantTile(Material.iron) with ILaserHandler wi
|
|||
|
||||
if (electricNode.power > 0)
|
||||
{
|
||||
Laser.spawn(worldObj, position + 0.5 + new Vector3(getDirection) * 0.51, position + new Vector3(getDirection) * 0.6 + 0.5, new Vector3(getDirection), electricNode.power / 20)
|
||||
Laser.spawn(worldObj, toVectorWorld + 0.5 + new Vector3(getDirection) * 0.51, toVectorWorld + new Vector3(getDirection) * 0.6 + 0.5, new Vector3(getDirection), electricNode.power / 20)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -59,8 +59,8 @@ class TileLaserReceiver extends ResonantTile(Material.rock) with ILaserHandler w
|
|||
|
||||
override def onPlaced(entityLiving: EntityLivingBase, itemStack: ItemStack)
|
||||
{
|
||||
val l = BlockPistonBase.determineOrientation(world, x, y, z, entityLiving)
|
||||
world.setBlockMetadataWithNotify(x, y, z, l, 2)
|
||||
val l = BlockPistonBase.determineOrientation(world, x.toInt, y.toInt, z.toInt, entityLiving)
|
||||
world.setBlockMetadataWithNotify(x.toInt, y.toInt, z.toInt, l, 2)
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
|
|
|
@ -47,7 +47,7 @@ class TileFocusCrystal extends TileFocus(Material.rock) with ILaserHandler with
|
|||
{
|
||||
val dir = ForgeDirection.getOrientation(a)
|
||||
val axis = new Vector3(dir)
|
||||
val rotateAngle = world.getIndirectPowerLevelTo(x + axis.x.toInt, y + axis.y.toInt, z + axis.z.toInt, a) * 15
|
||||
val rotateAngle = world.getIndirectPowerLevelTo(x.toInt + axis.x.toInt, y.toInt + axis.y.toInt, z.toInt + axis.z.toInt, a) * 15
|
||||
|
||||
if (rotateAngle > 0)
|
||||
{
|
||||
|
@ -55,12 +55,12 @@ class TileFocusCrystal extends TileFocus(Material.rock) with ILaserHandler with
|
|||
}
|
||||
}
|
||||
|
||||
world.markBlockForUpdate(x, y, z)
|
||||
world.markBlockForUpdate(x.toInt, y.toInt, z.toInt)
|
||||
}
|
||||
|
||||
if (energy > 0)
|
||||
{
|
||||
Laser.spawn(worldObj, position + 0.5 + normal * 0.9, position + 0.5, normal, color, energy)
|
||||
Laser.spawn(worldObj, toVectorWorld + 0.5 + normal * 0.9, toVectorWorld + 0.5, normal, color, energy)
|
||||
color = new Vector3(1, 1, 1)
|
||||
energy = 0
|
||||
}
|
||||
|
@ -68,8 +68,8 @@ class TileFocusCrystal extends TileFocus(Material.rock) with ILaserHandler with
|
|||
|
||||
override def focus(newPosition: Vector3)
|
||||
{
|
||||
normal = ((newPosition - position) - 0.5).normalize
|
||||
world.markBlockForUpdate(x, y, z)
|
||||
normal = ((newPosition - toVectorWorld) - 0.5).normalize
|
||||
world.markBlockForUpdate(x.toInt, y.toInt, z.toInt)
|
||||
}
|
||||
|
||||
override def getFocus: Vector3 = normal
|
||||
|
@ -83,7 +83,7 @@ class TileFocusCrystal extends TileFocus(Material.rock) with ILaserHandler with
|
|||
|
||||
override def onLaserHit(renderStart: Vector3, incidentDirection: Vector3, hit: MovingObjectPosition, color: Vector3, energy: Double): Boolean =
|
||||
{
|
||||
Electrodynamics.proxy.renderLaser(worldObj, renderStart, position + 0.5, color, energy)
|
||||
Electrodynamics.proxy.renderLaser(worldObj, renderStart, toVectorWorld + 0.5, color, energy)
|
||||
this.energy += energy
|
||||
this.color = (this.color + color) / 2
|
||||
return true
|
||||
|
@ -93,7 +93,7 @@ class TileFocusCrystal extends TileFocus(Material.rock) with ILaserHandler with
|
|||
{
|
||||
val nbt = new NBTTagCompound()
|
||||
writeToNBT(nbt)
|
||||
return new S35PacketUpdateTileEntity(x, y, z, 0, nbt)
|
||||
return new S35PacketUpdateTileEntity(x.toInt, y.toInt, z.toInt, 0, nbt)
|
||||
}
|
||||
|
||||
override def writeToNBT(nbt: NBTTagCompound)
|
||||
|
|
|
@ -49,7 +49,7 @@ class TileMirror extends TileFocus(Material.glass) with ILaserHandler with IFocu
|
|||
{
|
||||
val dir = ForgeDirection.getOrientation(a)
|
||||
val axis = new Vector3(dir)
|
||||
val rotateAngle = world.getIndirectPowerLevelTo(x + axis.x.toInt, y + axis.y.toInt, z + axis.z.toInt, a) * 15
|
||||
val rotateAngle = world.getIndirectPowerLevelTo((x.toInt + axis.x).toInt, (y + axis.y).toInt, (z + axis.z).toInt, a) * 15
|
||||
|
||||
if (rotateAngle > 0)
|
||||
{
|
||||
|
@ -57,7 +57,7 @@ class TileMirror extends TileFocus(Material.glass) with ILaserHandler with IFocu
|
|||
}
|
||||
}
|
||||
|
||||
world.markBlockForUpdate(x, y, z)
|
||||
world.markBlockForUpdate(x.toInt, y.toInt, z.toInt)
|
||||
}
|
||||
|
||||
if (world.getTotalWorldTime % 20 == 0)
|
||||
|
@ -66,8 +66,8 @@ class TileMirror extends TileFocus(Material.glass) with ILaserHandler with IFocu
|
|||
|
||||
override def focus(newPosition: Vector3)
|
||||
{
|
||||
normal = ((newPosition - position) - 0.5).normalize
|
||||
world.markBlockForUpdate(x, y, z)
|
||||
normal = ((newPosition - toVectorWorld) - 0.5).normalize
|
||||
world.markBlockForUpdate(x.toInt, y.toInt, z.toInt)
|
||||
}
|
||||
|
||||
override def getFocus: Vector3 = normal
|
||||
|
@ -89,7 +89,7 @@ class TileMirror extends TileFocus(Material.glass) with ILaserHandler with IFocu
|
|||
/**
|
||||
* Render incoming laser
|
||||
*/
|
||||
Electrodynamics.proxy.renderLaser(worldObj, renderStart, position + 0.5, color, energy)
|
||||
Electrodynamics.proxy.renderLaser(worldObj, renderStart, toVectorWorld + 0.5, color, energy)
|
||||
|
||||
/**
|
||||
* Calculate Reflection
|
||||
|
@ -102,7 +102,7 @@ class TileMirror extends TileFocus(Material.glass) with ILaserHandler with IFocu
|
|||
if (rotateAngle < Math.PI)
|
||||
{
|
||||
val newDirection = (incidentDirection.clone.transform(new Quaternion(rotateAngle, axisOfReflection))).normalize
|
||||
Laser.spawn(worldObj, position + 0.5 + newDirection * 0.9, position + 0.5, newDirection, color, energy / 1.2)
|
||||
Laser.spawn(worldObj, toVectorWorld+ 0.5 + newDirection * 0.9, toVectorWorld + 0.5, newDirection, color, energy / 1.2)
|
||||
}
|
||||
|
||||
return true
|
||||
|
@ -112,7 +112,7 @@ class TileMirror extends TileFocus(Material.glass) with ILaserHandler with IFocu
|
|||
{
|
||||
val nbt = new NBTTagCompound()
|
||||
writeToNBT(nbt)
|
||||
return new S35PacketUpdateTileEntity(x, y, z, 0, nbt)
|
||||
return new S35PacketUpdateTileEntity(x.toInt, y.toInt, z.toInt, 0, nbt)
|
||||
}
|
||||
|
||||
override def writeToNBT(nbt: NBTTagCompound)
|
||||
|
|
|
@ -94,7 +94,7 @@ class TileTesla extends ResonantTile(Material.iron) with TBlockNodeProvider with
|
|||
if (this.ticks % (4 + this.worldObj.rand.nextInt(2)) == 0 && ((this.worldObj.isRemote && isTransfering) || (this.energy.value != 0 && !this.worldObj.isBlockIndirectlyGettingPowered(this.xCoord, this.yCoord, this.zCoord))))
|
||||
{
|
||||
val topTesla: TileTesla = this.getTopTelsa
|
||||
val topTeslaVector: Vector3 = position
|
||||
val topTeslaVector: Vector3 = toVectorWorld
|
||||
if (this.linked != null || this.isLinkedClient)
|
||||
{
|
||||
if (!this.worldObj.isRemote)
|
||||
|
@ -124,8 +124,8 @@ class TileTesla extends ResonantTile(Material.iron) with TBlockNodeProvider with
|
|||
{
|
||||
def compare(o1: ITesla, o2: ITesla): Int =
|
||||
{
|
||||
val distance1: Double = position.distance(new Vector3(o1.asInstanceOf[TileEntity]))
|
||||
val distance2: Double = position.distance(new Vector3(o2.asInstanceOf[TileEntity]))
|
||||
val distance1: Double = toVectorWorld.distance(new Vector3(o1.asInstanceOf[TileEntity]))
|
||||
val distance2: Double = toVectorWorld.distance(new Vector3(o2.asInstanceOf[TileEntity]))
|
||||
if (distance1 < distance2)
|
||||
{
|
||||
return 1
|
||||
|
@ -141,7 +141,7 @@ class TileTesla extends ResonantTile(Material.iron) with TBlockNodeProvider with
|
|||
for (o <- TeslaGrid.instance.get)
|
||||
{
|
||||
var otherTesla = o
|
||||
if (new Vector3(otherTesla.asInstanceOf[TileEntity]).distance(position) < this.getRange && otherTesla != this)
|
||||
if (new Vector3(otherTesla.asInstanceOf[TileEntity]).distance(toVectorWorld) < this.getRange && otherTesla != this)
|
||||
{
|
||||
if (otherTesla.isInstanceOf[TileTesla])
|
||||
{
|
||||
|
@ -172,11 +172,11 @@ class TileTesla extends ResonantTile(Material.iron) with TBlockNodeProvider with
|
|||
if (tesla.isInstanceOf[TileTesla])
|
||||
{
|
||||
getMultiBlock.get.outputBlacklist.add(this)
|
||||
targetVector = tesla.asInstanceOf[TileTesla].getTopTelsa.position
|
||||
targetVector = tesla.asInstanceOf[TileTesla].getTopTelsa.toVectorWorld
|
||||
heightRange = (tesla.asInstanceOf[TileTesla]).getHeight
|
||||
}
|
||||
val distance: Double = topTeslaVector.distance(targetVector)
|
||||
Electrodynamics.proxy.renderElectricShock(this.worldObj, topTesla.position + new Vector3(0.5), targetVector + new Vector3(0.5, Math.random * heightRange / 3 - heightRange / 3, 0.5), EnumColor.DYES(this.dyeID).toColor)
|
||||
Electrodynamics.proxy.renderElectricShock(this.worldObj, topTesla.toVectorWorld + new Vector3(0.5), targetVector + new Vector3(0.5, Math.random * heightRange / 3 - heightRange / 3, 0.5), EnumColor.DYES(this.dyeID).toColor)
|
||||
this.transfer(tesla, Math.min(transferEnergy, TRANSFER_CAP))
|
||||
if (!sentPacket && transferEnergy > 0)
|
||||
{
|
||||
|
@ -308,7 +308,7 @@ class TileTesla extends ResonantTile(Material.iron) with TBlockNodeProvider with
|
|||
return this.topCache
|
||||
}
|
||||
this.connectedTeslas.clear
|
||||
val checkPosition: Vector3 = position
|
||||
val checkPosition: Vector3 = toVectorWorld
|
||||
var returnTile: TileTesla = this
|
||||
var exit = false
|
||||
while (exit)
|
||||
|
@ -344,7 +344,7 @@ class TileTesla extends ResonantTile(Material.iron) with TBlockNodeProvider with
|
|||
var exit = false
|
||||
while (!exit)
|
||||
{
|
||||
val t: TileEntity = (position + new Vector3(0, y, 0)).getTileEntity(this.worldObj)
|
||||
val t: TileEntity = (toVectorWorld + new Vector3(0, y, 0)).getTileEntity(this.worldObj)
|
||||
if (t.isInstanceOf[TileTesla])
|
||||
{
|
||||
this.connectedTeslas.add(t.asInstanceOf[TileTesla])
|
||||
|
@ -428,7 +428,7 @@ class TileTesla extends ResonantTile(Material.iron) with TBlockNodeProvider with
|
|||
val tileEntity: TileEntity = this.linked.getTileEntity(newOtherWorld)
|
||||
if (tileEntity.isInstanceOf[TileTesla])
|
||||
{
|
||||
(tileEntity.asInstanceOf[TileTesla]).setLink(position, this.worldObj.provider.dimensionId, false)
|
||||
(tileEntity.asInstanceOf[TileTesla]).setLink(toVectorWorld, this.worldObj.provider.dimensionId, false)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -454,7 +454,7 @@ class TileTesla extends ResonantTile(Material.iron) with TBlockNodeProvider with
|
|||
def getMultiBlockVectors: java.lang.Iterable[Vector3] =
|
||||
{
|
||||
val vectors: List[Vector3] = new ArrayList[Vector3]
|
||||
val checkPosition: Vector3 = position
|
||||
val checkPosition: Vector3 = toVectorWorld
|
||||
var exit = false
|
||||
while (!exit)
|
||||
{
|
||||
|
@ -474,7 +474,7 @@ class TileTesla extends ResonantTile(Material.iron) with TBlockNodeProvider with
|
|||
|
||||
def getPosition: Vector3 =
|
||||
{
|
||||
return position
|
||||
return toVectorWorld
|
||||
}
|
||||
|
||||
def getWorld: World =
|
||||
|
@ -576,7 +576,7 @@ class TileTesla extends ResonantTile(Material.iron) with TBlockNodeProvider with
|
|||
else
|
||||
{
|
||||
if (world.isRemote) player.addChatMessage(new ChatComponentText("Marked link for device."))
|
||||
LinkUtility.setLink(itemStack, position)
|
||||
LinkUtility.setLink(itemStack, toVectorWorld)
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
@ -593,8 +593,8 @@ class TileTesla extends ResonantTile(Material.iron) with TBlockNodeProvider with
|
|||
val mainTile: TileTesla = getLowestTesla
|
||||
mainTile.getMultiBlock.deconstruct
|
||||
mainTile.getMultiBlock.construct
|
||||
val isTop: Boolean = (position + new Vector3(0, 1, 0)).getTileEntity(this.worldObj).isInstanceOf[TileTesla]
|
||||
val isBottom: Boolean = (position + new Vector3(0, -1, 0)).getTileEntity(this.worldObj).isInstanceOf[TileTesla]
|
||||
val isTop: Boolean = (toVectorWorld + new Vector3(0, 1, 0)).getTileEntity(this.worldObj).isInstanceOf[TileTesla]
|
||||
val isBottom: Boolean = (toVectorWorld + new Vector3(0, -1, 0)).getTileEntity(this.worldObj).isInstanceOf[TileTesla]
|
||||
if (isTop && isBottom)
|
||||
{
|
||||
this.worldObj.setBlockMetadataWithNotify(this.xCoord, this.yCoord, this.zCoord, 1, 3)
|
||||
|
@ -612,7 +612,7 @@ class TileTesla extends ResonantTile(Material.iron) with TBlockNodeProvider with
|
|||
def getLowestTesla: TileTesla =
|
||||
{
|
||||
var lowest: TileTesla = this
|
||||
val checkPosition: Vector3 = position
|
||||
val checkPosition: Vector3 = toVectorWorld
|
||||
var exit = false
|
||||
while (!exit)
|
||||
{
|
||||
|
@ -639,4 +639,4 @@ class TileTesla extends ResonantTile(Material.iron) with TBlockNodeProvider with
|
|||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -42,7 +42,7 @@ class TileThermopile extends ResonantTile(Material.rock) with TBlockNodeProvider
|
|||
|
||||
for (dir <- ForgeDirection.VALID_DIRECTIONS)
|
||||
{
|
||||
val checkPos = position + dir
|
||||
val checkPos = toVectorWorld + dir
|
||||
val block = checkPos.getBlock
|
||||
|
||||
if (block == Blocks.water || block == Blocks.flowing_water)
|
||||
|
@ -77,7 +77,7 @@ class TileThermopile extends ResonantTile(Material.rock) with TBlockNodeProvider
|
|||
{
|
||||
for (dir <- ForgeDirection.VALID_DIRECTIONS)
|
||||
{
|
||||
val checkPos = position.add(dir)
|
||||
val checkPos = toVectorWorld.add(dir)
|
||||
val block = checkPos.getBlock(worldObj)
|
||||
|
||||
if (block == Blocks.water || block == Blocks.flowing_water)
|
||||
|
@ -120,4 +120,4 @@ class TileThermopile extends ResonantTile(Material.rock) with TBlockNodeProvider
|
|||
|
||||
return super.getIcon(side, meta)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -146,7 +146,7 @@ class TileBattery extends ResonantTile(Material.iron) with TIO with TBlockNodePr
|
|||
{
|
||||
energy.max = (TileBattery.getEnergyForTier(ItemBlockBattery.getTier(itemStack)))
|
||||
energy.value = itemStack.getItem.asInstanceOf[ItemBlockBattery].getEnergy(itemStack)
|
||||
world.setBlockMetadataWithNotify(x, y, z, ItemBlockBattery.getTier(itemStack), 3)
|
||||
world.setBlockMetadataWithNotify(x.toInt, y.toInt, z.toInt, ItemBlockBattery.getTier(itemStack), 3)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -155,7 +155,7 @@ class TileBattery extends ResonantTile(Material.iron) with TIO with TBlockNodePr
|
|||
val ret = new ArrayList[ItemStack]
|
||||
val itemStack: ItemStack = new ItemStack(getBlockType, 1)
|
||||
val itemBlock: ItemBlockBattery = itemStack.getItem.asInstanceOf[ItemBlockBattery]
|
||||
ItemBlockBattery.setTier(itemStack, world.getBlockMetadata(x, y, z).asInstanceOf[Byte])
|
||||
ItemBlockBattery.setTier(itemStack, world.getBlockMetadata(x.toInt, y.toInt, z.toInt).asInstanceOf[Byte])
|
||||
itemBlock.setEnergy(itemStack, energy.value)
|
||||
ret.add(itemStack)
|
||||
return ret
|
||||
|
@ -201,7 +201,7 @@ class TileBattery extends ResonantTile(Material.iron) with TIO with TBlockNodePr
|
|||
|
||||
for (check <- ForgeDirection.VALID_DIRECTIONS)
|
||||
{
|
||||
if ((position + check).getTileEntity.isInstanceOf[TileBattery])
|
||||
if ((toVectorWorld + check).getTileEntity.isInstanceOf[TileBattery])
|
||||
{
|
||||
disabledParts ++= partToDisable(check.ordinal)
|
||||
if (check == ForgeDirection.UP)
|
||||
|
@ -214,7 +214,7 @@ class TileBattery extends ResonantTile(Material.iron) with TIO with TBlockNodePr
|
|||
var connectionParts = Set.empty[String]
|
||||
val downDirs = ForgeDirection.VALID_DIRECTIONS.filter(_.offsetY == 0)
|
||||
downDirs.foreach(s => connectionParts ++= connectionPartToEnable(s.ordinal))
|
||||
downDirs.filter(s => (position + s).getTileEntity.isInstanceOf[TileBattery]).foreach(s => connectionParts --= connectionPartToEnable(s.ordinal))
|
||||
downDirs.filter(s => (toVectorWorld + s).getTileEntity.isInstanceOf[TileBattery]).foreach(s => connectionParts --= connectionPartToEnable(s.ordinal))
|
||||
enabledParts ++= connectionParts
|
||||
}
|
||||
}
|
||||
|
@ -278,4 +278,4 @@ class TileBattery extends ResonantTile(Material.iron) with TIO with TBlockNodePr
|
|||
super.writeToNBT(nbt)
|
||||
energy.save(nbt)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@ class NodePipe(parent: PartPipe) extends NodeFluidPressure(parent) with TMultipa
|
|||
{
|
||||
for (dir <- ForgeDirection.VALID_DIRECTIONS)
|
||||
{
|
||||
val tile = position.add(dir).getTileEntity(world)
|
||||
val tile = toVectorWorld.add(dir).getTileEntity(world)
|
||||
|
||||
if (tile.isInstanceOf[IFluidHandler])
|
||||
{
|
||||
|
@ -63,4 +63,4 @@ class NodePipe(parent: PartPipe) extends NodeFluidPressure(parent) with TMultipa
|
|||
}
|
||||
|
||||
def pipe: PartPipe = getParent.asInstanceOf[PartPipe]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -54,7 +54,7 @@ class TilePump extends TileMechanical(Material.iron) with IRotatable with IFluid
|
|||
{
|
||||
if (from == getDirection.getOpposite)
|
||||
{
|
||||
val tileOut = (position + from.getOpposite).getTileEntity
|
||||
val tileOut = (toVectorWorld + from.getOpposite).getTileEntity
|
||||
if (tileOut.isInstanceOf[IFluidHandler])
|
||||
return (tileOut.asInstanceOf[IFluidHandler]).fill(from, resource, doFill)
|
||||
}
|
||||
|
@ -96,4 +96,4 @@ class TilePump extends TileMechanical(Material.iron) with IRotatable with IFluid
|
|||
def canDrain(from: ForgeDirection, fluid: Fluid): Boolean = from == getDirection
|
||||
|
||||
def getTankInfo(from: ForgeDirection): Array[FluidTankInfo] = null
|
||||
}
|
||||
}
|
||||
|
|
|
@ -83,7 +83,7 @@ class TileDetector extends TileFilterable with TPacketReceiver
|
|||
this.worldObj.notifyBlocksOfNeighborChange(x, this.yCoord + 1, z, MechanicalContent.blockDetector)
|
||||
}
|
||||
}
|
||||
ResonantEngine.packetHandler.sendToAllAround(new PacketTile(x, y, z, Array[Any](0, this.isInverted)), this)
|
||||
ResonantEngine.packetHandler.sendToAllAround(new PacketTile(x.toInt, y.toInt, z.toInt, Array[Any](0, this.isInverted)), this)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -109,7 +109,7 @@ class TileDetector extends TileFilterable with TPacketReceiver
|
|||
|
||||
override def getDescriptionPacket: Packet =
|
||||
{
|
||||
return ResonantEngine.packetHandler.toMCPacket(new PacketTile(x, y, z, Array[Any](0, this.isInverted)))
|
||||
return ResonantEngine.packetHandler.toMCPacket(new PacketTile(x.toInt, y.toInt, z.toInt, Array[Any](0, this.isInverted)))
|
||||
}
|
||||
|
||||
override def read(buf: ByteBuf, id: Int, packetType: PacketType)
|
||||
|
@ -139,7 +139,7 @@ class TileDetector extends TileFilterable with TPacketReceiver
|
|||
{
|
||||
var isInverted: Boolean = false
|
||||
var isFront: Boolean = false
|
||||
val tileEntity: TileEntity = iBlockAccess.getTileEntity(x, y, z)
|
||||
val tileEntity: TileEntity = iBlockAccess.getTileEntity(x.toInt, y.toInt, z.toInt)
|
||||
if (tileEntity.isInstanceOf[TileDetector])
|
||||
{
|
||||
isFront = side == (tileEntity.asInstanceOf[TileDetector]).getDirection.ordinal
|
||||
|
@ -156,4 +156,4 @@ class TileDetector extends TileFilterable with TPacketReceiver
|
|||
}
|
||||
return 0
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -78,8 +78,8 @@ class TileBreaker extends ResonantTile(Material.iron) with TRotatable with IPack
|
|||
if (isIndirectlyPowered)
|
||||
{
|
||||
val dir: ForgeDirection = getDirection
|
||||
val check: Vector3 = position.add(dir)
|
||||
val put: VectorWorld = position.add(dir.getOpposite)
|
||||
val check: Vector3 = toVectorWorld.add(dir)
|
||||
val put: VectorWorld = toVectorWorld.add(dir.getOpposite)
|
||||
val block: Block = check.getBlock(world)
|
||||
if (block != null)
|
||||
{
|
||||
|
@ -121,7 +121,7 @@ class TileBreaker extends ResonantTile(Material.iron) with TRotatable with IPack
|
|||
|
||||
@SideOnly(Side.CLIENT) override def getIcon(access: IBlockAccess, side: Int): IIcon =
|
||||
{
|
||||
val meta: Int = access.getBlockMetadata(x, y, z)
|
||||
val meta: Int = access.getBlockMetadata(x.toInt, y.toInt, z.toInt)
|
||||
if (side == meta)
|
||||
{
|
||||
return TileBreaker.iconFront
|
||||
|
@ -169,4 +169,4 @@ class TileBreaker extends ResonantTile(Material.iron) with TRotatable with IPack
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -108,7 +108,7 @@ class TilePlacer extends ResonantTile(Material.rock) with TInventory with TRotat
|
|||
def doWork
|
||||
{
|
||||
val side: Int = 0
|
||||
val placePos: Vector3 = position.add(getDirection)
|
||||
val placePos: Vector3 = toVectorWorld.add(getDirection)
|
||||
val placeStack: ItemStack = getStackInSlot(0)
|
||||
if (InventoryUtility.placeItemBlock(world, placePos.xi, placePos.yi, placePos.zi, placeStack, side))
|
||||
{
|
||||
|
@ -172,7 +172,7 @@ class TilePlacer extends ResonantTile(Material.rock) with TInventory with TRotat
|
|||
|
||||
@SideOnly(Side.CLIENT) override def getIcon(access: IBlockAccess, side: Int): IIcon =
|
||||
{
|
||||
val meta: Int = access.getBlockMetadata(x, y, z)
|
||||
val meta: Int = access.getBlockMetadata(x.toInt, y.toInt, z.toInt)
|
||||
if (side == meta)
|
||||
{
|
||||
return TilePlacer.iconFront
|
||||
|
@ -218,4 +218,4 @@ class TilePlacer extends ResonantTile(Material.rock) with TInventory with TRotat
|
|||
GL11.glPopMatrix
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -149,7 +149,7 @@ class NodeGear(parent: PartGear) extends NodeMechanical(parent: PartGear)
|
|||
}
|
||||
|
||||
//It's not a gear. It might be be another tile node
|
||||
val sourceTile = position.add(from).getTileEntity(world)
|
||||
val sourceTile = toVectorWorld.add(from).getTileEntity(world)
|
||||
|
||||
if (sourceTile.isInstanceOf[INodeProvider])
|
||||
{
|
||||
|
@ -189,7 +189,7 @@ class NodeGear(parent: PartGear) extends NodeMechanical(parent: PartGear)
|
|||
val checkPart = otherParent.asInstanceOf[PartGear].tile.partMap(gear.placementSide.ordinal)
|
||||
if (checkPart.isInstanceOf[PartGear])
|
||||
{
|
||||
val requiredDirection = checkPart.asInstanceOf[PartGear].getPosition.subtract(position).toForgeDirection
|
||||
val requiredDirection = checkPart.asInstanceOf[PartGear].getPosition.subtract(toVectorWorld).toForgeDirection
|
||||
return checkPart.asInstanceOf[PartGear].isCenterMultiBlock && otherParent.asInstanceOf[PartGear].placementSide == requiredDirection
|
||||
}
|
||||
}
|
||||
|
@ -219,7 +219,7 @@ class NodeGear(parent: PartGear) extends NodeMechanical(parent: PartGear)
|
|||
}
|
||||
|
||||
//Check for gear outside this block placed on the same plane
|
||||
val otherTile = other.position.getTileEntity
|
||||
val otherTile = other.toVectorWorld.getTileEntity
|
||||
|
||||
if (otherTile.isInstanceOf[TileMultipart])
|
||||
{
|
||||
|
@ -227,7 +227,7 @@ class NodeGear(parent: PartGear) extends NodeMechanical(parent: PartGear)
|
|||
{
|
||||
//We found another gear, but check if we are connecting to the center spaces of the gear
|
||||
//If this is a multiblock, "otherTile" would be the center of that gear, not the adjacent
|
||||
val adjacentTile = position.add(from).getTileEntity
|
||||
val adjacentTile = toVectorWorld.add(from).getTileEntity
|
||||
|
||||
if (adjacentTile.isInstanceOf[TileMultipart])
|
||||
{
|
||||
|
@ -254,7 +254,7 @@ class NodeGear(parent: PartGear) extends NodeMechanical(parent: PartGear)
|
|||
|
||||
override def radius(other: TNodeMechanical): Double =
|
||||
{
|
||||
val deltaPos = other.asInstanceOf[NodeMechanical].position - position
|
||||
val deltaPos = other.asInstanceOf[NodeMechanical].toVectorWorld - toVectorWorld
|
||||
val caseX = gear.placementSide.offsetX != 0 && deltaPos.y == 0 && deltaPos.z == 0
|
||||
val caseY = gear.placementSide.offsetY != 0 && deltaPos.x == 0 && deltaPos.z == 0
|
||||
val caseZ = gear.placementSide.offsetZ != 0 && deltaPos.x == 0 && deltaPos.y == 0
|
||||
|
@ -264,4 +264,4 @@ class NodeGear(parent: PartGear) extends NodeMechanical(parent: PartGear)
|
|||
|
||||
if (gear.getMultiBlock.isConstructed) 1.5 else super.radius(other)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -44,7 +44,7 @@ import resonantengine.lib.render.RenderUtility
|
|||
if (tile.getWorldObj != null)
|
||||
{
|
||||
val dir: ForgeDirection = tile.getDirection
|
||||
if (tile.world.isAirBlock(tile.x + dir.offsetX, tile.y + dir.offsetY, tile.z + dir.offsetZ))
|
||||
if (tile.world.isAirBlock((tile.x + dir.offsetX).toInt, (tile.y + dir.offsetY).toInt, (tile.z + dir.offsetZ).toInt))
|
||||
{
|
||||
GL11.glTranslated(0, 0, (0.4 * Math.sin(angle)) - 0.5)
|
||||
}
|
||||
|
@ -58,4 +58,4 @@ import resonantengine.lib.render.RenderUtility
|
|||
RenderMechanicalPiston.MODEL.renderOnly(staticParts: _*)
|
||||
GL11.glPopMatrix
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -42,7 +42,7 @@ class TileMechanicalPiston extends TileMechanical(Material.piston)
|
|||
super.update
|
||||
if (markRevolve)
|
||||
{
|
||||
val movePosition: Vector3 = position.add(getDirection)
|
||||
val movePosition: Vector3 = toVectorWorld.add(getDirection)
|
||||
if (!hitOreBlock(movePosition))
|
||||
{
|
||||
if (!worldObj.isRemote)
|
||||
|
@ -191,4 +191,4 @@ class TileMechanicalPiston extends TileMechanical(Material.piston)
|
|||
}
|
||||
} */
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@ class NodeGrinder(parent: TileGrindingWheel) extends NodeMechanical(parent: Tile
|
|||
|
||||
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]) (position - other.asInstanceOf[NodeMechanical].position).toArray.sum < 0 else false
|
||||
override def inverseRotation(other: TNodeMechanical): Boolean = if (other.isInstanceOf[NodeGear]) (toVectorWorld - other.asInstanceOf[NodeMechanical].toVectorWorld).toArray.sum < 0 else false
|
||||
|
||||
override def inverseNext(other: TNodeMechanical): Boolean = if (other.isInstanceOf[NodeGear]) (position - other.asInstanceOf[NodeMechanical].position).toArray.sum < 0 else false
|
||||
}
|
||||
override def inverseNext(other: TNodeMechanical): Boolean = if (other.isInstanceOf[NodeGear]) (toVectorWorld - other.asInstanceOf[NodeMechanical].toVectorWorld).toArray.sum < 0 else false
|
||||
}
|
||||
|
|
|
@ -62,7 +62,7 @@ class TileGrindingWheel extends TileMechanical(Material.rock)
|
|||
|
||||
if (grindingItem != null)
|
||||
{
|
||||
if (TileGrindingWheel.grindingTimer.containsKey(grindingItem) && !grindingItem.isDead && position.add(0.5).distance(new Vector3(grindingItem)) < 1)
|
||||
if (TileGrindingWheel.grindingTimer.containsKey(grindingItem) && !grindingItem.isDead && toVectorWorld.add(0.5).distance(new Vector3(grindingItem)) < 1)
|
||||
{
|
||||
val timeLeft: Int = TileGrindingWheel.grindingTimer.decrease(grindingItem)
|
||||
if (timeLeft <= 0)
|
||||
|
@ -208,4 +208,4 @@ class TileGrindingWheel extends TileMechanical(Material.rock)
|
|||
TileGrindingWheel.model.renderOnly("teeth")
|
||||
glPopMatrix()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -69,7 +69,7 @@ class TileMixer extends TileMechanical(Material.iron)
|
|||
{
|
||||
if (x != 0 && z != 0)
|
||||
{
|
||||
val block: Block = position.add(x, 0, z).getBlock(world)
|
||||
val block: Block = toVectorWorld.add(x, 0, z).getBlock(world)
|
||||
if (block != null && !(block.isInstanceOf[IFluidBlock]))
|
||||
{
|
||||
return true
|
||||
|
@ -100,9 +100,9 @@ class TileMixer extends TileMechanical(Material.iron)
|
|||
{
|
||||
val entity: Entity = obj.asInstanceOf[Entity]
|
||||
val originalPosition: Vector3 = new Vector3(entity)
|
||||
val relativePosition: Vector3 = originalPosition - position.add(0.5)
|
||||
val relativePosition: Vector3 = originalPosition - toVectorWorld.add(0.5)
|
||||
relativePosition.transform(new Quaternion(-mechanicalNode.angularVelocity, new Vector3(1, 0, 0)))
|
||||
val newPosition: Vector3 = position + 0.5 + relativePosition
|
||||
val newPosition: Vector3 = toVectorWorld + 0.5 + relativePosition
|
||||
val difference: Vector3 = (newPosition - originalPosition) * 0.5
|
||||
entity.addVelocity(difference.x, difference.y, difference.z)
|
||||
entity.onGround = false
|
||||
|
@ -121,7 +121,7 @@ class TileMixer extends TileMechanical(Material.iron)
|
|||
{
|
||||
TileMixer.MIXER_ITEM_TIMER.put(processingItem, TileMixer.PROCESS_TIME)
|
||||
}
|
||||
if (!processingItem.isDead && (position + 0.5).distance(new Vector3(processingItem)) < 2)
|
||||
if (!processingItem.isDead && (toVectorWorld + 0.5).distance(new Vector3(processingItem)) < 2)
|
||||
{
|
||||
val timeLeft: Int = TileMixer.MIXER_ITEM_TIMER.decrease(processingItem)
|
||||
if (timeLeft <= 0)
|
||||
|
@ -212,4 +212,4 @@ class TileMixer extends TileMechanical(Material.iron)
|
|||
RenderMixer.MODEL.renderAll()
|
||||
glPopMatrix()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ class NodeTurbine(parent: TileTurbine) extends NodeMechanical(parent)
|
|||
*/
|
||||
override def radius(other: TNodeMechanical): Double =
|
||||
{
|
||||
val deltaPos = other.asInstanceOf[NodeMechanical].position - position
|
||||
val deltaPos = other.asInstanceOf[NodeMechanical].toVectorWorld - toVectorWorld
|
||||
|
||||
if (deltaPos.normalize.toForgeDirection == parent.getDirection)
|
||||
return super.radius(other)
|
||||
|
@ -46,4 +46,4 @@ class NodeTurbine(parent: TileTurbine) extends NodeMechanical(parent)
|
|||
override def canConnect(from: ForgeDirection) = from == turbine.getDirection
|
||||
|
||||
def turbine: TileTurbine = getParent.asInstanceOf[TileTurbine]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -93,7 +93,7 @@ class TileTurbine extends TileMechanical(Material.wood) with IMultiBlockStructur
|
|||
return vectors
|
||||
}
|
||||
|
||||
override def getPosition: Vector3 = position
|
||||
override def getPosition: Vector3 = toVectorWorld
|
||||
|
||||
def onMultiBlockChanged()
|
||||
{
|
||||
|
@ -196,4 +196,4 @@ class TileTurbine extends TileMechanical(Material.wood) with IMultiBlockStructur
|
|||
}
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -37,7 +37,7 @@ class TileWaterTurbine extends TileTurbine
|
|||
{
|
||||
if (other.isInstanceOf[NodeMechanical] && !other.isInstanceOf[TileTurbine])
|
||||
{
|
||||
val sourceTile: TileEntity = position.add(from).getTileEntity
|
||||
val sourceTile: TileEntity = toVectorWorld.add(from).getTileEntity
|
||||
|
||||
if (sourceTile.isInstanceOf[INodeProvider])
|
||||
{
|
||||
|
@ -69,7 +69,7 @@ class TileWaterTurbine extends TileTurbine
|
|||
val metadata = worldObj.getBlockMetadata(xCoord, yCoord + 1, zCoord)
|
||||
val isWater = blockAbove == Blocks.water || blockAbove == Blocks.flowing_water
|
||||
|
||||
if (isWater && metadata == 0 && blockBelow.isReplaceable(world, x, y - 1, z))
|
||||
if (isWater && metadata == 0 && blockBelow.isReplaceable(world, x.toInt, y.toInt - 1, z.toInt))
|
||||
{
|
||||
powerTicks = 20
|
||||
worldObj.setBlockToAir(xCoord, yCoord + 1, zCoord)
|
||||
|
@ -86,13 +86,13 @@ class TileWaterTurbine extends TileTurbine
|
|||
{
|
||||
if (dir != currentDir && dir != currentDir.getOpposite)
|
||||
{
|
||||
val check: Vector3 = position.add(dir)
|
||||
val check: Vector3 = toVectorWorld.add(dir)
|
||||
val block = worldObj.getBlock(check.xi, check.yi, check.zi)
|
||||
val metadata: Int = worldObj.getBlockMetadata(check.xi, check.yi, check.zi)
|
||||
|
||||
if (block == Blocks.water || block == Blocks.flowing_water)
|
||||
{
|
||||
val m = ReflectionHelper.findMethod(classOf[BlockLiquid], null, Array[String]("getFlowVector", "func_72202_i"), classOf[IBlockAccess], Integer.TYPE, Integer.TYPE, Integer.TYPE)
|
||||
val m = ReflectionHelper.findMethod(classOf[BlockLiquid], null, Array[String]("getFlowVector", "func_149800_f"), classOf[IBlockAccess], Integer.TYPE, Integer.TYPE, Integer.TYPE)
|
||||
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)
|
||||
|
||||
|
@ -125,4 +125,4 @@ class TileWaterTurbine extends TileTurbine
|
|||
par3List.add(new ItemStack(par1, 1, i))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -65,7 +65,7 @@ class TileWindTurbine extends TileTurbine with IBoilHandler
|
|||
//Break under storm
|
||||
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)))
|
||||
position.setBlockToAir()
|
||||
toVectorWorld.setBlockToAir()
|
||||
}
|
||||
else if (getMultiBlock.isPrimary)
|
||||
{
|
||||
|
@ -247,4 +247,4 @@ class TileWindTurbine extends TileTurbine with IBoilHandler
|
|||
TileWindTurbine.model.renderOnly("SmallHub")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -114,7 +114,7 @@ class TileElectromagnet extends ResonantBlock(Material.iron) with IElectromagnet
|
|||
|
||||
for (dir <- ForgeDirection.VALID_DIRECTIONS)
|
||||
{
|
||||
val check = position + dir
|
||||
val check = toVectorWorld + dir
|
||||
val checkTile = check.getTileEntity(world)
|
||||
|
||||
if (checkTile != null && checkTile.getClass == tile.getClass && check.getBlockMetadata(world) == tile.getBlockMetadata)
|
||||
|
@ -123,7 +123,7 @@ class TileElectromagnet extends ResonantBlock(Material.iron) with IElectromagnet
|
|||
}
|
||||
}
|
||||
|
||||
RenderBlockUtility.tessellateBlockWithConnectedTextures(sideMap, world, x, y, z, tile.getBlockType, null, RenderUtility.getIcon(edgeTexture))
|
||||
RenderBlockUtility.tessellateBlockWithConnectedTextures(sideMap, world, x.toInt, y.toInt, z.toInt, tile.getBlockType, null, RenderUtility.getIcon(edgeTexture))
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@ class GuiAccelerator(player: EntityPlayer, tileEntity: TileAccelerator) extends
|
|||
{
|
||||
this.fontRendererObj.drawString("Accelerator", 40, 10, 4210752)
|
||||
var status: String = ""
|
||||
val position: Vector3 = tileEntity.position + tileEntity.getDirection.getOpposite
|
||||
val position: Vector3 = tileEntity.toVectorWorld + tileEntity.getDirection.getOpposite
|
||||
if (!EntityParticle.canSpawnParticle(this.tileEntity.world, position))
|
||||
{
|
||||
status = "\u00a74Fail to emit; try rotating."
|
||||
|
@ -52,4 +52,4 @@ class GuiAccelerator(player: EntityPlayer, tileEntity: TileAccelerator) extends
|
|||
this.drawSlot(131, 74)
|
||||
this.drawSlot(105, 74)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -68,13 +68,13 @@ class TileAccelerator extends ResonantTile(Material.iron) with TInventory with I
|
|||
//Create new particle if we have materials to spawn it with
|
||||
if (getStackInSlot(0) != null && lastSpawnTick >= 40)
|
||||
{
|
||||
val spawn_vec: Vector3 = position
|
||||
val spawn_vec: Vector3 = toVectorWorld
|
||||
spawn_vec.add(getDirection.getOpposite)
|
||||
spawn_vec.add(0.5f)
|
||||
if (EntityParticle.canSpawnParticle(worldObj, spawn_vec))
|
||||
{
|
||||
totalEnergyConsumed = 0
|
||||
entityParticle = new EntityParticle(worldObj, spawn_vec, position, getDirection.getOpposite)
|
||||
entityParticle = new EntityParticle(worldObj, spawn_vec, toVectorWorld, getDirection.getOpposite)
|
||||
worldObj.spawnEntityInWorld(entityParticle)
|
||||
CalculateParticleDensity
|
||||
decrStackSize(0, 1)
|
||||
|
@ -205,7 +205,7 @@ class TileAccelerator extends ResonantTile(Material.iron) with TInventory with I
|
|||
|
||||
override def getDescPacket: PacketTile =
|
||||
{
|
||||
return new PacketTile(x, y, z, Array[Any](DESC_PACKET_ID, velocity, totalEnergyConsumed, antimatter, energy.value))
|
||||
return new PacketTile(x.toInt, y.toInt, z.toInt, Array[Any](DESC_PACKET_ID, velocity, totalEnergyConsumed, antimatter, energy.value))
|
||||
}
|
||||
|
||||
/////////////////////////////////////////
|
||||
|
@ -223,7 +223,7 @@ class TileAccelerator extends ResonantTile(Material.iron) with TInventory with I
|
|||
|
||||
override def activate(player: EntityPlayer, side: Int, hit: Vector3): Boolean =
|
||||
{
|
||||
player.openGui(Electrodynamics, 0, world, x, y, z)
|
||||
player.openGui(Electrodynamics, 0, world, x.toInt, y.toInt, z.toInt)
|
||||
return true
|
||||
}
|
||||
|
||||
|
@ -319,4 +319,4 @@ class TileAccelerator extends ResonantTile(Material.iron) with TInventory with I
|
|||
{
|
||||
world.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, direction.ordinal, 3)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -171,8 +171,8 @@ class TileNuclearBoiler extends ResonantTile(Material.iron) with TInventory with
|
|||
|
||||
def read(data: ByteBuf, player: EntityPlayer, `type`: PacketType)
|
||||
{
|
||||
this.waterTank.setFluid(new FluidStack(QuantumContent.fluidStackWater.fluidID, data.readInt))
|
||||
this.gasTank.setFluid(new FluidStack(QuantumContent.fluidStackUraniumHexaflouride.fluidID, data.readInt))
|
||||
this.waterTank.setFluid(new FluidStack(QuantumContent.fluidStackWater.getFluidID, data.readInt))
|
||||
this.gasTank.setFluid(new FluidStack(QuantumContent.fluidStackUraniumHexaflouride.getFluidID, data.readInt))
|
||||
this.timer = data.readInt
|
||||
}
|
||||
|
||||
|
@ -183,7 +183,7 @@ class TileNuclearBoiler extends ResonantTile(Material.iron) with TInventory with
|
|||
|
||||
override def getDescPacket: PacketTile =
|
||||
{
|
||||
return new PacketTile(x, y, z, Array[Any](this.timer, QuantumContent.getFluidAmount(this.waterTank.getFluid), QuantumContent.getFluidAmount(this.gasTank.getFluid)))
|
||||
return new PacketTile(x.toInt, y.toInt, z.toInt, Array[Any](this.timer, QuantumContent.getFluidAmount(this.waterTank.getFluid), QuantumContent.getFluidAmount(this.gasTank.getFluid)))
|
||||
}
|
||||
|
||||
override def use(player: EntityPlayer, side: Int, hit: Vector3): Boolean =
|
||||
|
@ -242,12 +242,12 @@ class TileNuclearBoiler extends ResonantTile(Material.iron) with TInventory with
|
|||
|
||||
def canFill(from: ForgeDirection, fluid: Fluid): Boolean =
|
||||
{
|
||||
return QuantumContent.fluidStackWater.fluidID == fluid.getID
|
||||
return QuantumContent.fluidStackWater.getFluidID == fluid.getID
|
||||
}
|
||||
|
||||
def canDrain(from: ForgeDirection, fluid: Fluid): Boolean =
|
||||
{
|
||||
return QuantumContent.fluidStackUraniumHexaflouride.fluidID == fluid.getID
|
||||
return QuantumContent.fluidStackUraniumHexaflouride.getFluidID == fluid.getID
|
||||
}
|
||||
|
||||
def getTankInfo(from: ForgeDirection): Array[FluidTankInfo] =
|
||||
|
@ -285,4 +285,4 @@ class TileNuclearBoiler extends ResonantTile(Material.iron) with TInventory with
|
|||
{
|
||||
return slotID == 2
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -58,7 +58,7 @@ class TileCentrifuge extends ResonantTile(Material.iron) with TInventory with TB
|
|||
for (i <- 0 to 6)
|
||||
{
|
||||
val direction: ForgeDirection = ForgeDirection.getOrientation(i)
|
||||
val tileEntity: TileEntity = position.add(direction).getTileEntity(world)
|
||||
val tileEntity: TileEntity = toVectorWorld.add(direction).getTileEntity(world)
|
||||
if (tileEntity.isInstanceOf[IFluidHandler] && tileEntity.getClass != this.getClass)
|
||||
{
|
||||
val fluidHandler: IFluidHandler = (tileEntity.asInstanceOf[IFluidHandler])
|
||||
|
@ -159,13 +159,13 @@ class TileCentrifuge extends ResonantTile(Material.iron) with TInventory with TB
|
|||
def read(data: ByteBuf, player: EntityPlayer, `type`: PacketType)
|
||||
{
|
||||
this.timer = data.readInt
|
||||
this.gasTank.setFluid(new FluidStack(QuantumContent.fluidStackUraniumHexaflouride.fluidID, data.readInt))
|
||||
this.gasTank.setFluid(new FluidStack(QuantumContent.fluidStackUraniumHexaflouride.getFluidID, data.readInt))
|
||||
|
||||
}
|
||||
|
||||
override def getDescPacket: PacketTile =
|
||||
{
|
||||
return new PacketTile(x, y, z, Array[Any](this.timer, QuantumContent.getFluidAmount(this.gasTank.getFluid)))
|
||||
return new PacketTile(x.toInt, y.toInt, z.toInt, Array[Any](this.timer, QuantumContent.getFluidAmount(this.gasTank.getFluid)))
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -218,7 +218,7 @@ class TileCentrifuge extends ResonantTile(Material.iron) with TInventory with TB
|
|||
|
||||
def canFill(from: ForgeDirection, fluid: Fluid): Boolean =
|
||||
{
|
||||
return QuantumContent.fluidStackUraniumHexaflouride.fluidID == fluid.getID
|
||||
return QuantumContent.fluidStackUraniumHexaflouride.getFluidID == fluid.getID
|
||||
}
|
||||
|
||||
def canDrain(from: ForgeDirection, fluid: Fluid): Boolean =
|
||||
|
@ -264,4 +264,4 @@ class TileCentrifuge extends ResonantTile(Material.iron) with TInventory with TB
|
|||
{
|
||||
return slotID == 2 || slotID == 3
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -58,7 +58,7 @@ class TilePlasma extends ResonantTile(Material.lava)
|
|||
override def update
|
||||
{
|
||||
super.update
|
||||
GridThermal.addHeat(position, ((temperature - GridThermal.getTemperature(position)) * 0.1f).asInstanceOf[Float])
|
||||
GridThermal.addHeat(toVectorWorld, ((temperature - GridThermal.getTemperature(toVectorWorld)) * 0.1f).asInstanceOf[Float])
|
||||
if (ticks % 20 == 0)
|
||||
{
|
||||
temperature /= 1.5
|
||||
|
@ -71,7 +71,7 @@ class TilePlasma extends ResonantTile(Material.lava)
|
|||
{
|
||||
if (worldObj.rand.nextFloat < 0.4)
|
||||
{
|
||||
val diDian: Vector3 = position
|
||||
val diDian: Vector3 = toVectorWorld
|
||||
diDian.add(ForgeDirection.getOrientation(i))
|
||||
val tileEntity: TileEntity = diDian.getTileEntity(worldObj)
|
||||
if (!(tileEntity.isInstanceOf[TilePlasma]))
|
||||
|
@ -88,4 +88,4 @@ class TilePlasma extends ResonantTile(Material.lava)
|
|||
temperature = newTemperature
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -64,7 +64,7 @@ class TilePlasmaHeater extends ResonantTile(Material.iron) with TBlockNodeProvid
|
|||
}
|
||||
if (ticks % 80 == 0)
|
||||
{
|
||||
world.markBlockForUpdate(x, y, z)
|
||||
world.markBlockForUpdate(x.toInt, y.toInt, z.toInt)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -191,7 +191,7 @@ class TilePlasmaHeater extends ResonantTile(Material.iron) with TBlockNodeProvid
|
|||
|
||||
override def use(player: EntityPlayer, side: Int, hit: Vector3): Boolean =
|
||||
{
|
||||
return FluidUtility.playerActivatedFluidItem(world, x, y, z, player, side)
|
||||
return FluidUtility.playerActivatedFluidItem(world, x.toInt, y.toInt, z.toInt, player, side)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -59,7 +59,7 @@ class TileQuantumAssembler extends ResonantTile(Material.iron) with TInventory w
|
|||
{
|
||||
if (!world.isRemote)
|
||||
{
|
||||
player.openGui(QuantumContent, 0, world, x, y, z)
|
||||
player.openGui(QuantumContent, 0, world, x.toInt, y.toInt, z.toInt)
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
@ -195,9 +195,9 @@ class TileQuantumAssembler extends ResonantTile(Material.iron) with TInventory w
|
|||
{
|
||||
if (this.getStackInSlot(6) != null)
|
||||
{
|
||||
return new PacketTile(x, y, z, Array[Any](time, getStackInSlot(6)))
|
||||
return new PacketTile(x.toInt, y.toInt, z.toInt, Array[Any](time, getStackInSlot(6)))
|
||||
}
|
||||
return new PacketTile(x, y, z, Array[Any](time, -1, -1, -1))
|
||||
return new PacketTile(x.toInt, y.toInt, z.toInt, Array[Any](time, -1, -1, -1))
|
||||
}
|
||||
|
||||
override def readFromNBT(nbt: NBTTagCompound)
|
||||
|
@ -220,4 +220,4 @@ class TileQuantumAssembler extends ResonantTile(Material.iron) with TInventory w
|
|||
}
|
||||
return itemStack.getItem eq QuantumContent.itemDarkMatter
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -106,7 +106,7 @@ class TileThermometer extends ResonantTile(Material.piston) with SimpleComponent
|
|||
|
||||
override def onRemove(block: Block, par6: Int)
|
||||
{
|
||||
val stack: ItemStack = ItemBlockSaved.getItemStackWithNBT(getBlockType, world, x, y, z)
|
||||
val stack: ItemStack = ItemBlockSaved.getItemStackWithNBT(getBlockType, world, x.toInt, y.toInt, z.toInt)
|
||||
InventoryUtility.dropItemStack(world, center, stack)
|
||||
}
|
||||
|
||||
|
@ -123,7 +123,7 @@ class TileThermometer extends ResonantTile(Material.piston) with SimpleComponent
|
|||
}
|
||||
else
|
||||
{
|
||||
detectedTemperature = GridThermal.getTemperature(position)
|
||||
detectedTemperature = GridThermal.getTemperature(toVectorWorld)
|
||||
}
|
||||
if (detectedTemperature != previousDetectedTemperature || isProvidingPower != this.isOverThreshold)
|
||||
{
|
||||
|
@ -229,4 +229,4 @@ class TileThermometer extends ResonantTile(Material.piston) with SimpleComponent
|
|||
{
|
||||
return "Thermometer"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -75,8 +75,8 @@ class TileReactorCell extends TileInventory(Material.iron) with IMultiBlockStruc
|
|||
mainTile.getMultiBlock.deconstruct()
|
||||
mainTile.getMultiBlock.construct()
|
||||
|
||||
val top = (position + new Vector3(0, 1, 0)).getTileEntity(worldObj).isInstanceOf[TileReactorCell]
|
||||
val bottom = (position + new Vector3(0, -1, 0)).getTileEntity(worldObj).isInstanceOf[TileReactorCell]
|
||||
val top = (toVectorWorld + new Vector3(0, 1, 0)).getTileEntity(worldObj).isInstanceOf[TileReactorCell]
|
||||
val bottom = (toVectorWorld + new Vector3(0, -1, 0)).getTileEntity(worldObj).isInstanceOf[TileReactorCell]
|
||||
|
||||
if (top && bottom)
|
||||
{
|
||||
|
@ -98,7 +98,7 @@ class TileReactorCell extends TileInventory(Material.iron) with IMultiBlockStruc
|
|||
def getLowest: TileReactorCell =
|
||||
{
|
||||
var lowest: TileReactorCell = this
|
||||
val checkPosition: Vector3 = position
|
||||
val checkPosition: Vector3 = toVectorWorld
|
||||
while (true)
|
||||
{
|
||||
val t: TileEntity = checkPosition.getTileEntity(this.worldObj)
|
||||
|
@ -190,7 +190,7 @@ class TileReactorCell extends TileInventory(Material.iron) with IMultiBlockStruc
|
|||
val entities = worldObj.getEntitiesWithinAABB(classOf[EntityLiving], AxisAlignedBB.getBoundingBox(xCoord - TileReactorCell.radius * 2, yCoord - TileReactorCell.radius * 2, zCoord - TileReactorCell.radius * 2, xCoord + TileReactorCell.radius * 2, yCoord + TileReactorCell.radius * 2, zCoord + TileReactorCell.radius * 2)).asInstanceOf[List[EntityLiving]]
|
||||
for (entity <- entities)
|
||||
{
|
||||
PoisonRadiation.INSTANCE.poisonEntity(position, entity)
|
||||
PoisonRadiation.INSTANCE.poisonEntity(toVectorWorld, entity)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -200,9 +200,9 @@ class TileReactorCell extends TileInventory(Material.iron) with IMultiBlockStruc
|
|||
/**
|
||||
* Heats up the surroundings. Control rods absorbs neutrons, reducing the heat produced.
|
||||
*/
|
||||
val controlRodCount = ForgeDirection.VALID_DIRECTIONS.map(position + _).count(_.getBlock == QuantumContent.blockControlRod)
|
||||
GridThermal.addHeat(position, internalEnergy / ((controlRodCount + 1) * 0.3))
|
||||
val temperature = GridThermal.getTemperature(position)
|
||||
val controlRodCount = ForgeDirection.VALID_DIRECTIONS.map(toVectorWorld + _).count(_.getBlock == QuantumContent.blockControlRod)
|
||||
GridThermal.addHeat(toVectorWorld, internalEnergy / ((controlRodCount + 1) * 0.3))
|
||||
val temperature = GridThermal.getTemperature(toVectorWorld)
|
||||
|
||||
internalEnergy = 0
|
||||
|
||||
|
@ -233,7 +233,7 @@ class TileReactorCell extends TileInventory(Material.iron) with IMultiBlockStruc
|
|||
}
|
||||
else
|
||||
{
|
||||
val temperature = GridThermal.getTemperature(position)
|
||||
val temperature = GridThermal.getTemperature(toVectorWorld)
|
||||
|
||||
if (world.rand.nextInt(5) == 0 && temperature >= 373)
|
||||
{
|
||||
|
@ -255,7 +255,7 @@ class TileReactorCell extends TileInventory(Material.iron) with IMultiBlockStruc
|
|||
override def getMultiBlockVectors: java.lang.Iterable[Vector3] =
|
||||
{
|
||||
val vectors: List[Vector3] = new util.ArrayList[Vector3]
|
||||
val checkPosition: Vector3 = position
|
||||
val checkPosition: Vector3 = toVectorWorld
|
||||
while (true)
|
||||
{
|
||||
val t: TileEntity = checkPosition.getTileEntity(this.worldObj)
|
||||
|
@ -274,7 +274,7 @@ class TileReactorCell extends TileInventory(Material.iron) with IMultiBlockStruc
|
|||
|
||||
def getPosition: Vector3 =
|
||||
{
|
||||
return position
|
||||
return toVectorWorld
|
||||
}
|
||||
|
||||
override def readFromNBT(nbt: NBTTagCompound)
|
||||
|
@ -340,7 +340,7 @@ class TileReactorCell extends TileInventory(Material.iron) with IMultiBlockStruc
|
|||
GL11.glTranslated(pos.x + 0.5, pos.y + 0.5, pos.z + 0.5)
|
||||
val meta = if (frame != 0) metadata else 2
|
||||
|
||||
val hasBelow = if (frame != 0) world.getTileEntity(x, y - 1, z).isInstanceOf[TileReactorCell] else false
|
||||
val hasBelow = if (frame != 0) world.getTileEntity(x.toInt, y.toInt - 1, z.toInt).isInstanceOf[TileReactorCell] else false
|
||||
|
||||
if (meta == 0)
|
||||
{
|
||||
|
@ -396,7 +396,7 @@ class TileReactorCell extends TileInventory(Material.iron) with IMultiBlockStruc
|
|||
def getHeight: Int =
|
||||
{
|
||||
var height: Int = 0
|
||||
val checkPosition: Vector3 = position
|
||||
val checkPosition: Vector3 = toVectorWorld
|
||||
var tile: TileEntity = this
|
||||
while (tile.isInstanceOf[TileReactorCell])
|
||||
{
|
||||
|
@ -450,4 +450,4 @@ class TileReactorCell extends TileInventory(Material.iron) with IMultiBlockStruc
|
|||
world.createExplosion(null, x + 0.5, y + 0.5, z + 0.5, 3, false)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue