Changed ItemElectric to TEnergyItemE
This commit is contained in:
parent
6c7c403fe9
commit
a46277b9a0
|
@ -31,7 +31,6 @@ import resonantengine.api.tile.IRotatable
|
||||||
import resonantengine.core.ResonantEngine
|
import resonantengine.core.ResonantEngine
|
||||||
import resonantengine.core.network.discriminator.{PacketTile, PacketType}
|
import resonantengine.core.network.discriminator.{PacketTile, PacketType}
|
||||||
import resonantengine.lib.collection.Pair
|
import resonantengine.lib.collection.Pair
|
||||||
import resonantengine.lib.prefab.gui.ContainerDummy
|
|
||||||
import resonantengine.lib.render.RenderItemOverlayUtility
|
import resonantengine.lib.render.RenderItemOverlayUtility
|
||||||
import resonantengine.lib.transform.region.Cuboid
|
import resonantengine.lib.transform.region.Cuboid
|
||||||
import resonantengine.lib.transform.vector.{Vector2, Vector3}
|
import resonantengine.lib.transform.vector.{Vector2, Vector3}
|
||||||
|
@ -40,6 +39,7 @@ import resonantengine.lib.utility.inventory.AutoCraftingManager.IAutoCrafter
|
||||||
import resonantengine.lib.utility.inventory.{AutoCraftingManager, InventoryUtility}
|
import resonantengine.lib.utility.inventory.{AutoCraftingManager, InventoryUtility}
|
||||||
import resonantengine.prefab.block.itemblock.ItemBlockSaved
|
import resonantengine.prefab.block.itemblock.ItemBlockSaved
|
||||||
import resonantengine.prefab.block.mixed.TileInventory
|
import resonantengine.prefab.block.mixed.TileInventory
|
||||||
|
import resonantengine.prefab.gui.ContainerDummy
|
||||||
|
|
||||||
import scala.collection.JavaConversions._
|
import scala.collection.JavaConversions._
|
||||||
|
|
||||||
|
@ -129,129 +129,6 @@ class TileEngineeringTable extends TileInventory(Material.wood) with IPacketRece
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override def getSizeInventory: Int =
|
|
||||||
{
|
|
||||||
return 10 + (if (this.invPlayer != null) this.invPlayer.getSizeInventory else 0)
|
|
||||||
}
|
|
||||||
|
|
||||||
override def setInventorySlotContents(slot: Int, itemStack: ItemStack)
|
|
||||||
{
|
|
||||||
if (slot < TileEngineeringTable.CRAFTING_MATRIX_END)
|
|
||||||
{
|
|
||||||
craftingMatrix(slot) = itemStack
|
|
||||||
}
|
|
||||||
else if (slot < TileEngineeringTable.CRAFTING_OUTPUT_END)
|
|
||||||
{
|
|
||||||
outputInventory(slot - TileEngineeringTable.CRAFTING_MATRIX_END) = itemStack
|
|
||||||
}
|
|
||||||
else if (slot < TileEngineeringTable.PLAYER_OUTPUT_END && this.invPlayer != null)
|
|
||||||
{
|
|
||||||
this.invPlayer.setInventorySlotContents(slot - TileEngineeringTable.CRAFTING_OUTPUT_END, itemStack)
|
|
||||||
val player: EntityPlayer = this.invPlayer.player
|
|
||||||
if (player.isInstanceOf[EntityPlayerMP])
|
|
||||||
{
|
|
||||||
(player.asInstanceOf[EntityPlayerMP]).sendContainerToPlayer(player.inventoryContainer)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (searchInventories)
|
|
||||||
{
|
|
||||||
var idDisplacement: Int = TileEngineeringTable.PLAYER_OUTPUT_END
|
|
||||||
for (dir <- ForgeDirection.VALID_DIRECTIONS)
|
|
||||||
{
|
|
||||||
val tile: TileEntity = toVectorWorld.add(dir).getTileEntity
|
|
||||||
if (tile.isInstanceOf[IInventory])
|
|
||||||
{
|
|
||||||
val inventory: IInventory = tile.asInstanceOf[IInventory]
|
|
||||||
val slotID: Int = slot - idDisplacement
|
|
||||||
if (slotID >= 0 && slotID < inventory.getSizeInventory)
|
|
||||||
{
|
|
||||||
inventory.setInventorySlotContents(slotID, itemStack)
|
|
||||||
}
|
|
||||||
idDisplacement += inventory.getSizeInventory
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
onInventoryChanged
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Updates all the output slots. Call this to update the Engineering Table.
|
|
||||||
*/
|
|
||||||
override def onInventoryChanged
|
|
||||||
{
|
|
||||||
if (worldObj != null)
|
|
||||||
{
|
|
||||||
if (!worldObj.isRemote)
|
|
||||||
{
|
|
||||||
this.outputInventory(TileEngineeringTable.CRAFTING_OUTPUT_SLOT) = null
|
|
||||||
var didCraft: Boolean = false
|
|
||||||
val inventoryCrafting: InventoryCrafting = this.getCraftingMatrix
|
|
||||||
val matrixOutput: ItemStack = CraftingManager.getInstance.findMatchingRecipe(inventoryCrafting, this.worldObj)
|
|
||||||
if (matrixOutput != null && this.getCraftingManager.getIdealRecipe(matrixOutput) != null)
|
|
||||||
{
|
|
||||||
this.outputInventory(TileEngineeringTable.CRAFTING_OUTPUT_SLOT) = matrixOutput
|
|
||||||
didCraft = true
|
|
||||||
}
|
|
||||||
if (!didCraft)
|
|
||||||
{
|
|
||||||
val filterStack: ItemStack = craftingMatrix(TileEngineeringTable.CENTER_SLOT)
|
|
||||||
if (filterStack != null && filterStack.getItem.isInstanceOf[ItemImprint])
|
|
||||||
{
|
|
||||||
val filters: java.util.List[ItemStack] = ItemImprint.getFilters(filterStack)
|
|
||||||
for (o <- filters)
|
|
||||||
{
|
|
||||||
val outputStack: ItemStack = o
|
|
||||||
if (outputStack != null)
|
|
||||||
{
|
|
||||||
val idealRecipe: Pair[ItemStack, Array[ItemStack]] = this.getCraftingManager.getIdealRecipe(outputStack)
|
|
||||||
if (idealRecipe != null)
|
|
||||||
{
|
|
||||||
val recipeOutput: ItemStack = idealRecipe.left
|
|
||||||
if (recipeOutput != null & recipeOutput.stackSize > 0)
|
|
||||||
{
|
|
||||||
this.outputInventory(TileEngineeringTable.CRAFTING_OUTPUT_SLOT) = recipeOutput
|
|
||||||
didCraft = true
|
|
||||||
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the AutoCraftingManager that does all the crafting results
|
|
||||||
*/
|
|
||||||
def getCraftingManager: AutoCraftingManager =
|
|
||||||
{
|
|
||||||
if (craftManager == null)
|
|
||||||
{
|
|
||||||
craftManager = new AutoCraftingManager(this)
|
|
||||||
}
|
|
||||||
return craftManager
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Construct an InventoryCrafting Matrix on the fly.
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
def getCraftingMatrix: InventoryCrafting =
|
|
||||||
{
|
|
||||||
val inventoryCrafting: InventoryCrafting = new InventoryCrafting(new ContainerDummy(this), 3, 3)
|
|
||||||
|
|
||||||
for (i <- 0 until this.craftingMatrix.length)
|
|
||||||
{
|
|
||||||
inventoryCrafting.setInventorySlotContents(i, this.craftingMatrix(i))
|
|
||||||
}
|
|
||||||
return inventoryCrafting
|
|
||||||
}
|
|
||||||
|
|
||||||
override def use(player: EntityPlayer, hitSide: Int, hit: Vector3): Boolean =
|
override def use(player: EntityPlayer, hitSide: Int, hit: Vector3): Boolean =
|
||||||
{
|
{
|
||||||
if (player.getCurrentEquippedItem != null && player.getCurrentEquippedItem.getItem.isInstanceOf[ItemHammer])
|
if (player.getCurrentEquippedItem != null && player.getCurrentEquippedItem.getItem.isInstanceOf[ItemHammer])
|
||||||
|
@ -453,6 +330,49 @@ class TileEngineeringTable extends TileInventory(Material.wood) with IPacketRece
|
||||||
nbt.setBoolean("searchInventories", this.searchInventories)
|
nbt.setBoolean("searchInventories", this.searchInventories)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override def getSizeInventory: Int =
|
||||||
|
{
|
||||||
|
return 10 + (if (this.invPlayer != null) this.invPlayer.getSizeInventory else 0)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* DO NOT USE THIS INTERNALLY. FOR EXTERNAL USE ONLY!
|
||||||
|
*/
|
||||||
|
override def getStackInSlot(slot: Int): ItemStack =
|
||||||
|
{
|
||||||
|
if (slot < TileEngineeringTable.CRAFTING_MATRIX_END)
|
||||||
|
{
|
||||||
|
return this.craftingMatrix(slot)
|
||||||
|
}
|
||||||
|
else if (slot < TileEngineeringTable.CRAFTING_OUTPUT_END)
|
||||||
|
{
|
||||||
|
return outputInventory(slot - TileEngineeringTable.CRAFTING_MATRIX_END)
|
||||||
|
}
|
||||||
|
else if (slot < TileEngineeringTable.PLAYER_OUTPUT_END && invPlayer != null)
|
||||||
|
{
|
||||||
|
return this.invPlayer.getStackInSlot(slot - TileEngineeringTable.CRAFTING_OUTPUT_END)
|
||||||
|
}
|
||||||
|
else if (searchInventories)
|
||||||
|
{
|
||||||
|
var idDisplacement: Int = TileEngineeringTable.PLAYER_OUTPUT_END
|
||||||
|
for (dir <- ForgeDirection.VALID_DIRECTIONS)
|
||||||
|
{
|
||||||
|
val tile: TileEntity = toVectorWorld.add(dir).getTileEntity
|
||||||
|
if (tile.isInstanceOf[IInventory])
|
||||||
|
{
|
||||||
|
val inventory: IInventory = tile.asInstanceOf[IInventory]
|
||||||
|
val slotID: Int = slot - idDisplacement
|
||||||
|
if (slotID >= 0 && slotID < inventory.getSizeInventory)
|
||||||
|
{
|
||||||
|
return inventory.getStackInSlot(slotID)
|
||||||
|
}
|
||||||
|
idDisplacement += inventory.getSizeInventory
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
def read(data: ByteBuf, player: EntityPlayer, `type`: PacketType)
|
def read(data: ByteBuf, player: EntityPlayer, `type`: PacketType)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
@ -536,6 +456,124 @@ class TileEngineeringTable extends TileInventory(Material.wood) with IPacketRece
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override def setInventorySlotContents(slot: Int, itemStack: ItemStack)
|
||||||
|
{
|
||||||
|
if (slot < TileEngineeringTable.CRAFTING_MATRIX_END)
|
||||||
|
{
|
||||||
|
craftingMatrix(slot) = itemStack
|
||||||
|
}
|
||||||
|
else if (slot < TileEngineeringTable.CRAFTING_OUTPUT_END)
|
||||||
|
{
|
||||||
|
outputInventory(slot - TileEngineeringTable.CRAFTING_MATRIX_END) = itemStack
|
||||||
|
}
|
||||||
|
else if (slot < TileEngineeringTable.PLAYER_OUTPUT_END && this.invPlayer != null)
|
||||||
|
{
|
||||||
|
this.invPlayer.setInventorySlotContents(slot - TileEngineeringTable.CRAFTING_OUTPUT_END, itemStack)
|
||||||
|
val player: EntityPlayer = this.invPlayer.player
|
||||||
|
if (player.isInstanceOf[EntityPlayerMP])
|
||||||
|
{
|
||||||
|
(player.asInstanceOf[EntityPlayerMP]).sendContainerToPlayer(player.inventoryContainer)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (searchInventories)
|
||||||
|
{
|
||||||
|
var idDisplacement: Int = TileEngineeringTable.PLAYER_OUTPUT_END
|
||||||
|
for (dir <- ForgeDirection.VALID_DIRECTIONS)
|
||||||
|
{
|
||||||
|
val tile: TileEntity = toVectorWorld.add(dir).getTileEntity
|
||||||
|
if (tile.isInstanceOf[IInventory])
|
||||||
|
{
|
||||||
|
val inventory: IInventory = tile.asInstanceOf[IInventory]
|
||||||
|
val slotID: Int = slot - idDisplacement
|
||||||
|
if (slotID >= 0 && slotID < inventory.getSizeInventory)
|
||||||
|
{
|
||||||
|
inventory.setInventorySlotContents(slotID, itemStack)
|
||||||
|
}
|
||||||
|
idDisplacement += inventory.getSizeInventory
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
onInventoryChanged
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Updates all the output slots. Call this to update the Engineering Table.
|
||||||
|
*/
|
||||||
|
override def onInventoryChanged
|
||||||
|
{
|
||||||
|
if (worldObj != null)
|
||||||
|
{
|
||||||
|
if (!worldObj.isRemote)
|
||||||
|
{
|
||||||
|
this.outputInventory(TileEngineeringTable.CRAFTING_OUTPUT_SLOT) = null
|
||||||
|
var didCraft: Boolean = false
|
||||||
|
val inventoryCrafting: InventoryCrafting = this.getCraftingMatrix
|
||||||
|
val matrixOutput: ItemStack = CraftingManager.getInstance.findMatchingRecipe(inventoryCrafting, this.worldObj)
|
||||||
|
if (matrixOutput != null && this.getCraftingManager.getIdealRecipe(matrixOutput) != null)
|
||||||
|
{
|
||||||
|
this.outputInventory(TileEngineeringTable.CRAFTING_OUTPUT_SLOT) = matrixOutput
|
||||||
|
didCraft = true
|
||||||
|
}
|
||||||
|
if (!didCraft)
|
||||||
|
{
|
||||||
|
val filterStack: ItemStack = craftingMatrix(TileEngineeringTable.CENTER_SLOT)
|
||||||
|
if (filterStack != null && filterStack.getItem.isInstanceOf[ItemImprint])
|
||||||
|
{
|
||||||
|
val filters: java.util.List[ItemStack] = ItemImprint.getFilters(filterStack)
|
||||||
|
for (o <- filters)
|
||||||
|
{
|
||||||
|
val outputStack: ItemStack = o
|
||||||
|
if (outputStack != null)
|
||||||
|
{
|
||||||
|
val idealRecipe: Pair[ItemStack, Array[ItemStack]] = this.getCraftingManager.getIdealRecipe(outputStack)
|
||||||
|
if (idealRecipe != null)
|
||||||
|
{
|
||||||
|
val recipeOutput: ItemStack = idealRecipe.left
|
||||||
|
if (recipeOutput != null & recipeOutput.stackSize > 0)
|
||||||
|
{
|
||||||
|
this.outputInventory(TileEngineeringTable.CRAFTING_OUTPUT_SLOT) = recipeOutput
|
||||||
|
didCraft = true
|
||||||
|
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the AutoCraftingManager that does all the crafting results
|
||||||
|
*/
|
||||||
|
def getCraftingManager: AutoCraftingManager =
|
||||||
|
{
|
||||||
|
if (craftManager == null)
|
||||||
|
{
|
||||||
|
craftManager = new AutoCraftingManager(this)
|
||||||
|
}
|
||||||
|
return craftManager
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Construct an InventoryCrafting Matrix on the fly.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
def getCraftingMatrix: InventoryCrafting =
|
||||||
|
{
|
||||||
|
val inventoryCrafting: InventoryCrafting = new InventoryCrafting(new ContainerDummy(this), 3, 3)
|
||||||
|
|
||||||
|
for (i <- 0 until this.craftingMatrix.length)
|
||||||
|
{
|
||||||
|
inventoryCrafting.setInventorySlotContents(i, this.craftingMatrix(i))
|
||||||
|
}
|
||||||
|
return inventoryCrafting
|
||||||
|
}
|
||||||
|
|
||||||
override def isItemValidForSlot(i: Int, itemstack: ItemStack): Boolean =
|
override def isItemValidForSlot(i: Int, itemstack: ItemStack): Boolean =
|
||||||
{
|
{
|
||||||
return true
|
return true
|
||||||
|
@ -583,44 +621,6 @@ class TileEngineeringTable extends TileInventory(Material.wood) with IPacketRece
|
||||||
return slot == optimalSlot
|
return slot == optimalSlot
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* DO NOT USE THIS INTERNALLY. FOR EXTERNAL USE ONLY!
|
|
||||||
*/
|
|
||||||
override def getStackInSlot(slot: Int): ItemStack =
|
|
||||||
{
|
|
||||||
if (slot < TileEngineeringTable.CRAFTING_MATRIX_END)
|
|
||||||
{
|
|
||||||
return this.craftingMatrix(slot)
|
|
||||||
}
|
|
||||||
else if (slot < TileEngineeringTable.CRAFTING_OUTPUT_END)
|
|
||||||
{
|
|
||||||
return outputInventory(slot - TileEngineeringTable.CRAFTING_MATRIX_END)
|
|
||||||
}
|
|
||||||
else if (slot < TileEngineeringTable.PLAYER_OUTPUT_END && invPlayer != null)
|
|
||||||
{
|
|
||||||
return this.invPlayer.getStackInSlot(slot - TileEngineeringTable.CRAFTING_OUTPUT_END)
|
|
||||||
}
|
|
||||||
else if (searchInventories)
|
|
||||||
{
|
|
||||||
var idDisplacement: Int = TileEngineeringTable.PLAYER_OUTPUT_END
|
|
||||||
for (dir <- ForgeDirection.VALID_DIRECTIONS)
|
|
||||||
{
|
|
||||||
val tile: TileEntity = toVectorWorld.add(dir).getTileEntity
|
|
||||||
if (tile.isInstanceOf[IInventory])
|
|
||||||
{
|
|
||||||
val inventory: IInventory = tile.asInstanceOf[IInventory]
|
|
||||||
val slotID: Int = slot - idDisplacement
|
|
||||||
if (slotID >= 0 && slotID < inventory.getSizeInventory)
|
|
||||||
{
|
|
||||||
return inventory.getStackInSlot(slotID)
|
|
||||||
}
|
|
||||||
idDisplacement += inventory.getSizeInventory
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return null
|
|
||||||
}
|
|
||||||
|
|
||||||
override def canExtractItem(slot: Int, itemstack: ItemStack, side: Int): Boolean =
|
override def canExtractItem(slot: Int, itemstack: ItemStack, side: Int): Boolean =
|
||||||
{
|
{
|
||||||
val outputStack: ItemStack = getStackInSlot(TileEngineeringTable.CRAFTING_MATRIX_END)
|
val outputStack: ItemStack = getStackInSlot(TileEngineeringTable.CRAFTING_MATRIX_END)
|
||||||
|
|
|
@ -82,7 +82,7 @@ class TileGrate extends TileFluidProvider(Material.rock) with TRotatable
|
||||||
{
|
{
|
||||||
val pressure = fluidNode.asInstanceOf[NodeFluidPressure].pressure(getDirection)
|
val pressure = fluidNode.asInstanceOf[NodeFluidPressure].pressure(getDirection)
|
||||||
val blockEffect = Math.abs(pressure * grateEffectMultiplier).toInt
|
val blockEffect = Math.abs(pressure * grateEffectMultiplier).toInt
|
||||||
fluidNode.getPrimaryTank.setCapacity(Math.max(blockEffect * FluidContainerRegistry.BUCKET_VOLUME * grateDrainSpeedMultiplier, FluidContainerRegistry.BUCKET_VOLUME).toInt)
|
fluidNode.getTank.setCapacity(Math.max(blockEffect * FluidContainerRegistry.BUCKET_VOLUME * grateDrainSpeedMultiplier, FluidContainerRegistry.BUCKET_VOLUME).toInt)
|
||||||
|
|
||||||
if (pressure > 0)
|
if (pressure > 0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -12,8 +12,8 @@ class NodeFluidGravity(parent: TileFluidProvider, volume: Int = FluidContainerRe
|
||||||
{
|
{
|
||||||
override protected def doDistribute(deltaTime: Double, dir: ForgeDirection, nodeA: NodeFluidPressure, nodeB: NodeFluidPressure, flowRate: Int)
|
override protected def doDistribute(deltaTime: Double, dir: ForgeDirection, nodeA: NodeFluidPressure, nodeB: NodeFluidPressure, flowRate: Int)
|
||||||
{
|
{
|
||||||
val tankA = nodeA.getPrimaryTank
|
val tankA = nodeA.getTank
|
||||||
val tankB = nodeB.getPrimaryTank
|
val tankB = nodeB.getTank
|
||||||
val pressureA = nodeA.pressure(dir)
|
val pressureA = nodeA.pressure(dir)
|
||||||
val pressureB = nodeB.pressure(dir.getOpposite)
|
val pressureB = nodeB.pressure(dir.getOpposite)
|
||||||
val amountA = tankA.getFluidAmount
|
val amountA = tankA.getFluidAmount
|
||||||
|
|
|
@ -5,7 +5,7 @@ import java.util.{ArrayList, List}
|
||||||
import cpw.mods.fml.relauncher.{Side, SideOnly}
|
import cpw.mods.fml.relauncher.{Side, SideOnly}
|
||||||
import edx.basic.fluid.tank.TileTank
|
import edx.basic.fluid.tank.TileTank
|
||||||
import edx.core.Reference
|
import edx.core.Reference
|
||||||
import edx.core.prefab.node.{NodeFluidPressure, TileFluidProvider}
|
import edx.core.prefab.node.{NodeFluid, NodeFluidPressure, TileFluidProvider}
|
||||||
import net.minecraft.block.Block
|
import net.minecraft.block.Block
|
||||||
import net.minecraft.block.material.Material
|
import net.minecraft.block.material.Material
|
||||||
import net.minecraft.entity.Entity
|
import net.minecraft.entity.Entity
|
||||||
|
@ -19,7 +19,6 @@ import net.minecraftforge.common.util.ForgeDirection
|
||||||
import net.minecraftforge.fluids._
|
import net.minecraftforge.fluids._
|
||||||
import org.lwjgl.opengl.GL11
|
import org.lwjgl.opengl.GL11
|
||||||
import resonantengine.api.edx.recipe.{MachineRecipes, RecipeType}
|
import resonantengine.api.edx.recipe.{MachineRecipes, RecipeType}
|
||||||
import resonantengine.lib.prefab.fluid.NodeFluid
|
|
||||||
import resonantengine.lib.render.{FluidRenderUtility, RenderUtility}
|
import resonantengine.lib.render.{FluidRenderUtility, RenderUtility}
|
||||||
import resonantengine.lib.transform.region.Cuboid
|
import resonantengine.lib.transform.region.Cuboid
|
||||||
import resonantengine.lib.transform.vector.Vector3
|
import resonantengine.lib.transform.vector.Vector3
|
||||||
|
@ -215,6 +214,34 @@ class TileGutter extends TileFluidProvider(Material.rock)
|
||||||
render(0, 0x0)
|
render(0, 0x0)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override def renderDynamic(pos: Vector3, frame: Float, pass: Int)
|
||||||
|
{
|
||||||
|
GL11.glPushMatrix()
|
||||||
|
GL11.glTranslated(pos.x + 0.5, pos.y + 0.5, pos.z + 0.5)
|
||||||
|
|
||||||
|
render(0, clientRenderMask)
|
||||||
|
|
||||||
|
if (world != null)
|
||||||
|
{
|
||||||
|
val tank: IFluidTank = fluidNode
|
||||||
|
val percentageFilled = tank.getFluidAmount / tank.getCapacity.toDouble
|
||||||
|
|
||||||
|
if (percentageFilled > 0.1)
|
||||||
|
{
|
||||||
|
GL11.glPushMatrix()
|
||||||
|
GL11.glScaled(0.99, 0.99, 0.99)
|
||||||
|
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()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
GL11.glPopMatrix()
|
||||||
|
}
|
||||||
|
|
||||||
def render(meta: Int, sides: Int)
|
def render(meta: Int, sides: Int)
|
||||||
{
|
{
|
||||||
RenderUtility.bind(TileGutter.texture)
|
RenderUtility.bind(TileGutter.texture)
|
||||||
|
@ -249,34 +276,6 @@ class TileGutter extends TileFluidProvider(Material.rock)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override def renderDynamic(pos: Vector3, frame: Float, pass: Int)
|
|
||||||
{
|
|
||||||
GL11.glPushMatrix()
|
|
||||||
GL11.glTranslated(pos.x + 0.5, pos.y + 0.5, pos.z + 0.5)
|
|
||||||
|
|
||||||
render(0, clientRenderMask)
|
|
||||||
|
|
||||||
if (world != null)
|
|
||||||
{
|
|
||||||
val tank: IFluidTank = fluidNode
|
|
||||||
val percentageFilled = tank.getFluidAmount / tank.getCapacity.toDouble
|
|
||||||
|
|
||||||
if (percentageFilled > 0.1)
|
|
||||||
{
|
|
||||||
GL11.glPushMatrix()
|
|
||||||
GL11.glScaled(0.99, 0.99, 0.99)
|
|
||||||
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()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
GL11.glPopMatrix()
|
|
||||||
}
|
|
||||||
|
|
||||||
//Recurse through all gutter blocks
|
//Recurse through all gutter blocks
|
||||||
private def findGutters(traverse: Set[NodeGutter] = Set(fluidNode.asInstanceOf[NodeGutter])): Set[NodeGutter] =
|
private def findGutters(traverse: Set[NodeGutter] = Set(fluidNode.asInstanceOf[NodeGutter])): Set[NodeGutter] =
|
||||||
{
|
{
|
||||||
|
@ -291,7 +290,7 @@ class TileGutter extends TileFluidProvider(Material.rock)
|
||||||
return foundGutters
|
return foundGutters
|
||||||
}
|
}
|
||||||
|
|
||||||
private def findAllTanks = findGutters().map(_.getPrimaryTank).toList
|
private def findAllTanks = findGutters().map(_.getTank).toList
|
||||||
|
|
||||||
class NodeGutter(parent: TileFluidProvider) extends NodeFluidGravity(parent)
|
class NodeGutter(parent: TileFluidProvider) extends NodeFluidGravity(parent)
|
||||||
{
|
{
|
||||||
|
|
|
@ -17,8 +17,8 @@ import net.minecraft.world.IBlockAccess
|
||||||
import net.minecraftforge.common.util.ForgeDirection
|
import net.minecraftforge.common.util.ForgeDirection
|
||||||
import net.minecraftforge.fluids._
|
import net.minecraftforge.fluids._
|
||||||
import org.lwjgl.opengl.GL11
|
import org.lwjgl.opengl.GL11
|
||||||
import resonantengine.api.tile.IRemovable.ISneakPickup
|
|
||||||
import resonantengine.api.graph.node.INode
|
import resonantengine.api.graph.node.INode
|
||||||
|
import resonantengine.api.tile.IRemovable.ISneakPickup
|
||||||
import resonantengine.lib.grid.core.Node
|
import resonantengine.lib.grid.core.Node
|
||||||
import resonantengine.lib.render.block.RenderConnectedTexture
|
import resonantengine.lib.render.block.RenderConnectedTexture
|
||||||
import resonantengine.lib.render.{FluidRenderUtility, RenderBlockUtility, RenderUtility}
|
import resonantengine.lib.render.{FluidRenderUtility, RenderBlockUtility, RenderUtility}
|
||||||
|
@ -85,9 +85,9 @@ class TileTank extends TileFluidProvider(Material.iron) with ISneakPickup with R
|
||||||
|
|
||||||
override def getLightValue(access: IBlockAccess): Int =
|
override def getLightValue(access: IBlockAccess): Int =
|
||||||
{
|
{
|
||||||
if (fluidNode.getPrimaryTank.getFluid != null && fluidNode.getPrimaryTank.getFluid.getFluid != null)
|
if (fluidNode.getTank.getFluid != null && fluidNode.getTank.getFluid.getFluid != null)
|
||||||
{
|
{
|
||||||
return fluidNode.getPrimaryTank.getFluid.getFluid.getLuminosity
|
return fluidNode.getTank.getFluid.getFluid.getLuminosity
|
||||||
}
|
}
|
||||||
|
|
||||||
return super.getLightValue(access)
|
return super.getLightValue(access)
|
||||||
|
@ -103,7 +103,7 @@ class TileTank extends TileFluidProvider(Material.iron) with ISneakPickup with R
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
override def renderDynamic(position: Vector3, frame: Float, pass: Int)
|
override def renderDynamic(position: Vector3, frame: Float, pass: Int)
|
||||||
{
|
{
|
||||||
renderTankFluid(position.x, position.y, position.z, fluidNode.getPrimaryTank.getFluid)
|
renderTankFluid(position.x, position.y, position.z, fluidNode.getTank.getFluid)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -122,7 +122,7 @@ class TileTank extends TileFluidProvider(Material.iron) with ISneakPickup with R
|
||||||
if (!fluid.getFluid.isGaseous)
|
if (!fluid.getFluid.isGaseous)
|
||||||
{
|
{
|
||||||
GL11.glScaled(0.99, 0.99, 0.99)
|
GL11.glScaled(0.99, 0.99, 0.99)
|
||||||
val tank: IFluidTank = fluidNode.getPrimaryTank
|
val tank: IFluidTank = fluidNode.getTank
|
||||||
val percentageFilled: Double = tank.getFluidAmount.toDouble / tank.getCapacity.toDouble
|
val percentageFilled: Double = tank.getFluidAmount.toDouble / tank.getCapacity.toDouble
|
||||||
val ySouthEast = FluidUtility.getAveragePercentageFilledForSides(classOf[TileTank], percentageFilled, world, toVector3, ForgeDirection.SOUTH, ForgeDirection.EAST)
|
val ySouthEast = FluidUtility.getAveragePercentageFilledForSides(classOf[TileTank], percentageFilled, world, toVector3, ForgeDirection.SOUTH, ForgeDirection.EAST)
|
||||||
val yNorthEast = FluidUtility.getAveragePercentageFilledForSides(classOf[TileTank], percentageFilled, world, toVector3, ForgeDirection.NORTH, ForgeDirection.EAST)
|
val yNorthEast = FluidUtility.getAveragePercentageFilledForSides(classOf[TileTank], percentageFilled, world, toVector3, ForgeDirection.NORTH, ForgeDirection.EAST)
|
||||||
|
@ -145,7 +145,7 @@ class TileTank extends TileFluidProvider(Material.iron) with ISneakPickup with R
|
||||||
|
|
||||||
if (itemStack.getTagCompound != null && itemStack.getTagCompound.hasKey("fluid"))
|
if (itemStack.getTagCompound != null && itemStack.getTagCompound.hasKey("fluid"))
|
||||||
{
|
{
|
||||||
renderInventoryFluid(0, 0, 0, FluidStack.loadFluidStackFromNBT(itemStack.getTagCompound.getCompoundTag("fluid")), fluidNode.getPrimaryTank.getCapacity)
|
renderInventoryFluid(0, 0, 0, FluidStack.loadFluidStackFromNBT(itemStack.getTagCompound.getCompoundTag("fluid")), fluidNode.getTank.getCapacity)
|
||||||
}
|
}
|
||||||
|
|
||||||
GL11.glPopMatrix()
|
GL11.glPopMatrix()
|
||||||
|
|
196
src/main/scala/edx/core/prefab/item/ItemFluidBucket.java
Normal file
196
src/main/scala/edx/core/prefab/item/ItemFluidBucket.java
Normal file
|
@ -0,0 +1,196 @@
|
||||||
|
package edx.core.prefab.item;
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import net.minecraft.block.material.Material;
|
||||||
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.init.Items;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.util.IIcon;
|
||||||
|
import net.minecraft.util.MovingObjectPosition;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
import net.minecraftforge.fluids.*;
|
||||||
|
import resonantengine.core.Reference;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Basic Item that acts like a bucket but stores its fluid inside NBT allowing it to contain any fluid
|
||||||
|
*
|
||||||
|
* @author Darkgurdsman
|
||||||
|
*/
|
||||||
|
public class ItemFluidBucket extends ItemFluidContainer
|
||||||
|
{
|
||||||
|
//TODO implement materials for bucket body allowing for molten fluids to more realistically be stored
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
IIcon icon_bucket;
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
IIcon icon_fluid;
|
||||||
|
|
||||||
|
public ItemFluidBucket()
|
||||||
|
{
|
||||||
|
super(0, FluidContainerRegistry.BUCKET_VOLUME);
|
||||||
|
this.setUnlocalizedName(Items.bucket.getUnlocalizedName());
|
||||||
|
this.setContainerItem(Items.bucket);
|
||||||
|
}
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void registerIcons(IIconRegister reg)
|
||||||
|
{
|
||||||
|
this.icon_bucket = reg.registerIcon(Reference.prefix() + "bucket_pass");
|
||||||
|
this.icon_fluid = reg.registerIcon(Reference.prefix() + "bucket_fluid_pass");
|
||||||
|
}
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public int getColorFromItemStack(ItemStack stack, int pass)
|
||||||
|
{
|
||||||
|
FluidStack fluidStack = this.getFluid(stack);
|
||||||
|
if (fluidStack != null && fluidStack.getFluid() != null && pass == 1)
|
||||||
|
{
|
||||||
|
return fluidStack.getFluid().getColor();
|
||||||
|
}
|
||||||
|
return super.getColorFromItemStack(stack, pass);
|
||||||
|
}
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT) @Override
|
||||||
|
public IIcon getIcon(ItemStack stack, int pass)
|
||||||
|
{
|
||||||
|
FluidStack fluidStack = this.getFluid(stack);
|
||||||
|
if (fluidStack != null && fluidStack.getFluid() != null)
|
||||||
|
{
|
||||||
|
Fluid fluid = fluidStack.getFluid();
|
||||||
|
if (fluid == FluidRegistry.LAVA)
|
||||||
|
{
|
||||||
|
return Items.lava_bucket.getIcon(stack, pass);
|
||||||
|
}
|
||||||
|
else if (fluid == FluidRegistry.WATER)
|
||||||
|
{
|
||||||
|
return Items.water_bucket.getIcon(stack, pass);
|
||||||
|
}
|
||||||
|
else if (pass == 0)
|
||||||
|
{
|
||||||
|
return icon_bucket;
|
||||||
|
}
|
||||||
|
else if (pass == 1)
|
||||||
|
{
|
||||||
|
return icon_fluid;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return Items.bucket.getIcon(stack, pass);
|
||||||
|
}
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT) @Override
|
||||||
|
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool)
|
||||||
|
{
|
||||||
|
FluidStack fluidStack = this.getFluid(stack);
|
||||||
|
if (fluidStack != null && fluidStack.getFluid() != null)
|
||||||
|
{
|
||||||
|
list.add("F: " + fluidStack.getFluid());
|
||||||
|
list.add("V: " + fluidStack.amount + "mL");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player)
|
||||||
|
{
|
||||||
|
if (this.getFluid(stack) == null)
|
||||||
|
{
|
||||||
|
return new ItemStack(Items.bucket);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(world, player, false);
|
||||||
|
if (movingobjectposition == null)
|
||||||
|
{
|
||||||
|
return stack;
|
||||||
|
}
|
||||||
|
if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK)
|
||||||
|
{
|
||||||
|
int i = movingobjectposition.blockX;
|
||||||
|
int j = movingobjectposition.blockY;
|
||||||
|
int k = movingobjectposition.blockZ;
|
||||||
|
|
||||||
|
if (!world.canMineBlock(player, i, j, k))
|
||||||
|
{
|
||||||
|
return stack;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (movingobjectposition.sideHit == 0)
|
||||||
|
{
|
||||||
|
--j;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (movingobjectposition.sideHit == 1)
|
||||||
|
{
|
||||||
|
++j;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (movingobjectposition.sideHit == 2)
|
||||||
|
{
|
||||||
|
--k;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (movingobjectposition.sideHit == 3)
|
||||||
|
{
|
||||||
|
++k;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (movingobjectposition.sideHit == 4)
|
||||||
|
{
|
||||||
|
--i;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (movingobjectposition.sideHit == 5)
|
||||||
|
{
|
||||||
|
++i;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!player.canPlayerEdit(i, j, k, movingobjectposition.sideHit, stack))
|
||||||
|
{
|
||||||
|
return stack;
|
||||||
|
}
|
||||||
|
|
||||||
|
//TODO if bored fix so that stacked buckets work correctly
|
||||||
|
if (this.tryPlaceContainedLiquid(stack, world, i, j, k) && !player.capabilities.isCreativeMode)
|
||||||
|
{
|
||||||
|
return new ItemStack(Items.bucket);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return stack;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Attempts to place the liquid contained inside the bucket.
|
||||||
|
*/
|
||||||
|
public boolean tryPlaceContainedLiquid(ItemStack stack, World world, int x, int y, int z)
|
||||||
|
{
|
||||||
|
FluidStack fluidStack = this.getFluid(stack);
|
||||||
|
if (fluidStack != null && fluidStack.getFluid() != null && fluidStack.getFluid().getBlock() != null)
|
||||||
|
{
|
||||||
|
Material material = world.getBlock(x, y, z).getMaterial();
|
||||||
|
boolean flag = !material.isSolid();
|
||||||
|
|
||||||
|
if (!world.isAirBlock(x, y, z) && !flag)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
|
||||||
|
if (!world.isRemote && flag && !material.isLiquid())
|
||||||
|
{
|
||||||
|
world.func_147480_a(x, y, z, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
world.setBlock(x, y, z, fluidStack.getFluid().getBlock(), 0, 3);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
106
src/main/scala/edx/core/prefab/node/NodeFluid.scala
Normal file
106
src/main/scala/edx/core/prefab/node/NodeFluid.scala
Normal file
|
@ -0,0 +1,106 @@
|
||||||
|
package edx.core.prefab.node
|
||||||
|
|
||||||
|
import net.minecraft.nbt.NBTTagCompound
|
||||||
|
import net.minecraftforge.common.util.ForgeDirection
|
||||||
|
import net.minecraftforge.fluids._
|
||||||
|
import resonantengine.api.graph.INodeProvider
|
||||||
|
import resonantengine.api.graph.node.INode
|
||||||
|
import resonantengine.api.misc.ISave
|
||||||
|
import resonantengine.lib.grid.core.{NodeConnector, TTileConnector}
|
||||||
|
import resonantengine.prefab.fluid.{TFluidHandler, TFluidTank}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A node that handles fluid interactions
|
||||||
|
*
|
||||||
|
* @param parent Parent(TileEntity or Multipart) that contains this node
|
||||||
|
* @param volume Amount of fluid in liters
|
||||||
|
* @author Calclavia
|
||||||
|
*/
|
||||||
|
class NodeFluid(parent: INodeProvider, volume: Int = FluidContainerRegistry.BUCKET_VOLUME) extends NodeConnector[IFluidHandler](parent) with ISave with TFluidHandler with TFluidTank with TTileConnector[IFluidHandler]
|
||||||
|
{
|
||||||
|
var onFluidChanged: () => Unit = () => ()
|
||||||
|
/** Internal tank */
|
||||||
|
private var tank = new FluidTank(volume)
|
||||||
|
|
||||||
|
override def fill(from: ForgeDirection, resource: FluidStack, doFill: Boolean): Int =
|
||||||
|
{
|
||||||
|
tank synchronized
|
||||||
|
{
|
||||||
|
if (canConnect(from))
|
||||||
|
{
|
||||||
|
val ret = super.fill(from, resource, doFill)
|
||||||
|
onFluidChanged()
|
||||||
|
return ret
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override def drain(from: ForgeDirection, resource: FluidStack, doDrain: Boolean): FluidStack =
|
||||||
|
{
|
||||||
|
tank synchronized
|
||||||
|
{
|
||||||
|
if (canConnect(from))
|
||||||
|
{
|
||||||
|
val ret = super.drain(from, resource, doDrain)
|
||||||
|
onFluidChanged()
|
||||||
|
return ret
|
||||||
|
}
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override def drain(from: ForgeDirection, maxDrain: Int, doDrain: Boolean): FluidStack =
|
||||||
|
{
|
||||||
|
tank synchronized
|
||||||
|
{
|
||||||
|
if (canConnect(from))
|
||||||
|
{
|
||||||
|
val ret = super.drain(from, maxDrain, doDrain)
|
||||||
|
onFluidChanged()
|
||||||
|
return ret
|
||||||
|
}
|
||||||
|
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override def canFill(from: ForgeDirection, fluid: Fluid): Boolean = canConnect(from)
|
||||||
|
|
||||||
|
override def canDrain(from: ForgeDirection, fluid: Fluid): Boolean = canConnect(from)
|
||||||
|
|
||||||
|
override def load(nbt: NBTTagCompound)
|
||||||
|
{
|
||||||
|
getTank.readFromNBT(nbt.getCompoundTag("tank"))
|
||||||
|
}
|
||||||
|
|
||||||
|
override def save(nbt: NBTTagCompound)
|
||||||
|
{
|
||||||
|
nbt.setTag("tank", getTank.writeToNBT(new NBTTagCompound))
|
||||||
|
}
|
||||||
|
|
||||||
|
override def getTank: FluidTank = tank
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the primary tank (not checked)
|
||||||
|
* @param t - The new tank
|
||||||
|
*/
|
||||||
|
def setPrimaryTank(t: FluidTank) = tank = t
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The class used to compare when making connections
|
||||||
|
*/
|
||||||
|
override protected def getCompareClass: Class[_ <: NodeFluid with INode] = classOf[NodeFluid]
|
||||||
|
|
||||||
|
protected def showConnectionsFor(obj: AnyRef, dir: ForgeDirection): Boolean =
|
||||||
|
{
|
||||||
|
if (obj != null)
|
||||||
|
{
|
||||||
|
if (obj.getClass.isAssignableFrom(getParent.getClass))
|
||||||
|
{
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
|
@ -2,9 +2,8 @@ package edx.core.prefab.node
|
||||||
|
|
||||||
import net.minecraftforge.common.util.ForgeDirection
|
import net.minecraftforge.common.util.ForgeDirection
|
||||||
import net.minecraftforge.fluids.{FluidContainerRegistry, IFluidHandler}
|
import net.minecraftforge.fluids.{FluidContainerRegistry, IFluidHandler}
|
||||||
import resonantengine.api.graph.{IUpdate, INodeProvider}
|
import resonantengine.api.graph.{INodeProvider, IUpdate}
|
||||||
import resonantengine.lib.grid.core.UpdateTicker
|
import resonantengine.lib.grid.core.UpdateTicker
|
||||||
import resonantengine.lib.prefab.fluid.NodeFluid
|
|
||||||
|
|
||||||
import scala.collection.convert.wrapAll._
|
import scala.collection.convert.wrapAll._
|
||||||
|
|
||||||
|
@ -66,7 +65,7 @@ class NodeFluidPressure(parent: INodeProvider, volume: Int = FluidContainerRegis
|
||||||
//High pressure to low
|
//High pressure to low
|
||||||
if (pressureA >= pressureB)
|
if (pressureA >= pressureB)
|
||||||
{
|
{
|
||||||
val tankA = getPrimaryTank
|
val tankA = getTank
|
||||||
|
|
||||||
if (tankA != null)
|
if (tankA != null)
|
||||||
{
|
{
|
||||||
|
@ -78,7 +77,7 @@ class NodeFluidPressure(parent: INodeProvider, volume: Int = FluidContainerRegis
|
||||||
|
|
||||||
if (amountA > 0)
|
if (amountA > 0)
|
||||||
{
|
{
|
||||||
val tankB = otherNode.getPrimaryTank
|
val tankB = otherNode.getTank
|
||||||
|
|
||||||
if (tankB != null)
|
if (tankB != null)
|
||||||
{
|
{
|
||||||
|
@ -94,7 +93,7 @@ class NodeFluidPressure(parent: INodeProvider, volume: Int = FluidContainerRegis
|
||||||
//It's a fluid handler.
|
//It's a fluid handler.
|
||||||
val pressure = this.pressure(dir)
|
val pressure = this.pressure(dir)
|
||||||
val tankPressure = 0
|
val tankPressure = 0
|
||||||
val sourceTank = getPrimaryTank
|
val sourceTank = getTank
|
||||||
val transferAmount = (Math.max(pressure, tankPressure) - Math.min(pressure, tankPressure)) * flowRate
|
val transferAmount = (Math.max(pressure, tankPressure) - Math.min(pressure, tankPressure)) * flowRate
|
||||||
|
|
||||||
if (pressure > tankPressure)
|
if (pressure > tankPressure)
|
||||||
|
@ -124,8 +123,8 @@ class NodeFluidPressure(parent: INodeProvider, volume: Int = FluidContainerRegis
|
||||||
|
|
||||||
protected def doDistribute(deltaTime: Double, dir: ForgeDirection, nodeA: NodeFluidPressure, nodeB: NodeFluidPressure, flowRate: Int)
|
protected def doDistribute(deltaTime: Double, dir: ForgeDirection, nodeA: NodeFluidPressure, nodeB: NodeFluidPressure, flowRate: Int)
|
||||||
{
|
{
|
||||||
val tankA = nodeA.getPrimaryTank
|
val tankA = nodeA.getTank
|
||||||
val tankB = nodeB.getPrimaryTank
|
val tankB = nodeB.getTank
|
||||||
val pressureA = nodeA.pressure(dir)
|
val pressureA = nodeA.pressure(dir)
|
||||||
val pressureB = nodeB.pressure(dir.getOpposite)
|
val pressureB = nodeB.pressure(dir.getOpposite)
|
||||||
val amountA = tankA.getFluidAmount
|
val amountA = tankA.getFluidAmount
|
||||||
|
|
|
@ -7,7 +7,6 @@ import net.minecraftforge.common.util.ForgeDirection
|
||||||
import net.minecraftforge.fluids._
|
import net.minecraftforge.fluids._
|
||||||
import resonantengine.core.network.discriminator.PacketType
|
import resonantengine.core.network.discriminator.PacketType
|
||||||
import resonantengine.lib.modcontent.block.ResonantTile
|
import resonantengine.lib.modcontent.block.ResonantTile
|
||||||
import resonantengine.lib.prefab.fluid.NodeFluid
|
|
||||||
import resonantengine.lib.wrapper.ByteBufWrapper._
|
import resonantengine.lib.wrapper.ByteBufWrapper._
|
||||||
import resonantengine.prefab.block.impl.TBlockNodeProvider
|
import resonantengine.prefab.block.impl.TBlockNodeProvider
|
||||||
import resonantengine.prefab.network.{TPacketReceiver, TPacketSender}
|
import resonantengine.prefab.network.{TPacketReceiver, TPacketSender}
|
||||||
|
@ -43,11 +42,11 @@ abstract class TileFluidProvider(material: Material) extends ResonantTile(materi
|
||||||
{
|
{
|
||||||
buf <<< colorID
|
buf <<< colorID
|
||||||
buf <<< clientRenderMask
|
buf <<< clientRenderMask
|
||||||
buf <<< fluidNode.getPrimaryTank
|
buf <<< fluidNode.getTank
|
||||||
}
|
}
|
||||||
case 1 =>
|
case 1 =>
|
||||||
{
|
{
|
||||||
buf <<< fluidNode.getPrimaryTank
|
buf <<< fluidNode.getTank
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -76,8 +75,6 @@ abstract class TileFluidProvider(material: Material) extends ResonantTile(materi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
def fluidNode = _fluidNode
|
|
||||||
|
|
||||||
override def readFromNBT(nbt: NBTTagCompound)
|
override def readFromNBT(nbt: NBTTagCompound)
|
||||||
{
|
{
|
||||||
super.readFromNBT(nbt)
|
super.readFromNBT(nbt)
|
||||||
|
@ -85,6 +82,17 @@ abstract class TileFluidProvider(material: Material) extends ResonantTile(materi
|
||||||
colorID = nbt.getInteger("colorID")
|
colorID = nbt.getInteger("colorID")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def fluidNode = _fluidNode
|
||||||
|
|
||||||
|
override def writeToNBT(nbt: NBTTagCompound)
|
||||||
|
{
|
||||||
|
super.writeToNBT(nbt)
|
||||||
|
fluidNode.save(nbt)
|
||||||
|
nbt.setInteger("colorID", colorID)
|
||||||
|
}
|
||||||
|
|
||||||
|
override def drain(from: ForgeDirection, resource: FluidStack, doDrain: Boolean): FluidStack = fluidNode.drain(from, resource, doDrain)
|
||||||
|
|
||||||
def fluidNode_=(newNode: NodeFluid)
|
def fluidNode_=(newNode: NodeFluid)
|
||||||
{
|
{
|
||||||
_fluidNode = newNode
|
_fluidNode = newNode
|
||||||
|
@ -97,15 +105,6 @@ abstract class TileFluidProvider(material: Material) extends ResonantTile(materi
|
||||||
nodes.add(fluidNode)
|
nodes.add(fluidNode)
|
||||||
}
|
}
|
||||||
|
|
||||||
override def writeToNBT(nbt: NBTTagCompound)
|
|
||||||
{
|
|
||||||
super.writeToNBT(nbt)
|
|
||||||
fluidNode.save(nbt)
|
|
||||||
nbt.setInteger("colorID", colorID)
|
|
||||||
}
|
|
||||||
|
|
||||||
override def drain(from: ForgeDirection, resource: FluidStack, doDrain: Boolean): FluidStack = fluidNode.drain(from, resource, doDrain)
|
|
||||||
|
|
||||||
override def drain(from: ForgeDirection, maxDrain: Int, doDrain: Boolean): FluidStack = fluidNode.drain(from, maxDrain, doDrain)
|
override def drain(from: ForgeDirection, maxDrain: Int, doDrain: Boolean): FluidStack = fluidNode.drain(from, maxDrain, doDrain)
|
||||||
|
|
||||||
override def canFill(from: ForgeDirection, fluid: Fluid): Boolean = fluidNode.canFill(from, fluid)
|
override def canFill(from: ForgeDirection, fluid: Fluid): Boolean = fluidNode.canFill(from, fluid)
|
||||||
|
|
|
@ -8,11 +8,9 @@ import net.minecraft.entity.player.EntityPlayer
|
||||||
import net.minecraft.item.{Item, ItemBlock, ItemStack}
|
import net.minecraft.item.{Item, ItemBlock, ItemStack}
|
||||||
import net.minecraft.nbt.NBTTagCompound
|
import net.minecraft.nbt.NBTTagCompound
|
||||||
import net.minecraft.world.World
|
import net.minecraft.world.World
|
||||||
import resonantengine.api.item.IEnergyItem
|
|
||||||
import resonantengine.lib.render.EnumColor
|
|
||||||
import resonantengine.lib.utility.LanguageUtility
|
import resonantengine.lib.utility.LanguageUtility
|
||||||
import resonantengine.lib.utility.science.UnitDisplay
|
|
||||||
import resonantengine.lib.wrapper.CollectionWrapper._
|
import resonantengine.lib.wrapper.CollectionWrapper._
|
||||||
|
import resonantengine.prefab.item.TEnergyItem
|
||||||
|
|
||||||
object ItemBlockBattery
|
object ItemBlockBattery
|
||||||
{
|
{
|
||||||
|
@ -36,7 +34,7 @@ object ItemBlockBattery
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class ItemBlockBattery(block: Block) extends ItemBlock(block) with IEnergyItem
|
class ItemBlockBattery(block: Block) extends ItemBlock(block) with TEnergyItem
|
||||||
{
|
{
|
||||||
this.setMaxStackSize(1)
|
this.setMaxStackSize(1)
|
||||||
this.setMaxDamage(100)
|
this.setMaxDamage(100)
|
||||||
|
@ -45,22 +43,7 @@ class ItemBlockBattery(block: Block) extends ItemBlock(block) with IEnergyItem
|
||||||
override def addInformation(itemStack: ItemStack, entityPlayer: EntityPlayer, list: List[_], par4: Boolean)
|
override def addInformation(itemStack: ItemStack, entityPlayer: EntityPlayer, list: List[_], par4: Boolean)
|
||||||
{
|
{
|
||||||
list.add(LanguageUtility.getLocal("tooltip.tier") + ": " + (ItemBlockBattery.getTier(itemStack) + 1))
|
list.add(LanguageUtility.getLocal("tooltip.tier") + ": " + (ItemBlockBattery.getTier(itemStack) + 1))
|
||||||
var color: String = ""
|
super.addInformation(itemStack, entityPlayer, list, par4)
|
||||||
val joules: Double = this.getEnergy(itemStack)
|
|
||||||
if (joules <= this.getEnergyCapacity(itemStack) / 3)
|
|
||||||
{
|
|
||||||
color = "\u00a74"
|
|
||||||
}
|
|
||||||
else if (joules > this.getEnergyCapacity(itemStack) * 2 / 3)
|
|
||||||
{
|
|
||||||
color = "\u00a72"
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
color = "\u00a76"
|
|
||||||
}
|
|
||||||
itemStack.getItemDamageForDisplay
|
|
||||||
list.add(LanguageUtility.getLocal("tooltip.battery.energy").replace("%0", color).replace("%1", EnumColor.GREY.toString).replace("%v0", new UnitDisplay(UnitDisplay.Unit.JOULES, joules).symbol.toString).replace("%v1", new UnitDisplay(UnitDisplay.Unit.JOULES, this.getEnergyCapacity(itemStack), true).symbol.toString))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -72,28 +55,7 @@ class ItemBlockBattery(block: Block) extends ItemBlock(block) with IEnergyItem
|
||||||
this.setEnergy(itemStack, 0)
|
this.setEnergy(itemStack, 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
def recharge(itemStack: ItemStack, energy: Double, doReceive: Boolean): Double =
|
override def setEnergy(itemStack: ItemStack, joules: Double): ItemStack =
|
||||||
{
|
|
||||||
val rejectedElectricity: Double = Math.max((this.getEnergy(itemStack) + energy) - this.getEnergyCapacity(itemStack), 0)
|
|
||||||
val energyToReceive: Double = Math.min(energy - rejectedElectricity, getTransferRate(itemStack))
|
|
||||||
if (doReceive)
|
|
||||||
{
|
|
||||||
this.setEnergy(itemStack, this.getEnergy(itemStack) + energyToReceive)
|
|
||||||
}
|
|
||||||
return energyToReceive
|
|
||||||
}
|
|
||||||
|
|
||||||
def discharge(itemStack: ItemStack, energy: Double, doTransfer: Boolean): Double =
|
|
||||||
{
|
|
||||||
val energyToExtract: Double = Math.min(Math.min(this.getEnergy(itemStack), energy), getTransferRate(itemStack))
|
|
||||||
if (doTransfer)
|
|
||||||
{
|
|
||||||
setEnergy(itemStack, this.getEnergy(itemStack) - energyToExtract)
|
|
||||||
}
|
|
||||||
return energyToExtract
|
|
||||||
}
|
|
||||||
|
|
||||||
def setEnergy(itemStack: ItemStack, joules: Double): ItemStack =
|
|
||||||
{
|
{
|
||||||
if (itemStack.getTagCompound == null)
|
if (itemStack.getTagCompound == null)
|
||||||
{
|
{
|
||||||
|
@ -104,30 +66,30 @@ class ItemBlockBattery(block: Block) extends ItemBlock(block) with IEnergyItem
|
||||||
return itemStack
|
return itemStack
|
||||||
}
|
}
|
||||||
|
|
||||||
def getTransferRate(itemStack: ItemStack): Double =
|
|
||||||
{
|
|
||||||
return this.getEnergyCapacity(itemStack) / 100
|
|
||||||
}
|
|
||||||
|
|
||||||
def getEnergyCapacity(theItem: ItemStack): Double =
|
def getEnergyCapacity(theItem: ItemStack): Double =
|
||||||
{
|
{
|
||||||
return TileBattery.getEnergyForTier(ItemBlockBattery.getTier(theItem))
|
return TileBattery.getEnergyForTier(ItemBlockBattery.getTier(theItem))
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Gets the energy stored in the item. Energy is stored using item NBT */
|
override def recharge(itemStack: ItemStack, energy: Double, doReceive: Boolean): Double =
|
||||||
def getEnergy(itemStack: ItemStack): Double =
|
|
||||||
{
|
{
|
||||||
if (itemStack.getTagCompound == null)
|
val rejectedElectricity: Double = Math.max((this.getEnergy(itemStack) + energy) - this.getEnergyCapacity(itemStack), 0)
|
||||||
|
val energyToReceive: Double = Math.min(energy - rejectedElectricity, getTransferRate(itemStack))
|
||||||
|
if (doReceive)
|
||||||
{
|
{
|
||||||
itemStack.setTagCompound(new NBTTagCompound)
|
this.setEnergy(itemStack, this.getEnergy(itemStack) + energyToReceive)
|
||||||
}
|
}
|
||||||
val energyStored = itemStack.getTagCompound.getDouble("energy")
|
return energyToReceive
|
||||||
return energyStored
|
|
||||||
}
|
}
|
||||||
|
|
||||||
def getTransfer(itemStack: ItemStack): Double =
|
override def discharge(itemStack: ItemStack, energy: Double, doTransfer: Boolean): Double =
|
||||||
{
|
{
|
||||||
return this.getEnergyCapacity(itemStack) - this.getEnergy(itemStack)
|
val energyToExtract: Double = Math.min(Math.min(this.getEnergy(itemStack), energy), getTransferRate(itemStack))
|
||||||
|
if (doTransfer)
|
||||||
|
{
|
||||||
|
setEnergy(itemStack, this.getEnergy(itemStack) - energyToExtract)
|
||||||
|
}
|
||||||
|
return energyToExtract
|
||||||
}
|
}
|
||||||
|
|
||||||
override def getDisplayDamage(stack: ItemStack): Int =
|
override def getDisplayDamage(stack: ItemStack): Int =
|
||||||
|
@ -135,12 +97,10 @@ class ItemBlockBattery(block: Block) extends ItemBlock(block) with IEnergyItem
|
||||||
return (100 - (getEnergy(stack) / getEnergyCapacity(stack)) * 100).toInt
|
return (100 - (getEnergy(stack) / getEnergyCapacity(stack)) * 100).toInt
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings(Array("unchecked"))
|
|
||||||
override def getSubItems(par1: Item, par2CreativeTabs: CreativeTabs, list: List[_])
|
override def getSubItems(par1: Item, par2CreativeTabs: CreativeTabs, list: List[_])
|
||||||
{
|
{
|
||||||
for (tier <- 0 to TileBattery.maxTier)
|
for (tier <- 0 to TileBattery.maxTier)
|
||||||
{
|
{
|
||||||
//TODO: Make traits for this
|
|
||||||
list.add(setEnergy(ItemBlockBattery.setTier(new ItemStack(this), tier), 0))
|
list.add(setEnergy(ItemBlockBattery.setTier(new ItemStack(this), tier), 0))
|
||||||
list.add(setEnergy(ItemBlockBattery.setTier(new ItemStack(this), tier), TileBattery.getEnergyForTier(tier)))
|
list.add(setEnergy(ItemBlockBattery.setTier(new ItemStack(this), tier), TileBattery.getEnergyForTier(tier)))
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,10 +6,10 @@ package edx.electrical.multimeter
|
||||||
import cpw.mods.fml.relauncher.{Side, SideOnly}
|
import cpw.mods.fml.relauncher.{Side, SideOnly}
|
||||||
import net.minecraft.client.gui.{GuiButton, GuiTextField}
|
import net.minecraft.client.gui.{GuiButton, GuiTextField}
|
||||||
import net.minecraft.entity.player.InventoryPlayer
|
import net.minecraft.entity.player.InventoryPlayer
|
||||||
import resonantengine.lib.prefab.gui.GuiContainerBase
|
|
||||||
import resonantengine.lib.render.EnumColor
|
import resonantengine.lib.render.EnumColor
|
||||||
import resonantengine.lib.utility.LanguageUtility
|
import resonantengine.lib.utility.LanguageUtility
|
||||||
import resonantengine.lib.wrapper.CollectionWrapper._
|
import resonantengine.lib.wrapper.CollectionWrapper._
|
||||||
|
import resonantengine.prefab.gui.GuiContainerBase
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Multimeter GUI
|
* Multimeter GUI
|
||||||
|
|
|
@ -87,7 +87,7 @@ class PartPipe extends PartFramedNode with TMaterial[PipeMaterial] with TColorab
|
||||||
//node Packet
|
//node Packet
|
||||||
val nbt = new NBTTagCompound
|
val nbt = new NBTTagCompound
|
||||||
val averageAmount = averageTankData.reduce(_ + _) / averageTankData.size
|
val averageAmount = averageTankData.reduce(_ + _) / averageTankData.size
|
||||||
val tempTank = node.getPrimaryTank //if (node.getFluid != null) new FluidTank(node.getFluid.getFluid, averageAmount, node.getCapacity) else new FluidTank(node.getCapacity)
|
val tempTank = node.getTank //if (node.getFluid != null) new FluidTank(node.getFluid.getFluid, averageAmount, node.getCapacity) else new FluidTank(node.getCapacity)
|
||||||
tempTank.writeToNBT(nbt)
|
tempTank.writeToNBT(nbt)
|
||||||
packet.writeInt(node.getCapacity).writeNBTTagCompound(nbt)
|
packet.writeInt(node.getCapacity).writeNBTTagCompound(nbt)
|
||||||
}
|
}
|
||||||
|
@ -102,7 +102,7 @@ class PartPipe extends PartFramedNode with TMaterial[PipeMaterial] with TColorab
|
||||||
if (packetID == 3 && world.isRemote)
|
if (packetID == 3 && world.isRemote)
|
||||||
{
|
{
|
||||||
node.setPrimaryTank(new FluidTank(packet.readInt))
|
node.setPrimaryTank(new FluidTank(packet.readInt))
|
||||||
node.getPrimaryTank.readFromNBT(packet.readNBTTagCompound)
|
node.getTank.readFromNBT(packet.readNBTTagCompound)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -343,7 +343,7 @@ object QuantumContent extends ContentHolder
|
||||||
*/
|
*/
|
||||||
if (tile.isInstanceOf[TileTank])
|
if (tile.isInstanceOf[TileTank])
|
||||||
{
|
{
|
||||||
val fluidStack = tile.asInstanceOf[TileTank].fluidNode.getPrimaryTank.getFluid
|
val fluidStack = tile.asInstanceOf[TileTank].fluidNode.getTank.getFluid
|
||||||
|
|
||||||
if (fluidStack != null)
|
if (fluidStack != null)
|
||||||
fluidStack.setTemperature(evt.temperature)
|
fluidStack.setTemperature(evt.temperature)
|
||||||
|
|
|
@ -3,8 +3,8 @@ package edx.quantum.items
|
||||||
import edx.core.{EDXCreativeTab, Reference}
|
import edx.core.{EDXCreativeTab, Reference}
|
||||||
import edx.quantum.QuantumContent
|
import edx.quantum.QuantumContent
|
||||||
import net.minecraft.item.ItemStack
|
import net.minecraft.item.ItemStack
|
||||||
import resonantengine.lib.prefab.item.ItemTooltip
|
|
||||||
import resonantengine.lib.utility.LanguageUtility
|
import resonantengine.lib.utility.LanguageUtility
|
||||||
|
import resonantengine.prefab.item.ItemTooltip
|
||||||
|
|
||||||
class ItemCell extends ItemTooltip
|
class ItemCell extends ItemTooltip
|
||||||
{
|
{
|
||||||
|
|
|
@ -4,7 +4,7 @@ import edx.quantum.QuantumContent
|
||||||
import net.minecraft.entity.player.EntityPlayer
|
import net.minecraft.entity.player.EntityPlayer
|
||||||
import net.minecraft.inventory.{IInventory, Slot, SlotFurnace}
|
import net.minecraft.inventory.{IInventory, Slot, SlotFurnace}
|
||||||
import net.minecraft.item.ItemStack
|
import net.minecraft.item.ItemStack
|
||||||
import resonantengine.lib.prefab.gui.ContainerBase
|
import resonantengine.prefab.gui.ContainerBase
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Accelerator container
|
* Accelerator container
|
||||||
|
|
|
@ -2,9 +2,9 @@ package edx.quantum.machine.accelerator
|
||||||
|
|
||||||
import edx.core.Settings
|
import edx.core.Settings
|
||||||
import net.minecraft.entity.player.EntityPlayer
|
import net.minecraft.entity.player.EntityPlayer
|
||||||
import resonantengine.lib.prefab.gui.GuiContainerBase
|
|
||||||
import resonantengine.lib.transform.vector.Vector3
|
import resonantengine.lib.transform.vector.Vector3
|
||||||
import resonantengine.lib.utility.science.UnitDisplay
|
import resonantengine.lib.utility.science.UnitDisplay
|
||||||
|
import resonantengine.prefab.gui.GuiContainerBase
|
||||||
|
|
||||||
class GuiAccelerator(player: EntityPlayer, tileEntity: TileAccelerator) extends GuiContainerBase(new ContainerAccelerator(player, tileEntity))
|
class GuiAccelerator(player: EntityPlayer, tileEntity: TileAccelerator) extends GuiContainerBase(new ContainerAccelerator(player, tileEntity))
|
||||||
{
|
{
|
||||||
|
|
|
@ -5,8 +5,8 @@ import net.minecraft.entity.player.EntityPlayer
|
||||||
import net.minecraft.inventory.{IInventory, Slot}
|
import net.minecraft.inventory.{IInventory, Slot}
|
||||||
import net.minecraft.item.ItemStack
|
import net.minecraft.item.ItemStack
|
||||||
import net.minecraftforge.fluids.FluidContainerRegistry
|
import net.minecraftforge.fluids.FluidContainerRegistry
|
||||||
import resonantengine.lib.prefab.gui.ContainerBase
|
import resonantengine.prefab.gui.ContainerBase
|
||||||
import resonantengine.lib.prefab.gui.slot.{SlotEnergyItem, SlotSpecific}
|
import resonantengine.prefab.gui.slot.{SlotEnergyItem, SlotSpecific}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Nuclear boiler container
|
* Nuclear boiler container
|
||||||
|
|
|
@ -2,9 +2,9 @@ package edx.quantum.machine.boiler
|
||||||
|
|
||||||
import net.minecraft.entity.player.EntityPlayer
|
import net.minecraft.entity.player.EntityPlayer
|
||||||
import net.minecraft.util.StatCollector
|
import net.minecraft.util.StatCollector
|
||||||
import resonantengine.lib.prefab.gui.GuiContainerBase
|
|
||||||
import resonantengine.lib.prefab.gui.GuiContainerBase.SlotType
|
|
||||||
import resonantengine.lib.utility.science.UnitDisplay
|
import resonantengine.lib.utility.science.UnitDisplay
|
||||||
|
import resonantengine.prefab.gui.GuiContainerBase
|
||||||
|
import resonantengine.prefab.gui.GuiContainerBase.SlotType
|
||||||
|
|
||||||
class GuiNuclearBoiler(player: EntityPlayer, tileEntity: TileNuclearBoiler) extends GuiContainerBase(new ContainerNuclearBoiler(player, tileEntity))
|
class GuiNuclearBoiler(player: EntityPlayer, tileEntity: TileNuclearBoiler) extends GuiContainerBase(new ContainerNuclearBoiler(player, tileEntity))
|
||||||
{
|
{
|
||||||
|
|
|
@ -4,8 +4,8 @@ import edx.quantum.QuantumContent
|
||||||
import net.minecraft.entity.player.{EntityPlayer, InventoryPlayer}
|
import net.minecraft.entity.player.{EntityPlayer, InventoryPlayer}
|
||||||
import net.minecraft.inventory.{IInventory, Slot, SlotFurnace}
|
import net.minecraft.inventory.{IInventory, Slot, SlotFurnace}
|
||||||
import net.minecraft.item.ItemStack
|
import net.minecraft.item.ItemStack
|
||||||
import resonantengine.lib.prefab.gui.ContainerBase
|
import resonantengine.prefab.gui.ContainerBase
|
||||||
import resonantengine.lib.prefab.gui.slot.SlotEnergyItem
|
import resonantengine.prefab.gui.slot.SlotEnergyItem
|
||||||
|
|
||||||
class ContainerCentrifuge(par1InventoryPlayer: InventoryPlayer, tileEntity: TileCentrifuge) extends ContainerBase(tileEntity)
|
class ContainerCentrifuge(par1InventoryPlayer: InventoryPlayer, tileEntity: TileCentrifuge) extends ContainerBase(tileEntity)
|
||||||
{
|
{
|
||||||
|
|
|
@ -2,9 +2,9 @@ package edx.quantum.machine.centrifuge
|
||||||
|
|
||||||
import net.minecraft.entity.player.InventoryPlayer
|
import net.minecraft.entity.player.InventoryPlayer
|
||||||
import net.minecraft.util.StatCollector
|
import net.minecraft.util.StatCollector
|
||||||
import resonantengine.lib.prefab.gui.GuiContainerBase
|
|
||||||
import resonantengine.lib.prefab.gui.GuiContainerBase.SlotType
|
|
||||||
import resonantengine.lib.utility.science.UnitDisplay
|
import resonantengine.lib.utility.science.UnitDisplay
|
||||||
|
import resonantengine.prefab.gui.GuiContainerBase
|
||||||
|
import resonantengine.prefab.gui.GuiContainerBase.SlotType
|
||||||
|
|
||||||
class GuiCentrifuge(par1InventoryPlayer: InventoryPlayer, tileEntity: TileCentrifuge) extends GuiContainerBase(new ContainerCentrifuge(par1InventoryPlayer, tileEntity))
|
class GuiCentrifuge(par1InventoryPlayer: InventoryPlayer, tileEntity: TileCentrifuge) extends GuiContainerBase(new ContainerCentrifuge(par1InventoryPlayer, tileEntity))
|
||||||
{
|
{
|
||||||
|
|
|
@ -2,8 +2,8 @@ package edx.quantum.machine.extractor
|
||||||
|
|
||||||
import net.minecraft.entity.player.InventoryPlayer
|
import net.minecraft.entity.player.InventoryPlayer
|
||||||
import net.minecraft.inventory.{Slot, SlotFurnace}
|
import net.minecraft.inventory.{Slot, SlotFurnace}
|
||||||
import resonantengine.lib.prefab.gui.ContainerBase
|
import resonantengine.prefab.gui.ContainerBase
|
||||||
import resonantengine.lib.prefab.gui.slot.SlotEnergyItem
|
import resonantengine.prefab.gui.slot.SlotEnergyItem
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Chemical extractor container
|
* Chemical extractor container
|
||||||
|
|
|
@ -2,9 +2,9 @@ package edx.quantum.machine.extractor
|
||||||
|
|
||||||
import net.minecraft.entity.player.InventoryPlayer
|
import net.minecraft.entity.player.InventoryPlayer
|
||||||
import net.minecraft.util.StatCollector
|
import net.minecraft.util.StatCollector
|
||||||
import resonantengine.lib.prefab.gui.GuiContainerBase
|
|
||||||
import resonantengine.lib.prefab.gui.GuiContainerBase.SlotType
|
|
||||||
import resonantengine.lib.utility.science.UnitDisplay
|
import resonantengine.lib.utility.science.UnitDisplay
|
||||||
|
import resonantengine.prefab.gui.GuiContainerBase
|
||||||
|
import resonantengine.prefab.gui.GuiContainerBase.SlotType
|
||||||
|
|
||||||
class GuiChemicalExtractor(par1InventoryPlayer: InventoryPlayer, tileEntity: TileChemicalExtractor) extends GuiContainerBase(new ContainerChemicalExtractor(par1InventoryPlayer, tileEntity))
|
class GuiChemicalExtractor(par1InventoryPlayer: InventoryPlayer, tileEntity: TileChemicalExtractor) extends GuiContainerBase(new ContainerChemicalExtractor(par1InventoryPlayer, tileEntity))
|
||||||
{
|
{
|
||||||
|
|
|
@ -5,8 +5,8 @@ import edx.core.Reference
|
||||||
import net.minecraft.entity.player.InventoryPlayer
|
import net.minecraft.entity.player.InventoryPlayer
|
||||||
import net.minecraft.util.ResourceLocation
|
import net.minecraft.util.ResourceLocation
|
||||||
import org.lwjgl.opengl.GL11
|
import org.lwjgl.opengl.GL11
|
||||||
import resonantengine.lib.prefab.gui.GuiContainerBase
|
|
||||||
import resonantengine.lib.utility.science.UnitDisplay
|
import resonantengine.lib.utility.science.UnitDisplay
|
||||||
|
import resonantengine.prefab.gui.GuiContainerBase
|
||||||
|
|
||||||
object GuiQuantumAssembler
|
object GuiQuantumAssembler
|
||||||
{
|
{
|
||||||
|
|
|
@ -4,8 +4,8 @@ import edx.quantum.items.{ItemBreederFuel, ItemFuelRod}
|
||||||
import net.minecraft.entity.player.EntityPlayer
|
import net.minecraft.entity.player.EntityPlayer
|
||||||
import net.minecraft.inventory.Slot
|
import net.minecraft.inventory.Slot
|
||||||
import net.minecraft.item.ItemStack
|
import net.minecraft.item.ItemStack
|
||||||
import resonantengine.lib.prefab.gui.ContainerBase
|
import resonantengine.prefab.gui.ContainerBase
|
||||||
import resonantengine.lib.prefab.gui.slot.SlotSpecific
|
import resonantengine.prefab.gui.slot.SlotSpecific
|
||||||
|
|
||||||
class ContainerReactorCell(player: EntityPlayer, tileEntity: TileReactorCell) extends ContainerBase(tileEntity)
|
class ContainerReactorCell(player: EntityPlayer, tileEntity: TileReactorCell) extends ContainerBase(tileEntity)
|
||||||
{
|
{
|
||||||
|
|
|
@ -2,8 +2,8 @@ package edx.quantum.reactor
|
||||||
|
|
||||||
import net.minecraft.entity.player.InventoryPlayer
|
import net.minecraft.entity.player.InventoryPlayer
|
||||||
import org.lwjgl.opengl.GL11
|
import org.lwjgl.opengl.GL11
|
||||||
import resonantengine.lib.prefab.gui.GuiContainerBase
|
|
||||||
import resonantengine.lib.utility.LanguageUtility
|
import resonantengine.lib.utility.LanguageUtility
|
||||||
|
import resonantengine.prefab.gui.GuiContainerBase
|
||||||
|
|
||||||
class GuiReactorCell(inventory: InventoryPlayer, tileEntity: TileReactorCell) extends GuiContainerBase(new ContainerReactorCell(inventory.player, tileEntity))
|
class GuiReactorCell(inventory: InventoryPlayer, tileEntity: TileReactorCell) extends GuiContainerBase(new ContainerReactorCell(inventory.player, tileEntity))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue