mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-27 15:23:16 +00:00
Loads of new assets
This commit is contained in:
1 parent
4227439a96
commit
cc0766be48
876 files changed
+585
-23
No files matched your search
@@ -99,6 +99,7 @@ import mekanism.client.render.tileentity.RenderObsidianTNT;
|
||||
import mekanism.client.render.tileentity.RenderPersonalChest;
|
||||
import mekanism.client.render.tileentity.RenderPressurizedReactionChamber;
|
||||
import mekanism.client.render.tileentity.RenderRotaryCondensentrator;
|
||||
import mekanism.client.render.tileentity.RenderSecurityDesk;
|
||||
import mekanism.client.render.tileentity.RenderSeismicVibrator;
|
||||
import mekanism.client.render.tileentity.RenderSolarNeutronActivator;
|
||||
import mekanism.client.render.tileentity.RenderTeleporter;
|
||||
@@ -314,7 +315,7 @@ public class ClientProxy extends CommonProxy
|
||||
GameRegistry.registerTileEntity(TileEntityResistiveHeater.class, "ResistiveHeater");
|
||||
ClientRegistry.registerTileEntity(TileEntityBoilerCasing.class, "BoilerCasing", new RenderThermoelectricBoiler());
|
||||
ClientRegistry.registerTileEntity(TileEntityBoilerValve.class, "BoilerValve", new RenderThermoelectricBoiler());
|
||||
GameRegistry.registerTileEntity(TileEntitySecurityDesk.class, "SecurityDesk");
|
||||
ClientRegistry.registerTileEntity(TileEntitySecurityDesk.class, "SecurityDesk", new RenderSecurityDesk());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -0,0 +1,117 @@
|
||||
package mekanism.client.model;
|
||||
|
||||
import net.minecraft.client.model.ModelBase;
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class ModelSecurityDesk extends ModelBase
|
||||
{
|
||||
ModelRenderer deskTop;
|
||||
ModelRenderer port;
|
||||
ModelRenderer deskBase;
|
||||
ModelRenderer led;
|
||||
ModelRenderer monitorBack;
|
||||
ModelRenderer keyboard;
|
||||
ModelRenderer monitor;
|
||||
ModelRenderer standNeck;
|
||||
ModelRenderer standBase;
|
||||
ModelRenderer deskMiddle;
|
||||
ModelRenderer monitorScreen;
|
||||
|
||||
public ModelSecurityDesk()
|
||||
{
|
||||
textureWidth = 128;
|
||||
textureHeight = 64;
|
||||
|
||||
deskTop = new ModelRenderer(this, 0, 0);
|
||||
deskTop.addBox(0F, 0F, 0F, 16, 7, 16);
|
||||
deskTop.setRotationPoint(-8F, 11F, -8F);
|
||||
deskTop.setTextureSize(128, 64);
|
||||
deskTop.mirror = true;
|
||||
setRotation(deskTop, 0F, 0F, 0F);
|
||||
port = new ModelRenderer(this, 64, 0);
|
||||
port.addBox(0F, 0F, 0F, 8, 8, 1);
|
||||
port.setRotationPoint(-4F, 12F, 7.01F);
|
||||
port.setTextureSize(128, 64);
|
||||
port.mirror = true;
|
||||
setRotation(port, 0F, 0F, 0F);
|
||||
deskBase = new ModelRenderer(this, 0, 38);
|
||||
deskBase.addBox(0F, 0F, 0F, 16, 5, 16);
|
||||
deskBase.setRotationPoint(-8F, 19F, -8F);
|
||||
deskBase.setTextureSize(128, 64);
|
||||
deskBase.mirror = true;
|
||||
setRotation(deskBase, 0F, 0F, 0F);
|
||||
led = new ModelRenderer(this, 0, 0);
|
||||
led.addBox(12F, 4.5F, -1.5F, 1, 1, 1);
|
||||
led.setRotationPoint(-7F, 5F, 4F);
|
||||
led.setTextureSize(128, 64);
|
||||
led.mirror = true;
|
||||
setRotation(led, -0.4712389F, 0F, 0F);
|
||||
monitorBack = new ModelRenderer(this, 82, 0);
|
||||
monitorBack.addBox(1F, -3F, 0F, 12, 6, 1);
|
||||
monitorBack.setRotationPoint(-7F, 5F, 4F);
|
||||
monitorBack.setTextureSize(128, 64);
|
||||
monitorBack.mirror = true;
|
||||
setRotation(monitorBack, -0.4712389F, 0F, 0F);
|
||||
keyboard = new ModelRenderer(this, 64, 27);
|
||||
keyboard.addBox(0F, 0F, 0F, 10, 1, 5);
|
||||
keyboard.setRotationPoint(-5F, 10.5F, -6F);
|
||||
keyboard.setTextureSize(128, 64);
|
||||
keyboard.mirror = true;
|
||||
setRotation(keyboard, 0.0872665F, 0F, 0F);
|
||||
monitor = new ModelRenderer(this, 64, 10);
|
||||
monitor.addBox(0F, -5F, -2F, 14, 10, 2);
|
||||
monitor.setRotationPoint(-7F, 5F, 4F);
|
||||
monitor.setTextureSize(128, 64);
|
||||
monitor.mirror = true;
|
||||
setRotation(monitor, -0.4712389F, 0F, 0F);
|
||||
standNeck = new ModelRenderer(this, 96, 7);
|
||||
standNeck.addBox(0F, -7F, -1F, 2, 7, 1);
|
||||
standNeck.setRotationPoint(-1F, 10F, 6F);
|
||||
standNeck.setTextureSize(128, 64);
|
||||
standNeck.mirror = true;
|
||||
setRotation(standNeck, 0.0698132F, 0F, 0F);
|
||||
standBase = new ModelRenderer(this, 64, 22);
|
||||
standBase.addBox(0F, 0F, -4F, 8, 1, 4);
|
||||
standBase.setRotationPoint(-4F, 10F, 6F);
|
||||
standBase.setTextureSize(128, 64);
|
||||
standBase.mirror = true;
|
||||
setRotation(standBase, 0.1047198F, 0F, 0F);
|
||||
deskMiddle = new ModelRenderer(this, 0, 23);
|
||||
deskMiddle.addBox(0F, 0F, 0F, 14, 1, 14);
|
||||
deskMiddle.setRotationPoint(-7F, 18F, -7F);
|
||||
deskMiddle.setTextureSize(128, 64);
|
||||
deskMiddle.mirror = true;
|
||||
setRotation(deskMiddle, 0F, 0F, 0F);
|
||||
monitorScreen = new ModelRenderer(this, 64, 33);
|
||||
monitorScreen.addBox(0.5F, -4.5F, -2.01F, 13, 9, 2);
|
||||
monitorScreen.setRotationPoint(-7F, 5F, 4F);
|
||||
monitorScreen.setTextureSize(128, 64);
|
||||
monitorScreen.mirror = true;
|
||||
setRotation(monitorScreen, -0.4712389F, 0F, 0F);
|
||||
}
|
||||
|
||||
public void render(float size)
|
||||
{
|
||||
deskTop.render(size);
|
||||
port.render(size);
|
||||
deskBase.render(size);
|
||||
led.render(size);
|
||||
monitorBack.render(size);
|
||||
keyboard.render(size);
|
||||
monitor.render(size);
|
||||
standNeck.render(size);
|
||||
standBase.render(size);
|
||||
deskMiddle.render(size);
|
||||
monitorScreen.render(size);
|
||||
}
|
||||
|
||||
private void setRotation(ModelRenderer model, float x, float y, float z)
|
||||
{
|
||||
model.rotateAngleX = x;
|
||||
model.rotateAngleY = y;
|
||||
model.rotateAngleZ = z;
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,14 @@
|
||||
package mekanism.client.render.block;
|
||||
|
||||
import mekanism.client.ClientProxy;
|
||||
import mekanism.client.model.ModelSecurityDesk;
|
||||
import mekanism.client.render.MekanismRenderer;
|
||||
import mekanism.common.MekanismBlocks;
|
||||
import mekanism.common.block.BlockBasic.BasicType;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
import mekanism.common.util.MekanismUtils.ResourceType;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
@@ -16,23 +21,37 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class BasicRenderingHandler implements ISimpleBlockRenderingHandler
|
||||
{
|
||||
public ModelSecurityDesk securityDesk = new ModelSecurityDesk();
|
||||
|
||||
@Override
|
||||
public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer)
|
||||
{
|
||||
GL11.glPushMatrix();
|
||||
GL11.glRotatef(90F, 0.0F, 1.0F, 0.0F);
|
||||
|
||||
if(block == MekanismBlocks.BasicBlock || block == MekanismBlocks.BasicBlock2)
|
||||
BasicType type = BasicType.get(block, metadata);
|
||||
|
||||
if(type != null)
|
||||
{
|
||||
if(block == MekanismBlocks.BasicBlock && metadata == 10)
|
||||
if(type == BasicType.STRUCTURAL_GLASS)
|
||||
{
|
||||
MekanismRenderer.blendOn();
|
||||
}
|
||||
|
||||
GL11.glRotatef(180, 0.0F, 1.0F, 0.0F);
|
||||
MekanismRenderer.renderItem(renderer, metadata, block);
|
||||
if(type != BasicType.SECURITY_DESK)
|
||||
{
|
||||
GL11.glRotatef(180, 0.0F, 1.0F, 0.0F);
|
||||
MekanismRenderer.renderItem(renderer, metadata, block);
|
||||
}
|
||||
else {
|
||||
GL11.glRotatef(180, 1.0F, 0.0F, 0.0F);
|
||||
GL11.glScalef(0.8F, 0.8F, 0.8F);
|
||||
GL11.glTranslatef(0.0F, -0.8F, 0.0F);
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(MekanismUtils.getResource(ResourceType.RENDER, "SecurityDesk.png"));
|
||||
securityDesk.render(0.0625F);
|
||||
}
|
||||
|
||||
if(block == MekanismBlocks.BasicBlock && metadata == 10)
|
||||
if(type == BasicType.STRUCTURAL_GLASS)
|
||||
{
|
||||
MekanismRenderer.blendOff();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
package mekanism.client.render.tileentity;
|
||||
|
||||
import mekanism.client.model.ModelSecurityDesk;
|
||||
import mekanism.common.tile.TileEntitySecurityDesk;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
import mekanism.common.util.MekanismUtils.ResourceType;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class RenderSecurityDesk extends TileEntitySpecialRenderer
|
||||
{
|
||||
private ModelSecurityDesk model = new ModelSecurityDesk();
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float partialTick)
|
||||
{
|
||||
renderAModelAt((TileEntitySecurityDesk)tileEntity, x, y, z, partialTick);
|
||||
}
|
||||
|
||||
private void renderAModelAt(TileEntitySecurityDesk tileEntity, double x, double y, double z, float partialTick)
|
||||
{
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef((float)x + 0.5F, (float)y + 1.5F, (float)z + 0.5F);
|
||||
|
||||
bindTexture(MekanismUtils.getResource(ResourceType.RENDER, "SecurityDesk.png"));
|
||||
|
||||
switch(tileEntity.facing)
|
||||
{
|
||||
case 2: GL11.glRotatef(0, 0.0F, 1.0F, 0.0F); break;
|
||||
case 3: GL11.glRotatef(180, 0.0F, 1.0F, 0.0F); break;
|
||||
case 4: GL11.glRotatef(90, 0.0F, 1.0F, 0.0F); break;
|
||||
case 5: GL11.glRotatef(270, 0.0F, 1.0F, 0.0F); break;
|
||||
}
|
||||
|
||||
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
|
||||
model.render(0.0625F);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
@@ -863,6 +863,19 @@ public class BlockBasic extends Block implements IBlockCTM, ICustomBlockIcon
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World world, int x, int y, int z, Block block, int meta)
|
||||
{
|
||||
TileEntity tileEntity = world.getTileEntity(x, y, z);
|
||||
|
||||
if(tileEntity instanceof IBoundingBlock)
|
||||
{
|
||||
((IBoundingBlock)tileEntity).onBreak();
|
||||
}
|
||||
|
||||
super.breakBlock(world, x, y, z, block, meta);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z, EntityPlayer player)
|
||||
@@ -1034,7 +1047,7 @@ public class BlockBasic extends Block implements IBlockCTM, ICustomBlockIcon
|
||||
@Override
|
||||
public boolean shouldRenderBlock(IBlockAccess world, int x, int y, int z, int meta)
|
||||
{
|
||||
return true;
|
||||
return BasicType.get(this, world.getBlockMetadata(x, y, z)) != BasicType.SECURITY_DESK;
|
||||
}
|
||||
|
||||
public static enum BasicType
|
||||
|
||||
@@ -232,12 +232,20 @@ public class ItemBlockBasic extends ItemBlock implements IEnergizedItem, ITierIt
|
||||
@Override
|
||||
public boolean placeBlockAt(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ, int metadata)
|
||||
{
|
||||
boolean place = super.placeBlockAt(stack, player, world, x, y, z, side, hitX, hitY, hitZ, metadata);
|
||||
|
||||
if(place)
|
||||
boolean place = true;
|
||||
|
||||
BasicType type = BasicType.get(stack);
|
||||
|
||||
if(type == BasicType.SECURITY_DESK)
|
||||
{
|
||||
if(y+1 > 255 || !world.getBlock(x, y+1, z).isReplaceable(world, x, y+1, z))
|
||||
{
|
||||
place = false;
|
||||
}
|
||||
}
|
||||
|
||||
if(place && super.placeBlockAt(stack, player, world, x, y, z, side, hitX, hitY, hitZ, metadata))
|
||||
{
|
||||
BasicType type = BasicType.get(stack);
|
||||
|
||||
if(type == BasicType.BIN && stack.stackTagCompound != null)
|
||||
{
|
||||
TileEntityBin tileEntity = (TileEntityBin)world.getTileEntity(x, y, z);
|
||||
|
||||
@@ -7,6 +7,7 @@ import java.util.ArrayList;
|
||||
import mekanism.api.Coord4D;
|
||||
import mekanism.common.Mekanism;
|
||||
import mekanism.common.PacketHandler;
|
||||
import mekanism.common.base.IBoundingBlock;
|
||||
import mekanism.common.frequency.Frequency;
|
||||
import mekanism.common.frequency.FrequencyManager;
|
||||
import mekanism.common.security.IOwnerItem;
|
||||
@@ -16,8 +17,9 @@ import mekanism.common.security.SecurityFrequency;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntitySecurityDesk extends TileEntityContainerBlock
|
||||
public class TileEntitySecurityDesk extends TileEntityContainerBlock implements IBoundingBlock
|
||||
{
|
||||
public String owner;
|
||||
|
||||
@@ -274,4 +276,28 @@ public class TileEntitySecurityDesk extends TileEntityContainerBlock
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPlace()
|
||||
{
|
||||
MekanismUtils.makeBoundingBlock(worldObj, Coord4D.get(this).getFromSide(ForgeDirection.UP), Coord4D.get(this));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBreak()
|
||||
{
|
||||
worldObj.setBlockToAir(xCoord, yCoord+1, zCoord);
|
||||
worldObj.setBlockToAir(xCoord, yCoord, zCoord);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Frequency getFrequency(FrequencyManager manager)
|
||||
{
|
||||
if(manager == Mekanism.securityFrequencies)
|
||||
{
|
||||
return frequency;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user