From 19749c79884682301e292b52d0ddb15e6d35a580 Mon Sep 17 00:00:00 2001 From: Alkalus Date: Thu, 28 Sep 2017 12:52:31 +1000 Subject: + Added Base Tile Entity Class. % Changed Trade Table to inherit from the base class. + Added functionality to the base TE to store the owners name and UUID. + Added Base NBT Block Class. $ Fixed ItemBlockNBT handling of NBT. --- .../core/block/machine/Machine_TradeTable.java | 28 ++++------------------ 1 file changed, 5 insertions(+), 23 deletions(-) (limited to 'src/Java/gtPlusPlus/core/block/machine') diff --git a/src/Java/gtPlusPlus/core/block/machine/Machine_TradeTable.java b/src/Java/gtPlusPlus/core/block/machine/Machine_TradeTable.java index a5ba90013d..540ba61837 100644 --- a/src/Java/gtPlusPlus/core/block/machine/Machine_TradeTable.java +++ b/src/Java/gtPlusPlus/core/block/machine/Machine_TradeTable.java @@ -5,6 +5,7 @@ import cpw.mods.fml.common.registry.LanguageRegistry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gtPlusPlus.GTplusplus; +import gtPlusPlus.core.block.base.BlockBaseNBT; import gtPlusPlus.core.creative.AddToCreativeTab; import gtPlusPlus.core.item.base.itemblock.ItemBlockNBT; import gtPlusPlus.core.lib.CORE; @@ -18,7 +19,7 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.util.IIcon; import net.minecraft.world.World; -public class Machine_TradeTable extends BlockContainer +public class Machine_TradeTable extends BlockBaseNBT { @SideOnly(Side.CLIENT) private IIcon textureTop; @@ -27,31 +28,13 @@ public class Machine_TradeTable extends BlockContainer @SideOnly(Side.CLIENT) private IIcon textureFront; - @SuppressWarnings("deprecation") - public Machine_TradeTable() - { - super(Material.leaves); - this.setBlockName("blockTradeBench"); - this.setCreativeTab(AddToCreativeTab.tabMachines); - GameRegistry.registerBlock(this, ItemBlockNBT.class, "blockTradeBench"); - LanguageRegistry.addName(this, "Trade-o-Mat"); - - } - - /** - * Gets the block's texture. Args: side, meta - */ - @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon(final int p_149691_1_, final int p_149691_2_) - { - return p_149691_1_ == 1 ? this.textureTop : (p_149691_1_ == 0 ? this.textureBottom : ((p_149691_1_ != 2) && (p_149691_1_ != 4) ? this.blockIcon : this.textureFront)); + public Machine_TradeTable(){ + super(Material.leaves, "blockTradeBench", "Trade-o-Mat"); } @Override @SideOnly(Side.CLIENT) - public void registerBlockIcons(final IIconRegister p_149651_1_) - { + public void registerBlockIcons(final IIconRegister p_149651_1_){ this.blockIcon = p_149651_1_.registerIcon(CORE.MODID + ":" + "SwirlYellow"); this.textureTop = p_149651_1_.registerIcon(CORE.MODID + ":" + "workbench_top"); this.textureBottom = p_149651_1_.registerIcon(CORE.MODID + ":" + "SwirlYellow"); @@ -63,7 +46,6 @@ public class Machine_TradeTable extends BlockContainer */ @Override public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float lx, final float ly, final float lz){ - if (world.isRemote) { return true; } -- cgit