Half fixed several tile render issues

This commit is contained in:
Robert S 2014-08-17 08:19:50 -04:00
parent e5bced2524
commit d77e3b5783
16 changed files with 95 additions and 60 deletions

View file

@ -1,5 +1,13 @@
package resonantinduction.archaic
import cpw.mods.fml.client.registry.ClientRegistry
import resonantinduction.archaic.process.{RenderMillstone, TileMillstone, RenderCastingMold, TileCastingMold}
class ClientProxy extends CommonProxy
{
override def init
{
ClientRegistry.bindTileEntitySpecialRenderer(classOf[TileCastingMold], new RenderCastingMold)
ClientRegistry.bindTileEntitySpecialRenderer(classOf[TileMillstone], new RenderMillstone)
}
}

View file

@ -102,11 +102,13 @@ object Atomic {
final val ENTITY_ID_PREFIX: Int = 49
final val SECOND_IN_TICKS: Int = 20
final val NAME: String = Reference.name + " Atomic"
final val contentRegistry: ModManager = new ModManager().setPrefix(Reference.prefix).setTab(ResonantTab.tab)
final val contentRegistry: ModManager = new ModManager().setPrefix(Reference.prefix).setTab(ResonantTab)
private final val SUPPORTED_LANGUAGES: Array[String] = Array[String]("en_US", "pl_PL", "de_DE", "ru_RU")
var INSTANCE = this
@SidedProxy(clientSide = "resonantinduction.atomic.ClientProxy", serverSide = "resonantinduction.atomic.CommonProxy") var proxy: CommonProxy = null
@Mod.Metadata("ResonantInduction|Atomic") var metadata: ModMetadata = null
@SidedProxy(clientSide = "resonantinduction.atomic.ClientProxy", serverSide = "resonantinduction.atomic.CommonProxy")
var proxy: CommonProxy = null
@Mod.Metadata("ResonantInduction|Atomic")
var metadata: ModMetadata = null
@EventHandler def preInit(event: FMLPreInitializationEvent) {
Atomic.INSTANCE = this
@ -159,20 +161,20 @@ object Atomic {
AtomicContent.blockFulmination = Atomic.contentRegistry.newBlock(classOf[TileFulmination])
AtomicContent.blockQuantumAssembler = Atomic.contentRegistry.newBlock(classOf[TileQuantumAssembler])
AtomicContent.itemHazmatTop = new ItemHazmat("HazmatMask", 0)
AtomicContent.itemHazmatBody = new ItemHazmat("HazmatBody", 1)
AtomicContent.itemHazmatLeggings = new ItemHazmat("HazmatLeggings", 2)
AtomicContent.itemHazmatBoots = new ItemHazmat("HazmatBoots", 3)
AtomicContent.itemCell = new Item().setUnlocalizedName("cellEmpty")
AtomicContent.itemFissileFuel = new ItemFissileFuel().setUnlocalizedName("rodFissileFuel")
AtomicContent.itemDeuteriumCell = new ItemCell().setUnlocalizedName("cellDeuterium")
AtomicContent.itemTritiumCell = new ItemCell().setUnlocalizedName("cellTritium")
AtomicContent.itemWaterCell = new ItemCell().setUnlocalizedName("cellWater")
AtomicContent.itemDarkMatter = new ItemDarkMatter().setUnlocalizedName("darkMatter")
AtomicContent.itemAntimatter = new ItemAntimatter().setUnlocalizedName("antimatter")
AtomicContent.itemBreedingRod = new ItemBreederFuel().setUnlocalizedName("rodBreederFuel")
AtomicContent.itemYellowCake = new ItemRadioactive().setUnlocalizedName("yellowcake")
AtomicContent.itemUranium = Atomic.contentRegistry.newItem(classOf[ItemUranium])
AtomicContent.itemHazmatTop = new ItemHazmat("HazmatMask", 0).setCreativeTab(ResonantTab)
AtomicContent.itemHazmatBody = new ItemHazmat("HazmatBody", 1).setCreativeTab(ResonantTab)
AtomicContent.itemHazmatLeggings = new ItemHazmat("HazmatLeggings", 2).setCreativeTab(ResonantTab)
AtomicContent.itemHazmatBoots = new ItemHazmat("HazmatBoots", 3).setCreativeTab(ResonantTab)
AtomicContent.itemCell = new Item().setUnlocalizedName("cellEmpty").setCreativeTab(ResonantTab)
AtomicContent.itemFissileFuel = new ItemFissileFuel().setUnlocalizedName("rodFissileFuel").setCreativeTab(ResonantTab)
AtomicContent.itemDeuteriumCell = new ItemCell().setUnlocalizedName("cellDeuterium").setCreativeTab(ResonantTab)
AtomicContent.itemTritiumCell = new ItemCell().setUnlocalizedName("cellTritium").setCreativeTab(ResonantTab)
AtomicContent.itemWaterCell = new ItemCell().setUnlocalizedName("cellWater").setCreativeTab(ResonantTab)
AtomicContent.itemDarkMatter = new ItemDarkMatter().setUnlocalizedName("darkMatter").setCreativeTab(ResonantTab)
AtomicContent.itemAntimatter = new ItemAntimatter().setUnlocalizedName("antimatter").setCreativeTab(ResonantTab)
AtomicContent.itemBreedingRod = new ItemBreederFuel().setUnlocalizedName("rodBreederFuel").setCreativeTab(ResonantTab)
AtomicContent.itemYellowCake = new ItemRadioactive().setUnlocalizedName("yellowcake").setCreativeTab(ResonantTab)
AtomicContent.itemUranium = Atomic.contentRegistry.newItem(classOf[ItemUranium]).setCreativeTab(ResonantTab)
GameRegistry.registerItem(AtomicContent.itemHazmatTop, "HazmatMask", "ResonantInduction|Atomic");
GameRegistry.registerItem(AtomicContent.itemHazmatBody, "HazmatBody", "ResonantInduction|Atomic");
@ -237,6 +239,7 @@ object Atomic {
})
Settings.config.save
ResonantTab.itemStack(new ItemStack(AtomicContent.blockReactorCell))
Atomic.proxy.preInit
}
@EventHandler def init(evt: FMLInitializationEvent) {

View file

@ -9,6 +9,7 @@ import net.minecraftforge.client.model.IModelCustom;
import org.lwjgl.opengl.GL11;
import resonant.lib.render.RenderUtility;
import resonant.lib.render.model.FixedTechneModel;
import resonantinduction.core.Reference;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@ -32,10 +33,15 @@ public class RenderNuclearBoiler extends TileEntitySpecialRenderer
bindTexture(TEXTURE);
MODEL.renderAll(); //TODO re-add rotation
//MODEL.renderOnlyAroundPivot(Math.toDegrees(tileEntity.rotation), 0, 1, 0, "FUEL BAR SUPPORT 1 ROTATES", "FUEL BAR 1 ROTATES");
//MODEL.renderOnlyAroundPivot(-Math.toDegrees(tileEntity.rotation), 0, 1, 0, "FUEL BAR SUPPORT 2 ROTATES", "FUEL BAR 2 ROTATES");
//MODEL.renderAllExcept("FUEL BAR SUPPORT 1 ROTATES", "FUEL BAR SUPPORT 2 ROTATES", "FUEL BAR 1 ROTATES", "FUEL BAR 2 ROTATES");
if(MODEL instanceof FixedTechneModel)
{
((FixedTechneModel)MODEL).renderOnlyAroundPivot(Math.toDegrees(tileEntity.rotation), 0, 1, 0, "FUEL BAR SUPPORT 1 ROTATES", "FUEL BAR 1 ROTATES");
((FixedTechneModel)MODEL).renderOnlyAroundPivot(-Math.toDegrees(tileEntity.rotation), 0, 1, 0, "FUEL BAR SUPPORT 2 ROTATES", "FUEL BAR 2 ROTATES");
MODEL.renderAllExcept("FUEL BAR SUPPORT 1 ROTATES", "FUEL BAR SUPPORT 2 ROTATES", "FUEL BAR 1 ROTATES", "FUEL BAR 2 ROTATES");
}else
{
MODEL.renderAll();
}
GL11.glPopMatrix();
}

View file

@ -51,6 +51,8 @@ public class TileNuclearBoiler extends TileElectricInventory implements IPacketR
super(Material.iron);
energy().setCapacity(DIAN * 2);
this.setSizeInventory(4);
normalRender(false);
isOpaqueCube(false);
}
@Override

View file

@ -44,7 +44,7 @@ public class TileCentrifuge extends TileElectricInventory implements IPacketRece
public TileCentrifuge()
{
super(Material.iron);
isOpaqueCube(true);
isOpaqueCube(false);
normalRender(false);
energy().setCapacity(DIAN * 2);
setSizeInventory(4);

View file

@ -9,6 +9,7 @@ import net.minecraftforge.client.model.IModelCustom;
import org.lwjgl.opengl.GL11;
import resonant.lib.render.RenderUtility;
import resonant.lib.render.model.FixedTechneModel;
import resonantinduction.core.Reference;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@ -31,11 +32,19 @@ public class RenderChemicalExtractor extends TileEntitySpecialRenderer
bindTexture(TEXTURE);
//GL11.glPushMatrix();
//MODEL.renderOnlyAroundPivot(Math.toDegrees(tileEntity.rotation), 0, 0, 1, "MAIN CHAMBER-ROTATES", "MAGNET 1-ROTATES", "MAGNET 2-ROTATES");
//GL11.glPopMatrix();
MODEL.renderAll();
//MODEL.renderAllExcept("MAIN CHAMBER-ROTATES", "MAGNET 1-ROTATES", "MAGNET 2-ROTATES");
if(MODEL instanceof FixedTechneModel)
{
GL11.glPushMatrix();
((FixedTechneModel)MODEL).renderOnlyAroundPivot(Math.toDegrees(tileEntity.rotation), 0, 0, 1, "MAIN CHAMBER-ROTATES", "MAGNET 1-ROTATES", "MAGNET 2-ROTATES");
GL11.glPopMatrix();
MODEL.renderAllExcept("MAIN CHAMBER-ROTATES", "MAGNET 1-ROTATES", "MAGNET 2-ROTATES");
}else
{
MODEL.renderAll();
}
GL11.glPopMatrix();
}

View file

@ -51,6 +51,8 @@ public class TilePlasmaHeater extends TileElectric implements IPacketReceiver, I
super(Material.iron);
energy().setCapacity(joules);
energy().setMaxTransfer(joules / 20);
normalRender(false);
isOpaqueCube(false);
}
@Override

View file

@ -9,7 +9,11 @@ import net.minecraft.entity.player.EntityPlayer
import net.minecraft.tileentity.TileEntity
import net.minecraft.world.World
import resonantinduction.electrical.battery.{RenderBattery, TileBattery}
import resonantinduction.electrical.laser.emitter.{RenderLaserEmitter, TileLaserEmitter}
import resonantinduction.electrical.laser.focus.crystal.{RenderFocusCrystal, TileFocusCrystal}
import resonantinduction.electrical.laser.focus.mirror.{RenderMirror, TileMirror}
import resonantinduction.electrical.laser.fx.{EntityBlockParticleFX, EntityLaserFX, EntityScorchFX}
import resonantinduction.electrical.laser.receiver.{RenderLaserReceiver, TileLaserReceiver}
import resonantinduction.electrical.multimeter.{GuiMultimeter, PartMultimeter}
import resonantinduction.electrical.render.FXElectricBolt
import resonantinduction.electrical.tesla.{RenderTesla, TileTesla}
@ -17,16 +21,19 @@ import universalelectricity.core.transform.vector.Vector3
/** @author Calclavia */
@SideOnly(Side.CLIENT) class ClientProxy extends CommonProxy {
override def preInit {
ClientRegistry.bindTileEntitySpecialRenderer(classOf[TileTesla], new RenderTesla)
ClientRegistry.bindTileEntitySpecialRenderer(classOf[TileBattery], new RenderBattery)
override def preInit
{
}
override def init {
//RenderingRegistry.registerBlockHandler(new BlockRenderingHandler.type)
//ClientRegistry.bindTileEntitySpecialRenderer(classOf(TileLaserEmitter), RenderLaserEmitter)
//ClientRegistry.bindTileEntitySpecialRenderer(classOf(TileMirror), RenderMirror)
//ClientRegistry.bindTileEntitySpecialRenderer(classOf(TileFocusCrystal), RenderFocusCrystal)
ClientRegistry.bindTileEntitySpecialRenderer(classOf[TileTesla], new RenderTesla)
ClientRegistry.bindTileEntitySpecialRenderer(classOf[TileBattery], new RenderBattery)
ClientRegistry.bindTileEntitySpecialRenderer(classOf[TileLaserEmitter], RenderLaserEmitter)
ClientRegistry.bindTileEntitySpecialRenderer(classOf[TileLaserReceiver], RenderLaserReceiver)
ClientRegistry.bindTileEntitySpecialRenderer(classOf[TileMirror], RenderMirror)
ClientRegistry.bindTileEntitySpecialRenderer(classOf[TileFocusCrystal], RenderFocusCrystal)
}
override def postInit {

View file

@ -17,11 +17,11 @@ import resonantinduction.core.resource.ItemResourcePart
import resonantinduction.core.{Reference, ResonantTab, Settings}
import resonantinduction.electrical.battery.{ItemBlockBattery, TileBattery}
import resonantinduction.electrical.generator.{TileMotor, TileSolarPanel, TileThermopile}
import resonantinduction.electrical.laser.emitter.BlockLaserEmitter
import resonantinduction.electrical.laser.emitter.{TileLaserEmitter, BlockLaserEmitter}
import resonantinduction.electrical.laser.focus.ItemFocusingMatrix
import resonantinduction.electrical.laser.focus.crystal.BlockFocusCrystal
import resonantinduction.electrical.laser.focus.mirror.BlockMirror
import resonantinduction.electrical.laser.receiver.BlockLaserReceiver
import resonantinduction.electrical.laser.focus.crystal.{TileFocusCrystal, BlockFocusCrystal}
import resonantinduction.electrical.laser.focus.mirror.{TileMirror, BlockMirror}
import resonantinduction.electrical.laser.receiver.{TileLaserReceiver, BlockLaserReceiver}
import resonantinduction.electrical.levitator.ItemLevitator
import resonantinduction.electrical.multimeter.ItemMultimeter
import resonantinduction.electrical.tesla.TileTesla
@ -62,6 +62,11 @@ object Electrical {
ElectricalContent.blockMirror = new BlockMirror()
ElectricalContent.blockFocusCrystal = new BlockFocusCrystal()
GameRegistry.registerTileEntity(classOf[TileLaserEmitter], "EMLaserEmitter");
GameRegistry.registerTileEntity(classOf[TileLaserReceiver], "EMLaserReceiver");
GameRegistry.registerTileEntity(classOf[TileMirror], "EMLaserMirror");
GameRegistry.registerTileEntity(classOf[TileFocusCrystal], "EMFocusCrystal");
ElectricalContent.itemFocusingMatrix = new ItemFocusingMatrix()
GameRegistry.registerBlock(ElectricalContent.blockLaserEmitter, "LaserEmitter")

View file

@ -36,6 +36,7 @@ public class TileBattery extends TileEnergyDistribution implements IPacketReceiv
this.saveIOMap_$eq(true);
this.normalRender(false);
this.isOpaqueCube(false);
this.itemBlock(ItemBlockBattery.class);
}

View file

@ -1,25 +1,15 @@
package resonantinduction.electrical.laser
import net.minecraft.tileentity.TileEntity
import net.minecraft.block.material.Material
import net.minecraftforge.common.util.ForgeDirection
import universalelectricity.core.transform.vector.Vector3
import resonant.content.prefab.java.TileAdvanced
/**
* @author Calclavia
*/
class TileBase extends TileEntity
class TileBase extends TileAdvanced(Material.iron)
{
def world = worldObj
def isPowered(): Boolean = getWorldObj.isBlockIndirectlyGettingPowered(xCoord, yCoord, zCoord)
def direction: ForgeDirection = ForgeDirection.getOrientation(getBlockMetadata)
def position: Vector3 = new Vector3(this)
def x = xCoord
def y = yCoord
def z = zCoord
}

View file

@ -29,7 +29,7 @@ object RenderLaserEmitter extends TileEntitySpecialRenderer
glEnable(GL_BLEND)
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)
tileEntity.asInstanceOf[TileLaserEmitter].direction match
tileEntity.asInstanceOf[TileLaserEmitter].getDirection match
{
case ForgeDirection.UNKNOWN =>
case ForgeDirection.UP => glRotatef(-90, 1, 0, 0)
@ -40,7 +40,7 @@ object RenderLaserEmitter extends TileEntitySpecialRenderer
case ForgeDirection.EAST => glRotatef(0, 0, 1, 0)
}
if (tileEntity.asInstanceOf[TileLaserEmitter].direction.offsetY == 0)
if (tileEntity.asInstanceOf[TileLaserEmitter].getDirection.offsetY == 0)
glRotatef(-90, 0, 1, 0)
else
glRotatef(180, 1, 0, 0)

View file

@ -1,28 +1,30 @@
package resonantinduction.electrical.laser.emitter
import net.minecraft.block.material.Material
import net.minecraft.util.MovingObjectPosition
import resonant.content.prefab.java.TileAdvanced
import resonantinduction.electrical.laser.{ILaserHandler, Laser}
import universalelectricity.core.transform.vector.Vector3
import resonantinduction.electrical.laser.{ILaserHandler, Laser, TileBase}
/**
* @author Calclavia
*/
class TileLaserEmitter extends TileBase with ILaserHandler
class TileLaserEmitter extends TileAdvanced(Material.iron) with ILaserHandler
{
var energy = 0D
override def onLaserHit(renderStart: Vector3, incidentDirection: Vector3, hit: MovingObjectPosition, color: Vector3, energy: Double) = false
override def updateEntity()
override def update()
{
if (isPowered())
if (isIndirectlyPowered)
{
energy += world.getStrongestIndirectPower(x, y, z) * (Laser.maxEnergy / 15)
}
if (energy > 0)
{
Laser.spawn(worldObj, position + 0.5 + new Vector3(direction) * 0.51, position + new Vector3(direction) * 0.6 + 0.5, new Vector3(direction), energy)
Laser.spawn(worldObj, position + 0.5 + new Vector3(getDirection) * 0.51, position + new Vector3(getDirection) * 0.6 + 0.5, new Vector3(getDirection), energy)
energy = 0;
}
}

View file

@ -22,7 +22,7 @@ class TileFocusCrystal extends TileBase with ILaserHandler with IFocus
var energy = 0D
var color = new Vector3(1, 1, 1)
override def updateEntity()
override def update()
{
if (isPowered())
{

View file

@ -22,7 +22,7 @@ class TileMirror extends TileBase with ILaserHandler with IFocus
private var cachedHits = List[Vector3]()
override def updateEntity()
override def update()
{
if (isPowered())
{

View file

@ -15,7 +15,7 @@ class TileLaserReceiver extends TileBase with ILaserHandler
var redstoneValue = 0
private var prevRedstoneValue = 0;
override def updateEntity()
override def update()
{
if (energy > 0)
{