diff options
author | Alkalus <draknyte1@hotmail.com> | 2017-09-28 12:52:31 +1000 |
---|---|---|
committer | Alkalus <draknyte1@hotmail.com> | 2017-09-28 12:52:31 +1000 |
commit | 19749c79884682301e292b52d0ddb15e6d35a580 (patch) | |
tree | d34cc6f5ffe3aebb2354761ca9a9e2a53b853b38 /src/Java/gtPlusPlus/core/block/base | |
parent | 4ab32e96512efaccb63fc2024e44dbc675afc5f0 (diff) | |
download | GT5-Unofficial-19749c79884682301e292b52d0ddb15e6d35a580.tar.gz GT5-Unofficial-19749c79884682301e292b52d0ddb15e6d35a580.tar.bz2 GT5-Unofficial-19749c79884682301e292b52d0ddb15e6d35a580.zip |
+ 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.
Diffstat (limited to 'src/Java/gtPlusPlus/core/block/base')
-rw-r--r-- | src/Java/gtPlusPlus/core/block/base/BlockBaseNBT.java | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/src/Java/gtPlusPlus/core/block/base/BlockBaseNBT.java b/src/Java/gtPlusPlus/core/block/base/BlockBaseNBT.java new file mode 100644 index 0000000000..3ecb556e09 --- /dev/null +++ b/src/Java/gtPlusPlus/core/block/base/BlockBaseNBT.java @@ -0,0 +1,73 @@ +package gtPlusPlus.core.block.base; + +import cpw.mods.fml.common.registry.GameRegistry; +import cpw.mods.fml.common.registry.LanguageRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gtPlusPlus.core.creative.AddToCreativeTab; +import gtPlusPlus.core.item.base.itemblock.ItemBlockNBT; +import net.minecraft.block.Block; +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.world.Explosion; +import net.minecraft.world.World; + +public abstract class BlockBaseNBT extends BlockContainer +{ + @SideOnly(Side.CLIENT) + private IIcon textureTop; + @SideOnly(Side.CLIENT) + private IIcon textureBottom; + @SideOnly(Side.CLIENT) + private IIcon textureFront; + + @SuppressWarnings("deprecation") + public BlockBaseNBT(Material material, String unlocalName, String displayName){ + super(material); + this.setBlockName(unlocalName); + this.setCreativeTab(AddToCreativeTab.tabMachines); + GameRegistry.registerBlock(this, ItemBlockNBT.class, unlocalName); + LanguageRegistry.addName(this, displayName); + } + + /** + * 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)); + } + + @Override + public abstract TileEntity createNewTileEntity(final World world, final int p_149915_2_); + + @Override + public void breakBlock(World world, int x, int y, int z, Block block, int meta) { + super.breakBlock(world, x, y, z, block, meta); + } + + @Override + public void onBlockDestroyedByPlayer(World world, int x, int y, int z, int meta) { + super.onBlockDestroyedByPlayer(world, x, y, z, meta); + } + + @Override + public void onBlockDestroyedByExplosion(World world, int x, int y, int z, Explosion explosion) { + super.onBlockDestroyedByExplosion(world, x, y, z, explosion); + } + + @Override + public void onBlockHarvested(World world, int x, int y, int z, int meta, EntityPlayer player) { + super.onBlockHarvested(world, x, y, z, meta, player); + } + + @Override + public void onBlockExploded(World world, int x, int y, int z, Explosion explosion) { + super.onBlockExploded(world, x, y, z, explosion); + } + +}
\ No newline at end of file |