Fixed stuff an things.

This commit is contained in:
cp committed 2014-03-01 20:23:56 +08:00
1 parent dd5664e604
commit bbd1c54fd2
6 files changed
+91 -88

No files matched your search

@@ -1,5 +1,7 @@
package crazypants.enderio.material;
import java.util.List;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
@@ -11,6 +13,10 @@ import cpw.mods.fml.relauncher.SideOnly;
import crazypants.enderio.EnderIO;
import crazypants.enderio.EnderIOTab;
import crazypants.enderio.ModObject;
import crazypants.enderio.machine.MachineRecipeRegistry;
import crazypants.enderio.machine.painter.BasicPainterTemplate;
import crazypants.enderio.machine.painter.PainterUtil;
import crazypants.enderio.machine.painter.TileEntityPaintedBlock;
public class ItemFusedQuartzFrame extends Item {
@@ -28,8 +34,7 @@ public class ItemFusedQuartzFrame extends Item {
protected void init() {
GameRegistry.registerItem(this, ModObject.itemFusedQuartzFrame.unlocalisedName);
//TODO:1.7
//MachineRecipeRegistry.instance.registerRecipe(ModObject.blockPainter.unlocalisedName, new FramePainterRecipe());
MachineRecipeRegistry.instance.registerRecipe(ModObject.blockPainter.unlocalisedName, new FramePainterRecipe());
}
@Override
@@ -41,20 +46,19 @@ public class ItemFusedQuartzFrame extends Item {
float par9, float par10) {
if(world.getBlock(x, y, z) == EnderIO.blockFusedQuartz) {
//TODO:1.7
// TileEntityCustomBlock tecb = (TileEntityCustomBlock) world.getTileEntity(x, y, z);
// if(tecb == null) {
// return false;
// }
// tecb.setSourceBlockId(PainterUtil.getSourceBlockId(itemStack));
// tecb.setSourceBlockMetadata(PainterUtil.getSourceBlockMetadata(itemStack));
// world.markBlockForUpdate(x, y, z);
// world.markBlockForRenderUpdate(x, y, z);
// if(!world.isRemote) {
// if(!player.capabilities.isCreativeMode) {
// itemStack.stackSize--;
// }
// }
TileEntityPaintedBlock tecb = (TileEntityPaintedBlock) world.getTileEntity(x, y, z);
if(tecb == null) {
return false;
}
tecb.setSourceBlock(PainterUtil.getSourceBlock(itemStack));
tecb.setSourceBlockMetadata(PainterUtil.getSourceBlockMetadata(itemStack));
world.markBlockForUpdate(x, y, z);
world.markBlockForUpdate(x, y, z);
if(!world.isRemote) {
if(!player.capabilities.isCreativeMode) {
itemStack.stackSize--;
}
}
return true;
} else {
return false;
@@ -67,38 +71,28 @@ public class ItemFusedQuartzFrame extends Item {
return true;
}
// @Override
// public String getUnlocalizedName(ItemStack par1ItemStack) {
// System.out.println("ItemFusedQuartzFrame.getUnlocalizedName: ");
// return "john";
// }
//
// @Override
// public String getUnlocalizedName() {
// System.out.println("ItemFusedQuartzFrame.getUnlocalizedName: ");
// return super.getUnlocalizedName();
// }
@Override
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack item, EntityPlayer par2EntityPlayer, List list, boolean par4) {
super.addInformation(item, par2EntityPlayer, list, par4);
list.add(PainterUtil.getTooltTipText(item));
}
//TODO:1.7
public static final class FramePainterRecipe extends BasicPainterTemplate {
// @Override
// @SideOnly(Side.CLIENT)
// public void addInformation(ItemStack item, EntityPlayer par2EntityPlayer, List list, boolean par4) {
// super.addInformation(item, par2EntityPlayer, list, par4);
// list.add(PainterUtil.getTooltTipText(item));
// }
//
// public static final class FramePainterRecipe extends BasicPainterTemplate {
//
// public FramePainterRecipe() {
// super(ModObject.itemFusedQuartzFrame.actualId);
// }
//
// @Override
// public List<IEnderIoRecipe> getAllRecipes() {
// ItemStack is = new ItemStack(ModObject.itemFusedQuartzFrame.actualId, 1, 0);
// IEnderIoRecipe recipe = new EnderIoRecipe(IEnderIoRecipe.PAINTER_ID, DEFAULT_ENERGY_PER_TASK, is, is);
// return Collections.singletonList(recipe);
// }
// }
public FramePainterRecipe() {
}
@Override
public boolean isValidTarget(ItemStack target) {
return target != null && target.getItem() == EnderIO.itemFusedQuartzFrame;
}
// @Override
// public List<IEnderIoRecipe> getAllRecipes() {
// ItemStack is = new ItemStack(ModObject.itemFusedQuartzFrame.actualId, 1, 0);
// IEnderIoRecipe recipe = new EnderIoRecipe(IEnderIoRecipe.PAINTER_ID, DEFAULT_ENERGY_PER_TASK, is, is);
// return Collections.singletonList(recipe);
// }
}
}