This commit is contained in:
Ellpeck 2015-12-21 22:46:23 +01:00
parent e6b10a63d3
commit 5239818e97
8 changed files with 51 additions and 51 deletions

View file

@ -85,6 +85,23 @@ public class BlockGiantChest extends BlockContainerBase{
return EnumRarity.epic; return EnumRarity.epic;
} }
@Override
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entity, ItemStack stack){
if(stack.getTagCompound() != null){
TileEntity tile = world.getTileEntity(x, y, z);
if(tile instanceof TileEntityGiantChest){
NBTTagList list = stack.getTagCompound().getTagList("Items", 10);
ItemStack[] slots = ((TileEntityGiantChest)tile).slots;
for(int i = 0; i < list.tagCount(); i++){
slots[i] = ItemStack.loadItemStackFromNBT(list.getCompoundTagAt(i));
}
}
}
super.onBlockPlacedBy(world, x, y, z, entity, stack);
}
@Override @Override
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune){ public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune){
ArrayList<ItemStack> drops = super.getDrops(world, x, y, z, metadata, fortune); ArrayList<ItemStack> drops = super.getDrops(world, x, y, z, metadata, fortune);
@ -119,23 +136,6 @@ public class BlockGiantChest extends BlockContainerBase{
return drops; return drops;
} }
@Override
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entity, ItemStack stack){
if(stack.getTagCompound() != null){
TileEntity tile = world.getTileEntity(x, y, z);
if(tile instanceof TileEntityGiantChest){
NBTTagList list = stack.getTagCompound().getTagList("Items", 10);
ItemStack[] slots = ((TileEntityGiantChest)tile).slots;
for(int i = 0; i < list.tagCount(); i++){
slots[i] = ItemStack.loadItemStackFromNBT(list.getCompoundTagAt(i));
}
}
}
super.onBlockPlacedBy(world, x, y, z, entity, stack);
}
@Override @Override
public void breakBlock(World world, int x, int y, int z, Block block, int par6){ public void breakBlock(World world, int x, int y, int z, Block block, int par6){
TileEntity tile = world.getTileEntity(x, y, z); TileEntity tile = world.getTileEntity(x, y, z);

View file

@ -46,13 +46,13 @@ public class BlockWildPlant extends BlockBushBase{
} }
@Override @Override
public boolean shouldAddCreative(){ public Class<? extends ItemBlockBase> getItemBlock(){
return false; return TheItemBlock.class;
} }
@Override @Override
public Class<? extends ItemBlockBase> getItemBlock(){ public boolean shouldAddCreative(){
return TheItemBlock.class; return false;
} }
@Override @Override

View file

@ -172,14 +172,14 @@ public class TileEntityAtomicReconstructor extends TileEntityInventoryBase imple
} }
@Override @Override
@SideOnly(Side.CLIENT) public void setEnergy(int energy){
public int getMaxEnergy(){ this.storage.setEnergyStored(energy);
return this.storage.getMaxEnergyStored();
} }
@Override @Override
public void setEnergy(int energy){ @SideOnly(Side.CLIENT)
this.storage.setEnergyStored(energy); public int getMaxEnergy(){
return this.storage.getMaxEnergyStored();
} }
@Override @Override

View file

@ -95,14 +95,14 @@ public class TileEntityFurnaceSolar extends TileEntityBase implements IEnergyPro
return this.storage.getEnergyStored(); return this.storage.getEnergyStored();
} }
@Override
public void setEnergy(int energy){
this.storage.setEnergyStored(energy);
}
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public int getMaxEnergy(){ public int getMaxEnergy(){
return this.storage.getMaxEnergyStored(); return this.storage.getMaxEnergyStored();
} }
@Override
public void setEnergy(int energy){
this.storage.setEnergyStored(energy);
}
} }

View file

@ -105,14 +105,14 @@ public class TileEntityHeatCollector extends TileEntityBase implements IEnergyPr
return this.storage.getEnergyStored(); return this.storage.getEnergyStored();
} }
@Override
public void setEnergy(int energy){
this.storage.setEnergyStored(energy);
}
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public int getMaxEnergy(){ public int getMaxEnergy(){
return this.storage.getMaxEnergyStored(); return this.storage.getMaxEnergyStored();
} }
@Override
public void setEnergy(int energy){
this.storage.setEnergyStored(energy);
}
} }

View file

@ -102,14 +102,14 @@ public class TileEntityLavaFactoryController extends TileEntityBase implements I
return this.storage.getEnergyStored(); return this.storage.getEnergyStored();
} }
@Override
public void setEnergy(int energy){
this.storage.setEnergyStored(energy);
}
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public int getMaxEnergy(){ public int getMaxEnergy(){
return this.storage.getMaxEnergyStored(); return this.storage.getMaxEnergyStored();
} }
@Override
public void setEnergy(int energy){
this.storage.setEnergyStored(energy);
}
} }

View file

@ -131,14 +131,14 @@ public class TileEntityLeafGenerator extends TileEntityBase implements IEnergyPr
return this.storage.getEnergyStored(); return this.storage.getEnergyStored();
} }
@Override
public void setEnergy(int energy){
this.storage.setEnergyStored(energy);
}
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public int getMaxEnergy(){ public int getMaxEnergy(){
return this.storage.getMaxEnergyStored(); return this.storage.getMaxEnergyStored();
} }
@Override
public void setEnergy(int energy){
this.storage.setEnergyStored(energy);
}
} }

View file

@ -192,14 +192,14 @@ public class TileEntityMiner extends TileEntityInventoryBase implements IEnergyR
return this.storage.getEnergyStored(); return this.storage.getEnergyStored();
} }
@Override
public void setEnergy(int energy){
this.storage.setEnergyStored(energy);
}
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public int getMaxEnergy(){ public int getMaxEnergy(){
return this.storage.getMaxEnergyStored(); return this.storage.getMaxEnergyStored();
} }
@Override
public void setEnergy(int energy){
this.storage.setEnergyStored(energy);
}
} }