mirror of
https://github.com/GTNewHorizons/EnderIO.git
synced 2026-11-24 22:14:42 +00:00
Fixed up the fused quartz stuff.
This commit is contained in:
1 parent
bbd1c54fd2
commit
4af6e0c059
3 files changed
+33
-54
No files matched your search
@@ -15,6 +15,7 @@ import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.EnderIO;
|
||||
@@ -63,13 +64,10 @@ public class BlockFusedQuartz extends BlockEio {
|
||||
|
||||
@Override
|
||||
protected void init() {
|
||||
super.init();
|
||||
//TODO:1.7
|
||||
// for (Type subtype : Type.values()) {
|
||||
// String unlocalisedName = "blockFusedQuartz." + subtype.unlocalisedName;
|
||||
// LanguageRegistry.instance().addStringLocalization(unlocalisedName, Lang.localize(unlocalisedName));
|
||||
//
|
||||
// }
|
||||
GameRegistry.registerBlock(this, ItemFusedQuartz.class, name);
|
||||
if(teClass != null) {
|
||||
GameRegistry.registerTileEntity(teClass, name + "TileEntity");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -87,17 +85,18 @@ public class BlockFusedQuartz extends BlockEio {
|
||||
return renderId;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getRenderBlockPass() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canRenderInPass(int pass) {
|
||||
FusedQuartzRenderer.renderPass = pass;
|
||||
return true;
|
||||
}
|
||||
//TODO:1.7 this makes it go splat
|
||||
// @Override
|
||||
// @SideOnly(Side.CLIENT)
|
||||
// public int getRenderBlockPass() {
|
||||
// return 1;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public boolean canRenderInPass(int pass) {
|
||||
// FusedQuartzRenderer.renderPass = pass;
|
||||
// return true;
|
||||
// }
|
||||
|
||||
@Override
|
||||
public int getLightOpacity(IBlockAccess world, int x, int y, int z) {
|
||||
@@ -109,14 +108,6 @@ public class BlockFusedQuartz extends BlockEio {
|
||||
return par1;
|
||||
}
|
||||
|
||||
public static int func_150032_b(int p_150032_0_) {
|
||||
return func_150031_c(p_150032_0_);
|
||||
}
|
||||
|
||||
public static int func_150031_c(int p_150031_0_) {
|
||||
return ~p_150031_0_ & 15;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List par3List) {
|
||||
for (int j = 0; j < Type.values().length; ++j) {
|
||||
|
||||
@@ -44,14 +44,15 @@ public class FusedQuartzRenderer implements ISimpleBlockRenderingHandler {
|
||||
@Override
|
||||
public boolean renderWorldBlock(IBlockAccess blockAccess, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
|
||||
int meta = blockAccess.getBlockMetadata(x, y, z);
|
||||
if((meta == 0 && renderPass != 0) || (meta == 1 && renderPass == 0)) {
|
||||
TileEntityPaintedBlock tecb = null;
|
||||
TileEntity te = blockAccess.getTileEntity(x, y, z);
|
||||
if(te instanceof TileEntityPaintedBlock) {
|
||||
tecb = (TileEntityPaintedBlock) te;
|
||||
}
|
||||
renderFrame(blockAccess, x, y, z, tecb, false, meta);
|
||||
//TODO:1.7 this makes it go splat
|
||||
//if((meta == 0 && renderPass != 0) || (meta == 1 && renderPass == 0)) {
|
||||
TileEntityPaintedBlock tecb = null;
|
||||
TileEntity te = blockAccess.getTileEntity(x, y, z);
|
||||
if(te instanceof TileEntityPaintedBlock) {
|
||||
tecb = (TileEntityPaintedBlock) te;
|
||||
}
|
||||
renderFrame(blockAccess, x, y, z, tecb, false, meta);
|
||||
// }
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,45 +2,32 @@ package crazypants.enderio.material;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemBlockWithMetadata;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.EnderIOTab;
|
||||
import crazypants.enderio.material.BlockFusedQuartz.Type;
|
||||
|
||||
public class ItemFusedQuartz extends ItemBlock {
|
||||
public class ItemFusedQuartz extends ItemBlockWithMetadata {
|
||||
|
||||
public ItemFusedQuartz() {
|
||||
super(EnderIO.blockFusedQuartz);
|
||||
this.setHasSubtypes(true);
|
||||
public ItemFusedQuartz(Block block) {
|
||||
super(block, block);
|
||||
setCreativeTab(EnderIOTab.tabEnderIO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIconFromDamage(int par1) {
|
||||
return EnderIO.blockFusedQuartz.getItemIcon(par1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetadata(int par1) {
|
||||
return par1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack par1ItemStack) {
|
||||
int meta = par1ItemStack.getItemDamage();
|
||||
meta = MathHelper.clamp_int(meta, 0, Type.values().length - 1);
|
||||
return "enderio.blockFusedQuartz." + Type.values()[meta].unlocalisedName;
|
||||
meta = MathHelper.clamp_int(meta, 0, BlockFusedQuartz.Type.values().length - 1);
|
||||
return "enderio.blockFusedQuartz." + BlockFusedQuartz.Type.values()[meta].unlocalisedName;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List par3List) {
|
||||
for (int j = 0; j < Type.values().length; ++j) {
|
||||
for (int j = 0; j < BlockFusedQuartz.Type.values().length; ++j) {
|
||||
par3List.add(new ItemStack(par1, 1, j));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user