Added new model for metal cast
This commit is contained in:
parent
53dc0957fe
commit
fe06c08414
5 changed files with 42 additions and 3 deletions
|
@ -8,6 +8,7 @@ import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.Icon;
|
import net.minecraft.util.Icon;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import resonantinduction.core.Reference;
|
import resonantinduction.core.Reference;
|
||||||
|
import resonantinduction.core.render.RIBlockRenderingHandler;
|
||||||
import universalelectricity.api.vector.Vector3;
|
import universalelectricity.api.vector.Vector3;
|
||||||
import calclavia.lib.prefab.block.BlockTile;
|
import calclavia.lib.prefab.block.BlockTile;
|
||||||
import calclavia.lib.utility.inventory.InventoryUtility;
|
import calclavia.lib.utility.inventory.InventoryUtility;
|
||||||
|
@ -26,6 +27,25 @@ public class BlockCast extends BlockTile
|
||||||
setTextureName(Reference.PREFIX + "material_metal_side");
|
setTextureName(Reference.PREFIX + "material_metal_side");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
@Override
|
||||||
|
public int getRenderType()
|
||||||
|
{
|
||||||
|
return RIBlockRenderingHandler.ID;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isOpaqueCube()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean renderAsNormalBlock()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
@Override
|
@Override
|
||||||
public void registerIcons(IconRegister iconReg)
|
public void registerIcons(IconRegister iconReg)
|
||||||
|
|
|
@ -1,15 +1,23 @@
|
||||||
package resonantinduction.archaic.process;
|
package resonantinduction.archaic.process;
|
||||||
|
|
||||||
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
|
import calclavia.lib.render.RenderUtility;
|
||||||
import net.minecraft.client.renderer.RenderBlocks;
|
import net.minecraft.client.renderer.RenderBlocks;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
import net.minecraftforge.client.model.AdvancedModelLoader;
|
||||||
|
import net.minecraftforge.client.model.IModelCustom;
|
||||||
|
import resonantinduction.core.Reference;
|
||||||
import resonantinduction.core.render.RenderItemOverlayTile;
|
import resonantinduction.core.render.RenderItemOverlayTile;
|
||||||
|
import resonantinduction.electrical.battery.RenderBattery;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public class RenderCast extends RenderItemOverlayTile
|
public class RenderCast extends RenderItemOverlayTile
|
||||||
{
|
{
|
||||||
private final RenderBlocks renderBlocks = new RenderBlocks();
|
public static RenderCast INSTANCE = new RenderCast();
|
||||||
|
public static final IModelCustom MODEL = AdvancedModelLoader.loadModel(Reference.MODEL_DIRECTORY + "cast.tcn");
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float var8)
|
public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float var8)
|
||||||
|
@ -17,6 +25,16 @@ public class RenderCast extends RenderItemOverlayTile
|
||||||
if (tileEntity instanceof TileCast)
|
if (tileEntity instanceof TileCast)
|
||||||
{
|
{
|
||||||
TileCast tile = (TileCast) tileEntity;
|
TileCast tile = (TileCast) tileEntity;
|
||||||
|
|
||||||
|
GL11.glPushMatrix();
|
||||||
|
GL11.glTranslated(x + 0.5, y + 0.5, z + 0.5);
|
||||||
|
GL11.glTranslated(0.25, -0.25, -0.25);
|
||||||
|
GL11.glScalef(0.5f, 0.5f, 0.5f);
|
||||||
|
RenderUtility.bind(Reference.DOMAIN, Reference.MODEL_PATH + "cast.png");
|
||||||
|
MODEL.renderAll();
|
||||||
|
GL11.glPopMatrix();
|
||||||
|
|
||||||
|
if (tile.worldObj != null)
|
||||||
renderItemOnSides(tileEntity, tile.getStackInSlot(0), x, y, z, "");
|
renderItemOnSides(tileEntity, tile.getStackInSlot(0), x, y, z, "");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -113,7 +113,8 @@ public class PartCharger extends PartFace implements IExternalInventory, ISidedI
|
||||||
if (energyLeft <= 0)
|
if (energyLeft <= 0)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (energyUsed > 0 && System.currentTimeMillis() - this.lastPacket >= 50)
|
|
||||||
|
if (!world().isRemote && energyUsed > 0 && System.currentTimeMillis() - this.lastPacket >= 50)
|
||||||
{
|
{
|
||||||
this.lastPacket = System.currentTimeMillis();
|
this.lastPacket = System.currentTimeMillis();
|
||||||
sendDescUpdate();
|
sendDescUpdate();
|
||||||
|
|
BIN
src/main/resources/assets/resonantinduction/models/cast.png
Normal file
BIN
src/main/resources/assets/resonantinduction/models/cast.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.9 KiB |
BIN
src/main/resources/assets/resonantinduction/models/cast.tcn
Normal file
BIN
src/main/resources/assets/resonantinduction/models/cast.tcn
Normal file
Binary file not shown.
Loading…
Add table
Reference in a new issue