added new foci (rendering missing)

This commit is contained in:
makeo committed 2015-11-09 21:09:28 +01:00
1 parent bfb1b8df84
commit 9218809993
4 files changed
+18 -17

No files matched your search

@@ -123,7 +123,8 @@ public class ClientProxy extends CommonProxy {
ItemRenderStoneMachine itemRenderStoneMachine = new ItemRenderStoneMachine();
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(RegisteredBlocks.blockStoneMachine), itemRenderStoneMachine);
itemRenderStoneMachine.registerRenderer(0, new TileManipulationFocus(), renderTileManipulationFocus);
itemRenderStoneMachine.registerRenderer(0, new TileManipulationFocus(0), renderTileManipulationFocus);
itemRenderStoneMachine.registerRenderer(3, new TileManipulationFocus(1), renderTileManipulationFocus);
MinecraftForgeClient.registerItemRenderer(RegisteredItems.itemFamiliar, new ItemRenderFamiliar());
MinecraftForgeClient.registerItemRenderer(RegisteredItems.itemCreativeNode, new ItemCreativeNodeRenderer());
@@ -22,18 +22,20 @@ public class RenderTileManipulationFocus extends TileEntitySpecialRenderer {
GL11.glPushMatrix();
GL11.glTranslated(x, y, z);
bindTexture(new SimpleResourceLocation("models/manipulation_focus_" + tile.fociId + ".png"));
bindTexture(new SimpleResourceLocation("models/manipulation_focus_" + tile.getFociId() + ".png"));
GL11.glRotatef(180, 1, 0, 0);
GL11.glTranslatef(0.5f, -1.5f + (2/16f), -0.5f);
if(tile.fociId == 0) {
if(tile.getFociId() == 0) {
GL11.glPushMatrix();
for(int i = 0; i < 4; i++) {
RANDOM_FOCUS.render(null, 0, 0, 0, 0, 0, 0.0625f);
GL11.glRotatef(90, 0, 1, 0);
}
GL11.glPopMatrix();
} else if(tile.getFociId() == 1) {
//TODO: Hell hell hell
}
GL11.glPopMatrix();
@@ -87,6 +87,7 @@ public class BlockStoneMachine extends Block {
list.add(new ItemStack(item, 1, 0));
list.add(new ItemStack(item, 1, 1));
list.add(new ItemStack(item, 1, 2));
list.add(new ItemStack(item, 1, 3));
}
@Override
@@ -104,11 +105,13 @@ public class BlockStoneMachine extends Block {
if (metadata == 15) {
return new TileManipulatorPillar();
} else if (metadata == 0) {
return new TileManipulationFocus();
return new TileManipulationFocus(0);
} else if(metadata == 1) {
return new TilePedestal();
} else if(metadata == 2) {
return new TileBlockProtector();
} else if(metadata == 3) {
return new TileManipulationFocus(1);
}
return null;
}
@@ -1,7 +1,5 @@
package makeo.gadomancy.common.blocks.tiles;
import net.minecraft.nbt.NBTTagCompound;
/**
* This class is part of the Gadomancy Mod
* Gadomancy is Open Source and distributed under the
@@ -11,20 +9,17 @@ import net.minecraft.nbt.NBTTagCompound;
* Created by makeo @ 28.10.2015 16:27
*/
public class TileManipulationFocus extends SynchronizedTileEntity {
public int fociId;
private int fociId;
public TileManipulationFocus(int fociId) {
this.fociId = fociId;
}
public int getFociId() {
return fociId;
}
@Override
public boolean canUpdate() {
return false;
}
@Override
public void readCustomNBT(NBTTagCompound compound) {
fociId = compound.getInteger("fociId");
}
@Override
public void writeCustomNBT(NBTTagCompound compound) {
compound.setInteger("fociId", fociId);
}
}