placeholder model for spreader so it shows in JEI. make monocle use blockstates like it should

This commit is contained in:
Vincent Lee committed 2016-01-22 22:32:02 -06:00
1 parent 4bf8fd3b98
commit e5ee04113f
3 files changed
+80 -75

No files matched your search

@@ -460,6 +460,7 @@ public final class ModelHandler {
registerVariantsDefaulted(ModBlocks.platform, PlatformVariant.class, "variant");
registerVariantsDefaulted(ModBlocks.prismarine, PrismarineVariant.class, "variant");
registerVariantsDefaulted(ModBlocks.spreader, SpreaderVariant.class, "variant");
// todo 1.8 this is temporary until animation API is done, currnetly item model textures will not match true spreader texture
registerVariantsDefaulted(ModFluffBlocks.stone, FutureStoneVariant.class, "variant");
registerVariantsDefaulted(ModBlocks.storage, StorageVariant.class, "variant");
}
@@ -11,6 +11,10 @@
package vazkii.botania.common.item.equipment.bauble;
import net.minecraft.block.Block;
import net.minecraft.block.BlockRedstoneComparator;
import net.minecraft.block.BlockRedstoneRepeater;
import net.minecraft.block.BlockRedstoneWire;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.client.renderer.GlStateManager;
@@ -63,8 +67,8 @@ public class ItemMonocle extends ItemBauble implements IBurstViewerBauble, ICosm
MovingObjectPosition pos = mc.objectMouseOver;
if(pos == null || pos.getBlockPos() == null)
return;
Block block = player.worldObj.getBlockState(pos.getBlockPos()).getBlock();
int meta = block.getMetaFromState(player.worldObj.getBlockState(pos.getBlockPos())); // todo 1.8 use states
IBlockState state = player.worldObj.getBlockState(pos.getBlockPos());
Block block = state.getBlock();
player.worldObj.getTileEntity(pos.getBlockPos());
ItemStack dispStack = null;
@@ -72,13 +76,13 @@ public class ItemMonocle extends ItemBauble implements IBurstViewerBauble, ICosm
if(block == Blocks.redstone_wire) {
dispStack = new ItemStack(Items.redstone);
text = EnumChatFormatting.RED + "" + meta;
text = EnumChatFormatting.RED + "" + state.getValue(BlockRedstoneWire.POWER);
} else if(block == Blocks.unpowered_repeater || block == Blocks.powered_repeater) {
dispStack = new ItemStack(Items.repeater);
text = "" + (((meta & 12) >> 2) + 1);
text = "" + state.getValue(BlockRedstoneRepeater.DELAY);
} else if(block == Blocks.unpowered_comparator || block == Blocks.powered_comparator) {
dispStack = new ItemStack(Items.comparator);
text = (meta & 4) == 4 ? "-" : "+";
text = state.getValue(BlockRedstoneComparator.MODE) == BlockRedstoneComparator.Mode.SUBTRACT ? "-" : "+";
}
if(dispStack == null)