Format
This commit is contained in:
parent
6e0ec1d861
commit
4ac26ac086
137 changed files with 10339 additions and 7322 deletions
|
@ -3,13 +3,14 @@ package techreborn.itemblocks;
|
|||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemMultiTexture;
|
||||
import techreborn.blocks.BlockMachineCasing;
|
||||
import techreborn.blocks.BlockOre;
|
||||
import techreborn.init.ModBlocks;
|
||||
|
||||
public class ItemBlockMachineCasing extends ItemMultiTexture {
|
||||
|
||||
public ItemBlockMachineCasing(Block block) {
|
||||
super(ModBlocks.MachineCasing, ModBlocks.MachineCasing, BlockMachineCasing.types);
|
||||
}
|
||||
public ItemBlockMachineCasing(Block block)
|
||||
{
|
||||
super(ModBlocks.MachineCasing, ModBlocks.MachineCasing,
|
||||
BlockMachineCasing.types);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -12,20 +12,28 @@ import techreborn.achievement.IPickupAchievement;
|
|||
import techreborn.blocks.BlockOre;
|
||||
import techreborn.init.ModBlocks;
|
||||
|
||||
public class ItemBlockOre extends ItemMultiTexture implements IPickupAchievement, ICraftAchievement{
|
||||
public class ItemBlockOre extends ItemMultiTexture implements
|
||||
IPickupAchievement, ICraftAchievement {
|
||||
|
||||
public ItemBlockOre(Block block) {
|
||||
super(ModBlocks.ore, ModBlocks.ore, BlockOre.types);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Achievement getAchievementOnCraft(ItemStack stack, EntityPlayer player, IInventory matrix) {
|
||||
return field_150939_a instanceof ICraftAchievement ? ((ICraftAchievement) field_150939_a).getAchievementOnCraft(stack, player, matrix) : null;
|
||||
public ItemBlockOre(Block block)
|
||||
{
|
||||
super(ModBlocks.ore, ModBlocks.ore, BlockOre.types);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Achievement getAchievementOnPickup(ItemStack stack, EntityPlayer player, EntityItem item) {
|
||||
return field_150939_a instanceof IPickupAchievement ? ((IPickupAchievement) field_150939_a).getAchievementOnPickup(stack, player, item) : null;
|
||||
public Achievement getAchievementOnCraft(ItemStack stack,
|
||||
EntityPlayer player, IInventory matrix)
|
||||
{
|
||||
return field_150939_a instanceof ICraftAchievement ? ((ICraftAchievement) field_150939_a)
|
||||
.getAchievementOnCraft(stack, player, matrix) : null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Achievement getAchievementOnPickup(ItemStack stack,
|
||||
EntityPlayer player, EntityItem item)
|
||||
{
|
||||
return field_150939_a instanceof IPickupAchievement ? ((IPickupAchievement) field_150939_a)
|
||||
.getAchievementOnPickup(stack, player, item) : null;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package techreborn.itemblocks;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
|
@ -9,39 +9,53 @@ import net.minecraft.item.ItemStack;
|
|||
import net.minecraft.world.World;
|
||||
import techreborn.init.ModBlocks;
|
||||
import techreborn.tiles.TileQuantumChest;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemBlockQuantumChest extends ItemBlock {
|
||||
|
||||
public ItemBlockQuantumChest(Block p_i45328_1_) {
|
||||
super(p_i45328_1_);
|
||||
}
|
||||
public ItemBlockQuantumChest(Block p_i45328_1_)
|
||||
{
|
||||
super(p_i45328_1_);
|
||||
}
|
||||
|
||||
@SuppressWarnings({"rawtypes", "unchecked"})
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4) {
|
||||
if (stack != null && stack.hasTagCompound()) {
|
||||
if (stack.getTagCompound().getCompoundTag("tileEntity") != null)
|
||||
list.add(stack.getTagCompound().getCompoundTag("tileEntity").getInteger("storedQuantity") + " items");
|
||||
}
|
||||
}
|
||||
@SuppressWarnings(
|
||||
{ "rawtypes", "unchecked" })
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list,
|
||||
boolean par4)
|
||||
{
|
||||
if (stack != null && stack.hasTagCompound())
|
||||
{
|
||||
if (stack.getTagCompound().getCompoundTag("tileEntity") != null)
|
||||
list.add(stack.getTagCompound().getCompoundTag("tileEntity")
|
||||
.getInteger("storedQuantity")
|
||||
+ " items");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean placeBlockAt(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ, int metadata) {
|
||||
if (!world.setBlock(x, y, z, ModBlocks.quantumChest, metadata, 3)) {
|
||||
return false;
|
||||
}
|
||||
if (world.getBlock(x, y, z) == ModBlocks.quantumChest) {
|
||||
world.getBlock(x, y, z).onBlockPlacedBy(world, x, y, z, player, stack);
|
||||
world.getBlock(x, y, z).onPostBlockPlaced(world, x, y, z, metadata);
|
||||
}
|
||||
if (stack != null && stack.hasTagCompound()) {
|
||||
((TileQuantumChest) world.getTileEntity(x, y, z)).readFromNBTWithoutCoords(stack.getTagCompound().getCompoundTag("tileEntity"));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public boolean placeBlockAt(ItemStack stack, EntityPlayer player,
|
||||
World world, int x, int y, int z, int side, float hitX, float hitY,
|
||||
float hitZ, int metadata)
|
||||
{
|
||||
if (!world.setBlock(x, y, z, ModBlocks.quantumChest, metadata, 3))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (world.getBlock(x, y, z) == ModBlocks.quantumChest)
|
||||
{
|
||||
world.getBlock(x, y, z).onBlockPlacedBy(world, x, y, z, player,
|
||||
stack);
|
||||
world.getBlock(x, y, z).onPostBlockPlaced(world, x, y, z, metadata);
|
||||
}
|
||||
if (stack != null && stack.hasTagCompound())
|
||||
{
|
||||
((TileQuantumChest) world.getTileEntity(x, y, z))
|
||||
.readFromNBTWithoutCoords(stack.getTagCompound()
|
||||
.getCompoundTag("tileEntity"));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,22 +10,32 @@ import techreborn.tiles.TileQuantumTank;
|
|||
|
||||
public class ItemBlockQuantumTank extends ItemBlock {
|
||||
|
||||
public ItemBlockQuantumTank(Block block) {
|
||||
super(block);
|
||||
}
|
||||
public ItemBlockQuantumTank(Block block)
|
||||
{
|
||||
super(block);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean placeBlockAt(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ, int metadata) {
|
||||
if (!world.setBlock(x, y, z, ModBlocks.quantumTank, metadata, 3)) {
|
||||
return false;
|
||||
}
|
||||
if (world.getBlock(x, y, z) == ModBlocks.quantumTank) {
|
||||
world.getBlock(x, y, z).onBlockPlacedBy(world, x, y, z, player, stack);
|
||||
world.getBlock(x, y, z).onPostBlockPlaced(world, x, y, z, metadata);
|
||||
}
|
||||
if (stack != null && stack.hasTagCompound()) {
|
||||
((TileQuantumTank) world.getTileEntity(x, y, z)).readFromNBTWithoutCoords(stack.getTagCompound().getCompoundTag("tileEntity"));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public boolean placeBlockAt(ItemStack stack, EntityPlayer player,
|
||||
World world, int x, int y, int z, int side, float hitX, float hitY,
|
||||
float hitZ, int metadata)
|
||||
{
|
||||
if (!world.setBlock(x, y, z, ModBlocks.quantumTank, metadata, 3))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (world.getBlock(x, y, z) == ModBlocks.quantumTank)
|
||||
{
|
||||
world.getBlock(x, y, z).onBlockPlacedBy(world, x, y, z, player,
|
||||
stack);
|
||||
world.getBlock(x, y, z).onPostBlockPlaced(world, x, y, z, metadata);
|
||||
}
|
||||
if (stack != null && stack.hasTagCompound())
|
||||
{
|
||||
((TileQuantumTank) world.getTileEntity(x, y, z))
|
||||
.readFromNBTWithoutCoords(stack.getTagCompound()
|
||||
.getCompoundTag("tileEntity"));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,8 +7,9 @@ import techreborn.init.ModBlocks;
|
|||
|
||||
public class ItemBlockStorage extends ItemMultiTexture {
|
||||
|
||||
public ItemBlockStorage(Block block) {
|
||||
super(ModBlocks.storage, ModBlocks.storage, BlockStorage.types);
|
||||
}
|
||||
public ItemBlockStorage(Block block)
|
||||
{
|
||||
super(ModBlocks.storage, ModBlocks.storage, BlockStorage.types);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue