mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-26 08:48:34 +01:00
More cleanup!
This commit is contained in:
parent
8c0c2bb073
commit
4ede6fc608
166 changed files with 2962 additions and 2957 deletions
|
@ -49,6 +49,10 @@ public enum TheAchievements{
|
||||||
public final Achievement ach;
|
public final Achievement ach;
|
||||||
public final int type;
|
public final int type;
|
||||||
|
|
||||||
|
TheAchievements(String name, int x, int y, ItemStack displayStack, Achievement hasToHaveBefore){
|
||||||
|
this(name, x, y, displayStack, hasToHaveBefore, InitAchievements.CRAFTING_ACH);
|
||||||
|
}
|
||||||
|
|
||||||
TheAchievements(String name, int x, int y, ItemStack displayStack, Achievement hasToHaveBefore, int type){
|
TheAchievements(String name, int x, int y, ItemStack displayStack, Achievement hasToHaveBefore, int type){
|
||||||
this.ach = new Achievement("achievement."+ModUtil.MOD_ID_LOWER+"."+name, ModUtil.MOD_ID_LOWER+"."+name, x, y, displayStack, hasToHaveBefore);
|
this.ach = new Achievement("achievement."+ModUtil.MOD_ID_LOWER+"."+name, ModUtil.MOD_ID_LOWER+"."+name, x, y, displayStack, hasToHaveBefore);
|
||||||
if(hasToHaveBefore == null){
|
if(hasToHaveBefore == null){
|
||||||
|
@ -57,8 +61,4 @@ public enum TheAchievements{
|
||||||
this.ach.registerStat();
|
this.ach.registerStat();
|
||||||
this.type = type;
|
this.type = type;
|
||||||
}
|
}
|
||||||
|
|
||||||
TheAchievements(String name, int x, int y, ItemStack displayStack, Achievement hasToHaveBefore){
|
|
||||||
this(name, x, y, displayStack, hasToHaveBefore, InitAchievements.CRAFTING_ACH);
|
|
||||||
}
|
|
||||||
}
|
}
|
|
@ -47,28 +47,11 @@ public class BlockBreaker extends BlockContainerBase implements IActAddItemOrBlo
|
||||||
this.setStepSound(soundTypeStone);
|
this.setStepSound(soundTypeStone);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack stack){
|
|
||||||
int rotation = BlockPistonBase.determineOrientation(world, x, y, z, player);
|
|
||||||
world.setBlockMetadataWithNotify(x, y, z, rotation, 2);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TileEntity createNewTileEntity(World world, int par2){
|
public TileEntity createNewTileEntity(World world, int par2){
|
||||||
return this.isPlacer ? new TileEntityBreaker.TileEntityPlacer() : new TileEntityBreaker();
|
return this.isPlacer ? new TileEntityBreaker.TileEntityPlacer() : new TileEntityBreaker();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public IIcon getIcon(int side, int meta){
|
|
||||||
if(side == 0 || side == 1){
|
|
||||||
return this.topIcon;
|
|
||||||
}
|
|
||||||
if(side == 3){
|
|
||||||
return this.frontIcon;
|
|
||||||
}
|
|
||||||
return this.blockIcon;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side){
|
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side){
|
||||||
int meta = world.getBlockMetadata(x, y, z);
|
int meta = world.getBlockMetadata(x, y, z);
|
||||||
|
@ -82,11 +65,14 @@ public class BlockBreaker extends BlockContainerBase implements IActAddItemOrBlo
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
public IIcon getIcon(int side, int meta){
|
||||||
public void registerBlockIcons(IIconRegister iconReg){
|
if(side == 0 || side == 1){
|
||||||
this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName());
|
return this.topIcon;
|
||||||
this.frontIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Front");
|
}
|
||||||
this.topIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Top");
|
if(side == 3){
|
||||||
|
return this.frontIcon;
|
||||||
|
}
|
||||||
|
return this.blockIcon;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -102,9 +88,17 @@ public class BlockBreaker extends BlockContainerBase implements IActAddItemOrBlo
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void breakBlock(World world, int x, int y, int z, Block block, int par6){
|
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack stack){
|
||||||
this.dropInventory(world, x, y, z);
|
int rotation = BlockPistonBase.determineOrientation(world, x, y, z, player);
|
||||||
super.breakBlock(world, x, y, z, block, par6);
|
world.setBlockMetadataWithNotify(x, y, z, rotation, 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void registerBlockIcons(IIconRegister iconReg){
|
||||||
|
this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName());
|
||||||
|
this.frontIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Front");
|
||||||
|
this.topIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Top");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -112,6 +106,12 @@ public class BlockBreaker extends BlockContainerBase implements IActAddItemOrBlo
|
||||||
return this.isPlacer ? "blockPlacer" : "blockBreaker";
|
return this.isPlacer ? "blockPlacer" : "blockBreaker";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void breakBlock(World world, int x, int y, int z, Block block, int par6){
|
||||||
|
this.dropInventory(world, x, y, z);
|
||||||
|
super.breakBlock(world, x, y, z, block, par6);
|
||||||
|
}
|
||||||
|
|
||||||
public static class TheItemBlock extends ItemBlock{
|
public static class TheItemBlock extends ItemBlock{
|
||||||
|
|
||||||
private Block theBlock;
|
private Block theBlock;
|
||||||
|
@ -123,11 +123,6 @@ public class BlockBreaker extends BlockContainerBase implements IActAddItemOrBlo
|
||||||
this.setMaxDamage(0);
|
this.setMaxDamage(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public EnumRarity getRarity(ItemStack stack){
|
|
||||||
return EnumRarity.rare;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getUnlocalizedName(ItemStack stack){
|
public String getUnlocalizedName(ItemStack stack){
|
||||||
return this.getUnlocalizedName();
|
return this.getUnlocalizedName();
|
||||||
|
@ -137,5 +132,10 @@ public class BlockBreaker extends BlockContainerBase implements IActAddItemOrBlo
|
||||||
public int getMetadata(int damage){
|
public int getMetadata(int damage){
|
||||||
return damage;
|
return damage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EnumRarity getRarity(ItemStack stack){
|
||||||
|
return EnumRarity.rare;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,13 +50,6 @@ public class BlockCanolaPress extends BlockContainerBase implements IActAddItemO
|
||||||
return side == 1 || side == 0 ? this.topIcon : this.blockIcon;
|
return side == 1 || side == 0 ? this.topIcon : this.blockIcon;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
public void registerBlockIcons(IIconRegister iconReg){
|
|
||||||
this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName());
|
|
||||||
this.topIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Top");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9){
|
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9){
|
||||||
if(!world.isRemote){
|
if(!world.isRemote){
|
||||||
|
@ -70,9 +63,10 @@ public class BlockCanolaPress extends BlockContainerBase implements IActAddItemO
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void breakBlock(World world, int x, int y, int z, Block block, int par6){
|
@SideOnly(Side.CLIENT)
|
||||||
this.dropInventory(world, x, y, z);
|
public void registerBlockIcons(IIconRegister iconReg){
|
||||||
super.breakBlock(world, x, y, z, block, par6);
|
this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName());
|
||||||
|
this.topIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Top");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -80,6 +74,12 @@ public class BlockCanolaPress extends BlockContainerBase implements IActAddItemO
|
||||||
return "blockCanolaPress";
|
return "blockCanolaPress";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void breakBlock(World world, int x, int y, int z, Block block, int par6){
|
||||||
|
this.dropInventory(world, x, y, z);
|
||||||
|
super.breakBlock(world, x, y, z, block, par6);
|
||||||
|
}
|
||||||
|
|
||||||
public static class TheItemBlock extends ItemBlock{
|
public static class TheItemBlock extends ItemBlock{
|
||||||
|
|
||||||
private Block theBlock;
|
private Block theBlock;
|
||||||
|
@ -91,11 +91,6 @@ public class BlockCanolaPress extends BlockContainerBase implements IActAddItemO
|
||||||
this.setMaxDamage(0);
|
this.setMaxDamage(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public EnumRarity getRarity(ItemStack stack){
|
|
||||||
return EnumRarity.rare;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getUnlocalizedName(ItemStack stack){
|
public String getUnlocalizedName(ItemStack stack){
|
||||||
return this.getUnlocalizedName();
|
return this.getUnlocalizedName();
|
||||||
|
@ -105,5 +100,10 @@ public class BlockCanolaPress extends BlockContainerBase implements IActAddItemO
|
||||||
public int getMetadata(int damage){
|
public int getMetadata(int damage){
|
||||||
return damage;
|
return damage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EnumRarity getRarity(ItemStack stack){
|
||||||
|
return EnumRarity.rare;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,18 +44,6 @@ public class BlockCoalGenerator extends BlockContainerBase implements IActAddIte
|
||||||
this.setTickRandomly(true);
|
this.setTickRandomly(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
public void randomDisplayTick(World world, int x, int y, int z, Random rand){
|
|
||||||
int meta = world.getBlockMetadata(x, y, z);
|
|
||||||
|
|
||||||
if(meta == 1){
|
|
||||||
for(int i = 0; i < 5; i++){
|
|
||||||
world.spawnParticle("smoke", (double)x+0.5F, (double)y+1.0F, (double)z+0.5F, 0.0D, 0.0D, 0.0D);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TileEntity createNewTileEntity(World world, int par2){
|
public TileEntity createNewTileEntity(World world, int par2){
|
||||||
return new TileEntityCoalGenerator();
|
return new TileEntityCoalGenerator();
|
||||||
|
@ -68,10 +56,14 @@ public class BlockCoalGenerator extends BlockContainerBase implements IActAddIte
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void registerBlockIcons(IIconRegister iconReg){
|
public void randomDisplayTick(World world, int x, int y, int z, Random rand){
|
||||||
this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName());
|
int meta = world.getBlockMetadata(x, y, z);
|
||||||
this.topIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Top");
|
|
||||||
this.bottomIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Bottom");
|
if(meta == 1){
|
||||||
|
for(int i = 0; i < 5; i++){
|
||||||
|
world.spawnParticle("smoke", (double)x+0.5F, (double)y+1.0F, (double)z+0.5F, 0.0D, 0.0D, 0.0D);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -87,9 +79,11 @@ public class BlockCoalGenerator extends BlockContainerBase implements IActAddIte
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void breakBlock(World world, int x, int y, int z, Block block, int par6){
|
@SideOnly(Side.CLIENT)
|
||||||
this.dropInventory(world, x, y, z);
|
public void registerBlockIcons(IIconRegister iconReg){
|
||||||
super.breakBlock(world, x, y, z, block, par6);
|
this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName());
|
||||||
|
this.topIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Top");
|
||||||
|
this.bottomIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Bottom");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -97,6 +91,12 @@ public class BlockCoalGenerator extends BlockContainerBase implements IActAddIte
|
||||||
return "blockCoalGenerator";
|
return "blockCoalGenerator";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void breakBlock(World world, int x, int y, int z, Block block, int par6){
|
||||||
|
this.dropInventory(world, x, y, z);
|
||||||
|
super.breakBlock(world, x, y, z, block, par6);
|
||||||
|
}
|
||||||
|
|
||||||
public static class TheItemBlock extends ItemBlock{
|
public static class TheItemBlock extends ItemBlock{
|
||||||
|
|
||||||
private Block theBlock;
|
private Block theBlock;
|
||||||
|
@ -108,11 +108,6 @@ public class BlockCoalGenerator extends BlockContainerBase implements IActAddIte
|
||||||
this.setMaxDamage(0);
|
this.setMaxDamage(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public EnumRarity getRarity(ItemStack stack){
|
|
||||||
return EnumRarity.uncommon;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getUnlocalizedName(ItemStack stack){
|
public String getUnlocalizedName(ItemStack stack){
|
||||||
return this.getUnlocalizedName();
|
return this.getUnlocalizedName();
|
||||||
|
@ -122,5 +117,10 @@ public class BlockCoalGenerator extends BlockContainerBase implements IActAddIte
|
||||||
public int getMetadata(int damage){
|
public int getMetadata(int damage){
|
||||||
return damage;
|
return damage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EnumRarity getRarity(ItemStack stack){
|
||||||
|
return EnumRarity.uncommon;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,6 +44,38 @@ public class BlockCoffeeMachine extends BlockContainerBase implements IActAddIte
|
||||||
this.setBlockBounds(f, 0F, f, 1F-f, 1F-2*f, 1F-f);
|
this.setBlockBounds(f, 0F, f, 1F-f, 1F-2*f, 1F-f);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean renderAsNormalBlock(){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getRenderType(){
|
||||||
|
return AssetUtil.COFFEE_MACHINE_RENDER_ID;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IIcon getIcon(int side, int metadata){
|
||||||
|
return this.blockIcon;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isOpaqueCube(){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int f6, float f7, float f8, float f9){
|
||||||
|
if(!world.isRemote){
|
||||||
|
TileEntityCoffeeMachine machine = (TileEntityCoffeeMachine)world.getTileEntity(x, y, z);
|
||||||
|
if(machine != null){
|
||||||
|
player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.COFFEE_MACHINE.ordinal(), world, x, y, z);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack stack){
|
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack stack){
|
||||||
int rotation = MathHelper.floor_double((double)(player.rotationYaw*4.0F/360.0F)+0.5D) & 3;
|
int rotation = MathHelper.floor_double((double)(player.rotationYaw*4.0F/360.0F)+0.5D) & 3;
|
||||||
|
@ -62,44 +94,12 @@ public class BlockCoffeeMachine extends BlockContainerBase implements IActAddIte
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int f6, float f7, float f8, float f9){
|
|
||||||
if(!world.isRemote){
|
|
||||||
TileEntityCoffeeMachine machine = (TileEntityCoffeeMachine)world.getTileEntity(x, y, z);
|
|
||||||
if(machine != null){
|
|
||||||
player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.COFFEE_MACHINE.ordinal(), world, x, y, z);
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public IIcon getIcon(int side, int metadata){
|
|
||||||
return this.blockIcon;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void registerBlockIcons(IIconRegister iconReg){
|
public void registerBlockIcons(IIconRegister iconReg){
|
||||||
this.blockIcon = Blocks.coal_block.getIcon(0, 0);
|
this.blockIcon = Blocks.coal_block.getIcon(0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isOpaqueCube(){
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean renderAsNormalBlock(){
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getRenderType(){
|
|
||||||
return AssetUtil.COFFEE_MACHINE_RENDER_ID;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TileEntity createNewTileEntity(World world, int meta){
|
public TileEntity createNewTileEntity(World world, int meta){
|
||||||
return new TileEntityCoffeeMachine();
|
return new TileEntityCoffeeMachine();
|
||||||
|
@ -127,11 +127,6 @@ public class BlockCoffeeMachine extends BlockContainerBase implements IActAddIte
|
||||||
this.setMaxDamage(0);
|
this.setMaxDamage(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public EnumRarity getRarity(ItemStack stack){
|
|
||||||
return EnumRarity.rare;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getUnlocalizedName(ItemStack stack){
|
public String getUnlocalizedName(ItemStack stack){
|
||||||
return this.getUnlocalizedName();
|
return this.getUnlocalizedName();
|
||||||
|
@ -141,5 +136,10 @@ public class BlockCoffeeMachine extends BlockContainerBase implements IActAddIte
|
||||||
public int getMetadata(int damage){
|
public int getMetadata(int damage){
|
||||||
return damage;
|
return damage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EnumRarity getRarity(ItemStack stack){
|
||||||
|
return EnumRarity.rare;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,8 +48,23 @@ public class BlockColoredLamp extends Block implements IActAddItemOrBlock{
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getLightValue(IBlockAccess world, int x, int y, int z){
|
public String getName(){
|
||||||
return this.isOn ? 15 : 0;
|
return this.isOn ? "blockColoredLampOn" : "blockColoredLamp";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IIcon getIcon(int side, int meta){
|
||||||
|
return meta >= allLampTypes.length ? null : textures[meta];
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Item getItemDropped(int par1, Random rand, int par3){
|
||||||
|
return Item.getItemFromBlock(InitBlocks.blockColoredLamp);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int damageDropped(int meta){
|
||||||
|
return meta;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -86,13 +101,14 @@ public class BlockColoredLamp extends Block implements IActAddItemOrBlock{
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getName(){
|
public ItemStack createStackedBlock(int meta){
|
||||||
return this.isOn ? "blockColoredLampOn" : "blockColoredLamp";
|
return new ItemStack(InitBlocks.blockColoredLamp, 1, meta);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IIcon getIcon(int side, int meta){
|
@SideOnly(Side.CLIENT)
|
||||||
return meta >= allLampTypes.length ? null : textures[meta];
|
public Item getItem(World world, int x, int y, int z){
|
||||||
|
return Item.getItemFromBlock(InitBlocks.blockColoredLamp);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("all")
|
@SuppressWarnings("all")
|
||||||
|
@ -103,27 +119,6 @@ public class BlockColoredLamp extends Block implements IActAddItemOrBlock{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public Item getItemDropped(int par1, Random rand, int par3){
|
|
||||||
return Item.getItemFromBlock(InitBlocks.blockColoredLamp);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
public Item getItem(World world, int x, int y, int z){
|
|
||||||
return Item.getItemFromBlock(InitBlocks.blockColoredLamp);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ItemStack createStackedBlock(int meta){
|
|
||||||
return new ItemStack(InitBlocks.blockColoredLamp, 1, meta);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int damageDropped(int meta){
|
|
||||||
return meta;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void registerBlockIcons(IIconRegister iconReg){
|
public void registerBlockIcons(IIconRegister iconReg){
|
||||||
|
@ -132,6 +127,11 @@ public class BlockColoredLamp extends Block implements IActAddItemOrBlock{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getLightValue(IBlockAccess world, int x, int y, int z){
|
||||||
|
return this.isOn ? 15 : 0;
|
||||||
|
}
|
||||||
|
|
||||||
public static class TheItemBlock extends ItemBlock{
|
public static class TheItemBlock extends ItemBlock{
|
||||||
|
|
||||||
private Block theBlock;
|
private Block theBlock;
|
||||||
|
@ -143,16 +143,6 @@ public class BlockColoredLamp extends Block implements IActAddItemOrBlock{
|
||||||
this.setMaxDamage(0);
|
this.setMaxDamage(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public EnumRarity getRarity(ItemStack stack){
|
|
||||||
return EnumRarity.rare;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getUnlocalizedName(ItemStack stack){
|
|
||||||
return InitBlocks.blockColoredLamp.getUnlocalizedName()+allLampTypes[stack.getItemDamage()].getName();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getMetadata(int damage){
|
public int getMetadata(int damage){
|
||||||
return damage;
|
return damage;
|
||||||
|
@ -165,5 +155,15 @@ public class BlockColoredLamp extends Block implements IActAddItemOrBlock{
|
||||||
}
|
}
|
||||||
return StringUtil.localize(this.getUnlocalizedName(stack)+".name")+(((BlockColoredLamp)this.theBlock).isOn ? " ("+StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".onSuffix.desc")+")" : "");
|
return StringUtil.localize(this.getUnlocalizedName(stack)+".name")+(((BlockColoredLamp)this.theBlock).isOn ? " ("+StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".onSuffix.desc")+")" : "");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EnumRarity getRarity(ItemStack stack){
|
||||||
|
return EnumRarity.rare;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getUnlocalizedName(ItemStack stack){
|
||||||
|
return InitBlocks.blockColoredLamp.getUnlocalizedName()+allLampTypes[stack.getItemDamage()].getName();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -47,6 +47,42 @@ public class BlockCompost extends BlockContainerBase implements IActAddItemOrBlo
|
||||||
this.setBlockBoundsForItemRender();
|
this.setBlockBoundsForItemRender();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean renderAsNormalBlock(){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getRenderType(){
|
||||||
|
return AssetUtil.COMPOST_RENDER_ID;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IIcon getIcon(int side, int metadata){
|
||||||
|
return this.blockIcon;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addCollisionBoxesToList(World world, int x, int y, int z, AxisAlignedBB mask, List list, Entity collidingEntity){
|
||||||
|
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.3125F, 1.0F);
|
||||||
|
super.addCollisionBoxesToList(world, x, y, z, mask, list, collidingEntity);
|
||||||
|
float f = 0.125F;
|
||||||
|
this.setBlockBounds(0.0F, 0.0F, 0.0F, f, 1.0F, 1.0F);
|
||||||
|
super.addCollisionBoxesToList(world, x, y, z, mask, list, collidingEntity);
|
||||||
|
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, f);
|
||||||
|
super.addCollisionBoxesToList(world, x, y, z, mask, list, collidingEntity);
|
||||||
|
this.setBlockBounds(1.0F-f, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
|
||||||
|
super.addCollisionBoxesToList(world, x, y, z, mask, list, collidingEntity);
|
||||||
|
this.setBlockBounds(0.0F, 0.0F, 1.0F-f, 1.0F, 1.0F, 1.0F);
|
||||||
|
super.addCollisionBoxesToList(world, x, y, z, mask, list, collidingEntity);
|
||||||
|
this.setBlockBoundsForItemRender();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isOpaqueCube(){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int f6, float f7, float f8, float f9){
|
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int f6, float f7, float f8, float f9){
|
||||||
if(!world.isRemote){
|
if(!world.isRemote){
|
||||||
|
@ -79,33 +115,6 @@ public class BlockCompost extends BlockContainerBase implements IActAddItemOrBlo
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void addCollisionBoxesToList(World world, int x, int y, int z, AxisAlignedBB mask, List list, Entity collidingEntity){
|
|
||||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.3125F, 1.0F);
|
|
||||||
super.addCollisionBoxesToList(world, x, y, z, mask, list, collidingEntity);
|
|
||||||
float f = 0.125F;
|
|
||||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, f, 1.0F, 1.0F);
|
|
||||||
super.addCollisionBoxesToList(world, x, y, z, mask, list, collidingEntity);
|
|
||||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, f);
|
|
||||||
super.addCollisionBoxesToList(world, x, y, z, mask, list, collidingEntity);
|
|
||||||
this.setBlockBounds(1.0F-f, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
|
|
||||||
super.addCollisionBoxesToList(world, x, y, z, mask, list, collidingEntity);
|
|
||||||
this.setBlockBounds(0.0F, 0.0F, 1.0F-f, 1.0F, 1.0F, 1.0F);
|
|
||||||
super.addCollisionBoxesToList(world, x, y, z, mask, list, collidingEntity);
|
|
||||||
this.setBlockBoundsForItemRender();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public IIcon getIcon(int side, int metadata){
|
|
||||||
return this.blockIcon;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
public void registerBlockIcons(IIconRegister iconReg){
|
|
||||||
this.blockIcon = Blocks.planks.getIcon(0, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setBlockBoundsForItemRender(){
|
public void setBlockBoundsForItemRender(){
|
||||||
float f = 1.0F/16.0F;
|
float f = 1.0F/16.0F;
|
||||||
|
@ -113,18 +122,9 @@ public class BlockCompost extends BlockContainerBase implements IActAddItemOrBlo
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isOpaqueCube(){
|
@SideOnly(Side.CLIENT)
|
||||||
return false;
|
public void registerBlockIcons(IIconRegister iconReg){
|
||||||
}
|
this.blockIcon = Blocks.planks.getIcon(0, 0);
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean renderAsNormalBlock(){
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getRenderType(){
|
|
||||||
return AssetUtil.COMPOST_RENDER_ID;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -154,11 +154,6 @@ public class BlockCompost extends BlockContainerBase implements IActAddItemOrBlo
|
||||||
this.setMaxDamage(0);
|
this.setMaxDamage(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public EnumRarity getRarity(ItemStack stack){
|
|
||||||
return EnumRarity.uncommon;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getUnlocalizedName(ItemStack stack){
|
public String getUnlocalizedName(ItemStack stack){
|
||||||
return this.getUnlocalizedName();
|
return this.getUnlocalizedName();
|
||||||
|
@ -168,5 +163,10 @@ public class BlockCompost extends BlockContainerBase implements IActAddItemOrBlo
|
||||||
public int getMetadata(int damage){
|
public int getMetadata(int damage){
|
||||||
return damage;
|
return damage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EnumRarity getRarity(ItemStack stack){
|
||||||
|
return EnumRarity.uncommon;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,28 +44,11 @@ public class BlockDropper extends BlockContainerBase implements IActAddItemOrBlo
|
||||||
this.setStepSound(soundTypeStone);
|
this.setStepSound(soundTypeStone);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack stack){
|
|
||||||
int rotation = BlockPistonBase.determineOrientation(world, x, y, z, player);
|
|
||||||
world.setBlockMetadataWithNotify(x, y, z, rotation, 2);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TileEntity createNewTileEntity(World world, int par2){
|
public TileEntity createNewTileEntity(World world, int par2){
|
||||||
return new TileEntityDropper();
|
return new TileEntityDropper();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public IIcon getIcon(int side, int meta){
|
|
||||||
if(side == 0 || side == 1){
|
|
||||||
return this.topIcon;
|
|
||||||
}
|
|
||||||
if(side == 3){
|
|
||||||
return this.frontIcon;
|
|
||||||
}
|
|
||||||
return this.blockIcon;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side){
|
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side){
|
||||||
int meta = world.getBlockMetadata(x, y, z);
|
int meta = world.getBlockMetadata(x, y, z);
|
||||||
|
@ -79,11 +62,14 @@ public class BlockDropper extends BlockContainerBase implements IActAddItemOrBlo
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
public IIcon getIcon(int side, int meta){
|
||||||
public void registerBlockIcons(IIconRegister iconReg){
|
if(side == 0 || side == 1){
|
||||||
this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName());
|
return this.topIcon;
|
||||||
this.frontIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Front");
|
}
|
||||||
this.topIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Top");
|
if(side == 3){
|
||||||
|
return this.frontIcon;
|
||||||
|
}
|
||||||
|
return this.blockIcon;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -99,9 +85,17 @@ public class BlockDropper extends BlockContainerBase implements IActAddItemOrBlo
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void breakBlock(World world, int x, int y, int z, Block block, int par6){
|
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack stack){
|
||||||
this.dropInventory(world, x, y, z);
|
int rotation = BlockPistonBase.determineOrientation(world, x, y, z, player);
|
||||||
super.breakBlock(world, x, y, z, block, par6);
|
world.setBlockMetadataWithNotify(x, y, z, rotation, 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void registerBlockIcons(IIconRegister iconReg){
|
||||||
|
this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName());
|
||||||
|
this.frontIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Front");
|
||||||
|
this.topIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Top");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -109,6 +103,12 @@ public class BlockDropper extends BlockContainerBase implements IActAddItemOrBlo
|
||||||
return "blockDropper";
|
return "blockDropper";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void breakBlock(World world, int x, int y, int z, Block block, int par6){
|
||||||
|
this.dropInventory(world, x, y, z);
|
||||||
|
super.breakBlock(world, x, y, z, block, par6);
|
||||||
|
}
|
||||||
|
|
||||||
public static class TheItemBlock extends ItemBlock{
|
public static class TheItemBlock extends ItemBlock{
|
||||||
|
|
||||||
private Block theBlock;
|
private Block theBlock;
|
||||||
|
@ -120,11 +120,6 @@ public class BlockDropper extends BlockContainerBase implements IActAddItemOrBlo
|
||||||
this.setMaxDamage(0);
|
this.setMaxDamage(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public EnumRarity getRarity(ItemStack stack){
|
|
||||||
return EnumRarity.rare;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getUnlocalizedName(ItemStack stack){
|
public String getUnlocalizedName(ItemStack stack){
|
||||||
return this.getUnlocalizedName();
|
return this.getUnlocalizedName();
|
||||||
|
@ -134,5 +129,10 @@ public class BlockDropper extends BlockContainerBase implements IActAddItemOrBlo
|
||||||
public int getMetadata(int damage){
|
public int getMetadata(int damage){
|
||||||
return damage;
|
return damage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EnumRarity getRarity(ItemStack stack){
|
||||||
|
return EnumRarity.rare;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -54,14 +54,6 @@ public class BlockEnergizer extends BlockContainerBase implements IActAddItemOrB
|
||||||
return side == 1 ? this.topIcon : (side == 0 ? this.blockIcon : this.sideIcon);
|
return side == 1 ? this.topIcon : (side == 0 ? this.blockIcon : this.sideIcon);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
public void registerBlockIcons(IIconRegister iconReg){
|
|
||||||
this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName());
|
|
||||||
this.topIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Top");
|
|
||||||
this.sideIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Side");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9){
|
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9){
|
||||||
if(!world.isRemote){
|
if(!world.isRemote){
|
||||||
|
@ -83,9 +75,11 @@ public class BlockEnergizer extends BlockContainerBase implements IActAddItemOrB
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void breakBlock(World world, int x, int y, int z, Block block, int par6){
|
@SideOnly(Side.CLIENT)
|
||||||
this.dropInventory(world, x, y, z);
|
public void registerBlockIcons(IIconRegister iconReg){
|
||||||
super.breakBlock(world, x, y, z, block, par6);
|
this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName());
|
||||||
|
this.topIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Top");
|
||||||
|
this.sideIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Side");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -93,6 +87,12 @@ public class BlockEnergizer extends BlockContainerBase implements IActAddItemOrB
|
||||||
return this.isEnergizer ? "blockEnergizer" : "blockEnervator";
|
return this.isEnergizer ? "blockEnergizer" : "blockEnervator";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void breakBlock(World world, int x, int y, int z, Block block, int par6){
|
||||||
|
this.dropInventory(world, x, y, z);
|
||||||
|
super.breakBlock(world, x, y, z, block, par6);
|
||||||
|
}
|
||||||
|
|
||||||
public static class TheItemBlock extends ItemBlock{
|
public static class TheItemBlock extends ItemBlock{
|
||||||
|
|
||||||
private Block theBlock;
|
private Block theBlock;
|
||||||
|
@ -104,11 +104,6 @@ public class BlockEnergizer extends BlockContainerBase implements IActAddItemOrB
|
||||||
this.setMaxDamage(0);
|
this.setMaxDamage(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public EnumRarity getRarity(ItemStack stack){
|
|
||||||
return EnumRarity.uncommon;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getUnlocalizedName(ItemStack stack){
|
public String getUnlocalizedName(ItemStack stack){
|
||||||
return this.getUnlocalizedName();
|
return this.getUnlocalizedName();
|
||||||
|
@ -118,5 +113,10 @@ public class BlockEnergizer extends BlockContainerBase implements IActAddItemOrB
|
||||||
public int getMetadata(int damage){
|
public int getMetadata(int damage){
|
||||||
return damage;
|
return damage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EnumRarity getRarity(ItemStack stack){
|
||||||
|
return EnumRarity.uncommon;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,13 +50,6 @@ public class BlockFeeder extends BlockContainerBase implements IActAddItemOrBloc
|
||||||
return (side == 0 || side == 1) ? this.topIcon : this.blockIcon;
|
return (side == 0 || side == 1) ? this.topIcon : this.blockIcon;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
public void registerBlockIcons(IIconRegister iconReg){
|
|
||||||
this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName());
|
|
||||||
this.topIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Top");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9){
|
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9){
|
||||||
if(!world.isRemote){
|
if(!world.isRemote){
|
||||||
|
@ -70,9 +63,10 @@ public class BlockFeeder extends BlockContainerBase implements IActAddItemOrBloc
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void breakBlock(World world, int x, int y, int z, Block block, int par6){
|
@SideOnly(Side.CLIENT)
|
||||||
this.dropInventory(world, x, y, z);
|
public void registerBlockIcons(IIconRegister iconReg){
|
||||||
super.breakBlock(world, x, y, z, block, par6);
|
this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName());
|
||||||
|
this.topIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Top");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -80,6 +74,12 @@ public class BlockFeeder extends BlockContainerBase implements IActAddItemOrBloc
|
||||||
return "blockFeeder";
|
return "blockFeeder";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void breakBlock(World world, int x, int y, int z, Block block, int par6){
|
||||||
|
this.dropInventory(world, x, y, z);
|
||||||
|
super.breakBlock(world, x, y, z, block, par6);
|
||||||
|
}
|
||||||
|
|
||||||
public static class TheItemBlock extends ItemBlock{
|
public static class TheItemBlock extends ItemBlock{
|
||||||
|
|
||||||
private Block theBlock;
|
private Block theBlock;
|
||||||
|
@ -91,11 +91,6 @@ public class BlockFeeder extends BlockContainerBase implements IActAddItemOrBloc
|
||||||
this.setMaxDamage(0);
|
this.setMaxDamage(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public EnumRarity getRarity(ItemStack stack){
|
|
||||||
return EnumRarity.rare;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getUnlocalizedName(ItemStack stack){
|
public String getUnlocalizedName(ItemStack stack){
|
||||||
return this.getUnlocalizedName();
|
return this.getUnlocalizedName();
|
||||||
|
@ -105,5 +100,10 @@ public class BlockFeeder extends BlockContainerBase implements IActAddItemOrBloc
|
||||||
public int getMetadata(int damage){
|
public int getMetadata(int damage){
|
||||||
return damage;
|
return damage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EnumRarity getRarity(ItemStack stack){
|
||||||
|
return EnumRarity.rare;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,6 +45,17 @@ public class BlockFermentingBarrel extends BlockContainerBase implements IActAdd
|
||||||
return new TileEntityFermentingBarrel();
|
return new TileEntityFermentingBarrel();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void breakBlock(World world, int x, int y, int z, Block block, int par6){
|
||||||
|
this.dropInventory(world, x, y, z);
|
||||||
|
super.breakBlock(world, x, y, z, block, par6);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IIcon getIcon(int side, int metadata){
|
||||||
|
return side <= 1 ? this.iconTop : this.blockIcon;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9){
|
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9){
|
||||||
if(!world.isRemote){
|
if(!world.isRemote){
|
||||||
|
@ -57,17 +68,6 @@ public class BlockFermentingBarrel extends BlockContainerBase implements IActAdd
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void breakBlock(World world, int x, int y, int z, Block block, int par6){
|
|
||||||
this.dropInventory(world, x, y, z);
|
|
||||||
super.breakBlock(world, x, y, z, block, par6);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public IIcon getIcon(int side, int metadata){
|
|
||||||
return side <= 1 ? this.iconTop : this.blockIcon;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void registerBlockIcons(IIconRegister iconReg){
|
public void registerBlockIcons(IIconRegister iconReg){
|
||||||
|
@ -91,11 +91,6 @@ public class BlockFermentingBarrel extends BlockContainerBase implements IActAdd
|
||||||
this.setMaxDamage(0);
|
this.setMaxDamage(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public EnumRarity getRarity(ItemStack stack){
|
|
||||||
return EnumRarity.uncommon;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getUnlocalizedName(ItemStack stack){
|
public String getUnlocalizedName(ItemStack stack){
|
||||||
return this.getUnlocalizedName();
|
return this.getUnlocalizedName();
|
||||||
|
@ -105,5 +100,10 @@ public class BlockFermentingBarrel extends BlockContainerBase implements IActAdd
|
||||||
public int getMetadata(int meta){
|
public int getMetadata(int meta){
|
||||||
return meta;
|
return meta;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EnumRarity getRarity(ItemStack stack){
|
||||||
|
return EnumRarity.uncommon;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,14 +43,18 @@ public class BlockFishingNet extends BlockContainerBase implements IActAddItemOr
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IIcon getIcon(int side, int metadata){
|
public boolean renderAsNormalBlock(){
|
||||||
return this.blockIcon;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
public int getRenderType(){
|
||||||
public void registerBlockIcons(IIconRegister iconReg){
|
return AssetUtil.FISHING_NET_RENDER_ID;
|
||||||
this.blockIcon = Blocks.planks.getIcon(0, 0);
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IIcon getIcon(int side, int metadata){
|
||||||
|
return this.blockIcon;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -59,13 +63,9 @@ public class BlockFishingNet extends BlockContainerBase implements IActAddItemOr
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean renderAsNormalBlock(){
|
@SideOnly(Side.CLIENT)
|
||||||
return false;
|
public void registerBlockIcons(IIconRegister iconReg){
|
||||||
}
|
this.blockIcon = Blocks.planks.getIcon(0, 0);
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getRenderType(){
|
|
||||||
return AssetUtil.FISHING_NET_RENDER_ID;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -84,11 +84,6 @@ public class BlockFishingNet extends BlockContainerBase implements IActAddItemOr
|
||||||
this.setMaxDamage(0);
|
this.setMaxDamage(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public EnumRarity getRarity(ItemStack stack){
|
|
||||||
return EnumRarity.uncommon;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getUnlocalizedName(ItemStack stack){
|
public String getUnlocalizedName(ItemStack stack){
|
||||||
return this.getUnlocalizedName();
|
return this.getUnlocalizedName();
|
||||||
|
@ -98,5 +93,10 @@ public class BlockFishingNet extends BlockContainerBase implements IActAddItemOr
|
||||||
public int getMetadata(int meta){
|
public int getMetadata(int meta){
|
||||||
return meta;
|
return meta;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EnumRarity getRarity(ItemStack stack){
|
||||||
|
return EnumRarity.uncommon;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,28 +47,11 @@ public class BlockFluidCollector extends BlockContainerBase implements IActAddIt
|
||||||
this.setStepSound(soundTypeStone);
|
this.setStepSound(soundTypeStone);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack stack){
|
|
||||||
int rotation = BlockPistonBase.determineOrientation(world, x, y, z, player);
|
|
||||||
world.setBlockMetadataWithNotify(x, y, z, rotation, 2);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TileEntity createNewTileEntity(World world, int par2){
|
public TileEntity createNewTileEntity(World world, int par2){
|
||||||
return this.isPlacer ? new TileEntityFluidCollector.TileEntityFluidPlacer() : new TileEntityFluidCollector();
|
return this.isPlacer ? new TileEntityFluidCollector.TileEntityFluidPlacer() : new TileEntityFluidCollector();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public IIcon getIcon(int side, int meta){
|
|
||||||
if(side == 0 || side == 1){
|
|
||||||
return this.topIcon;
|
|
||||||
}
|
|
||||||
if(side == 3){
|
|
||||||
return this.frontIcon;
|
|
||||||
}
|
|
||||||
return this.blockIcon;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side){
|
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side){
|
||||||
int meta = world.getBlockMetadata(x, y, z);
|
int meta = world.getBlockMetadata(x, y, z);
|
||||||
|
@ -82,11 +65,14 @@ public class BlockFluidCollector extends BlockContainerBase implements IActAddIt
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
public IIcon getIcon(int side, int meta){
|
||||||
public void registerBlockIcons(IIconRegister iconReg){
|
if(side == 0 || side == 1){
|
||||||
this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName());
|
return this.topIcon;
|
||||||
this.frontIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Front");
|
}
|
||||||
this.topIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Top");
|
if(side == 3){
|
||||||
|
return this.frontIcon;
|
||||||
|
}
|
||||||
|
return this.blockIcon;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -102,9 +88,17 @@ public class BlockFluidCollector extends BlockContainerBase implements IActAddIt
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void breakBlock(World world, int x, int y, int z, Block block, int par6){
|
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack stack){
|
||||||
this.dropInventory(world, x, y, z);
|
int rotation = BlockPistonBase.determineOrientation(world, x, y, z, player);
|
||||||
super.breakBlock(world, x, y, z, block, par6);
|
world.setBlockMetadataWithNotify(x, y, z, rotation, 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void registerBlockIcons(IIconRegister iconReg){
|
||||||
|
this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName());
|
||||||
|
this.frontIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Front");
|
||||||
|
this.topIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Top");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -112,6 +106,12 @@ public class BlockFluidCollector extends BlockContainerBase implements IActAddIt
|
||||||
return this.isPlacer ? "blockFluidPlacer" : "blockFluidCollector";
|
return this.isPlacer ? "blockFluidPlacer" : "blockFluidCollector";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void breakBlock(World world, int x, int y, int z, Block block, int par6){
|
||||||
|
this.dropInventory(world, x, y, z);
|
||||||
|
super.breakBlock(world, x, y, z, block, par6);
|
||||||
|
}
|
||||||
|
|
||||||
public static class TheItemBlock extends ItemBlock{
|
public static class TheItemBlock extends ItemBlock{
|
||||||
|
|
||||||
private Block theBlock;
|
private Block theBlock;
|
||||||
|
@ -123,11 +123,6 @@ public class BlockFluidCollector extends BlockContainerBase implements IActAddIt
|
||||||
this.setMaxDamage(0);
|
this.setMaxDamage(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public EnumRarity getRarity(ItemStack stack){
|
|
||||||
return EnumRarity.rare;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getUnlocalizedName(ItemStack stack){
|
public String getUnlocalizedName(ItemStack stack){
|
||||||
return this.getUnlocalizedName();
|
return this.getUnlocalizedName();
|
||||||
|
@ -137,5 +132,10 @@ public class BlockFluidCollector extends BlockContainerBase implements IActAddIt
|
||||||
public int getMetadata(int damage){
|
public int getMetadata(int damage){
|
||||||
return damage;
|
return damage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EnumRarity getRarity(ItemStack stack){
|
||||||
|
return EnumRarity.rare;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -78,11 +78,6 @@ public class BlockFluidFlowing extends BlockFluidClassic implements IActAddItemO
|
||||||
this.setMaxDamage(0);
|
this.setMaxDamage(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public EnumRarity getRarity(ItemStack stack){
|
|
||||||
return EnumRarity.uncommon;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getUnlocalizedName(ItemStack stack){
|
public String getUnlocalizedName(ItemStack stack){
|
||||||
return this.getUnlocalizedName();
|
return this.getUnlocalizedName();
|
||||||
|
@ -92,5 +87,10 @@ public class BlockFluidFlowing extends BlockFluidClassic implements IActAddItemO
|
||||||
public int getMetadata(int damage){
|
public int getMetadata(int damage){
|
||||||
return damage;
|
return damage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EnumRarity getRarity(ItemStack stack){
|
||||||
|
return EnumRarity.uncommon;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,45 +48,11 @@ public class BlockFurnaceDouble extends BlockContainerBase implements IActAddIte
|
||||||
this.setTickRandomly(true);
|
this.setTickRandomly(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack stack){
|
|
||||||
int rotation = MathHelper.floor_double((double)(player.rotationYaw*4.0F/360.0F)+0.5D) & 3;
|
|
||||||
|
|
||||||
if(rotation == 0){
|
|
||||||
world.setBlockMetadataWithNotify(x, y, z, 0, 2);
|
|
||||||
}
|
|
||||||
if(rotation == 1){
|
|
||||||
world.setBlockMetadataWithNotify(x, y, z, 3, 2);
|
|
||||||
}
|
|
||||||
if(rotation == 2){
|
|
||||||
world.setBlockMetadataWithNotify(x, y, z, 1, 2);
|
|
||||||
}
|
|
||||||
if(rotation == 3){
|
|
||||||
world.setBlockMetadataWithNotify(x, y, z, 2, 2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TileEntity createNewTileEntity(World world, int par2){
|
public TileEntity createNewTileEntity(World world, int par2){
|
||||||
return new TileEntityFurnaceDouble();
|
return new TileEntityFurnaceDouble();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getLightValue(IBlockAccess world, int x, int y, int z){
|
|
||||||
return world.getBlockMetadata(x, y, z) > 3 ? 12 : 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public IIcon getIcon(int side, int meta){
|
|
||||||
if(side == 1){
|
|
||||||
return this.topIcon;
|
|
||||||
}
|
|
||||||
if(side == 3){
|
|
||||||
return this.frontIcon;
|
|
||||||
}
|
|
||||||
return this.blockIcon;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side){
|
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side){
|
||||||
int meta = world.getBlockMetadata(x, y, z);
|
int meta = world.getBlockMetadata(x, y, z);
|
||||||
|
@ -103,24 +69,14 @@ public class BlockFurnaceDouble extends BlockContainerBase implements IActAddIte
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
public IIcon getIcon(int side, int meta){
|
||||||
public void registerBlockIcons(IIconRegister iconReg){
|
if(side == 1){
|
||||||
this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName());
|
return this.topIcon;
|
||||||
this.topIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Top");
|
|
||||||
this.onIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"On");
|
|
||||||
this.frontIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Front");
|
|
||||||
}
|
}
|
||||||
|
if(side == 3){
|
||||||
@Override
|
return this.frontIcon;
|
||||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9){
|
|
||||||
if(!world.isRemote){
|
|
||||||
TileEntityFurnaceDouble furnace = (TileEntityFurnaceDouble)world.getTileEntity(x, y, z);
|
|
||||||
if(furnace != null){
|
|
||||||
player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.FURNACE_DOUBLE.ordinal(), world, x, y, z);
|
|
||||||
}
|
}
|
||||||
return true;
|
return this.blockIcon;
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -159,9 +115,47 @@ public class BlockFurnaceDouble extends BlockContainerBase implements IActAddIte
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void breakBlock(World world, int x, int y, int z, Block block, int par6){
|
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9){
|
||||||
this.dropInventory(world, x, y, z);
|
if(!world.isRemote){
|
||||||
super.breakBlock(world, x, y, z, block, par6);
|
TileEntityFurnaceDouble furnace = (TileEntityFurnaceDouble)world.getTileEntity(x, y, z);
|
||||||
|
if(furnace != null){
|
||||||
|
player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.FURNACE_DOUBLE.ordinal(), world, x, y, z);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack stack){
|
||||||
|
int rotation = MathHelper.floor_double((double)(player.rotationYaw*4.0F/360.0F)+0.5D) & 3;
|
||||||
|
|
||||||
|
if(rotation == 0){
|
||||||
|
world.setBlockMetadataWithNotify(x, y, z, 0, 2);
|
||||||
|
}
|
||||||
|
if(rotation == 1){
|
||||||
|
world.setBlockMetadataWithNotify(x, y, z, 3, 2);
|
||||||
|
}
|
||||||
|
if(rotation == 2){
|
||||||
|
world.setBlockMetadataWithNotify(x, y, z, 1, 2);
|
||||||
|
}
|
||||||
|
if(rotation == 3){
|
||||||
|
world.setBlockMetadataWithNotify(x, y, z, 2, 2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void registerBlockIcons(IIconRegister iconReg){
|
||||||
|
this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName());
|
||||||
|
this.topIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Top");
|
||||||
|
this.onIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"On");
|
||||||
|
this.frontIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Front");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getLightValue(IBlockAccess world, int x, int y, int z){
|
||||||
|
return world.getBlockMetadata(x, y, z) > 3 ? 12 : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -169,6 +163,12 @@ public class BlockFurnaceDouble extends BlockContainerBase implements IActAddIte
|
||||||
return "blockFurnaceDouble";
|
return "blockFurnaceDouble";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void breakBlock(World world, int x, int y, int z, Block block, int par6){
|
||||||
|
this.dropInventory(world, x, y, z);
|
||||||
|
super.breakBlock(world, x, y, z, block, par6);
|
||||||
|
}
|
||||||
|
|
||||||
public static class TheItemBlock extends ItemBlock{
|
public static class TheItemBlock extends ItemBlock{
|
||||||
|
|
||||||
private Block theBlock;
|
private Block theBlock;
|
||||||
|
@ -180,11 +180,6 @@ public class BlockFurnaceDouble extends BlockContainerBase implements IActAddIte
|
||||||
this.setMaxDamage(0);
|
this.setMaxDamage(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public EnumRarity getRarity(ItemStack stack){
|
|
||||||
return EnumRarity.rare;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getUnlocalizedName(ItemStack stack){
|
public String getUnlocalizedName(ItemStack stack){
|
||||||
return this.getUnlocalizedName();
|
return this.getUnlocalizedName();
|
||||||
|
@ -194,5 +189,10 @@ public class BlockFurnaceDouble extends BlockContainerBase implements IActAddIte
|
||||||
public int getMetadata(int damage){
|
public int getMetadata(int damage){
|
||||||
return damage;
|
return damage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EnumRarity getRarity(ItemStack stack){
|
||||||
|
return EnumRarity.rare;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,14 +43,18 @@ public class BlockFurnaceSolar extends BlockContainerBase implements IActAddItem
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IIcon getIcon(int side, int metadata){
|
public boolean renderAsNormalBlock(){
|
||||||
return this.blockIcon;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
public int getRenderType(){
|
||||||
public void registerBlockIcons(IIconRegister iconReg){
|
return AssetUtil.FURNACE_SOLAR_RENDER_ID;
|
||||||
this.blockIcon = Blocks.daylight_detector.getIcon(0, 0);
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IIcon getIcon(int side, int metadata){
|
||||||
|
return this.blockIcon;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -59,13 +63,9 @@ public class BlockFurnaceSolar extends BlockContainerBase implements IActAddItem
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean renderAsNormalBlock(){
|
@SideOnly(Side.CLIENT)
|
||||||
return false;
|
public void registerBlockIcons(IIconRegister iconReg){
|
||||||
}
|
this.blockIcon = Blocks.daylight_detector.getIcon(0, 0);
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getRenderType(){
|
|
||||||
return AssetUtil.FURNACE_SOLAR_RENDER_ID;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -84,11 +84,6 @@ public class BlockFurnaceSolar extends BlockContainerBase implements IActAddItem
|
||||||
this.setMaxDamage(0);
|
this.setMaxDamage(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public EnumRarity getRarity(ItemStack stack){
|
|
||||||
return EnumRarity.rare;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getUnlocalizedName(ItemStack stack){
|
public String getUnlocalizedName(ItemStack stack){
|
||||||
return this.getUnlocalizedName();
|
return this.getUnlocalizedName();
|
||||||
|
@ -98,5 +93,10 @@ public class BlockFurnaceSolar extends BlockContainerBase implements IActAddItem
|
||||||
public int getMetadata(int meta){
|
public int getMetadata(int meta){
|
||||||
return meta;
|
return meta;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EnumRarity getRarity(ItemStack stack){
|
||||||
|
return EnumRarity.rare;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,11 +35,6 @@ public class BlockGeneric extends Block implements IActAddItemOrBlock{
|
||||||
this.setStepSound(soundTypeStone);
|
this.setStepSound(soundTypeStone);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getName(){
|
|
||||||
return this.name;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IIcon getIcon(int side, int meta){
|
public IIcon getIcon(int side, int meta){
|
||||||
return this.blockIcon;
|
return this.blockIcon;
|
||||||
|
@ -51,6 +46,11 @@ public class BlockGeneric extends Block implements IActAddItemOrBlock{
|
||||||
this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName());
|
this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getName(){
|
||||||
|
return this.name;
|
||||||
|
}
|
||||||
|
|
||||||
public static class TheItemBlock extends ItemBlock{
|
public static class TheItemBlock extends ItemBlock{
|
||||||
|
|
||||||
private Block theBlock;
|
private Block theBlock;
|
||||||
|
@ -62,11 +62,6 @@ public class BlockGeneric extends Block implements IActAddItemOrBlock{
|
||||||
this.setMaxDamage(0);
|
this.setMaxDamage(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public EnumRarity getRarity(ItemStack stack){
|
|
||||||
return EnumRarity.uncommon;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getUnlocalizedName(ItemStack stack){
|
public String getUnlocalizedName(ItemStack stack){
|
||||||
return this.getUnlocalizedName();
|
return this.getUnlocalizedName();
|
||||||
|
@ -76,5 +71,10 @@ public class BlockGeneric extends Block implements IActAddItemOrBlock{
|
||||||
public int getMetadata(int meta){
|
public int getMetadata(int meta){
|
||||||
return meta;
|
return meta;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EnumRarity getRarity(ItemStack stack){
|
||||||
|
return EnumRarity.uncommon;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,14 +51,6 @@ public class BlockGiantChest extends BlockContainerBase implements IActAddItemOr
|
||||||
return side == 1 ? this.topIcon : (side == 0 ? this.bottomIcon : this.blockIcon);
|
return side == 1 ? this.topIcon : (side == 0 ? this.bottomIcon : this.blockIcon);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
public void registerBlockIcons(IIconRegister iconReg){
|
|
||||||
this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName());
|
|
||||||
this.topIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Top");
|
|
||||||
this.bottomIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Bottom");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9){
|
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9){
|
||||||
if(!world.isRemote){
|
if(!world.isRemote){
|
||||||
|
@ -72,9 +64,11 @@ public class BlockGiantChest extends BlockContainerBase implements IActAddItemOr
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void breakBlock(World world, int x, int y, int z, Block block, int par6){
|
@SideOnly(Side.CLIENT)
|
||||||
this.dropInventory(world, x, y, z);
|
public void registerBlockIcons(IIconRegister iconReg){
|
||||||
super.breakBlock(world, x, y, z, block, par6);
|
this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName());
|
||||||
|
this.topIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Top");
|
||||||
|
this.bottomIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Bottom");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -82,6 +76,12 @@ public class BlockGiantChest extends BlockContainerBase implements IActAddItemOr
|
||||||
return "blockGiantChest";
|
return "blockGiantChest";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void breakBlock(World world, int x, int y, int z, Block block, int par6){
|
||||||
|
this.dropInventory(world, x, y, z);
|
||||||
|
super.breakBlock(world, x, y, z, block, par6);
|
||||||
|
}
|
||||||
|
|
||||||
public static class TheItemBlock extends ItemBlock{
|
public static class TheItemBlock extends ItemBlock{
|
||||||
|
|
||||||
private Block theBlock;
|
private Block theBlock;
|
||||||
|
@ -93,11 +93,6 @@ public class BlockGiantChest extends BlockContainerBase implements IActAddItemOr
|
||||||
this.setMaxDamage(0);
|
this.setMaxDamage(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public EnumRarity getRarity(ItemStack stack){
|
|
||||||
return EnumRarity.uncommon;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getUnlocalizedName(ItemStack stack){
|
public String getUnlocalizedName(ItemStack stack){
|
||||||
return this.getUnlocalizedName();
|
return this.getUnlocalizedName();
|
||||||
|
@ -107,6 +102,11 @@ public class BlockGiantChest extends BlockContainerBase implements IActAddItemOr
|
||||||
public int getMetadata(int damage){
|
public int getMetadata(int damage){
|
||||||
return damage;
|
return damage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EnumRarity getRarity(ItemStack stack){
|
||||||
|
return EnumRarity.uncommon;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -37,6 +37,23 @@ public class BlockGreenhouseGlass extends BlockContainerBase implements IActAddI
|
||||||
this.setStepSound(soundTypeStone);
|
this.setStepSound(soundTypeStone);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean renderAsNormalBlock(){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public boolean shouldSideBeRendered(IBlockAccess world, int x, int y, int z, int meta){
|
||||||
|
return world.getBlockMetadata(x, y, z) != world.getBlockMetadata(x-Facing.offsetsXForSide[meta], y-Facing.offsetsYForSide[meta], z-Facing.offsetsZForSide[meta]) || (world.getBlock(x, y, z) != this && super.shouldSideBeRendered(world, x, y, z, meta));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IIcon getIcon(int side, int metadata){
|
||||||
|
return this.blockIcon;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isOpaqueCube(){
|
public boolean isOpaqueCube(){
|
||||||
return false;
|
return false;
|
||||||
|
@ -48,21 +65,6 @@ public class BlockGreenhouseGlass extends BlockContainerBase implements IActAddI
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean renderAsNormalBlock(){
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public TileEntity createNewTileEntity(World world, int par2){
|
|
||||||
return new TileEntityGreenhouseGlass();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public IIcon getIcon(int side, int metadata){
|
|
||||||
return this.blockIcon;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void registerBlockIcons(IIconRegister iconReg){
|
public void registerBlockIcons(IIconRegister iconReg){
|
||||||
|
@ -75,10 +77,8 @@ public class BlockGreenhouseGlass extends BlockContainerBase implements IActAddI
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
public TileEntity createNewTileEntity(World world, int par2){
|
||||||
public boolean shouldSideBeRendered(IBlockAccess world, int x, int y, int z, int meta){
|
return new TileEntityGreenhouseGlass();
|
||||||
return world.getBlockMetadata(x, y, z) != world.getBlockMetadata(x-Facing.offsetsXForSide[meta], y-Facing.offsetsYForSide[meta], z-Facing.offsetsZForSide[meta]) || (world.getBlock(x, y, z) != this && super.shouldSideBeRendered(world, x, y, z, meta));
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class TheItemBlock extends ItemBlock{
|
public static class TheItemBlock extends ItemBlock{
|
||||||
|
@ -92,11 +92,6 @@ public class BlockGreenhouseGlass extends BlockContainerBase implements IActAddI
|
||||||
this.setMaxDamage(0);
|
this.setMaxDamage(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public EnumRarity getRarity(ItemStack stack){
|
|
||||||
return EnumRarity.epic;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getUnlocalizedName(ItemStack stack){
|
public String getUnlocalizedName(ItemStack stack){
|
||||||
return this.getUnlocalizedName();
|
return this.getUnlocalizedName();
|
||||||
|
@ -106,5 +101,10 @@ public class BlockGreenhouseGlass extends BlockContainerBase implements IActAddI
|
||||||
public int getMetadata(int damage){
|
public int getMetadata(int damage){
|
||||||
return damage;
|
return damage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EnumRarity getRarity(ItemStack stack){
|
||||||
|
return EnumRarity.epic;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,11 +53,6 @@ public class BlockGrinder extends BlockContainerBase implements IActAddItemOrBlo
|
||||||
return this.isDouble ? new TileEntityGrinder.TileEntityGrinderDouble() : new TileEntityGrinder();
|
return this.isDouble ? new TileEntityGrinder.TileEntityGrinderDouble() : new TileEntityGrinder();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getLightValue(IBlockAccess world, int x, int y, int z){
|
|
||||||
return world.getBlockMetadata(x, y, z) == 1 ? 12 : 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IIcon getIcon(int side, int meta){
|
public IIcon getIcon(int side, int meta){
|
||||||
if(side == 1 && meta != 1){
|
if(side == 1 && meta != 1){
|
||||||
|
@ -87,15 +82,6 @@ public class BlockGrinder extends BlockContainerBase implements IActAddItemOrBlo
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
public void registerBlockIcons(IIconRegister iconReg){
|
|
||||||
this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName());
|
|
||||||
this.topIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":blockGrinderTop");
|
|
||||||
this.onIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":blockGrinderOn");
|
|
||||||
this.bottomIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":blockGrinderBottom");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9){
|
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9){
|
||||||
if(!world.isRemote){
|
if(!world.isRemote){
|
||||||
|
@ -109,9 +95,17 @@ public class BlockGrinder extends BlockContainerBase implements IActAddItemOrBlo
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void breakBlock(World world, int x, int y, int z, Block block, int par6){
|
@SideOnly(Side.CLIENT)
|
||||||
this.dropInventory(world, x, y, z);
|
public void registerBlockIcons(IIconRegister iconReg){
|
||||||
super.breakBlock(world, x, y, z, block, par6);
|
this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName());
|
||||||
|
this.topIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":blockGrinderTop");
|
||||||
|
this.onIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":blockGrinderOn");
|
||||||
|
this.bottomIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":blockGrinderBottom");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getLightValue(IBlockAccess world, int x, int y, int z){
|
||||||
|
return world.getBlockMetadata(x, y, z) == 1 ? 12 : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -119,6 +113,12 @@ public class BlockGrinder extends BlockContainerBase implements IActAddItemOrBlo
|
||||||
return isDouble ? "blockGrinderDouble" : "blockGrinder";
|
return isDouble ? "blockGrinderDouble" : "blockGrinder";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void breakBlock(World world, int x, int y, int z, Block block, int par6){
|
||||||
|
this.dropInventory(world, x, y, z);
|
||||||
|
super.breakBlock(world, x, y, z, block, par6);
|
||||||
|
}
|
||||||
|
|
||||||
public static class TheItemBlock extends ItemBlock{
|
public static class TheItemBlock extends ItemBlock{
|
||||||
|
|
||||||
private Block theBlock;
|
private Block theBlock;
|
||||||
|
@ -130,11 +130,6 @@ public class BlockGrinder extends BlockContainerBase implements IActAddItemOrBlo
|
||||||
this.setMaxDamage(0);
|
this.setMaxDamage(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public EnumRarity getRarity(ItemStack stack){
|
|
||||||
return ((BlockGrinder)theBlock).isDouble ? EnumRarity.epic : EnumRarity.rare;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getUnlocalizedName(ItemStack stack){
|
public String getUnlocalizedName(ItemStack stack){
|
||||||
return this.getUnlocalizedName();
|
return this.getUnlocalizedName();
|
||||||
|
@ -144,5 +139,10 @@ public class BlockGrinder extends BlockContainerBase implements IActAddItemOrBlo
|
||||||
public int getMetadata(int meta){
|
public int getMetadata(int meta){
|
||||||
return meta;
|
return meta;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EnumRarity getRarity(ItemStack stack){
|
||||||
|
return ((BlockGrinder)theBlock).isDouble ? EnumRarity.epic : EnumRarity.rare;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -72,11 +72,6 @@ public class BlockHeatCollector extends BlockContainerBase implements IActAddIte
|
||||||
this.setMaxDamage(0);
|
this.setMaxDamage(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public EnumRarity getRarity(ItemStack stack){
|
|
||||||
return EnumRarity.rare;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getUnlocalizedName(ItemStack stack){
|
public String getUnlocalizedName(ItemStack stack){
|
||||||
return this.getUnlocalizedName();
|
return this.getUnlocalizedName();
|
||||||
|
@ -86,5 +81,10 @@ public class BlockHeatCollector extends BlockContainerBase implements IActAddIte
|
||||||
public int getMetadata(int damage){
|
public int getMetadata(int damage){
|
||||||
return damage;
|
return damage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EnumRarity getRarity(ItemStack stack){
|
||||||
|
return EnumRarity.rare;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,12 +58,6 @@ public class BlockInputter extends BlockContainerBase implements IActAddItemOrBl
|
||||||
return this.blockIcon;
|
return this.blockIcon;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
public void registerBlockIcons(IIconRegister iconReg){
|
|
||||||
this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9){
|
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9){
|
||||||
if(!world.isRemote){
|
if(!world.isRemote){
|
||||||
|
@ -76,6 +70,17 @@ public class BlockInputter extends BlockContainerBase implements IActAddItemOrBl
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void registerBlockIcons(IIconRegister iconReg){
|
||||||
|
this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getName(){
|
||||||
|
return this.isAdvanced ? "blockInputterAdvanced" : "blockInputter";
|
||||||
|
}
|
||||||
|
|
||||||
@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){
|
||||||
if(!world.isRemote){
|
if(!world.isRemote){
|
||||||
|
@ -88,11 +93,6 @@ public class BlockInputter extends BlockContainerBase implements IActAddItemOrBl
|
||||||
super.breakBlock(world, x, y, z, block, par6);
|
super.breakBlock(world, x, y, z, block, par6);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getName(){
|
|
||||||
return this.isAdvanced ? "blockInputterAdvanced" : "blockInputter";
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class TheItemBlock extends ItemBlock{
|
public static class TheItemBlock extends ItemBlock{
|
||||||
|
|
||||||
private Block theBlock;
|
private Block theBlock;
|
||||||
|
@ -108,8 +108,13 @@ public class BlockInputter extends BlockContainerBase implements IActAddItemOrBl
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public EnumRarity getRarity(ItemStack stack){
|
public String getUnlocalizedName(ItemStack stack){
|
||||||
return ((BlockInputter)theBlock).isAdvanced ? EnumRarity.epic : EnumRarity.rare;
|
return this.getUnlocalizedName();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getMetadata(int damage){
|
||||||
|
return damage;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -126,13 +131,8 @@ public class BlockInputter extends BlockContainerBase implements IActAddItemOrBl
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getUnlocalizedName(ItemStack stack){
|
public EnumRarity getRarity(ItemStack stack){
|
||||||
return this.getUnlocalizedName();
|
return ((BlockInputter)theBlock).isAdvanced ? EnumRarity.epic : EnumRarity.rare;
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getMetadata(int damage){
|
|
||||||
return damage;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,11 +48,6 @@ public class BlockItemRepairer extends BlockContainerBase implements IActAddItem
|
||||||
return new TileEntityItemRepairer();
|
return new TileEntityItemRepairer();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getLightValue(IBlockAccess world, int x, int y, int z){
|
|
||||||
return world.getBlockMetadata(x, y, z) == 1 ? 12 : 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IIcon getIcon(int side, int meta){
|
public IIcon getIcon(int side, int meta){
|
||||||
if(side == 1){
|
if(side == 1){
|
||||||
|
@ -64,14 +59,6 @@ public class BlockItemRepairer extends BlockContainerBase implements IActAddItem
|
||||||
return this.blockIcon;
|
return this.blockIcon;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
public void registerBlockIcons(IIconRegister iconReg){
|
|
||||||
this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName());
|
|
||||||
this.topIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Top");
|
|
||||||
this.bottomIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Bottom");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9){
|
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9){
|
||||||
if(!world.isRemote){
|
if(!world.isRemote){
|
||||||
|
@ -85,9 +72,16 @@ public class BlockItemRepairer extends BlockContainerBase implements IActAddItem
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void breakBlock(World world, int x, int y, int z, Block block, int par6){
|
@SideOnly(Side.CLIENT)
|
||||||
this.dropInventory(world, x, y, z);
|
public void registerBlockIcons(IIconRegister iconReg){
|
||||||
super.breakBlock(world, x, y, z, block, par6);
|
this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName());
|
||||||
|
this.topIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Top");
|
||||||
|
this.bottomIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Bottom");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getLightValue(IBlockAccess world, int x, int y, int z){
|
||||||
|
return world.getBlockMetadata(x, y, z) == 1 ? 12 : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -95,6 +89,12 @@ public class BlockItemRepairer extends BlockContainerBase implements IActAddItem
|
||||||
return "blockItemRepairer";
|
return "blockItemRepairer";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void breakBlock(World world, int x, int y, int z, Block block, int par6){
|
||||||
|
this.dropInventory(world, x, y, z);
|
||||||
|
super.breakBlock(world, x, y, z, block, par6);
|
||||||
|
}
|
||||||
|
|
||||||
public static class TheItemBlock extends ItemBlock{
|
public static class TheItemBlock extends ItemBlock{
|
||||||
|
|
||||||
private Block theBlock;
|
private Block theBlock;
|
||||||
|
@ -106,11 +106,6 @@ public class BlockItemRepairer extends BlockContainerBase implements IActAddItem
|
||||||
this.setMaxDamage(0);
|
this.setMaxDamage(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public EnumRarity getRarity(ItemStack stack){
|
|
||||||
return EnumRarity.epic;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getUnlocalizedName(ItemStack stack){
|
public String getUnlocalizedName(ItemStack stack){
|
||||||
return this.getUnlocalizedName();
|
return this.getUnlocalizedName();
|
||||||
|
@ -120,5 +115,10 @@ public class BlockItemRepairer extends BlockContainerBase implements IActAddItem
|
||||||
public int getMetadata(int meta){
|
public int getMetadata(int meta){
|
||||||
return meta;
|
return meta;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EnumRarity getRarity(ItemStack stack){
|
||||||
|
return EnumRarity.epic;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,14 +42,12 @@ public class BlockLampPowerer extends Block implements IActAddItemOrBlock{
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getName(){
|
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side){
|
||||||
return "blockLampPowerer";
|
int meta = world.getBlockMetadata(x, y, z);
|
||||||
|
if(side == meta){
|
||||||
|
return this.frontIcon;
|
||||||
}
|
}
|
||||||
|
return this.blockIcon;
|
||||||
@Override
|
|
||||||
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack stack){
|
|
||||||
int rotation = BlockPistonBase.determineOrientation(world, x, y, z, player);
|
|
||||||
world.setBlockMetadataWithNotify(x, y, z, rotation, 2);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -61,12 +59,8 @@ public class BlockLampPowerer extends Block implements IActAddItemOrBlock{
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side){
|
public void onNeighborBlockChange(World world, int x, int y, int z, Block block){
|
||||||
int meta = world.getBlockMetadata(x, y, z);
|
this.updateLamp(world, x, y, z);
|
||||||
if(side == meta){
|
|
||||||
return this.frontIcon;
|
|
||||||
}
|
|
||||||
return this.blockIcon;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -75,8 +69,21 @@ public class BlockLampPowerer extends Block implements IActAddItemOrBlock{
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onNeighborBlockChange(World world, int x, int y, int z, Block block){
|
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack stack){
|
||||||
this.updateLamp(world, x, y, z);
|
int rotation = BlockPistonBase.determineOrientation(world, x, y, z, player);
|
||||||
|
world.setBlockMetadataWithNotify(x, y, z, rotation, 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void registerBlockIcons(IIconRegister iconReg){
|
||||||
|
this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName());
|
||||||
|
this.frontIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Front");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getName(){
|
||||||
|
return "blockLampPowerer";
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateLamp(World world, int x, int y, int z){
|
private void updateLamp(World world, int x, int y, int z){
|
||||||
|
@ -97,13 +104,6 @@ public class BlockLampPowerer extends Block implements IActAddItemOrBlock{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
public void registerBlockIcons(IIconRegister iconReg){
|
|
||||||
this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName());
|
|
||||||
this.frontIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Front");
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class TheItemBlock extends ItemBlock{
|
public static class TheItemBlock extends ItemBlock{
|
||||||
|
|
||||||
private Block theBlock;
|
private Block theBlock;
|
||||||
|
@ -115,11 +115,6 @@ public class BlockLampPowerer extends Block implements IActAddItemOrBlock{
|
||||||
this.setMaxDamage(0);
|
this.setMaxDamage(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public EnumRarity getRarity(ItemStack stack){
|
|
||||||
return EnumRarity.uncommon;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getUnlocalizedName(ItemStack stack){
|
public String getUnlocalizedName(ItemStack stack){
|
||||||
return this.getUnlocalizedName();
|
return this.getUnlocalizedName();
|
||||||
|
@ -129,5 +124,10 @@ public class BlockLampPowerer extends Block implements IActAddItemOrBlock{
|
||||||
public int getMetadata(int meta){
|
public int getMetadata(int meta){
|
||||||
return meta;
|
return meta;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EnumRarity getRarity(ItemStack stack){
|
||||||
|
return EnumRarity.uncommon;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,13 +50,6 @@ public class BlockLavaFactoryController extends BlockContainerBase implements IA
|
||||||
return side == 1 ? this.topIcon : this.blockIcon;
|
return side == 1 ? this.topIcon : this.blockIcon;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
public void registerBlockIcons(IIconRegister iconReg){
|
|
||||||
this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName());
|
|
||||||
this.topIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Top");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9){
|
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9){
|
||||||
if(!world.isRemote){
|
if(!world.isRemote){
|
||||||
|
@ -76,6 +69,13 @@ public class BlockLavaFactoryController extends BlockContainerBase implements IA
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void registerBlockIcons(IIconRegister iconReg){
|
||||||
|
this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName());
|
||||||
|
this.topIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Top");
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getName(){
|
public String getName(){
|
||||||
return "blockLavaFactoryController";
|
return "blockLavaFactoryController";
|
||||||
|
@ -92,11 +92,6 @@ public class BlockLavaFactoryController extends BlockContainerBase implements IA
|
||||||
this.setMaxDamage(0);
|
this.setMaxDamage(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public EnumRarity getRarity(ItemStack stack){
|
|
||||||
return EnumRarity.uncommon;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getUnlocalizedName(ItemStack stack){
|
public String getUnlocalizedName(ItemStack stack){
|
||||||
return this.getUnlocalizedName();
|
return this.getUnlocalizedName();
|
||||||
|
@ -106,5 +101,10 @@ public class BlockLavaFactoryController extends BlockContainerBase implements IA
|
||||||
public int getMetadata(int damage){
|
public int getMetadata(int damage){
|
||||||
return damage;
|
return damage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EnumRarity getRarity(ItemStack stack){
|
||||||
|
return EnumRarity.uncommon;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,18 +43,6 @@ public class BlockLeafGenerator extends BlockContainerBase implements IActAddIte
|
||||||
this.setTickRandomly(true);
|
this.setTickRandomly(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
public void randomDisplayTick(World world, int x, int y, int z, Random rand){
|
|
||||||
int meta = world.getBlockMetadata(x, y, z);
|
|
||||||
|
|
||||||
if(meta == 1){
|
|
||||||
for(int i = 0; i < 5; i++){
|
|
||||||
world.spawnParticle("smoke", (double)x+0.5F, (double)y+1.0F, (double)z+0.5F, 0.0D, 0.0D, 0.0D);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TileEntity createNewTileEntity(World world, int par2){
|
public TileEntity createNewTileEntity(World world, int par2){
|
||||||
return new TileEntityLeafGenerator();
|
return new TileEntityLeafGenerator();
|
||||||
|
@ -67,10 +55,14 @@ public class BlockLeafGenerator extends BlockContainerBase implements IActAddIte
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void registerBlockIcons(IIconRegister iconReg){
|
public void randomDisplayTick(World world, int x, int y, int z, Random rand){
|
||||||
this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName());
|
int meta = world.getBlockMetadata(x, y, z);
|
||||||
this.topIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Top");
|
|
||||||
this.bottomIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Bottom");
|
if(meta == 1){
|
||||||
|
for(int i = 0; i < 5; i++){
|
||||||
|
world.spawnParticle("smoke", (double)x+0.5F, (double)y+1.0F, (double)z+0.5F, 0.0D, 0.0D, 0.0D);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -86,9 +78,11 @@ public class BlockLeafGenerator extends BlockContainerBase implements IActAddIte
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void breakBlock(World world, int x, int y, int z, Block block, int par6){
|
@SideOnly(Side.CLIENT)
|
||||||
this.dropInventory(world, x, y, z);
|
public void registerBlockIcons(IIconRegister iconReg){
|
||||||
super.breakBlock(world, x, y, z, block, par6);
|
this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName());
|
||||||
|
this.topIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Top");
|
||||||
|
this.bottomIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Bottom");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -96,6 +90,12 @@ public class BlockLeafGenerator extends BlockContainerBase implements IActAddIte
|
||||||
return "blockLeafGenerator";
|
return "blockLeafGenerator";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void breakBlock(World world, int x, int y, int z, Block block, int par6){
|
||||||
|
this.dropInventory(world, x, y, z);
|
||||||
|
super.breakBlock(world, x, y, z, block, par6);
|
||||||
|
}
|
||||||
|
|
||||||
public static class TheItemBlock extends ItemBlock{
|
public static class TheItemBlock extends ItemBlock{
|
||||||
|
|
||||||
public TheItemBlock(Block block){
|
public TheItemBlock(Block block){
|
||||||
|
@ -104,11 +104,6 @@ public class BlockLeafGenerator extends BlockContainerBase implements IActAddIte
|
||||||
this.setMaxDamage(0);
|
this.setMaxDamage(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public EnumRarity getRarity(ItemStack stack){
|
|
||||||
return EnumRarity.uncommon;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getUnlocalizedName(ItemStack stack){
|
public String getUnlocalizedName(ItemStack stack){
|
||||||
return this.getUnlocalizedName();
|
return this.getUnlocalizedName();
|
||||||
|
@ -118,5 +113,10 @@ public class BlockLeafGenerator extends BlockContainerBase implements IActAddIte
|
||||||
public int getMetadata(int damage){
|
public int getMetadata(int damage){
|
||||||
return damage;
|
return damage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EnumRarity getRarity(ItemStack stack){
|
||||||
|
return EnumRarity.uncommon;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,12 +39,9 @@ public class BlockMisc extends Block implements IActAddItemOrBlock{
|
||||||
this.setHarvestLevel("pickaxe", 1);
|
this.setHarvestLevel("pickaxe", 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("all")
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
public IIcon getIcon(int side, int metadata){
|
||||||
public void getSubBlocks(Item item, CreativeTabs tab, List list){
|
return metadata >= textures.length ? null : textures[metadata];
|
||||||
for(int j = 0; j < allMiscBlocks.length; j++){
|
|
||||||
list.add(new ItemStack(item, 1, j));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -52,9 +49,12 @@ public class BlockMisc extends Block implements IActAddItemOrBlock{
|
||||||
return meta;
|
return meta;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@SuppressWarnings("all")
|
||||||
public IIcon getIcon(int side, int metadata){
|
@SideOnly(Side.CLIENT)
|
||||||
return metadata >= textures.length ? null : textures[metadata];
|
public void getSubBlocks(Item item, CreativeTabs tab, List list){
|
||||||
|
for(int j = 0; j < allMiscBlocks.length; j++){
|
||||||
|
list.add(new ItemStack(item, 1, j));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -81,11 +81,6 @@ public class BlockMisc extends Block implements IActAddItemOrBlock{
|
||||||
this.setMaxDamage(0);
|
this.setMaxDamage(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public EnumRarity getRarity(ItemStack stack){
|
|
||||||
return stack.getItemDamage() >= allMiscBlocks.length ? EnumRarity.common : allMiscBlocks[stack.getItemDamage()].rarity;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getUnlocalizedName(ItemStack stack){
|
public String getUnlocalizedName(ItemStack stack){
|
||||||
return this.getUnlocalizedName()+(stack.getItemDamage() >= allMiscBlocks.length ? " ERROR!" : allMiscBlocks[stack.getItemDamage()].getName());
|
return this.getUnlocalizedName()+(stack.getItemDamage() >= allMiscBlocks.length ? " ERROR!" : allMiscBlocks[stack.getItemDamage()].getName());
|
||||||
|
@ -95,5 +90,10 @@ public class BlockMisc extends Block implements IActAddItemOrBlock{
|
||||||
public int getMetadata(int damage){
|
public int getMetadata(int damage){
|
||||||
return damage;
|
return damage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EnumRarity getRarity(ItemStack stack){
|
||||||
|
return stack.getItemDamage() >= allMiscBlocks.length ? EnumRarity.common : allMiscBlocks[stack.getItemDamage()].rarity;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,18 +44,6 @@ public class BlockOilGenerator extends BlockContainerBase implements IActAddItem
|
||||||
this.setTickRandomly(true);
|
this.setTickRandomly(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
public void randomDisplayTick(World world, int x, int y, int z, Random rand){
|
|
||||||
int meta = world.getBlockMetadata(x, y, z);
|
|
||||||
|
|
||||||
if(meta == 1){
|
|
||||||
for(int i = 0; i < 5; i++){
|
|
||||||
world.spawnParticle("smoke", (double)x+0.5F, (double)y+1.0F, (double)z+0.5F, 0.0D, 0.0D, 0.0D);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TileEntity createNewTileEntity(World world, int par2){
|
public TileEntity createNewTileEntity(World world, int par2){
|
||||||
return new TileEntityOilGenerator();
|
return new TileEntityOilGenerator();
|
||||||
|
@ -68,10 +56,14 @@ public class BlockOilGenerator extends BlockContainerBase implements IActAddItem
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void registerBlockIcons(IIconRegister iconReg){
|
public void randomDisplayTick(World world, int x, int y, int z, Random rand){
|
||||||
this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName());
|
int meta = world.getBlockMetadata(x, y, z);
|
||||||
this.topIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Top");
|
|
||||||
this.bottomIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Bottom");
|
if(meta == 1){
|
||||||
|
for(int i = 0; i < 5; i++){
|
||||||
|
world.spawnParticle("smoke", (double)x+0.5F, (double)y+1.0F, (double)z+0.5F, 0.0D, 0.0D, 0.0D);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -87,9 +79,11 @@ public class BlockOilGenerator extends BlockContainerBase implements IActAddItem
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void breakBlock(World world, int x, int y, int z, Block block, int par6){
|
@SideOnly(Side.CLIENT)
|
||||||
this.dropInventory(world, x, y, z);
|
public void registerBlockIcons(IIconRegister iconReg){
|
||||||
super.breakBlock(world, x, y, z, block, par6);
|
this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName());
|
||||||
|
this.topIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Top");
|
||||||
|
this.bottomIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Bottom");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -97,6 +91,12 @@ public class BlockOilGenerator extends BlockContainerBase implements IActAddItem
|
||||||
return "blockOilGenerator";
|
return "blockOilGenerator";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void breakBlock(World world, int x, int y, int z, Block block, int par6){
|
||||||
|
this.dropInventory(world, x, y, z);
|
||||||
|
super.breakBlock(world, x, y, z, block, par6);
|
||||||
|
}
|
||||||
|
|
||||||
public static class TheItemBlock extends ItemBlock{
|
public static class TheItemBlock extends ItemBlock{
|
||||||
|
|
||||||
private Block theBlock;
|
private Block theBlock;
|
||||||
|
@ -108,11 +108,6 @@ public class BlockOilGenerator extends BlockContainerBase implements IActAddItem
|
||||||
this.setMaxDamage(0);
|
this.setMaxDamage(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public EnumRarity getRarity(ItemStack stack){
|
|
||||||
return EnumRarity.uncommon;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getUnlocalizedName(ItemStack stack){
|
public String getUnlocalizedName(ItemStack stack){
|
||||||
return this.getUnlocalizedName();
|
return this.getUnlocalizedName();
|
||||||
|
@ -122,5 +117,10 @@ public class BlockOilGenerator extends BlockContainerBase implements IActAddItem
|
||||||
public int getMetadata(int damage){
|
public int getMetadata(int damage){
|
||||||
return damage;
|
return damage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EnumRarity getRarity(ItemStack stack){
|
||||||
|
return EnumRarity.uncommon;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,14 +51,6 @@ public class BlockOreMagnet extends BlockContainerBase implements IActAddItemOrB
|
||||||
return (side == 1 ? this.topIcon : (side == 0 ? this.bottomIcon : this.blockIcon));
|
return (side == 1 ? this.topIcon : (side == 0 ? this.bottomIcon : this.blockIcon));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
public void registerBlockIcons(IIconRegister iconReg){
|
|
||||||
this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName());
|
|
||||||
this.topIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Top");
|
|
||||||
this.bottomIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Bottom");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9){
|
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9){
|
||||||
if(!world.isRemote){
|
if(!world.isRemote){
|
||||||
|
@ -72,9 +64,11 @@ public class BlockOreMagnet extends BlockContainerBase implements IActAddItemOrB
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void breakBlock(World world, int x, int y, int z, Block block, int par6){
|
@SideOnly(Side.CLIENT)
|
||||||
this.dropInventory(world, x, y, z);
|
public void registerBlockIcons(IIconRegister iconReg){
|
||||||
super.breakBlock(world, x, y, z, block, par6);
|
this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName());
|
||||||
|
this.topIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Top");
|
||||||
|
this.bottomIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Bottom");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -82,6 +76,12 @@ public class BlockOreMagnet extends BlockContainerBase implements IActAddItemOrB
|
||||||
return "blockOreMagnet";
|
return "blockOreMagnet";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void breakBlock(World world, int x, int y, int z, Block block, int par6){
|
||||||
|
this.dropInventory(world, x, y, z);
|
||||||
|
super.breakBlock(world, x, y, z, block, par6);
|
||||||
|
}
|
||||||
|
|
||||||
public static class TheItemBlock extends ItemBlock{
|
public static class TheItemBlock extends ItemBlock{
|
||||||
|
|
||||||
private Block theBlock;
|
private Block theBlock;
|
||||||
|
@ -93,11 +93,6 @@ public class BlockOreMagnet extends BlockContainerBase implements IActAddItemOrB
|
||||||
this.setMaxDamage(0);
|
this.setMaxDamage(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public EnumRarity getRarity(ItemStack stack){
|
|
||||||
return EnumRarity.rare;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getUnlocalizedName(ItemStack stack){
|
public String getUnlocalizedName(ItemStack stack){
|
||||||
return this.getUnlocalizedName();
|
return this.getUnlocalizedName();
|
||||||
|
@ -107,5 +102,10 @@ public class BlockOreMagnet extends BlockContainerBase implements IActAddItemOrB
|
||||||
public int getMetadata(int damage){
|
public int getMetadata(int damage){
|
||||||
return damage;
|
return damage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EnumRarity getRarity(ItemStack stack){
|
||||||
|
return EnumRarity.rare;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,6 +38,7 @@ public class BlockPhantom extends BlockContainerBase implements IActAddItemOrBlo
|
||||||
|
|
||||||
public Type type;
|
public Type type;
|
||||||
public int range;
|
public int range;
|
||||||
|
|
||||||
public BlockPhantom(Type type){
|
public BlockPhantom(Type type){
|
||||||
super(Material.rock);
|
super(Material.rock);
|
||||||
this.type = type;
|
this.type = type;
|
||||||
|
@ -62,6 +63,27 @@ public class BlockPhantom extends BlockContainerBase implements IActAddItemOrBlo
|
||||||
super.breakBlock(world, x, y, z, block, par6);
|
super.breakBlock(world, x, y, z, block, par6);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TileEntity createNewTileEntity(World world, int par2){
|
||||||
|
switch(this.type){
|
||||||
|
case PLACER:
|
||||||
|
return new TileEntityPhantomPlacer();
|
||||||
|
case BREAKER:
|
||||||
|
return new TileEntityPhantomPlacer.TileEntityPhantomBreaker();
|
||||||
|
case LIQUIFACE:
|
||||||
|
return new TileEntityPhantomface.TileEntityPhantomLiquiface();
|
||||||
|
case ENERGYFACE:
|
||||||
|
return new TileEntityPhantomface.TileEntityPhantomEnergyface();
|
||||||
|
default:
|
||||||
|
return new TileEntityPhantomface.TileEntityPhantomItemface();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IIcon getIcon(int side, int metadata){
|
||||||
|
return this.blockIcon;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int hitSide, float hitX, float hitY, float hitZ){
|
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int hitSide, float hitX, float hitY, float hitZ){
|
||||||
if(!world.isRemote){
|
if(!world.isRemote){
|
||||||
|
@ -97,27 +119,6 @@ public class BlockPhantom extends BlockContainerBase implements IActAddItemOrBlo
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public TileEntity createNewTileEntity(World world, int par2){
|
|
||||||
switch(this.type){
|
|
||||||
case PLACER:
|
|
||||||
return new TileEntityPhantomPlacer();
|
|
||||||
case BREAKER:
|
|
||||||
return new TileEntityPhantomPlacer.TileEntityPhantomBreaker();
|
|
||||||
case LIQUIFACE:
|
|
||||||
return new TileEntityPhantomface.TileEntityPhantomLiquiface();
|
|
||||||
case ENERGYFACE:
|
|
||||||
return new TileEntityPhantomface.TileEntityPhantomEnergyface();
|
|
||||||
default:
|
|
||||||
return new TileEntityPhantomface.TileEntityPhantomItemface();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public IIcon getIcon(int side, int metadata){
|
|
||||||
return this.blockIcon;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void registerBlockIcons(IIconRegister iconReg){
|
public void registerBlockIcons(IIconRegister iconReg){
|
||||||
|
@ -159,11 +160,6 @@ public class BlockPhantom extends BlockContainerBase implements IActAddItemOrBlo
|
||||||
this.setMaxDamage(0);
|
this.setMaxDamage(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public EnumRarity getRarity(ItemStack stack){
|
|
||||||
return EnumRarity.epic;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getUnlocalizedName(ItemStack stack){
|
public String getUnlocalizedName(ItemStack stack){
|
||||||
return this.getUnlocalizedName();
|
return this.getUnlocalizedName();
|
||||||
|
@ -173,5 +169,10 @@ public class BlockPhantom extends BlockContainerBase implements IActAddItemOrBlo
|
||||||
public int getMetadata(int damage){
|
public int getMetadata(int damage){
|
||||||
return damage;
|
return damage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EnumRarity getRarity(ItemStack stack){
|
||||||
|
return EnumRarity.epic;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -39,11 +39,6 @@ public class BlockPhantomBooster extends BlockContainerBase implements IActAddIt
|
||||||
this.setBlockBounds(3*f, 0F, 3*f, 1-3*f, 1F, 1-3*f);
|
this.setBlockBounds(3*f, 0F, 3*f, 1-3*f, 1F, 1-3*f);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isOpaqueCube(){
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean renderAsNormalBlock(){
|
public boolean renderAsNormalBlock(){
|
||||||
return false;
|
return false;
|
||||||
|
@ -59,6 +54,11 @@ public class BlockPhantomBooster extends BlockContainerBase implements IActAddIt
|
||||||
return this.blockIcon;
|
return this.blockIcon;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isOpaqueCube(){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void registerBlockIcons(IIconRegister iconReg){
|
public void registerBlockIcons(IIconRegister iconReg){
|
||||||
|
@ -86,11 +86,6 @@ public class BlockPhantomBooster extends BlockContainerBase implements IActAddIt
|
||||||
this.setMaxDamage(0);
|
this.setMaxDamage(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public EnumRarity getRarity(ItemStack stack){
|
|
||||||
return EnumRarity.epic;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getUnlocalizedName(ItemStack stack){
|
public String getUnlocalizedName(ItemStack stack){
|
||||||
return this.getUnlocalizedName();
|
return this.getUnlocalizedName();
|
||||||
|
@ -100,5 +95,10 @@ public class BlockPhantomBooster extends BlockContainerBase implements IActAddIt
|
||||||
public int getMetadata(int damage){
|
public int getMetadata(int damage){
|
||||||
return damage;
|
return damage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EnumRarity getRarity(ItemStack stack){
|
||||||
|
return EnumRarity.epic;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -50,11 +50,6 @@ public class BlockPlant extends BlockCrops implements IActAddItemOrBlock{
|
||||||
return EnumPlantType.Crop;
|
return EnumPlantType.Crop;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public int quantityDropped(int meta, int fortune, Random random){
|
|
||||||
return meta >= 7 ? random.nextInt(addDropAmount)+minDropAmount : super.quantityDropped(meta, fortune, random);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public IIcon getIcon(int side, int meta){
|
public IIcon getIcon(int side, int meta){
|
||||||
|
@ -74,24 +69,14 @@ public class BlockPlant extends BlockCrops implements IActAddItemOrBlock{
|
||||||
return this.seedItem;
|
return this.seedItem;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public Item getItemDropped(int meta, Random rand, int par3){
|
|
||||||
return meta >= 7 ? this.func_149865_P() : this.func_149866_i();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Item func_149865_P(){
|
public Item func_149865_P(){
|
||||||
return this.returnItem;
|
return this.returnItem;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int damageDropped(int meta){
|
public Item getItemDropped(int meta, Random rand, int par3){
|
||||||
return this.returnMeta;
|
return meta >= 7 ? this.func_149865_P() : this.func_149866_i();
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getDamageValue(World world, int x, int y, int z){
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -107,6 +92,21 @@ public class BlockPlant extends BlockCrops implements IActAddItemOrBlock{
|
||||||
return this.name;
|
return this.name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int damageDropped(int meta){
|
||||||
|
return this.returnMeta;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getDamageValue(World world, int x, int y, int z){
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int quantityDropped(int meta, int fortune, Random random){
|
||||||
|
return meta >= 7 ? random.nextInt(addDropAmount)+minDropAmount : super.quantityDropped(meta, fortune, random);
|
||||||
|
}
|
||||||
|
|
||||||
public static class TheItemBlock extends ItemBlock{
|
public static class TheItemBlock extends ItemBlock{
|
||||||
|
|
||||||
private Block theBlock;
|
private Block theBlock;
|
||||||
|
@ -118,11 +118,6 @@ public class BlockPlant extends BlockCrops implements IActAddItemOrBlock{
|
||||||
this.setMaxDamage(0);
|
this.setMaxDamage(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public EnumRarity getRarity(ItemStack stack){
|
|
||||||
return EnumRarity.uncommon;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getUnlocalizedName(ItemStack stack){
|
public String getUnlocalizedName(ItemStack stack){
|
||||||
return this.getUnlocalizedName();
|
return this.getUnlocalizedName();
|
||||||
|
@ -132,5 +127,10 @@ public class BlockPlant extends BlockCrops implements IActAddItemOrBlock{
|
||||||
public int getMetadata(int damage){
|
public int getMetadata(int damage){
|
||||||
return damage;
|
return damage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EnumRarity getRarity(ItemStack stack){
|
||||||
|
return EnumRarity.uncommon;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -41,6 +41,17 @@ public class BlockSlabs extends Block implements IActAddItemOrBlock{
|
||||||
this.name = name;
|
this.name = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean renderAsNormalBlock(){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public IIcon getIcon(int side, int meta){
|
||||||
|
return this.fullBlock.getIcon(0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addCollisionBoxesToList(World world, int x, int y, int z, AxisAlignedBB axis, List list, Entity entity){
|
public void addCollisionBoxesToList(World world, int x, int y, int z, AxisAlignedBB axis, List list, Entity entity){
|
||||||
this.setBlockBoundsBasedOnState(world, x, y, z);
|
this.setBlockBoundsBasedOnState(world, x, y, z);
|
||||||
|
@ -48,16 +59,8 @@ public class BlockSlabs extends Block implements IActAddItemOrBlock{
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setBlockBoundsForItemRender(){
|
public boolean isOpaqueCube(){
|
||||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F);
|
return false;
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z){
|
|
||||||
int meta = world.getBlockMetadata(x, y, z);
|
|
||||||
float minY = meta == 1 ? 0.5F : 0.0F;
|
|
||||||
float maxY = meta == 1 ? 1.0F : 0.5F;
|
|
||||||
this.setBlockBounds(0.0F, minY, 0F, 1.0F, maxY, 1.0F);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -72,19 +75,16 @@ public class BlockSlabs extends Block implements IActAddItemOrBlock{
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isOpaqueCube(){
|
public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z){
|
||||||
return false;
|
int meta = world.getBlockMetadata(x, y, z);
|
||||||
|
float minY = meta == 1 ? 0.5F : 0.0F;
|
||||||
|
float maxY = meta == 1 ? 1.0F : 0.5F;
|
||||||
|
this.setBlockBounds(0.0F, minY, 0F, 1.0F, maxY, 1.0F);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean renderAsNormalBlock(){
|
public void setBlockBoundsForItemRender(){
|
||||||
return false;
|
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F);
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
public IIcon getIcon(int side, int meta){
|
|
||||||
return this.fullBlock.getIcon(0, 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -109,21 +109,16 @@ public class BlockSlabs extends Block implements IActAddItemOrBlock{
|
||||||
this.setMaxDamage(0);
|
this.setMaxDamage(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public EnumRarity getRarity(ItemStack stack){
|
|
||||||
return EnumRarity.uncommon;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getUnlocalizedName(ItemStack stack){
|
|
||||||
return this.getUnlocalizedName();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getMetadata(int meta){
|
public int getMetadata(int meta){
|
||||||
return meta;
|
return meta;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EnumRarity getRarity(ItemStack stack){
|
||||||
|
return EnumRarity.uncommon;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ){
|
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ){
|
||||||
if(world.getBlock(x, y, z) == this.theBlock && ((side == 1 && world.getBlockMetadata(x, y, z) == 0) || (side == 0 && world.getBlockMetadata(x, y, z) == 1))){
|
if(world.getBlock(x, y, z) == this.theBlock && ((side == 1 && world.getBlockMetadata(x, y, z) == 0) || (side == 0 && world.getBlockMetadata(x, y, z) == 1))){
|
||||||
|
@ -135,5 +130,10 @@ public class BlockSlabs extends Block implements IActAddItemOrBlock{
|
||||||
}
|
}
|
||||||
return super.onItemUse(stack, player, world, x, y, z, side, hitX, hitY, hitZ);
|
return super.onItemUse(stack, player, world, x, y, z, side, hitX, hitY, hitZ);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getUnlocalizedName(ItemStack stack){
|
||||||
|
return this.getUnlocalizedName();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,6 +41,37 @@ public class BlockSmileyCloud extends BlockContainerBase implements IActAddItemO
|
||||||
this.setStepSound(soundTypeCloth);
|
this.setStepSound(soundTypeCloth);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean renderAsNormalBlock(){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getRenderType(){
|
||||||
|
return AssetUtil.SMILEY_CLOUD_RENDER_ID;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IIcon getIcon(int side, int metadata){
|
||||||
|
return this.blockIcon;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isOpaqueCube(){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int f6, float f7, float f8, float f9){
|
||||||
|
if(!world.isRemote){
|
||||||
|
TileEntity tile = world.getTileEntity(x, y, z);
|
||||||
|
if(tile instanceof TileEntitySmileyCloud){
|
||||||
|
player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.CLOUD.ordinal(), world, x, y, z);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z){
|
public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z){
|
||||||
int meta = world.getBlockMetadata(x, y, z);
|
int meta = world.getBlockMetadata(x, y, z);
|
||||||
|
@ -60,22 +91,6 @@ public class BlockSmileyCloud extends BlockContainerBase implements IActAddItemO
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int f6, float f7, float f8, float f9){
|
|
||||||
if(!world.isRemote){
|
|
||||||
TileEntity tile = world.getTileEntity(x, y, z);
|
|
||||||
if(tile instanceof TileEntitySmileyCloud){
|
|
||||||
player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.CLOUD.ordinal(), world, x, y, z);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public IIcon getIcon(int side, int metadata){
|
|
||||||
return this.blockIcon;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack stack){
|
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack stack){
|
||||||
int rotation = MathHelper.floor_double((double)(player.rotationYaw*4.0F/360.0F)+0.5D) & 3;
|
int rotation = MathHelper.floor_double((double)(player.rotationYaw*4.0F/360.0F)+0.5D) & 3;
|
||||||
|
@ -100,21 +115,6 @@ public class BlockSmileyCloud extends BlockContainerBase implements IActAddItemO
|
||||||
this.blockIcon = Blocks.wool.getIcon(0, 0);
|
this.blockIcon = Blocks.wool.getIcon(0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isOpaqueCube(){
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean renderAsNormalBlock(){
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getRenderType(){
|
|
||||||
return AssetUtil.SMILEY_CLOUD_RENDER_ID;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TileEntity createNewTileEntity(World world, int meta){
|
public TileEntity createNewTileEntity(World world, int meta){
|
||||||
return new TileEntitySmileyCloud();
|
return new TileEntitySmileyCloud();
|
||||||
|
@ -142,11 +142,6 @@ public class BlockSmileyCloud extends BlockContainerBase implements IActAddItemO
|
||||||
this.setMaxDamage(0);
|
this.setMaxDamage(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public EnumRarity getRarity(ItemStack stack){
|
|
||||||
return EnumRarity.uncommon;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getUnlocalizedName(ItemStack stack){
|
public String getUnlocalizedName(ItemStack stack){
|
||||||
return this.getUnlocalizedName();
|
return this.getUnlocalizedName();
|
||||||
|
@ -156,5 +151,10 @@ public class BlockSmileyCloud extends BlockContainerBase implements IActAddItemO
|
||||||
public int getMetadata(int damage){
|
public int getMetadata(int damage){
|
||||||
return damage;
|
return damage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EnumRarity getRarity(ItemStack stack){
|
||||||
|
return EnumRarity.uncommon;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,11 +43,6 @@ public class BlockStair extends BlockStairs implements IActAddItemOrBlock{
|
||||||
this.setMaxDamage(0);
|
this.setMaxDamage(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public EnumRarity getRarity(ItemStack stack){
|
|
||||||
return EnumRarity.uncommon;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getUnlocalizedName(ItemStack stack){
|
public String getUnlocalizedName(ItemStack stack){
|
||||||
return this.getUnlocalizedName();
|
return this.getUnlocalizedName();
|
||||||
|
@ -57,5 +52,10 @@ public class BlockStair extends BlockStairs implements IActAddItemOrBlock{
|
||||||
public int getMetadata(int meta){
|
public int getMetadata(int meta){
|
||||||
return meta;
|
return meta;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EnumRarity getRarity(ItemStack stack){
|
||||||
|
return EnumRarity.uncommon;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,6 +50,63 @@ public class BlockTreasureChest extends Block implements IActAddItemOrBlock{
|
||||||
this.setTickRandomly(true);
|
this.setTickRandomly(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side){
|
||||||
|
int meta = world.getBlockMetadata(x, y, z);
|
||||||
|
if(side == 1){
|
||||||
|
return this.topIcon;
|
||||||
|
}
|
||||||
|
if(side == meta+2){
|
||||||
|
return this.frontIcon;
|
||||||
|
}
|
||||||
|
if(side == 0){
|
||||||
|
return this.bottomIcon;
|
||||||
|
}
|
||||||
|
return this.blockIcon;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IIcon getIcon(int side, int meta){
|
||||||
|
if(side == 1){
|
||||||
|
return this.topIcon;
|
||||||
|
}
|
||||||
|
if(side == 0){
|
||||||
|
return this.bottomIcon;
|
||||||
|
}
|
||||||
|
if(side == 3){
|
||||||
|
return this.frontIcon;
|
||||||
|
}
|
||||||
|
return this.blockIcon;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void randomDisplayTick(World world, int x, int y, int z, Random rand){
|
||||||
|
for(int i = 0; i < 2; i++){
|
||||||
|
for(float f = 0; f <= 3; f += 0.5){
|
||||||
|
float particleX = rand.nextFloat();
|
||||||
|
float particleZ = rand.nextFloat();
|
||||||
|
world.spawnParticle("bubble", (double)x+particleX, (double)y+f+1, (double)z+particleZ, 0.0D, 0.2D, 0.0D);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Item getItemDropped(int par1, Random rand, int par3){
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9){
|
||||||
|
if(!world.isRemote){
|
||||||
|
world.playSoundAtEntity(player, "random.chestopen", 0.2F, new Random().nextFloat()*0.1F+0.9F);
|
||||||
|
this.dropItems(world, x, y, z);
|
||||||
|
player.addStat(TheAchievements.OPEN_TREASURE_CHEST.ach, 1);
|
||||||
|
world.setBlockToAir(x, y, z);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canSilkHarvest(){
|
public boolean canSilkHarvest(){
|
||||||
return false;
|
return false;
|
||||||
|
@ -73,40 +130,6 @@ public class BlockTreasureChest extends Block implements IActAddItemOrBlock{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public Item getItemDropped(int par1, Random rand, int par3){
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public IIcon getIcon(int side, int meta){
|
|
||||||
if(side == 1){
|
|
||||||
return this.topIcon;
|
|
||||||
}
|
|
||||||
if(side == 0){
|
|
||||||
return this.bottomIcon;
|
|
||||||
}
|
|
||||||
if(side == 3){
|
|
||||||
return this.frontIcon;
|
|
||||||
}
|
|
||||||
return this.blockIcon;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side){
|
|
||||||
int meta = world.getBlockMetadata(x, y, z);
|
|
||||||
if(side == 1){
|
|
||||||
return this.topIcon;
|
|
||||||
}
|
|
||||||
if(side == meta+2){
|
|
||||||
return this.frontIcon;
|
|
||||||
}
|
|
||||||
if(side == 0){
|
|
||||||
return this.bottomIcon;
|
|
||||||
}
|
|
||||||
return this.blockIcon;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void registerBlockIcons(IIconRegister iconReg){
|
public void registerBlockIcons(IIconRegister iconReg){
|
||||||
|
@ -117,14 +140,8 @@ public class BlockTreasureChest extends Block implements IActAddItemOrBlock{
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9){
|
public String getName(){
|
||||||
if(!world.isRemote){
|
return "blockTreasureChest";
|
||||||
world.playSoundAtEntity(player, "random.chestopen", 0.2F, new Random().nextFloat()*0.1F+0.9F);
|
|
||||||
this.dropItems(world, x, y, z);
|
|
||||||
player.addStat(TheAchievements.OPEN_TREASURE_CHEST.ach, 1);
|
|
||||||
world.setBlockToAir(x, y, z);
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void dropItems(World world, int x, int y, int z){
|
private void dropItems(World world, int x, int y, int z){
|
||||||
|
@ -150,23 +167,6 @@ public class BlockTreasureChest extends Block implements IActAddItemOrBlock{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
public void randomDisplayTick(World world, int x, int y, int z, Random rand){
|
|
||||||
for(int i = 0; i < 2; i++){
|
|
||||||
for(float f = 0; f <= 3; f += 0.5){
|
|
||||||
float particleX = rand.nextFloat();
|
|
||||||
float particleZ = rand.nextFloat();
|
|
||||||
world.spawnParticle("bubble", (double)x+particleX, (double)y+f+1, (double)z+particleZ, 0.0D, 0.2D, 0.0D);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getName(){
|
|
||||||
return "blockTreasureChest";
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class TheItemBlock extends ItemBlock{
|
public static class TheItemBlock extends ItemBlock{
|
||||||
|
|
||||||
private Block theBlock;
|
private Block theBlock;
|
||||||
|
@ -178,11 +178,6 @@ public class BlockTreasureChest extends Block implements IActAddItemOrBlock{
|
||||||
this.setMaxDamage(0);
|
this.setMaxDamage(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public EnumRarity getRarity(ItemStack stack){
|
|
||||||
return EnumRarity.epic;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getUnlocalizedName(ItemStack stack){
|
public String getUnlocalizedName(ItemStack stack){
|
||||||
return this.getUnlocalizedName();
|
return this.getUnlocalizedName();
|
||||||
|
@ -192,5 +187,10 @@ public class BlockTreasureChest extends Block implements IActAddItemOrBlock{
|
||||||
public int getMetadata(int damage){
|
public int getMetadata(int damage){
|
||||||
return damage;
|
return damage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EnumRarity getRarity(ItemStack stack){
|
||||||
|
return EnumRarity.epic;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,11 +44,23 @@ public class BlockWildPlant extends BlockBush implements IActAddItemOrBlock{
|
||||||
return world.getBlockMetadata(x, y, z) == TheWildPlants.RICE.ordinal() ? world.getBlock(x, y-1, z).getMaterial() == Material.water : world.getBlock(x, y-1, z).canSustainPlant(world, x, y-1, z, ForgeDirection.UP, this);
|
return world.getBlockMetadata(x, y, z) == TheWildPlants.RICE.ordinal() ? world.getBlock(x, y-1, z).getMaterial() == Material.water : world.getBlock(x, y-1, z).canSustainPlant(world, x, y-1, z, ForgeDirection.UP, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IIcon getIcon(int side, int metadata){
|
||||||
|
return metadata >= allWildPlants.length ? null : allWildPlants[metadata].wildVersionOf.getIcon(0, 7);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canSilkHarvest(){
|
public boolean canSilkHarvest(){
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public Item getItem(World world, int x, int y, int z){
|
||||||
|
int meta = world.getBlockMetadata(x, y, z);
|
||||||
|
return meta >= allWildPlants.length ? null : ((BlockPlant)allWildPlants[meta].wildVersionOf).seedItem;
|
||||||
|
}
|
||||||
|
|
||||||
@SuppressWarnings("all")
|
@SuppressWarnings("all")
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void getSubBlocks(Item item, CreativeTabs tab, List list){
|
public void getSubBlocks(Item item, CreativeTabs tab, List list){
|
||||||
|
@ -57,16 +69,6 @@ public class BlockWildPlant extends BlockBush implements IActAddItemOrBlock{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune){
|
|
||||||
return metadata >= allWildPlants.length ? null : allWildPlants[metadata].wildVersionOf.getDrops(world, x, y, z, 7, fortune);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public IIcon getIcon(int side, int metadata){
|
|
||||||
return metadata >= allWildPlants.length ? null : allWildPlants[metadata].wildVersionOf.getIcon(0, 7);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void registerBlockIcons(IIconRegister iconReg){
|
public void registerBlockIcons(IIconRegister iconReg){
|
||||||
|
@ -74,15 +76,13 @@ public class BlockWildPlant extends BlockBush implements IActAddItemOrBlock{
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getName(){
|
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune){
|
||||||
return "blockWild";
|
return metadata >= allWildPlants.length ? null : allWildPlants[metadata].wildVersionOf.getDrops(world, x, y, z, 7, fortune);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
public String getName(){
|
||||||
public Item getItem(World world, int x, int y, int z){
|
return "blockWild";
|
||||||
int meta = world.getBlockMetadata(x, y, z);
|
|
||||||
return meta >= allWildPlants.length ? null : ((BlockPlant)allWildPlants[meta].wildVersionOf).seedItem;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class TheItemBlock extends ItemBlock{
|
public static class TheItemBlock extends ItemBlock{
|
||||||
|
@ -96,26 +96,26 @@ public class BlockWildPlant extends BlockBush implements IActAddItemOrBlock{
|
||||||
this.setMaxDamage(0);
|
this.setMaxDamage(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public EnumRarity getRarity(ItemStack stack){
|
|
||||||
return stack.getItemDamage() >= allWildPlants.length ? EnumRarity.common : allWildPlants[stack.getItemDamage()].rarity;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getUnlocalizedName(ItemStack stack){
|
|
||||||
return this.getUnlocalizedName()+(stack.getItemDamage() >= allWildPlants.length ? " ERROR!" : allWildPlants[stack.getItemDamage()].getName());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getMetadata(int damage){
|
public int getMetadata(int damage){
|
||||||
return damage;
|
return damage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EnumRarity getRarity(ItemStack stack){
|
||||||
|
return stack.getItemDamage() >= allWildPlants.length ? EnumRarity.common : allWildPlants[stack.getItemDamage()].rarity;
|
||||||
|
}
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
@Override
|
@Override
|
||||||
public IIcon getIconFromDamage(int meta){
|
public IIcon getIconFromDamage(int meta){
|
||||||
return this.theBlock.getIcon(0, meta);
|
return this.theBlock.getIcon(0, meta);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getUnlocalizedName(ItemStack stack){
|
||||||
|
return this.getUnlocalizedName()+(stack.getItemDamage() >= allWildPlants.length ? " ERROR!" : allWildPlants[stack.getItemDamage()].getName());
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,6 +47,46 @@ public class BlockXPSolidifier extends BlockContainerBase implements IActAddItem
|
||||||
this.setStepSound(soundTypeStone);
|
this.setStepSound(soundTypeStone);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TileEntity createNewTileEntity(World world, int par2){
|
||||||
|
return new TileEntityXPSolidifier();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side){
|
||||||
|
int meta = world.getBlockMetadata(x, y, z);
|
||||||
|
if(side == 1 || side == 0){
|
||||||
|
return this.topIcon;
|
||||||
|
}
|
||||||
|
if(side == meta+2){
|
||||||
|
return this.frontIcon;
|
||||||
|
}
|
||||||
|
return this.blockIcon;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IIcon getIcon(int side, int meta){
|
||||||
|
if(side == 1 || side == 0){
|
||||||
|
return this.topIcon;
|
||||||
|
}
|
||||||
|
if(side == 3){
|
||||||
|
return this.frontIcon;
|
||||||
|
}
|
||||||
|
return this.blockIcon;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9){
|
||||||
|
if(!world.isRemote){
|
||||||
|
TileEntityXPSolidifier solidifier = (TileEntityXPSolidifier)world.getTileEntity(x, y, z);
|
||||||
|
if(solidifier != null){
|
||||||
|
player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.XP_SOLIDIFIER.ordinal(), world, x, y, z);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack stack){
|
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack stack){
|
||||||
int rotation = MathHelper.floor_double((double)(player.rotationYaw*4.0F/360.0F)+0.5D) & 3;
|
int rotation = MathHelper.floor_double((double)(player.rotationYaw*4.0F/360.0F)+0.5D) & 3;
|
||||||
|
@ -65,34 +105,6 @@ public class BlockXPSolidifier extends BlockContainerBase implements IActAddItem
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public TileEntity createNewTileEntity(World world, int par2){
|
|
||||||
return new TileEntityXPSolidifier();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public IIcon getIcon(int side, int meta){
|
|
||||||
if(side == 1 || side == 0){
|
|
||||||
return this.topIcon;
|
|
||||||
}
|
|
||||||
if(side == 3){
|
|
||||||
return this.frontIcon;
|
|
||||||
}
|
|
||||||
return this.blockIcon;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side){
|
|
||||||
int meta = world.getBlockMetadata(x, y, z);
|
|
||||||
if(side == 1 || side == 0){
|
|
||||||
return this.topIcon;
|
|
||||||
}
|
|
||||||
if(side == meta+2){
|
|
||||||
return this.frontIcon;
|
|
||||||
}
|
|
||||||
return this.blockIcon;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void registerBlockIcons(IIconRegister iconReg){
|
public void registerBlockIcons(IIconRegister iconReg){
|
||||||
|
@ -102,15 +114,8 @@ public class BlockXPSolidifier extends BlockContainerBase implements IActAddItem
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9){
|
public String getName(){
|
||||||
if(!world.isRemote){
|
return "blockXPSolidifier";
|
||||||
TileEntityXPSolidifier solidifier = (TileEntityXPSolidifier)world.getTileEntity(x, y, z);
|
|
||||||
if(solidifier != null){
|
|
||||||
player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.XP_SOLIDIFIER.ordinal(), world, x, y, z);
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -145,11 +150,6 @@ public class BlockXPSolidifier extends BlockContainerBase implements IActAddItem
|
||||||
world.spawnEntityInWorld(entityItem);
|
world.spawnEntityInWorld(entityItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getName(){
|
|
||||||
return "blockXPSolidifier";
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class TheItemBlock extends ItemBlock{
|
public static class TheItemBlock extends ItemBlock{
|
||||||
|
|
||||||
private Block theBlock;
|
private Block theBlock;
|
||||||
|
@ -161,11 +161,6 @@ public class BlockXPSolidifier extends BlockContainerBase implements IActAddItem
|
||||||
this.setMaxDamage(0);
|
this.setMaxDamage(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public EnumRarity getRarity(ItemStack stack){
|
|
||||||
return EnumRarity.epic;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getUnlocalizedName(ItemStack stack){
|
public String getUnlocalizedName(ItemStack stack){
|
||||||
return this.getUnlocalizedName();
|
return this.getUnlocalizedName();
|
||||||
|
@ -175,5 +170,10 @@ public class BlockXPSolidifier extends BlockContainerBase implements IActAddItem
|
||||||
public int getMetadata(int damage){
|
public int getMetadata(int damage){
|
||||||
return damage;
|
return damage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EnumRarity getRarity(ItemStack stack){
|
||||||
|
return EnumRarity.epic;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -116,6 +116,12 @@ public class ModelCoffeeMachine extends ModelBaseAA{
|
||||||
setRotation(p13, 0F, 0F, 0F);
|
setRotation(p13, 0F, 0F, 0F);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void setRotation(ModelRenderer model, float x, float y, float z){
|
||||||
|
model.rotateAngleX = x;
|
||||||
|
model.rotateAngleY = y;
|
||||||
|
model.rotateAngleZ = z;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void render(float f){
|
public void render(float f){
|
||||||
p1.render(f);
|
p1.render(f);
|
||||||
|
@ -133,12 +139,6 @@ public class ModelCoffeeMachine extends ModelBaseAA{
|
||||||
p13.render(f);
|
p13.render(f);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setRotation(ModelRenderer model, float x, float y, float z){
|
|
||||||
model.rotateAngleX = x;
|
|
||||||
model.rotateAngleY = y;
|
|
||||||
model.rotateAngleZ = z;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getName(){
|
public String getName(){
|
||||||
return "modelCoffeeMachine";
|
return "modelCoffeeMachine";
|
||||||
|
|
|
@ -54,6 +54,20 @@ public class ModelCompost extends ModelBaseAA{
|
||||||
this.innerDone.addBox(0.0F, 0.0F, 0.0F, 12, 13, 12, 0.0F);
|
this.innerDone.addBox(0.0F, 0.0F, 0.0F, 12, 13, 12, 0.0F);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void render(float f){
|
||||||
|
this.wallThree.render(f);
|
||||||
|
this.wallFour.render(f);
|
||||||
|
this.wallOne.render(f);
|
||||||
|
this.wallTwo.render(f);
|
||||||
|
this.floor.render(f);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getName(){
|
||||||
|
return "modelCompost";
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void renderExtra(float f, TileEntity tile){
|
public void renderExtra(float f, TileEntity tile){
|
||||||
int meta = tile.getWorldObj().getBlockMetadata(tile.xCoord, tile.yCoord, tile.zCoord);
|
int meta = tile.getWorldObj().getBlockMetadata(tile.xCoord, tile.yCoord, tile.zCoord);
|
||||||
|
@ -69,18 +83,4 @@ public class ModelCompost extends ModelBaseAA{
|
||||||
this.innerDone.render(f);
|
this.innerDone.render(f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void render(float f){
|
|
||||||
this.wallThree.render(f);
|
|
||||||
this.wallFour.render(f);
|
|
||||||
this.wallOne.render(f);
|
|
||||||
this.wallTwo.render(f);
|
|
||||||
this.floor.render(f);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getName(){
|
|
||||||
return "modelCompost";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -126,6 +126,12 @@ public class ModelPhantomBooster extends ModelBaseAA{
|
||||||
setRotation(s15, 0F, 0F, 0F);
|
setRotation(s15, 0F, 0F, 0F);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void setRotation(ModelRenderer model, float x, float y, float z){
|
||||||
|
model.rotateAngleX = x;
|
||||||
|
model.rotateAngleY = y;
|
||||||
|
model.rotateAngleZ = z;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void render(float f){
|
public void render(float f){
|
||||||
s1.render(f);
|
s1.render(f);
|
||||||
|
@ -154,10 +160,4 @@ public class ModelPhantomBooster extends ModelBaseAA{
|
||||||
public boolean doesRotate(){
|
public boolean doesRotate(){
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setRotation(ModelRenderer model, float x, float y, float z){
|
|
||||||
model.rotateAngleX = x;
|
|
||||||
model.rotateAngleY = y;
|
|
||||||
model.rotateAngleZ = z;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -133,9 +133,10 @@ public class ModelSmileyCloud extends ModelBaseAA{
|
||||||
setRotation(s16, 0F, 0F, 0F);
|
setRotation(s16, 0F, 0F, 0F);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
private void setRotation(ModelRenderer model, float x, float y, float z){
|
||||||
public boolean doesRotate(){
|
model.rotateAngleX = x;
|
||||||
return true;
|
model.rotateAngleY = y;
|
||||||
|
model.rotateAngleZ = z;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -158,14 +159,13 @@ public class ModelSmileyCloud extends ModelBaseAA{
|
||||||
s16.render(f);
|
s16.render(f);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setRotation(ModelRenderer model, float x, float y, float z){
|
|
||||||
model.rotateAngleX = x;
|
|
||||||
model.rotateAngleY = y;
|
|
||||||
model.rotateAngleZ = z;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getName(){
|
public String getName(){
|
||||||
return "modelSmileyCloud";
|
return "modelSmileyCloud";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean doesRotate(){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -72,139 +72,6 @@ public class GuiBooklet extends GuiScreen{
|
||||||
this.parentScreen = parentScreen;
|
this.parentScreen = parentScreen;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void updateScreen(){
|
|
||||||
super.updateScreen();
|
|
||||||
this.searchField.updateCursorCounter();
|
|
||||||
|
|
||||||
if(this.currentIndexEntry != null && this.currentChapter != null && this.currentPage != null){
|
|
||||||
this.currentPage.updateScreen(this.ticksElapsed);
|
|
||||||
}
|
|
||||||
|
|
||||||
boolean buttonThere = UpdateChecker.doneChecking && UpdateChecker.updateVersion > UpdateChecker.clientVersion;
|
|
||||||
this.buttonUpdate.visible = buttonThere;
|
|
||||||
if(buttonThere){
|
|
||||||
if(this.ticksElapsed%8 == 0){
|
|
||||||
TexturedButton button = (TexturedButton)this.buttonUpdate;
|
|
||||||
button.setTexturePos(245, button.texturePosY == 0 ? 22 : 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
this.ticksElapsed++;
|
|
||||||
}
|
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
@Override
|
|
||||||
public void keyTyped(char theChar, int key){
|
|
||||||
if(key != 1 && this.searchField.isFocused()){
|
|
||||||
this.searchField.textboxKeyTyped(theChar, key);
|
|
||||||
|
|
||||||
if(this.currentIndexEntry instanceof BookletEntryAllSearch){
|
|
||||||
BookletEntryAllSearch currentEntry = (BookletEntryAllSearch)this.currentIndexEntry;
|
|
||||||
if(this.searchField.getText() != null && !this.searchField.getText().isEmpty()){
|
|
||||||
currentEntry.chapters.clear();
|
|
||||||
|
|
||||||
for(BookletChapter chapter : currentEntry.allChapters){
|
|
||||||
if(chapter.getLocalizedName().toLowerCase().contains(this.searchField.getText().toLowerCase())){
|
|
||||||
currentEntry.chapters.add(chapter);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
currentEntry.chapters = (ArrayList<BookletChapter>)currentEntry.allChapters.clone();
|
|
||||||
}
|
|
||||||
this.openIndexEntry(this.currentIndexEntry, this.pageOpenInIndex, false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
super.keyTyped(theChar, key);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onGuiClosed(){
|
|
||||||
PersistentClientData.saveBookPage(this.currentIndexEntry, this.currentChapter, this.currentPage, this.pageOpenInIndex);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void mouseClicked(int par1, int par2, int par3){
|
|
||||||
this.searchField.mouseClicked(par1, par2, par3);
|
|
||||||
if(par3 == 0 && this.currentChapter != null){
|
|
||||||
this.mouseClicked = true;
|
|
||||||
}
|
|
||||||
super.mouseClicked(par1, par2, par3);
|
|
||||||
}
|
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
@Override
|
|
||||||
public void initGui(){
|
|
||||||
this.guiLeft = (this.width-this.xSize)/2;
|
|
||||||
this.guiTop = (this.height-this.ySize)/2;
|
|
||||||
|
|
||||||
this.unicodeRenderer = new FontRenderer(this.mc.gameSettings, new ResourceLocation("textures/font/ascii.png"), this.mc.renderEngine, true);
|
|
||||||
|
|
||||||
this.buttonForward = new TexturedButton(0, this.guiLeft+this.xSize, this.guiTop+this.ySize+2, 164, 0, 18, 10);
|
|
||||||
this.buttonList.add(this.buttonForward);
|
|
||||||
|
|
||||||
this.buttonBackward = new TexturedButton(1, this.guiLeft-18, this.guiTop+this.ySize+2, 146, 0, 18, 10);
|
|
||||||
this.buttonList.add(this.buttonBackward);
|
|
||||||
|
|
||||||
this.buttonPreviousScreen = new TexturedButton(2, this.guiLeft+this.xSize/2-7, this.guiTop+this.ySize+2, 182, 0, 15, 10);
|
|
||||||
this.buttonList.add(this.buttonPreviousScreen);
|
|
||||||
|
|
||||||
this.buttonPreviouslyOpenedGui = new TexturedButton(3, this.guiLeft+this.xSize/3, this.guiTop+this.ySize+2, 245, 44, 11, 15);
|
|
||||||
this.buttonList.add(this.buttonPreviouslyOpenedGui);
|
|
||||||
|
|
||||||
this.buttonUpdate = new TexturedButton(4, this.guiLeft-11, this.guiTop-11, 245, 0, 11, 11);
|
|
||||||
this.buttonUpdate.visible = UpdateChecker.doneChecking && UpdateChecker.updateVersion > UpdateChecker.clientVersion;
|
|
||||||
this.buttonList.add(this.buttonUpdate);
|
|
||||||
|
|
||||||
this.buttonTwitter = new TexturedButton(5, this.guiLeft, this.guiTop, 213, 0, 8, 8);
|
|
||||||
this.buttonList.add(this.buttonTwitter);
|
|
||||||
|
|
||||||
this.buttonForum = new TexturedButton(6, this.guiLeft, this.guiTop+10, 221, 0, 8, 8);
|
|
||||||
this.buttonList.add(this.buttonForum);
|
|
||||||
|
|
||||||
this.buttonAchievements = new TexturedButton(7, this.guiLeft+138, this.guiTop, 205, 0, 8, 8);
|
|
||||||
this.buttonList.add(this.buttonAchievements);
|
|
||||||
|
|
||||||
this.buttonConfig = new TexturedButton(8, this.guiLeft+138, this.guiTop+10, 197, 0, 8, 8);
|
|
||||||
this.buttonList.add(this.buttonConfig);
|
|
||||||
|
|
||||||
for(int i = 0; i < this.chapterButtons.length; i++){
|
|
||||||
this.chapterButtons[i] = new IndexButton(9+i, guiLeft+15, guiTop+10+(i*12), 115, 10, "", this);
|
|
||||||
this.buttonList.add(this.chapterButtons[i]);
|
|
||||||
}
|
|
||||||
|
|
||||||
this.searchField = new GuiTextField(this.unicodeRenderer, guiLeft+148, guiTop+162, 66, 10);
|
|
||||||
this.searchField.setMaxStringLength(30);
|
|
||||||
this.searchField.setEnableBackgroundDrawing(false);
|
|
||||||
|
|
||||||
this.currentPage = null;
|
|
||||||
this.currentChapter = null;
|
|
||||||
this.currentIndexEntry = null;
|
|
||||||
|
|
||||||
if(!PersistentClientData.getBoolean("BookAlreadyOpened")){
|
|
||||||
this.openIndexEntry(InitBooklet.chapterIntro.entry, 1, true);
|
|
||||||
this.openChapter(InitBooklet.chapterIntro, null);
|
|
||||||
|
|
||||||
PersistentClientData.setBoolean("BookAlreadyOpened", true);
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
PersistentClientData.openLastBookPage(this);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean doesGuiPauseGame(){
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void renderToolTip(ItemStack stack, int x, int y){
|
|
||||||
super.renderToolTip(stack, x, y);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void drawHoveringText(List list, int x, int y){
|
public void drawHoveringText(List list, int x, int y){
|
||||||
super.func_146283_a(list, x, y);
|
super.func_146283_a(list, x, y);
|
||||||
}
|
}
|
||||||
|
@ -298,30 +165,46 @@ public class GuiBooklet extends GuiScreen{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isGimmicky(){
|
@SuppressWarnings("unchecked")
|
||||||
return KeyUtil.isControlPressed() && KeyUtil.isShiftPressed() && KeyUtil.isAltPressed();
|
@Override
|
||||||
|
public void keyTyped(char theChar, int key){
|
||||||
|
if(key != 1 && this.searchField.isFocused()){
|
||||||
|
this.searchField.textboxKeyTyped(theChar, key);
|
||||||
|
|
||||||
|
if(this.currentIndexEntry instanceof BookletEntryAllSearch){
|
||||||
|
BookletEntryAllSearch currentEntry = (BookletEntryAllSearch)this.currentIndexEntry;
|
||||||
|
if(this.searchField.getText() != null && !this.searchField.getText().isEmpty()){
|
||||||
|
currentEntry.chapters.clear();
|
||||||
|
|
||||||
|
for(BookletChapter chapter : currentEntry.allChapters){
|
||||||
|
if(chapter.getLocalizedName().toLowerCase().contains(this.searchField.getText().toLowerCase())){
|
||||||
|
currentEntry.chapters.add(chapter);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
currentEntry.chapters = (ArrayList<BookletChapter>)currentEntry.allChapters.clone();
|
||||||
|
}
|
||||||
|
this.openIndexEntry(this.currentIndexEntry, this.pageOpenInIndex, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
super.keyTyped(theChar, key);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private BookletPage getNextPage(BookletChapter chapter, BookletPage currentPage){
|
@Override
|
||||||
for(int i = 0; i < chapter.pages.length; i++){
|
public void renderToolTip(ItemStack stack, int x, int y){
|
||||||
if(chapter.pages[i] == currentPage){
|
super.renderToolTip(stack, x, y);
|
||||||
if(i+1 < chapter.pages.length){
|
|
||||||
return chapter.pages[i+1];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private BookletPage getPrevPage(BookletChapter chapter, BookletPage currentPage){
|
@Override
|
||||||
for(int i = 0; i < chapter.pages.length; i++){
|
protected void mouseClicked(int par1, int par2, int par3){
|
||||||
if(chapter.pages[i] == currentPage){
|
this.searchField.mouseClicked(par1, par2, par3);
|
||||||
if(i-1 >= 0){
|
if(par3 == 0 && this.currentChapter != null){
|
||||||
return chapter.pages[i-1];
|
this.mouseClicked = true;
|
||||||
}
|
}
|
||||||
}
|
super.mouseClicked(par1, par2, par3);
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -429,6 +312,150 @@ public class GuiBooklet extends GuiScreen{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
@Override
|
||||||
|
public void initGui(){
|
||||||
|
this.guiLeft = (this.width-this.xSize)/2;
|
||||||
|
this.guiTop = (this.height-this.ySize)/2;
|
||||||
|
|
||||||
|
this.unicodeRenderer = new FontRenderer(this.mc.gameSettings, new ResourceLocation("textures/font/ascii.png"), this.mc.renderEngine, true);
|
||||||
|
|
||||||
|
this.buttonForward = new TexturedButton(0, this.guiLeft+this.xSize, this.guiTop+this.ySize+2, 164, 0, 18, 10);
|
||||||
|
this.buttonList.add(this.buttonForward);
|
||||||
|
|
||||||
|
this.buttonBackward = new TexturedButton(1, this.guiLeft-18, this.guiTop+this.ySize+2, 146, 0, 18, 10);
|
||||||
|
this.buttonList.add(this.buttonBackward);
|
||||||
|
|
||||||
|
this.buttonPreviousScreen = new TexturedButton(2, this.guiLeft+this.xSize/2-7, this.guiTop+this.ySize+2, 182, 0, 15, 10);
|
||||||
|
this.buttonList.add(this.buttonPreviousScreen);
|
||||||
|
|
||||||
|
this.buttonPreviouslyOpenedGui = new TexturedButton(3, this.guiLeft+this.xSize/3, this.guiTop+this.ySize+2, 245, 44, 11, 15);
|
||||||
|
this.buttonList.add(this.buttonPreviouslyOpenedGui);
|
||||||
|
|
||||||
|
this.buttonUpdate = new TexturedButton(4, this.guiLeft-11, this.guiTop-11, 245, 0, 11, 11);
|
||||||
|
this.buttonUpdate.visible = UpdateChecker.doneChecking && UpdateChecker.updateVersion > UpdateChecker.clientVersion;
|
||||||
|
this.buttonList.add(this.buttonUpdate);
|
||||||
|
|
||||||
|
this.buttonTwitter = new TexturedButton(5, this.guiLeft, this.guiTop, 213, 0, 8, 8);
|
||||||
|
this.buttonList.add(this.buttonTwitter);
|
||||||
|
|
||||||
|
this.buttonForum = new TexturedButton(6, this.guiLeft, this.guiTop+10, 221, 0, 8, 8);
|
||||||
|
this.buttonList.add(this.buttonForum);
|
||||||
|
|
||||||
|
this.buttonAchievements = new TexturedButton(7, this.guiLeft+138, this.guiTop, 205, 0, 8, 8);
|
||||||
|
this.buttonList.add(this.buttonAchievements);
|
||||||
|
|
||||||
|
this.buttonConfig = new TexturedButton(8, this.guiLeft+138, this.guiTop+10, 197, 0, 8, 8);
|
||||||
|
this.buttonList.add(this.buttonConfig);
|
||||||
|
|
||||||
|
for(int i = 0; i < this.chapterButtons.length; i++){
|
||||||
|
this.chapterButtons[i] = new IndexButton(9+i, guiLeft+15, guiTop+10+(i*12), 115, 10, "", this);
|
||||||
|
this.buttonList.add(this.chapterButtons[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.searchField = new GuiTextField(this.unicodeRenderer, guiLeft+148, guiTop+162, 66, 10);
|
||||||
|
this.searchField.setMaxStringLength(30);
|
||||||
|
this.searchField.setEnableBackgroundDrawing(false);
|
||||||
|
|
||||||
|
this.currentPage = null;
|
||||||
|
this.currentChapter = null;
|
||||||
|
this.currentIndexEntry = null;
|
||||||
|
|
||||||
|
if(!PersistentClientData.getBoolean("BookAlreadyOpened")){
|
||||||
|
this.openIndexEntry(InitBooklet.chapterIntro.entry, 1, true);
|
||||||
|
this.openChapter(InitBooklet.chapterIntro, null);
|
||||||
|
|
||||||
|
PersistentClientData.setBoolean("BookAlreadyOpened", true);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
PersistentClientData.openLastBookPage(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateScreen(){
|
||||||
|
super.updateScreen();
|
||||||
|
this.searchField.updateCursorCounter();
|
||||||
|
|
||||||
|
if(this.currentIndexEntry != null && this.currentChapter != null && this.currentPage != null){
|
||||||
|
this.currentPage.updateScreen(this.ticksElapsed);
|
||||||
|
}
|
||||||
|
|
||||||
|
boolean buttonThere = UpdateChecker.doneChecking && UpdateChecker.updateVersion > UpdateChecker.clientVersion;
|
||||||
|
this.buttonUpdate.visible = buttonThere;
|
||||||
|
if(buttonThere){
|
||||||
|
if(this.ticksElapsed%8 == 0){
|
||||||
|
TexturedButton button = (TexturedButton)this.buttonUpdate;
|
||||||
|
button.setTexturePos(245, button.texturePosY == 0 ? 22 : 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
this.ticksElapsed++;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onGuiClosed(){
|
||||||
|
PersistentClientData.saveBookPage(this.currentIndexEntry, this.currentChapter, this.currentPage, this.pageOpenInIndex);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean doesGuiPauseGame(){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void openChapter(BookletChapter chapter, BookletPage page){
|
||||||
|
if(chapter == null){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.searchField.setVisible(false);
|
||||||
|
this.searchField.setFocused(false);
|
||||||
|
this.searchField.setText("");
|
||||||
|
|
||||||
|
this.currentChapter = chapter;
|
||||||
|
this.currentPage = page != null && this.hasPage(chapter, page) ? page : chapter.pages[0];
|
||||||
|
|
||||||
|
this.buttonForward.visible = this.getNextPage(chapter, this.currentPage) != null;
|
||||||
|
this.buttonBackward.visible = this.getPrevPage(chapter, this.currentPage) != null;
|
||||||
|
this.buttonPreviousScreen.visible = true;
|
||||||
|
this.buttonPreviouslyOpenedGui.visible = this.parentScreen != null;
|
||||||
|
|
||||||
|
for(GuiButton chapterButton : this.chapterButtons){
|
||||||
|
chapterButton.visible = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean hasPage(BookletChapter chapter, BookletPage page){
|
||||||
|
for(BookletPage aPage : chapter.pages){
|
||||||
|
if(aPage == page){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
private BookletPage getNextPage(BookletChapter chapter, BookletPage currentPage){
|
||||||
|
for(int i = 0; i < chapter.pages.length; i++){
|
||||||
|
if(chapter.pages[i] == currentPage){
|
||||||
|
if(i+1 < chapter.pages.length){
|
||||||
|
return chapter.pages[i+1];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
private BookletPage getPrevPage(BookletChapter chapter, BookletPage currentPage){
|
||||||
|
for(int i = 0; i < chapter.pages.length; i++){
|
||||||
|
if(chapter.pages[i] == currentPage){
|
||||||
|
if(i-1 >= 0){
|
||||||
|
return chapter.pages[i-1];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public void openIndexEntry(BookletIndexEntry entry, int page, boolean resetTextField){
|
public void openIndexEntry(BookletIndexEntry entry, int page, boolean resetTextField){
|
||||||
if(resetTextField){
|
if(resetTextField){
|
||||||
|
@ -474,35 +501,8 @@ public class GuiBooklet extends GuiScreen{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void openChapter(BookletChapter chapter, BookletPage page){
|
private boolean isGimmicky(){
|
||||||
if(chapter == null){
|
return KeyUtil.isControlPressed() && KeyUtil.isShiftPressed() && KeyUtil.isAltPressed();
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.searchField.setVisible(false);
|
|
||||||
this.searchField.setFocused(false);
|
|
||||||
this.searchField.setText("");
|
|
||||||
|
|
||||||
this.currentChapter = chapter;
|
|
||||||
this.currentPage = page != null && this.hasPage(chapter, page) ? page : chapter.pages[0];
|
|
||||||
|
|
||||||
this.buttonForward.visible = this.getNextPage(chapter, this.currentPage) != null;
|
|
||||||
this.buttonBackward.visible = this.getPrevPage(chapter, this.currentPage) != null;
|
|
||||||
this.buttonPreviousScreen.visible = true;
|
|
||||||
this.buttonPreviouslyOpenedGui.visible = this.parentScreen != null;
|
|
||||||
|
|
||||||
for(GuiButton chapterButton : this.chapterButtons){
|
|
||||||
chapterButton.visible = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private boolean hasPage(BookletChapter chapter, BookletPage page){
|
|
||||||
for(BookletPage aPage : chapter.pages){
|
|
||||||
if(aPage == page){
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class IndexButton extends GuiButton{
|
private static class IndexButton extends GuiButton{
|
||||||
|
|
|
@ -68,14 +68,6 @@ public class BookletPage{
|
||||||
return this.id;
|
return this.id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public BookletChapter getChapter(){
|
|
||||||
return this.chapter;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setChapter(BookletChapter chapter){
|
|
||||||
this.chapter = chapter;
|
|
||||||
}
|
|
||||||
|
|
||||||
public final String getText(){
|
public final String getText(){
|
||||||
if(this.hasNoText){
|
if(this.hasNoText){
|
||||||
return null;
|
return null;
|
||||||
|
@ -89,15 +81,15 @@ public class BookletPage{
|
||||||
return base;
|
return base;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public BookletPage addTextReplacement(String text, int replacement){
|
||||||
|
return this.addTextReplacement(text, Integer.toString(replacement));
|
||||||
|
}
|
||||||
|
|
||||||
public BookletPage addTextReplacement(String text, String replacement){
|
public BookletPage addTextReplacement(String text, String replacement){
|
||||||
this.textReplacements.put(text, replacement);
|
this.textReplacements.put(text, replacement);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public BookletPage addTextReplacement(String text, int replacement){
|
|
||||||
return this.addTextReplacement(text, Integer.toString(replacement));
|
|
||||||
}
|
|
||||||
|
|
||||||
public void renderPre(GuiBooklet gui, int mouseX, int mouseY, boolean mouseClick, int ticksElapsed){
|
public void renderPre(GuiBooklet gui, int mouseX, int mouseY, boolean mouseClick, int ticksElapsed){
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -106,10 +98,6 @@ public class BookletPage{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public ItemStack[] getItemStacksForPage(){
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void updateScreen(int ticksElapsed){
|
public void updateScreen(int ticksElapsed){
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -145,4 +133,16 @@ public class BookletPage{
|
||||||
|
|
||||||
gui.drawHoveringText(list, x, y);
|
gui.drawHoveringText(list, x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ItemStack[] getItemStacksForPage(){
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BookletChapter getChapter(){
|
||||||
|
return this.chapter;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setChapter(BookletChapter chapter){
|
||||||
|
this.chapter = chapter;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,25 +31,14 @@ public class PageCrafting extends BookletPage{
|
||||||
private final IRecipe[] recipes;
|
private final IRecipe[] recipes;
|
||||||
private int recipePos;
|
private int recipePos;
|
||||||
|
|
||||||
public PageCrafting(int id, IRecipe... recipes){
|
|
||||||
super(id);
|
|
||||||
this.recipes = recipes;
|
|
||||||
InitBooklet.pagesWithItemStackData.add(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
public PageCrafting(int id, ArrayList<IRecipe> recipes){
|
public PageCrafting(int id, ArrayList<IRecipe> recipes){
|
||||||
this(id, recipes.toArray(new IRecipe[recipes.size()]));
|
this(id, recipes.toArray(new IRecipe[recipes.size()]));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
public PageCrafting(int id, IRecipe... recipes){
|
||||||
public ItemStack[] getItemStacksForPage(){
|
super(id);
|
||||||
ItemStack[] stacks = new ItemStack[this.recipes.length];
|
this.recipes = recipes;
|
||||||
for(int i = 0; i < stacks.length; i++){
|
InitBooklet.pagesWithItemStackData.add(this);
|
||||||
if(this.recipes[i] != null){
|
|
||||||
stacks[i] = this.recipes[i].getRecipeOutput();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return stacks;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -60,18 +49,6 @@ public class PageCrafting extends BookletPage{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void updateScreen(int ticksElapsed){
|
|
||||||
if(ticksElapsed%30 == 0){
|
|
||||||
if(this.recipePos+1 >= this.recipes.length){
|
|
||||||
this.recipePos = 0;
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
this.recipePos++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
@Override
|
@Override
|
||||||
public void render(GuiBooklet gui, int mouseX, int mouseY, boolean mouseClick, int ticksElapsed){
|
public void render(GuiBooklet gui, int mouseX, int mouseY, boolean mouseClick, int ticksElapsed){
|
||||||
|
@ -158,4 +135,27 @@ public class PageCrafting extends BookletPage{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateScreen(int ticksElapsed){
|
||||||
|
if(ticksElapsed%30 == 0){
|
||||||
|
if(this.recipePos+1 >= this.recipes.length){
|
||||||
|
this.recipePos = 0;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
this.recipePos++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ItemStack[] getItemStacksForPage(){
|
||||||
|
ItemStack[] stacks = new ItemStack[this.recipes.length];
|
||||||
|
for(int i = 0; i < stacks.length; i++){
|
||||||
|
if(this.recipes[i] != null){
|
||||||
|
stacks[i] = this.recipes[i].getRecipeOutput();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return stacks;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,11 +37,6 @@ public class PageCrusherRecipe extends BookletPage{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public ItemStack[] getItemStacksForPage(){
|
|
||||||
return this.recipe == null ? new ItemStack[0] : new ItemStack[]{this.recipe.firstOutput};
|
|
||||||
}
|
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
@Override
|
@Override
|
||||||
public void render(GuiBooklet gui, int mouseX, int mouseY, boolean mouseClick, int ticksElapsed){
|
public void render(GuiBooklet gui, int mouseX, int mouseY, boolean mouseClick, int ticksElapsed){
|
||||||
|
@ -89,4 +84,9 @@ public class PageCrusherRecipe extends BookletPage{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ItemStack[] getItemStacksForPage(){
|
||||||
|
return this.recipe == null ? new ItemStack[0] : new ItemStack[]{this.recipe.firstOutput};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,6 +26,10 @@ public class PageFurnace extends BookletPage{
|
||||||
private final ItemStack result;
|
private final ItemStack result;
|
||||||
private final ItemStack input;
|
private final ItemStack input;
|
||||||
|
|
||||||
|
public PageFurnace(int id, ItemStack result){
|
||||||
|
this(id, null, result);
|
||||||
|
}
|
||||||
|
|
||||||
public PageFurnace(int id, ItemStack input, ItemStack result){
|
public PageFurnace(int id, ItemStack input, ItemStack result){
|
||||||
super(id);
|
super(id);
|
||||||
this.result = result;
|
this.result = result;
|
||||||
|
@ -33,15 +37,6 @@ public class PageFurnace extends BookletPage{
|
||||||
InitBooklet.pagesWithItemStackData.add(this);
|
InitBooklet.pagesWithItemStackData.add(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public PageFurnace(int id, ItemStack result){
|
|
||||||
this(id, null, result);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ItemStack[] getItemStacksForPage(){
|
|
||||||
return this.result == null ? new ItemStack[0] : new ItemStack[]{this.result};
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void renderPre(GuiBooklet gui, int mouseX, int mouseY, boolean mouseClick, int ticksElapsed){
|
public void renderPre(GuiBooklet gui, int mouseX, int mouseY, boolean mouseClick, int ticksElapsed){
|
||||||
if(this.input != null || this.getInputForOutput(this.result) != null){
|
if(this.input != null || this.getInputForOutput(this.result) != null){
|
||||||
|
@ -91,6 +86,11 @@ public class PageFurnace extends BookletPage{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ItemStack[] getItemStacksForPage(){
|
||||||
|
return this.result == null ? new ItemStack[0] : new ItemStack[]{this.result};
|
||||||
|
}
|
||||||
|
|
||||||
private ItemStack getInputForOutput(ItemStack output){
|
private ItemStack getInputForOutput(ItemStack output){
|
||||||
for(Object o : FurnaceRecipes.smelting().getSmeltingList().entrySet()){
|
for(Object o : FurnaceRecipes.smelting().getSmeltingList().entrySet()){
|
||||||
ItemStack stack = (ItemStack)((Map.Entry)o).getValue();
|
ItemStack stack = (ItemStack)((Map.Entry)o).getValue();
|
||||||
|
|
|
@ -30,11 +30,6 @@ public class PageTextOnly extends BookletPage{
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public ItemStack[] getItemStacksForPage(){
|
|
||||||
return this.stack == null ? new ItemStack[0] : new ItemStack[]{this.stack};
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void renderPre(GuiBooklet gui, int mouseX, int mouseY, boolean mouseClick, int ticksElapsed){
|
public void renderPre(GuiBooklet gui, int mouseX, int mouseY, boolean mouseClick, int ticksElapsed){
|
||||||
String text = gui.currentPage.getText();
|
String text = gui.currentPage.getText();
|
||||||
|
@ -42,4 +37,9 @@ public class PageTextOnly extends BookletPage{
|
||||||
gui.unicodeRenderer.drawSplitString(text, gui.guiLeft+14, gui.guiTop+9, 115, 0);
|
gui.unicodeRenderer.drawSplitString(text, gui.guiLeft+14, gui.guiTop+9, 115, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ItemStack[] getItemStacksForPage(){
|
||||||
|
return this.stack == null ? new ItemStack[0] : new ItemStack[]{this.stack};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -160,8 +160,8 @@ public enum ConfigCrafting{
|
||||||
this(name, category, true);
|
this(name, category, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
ConfigCrafting(String name, ConfigCategories category, String extraText){
|
ConfigCrafting(String name, ConfigCategories category, boolean defaultValue){
|
||||||
this(name, category, extraText, true);
|
this(name, category, "", defaultValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
ConfigCrafting(String name, ConfigCategories category, String extraText, boolean defaultValue){
|
ConfigCrafting(String name, ConfigCategories category, String extraText, boolean defaultValue){
|
||||||
|
@ -171,8 +171,8 @@ public enum ConfigCrafting{
|
||||||
this.extraText = extraText.length() > 0 ? extraText+" " : "";
|
this.extraText = extraText.length() > 0 ? extraText+" " : "";
|
||||||
}
|
}
|
||||||
|
|
||||||
ConfigCrafting(String name, ConfigCategories category, boolean defaultValue){
|
ConfigCrafting(String name, ConfigCategories category, String extraText){
|
||||||
this(name, category, "", defaultValue);
|
this(name, category, extraText, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isEnabled(){
|
public boolean isEnabled(){
|
||||||
|
|
|
@ -32,6 +32,16 @@ public class CreativeTab extends CreativeTabs{
|
||||||
super(ModUtil.MOD_ID_LOWER);
|
super(ModUtil.MOD_ID_LOWER);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ItemStack getIconItemStack(){
|
||||||
|
return new ItemStack(this.getTabIconItem());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Item getTabIconItem(){
|
||||||
|
return Item.getItemFromBlock(InitBlocks.blockPhantomLiquiface);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void displayAllReleventItems(List list){
|
public void displayAllReleventItems(List list){
|
||||||
|
@ -186,16 +196,6 @@ public class CreativeTab extends CreativeTabs{
|
||||||
add(InitItems.itemPotionRingAdvanced);
|
add(InitItems.itemPotionRingAdvanced);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public Item getTabIconItem(){
|
|
||||||
return Item.getItemFromBlock(InitBlocks.blockPhantomLiquiface);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ItemStack getIconItemStack(){
|
|
||||||
return new ItemStack(this.getTabIconItem());
|
|
||||||
}
|
|
||||||
|
|
||||||
public void add(Item item){
|
public void add(Item item){
|
||||||
item.getSubItems(item, instance, this.list);
|
item.getSubItems(item, instance, this.list);
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,19 +25,6 @@ import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
public class CraftEvent{
|
public class CraftEvent{
|
||||||
|
|
||||||
public static void checkAchievements(ItemStack gotten, EntityPlayer player, int type){
|
|
||||||
for(int i = 0; i < TheAchievements.values().length; i++){
|
|
||||||
TheAchievements ach = TheAchievements.values()[i];
|
|
||||||
if(ach.type == type){
|
|
||||||
if(gotten != null && ach.ach.theItemStack != null && gotten.getItem() == ach.ach.theItemStack.getItem()){
|
|
||||||
if(gotten.getItemDamage() == ach.ach.theItemStack.getItemDamage()){
|
|
||||||
player.addStat(ach.ach, 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public void onCraftedEvent(PlayerEvent.ItemCraftedEvent event){
|
public void onCraftedEvent(PlayerEvent.ItemCraftedEvent event){
|
||||||
checkAchievements(event.crafting, event.player, InitAchievements.CRAFTING_ACH);
|
checkAchievements(event.crafting, event.player, InitAchievements.CRAFTING_ACH);
|
||||||
|
@ -55,4 +42,17 @@ public class CraftEvent{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void checkAchievements(ItemStack gotten, EntityPlayer player, int type){
|
||||||
|
for(int i = 0; i < TheAchievements.values().length; i++){
|
||||||
|
TheAchievements ach = TheAchievements.values()[i];
|
||||||
|
if(ach.type == type){
|
||||||
|
if(gotten != null && ach.ach.theItemStack != null && gotten.getItem() == ach.ach.theItemStack.getItem()){
|
||||||
|
if(gotten.getItemDamage() == ach.ach.theItemStack.getItemDamage()){
|
||||||
|
player.addStat(ach.ach, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,22 +55,6 @@ public class WorldDecorationEvent{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void genPlantNormally(Block plant, int meta, int amount, boolean doIt, Material blockBelow, DecorateBiomeEvent event){
|
|
||||||
if(doIt){
|
|
||||||
for(int i = 0; i < amount; i++){
|
|
||||||
if(event.rand.nextInt(ConfigIntValues.NORMAL_PLANT_CHANCE.getValue()) == 0){
|
|
||||||
int genX = event.chunkX+event.rand.nextInt(16)+8;
|
|
||||||
int genZ = event.chunkZ+event.rand.nextInt(16)+8;
|
|
||||||
int genY = event.world.getTopSolidOrLiquidBlock(genX, genZ)-1;
|
|
||||||
|
|
||||||
if(event.world.getBlock(genX, genY, genZ).getMaterial() == blockBelow){
|
|
||||||
event.world.setBlock(genX, genY+1, genZ, plant, meta, 2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void generateRice(DecorateBiomeEvent event){
|
private void generateRice(DecorateBiomeEvent event){
|
||||||
if(ConfigBoolValues.DO_RICE_GEN.isEnabled()){
|
if(ConfigBoolValues.DO_RICE_GEN.isEnabled()){
|
||||||
for(int i = 0; i < ConfigIntValues.RICE_AMOUNT.getValue(); i++){
|
for(int i = 0; i < ConfigIntValues.RICE_AMOUNT.getValue(); i++){
|
||||||
|
@ -92,4 +76,20 @@ public class WorldDecorationEvent{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void genPlantNormally(Block plant, int meta, int amount, boolean doIt, Material blockBelow, DecorateBiomeEvent event){
|
||||||
|
if(doIt){
|
||||||
|
for(int i = 0; i < amount; i++){
|
||||||
|
if(event.rand.nextInt(ConfigIntValues.NORMAL_PLANT_CHANCE.getValue()) == 0){
|
||||||
|
int genX = event.chunkX+event.rand.nextInt(16)+8;
|
||||||
|
int genZ = event.chunkZ+event.rand.nextInt(16)+8;
|
||||||
|
int genY = event.world.getTopSolidOrLiquidBlock(genX, genZ)-1;
|
||||||
|
|
||||||
|
if(event.world.getBlock(genX, genY, genZ).getMaterial() == blockBelow){
|
||||||
|
event.world.setBlock(genX, genY+1, genZ, plant, meta, 2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,6 +40,15 @@ public class JamVillagerTradeHandler implements VillagerRegistry.IVillageTradeHa
|
||||||
this.addWants("dustGlowstone", 12, 22);
|
this.addWants("dustGlowstone", 12, 22);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void addWants(String oredictName, int minSize, int maxSize){
|
||||||
|
ArrayList<ItemStack> stacks = (ArrayList<ItemStack>)OreDictionary.getOres(oredictName, false);
|
||||||
|
trades.add(new Trade(stacks, minSize, maxSize));
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addWants(ItemStack stack, int minSize, int maxSize){
|
||||||
|
trades.add(new Trade(stack, minSize, maxSize));
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SuppressWarnings("all")
|
@SuppressWarnings("all")
|
||||||
public void manipulateTradesForVillager(EntityVillager villager, MerchantRecipeList recipeList, Random rand){
|
public void manipulateTradesForVillager(EntityVillager villager, MerchantRecipeList recipeList, Random rand){
|
||||||
|
@ -67,15 +76,6 @@ public class JamVillagerTradeHandler implements VillagerRegistry.IVillageTradeHa
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addWants(String oredictName, int minSize, int maxSize){
|
|
||||||
ArrayList<ItemStack> stacks = (ArrayList<ItemStack>)OreDictionary.getOres(oredictName, false);
|
|
||||||
trades.add(new Trade(stacks, minSize, maxSize));
|
|
||||||
}
|
|
||||||
|
|
||||||
public void addWants(ItemStack stack, int minSize, int maxSize){
|
|
||||||
trades.add(new Trade(stack, minSize, maxSize));
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class Trade{
|
public static class Trade{
|
||||||
|
|
||||||
public final ArrayList<ItemStack> wants = new ArrayList<ItemStack>();
|
public final ArrayList<ItemStack> wants = new ArrayList<ItemStack>();
|
||||||
|
|
|
@ -52,6 +52,11 @@ public class OreGen implements IWorldGenerator{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unused")
|
||||||
|
private void generateNether(World world, Random random, int x, int z){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unused")
|
@SuppressWarnings("unused")
|
||||||
private void generateEnd(World world, Random random, int x, int z){
|
private void generateEnd(World world, Random random, int x, int z){
|
||||||
|
|
||||||
|
@ -63,11 +68,6 @@ public class OreGen implements IWorldGenerator{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unused")
|
|
||||||
private void generateNether(World world, Random random, int x, int z){
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public void addOreSpawn(Block block, int meta, Block blockIn, World world, Random random, int blockXPos, int blockZPos, int maxVeinSize, int chancesToSpawn, int minY, int maxY){
|
public void addOreSpawn(Block block, int meta, Block blockIn, World world, Random random, int blockXPos, int blockZPos, int maxVeinSize, int chancesToSpawn, int minY, int maxY){
|
||||||
if(maxY > minY){
|
if(maxY > minY){
|
||||||
int yDiff = maxY-minY;
|
int yDiff = maxY-minY;
|
||||||
|
|
|
@ -68,17 +68,8 @@ public class VillageComponentCustomCropField extends StructureVillagePieces.Hous
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Block getRandomCropType(Random rand){
|
public void fillWithBlocks(World world, StructureBoundingBox sbb, int minX, int minY, int minZ, int maxX, int maxY, int maxZ, Block block){
|
||||||
switch(rand.nextInt(4)){
|
this.fillWithBlocks(world, sbb, minX, minY, minZ, maxX, maxY, maxZ, block, block, false);
|
||||||
case 0:
|
|
||||||
return InitBlocks.blockFlax;
|
|
||||||
case 1:
|
|
||||||
return InitBlocks.blockCoffee;
|
|
||||||
case 2:
|
|
||||||
return InitBlocks.blockRice;
|
|
||||||
default:
|
|
||||||
return InitBlocks.blockCanola;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void spawnActualHouse(World world, Random rand, StructureBoundingBox sbb){
|
public void spawnActualHouse(World world, Random rand, StructureBoundingBox sbb){
|
||||||
|
@ -106,7 +97,16 @@ public class VillageComponentCustomCropField extends StructureVillagePieces.Hous
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void fillWithBlocks(World world, StructureBoundingBox sbb, int minX, int minY, int minZ, int maxX, int maxY, int maxZ, Block block){
|
private Block getRandomCropType(Random rand){
|
||||||
this.fillWithBlocks(world, sbb, minX, minY, minZ, maxX, maxY, maxZ, block, block, false);
|
switch(rand.nextInt(4)){
|
||||||
|
case 0:
|
||||||
|
return InitBlocks.blockFlax;
|
||||||
|
case 1:
|
||||||
|
return InitBlocks.blockCoffee;
|
||||||
|
case 2:
|
||||||
|
return InitBlocks.blockRice;
|
||||||
|
default:
|
||||||
|
return InitBlocks.blockCanola;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -73,6 +73,10 @@ public class VillageComponentJamHouse extends StructureVillagePieces.House1{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void fillWithBlocks(World world, StructureBoundingBox sbb, int minX, int minY, int minZ, int maxX, int maxY, int maxZ, Block block){
|
||||||
|
this.fillWithBlocks(world, sbb, minX, minY, minZ, maxX, maxY, maxZ, block, block, false);
|
||||||
|
}
|
||||||
|
|
||||||
public void spawnActualHouse(World world, Random rand, StructureBoundingBox sbb){
|
public void spawnActualHouse(World world, Random rand, StructureBoundingBox sbb){
|
||||||
//Base
|
//Base
|
||||||
this.fillWithBlocks(world, sbb, 1, 0, 8, 9, 0, 10, Blocks.grass);
|
this.fillWithBlocks(world, sbb, 1, 0, 8, 9, 0, 10, Blocks.grass);
|
||||||
|
@ -193,10 +197,6 @@ public class VillageComponentJamHouse extends StructureVillagePieces.House1{
|
||||||
this.placeBlockAtCurrentPosition(world, Blocks.torch, 0, 8, 3, 6, sbb);
|
this.placeBlockAtCurrentPosition(world, Blocks.torch, 0, 8, 3, 6, sbb);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void fillWithBlocks(World world, StructureBoundingBox sbb, int minX, int minY, int minZ, int maxX, int maxY, int maxZ, Block block){
|
|
||||||
this.fillWithBlocks(world, sbb, minX, minY, minZ, maxX, maxY, maxZ, block, block, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected int getVillagerType(int par1){
|
protected int getVillagerType(int par1){
|
||||||
return ConfigIntValues.JAM_VILLAGER_ID.getValue();
|
return ConfigIntValues.JAM_VILLAGER_ID.getValue();
|
||||||
|
|
|
@ -43,11 +43,6 @@ public class ContainerBreaker extends Container{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canInteractWith(EntityPlayer player){
|
|
||||||
return this.breaker.isUseableByPlayer(player);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack transferStackInSlot(EntityPlayer player, int slot){
|
public ItemStack transferStackInSlot(EntityPlayer player, int slot){
|
||||||
final int inventoryStart = 9;
|
final int inventoryStart = 9;
|
||||||
|
@ -96,4 +91,9 @@ public class ContainerBreaker extends Container{
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canInteractWith(EntityPlayer player){
|
||||||
|
return this.breaker.isUseableByPlayer(player);
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -47,11 +47,6 @@ public class ContainerCanolaPress extends Container{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canInteractWith(EntityPlayer player){
|
|
||||||
return this.press.isUseableByPlayer(player);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack transferStackInSlot(EntityPlayer player, int slot){
|
public ItemStack transferStackInSlot(EntityPlayer player, int slot){
|
||||||
final int inventoryStart = 3;
|
final int inventoryStart = 3;
|
||||||
|
@ -109,4 +104,9 @@ public class ContainerCanolaPress extends Container{
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canInteractWith(EntityPlayer player){
|
||||||
|
return this.press.isUseableByPlayer(player);
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -40,11 +40,6 @@ public class ContainerCoalGenerator extends Container{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canInteractWith(EntityPlayer player){
|
|
||||||
return this.generator.isUseableByPlayer(player);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack transferStackInSlot(EntityPlayer player, int slot){
|
public ItemStack transferStackInSlot(EntityPlayer player, int slot){
|
||||||
final int inventoryStart = 1;
|
final int inventoryStart = 1;
|
||||||
|
@ -97,4 +92,9 @@ public class ContainerCoalGenerator extends Container{
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canInteractWith(EntityPlayer player){
|
||||||
|
return this.generator.isUseableByPlayer(player);
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -57,11 +57,6 @@ public class ContainerCoffeeMachine extends Container{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canInteractWith(EntityPlayer player){
|
|
||||||
return this.machine.isUseableByPlayer(player);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack transferStackInSlot(EntityPlayer player, int slot){
|
public ItemStack transferStackInSlot(EntityPlayer player, int slot){
|
||||||
final int inventoryStart = 13;
|
final int inventoryStart = 13;
|
||||||
|
@ -136,4 +131,9 @@ public class ContainerCoffeeMachine extends Container{
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canInteractWith(EntityPlayer player){
|
||||||
|
return this.machine.isUseableByPlayer(player);
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -55,30 +55,6 @@ public class ContainerCrafter extends Container{
|
||||||
this.onCraftMatrixChanged(this.craftMatrix);
|
this.onCraftMatrixChanged(this.craftMatrix);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onCraftMatrixChanged(IInventory inv){
|
|
||||||
this.craftResult.setInventorySlotContents(0, CraftingManager.getInstance().findMatchingRecipe(this.craftMatrix, this.world));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onContainerClosed(EntityPlayer player){
|
|
||||||
super.onContainerClosed(player);
|
|
||||||
|
|
||||||
if(!this.world.isRemote){
|
|
||||||
for(int i = 0; i < 9; ++i){
|
|
||||||
ItemStack stack = this.craftMatrix.getStackInSlotOnClosing(i);
|
|
||||||
if(stack != null){
|
|
||||||
player.dropPlayerItemWithRandomChoice(stack, false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canInteractWith(EntityPlayer player){
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack transferStackInSlot(EntityPlayer player, int slot){
|
public ItemStack transferStackInSlot(EntityPlayer player, int slot){
|
||||||
ItemStack stack = null;
|
ItemStack stack = null;
|
||||||
|
@ -119,4 +95,28 @@ public class ContainerCrafter extends Container{
|
||||||
}
|
}
|
||||||
return stack;
|
return stack;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onContainerClosed(EntityPlayer player){
|
||||||
|
super.onContainerClosed(player);
|
||||||
|
|
||||||
|
if(!this.world.isRemote){
|
||||||
|
for(int i = 0; i < 9; ++i){
|
||||||
|
ItemStack stack = this.craftMatrix.getStackInSlotOnClosing(i);
|
||||||
|
if(stack != null){
|
||||||
|
player.dropPlayerItemWithRandomChoice(stack, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCraftMatrixChanged(IInventory inv){
|
||||||
|
this.craftResult.setInventorySlotContents(0, CraftingManager.getInstance().findMatchingRecipe(this.craftMatrix, this.world));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canInteractWith(EntityPlayer player){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -65,32 +65,6 @@ public class ContainerDrill extends Container{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canInteractWith(EntityPlayer player){
|
|
||||||
return this.drillInventory.isUseableByPlayer(player);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onContainerClosed(EntityPlayer player){
|
|
||||||
ItemStack stack = inventory.getCurrentItem();
|
|
||||||
if(stack != null && stack.getItem() instanceof ItemDrill){
|
|
||||||
((ItemDrill)stack.getItem()).writeSlotsToNBT(this.drillInventory.slots, inventory.getCurrentItem());
|
|
||||||
}
|
|
||||||
super.onContainerClosed(player);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ItemStack slotClick(int par1, int par2, int par3, EntityPlayer player){
|
|
||||||
//par3 appears to be the type of clicking
|
|
||||||
//par3 == 2 appears to be one of the number keys being hit
|
|
||||||
if(par3 == 2 && par2 == inventory.currentItem){
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
return super.slotClick(par1, par2, par3, player);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack transferStackInSlot(EntityPlayer player, int slot){
|
public ItemStack transferStackInSlot(EntityPlayer player, int slot){
|
||||||
final int inventoryStart = 5;
|
final int inventoryStart = 5;
|
||||||
|
@ -144,6 +118,32 @@ public class ContainerDrill extends Container{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ItemStack slotClick(int par1, int par2, int par3, EntityPlayer player){
|
||||||
|
//par3 appears to be the type of clicking
|
||||||
|
//par3 == 2 appears to be one of the number keys being hit
|
||||||
|
if(par3 == 2 && par2 == inventory.currentItem){
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
return super.slotClick(par1, par2, par3, player);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onContainerClosed(EntityPlayer player){
|
||||||
|
ItemStack stack = inventory.getCurrentItem();
|
||||||
|
if(stack != null && stack.getItem() instanceof ItemDrill){
|
||||||
|
((ItemDrill)stack.getItem()).writeSlotsToNBT(this.drillInventory.slots, inventory.getCurrentItem());
|
||||||
|
}
|
||||||
|
super.onContainerClosed(player);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canInteractWith(EntityPlayer player){
|
||||||
|
return this.drillInventory.isUseableByPlayer(player);
|
||||||
|
}
|
||||||
|
|
||||||
public static class InventoryDrill implements IInventory{
|
public static class InventoryDrill implements IInventory{
|
||||||
|
|
||||||
public ItemStack[] slots = new ItemStack[SLOT_AMOUNT];
|
public ItemStack[] slots = new ItemStack[SLOT_AMOUNT];
|
||||||
|
|
|
@ -43,11 +43,6 @@ public class ContainerDropper extends Container{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canInteractWith(EntityPlayer player){
|
|
||||||
return this.dropper.isUseableByPlayer(player);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack transferStackInSlot(EntityPlayer player, int slot){
|
public ItemStack transferStackInSlot(EntityPlayer player, int slot){
|
||||||
final int inventoryStart = 9;
|
final int inventoryStart = 9;
|
||||||
|
@ -96,4 +91,9 @@ public class ContainerDropper extends Container{
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canInteractWith(EntityPlayer player){
|
||||||
|
return this.dropper.isUseableByPlayer(player);
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -50,13 +50,13 @@ public class ContainerEnergizer extends Container{
|
||||||
final int finalI = i;
|
final int finalI = i;
|
||||||
this.addSlotToContainer(new Slot(inventory, inventory.getSizeInventory()-1-i, 102, 19+i*18){
|
this.addSlotToContainer(new Slot(inventory, inventory.getSizeInventory()-1-i, 102, 19+i*18){
|
||||||
@Override
|
@Override
|
||||||
public int getSlotStackLimit(){
|
public boolean isItemValid(ItemStack stack){
|
||||||
return 1;
|
return stack != null && stack.getItem().isValidArmor(stack, finalI, finalPlayer);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isItemValid(ItemStack stack){
|
public int getSlotStackLimit(){
|
||||||
return stack != null && stack.getItem().isValidArmor(stack, finalI, finalPlayer);
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -68,11 +68,6 @@ public class ContainerEnergizer extends Container{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canInteractWith(EntityPlayer player){
|
|
||||||
return this.energizer.isUseableByPlayer(player);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack transferStackInSlot(EntityPlayer player, int slot){
|
public ItemStack transferStackInSlot(EntityPlayer player, int slot){
|
||||||
final int inventoryStart = 2;
|
final int inventoryStart = 2;
|
||||||
|
@ -132,4 +127,9 @@ public class ContainerEnergizer extends Container{
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canInteractWith(EntityPlayer player){
|
||||||
|
return this.energizer.isUseableByPlayer(player);
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -50,13 +50,13 @@ public class ContainerEnervator extends Container{
|
||||||
final int finalI = i;
|
final int finalI = i;
|
||||||
this.addSlotToContainer(new Slot(inventory, inventory.getSizeInventory()-1-i, 102, 19+i*18){
|
this.addSlotToContainer(new Slot(inventory, inventory.getSizeInventory()-1-i, 102, 19+i*18){
|
||||||
@Override
|
@Override
|
||||||
public int getSlotStackLimit(){
|
public boolean isItemValid(ItemStack stack){
|
||||||
return 1;
|
return stack != null && stack.getItem().isValidArmor(stack, finalI, finalPlayer);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isItemValid(ItemStack stack){
|
public int getSlotStackLimit(){
|
||||||
return stack != null && stack.getItem().isValidArmor(stack, finalI, finalPlayer);
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -68,11 +68,6 @@ public class ContainerEnervator extends Container{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canInteractWith(EntityPlayer player){
|
|
||||||
return this.enervator.isUseableByPlayer(player);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack transferStackInSlot(EntityPlayer player, int slot){
|
public ItemStack transferStackInSlot(EntityPlayer player, int slot){
|
||||||
final int inventoryStart = 2;
|
final int inventoryStart = 2;
|
||||||
|
@ -132,4 +127,9 @@ public class ContainerEnervator extends Container{
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canInteractWith(EntityPlayer player){
|
||||||
|
return this.enervator.isUseableByPlayer(player);
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -38,11 +38,6 @@ public class ContainerFeeder extends Container{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canInteractWith(EntityPlayer player){
|
|
||||||
return this.tileFeeder.isUseableByPlayer(player);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack transferStackInSlot(EntityPlayer player, int slot){
|
public ItemStack transferStackInSlot(EntityPlayer player, int slot){
|
||||||
final int inventoryStart = 1;
|
final int inventoryStart = 1;
|
||||||
|
@ -91,4 +86,9 @@ public class ContainerFeeder extends Container{
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canInteractWith(EntityPlayer player){
|
||||||
|
return this.tileFeeder.isUseableByPlayer(player);
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -46,11 +46,6 @@ public class ContainerFermentingBarrel extends Container{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canInteractWith(EntityPlayer player){
|
|
||||||
return this.barrel.isUseableByPlayer(player);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack transferStackInSlot(EntityPlayer player, int slot){
|
public ItemStack transferStackInSlot(EntityPlayer player, int slot){
|
||||||
final int inventoryStart = 4;
|
final int inventoryStart = 4;
|
||||||
|
@ -108,4 +103,9 @@ public class ContainerFermentingBarrel extends Container{
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canInteractWith(EntityPlayer player){
|
||||||
|
return this.barrel.isUseableByPlayer(player);
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -42,11 +42,6 @@ public class ContainerFluidCollector extends Container{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canInteractWith(EntityPlayer player){
|
|
||||||
return this.collector.isUseableByPlayer(player);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack transferStackInSlot(EntityPlayer player, int slot){
|
public ItemStack transferStackInSlot(EntityPlayer player, int slot){
|
||||||
final int inventoryStart = 2;
|
final int inventoryStart = 2;
|
||||||
|
@ -106,4 +101,9 @@ public class ContainerFluidCollector extends Container{
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canInteractWith(EntityPlayer player){
|
||||||
|
return this.collector.isUseableByPlayer(player);
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -44,11 +44,6 @@ public class ContainerFurnaceDouble extends Container{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canInteractWith(EntityPlayer player){
|
|
||||||
return this.tileFurnace.isUseableByPlayer(player);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack transferStackInSlot(EntityPlayer player, int slot){
|
public ItemStack transferStackInSlot(EntityPlayer player, int slot){
|
||||||
final int inventoryStart = 4;
|
final int inventoryStart = 4;
|
||||||
|
@ -110,4 +105,9 @@ public class ContainerFurnaceDouble extends Container{
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canInteractWith(EntityPlayer player){
|
||||||
|
return this.tileFurnace.isUseableByPlayer(player);
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -43,11 +43,6 @@ public class ContainerGiantChest extends Container{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canInteractWith(EntityPlayer player){
|
|
||||||
return this.tileChest.isUseableByPlayer(player);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack transferStackInSlot(EntityPlayer player, int slot){
|
public ItemStack transferStackInSlot(EntityPlayer player, int slot){
|
||||||
final int inventoryStart = 117;
|
final int inventoryStart = 117;
|
||||||
|
@ -96,4 +91,9 @@ public class ContainerGiantChest extends Container{
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canInteractWith(EntityPlayer player){
|
||||||
|
return this.tileChest.isUseableByPlayer(player);
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -50,11 +50,6 @@ public class ContainerGrinder extends Container{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canInteractWith(EntityPlayer player){
|
|
||||||
return this.tileGrinder.isUseableByPlayer(player);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack transferStackInSlot(EntityPlayer player, int slot){
|
public ItemStack transferStackInSlot(EntityPlayer player, int slot){
|
||||||
final int inventoryStart = this.isDouble ? 6 : 3;
|
final int inventoryStart = this.isDouble ? 6 : 3;
|
||||||
|
@ -121,4 +116,9 @@ public class ContainerGrinder extends Container{
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canInteractWith(EntityPlayer player){
|
||||||
|
return this.tileGrinder.isUseableByPlayer(player);
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -54,22 +54,6 @@ public class ContainerInputter extends Container{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canInteractWith(EntityPlayer player){
|
|
||||||
return this.tileInputter.isUseableByPlayer(player);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ItemStack slotClick(int par1, int par2, int par3, EntityPlayer player){
|
|
||||||
if(par1 >= 0 && par1 < this.inventorySlots.size() && this.getSlot(par1) instanceof SlotFilter){
|
|
||||||
//Calls the Filter's SlotClick function
|
|
||||||
return ((SlotFilter)getSlot(par1)).slotClick(player, par2);
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
return super.slotClick(par1, par2, par3, player);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack transferStackInSlot(EntityPlayer player, int slot){
|
public ItemStack transferStackInSlot(EntityPlayer player, int slot){
|
||||||
final int inventoryStart = this.isAdvanced ? 25 : 1;
|
final int inventoryStart = this.isAdvanced ? 25 : 1;
|
||||||
|
@ -118,4 +102,20 @@ public class ContainerInputter extends Container{
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ItemStack slotClick(int par1, int par2, int par3, EntityPlayer player){
|
||||||
|
if(par1 >= 0 && par1 < this.inventorySlots.size() && this.getSlot(par1) instanceof SlotFilter){
|
||||||
|
//Calls the Filter's SlotClick function
|
||||||
|
return ((SlotFilter)getSlot(par1)).slotClick(player, par2);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
return super.slotClick(par1, par2, par3, player);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canInteractWith(EntityPlayer player){
|
||||||
|
return this.tileInputter.isUseableByPlayer(player);
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -44,11 +44,6 @@ public class ContainerOilGenerator extends Container{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canInteractWith(EntityPlayer player){
|
|
||||||
return this.generator.isUseableByPlayer(player);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack transferStackInSlot(EntityPlayer player, int slot){
|
public ItemStack transferStackInSlot(EntityPlayer player, int slot){
|
||||||
final int inventoryStart = 2;
|
final int inventoryStart = 2;
|
||||||
|
@ -101,4 +96,9 @@ public class ContainerOilGenerator extends Container{
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canInteractWith(EntityPlayer player){
|
||||||
|
return this.generator.isUseableByPlayer(player);
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -46,11 +46,6 @@ public class ContainerOreMagnet extends Container{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canInteractWith(EntityPlayer player){
|
|
||||||
return this.magnet.isUseableByPlayer(player);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack transferStackInSlot(EntityPlayer player, int slot){
|
public ItemStack transferStackInSlot(EntityPlayer player, int slot){
|
||||||
final int inventoryStart = 3;
|
final int inventoryStart = 3;
|
||||||
|
@ -103,4 +98,9 @@ public class ContainerOreMagnet extends Container{
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canInteractWith(EntityPlayer player){
|
||||||
|
return this.magnet.isUseableByPlayer(player);
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -43,11 +43,6 @@ public class ContainerPhantomPlacer extends Container{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canInteractWith(EntityPlayer player){
|
|
||||||
return this.placer.isUseableByPlayer(player);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack transferStackInSlot(EntityPlayer player, int slot){
|
public ItemStack transferStackInSlot(EntityPlayer player, int slot){
|
||||||
final int inventoryStart = 9;
|
final int inventoryStart = 9;
|
||||||
|
@ -96,4 +91,9 @@ public class ContainerPhantomPlacer extends Container{
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canInteractWith(EntityPlayer player){
|
||||||
|
return this.placer.isUseableByPlayer(player);
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -41,11 +41,6 @@ public class ContainerRepairer extends Container{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canInteractWith(EntityPlayer player){
|
|
||||||
return this.tileRepairer.isUseableByPlayer(player);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack transferStackInSlot(EntityPlayer player, int slot){
|
public ItemStack transferStackInSlot(EntityPlayer player, int slot){
|
||||||
final int inventoryStart = 2;
|
final int inventoryStart = 2;
|
||||||
|
@ -98,4 +93,9 @@ public class ContainerRepairer extends Container{
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canInteractWith(EntityPlayer player){
|
||||||
|
return this.tileRepairer.isUseableByPlayer(player);
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -16,13 +16,13 @@ import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
public class ContainerSmileyCloud extends Container{
|
public class ContainerSmileyCloud extends Container{
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canInteractWith(EntityPlayer player){
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack transferStackInSlot(EntityPlayer player, int slot){
|
public ItemStack transferStackInSlot(EntityPlayer player, int slot){
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canInteractWith(EntityPlayer player){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -40,11 +40,6 @@ public class ContainerXPSolidifier extends Container{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canInteractWith(EntityPlayer player){
|
|
||||||
return this.solidifier.isUseableByPlayer(player);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack transferStackInSlot(EntityPlayer player, int slot){
|
public ItemStack transferStackInSlot(EntityPlayer player, int slot){
|
||||||
final int inventoryStart = 1;
|
final int inventoryStart = 1;
|
||||||
|
@ -89,4 +84,9 @@ public class ContainerXPSolidifier extends Container{
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canInteractWith(EntityPlayer player){
|
||||||
|
return this.solidifier.isUseableByPlayer(player);
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -178,12 +178,12 @@ public class GuiHandler implements IGuiHandler{
|
||||||
|
|
||||||
public boolean checkTileEntity;
|
public boolean checkTileEntity;
|
||||||
|
|
||||||
GuiTypes(boolean checkTileEntity){
|
|
||||||
this.checkTileEntity = checkTileEntity;
|
|
||||||
}
|
|
||||||
|
|
||||||
GuiTypes(){
|
GuiTypes(){
|
||||||
this(true);
|
this(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GuiTypes(boolean checkTileEntity){
|
||||||
|
this.checkTileEntity = checkTileEntity;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -34,6 +34,11 @@ public class GuiBreaker extends GuiContainer{
|
||||||
this.ySize = 93+86;
|
this.ySize = 93+86;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void drawScreen(int x, int y, float f){
|
||||||
|
super.drawScreen(x, y, f);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawGuiContainerForegroundLayer(int x, int y){
|
public void drawGuiContainerForegroundLayer(int x, int y){
|
||||||
AssetUtil.displayNameString(this.fontRendererObj, xSize, -10, this.breaker.getInventoryName());
|
AssetUtil.displayNameString(this.fontRendererObj, xSize, -10, this.breaker.getInventoryName());
|
||||||
|
@ -49,9 +54,4 @@ public class GuiBreaker extends GuiContainer{
|
||||||
this.mc.getTextureManager().bindTexture(resLoc);
|
this.mc.getTextureManager().bindTexture(resLoc);
|
||||||
this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, 176, 93);
|
this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, 176, 93);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void drawScreen(int x, int y, float f){
|
|
||||||
super.drawScreen(x, y, f);
|
|
||||||
}
|
|
||||||
}
|
}
|
|
@ -37,6 +37,20 @@ public class GuiCanolaPress extends GuiContainer{
|
||||||
this.ySize = 93+86;
|
this.ySize = 93+86;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void drawScreen(int x, int y, float f){
|
||||||
|
super.drawScreen(x, y, f);
|
||||||
|
String text1 = this.press.storage.getEnergyStored()+"/"+this.press.storage.getMaxEnergyStored()+" RF";
|
||||||
|
if(x >= guiLeft+43 && y >= guiTop+6 && x <= guiLeft+58 && y <= guiTop+88){
|
||||||
|
this.func_146283_a(Collections.singletonList(text1), x, y);
|
||||||
|
}
|
||||||
|
|
||||||
|
String text2 = this.press.tank.getFluidAmount()+"/"+this.press.tank.getCapacity()+" mB "+StringUtil.localize("fluid.canolaoil");
|
||||||
|
if(x >= guiLeft+117 && y >= guiTop+6 && x <= guiLeft+132 && y <= guiTop+88){
|
||||||
|
this.func_146283_a(Collections.singletonList(text2), x, y);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawGuiContainerForegroundLayer(int x, int y){
|
public void drawGuiContainerForegroundLayer(int x, int y){
|
||||||
AssetUtil.displayNameString(this.fontRendererObj, xSize, -10, this.press.getInventoryName());
|
AssetUtil.displayNameString(this.fontRendererObj, xSize, -10, this.press.getInventoryName());
|
||||||
|
@ -67,18 +81,4 @@ public class GuiCanolaPress extends GuiContainer{
|
||||||
drawTexturedModalRect(this.guiLeft+83, this.guiTop+32, 176, 0, 12, i);
|
drawTexturedModalRect(this.guiLeft+83, this.guiTop+32, 176, 0, 12, i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void drawScreen(int x, int y, float f){
|
|
||||||
super.drawScreen(x, y, f);
|
|
||||||
String text1 = this.press.storage.getEnergyStored()+"/"+this.press.storage.getMaxEnergyStored()+" RF";
|
|
||||||
if(x >= guiLeft+43 && y >= guiTop+6 && x <= guiLeft+58 && y <= guiTop+88){
|
|
||||||
this.func_146283_a(Collections.singletonList(text1), x, y);
|
|
||||||
}
|
|
||||||
|
|
||||||
String text2 = this.press.tank.getFluidAmount()+"/"+this.press.tank.getCapacity()+" mB "+StringUtil.localize("fluid.canolaoil");
|
|
||||||
if(x >= guiLeft+117 && y >= guiTop+6 && x <= guiLeft+132 && y <= guiTop+88){
|
|
||||||
this.func_146283_a(Collections.singletonList(text2), x, y);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
|
@ -36,6 +36,15 @@ public class GuiCoalGenerator extends GuiContainer{
|
||||||
this.ySize = 93+86;
|
this.ySize = 93+86;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void drawScreen(int x, int y, float f){
|
||||||
|
super.drawScreen(x, y, f);
|
||||||
|
String text1 = this.generator.storage.getEnergyStored()+"/"+this.generator.storage.getMaxEnergyStored()+" RF";
|
||||||
|
if(x >= guiLeft+43 && y >= guiTop+6 && x <= guiLeft+58 && y <= guiTop+88){
|
||||||
|
this.func_146283_a(Collections.singletonList(text1), x, y);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawGuiContainerForegroundLayer(int x, int y){
|
public void drawGuiContainerForegroundLayer(int x, int y){
|
||||||
AssetUtil.displayNameString(this.fontRendererObj, xSize, -10, this.generator.getInventoryName());
|
AssetUtil.displayNameString(this.fontRendererObj, xSize, -10, this.generator.getInventoryName());
|
||||||
|
@ -61,13 +70,4 @@ public class GuiCoalGenerator extends GuiContainer{
|
||||||
this.drawTexturedModalRect(guiLeft+87, guiTop+27+12-i, 176, 96-i, 14, i);
|
this.drawTexturedModalRect(guiLeft+87, guiTop+27+12-i, 176, 96-i, 14, i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void drawScreen(int x, int y, float f){
|
|
||||||
super.drawScreen(x, y, f);
|
|
||||||
String text1 = this.generator.storage.getEnergyStored()+"/"+this.generator.storage.getMaxEnergyStored()+" RF";
|
|
||||||
if(x >= guiLeft+43 && y >= guiTop+6 && x <= guiLeft+58 && y <= guiTop+88){
|
|
||||||
this.func_146283_a(Collections.singletonList(text1), x, y);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
|
@ -62,8 +62,22 @@ public class GuiCoffeeMachine extends GuiContainer{
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void actionPerformed(GuiButton button){
|
public void drawScreen(int x, int y, float f){
|
||||||
PacketHandler.theNetwork.sendToServer(new PacketGuiButton(x, y, z, world, button.id, Minecraft.getMinecraft().thePlayer));
|
super.drawScreen(x, y, f);
|
||||||
|
|
||||||
|
String text1 = this.machine.storage.getEnergyStored()+"/"+this.machine.storage.getMaxEnergyStored()+" RF";
|
||||||
|
if(x >= guiLeft+16 && y >= guiTop+5 && x <= guiLeft+23 && y <= guiTop+89){
|
||||||
|
this.func_146283_a(Collections.singletonList(text1), x, y);
|
||||||
|
}
|
||||||
|
String text3 = this.machine.tank.getFluidAmount()+"/"+this.machine.tank.getCapacity()+" mB "+FluidRegistry.WATER.getLocalizedName(this.machine.tank.getFluid());
|
||||||
|
if(x >= guiLeft+27 && y >= guiTop+5 && x <= guiLeft+33 && y <= guiTop+70){
|
||||||
|
this.func_146283_a(Collections.singletonList(text3), x, y);
|
||||||
|
}
|
||||||
|
|
||||||
|
String text2 = this.machine.coffeeCacheAmount+"/"+this.machine.coffeeCacheMaxAmount+" "+StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".gui.coffee");
|
||||||
|
if(x >= guiLeft+40 && y >= guiTop+25 && x <= guiLeft+49 && y <= guiTop+56){
|
||||||
|
this.func_146283_a(Collections.singletonList(text2), x, y);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -105,21 +119,7 @@ public class GuiCoffeeMachine extends GuiContainer{
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawScreen(int x, int y, float f){
|
public void actionPerformed(GuiButton button){
|
||||||
super.drawScreen(x, y, f);
|
PacketHandler.theNetwork.sendToServer(new PacketGuiButton(x, y, z, world, button.id, Minecraft.getMinecraft().thePlayer));
|
||||||
|
|
||||||
String text1 = this.machine.storage.getEnergyStored()+"/"+this.machine.storage.getMaxEnergyStored()+" RF";
|
|
||||||
if(x >= guiLeft+16 && y >= guiTop+5 && x <= guiLeft+23 && y <= guiTop+89){
|
|
||||||
this.func_146283_a(Collections.singletonList(text1), x, y);
|
|
||||||
}
|
|
||||||
String text3 = this.machine.tank.getFluidAmount()+"/"+this.machine.tank.getCapacity()+" mB "+FluidRegistry.WATER.getLocalizedName(this.machine.tank.getFluid());
|
|
||||||
if(x >= guiLeft+27 && y >= guiTop+5 && x <= guiLeft+33 && y <= guiTop+70){
|
|
||||||
this.func_146283_a(Collections.singletonList(text3), x, y);
|
|
||||||
}
|
|
||||||
|
|
||||||
String text2 = this.machine.coffeeCacheAmount+"/"+this.machine.coffeeCacheMaxAmount+" "+StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".gui.coffee");
|
|
||||||
if(x >= guiLeft+40 && y >= guiTop+25 && x <= guiLeft+49 && y <= guiTop+56){
|
|
||||||
this.func_146283_a(Collections.singletonList(text2), x, y);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -34,6 +34,11 @@ public class GuiDropper extends GuiContainer{
|
||||||
this.ySize = 93+86;
|
this.ySize = 93+86;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void drawScreen(int x, int y, float f){
|
||||||
|
super.drawScreen(x, y, f);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawGuiContainerForegroundLayer(int x, int y){
|
public void drawGuiContainerForegroundLayer(int x, int y){
|
||||||
AssetUtil.displayNameString(this.fontRendererObj, xSize, -10, this.dropper.getInventoryName());
|
AssetUtil.displayNameString(this.fontRendererObj, xSize, -10, this.dropper.getInventoryName());
|
||||||
|
@ -49,9 +54,4 @@ public class GuiDropper extends GuiContainer{
|
||||||
this.mc.getTextureManager().bindTexture(resLoc);
|
this.mc.getTextureManager().bindTexture(resLoc);
|
||||||
this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, 176, 93);
|
this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, 176, 93);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void drawScreen(int x, int y, float f){
|
|
||||||
super.drawScreen(x, y, f);
|
|
||||||
}
|
|
||||||
}
|
}
|
|
@ -36,6 +36,15 @@ public class GuiEnergizer extends GuiContainer{
|
||||||
this.ySize = 93+86;
|
this.ySize = 93+86;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void drawScreen(int x, int y, float f){
|
||||||
|
super.drawScreen(x, y, f);
|
||||||
|
String text1 = this.energizer.storage.getEnergyStored()+"/"+this.energizer.storage.getMaxEnergyStored()+" RF";
|
||||||
|
if(x >= guiLeft+57 && y >= guiTop+6 && x <= guiLeft+72 && y <= guiTop+88){
|
||||||
|
this.func_146283_a(Collections.singletonList(text1), x, y);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawGuiContainerForegroundLayer(int x, int y){
|
public void drawGuiContainerForegroundLayer(int x, int y){
|
||||||
AssetUtil.displayNameString(this.fontRendererObj, xSize, -10, this.energizer.getInventoryName());
|
AssetUtil.displayNameString(this.fontRendererObj, xSize, -10, this.energizer.getInventoryName());
|
||||||
|
@ -56,13 +65,4 @@ public class GuiEnergizer extends GuiContainer{
|
||||||
drawTexturedModalRect(this.guiLeft+57, this.guiTop+89-i, 176, 0, 16, i);
|
drawTexturedModalRect(this.guiLeft+57, this.guiTop+89-i, 176, 0, 16, i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void drawScreen(int x, int y, float f){
|
|
||||||
super.drawScreen(x, y, f);
|
|
||||||
String text1 = this.energizer.storage.getEnergyStored()+"/"+this.energizer.storage.getMaxEnergyStored()+" RF";
|
|
||||||
if(x >= guiLeft+57 && y >= guiTop+6 && x <= guiLeft+72 && y <= guiTop+88){
|
|
||||||
this.func_146283_a(Collections.singletonList(text1), x, y);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
|
@ -36,6 +36,15 @@ public class GuiEnervator extends GuiContainer{
|
||||||
this.ySize = 93+86;
|
this.ySize = 93+86;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void drawScreen(int x, int y, float f){
|
||||||
|
super.drawScreen(x, y, f);
|
||||||
|
String text1 = this.enervator.storage.getEnergyStored()+"/"+this.enervator.storage.getMaxEnergyStored()+" RF";
|
||||||
|
if(x >= guiLeft+57 && y >= guiTop+6 && x <= guiLeft+72 && y <= guiTop+88){
|
||||||
|
this.func_146283_a(Collections.singletonList(text1), x, y);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawGuiContainerForegroundLayer(int x, int y){
|
public void drawGuiContainerForegroundLayer(int x, int y){
|
||||||
AssetUtil.displayNameString(this.fontRendererObj, xSize, -10, this.enervator.getInventoryName());
|
AssetUtil.displayNameString(this.fontRendererObj, xSize, -10, this.enervator.getInventoryName());
|
||||||
|
@ -56,13 +65,4 @@ public class GuiEnervator extends GuiContainer{
|
||||||
drawTexturedModalRect(this.guiLeft+57, this.guiTop+89-i, 176, 0, 16, i);
|
drawTexturedModalRect(this.guiLeft+57, this.guiTop+89-i, 176, 0, 16, i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void drawScreen(int x, int y, float f){
|
|
||||||
super.drawScreen(x, y, f);
|
|
||||||
String text1 = this.enervator.storage.getEnergyStored()+"/"+this.enervator.storage.getMaxEnergyStored()+" RF";
|
|
||||||
if(x >= guiLeft+57 && y >= guiTop+6 && x <= guiLeft+72 && y <= guiTop+88){
|
|
||||||
this.func_146283_a(Collections.singletonList(text1), x, y);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
|
@ -39,6 +39,15 @@ public class GuiFeeder extends GuiContainer{
|
||||||
this.ySize = 70+86;
|
this.ySize = 70+86;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void drawScreen(int x, int y, float f){
|
||||||
|
super.drawScreen(x, y, f);
|
||||||
|
if(x >= guiLeft+69 && y >= guiTop+30 && x <= guiLeft+69+10 && y <= guiTop+30+10){
|
||||||
|
String[] array = new String[]{(this.tileFeeder.currentAnimalAmount+" "+StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".gui.animals")), ((this.tileFeeder.currentAnimalAmount >= 2 && this.tileFeeder.currentAnimalAmount < ConfigIntValues.FEEDER_THRESHOLD.getValue()) ? StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".gui.enoughToBreed") : (this.tileFeeder.currentAnimalAmount >= ConfigIntValues.FEEDER_THRESHOLD.getValue() ? StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".gui.tooMany") : StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".gui.notEnough")))};
|
||||||
|
this.func_146283_a(Arrays.asList(array), x, y);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawGuiContainerForegroundLayer(int x, int y){
|
public void drawGuiContainerForegroundLayer(int x, int y){
|
||||||
AssetUtil.displayNameString(this.fontRendererObj, xSize, -10, this.tileFeeder.getInventoryName());
|
AssetUtil.displayNameString(this.fontRendererObj, xSize, -10, this.tileFeeder.getInventoryName());
|
||||||
|
@ -65,13 +74,4 @@ public class GuiFeeder extends GuiContainer{
|
||||||
this.drawTexturedModalRect(guiLeft+70, guiTop+31, 192, 24, 8, 8);
|
this.drawTexturedModalRect(guiLeft+70, guiTop+31, 192, 24, 8, 8);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void drawScreen(int x, int y, float f){
|
|
||||||
super.drawScreen(x, y, f);
|
|
||||||
if(x >= guiLeft+69 && y >= guiTop+30 && x <= guiLeft+69+10 && y <= guiTop+30+10){
|
|
||||||
String[] array = new String[]{(this.tileFeeder.currentAnimalAmount+" "+StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".gui.animals")), ((this.tileFeeder.currentAnimalAmount >= 2 && this.tileFeeder.currentAnimalAmount < ConfigIntValues.FEEDER_THRESHOLD.getValue()) ? StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".gui.enoughToBreed") : (this.tileFeeder.currentAnimalAmount >= ConfigIntValues.FEEDER_THRESHOLD.getValue() ? StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".gui.tooMany") : StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".gui.notEnough")))};
|
|
||||||
this.func_146283_a(Arrays.asList(array), x, y);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
|
@ -37,6 +37,21 @@ public class GuiFermentingBarrel extends GuiContainer{
|
||||||
this.ySize = 93+86;
|
this.ySize = 93+86;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void drawScreen(int x, int y, float f){
|
||||||
|
super.drawScreen(x, y, f);
|
||||||
|
|
||||||
|
String text1 = this.press.canolaTank.getFluidAmount()+"/"+this.press.canolaTank.getCapacity()+" mB "+StringUtil.localize("fluid.canolaoil");
|
||||||
|
if(x >= guiLeft+61 && y >= guiTop+6 && x <= guiLeft+76 && y <= guiTop+88){
|
||||||
|
this.func_146283_a(Collections.singletonList(text1), x, y);
|
||||||
|
}
|
||||||
|
|
||||||
|
String text2 = this.press.oilTank.getFluidAmount()+"/"+this.press.oilTank.getCapacity()+" mB "+StringUtil.localize("fluid.oil");
|
||||||
|
if(x >= guiLeft+99 && y >= guiTop+6 && x <= guiLeft+114 && y <= guiTop+88){
|
||||||
|
this.func_146283_a(Collections.singletonList(text2), x, y);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawGuiContainerForegroundLayer(int x, int y){
|
public void drawGuiContainerForegroundLayer(int x, int y){
|
||||||
AssetUtil.displayNameString(this.fontRendererObj, xSize, -10, this.press.getInventoryName());
|
AssetUtil.displayNameString(this.fontRendererObj, xSize, -10, this.press.getInventoryName());
|
||||||
|
@ -67,19 +82,4 @@ public class GuiFermentingBarrel extends GuiContainer{
|
||||||
drawTexturedModalRect(this.guiLeft+82, this.guiTop+34, 176, 0, 12, i);
|
drawTexturedModalRect(this.guiLeft+82, this.guiTop+34, 176, 0, 12, i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void drawScreen(int x, int y, float f){
|
|
||||||
super.drawScreen(x, y, f);
|
|
||||||
|
|
||||||
String text1 = this.press.canolaTank.getFluidAmount()+"/"+this.press.canolaTank.getCapacity()+" mB "+StringUtil.localize("fluid.canolaoil");
|
|
||||||
if(x >= guiLeft+61 && y >= guiTop+6 && x <= guiLeft+76 && y <= guiTop+88){
|
|
||||||
this.func_146283_a(Collections.singletonList(text1), x, y);
|
|
||||||
}
|
|
||||||
|
|
||||||
String text2 = this.press.oilTank.getFluidAmount()+"/"+this.press.oilTank.getCapacity()+" mB "+StringUtil.localize("fluid.oil");
|
|
||||||
if(x >= guiLeft+99 && y >= guiTop+6 && x <= guiLeft+114 && y <= guiTop+88){
|
|
||||||
this.func_146283_a(Collections.singletonList(text2), x, y);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
|
@ -36,6 +36,16 @@ public class GuiFluidCollector extends GuiContainer{
|
||||||
this.ySize = 93+86;
|
this.ySize = 93+86;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void drawScreen(int x, int y, float f){
|
||||||
|
super.drawScreen(x, y, f);
|
||||||
|
|
||||||
|
String text2 = this.collector.tank.getFluidAmount()+"/"+this.collector.tank.getCapacity()+" mB "+(this.collector.tank.getFluidAmount() > 0 ? this.collector.tank.getFluid().getLocalizedName() : "");
|
||||||
|
if(x >= guiLeft+68 && y >= guiTop+6 && x <= guiLeft+83 && y <= guiTop+88){
|
||||||
|
this.func_146283_a(Collections.singletonList(text2), x, y);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawGuiContainerForegroundLayer(int x, int y){
|
public void drawGuiContainerForegroundLayer(int x, int y){
|
||||||
AssetUtil.displayNameString(this.fontRendererObj, xSize, -10, this.collector.getInventoryName());
|
AssetUtil.displayNameString(this.fontRendererObj, xSize, -10, this.collector.getInventoryName());
|
||||||
|
@ -56,14 +66,4 @@ public class GuiFluidCollector extends GuiContainer{
|
||||||
drawTexturedModalRect(this.guiLeft+68, this.guiTop+89-i, 176, 0, 16, i);
|
drawTexturedModalRect(this.guiLeft+68, this.guiTop+89-i, 176, 0, 16, i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void drawScreen(int x, int y, float f){
|
|
||||||
super.drawScreen(x, y, f);
|
|
||||||
|
|
||||||
String text2 = this.collector.tank.getFluidAmount()+"/"+this.collector.tank.getCapacity()+" mB "+(this.collector.tank.getFluidAmount() > 0 ? this.collector.tank.getFluid().getLocalizedName() : "");
|
|
||||||
if(x >= guiLeft+68 && y >= guiTop+6 && x <= guiLeft+83 && y <= guiTop+88){
|
|
||||||
this.func_146283_a(Collections.singletonList(text2), x, y);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
|
@ -36,6 +36,15 @@ public class GuiFurnaceDouble extends GuiContainer{
|
||||||
this.ySize = 93+86;
|
this.ySize = 93+86;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void drawScreen(int x, int y, float f){
|
||||||
|
super.drawScreen(x, y, f);
|
||||||
|
String text = this.tileFurnace.storage.getEnergyStored()+"/"+this.tileFurnace.storage.getMaxEnergyStored()+" RF";
|
||||||
|
if(x >= guiLeft+28 && y >= guiTop+6 && x <= guiLeft+43 && y <= guiTop+88){
|
||||||
|
this.func_146283_a(Collections.singletonList(text), x, y);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawGuiContainerForegroundLayer(int x, int y){
|
public void drawGuiContainerForegroundLayer(int x, int y){
|
||||||
AssetUtil.displayNameString(this.fontRendererObj, xSize, -10, this.tileFurnace.getInventoryName());
|
AssetUtil.displayNameString(this.fontRendererObj, xSize, -10, this.tileFurnace.getInventoryName());
|
||||||
|
@ -64,13 +73,4 @@ public class GuiFurnaceDouble extends GuiContainer{
|
||||||
this.drawTexturedModalRect(this.guiLeft+101, this.guiTop+40, 176, 22, 24, i);
|
this.drawTexturedModalRect(this.guiLeft+101, this.guiTop+40, 176, 22, 24, i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void drawScreen(int x, int y, float f){
|
|
||||||
super.drawScreen(x, y, f);
|
|
||||||
String text = this.tileFurnace.storage.getEnergyStored()+"/"+this.tileFurnace.storage.getMaxEnergyStored()+" RF";
|
|
||||||
if(x >= guiLeft+28 && y >= guiTop+6 && x <= guiLeft+43 && y <= guiTop+88){
|
|
||||||
this.func_146283_a(Collections.singletonList(text), x, y);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
|
@ -30,6 +30,7 @@ public class GuiGrinder extends GuiContainer{
|
||||||
private static final ResourceLocation resLocDouble = AssetUtil.getGuiLocation("guiGrinderDouble");
|
private static final ResourceLocation resLocDouble = AssetUtil.getGuiLocation("guiGrinderDouble");
|
||||||
private TileEntityGrinder tileGrinder;
|
private TileEntityGrinder tileGrinder;
|
||||||
private boolean isDouble;
|
private boolean isDouble;
|
||||||
|
|
||||||
public GuiGrinder(InventoryPlayer inventoryPlayer, TileEntityBase tile){
|
public GuiGrinder(InventoryPlayer inventoryPlayer, TileEntityBase tile){
|
||||||
this(inventoryPlayer, tile, false);
|
this(inventoryPlayer, tile, false);
|
||||||
}
|
}
|
||||||
|
@ -42,6 +43,15 @@ public class GuiGrinder extends GuiContainer{
|
||||||
this.ySize = 93+86;
|
this.ySize = 93+86;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void drawScreen(int x, int y, float f){
|
||||||
|
super.drawScreen(x, y, f);
|
||||||
|
String text = this.tileGrinder.storage.getEnergyStored()+"/"+this.tileGrinder.storage.getMaxEnergyStored()+" RF";
|
||||||
|
if((this.isDouble && x >= guiLeft+14 && y >= guiTop+6 && x <= guiLeft+29 && y <= guiTop+88) || (!this.isDouble && x >= guiLeft+43 && y >= guiTop+6 && x <= guiLeft+58 && y <= guiTop+88)){
|
||||||
|
this.func_146283_a(Collections.singletonList(text), x, y);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawGuiContainerForegroundLayer(int x, int y){
|
public void drawGuiContainerForegroundLayer(int x, int y){
|
||||||
AssetUtil.displayNameString(this.fontRendererObj, xSize, -10, this.tileGrinder.getInventoryName());
|
AssetUtil.displayNameString(this.fontRendererObj, xSize, -10, this.tileGrinder.getInventoryName());
|
||||||
|
@ -73,15 +83,6 @@ public class GuiGrinder extends GuiContainer{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void drawScreen(int x, int y, float f){
|
|
||||||
super.drawScreen(x, y, f);
|
|
||||||
String text = this.tileGrinder.storage.getEnergyStored()+"/"+this.tileGrinder.storage.getMaxEnergyStored()+" RF";
|
|
||||||
if((this.isDouble && x >= guiLeft+14 && y >= guiTop+6 && x <= guiLeft+29 && y <= guiTop+88) || (!this.isDouble && x >= guiLeft+43 && y >= guiTop+6 && x <= guiLeft+58 && y <= guiTop+88)){
|
|
||||||
this.func_146283_a(Collections.singletonList(text), x, y);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class GuiGrinderDouble extends GuiGrinder{
|
public static class GuiGrinderDouble extends GuiGrinder{
|
||||||
public GuiGrinderDouble(InventoryPlayer inventory, TileEntityBase tile){
|
public GuiGrinderDouble(InventoryPlayer inventory, TileEntityBase tile){
|
||||||
super(inventory, tile, true);
|
super(inventory, tile, true);
|
||||||
|
|
|
@ -76,21 +76,6 @@ public class GuiInputter extends GuiContainer{
|
||||||
this.isAdvanced = isAdvanced;
|
this.isAdvanced = isAdvanced;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void drawGuiContainerForegroundLayer(int x, int y){
|
|
||||||
AssetUtil.displayNameString(this.fontRendererObj, xSize, -10, this.tileInputter.getInventoryName());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void updateScreen(){
|
|
||||||
super.updateScreen();
|
|
||||||
|
|
||||||
this.fieldPutStart.updateCursorCounter();
|
|
||||||
this.fieldPutEnd.updateCursorCounter();
|
|
||||||
this.fieldPullStart.updateCursorCounter();
|
|
||||||
this.fieldPullEnd.updateCursorCounter();
|
|
||||||
}
|
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
@Override
|
@Override
|
||||||
public void initGui(){
|
public void initGui(){
|
||||||
|
@ -131,90 +116,6 @@ public class GuiInputter extends GuiContainer{
|
||||||
this.buttonList.add(new TinyButton(TileEntityInputter.OKAY_BUTTON_ID, guiLeft+84, guiTop+80+(isAdvanced ? OFFSET_ADVANCED : 0)));
|
this.buttonList.add(new TinyButton(TileEntityInputter.OKAY_BUTTON_ID, guiLeft+84, guiTop+80+(isAdvanced ? OFFSET_ADVANCED : 0)));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void mouseClicked(int par1, int par2, int par3){
|
|
||||||
this.fieldPutStart.mouseClicked(par1, par2, par3);
|
|
||||||
this.fieldPutEnd.mouseClicked(par1, par2, par3);
|
|
||||||
this.fieldPullStart.mouseClicked(par1, par2, par3);
|
|
||||||
this.fieldPullEnd.mouseClicked(par1, par2, par3);
|
|
||||||
|
|
||||||
super.mouseClicked(par1, par2, par3);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void keyTyped(char theChar, int key){
|
|
||||||
if(key == Keyboard.KEY_RETURN || key == Keyboard.KEY_NUMPADENTER){
|
|
||||||
if(this.fieldPutStart.isFocused()){
|
|
||||||
this.setVariable(this.fieldPutStart, 0);
|
|
||||||
}
|
|
||||||
if(this.fieldPutEnd.isFocused()){
|
|
||||||
this.setVariable(this.fieldPutEnd, 1);
|
|
||||||
}
|
|
||||||
if(this.fieldPullStart.isFocused()){
|
|
||||||
this.setVariable(this.fieldPullStart, 2);
|
|
||||||
}
|
|
||||||
if(this.fieldPullEnd.isFocused()){
|
|
||||||
this.setVariable(this.fieldPullEnd, 3);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if(Character.isDigit(theChar) || key == Keyboard.KEY_BACK || key == Keyboard.KEY_DELETE || key == Keyboard.KEY_LEFT || key == Keyboard.KEY_RIGHT){
|
|
||||||
this.fieldPutStart.textboxKeyTyped(theChar, key);
|
|
||||||
this.fieldPutEnd.textboxKeyTyped(theChar, key);
|
|
||||||
this.fieldPullStart.textboxKeyTyped(theChar, key);
|
|
||||||
this.fieldPullEnd.textboxKeyTyped(theChar, key);
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
super.keyTyped(theChar, key);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setVariable(GuiTextField field, int sendInt){
|
|
||||||
if(!field.getText().isEmpty()){
|
|
||||||
this.sendPacket(parse(field.getText()), sendInt);
|
|
||||||
field.setText("");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private int parse(String theInt){
|
|
||||||
try{
|
|
||||||
return Integer.parseInt(theInt);
|
|
||||||
}
|
|
||||||
catch(Exception e){
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void sendPacket(int text, int textID){
|
|
||||||
PacketHandler.theNetwork.sendToServer(new PacketGuiNumber(x, y, z, world, text, textID, Minecraft.getMinecraft().thePlayer));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void drawGuiContainerBackgroundLayer(float f, int x, int y){
|
|
||||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
|
||||||
|
|
||||||
this.mc.getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION);
|
|
||||||
this.drawTexturedModalRect(this.guiLeft, this.guiTop+93+(isAdvanced ? OFFSET_ADVANCED : 0), 0, 0, 176, 86);
|
|
||||||
|
|
||||||
this.mc.getTextureManager().bindTexture(this.isAdvanced ? resLocAdvanced : resLoc);
|
|
||||||
this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, 176, 93+(isAdvanced ? OFFSET_ADVANCED : 0));
|
|
||||||
|
|
||||||
this.fontRendererObj.drawString(StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".gui.pull"), guiLeft+22+3, guiTop+32+(isAdvanced ? OFFSET_ADVANCED : 0), StringUtil.DECIMAL_COLOR_GRAY_TEXT);
|
|
||||||
this.fontRendererObj.drawString(StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".gui.put"), guiLeft+107+3, guiTop+32+(isAdvanced ? OFFSET_ADVANCED : 0), StringUtil.DECIMAL_COLOR_GRAY_TEXT);
|
|
||||||
|
|
||||||
this.fontRendererObj.drawString(sideString[tileInputter.sideToPull+1], guiLeft+24+1, guiTop+45+3+(isAdvanced ? OFFSET_ADVANCED : 0), StringUtil.DECIMAL_COLOR_GRAY_TEXT);
|
|
||||||
this.fontRendererObj.drawString(sideString[tileInputter.sideToPut+1], guiLeft+109+1, guiTop+45+3+(isAdvanced ? OFFSET_ADVANCED : 0), StringUtil.DECIMAL_COLOR_GRAY_TEXT);
|
|
||||||
|
|
||||||
this.fontRendererObj.drawString(Integer.toString(this.tileInputter.slotToPutStart), guiLeft+99, guiTop+67+(isAdvanced ? OFFSET_ADVANCED : 0), StringUtil.DECIMAL_COLOR_WHITE);
|
|
||||||
this.fontRendererObj.drawString(Integer.toString(this.tileInputter.slotToPutEnd), guiLeft+136, guiTop+67+(isAdvanced ? OFFSET_ADVANCED : 0), StringUtil.DECIMAL_COLOR_WHITE);
|
|
||||||
this.fontRendererObj.drawString(Integer.toString(this.tileInputter.slotToPullStart), guiLeft+14, guiTop+67+(isAdvanced ? OFFSET_ADVANCED : 0), StringUtil.DECIMAL_COLOR_WHITE);
|
|
||||||
this.fontRendererObj.drawString(Integer.toString(this.tileInputter.slotToPullEnd), guiLeft+51, guiTop+67+(isAdvanced ? OFFSET_ADVANCED : 0), StringUtil.DECIMAL_COLOR_WHITE);
|
|
||||||
|
|
||||||
this.fieldPutStart.drawTextBox();
|
|
||||||
this.fieldPutEnd.drawTextBox();
|
|
||||||
this.fieldPullStart.drawTextBox();
|
|
||||||
this.fieldPullEnd.drawTextBox();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public void drawScreen(int x, int y, float f){
|
public void drawScreen(int x, int y, float f){
|
||||||
|
@ -257,6 +158,105 @@ public class GuiInputter extends GuiContainer{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void drawGuiContainerForegroundLayer(int x, int y){
|
||||||
|
AssetUtil.displayNameString(this.fontRendererObj, xSize, -10, this.tileInputter.getInventoryName());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void drawGuiContainerBackgroundLayer(float f, int x, int y){
|
||||||
|
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||||
|
|
||||||
|
this.mc.getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION);
|
||||||
|
this.drawTexturedModalRect(this.guiLeft, this.guiTop+93+(isAdvanced ? OFFSET_ADVANCED : 0), 0, 0, 176, 86);
|
||||||
|
|
||||||
|
this.mc.getTextureManager().bindTexture(this.isAdvanced ? resLocAdvanced : resLoc);
|
||||||
|
this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, 176, 93+(isAdvanced ? OFFSET_ADVANCED : 0));
|
||||||
|
|
||||||
|
this.fontRendererObj.drawString(StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".gui.pull"), guiLeft+22+3, guiTop+32+(isAdvanced ? OFFSET_ADVANCED : 0), StringUtil.DECIMAL_COLOR_GRAY_TEXT);
|
||||||
|
this.fontRendererObj.drawString(StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".gui.put"), guiLeft+107+3, guiTop+32+(isAdvanced ? OFFSET_ADVANCED : 0), StringUtil.DECIMAL_COLOR_GRAY_TEXT);
|
||||||
|
|
||||||
|
this.fontRendererObj.drawString(sideString[tileInputter.sideToPull+1], guiLeft+24+1, guiTop+45+3+(isAdvanced ? OFFSET_ADVANCED : 0), StringUtil.DECIMAL_COLOR_GRAY_TEXT);
|
||||||
|
this.fontRendererObj.drawString(sideString[tileInputter.sideToPut+1], guiLeft+109+1, guiTop+45+3+(isAdvanced ? OFFSET_ADVANCED : 0), StringUtil.DECIMAL_COLOR_GRAY_TEXT);
|
||||||
|
|
||||||
|
this.fontRendererObj.drawString(Integer.toString(this.tileInputter.slotToPutStart), guiLeft+99, guiTop+67+(isAdvanced ? OFFSET_ADVANCED : 0), StringUtil.DECIMAL_COLOR_WHITE);
|
||||||
|
this.fontRendererObj.drawString(Integer.toString(this.tileInputter.slotToPutEnd), guiLeft+136, guiTop+67+(isAdvanced ? OFFSET_ADVANCED : 0), StringUtil.DECIMAL_COLOR_WHITE);
|
||||||
|
this.fontRendererObj.drawString(Integer.toString(this.tileInputter.slotToPullStart), guiLeft+14, guiTop+67+(isAdvanced ? OFFSET_ADVANCED : 0), StringUtil.DECIMAL_COLOR_WHITE);
|
||||||
|
this.fontRendererObj.drawString(Integer.toString(this.tileInputter.slotToPullEnd), guiLeft+51, guiTop+67+(isAdvanced ? OFFSET_ADVANCED : 0), StringUtil.DECIMAL_COLOR_WHITE);
|
||||||
|
|
||||||
|
this.fieldPutStart.drawTextBox();
|
||||||
|
this.fieldPutEnd.drawTextBox();
|
||||||
|
this.fieldPullStart.drawTextBox();
|
||||||
|
this.fieldPullEnd.drawTextBox();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void mouseClicked(int par1, int par2, int par3){
|
||||||
|
this.fieldPutStart.mouseClicked(par1, par2, par3);
|
||||||
|
this.fieldPutEnd.mouseClicked(par1, par2, par3);
|
||||||
|
this.fieldPullStart.mouseClicked(par1, par2, par3);
|
||||||
|
this.fieldPullEnd.mouseClicked(par1, par2, par3);
|
||||||
|
|
||||||
|
super.mouseClicked(par1, par2, par3);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void keyTyped(char theChar, int key){
|
||||||
|
if(key == Keyboard.KEY_RETURN || key == Keyboard.KEY_NUMPADENTER){
|
||||||
|
if(this.fieldPutStart.isFocused()){
|
||||||
|
this.setVariable(this.fieldPutStart, 0);
|
||||||
|
}
|
||||||
|
if(this.fieldPutEnd.isFocused()){
|
||||||
|
this.setVariable(this.fieldPutEnd, 1);
|
||||||
|
}
|
||||||
|
if(this.fieldPullStart.isFocused()){
|
||||||
|
this.setVariable(this.fieldPullStart, 2);
|
||||||
|
}
|
||||||
|
if(this.fieldPullEnd.isFocused()){
|
||||||
|
this.setVariable(this.fieldPullEnd, 3);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if(Character.isDigit(theChar) || key == Keyboard.KEY_BACK || key == Keyboard.KEY_DELETE || key == Keyboard.KEY_LEFT || key == Keyboard.KEY_RIGHT){
|
||||||
|
this.fieldPutStart.textboxKeyTyped(theChar, key);
|
||||||
|
this.fieldPutEnd.textboxKeyTyped(theChar, key);
|
||||||
|
this.fieldPullStart.textboxKeyTyped(theChar, key);
|
||||||
|
this.fieldPullEnd.textboxKeyTyped(theChar, key);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
super.keyTyped(theChar, key);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateScreen(){
|
||||||
|
super.updateScreen();
|
||||||
|
|
||||||
|
this.fieldPutStart.updateCursorCounter();
|
||||||
|
this.fieldPutEnd.updateCursorCounter();
|
||||||
|
this.fieldPullStart.updateCursorCounter();
|
||||||
|
this.fieldPullEnd.updateCursorCounter();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setVariable(GuiTextField field, int sendInt){
|
||||||
|
if(!field.getText().isEmpty()){
|
||||||
|
this.sendPacket(parse(field.getText()), sendInt);
|
||||||
|
field.setText("");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void sendPacket(int text, int textID){
|
||||||
|
PacketHandler.theNetwork.sendToServer(new PacketGuiNumber(x, y, z, world, text, textID, Minecraft.getMinecraft().thePlayer));
|
||||||
|
}
|
||||||
|
|
||||||
|
private int parse(String theInt){
|
||||||
|
try{
|
||||||
|
return Integer.parseInt(theInt);
|
||||||
|
}
|
||||||
|
catch(Exception e){
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void actionPerformed(GuiButton button){
|
public void actionPerformed(GuiButton button){
|
||||||
if(button.id == TileEntityInputter.OKAY_BUTTON_ID){
|
if(button.id == TileEntityInputter.OKAY_BUTTON_ID){
|
||||||
|
|
|
@ -37,6 +37,19 @@ public class GuiOilGenerator extends GuiContainer{
|
||||||
this.ySize = 93+86;
|
this.ySize = 93+86;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void drawScreen(int x, int y, float f){
|
||||||
|
super.drawScreen(x, y, f);
|
||||||
|
String text1 = this.generator.storage.getEnergyStored()+"/"+this.generator.storage.getMaxEnergyStored()+" RF";
|
||||||
|
if(x >= guiLeft+43 && y >= guiTop+6 && x <= guiLeft+58 && y <= guiTop+88){
|
||||||
|
this.func_146283_a(Collections.singletonList(text1), x, y);
|
||||||
|
}
|
||||||
|
String text2 = this.generator.tank.getFluidAmount()+"/"+this.generator.tank.getCapacity()+" mB "+StringUtil.localize("fluid.oil");
|
||||||
|
if(x >= guiLeft+117 && y >= guiTop+6 && x <= guiLeft+132 && y <= guiTop+88){
|
||||||
|
this.func_146283_a(Collections.singletonList(text2), x, y);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawGuiContainerForegroundLayer(int x, int y){
|
public void drawGuiContainerForegroundLayer(int x, int y){
|
||||||
AssetUtil.displayNameString(this.fontRendererObj, xSize, -10, this.generator.getInventoryName());
|
AssetUtil.displayNameString(this.fontRendererObj, xSize, -10, this.generator.getInventoryName());
|
||||||
|
@ -67,17 +80,4 @@ public class GuiOilGenerator extends GuiContainer{
|
||||||
this.drawTexturedModalRect(guiLeft+72, guiTop+44+12-i, 176, 96-i, 14, i);
|
this.drawTexturedModalRect(guiLeft+72, guiTop+44+12-i, 176, 96-i, 14, i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void drawScreen(int x, int y, float f){
|
|
||||||
super.drawScreen(x, y, f);
|
|
||||||
String text1 = this.generator.storage.getEnergyStored()+"/"+this.generator.storage.getMaxEnergyStored()+" RF";
|
|
||||||
if(x >= guiLeft+43 && y >= guiTop+6 && x <= guiLeft+58 && y <= guiTop+88){
|
|
||||||
this.func_146283_a(Collections.singletonList(text1), x, y);
|
|
||||||
}
|
|
||||||
String text2 = this.generator.tank.getFluidAmount()+"/"+this.generator.tank.getCapacity()+" mB "+StringUtil.localize("fluid.oil");
|
|
||||||
if(x >= guiLeft+117 && y >= guiTop+6 && x <= guiLeft+132 && y <= guiTop+88){
|
|
||||||
this.func_146283_a(Collections.singletonList(text2), x, y);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
|
@ -38,6 +38,23 @@ public class GuiOreMagnet extends GuiContainer{
|
||||||
this.ySize = 93+86;
|
this.ySize = 93+86;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void drawScreen(int x, int y, float f){
|
||||||
|
super.drawScreen(x, y, f);
|
||||||
|
String text1 = this.magnet.storage.getEnergyStored()+"/"+this.magnet.storage.getMaxEnergyStored()+" RF";
|
||||||
|
if(x >= guiLeft+43 && y >= guiTop+6 && x <= guiLeft+58 && y <= guiTop+88){
|
||||||
|
this.func_146283_a(Collections.singletonList(text1), x, y);
|
||||||
|
}
|
||||||
|
String text2 = this.magnet.tank.getFluidAmount()+"/"+this.magnet.tank.getCapacity()+" mB "+StringUtil.localize("fluid.oil");
|
||||||
|
if(x >= guiLeft+117 && y >= guiTop+6 && x <= guiLeft+132 && y <= guiTop+88){
|
||||||
|
this.func_146283_a(Collections.singletonList(text2), x, y);
|
||||||
|
}
|
||||||
|
//TODO Upgrade Slot Joke
|
||||||
|
if(x >= guiLeft+70 && y >= guiTop+42 && x <= guiLeft+70+18 && y <= guiTop+42+18){
|
||||||
|
this.func_146283_a(Arrays.asList("@SuppressWarnings(\"unused\")", "This slot is currently unused. Ignore it."), x, y);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawGuiContainerForegroundLayer(int x, int y){
|
public void drawGuiContainerForegroundLayer(int x, int y){
|
||||||
AssetUtil.displayNameString(this.fontRendererObj, xSize, -10, this.magnet.getInventoryName());
|
AssetUtil.displayNameString(this.fontRendererObj, xSize, -10, this.magnet.getInventoryName());
|
||||||
|
@ -63,21 +80,4 @@ public class GuiOreMagnet extends GuiContainer{
|
||||||
drawTexturedModalRect(this.guiLeft+117, this.guiTop+89-i, 192, 0, 16, i);
|
drawTexturedModalRect(this.guiLeft+117, this.guiTop+89-i, 192, 0, 16, i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void drawScreen(int x, int y, float f){
|
|
||||||
super.drawScreen(x, y, f);
|
|
||||||
String text1 = this.magnet.storage.getEnergyStored()+"/"+this.magnet.storage.getMaxEnergyStored()+" RF";
|
|
||||||
if(x >= guiLeft+43 && y >= guiTop+6 && x <= guiLeft+58 && y <= guiTop+88){
|
|
||||||
this.func_146283_a(Collections.singletonList(text1), x, y);
|
|
||||||
}
|
|
||||||
String text2 = this.magnet.tank.getFluidAmount()+"/"+this.magnet.tank.getCapacity()+" mB "+StringUtil.localize("fluid.oil");
|
|
||||||
if(x >= guiLeft+117 && y >= guiTop+6 && x <= guiLeft+132 && y <= guiTop+88){
|
|
||||||
this.func_146283_a(Collections.singletonList(text2), x, y);
|
|
||||||
}
|
|
||||||
//TODO Upgrade Slot Joke
|
|
||||||
if(x >= guiLeft+70 && y >= guiTop+42 && x <= guiLeft+70+18 && y <= guiTop+42+18){
|
|
||||||
this.func_146283_a(Arrays.asList("@SuppressWarnings(\"unused\")", "This slot is currently unused. Ignore it."), x, y);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
|
@ -34,6 +34,11 @@ public class GuiPhantomPlacer extends GuiContainer{
|
||||||
this.ySize = 93+86;
|
this.ySize = 93+86;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void drawScreen(int x, int y, float f){
|
||||||
|
super.drawScreen(x, y, f);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawGuiContainerForegroundLayer(int x, int y){
|
public void drawGuiContainerForegroundLayer(int x, int y){
|
||||||
AssetUtil.displayNameString(this.fontRendererObj, xSize, -10, this.placer.getInventoryName());
|
AssetUtil.displayNameString(this.fontRendererObj, xSize, -10, this.placer.getInventoryName());
|
||||||
|
@ -49,9 +54,4 @@ public class GuiPhantomPlacer extends GuiContainer{
|
||||||
this.mc.getTextureManager().bindTexture(resLoc);
|
this.mc.getTextureManager().bindTexture(resLoc);
|
||||||
this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, 176, 93);
|
this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, 176, 93);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void drawScreen(int x, int y, float f){
|
|
||||||
super.drawScreen(x, y, f);
|
|
||||||
}
|
|
||||||
}
|
}
|
|
@ -36,6 +36,15 @@ public class GuiRepairer extends GuiContainer{
|
||||||
this.ySize = 93+86;
|
this.ySize = 93+86;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void drawScreen(int x, int y, float f){
|
||||||
|
super.drawScreen(x, y, f);
|
||||||
|
String text = this.tileRepairer.storage.getEnergyStored()+"/"+this.tileRepairer.storage.getMaxEnergyStored()+" RF";
|
||||||
|
if(x >= guiLeft+28 && y >= guiTop+6 && x <= guiLeft+43 && y <= guiTop+88){
|
||||||
|
this.func_146283_a(Collections.singletonList(text), x, y);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawGuiContainerForegroundLayer(int x, int y){
|
public void drawGuiContainerForegroundLayer(int x, int y){
|
||||||
AssetUtil.displayNameString(this.fontRendererObj, xSize, -10, this.tileRepairer.getInventoryName());
|
AssetUtil.displayNameString(this.fontRendererObj, xSize, -10, this.tileRepairer.getInventoryName());
|
||||||
|
@ -60,13 +69,4 @@ public class GuiRepairer extends GuiContainer{
|
||||||
this.drawTexturedModalRect(this.guiLeft+73, this.guiTop+52, 176, 28, i, 16);
|
this.drawTexturedModalRect(this.guiLeft+73, this.guiTop+52, 176, 28, i, 16);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void drawScreen(int x, int y, float f){
|
|
||||||
super.drawScreen(x, y, f);
|
|
||||||
String text = this.tileRepairer.storage.getEnergyStored()+"/"+this.tileRepairer.storage.getMaxEnergyStored()+" RF";
|
|
||||||
if(x >= guiLeft+28 && y >= guiTop+6 && x <= guiLeft+43 && y <= guiTop+88){
|
|
||||||
this.func_146283_a(Collections.singletonList(text), x, y);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
|
@ -54,19 +54,6 @@ public class GuiSmileyCloud extends GuiContainer{
|
||||||
this.ySize = 20;
|
this.ySize = 20;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void drawGuiContainerForegroundLayer(int x, int y){
|
|
||||||
String name = cloud.name == null || cloud.name.isEmpty() ? "" : EnumChatFormatting.GOLD+cloud.name+EnumChatFormatting.RESET+" "+StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".gui.the")+" ";
|
|
||||||
String localizedName = name+StringUtil.localize("container."+ModUtil.MOD_ID_LOWER+".cloud.name");
|
|
||||||
this.fontRendererObj.drawString(localizedName, xSize/2-this.fontRendererObj.getStringWidth(localizedName)/2, -10, StringUtil.DECIMAL_COLOR_WHITE);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void updateScreen(){
|
|
||||||
super.updateScreen();
|
|
||||||
this.nameField.updateCursorCounter();
|
|
||||||
}
|
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
@Override
|
@Override
|
||||||
public void initGui(){
|
public void initGui(){
|
||||||
|
@ -78,6 +65,29 @@ public class GuiSmileyCloud extends GuiContainer{
|
||||||
this.nameField.setFocused(true);
|
this.nameField.setFocused(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
public void drawScreen(int x, int y, float f){
|
||||||
|
super.drawScreen(x, y, f);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void drawGuiContainerForegroundLayer(int x, int y){
|
||||||
|
String name = cloud.name == null || cloud.name.isEmpty() ? "" : EnumChatFormatting.GOLD+cloud.name+EnumChatFormatting.RESET+" "+StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".gui.the")+" ";
|
||||||
|
String localizedName = name+StringUtil.localize("container."+ModUtil.MOD_ID_LOWER+".cloud.name");
|
||||||
|
this.fontRendererObj.drawString(localizedName, xSize/2-this.fontRendererObj.getStringWidth(localizedName)/2, -10, StringUtil.DECIMAL_COLOR_WHITE);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void drawGuiContainerBackgroundLayer(float f, int x, int y){
|
||||||
|
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||||
|
|
||||||
|
this.mc.getTextureManager().bindTexture(resLoc);
|
||||||
|
this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, this.xSize, this.ySize);
|
||||||
|
|
||||||
|
this.nameField.drawTextBox();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void mouseClicked(int par1, int par2, int par3){
|
protected void mouseClicked(int par1, int par2, int par3){
|
||||||
this.nameField.mouseClicked(par1, par2, par3);
|
this.nameField.mouseClicked(par1, par2, par3);
|
||||||
|
@ -99,6 +109,12 @@ public class GuiSmileyCloud extends GuiContainer{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateScreen(){
|
||||||
|
super.updateScreen();
|
||||||
|
this.nameField.updateCursorCounter();
|
||||||
|
}
|
||||||
|
|
||||||
public void setVariable(GuiTextField field){
|
public void setVariable(GuiTextField field){
|
||||||
this.sendPacket(field.getText(), 0);
|
this.sendPacket(field.getText(), 0);
|
||||||
field.setText("");
|
field.setText("");
|
||||||
|
@ -107,20 +123,4 @@ public class GuiSmileyCloud extends GuiContainer{
|
||||||
private void sendPacket(String text, int textID){
|
private void sendPacket(String text, int textID){
|
||||||
PacketHandler.theNetwork.sendToServer(new PacketGuiString(x, y, z, world, text, textID, Minecraft.getMinecraft().thePlayer));
|
PacketHandler.theNetwork.sendToServer(new PacketGuiString(x, y, z, world, text, textID, Minecraft.getMinecraft().thePlayer));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void drawGuiContainerBackgroundLayer(float f, int x, int y){
|
|
||||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
|
||||||
|
|
||||||
this.mc.getTextureManager().bindTexture(resLoc);
|
|
||||||
this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, this.xSize, this.ySize);
|
|
||||||
|
|
||||||
this.nameField.drawTextBox();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
public void drawScreen(int x, int y, float f){
|
|
||||||
super.drawScreen(x, y, f);
|
|
||||||
}
|
|
||||||
}
|
}
|
|
@ -75,9 +75,8 @@ public class GuiXPSolidifier extends GuiContainer{
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void actionPerformed(GuiButton button){
|
public void drawScreen(int x, int y, float f){
|
||||||
PacketHandler.theNetwork.sendToServer(new PacketGuiButton(x, y, z, world, button.id, Minecraft.getMinecraft().thePlayer));
|
super.drawScreen(x, y, f);
|
||||||
this.solidifier.onButtonPressed(button.id, Minecraft.getMinecraft().thePlayer);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -99,7 +98,8 @@ public class GuiXPSolidifier extends GuiContainer{
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawScreen(int x, int y, float f){
|
public void actionPerformed(GuiButton button){
|
||||||
super.drawScreen(x, y, f);
|
PacketHandler.theNetwork.sendToServer(new PacketGuiButton(x, y, z, world, button.id, Minecraft.getMinecraft().thePlayer));
|
||||||
|
this.solidifier.onButtonPressed(button.id, Minecraft.getMinecraft().thePlayer);
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -21,6 +21,11 @@ public class SlotImmovable extends Slot{
|
||||||
super(inventory, id, x, y);
|
super(inventory, id, x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isItemValid(ItemStack stack){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void putStack(ItemStack stack){
|
public void putStack(ItemStack stack){
|
||||||
|
|
||||||
|
@ -35,9 +40,4 @@ public class SlotImmovable extends Slot{
|
||||||
public boolean canTakeStack(EntityPlayer player){
|
public boolean canTakeStack(EntityPlayer player){
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isItemValid(ItemStack stack){
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,25 +39,19 @@ public class ItemArmorAA extends ItemArmor implements IActAddItemOrBlock{
|
||||||
this.setMaxDamage(material.getDurability(type)/10);
|
this.setMaxDamage(material.getDurability(type)/10);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public IIcon getIcon(ItemStack stack, int pass){
|
|
||||||
return this.itemIcon;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public EnumRarity getRarity(ItemStack stack){
|
public EnumRarity getRarity(ItemStack stack){
|
||||||
return EnumRarity.rare;
|
return EnumRarity.rare;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
public IIcon getIcon(ItemStack stack, int pass){
|
||||||
public void registerIcons(IIconRegister iconReg){
|
return this.itemIcon;
|
||||||
this.itemIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getName(){
|
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type){
|
||||||
return this.name;
|
return this.textures[slot == 2 ? 1 : 0];
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -72,7 +66,13 @@ public class ItemArmorAA extends ItemArmor implements IActAddItemOrBlock{
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type){
|
@SideOnly(Side.CLIENT)
|
||||||
return this.textures[slot == 2 ? 1 : 0];
|
public void registerIcons(IIconRegister iconReg){
|
||||||
|
this.itemIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getName(){
|
||||||
|
return this.name;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue