This commit is contained in:
Ellpeck 2015-10-02 16:48:01 +02:00
parent 42d6c39d14
commit 9f4323bb0d
159 changed files with 1234 additions and 719 deletions

View file

@ -43,6 +43,7 @@ import ellpeck.actuallyadditions.tile.TileEntityBase;
import ellpeck.actuallyadditions.update.UpdateChecker; import ellpeck.actuallyadditions.update.UpdateChecker;
import ellpeck.actuallyadditions.util.ModUtil; import ellpeck.actuallyadditions.util.ModUtil;
import ellpeck.actuallyadditions.util.Util; import ellpeck.actuallyadditions.util.Util;
// So that BuildCraft Oil always gets used // So that BuildCraft Oil always gets used
@Mod(modid = ModUtil.MOD_ID, name = ModUtil.NAME, version = ModUtil.VERSION, dependencies = "after:BuildCraft|Energy", canBeDeactivated = false, guiFactory = "ellpeck.actuallyadditions.config.GuiFactory") @Mod(modid = ModUtil.MOD_ID, name = ModUtil.NAME, version = ModUtil.VERSION, dependencies = "after:BuildCraft|Energy", canBeDeactivated = false, guiFactory = "ellpeck.actuallyadditions.config.GuiFactory")
public class ActuallyAdditions{ public class ActuallyAdditions{

View file

@ -50,7 +50,7 @@ public enum TheAchievements{
public final int type; public final int type;
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) this.ach.initIndependentStat(); if(hasToHaveBefore == null) this.ach.initIndependentStat();
this.ach.registerStat(); this.ach.registerStat();
this.type = type; this.type = type;

View file

@ -76,16 +76,18 @@ public class BlockBreaker extends BlockContainerBase implements IActAddItemOrBlo
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconReg){ public void registerBlockIcons(IIconRegister iconReg){
this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName()); this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName());
this.frontIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + "Front"); this.frontIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Front");
this.topIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + "Top"); 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){
TileEntityBreaker breaker = (TileEntityBreaker)world.getTileEntity(x, y, z); TileEntityBreaker breaker = (TileEntityBreaker)world.getTileEntity(x, y, z);
if (breaker != null) player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.BREAKER.ordinal(), world, x, y, z); if(breaker != null){
player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.BREAKER.ordinal(), world, x, y, z);
}
return true; return true;
} }
return true; return true;

View file

@ -53,15 +53,17 @@ public class BlockCanolaPress extends BlockContainerBase implements IActAddItemO
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconReg){ public void registerBlockIcons(IIconRegister iconReg){
this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName()); this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName());
this.topIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + "Top"); 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){
TileEntityCanolaPress press = (TileEntityCanolaPress)world.getTileEntity(x, y, z); TileEntityCanolaPress press = (TileEntityCanolaPress)world.getTileEntity(x, y, z);
if (press != null) player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.CANOLA_PRESS.ordinal(), world, x, y, z); if(press != null){
player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.CANOLA_PRESS.ordinal(), world, x, y, z);
}
return true; return true;
} }
return true; return true;

View file

@ -49,9 +49,9 @@ public class BlockCoalGenerator extends BlockContainerBase implements IActAddIte
public void randomDisplayTick(World world, int x, int y, int z, Random rand){ public void randomDisplayTick(World world, int x, int y, int z, Random rand){
int meta = world.getBlockMetadata(x, y, z); int meta = world.getBlockMetadata(x, y, z);
if (meta == 1){ if(meta == 1){
for(int i = 0; i < 5; i++){ 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); world.spawnParticle("smoke", (double)x+0.5F, (double)y+1.0F, (double)z+0.5F, 0.0D, 0.0D, 0.0D);
} }
} }
} }
@ -69,16 +69,18 @@ public class BlockCoalGenerator extends BlockContainerBase implements IActAddIte
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconReg){ public void registerBlockIcons(IIconRegister iconReg){
this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName()); this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName());
this.topIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + "Top"); this.topIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Top");
this.bottomIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + "Bottom"); 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){
TileEntityCoalGenerator press = (TileEntityCoalGenerator)world.getTileEntity(x, y, z); TileEntityCoalGenerator press = (TileEntityCoalGenerator)world.getTileEntity(x, y, z);
if (press != null) player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.COAL_GENERATOR.ordinal(), world, x, y, z); if(press != null){
player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.COAL_GENERATOR.ordinal(), world, x, y, z);
}
return true; return true;
} }
return true; return true;

View file

@ -58,7 +58,9 @@ public class BlockCoffeeMachine extends BlockContainerBase implements IActAddIte
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){
TileEntityCoffeeMachine machine = (TileEntityCoffeeMachine)world.getTileEntity(x, y, z); TileEntityCoffeeMachine machine = (TileEntityCoffeeMachine)world.getTileEntity(x, y, z);
if (machine != null) player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.COFFEE_MACHINE.ordinal(), world, x, y, z); if(machine != null){
player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.COFFEE_MACHINE.ordinal(), world, x, y, z);
}
return true; return true;
} }
return true; return true;

View file

@ -74,7 +74,9 @@ public class BlockColoredLamp extends Block implements IActAddItemOrBlock{
if(world.getBlockMetadata(x, y, z) != color.ordinal()){ if(world.getBlockMetadata(x, y, z) != color.ordinal()){
if(!world.isRemote){ if(!world.isRemote){
world.setBlockMetadataWithNotify(x, y, z, color.ordinal(), 2); world.setBlockMetadataWithNotify(x, y, z, color.ordinal(), 2);
if(!player.capabilities.isCreativeMode) player.inventory.decrStackSize(player.inventory.currentItem, 1); if(!player.capabilities.isCreativeMode){
player.inventory.decrStackSize(player.inventory.currentItem, 1);
}
} }
return true; return true;
} }
@ -98,7 +100,7 @@ public class BlockColoredLamp extends Block implements IActAddItemOrBlock{
@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){
for (int j = 0; j < allLampTypes.length; j++){ for(int j = 0; j < allLampTypes.length; j++){
list.add(new ItemStack(item, 1, j)); list.add(new ItemStack(item, 1, j));
} }
} }
@ -128,7 +130,7 @@ public class BlockColoredLamp extends Block implements IActAddItemOrBlock{
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconReg){ public void registerBlockIcons(IIconRegister iconReg){
for(int i = 0; i < allLampTypes.length; i++){ for(int i = 0; i < allLampTypes.length; i++){
this.textures[i] = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + ((IActAddItemOrBlock)InitBlocks.blockColoredLamp).getName() + allLampTypes[i].name + (isOn ? "On" : "")); this.textures[i] = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+((IActAddItemOrBlock)InitBlocks.blockColoredLamp).getName()+allLampTypes[i].name+(isOn ? "On" : ""));
} }
} }
@ -150,7 +152,7 @@ public class BlockColoredLamp extends Block implements IActAddItemOrBlock{
@Override @Override
public String getUnlocalizedName(ItemStack stack){ public String getUnlocalizedName(ItemStack stack){
return InitBlocks.blockColoredLamp.getUnlocalizedName() + allLampTypes[stack.getItemDamage()].getName(); return InitBlocks.blockColoredLamp.getUnlocalizedName()+allLampTypes[stack.getItemDamage()].getName();
} }
@Override @Override
@ -161,7 +163,7 @@ public class BlockColoredLamp extends Block implements IActAddItemOrBlock{
@Override @Override
public String getItemStackDisplayName(ItemStack stack){ public String getItemStackDisplayName(ItemStack stack){
if(stack.getItemDamage() >= allLampTypes.length) return null; if(stack.getItemDamage() >= allLampTypes.length) return null;
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")+")" : "");
} }
} }
} }

View file

@ -54,15 +54,23 @@ public class BlockCompost extends BlockContainerBase implements IActAddItemOrBlo
TileEntityCompost tile = (TileEntityCompost)world.getTileEntity(x, y, z); TileEntityCompost tile = (TileEntityCompost)world.getTileEntity(x, y, z);
//Add items to be composted //Add items to be composted
if(stackPlayer != null && stackPlayer.getItem() instanceof ItemMisc && stackPlayer.getItemDamage() == TheMiscItems.MASHED_FOOD.ordinal() && (tile.slots[0] == null || (!(tile.slots[0].getItem() instanceof ItemFertilizer) && tile.slots[0].stackSize < ConfigIntValues.COMPOST_AMOUNT.getValue()))){ if(stackPlayer != null && stackPlayer.getItem() instanceof ItemMisc && stackPlayer.getItemDamage() == TheMiscItems.MASHED_FOOD.ordinal() && (tile.slots[0] == null || (!(tile.slots[0].getItem() instanceof ItemFertilizer) && tile.slots[0].stackSize < ConfigIntValues.COMPOST_AMOUNT.getValue()))){
if(tile.slots[0] == null) tile.slots[0] = new ItemStack(stackPlayer.getItem(), 1, TheMiscItems.MASHED_FOOD.ordinal()); if(tile.slots[0] == null){
else tile.slots[0].stackSize++; tile.slots[0] = new ItemStack(stackPlayer.getItem(), 1, TheMiscItems.MASHED_FOOD.ordinal());
}
else{
tile.slots[0].stackSize++;
}
if(!player.capabilities.isCreativeMode) player.inventory.getCurrentItem().stackSize--; if(!player.capabilities.isCreativeMode) player.inventory.getCurrentItem().stackSize--;
} }
//Add Fertilizer to player's inventory //Add Fertilizer to player's inventory
else if(tile.slots[0] != null && (stackPlayer == null || (stackPlayer.getItem() instanceof ItemFertilizer && stackPlayer.stackSize <= stackPlayer.getMaxStackSize() - tile.slots[0].stackSize)) && tile.slots[0].getItem() instanceof ItemFertilizer){ else if(tile.slots[0] != null && (stackPlayer == null || (stackPlayer.getItem() instanceof ItemFertilizer && stackPlayer.stackSize <= stackPlayer.getMaxStackSize()-tile.slots[0].stackSize)) && tile.slots[0].getItem() instanceof ItemFertilizer){
if(stackPlayer == null) player.inventory.setInventorySlotContents(player.inventory.currentItem, tile.slots[0].copy()); if(stackPlayer == null){
else player.getCurrentEquippedItem().stackSize+=tile.slots[0].stackSize; player.inventory.setInventorySlotContents(player.inventory.currentItem, tile.slots[0].copy());
}
else{
player.getCurrentEquippedItem().stackSize += tile.slots[0].stackSize;
}
tile.slots[0] = null; tile.slots[0] = null;
} }
} }
@ -78,9 +86,9 @@ public class BlockCompost extends BlockContainerBase implements IActAddItemOrBlo
super.addCollisionBoxesToList(world, x, y, z, mask, list, collidingEntity); super.addCollisionBoxesToList(world, x, y, z, mask, list, collidingEntity);
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, f); this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, f);
super.addCollisionBoxesToList(world, x, y, z, mask, list, collidingEntity); super.addCollisionBoxesToList(world, x, y, z, mask, list, collidingEntity);
this.setBlockBounds(1.0F - f, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); this.setBlockBounds(1.0F-f, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
super.addCollisionBoxesToList(world, x, y, z, mask, list, collidingEntity); super.addCollisionBoxesToList(world, x, y, z, mask, list, collidingEntity);
this.setBlockBounds(0.0F, 0.0F, 1.0F - f, 1.0F, 1.0F, 1.0F); this.setBlockBounds(0.0F, 0.0F, 1.0F-f, 1.0F, 1.0F, 1.0F);
super.addCollisionBoxesToList(world, x, y, z, mask, list, collidingEntity); super.addCollisionBoxesToList(world, x, y, z, mask, list, collidingEntity);
this.setBlockBoundsForItemRender(); this.setBlockBoundsForItemRender();
} }

View file

@ -51,7 +51,9 @@ public abstract class BlockContainerBase extends BlockContainer{
float dY = rand.nextFloat()*0.8F+0.1F; float dY = rand.nextFloat()*0.8F+0.1F;
float dZ = rand.nextFloat()*0.8F+0.1F; float dZ = rand.nextFloat()*0.8F+0.1F;
EntityItem entityItem = new EntityItem(world, x+dX, y+dY, z+dZ, stack.copy()); EntityItem entityItem = new EntityItem(world, x+dX, y+dY, z+dZ, stack.copy());
if(stack.hasTagCompound()) entityItem.getEntityItem().setTagCompound((NBTTagCompound)stack.getTagCompound().copy()); if(stack.hasTagCompound()){
entityItem.getEntityItem().setTagCompound((NBTTagCompound)stack.getTagCompound().copy());
}
float factor = 0.05F; float factor = 0.05F;
entityItem.motionX = rand.nextGaussian()*factor; entityItem.motionX = rand.nextGaussian()*factor;
entityItem.motionY = rand.nextGaussian()*factor+0.2F; entityItem.motionY = rand.nextGaussian()*factor+0.2F;

View file

@ -73,16 +73,18 @@ public class BlockDropper extends BlockContainerBase implements IActAddItemOrBlo
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconReg){ public void registerBlockIcons(IIconRegister iconReg){
this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName()); this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName());
this.frontIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + "Front"); this.frontIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Front");
this.topIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + "Top"); 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){
TileEntityDropper dropper = (TileEntityDropper)world.getTileEntity(x, y, z); TileEntityDropper dropper = (TileEntityDropper)world.getTileEntity(x, y, z);
if (dropper != null) player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.DROPPER.ordinal(), world, x, y, z); if(dropper != null){
player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.DROPPER.ordinal(), world, x, y, z);
}
return true; return true;
} }
return true; return true;

View file

@ -57,9 +57,9 @@ public class BlockEnergizer extends BlockContainerBase implements IActAddItemOrB
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconReg){ public void registerBlockIcons(IIconRegister iconReg){
this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName()); this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName());
this.topIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + "Top"); this.topIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Top");
this.sideIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + "Side"); this.sideIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Side");
} }
@Override @Override
@ -67,11 +67,15 @@ public class BlockEnergizer extends BlockContainerBase implements IActAddItemOrB
if(!world.isRemote){ if(!world.isRemote){
if(this.isEnergizer){ if(this.isEnergizer){
TileEntityEnergizer energizer = (TileEntityEnergizer)world.getTileEntity(x, y, z); TileEntityEnergizer energizer = (TileEntityEnergizer)world.getTileEntity(x, y, z);
if(energizer != null) player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.ENERGIZER.ordinal(), world, x, y, z); if(energizer != null){
player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.ENERGIZER.ordinal(), world, x, y, z);
}
} }
else{ else{
TileEntityEnervator energizer = (TileEntityEnervator)world.getTileEntity(x, y, z); TileEntityEnervator energizer = (TileEntityEnervator)world.getTileEntity(x, y, z);
if(energizer != null) player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.ENERVATOR.ordinal(), world, x, y, z); if(energizer != null){
player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.ENERVATOR.ordinal(), world, x, y, z);
}
} }
return true; return true;
} }

View file

@ -53,15 +53,17 @@ public class BlockFeeder extends BlockContainerBase implements IActAddItemOrBloc
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconReg){ public void registerBlockIcons(IIconRegister iconReg){
this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName()); this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName());
this.topIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + "Top"); 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){
TileEntityFeeder feeder = (TileEntityFeeder)world.getTileEntity(x, y, z); TileEntityFeeder feeder = (TileEntityFeeder)world.getTileEntity(x, y, z);
if (feeder != null) player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.FEEDER.ordinal(), world, x, y, z); if(feeder != null){
player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.FEEDER.ordinal(), world, x, y, z);
}
return true; return true;
} }
return true; return true;

View file

@ -49,7 +49,9 @@ public class BlockFermentingBarrel extends BlockContainerBase implements IActAdd
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){
TileEntityFermentingBarrel press = (TileEntityFermentingBarrel)world.getTileEntity(x, y, z); TileEntityFermentingBarrel press = (TileEntityFermentingBarrel)world.getTileEntity(x, y, z);
if (press != null) player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.FERMENTING_BARREL.ordinal(), world, x, y, z); if(press != null){
player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.FERMENTING_BARREL.ordinal(), world, x, y, z);
}
return true; return true;
} }
return true; return true;
@ -69,8 +71,8 @@ public class BlockFermentingBarrel extends BlockContainerBase implements IActAdd
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconReg){ public void registerBlockIcons(IIconRegister iconReg){
this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName()); this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName());
this.iconTop = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + "Top"); this.iconTop = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Top");
} }
@Override @Override

View file

@ -76,16 +76,18 @@ public class BlockFluidCollector extends BlockContainerBase implements IActAddIt
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconReg){ public void registerBlockIcons(IIconRegister iconReg){
this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName()); this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName());
this.frontIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + "Front"); this.frontIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Front");
this.topIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + "Top"); 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){
TileEntityFluidCollector collector = (TileEntityFluidCollector)world.getTileEntity(x, y, z); TileEntityFluidCollector collector = (TileEntityFluidCollector)world.getTileEntity(x, y, z);
if (collector != null) player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.FLUID_COLLECTOR.ordinal(), world, x, y, z); if(collector != null){
player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.FLUID_COLLECTOR.ordinal(), world, x, y, z);
}
return true; return true;
} }
return true; return true;

View file

@ -58,8 +58,8 @@ public class BlockFluidFlowing extends BlockFluidClassic implements IActAddItemO
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconReg){ public void registerBlockIcons(IIconRegister iconReg){
this.stillIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + "Still"); this.stillIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Still");
this.flowingIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + "Flowing"); this.flowingIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Flowing");
this.definedFluid.setIcons(this.stillIcon, this.flowingIcon); this.definedFluid.setIcons(this.stillIcon, this.flowingIcon);
} }

View file

@ -50,12 +50,12 @@ public class BlockFurnaceDouble extends BlockContainerBase implements IActAddIte
@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;
if (rotation == 0) world.setBlockMetadataWithNotify(x, y, z, 0, 2); if(rotation == 0) world.setBlockMetadataWithNotify(x, y, z, 0, 2);
if (rotation == 1) world.setBlockMetadataWithNotify(x, y, z, 3, 2); if(rotation == 1) world.setBlockMetadataWithNotify(x, y, z, 3, 2);
if (rotation == 2) world.setBlockMetadataWithNotify(x, y, z, 1, 2); if(rotation == 2) world.setBlockMetadataWithNotify(x, y, z, 1, 2);
if (rotation == 3) world.setBlockMetadataWithNotify(x, y, z, 2, 2); if(rotation == 3) world.setBlockMetadataWithNotify(x, y, z, 2, 2);
} }
@Override @Override
@ -79,7 +79,9 @@ public class BlockFurnaceDouble extends BlockContainerBase implements IActAddIte
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);
if(side == 1) return this.topIcon; if(side == 1) return this.topIcon;
if(side == meta+2 && meta <= 3) return this.frontIcon; if(side == meta+2 && meta <= 3){
return this.frontIcon;
}
else if(side == meta-2 && meta > 3) return this.onIcon; else if(side == meta-2 && meta > 3) return this.onIcon;
return this.blockIcon; return this.blockIcon;
} }
@ -87,17 +89,19 @@ public class BlockFurnaceDouble extends BlockContainerBase implements IActAddIte
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconReg){ public void registerBlockIcons(IIconRegister iconReg){
this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName()); this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName());
this.topIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + "Top"); this.topIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Top");
this.onIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + "On"); this.onIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"On");
this.frontIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + "Front"); this.frontIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Front");
} }
@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){
TileEntityFurnaceDouble furnace = (TileEntityFurnaceDouble)world.getTileEntity(x, y, z); TileEntityFurnaceDouble furnace = (TileEntityFurnaceDouble)world.getTileEntity(x, y, z);
if (furnace != null) player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.FURNACE_DOUBLE.ordinal(), world, x, y, z); if(furnace != null){
player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.FURNACE_DOUBLE.ordinal(), world, x, y, z);
}
return true; return true;
} }
return true; return true;
@ -108,32 +112,32 @@ public class BlockFurnaceDouble extends BlockContainerBase implements IActAddIte
public void randomDisplayTick(World world, int x, int y, int z, Random rand){ public void randomDisplayTick(World world, int x, int y, int z, Random rand){
int meta = world.getBlockMetadata(x, y, z); int meta = world.getBlockMetadata(x, y, z);
if (meta > 3){ if(meta > 3){
float f = (float)x + 0.5F; float f = (float)x+0.5F;
float f1 = (float)y + 0.0F + rand.nextFloat() * 6.0F / 16.0F; float f1 = (float)y+0.0F+rand.nextFloat()*6.0F/16.0F;
float f2 = (float)z + 0.5F; float f2 = (float)z+0.5F;
float f3 = 0.52F; float f3 = 0.52F;
float f4 = rand.nextFloat() * 0.6F - 0.3F; float f4 = rand.nextFloat()*0.6F-0.3F;
if(meta == 6){ if(meta == 6){
world.spawnParticle("smoke", (double)(f - f3), (double)f1, (double)(f2 + f4), 0.0D, 0.0D, 0.0D); world.spawnParticle("smoke", (double)(f-f3), (double)f1, (double)(f2+f4), 0.0D, 0.0D, 0.0D);
world.spawnParticle("flame", (double)(f - f3), (double)f1, (double)(f2 + f4), 0.0D, 0.0D, 0.0D); world.spawnParticle("flame", (double)(f-f3), (double)f1, (double)(f2+f4), 0.0D, 0.0D, 0.0D);
} }
if(meta == 7){ if(meta == 7){
world.spawnParticle("smoke", (double)(f + f3), (double)f1, (double)(f2 + f4), 0.0D, 0.0D, 0.0D); world.spawnParticle("smoke", (double)(f+f3), (double)f1, (double)(f2+f4), 0.0D, 0.0D, 0.0D);
world.spawnParticle("flame", (double)(f + f3), (double)f1, (double)(f2 + f4), 0.0D, 0.0D, 0.0D); world.spawnParticle("flame", (double)(f+f3), (double)f1, (double)(f2+f4), 0.0D, 0.0D, 0.0D);
} }
if(meta == 4){ if(meta == 4){
world.spawnParticle("smoke", (double)(f + f4), (double)f1, (double)(f2 - f3), 0.0D, 0.0D, 0.0D); world.spawnParticle("smoke", (double)(f+f4), (double)f1, (double)(f2-f3), 0.0D, 0.0D, 0.0D);
world.spawnParticle("flame", (double)(f + f4), (double)f1, (double)(f2 - f3), 0.0D, 0.0D, 0.0D); world.spawnParticle("flame", (double)(f+f4), (double)f1, (double)(f2-f3), 0.0D, 0.0D, 0.0D);
} }
if(meta == 5){ if(meta == 5){
world.spawnParticle("smoke", (double)(f + f4), (double)f1, (double)(f2 + f3), 0.0D, 0.0D, 0.0D); world.spawnParticle("smoke", (double)(f+f4), (double)f1, (double)(f2+f3), 0.0D, 0.0D, 0.0D);
world.spawnParticle("flame", (double)(f + f4), (double)f1, (double)(f2 + f3), 0.0D, 0.0D, 0.0D); world.spawnParticle("flame", (double)(f+f4), (double)f1, (double)(f2+f3), 0.0D, 0.0D, 0.0D);
} }
for(int i = 0; i < 5; i++){ 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); world.spawnParticle("smoke", (double)x+0.5F, (double)y+1.0F, (double)z+0.5F, 0.0D, 0.0D, 0.0D);
} }
} }
} }

View file

@ -48,7 +48,7 @@ public class BlockGeneric extends Block implements IActAddItemOrBlock{
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconReg){ public void registerBlockIcons(IIconRegister iconReg){
this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName()); this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName());
} }
public static class TheItemBlock extends ItemBlock{ public static class TheItemBlock extends ItemBlock{

View file

@ -54,16 +54,18 @@ public class BlockGiantChest extends BlockContainerBase implements IActAddItemOr
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconReg){ public void registerBlockIcons(IIconRegister iconReg){
this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName()); this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName());
this.topIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + "Top"); this.topIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Top");
this.bottomIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + "Bottom"); 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){
TileEntityGiantChest chest = (TileEntityGiantChest)world.getTileEntity(x, y, z); TileEntityGiantChest chest = (TileEntityGiantChest)world.getTileEntity(x, y, z);
if (chest != null) player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.GIANT_CHEST.ordinal(), world, x, y, z); if(chest != null){
player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.GIANT_CHEST.ordinal(), world, x, y, z);
}
return true; return true;
} }
return true; return true;
@ -100,6 +102,7 @@ public class BlockGiantChest extends BlockContainerBase implements IActAddItemOr
public String getUnlocalizedName(ItemStack stack){ public String getUnlocalizedName(ItemStack stack){
return this.getUnlocalizedName(); return this.getUnlocalizedName();
} }
@Override @Override
public int getMetadata(int damage){ public int getMetadata(int damage){
return damage; return damage;

View file

@ -66,7 +66,7 @@ public class BlockGreenhouseGlass extends BlockContainerBase implements IActAddI
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconReg){ public void registerBlockIcons(IIconRegister iconReg){
this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName()); this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName());
} }
@Override @Override

View file

@ -72,30 +72,32 @@ public class BlockGrinder extends BlockContainerBase implements IActAddItemOrBlo
public void randomDisplayTick(World world, int x, int y, int z, Random rand){ public void randomDisplayTick(World world, int x, int y, int z, Random rand){
int meta = world.getBlockMetadata(x, y, z); int meta = world.getBlockMetadata(x, y, z);
if (meta == 1){ if(meta == 1){
for(int i = 0; i < 5; i++){ for(int i = 0; i < 5; i++){
double xRand = new Random().nextDouble()/0.75D - 0.5D; double xRand = new Random().nextDouble()/0.75D-0.5D;
double zRand = new Random().nextDouble()/0.75D - 0.5D; double zRand = new Random().nextDouble()/0.75D-0.5D;
world.spawnParticle("crit", (double)x+0.4F, (double)y + 0.8F, (double)z+0.4F, xRand, 0.5D, zRand); world.spawnParticle("crit", (double)x+0.4F, (double)y+0.8F, (double)z+0.4F, xRand, 0.5D, zRand);
} }
world.spawnParticle("smoke", (double)x+0.5F, (double)y + 1.0F, (double)z+0.5F, 0.0D, 0.0D, 0.0D); world.spawnParticle("smoke", (double)x+0.5F, (double)y+1.0F, (double)z+0.5F, 0.0D, 0.0D, 0.0D);
} }
} }
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconReg){ public void registerBlockIcons(IIconRegister iconReg){
this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName()); this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName());
this.topIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":blockGrinderTop"); this.topIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":blockGrinderTop");
this.onIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":blockGrinderOn"); this.onIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":blockGrinderOn");
this.bottomIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":blockGrinderBottom"); 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){
TileEntityGrinder grinder = (TileEntityGrinder)world.getTileEntity(x, y, z); TileEntityGrinder grinder = (TileEntityGrinder)world.getTileEntity(x, y, z);
if (grinder != null) player.openGui(ActuallyAdditions.instance, this.isDouble ? GuiHandler.GuiTypes.GRINDER_DOUBLE.ordinal() : GuiHandler.GuiTypes.GRINDER.ordinal(), world, x, y, z); if(grinder != null){
player.openGui(ActuallyAdditions.instance, this.isDouble ? GuiHandler.GuiTypes.GRINDER_DOUBLE.ordinal() : GuiHandler.GuiTypes.GRINDER.ordinal(), world, x, y, z);
}
return true; return true;
} }
return true; return true;

View file

@ -51,9 +51,9 @@ public class BlockHeatCollector extends BlockContainerBase implements IActAddIte
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconReg){ public void registerBlockIcons(IIconRegister iconReg){
this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + "Side"); this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Side");
this.topIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + "Top"); this.topIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Top");
this.bottomIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + "Bottom"); this.bottomIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Bottom");
} }
@Override @Override

View file

@ -61,14 +61,16 @@ public class BlockInputter extends BlockContainerBase implements IActAddItemOrBl
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconReg){ public void registerBlockIcons(IIconRegister iconReg){
this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName()); 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){
TileEntityInputter inputter = (TileEntityInputter)world.getTileEntity(x, y, z); TileEntityInputter inputter = (TileEntityInputter)world.getTileEntity(x, y, z);
if (inputter != null) player.openGui(ActuallyAdditions.instance, this.isAdvanced ? GuiHandler.GuiTypes.INPUTTER_ADVANCED.ordinal() : GuiHandler.GuiTypes.INPUTTER.ordinal(), world, x, y, z); if(inputter != null){
player.openGui(ActuallyAdditions.instance, this.isAdvanced ? GuiHandler.GuiTypes.INPUTTER_ADVANCED.ordinal() : GuiHandler.GuiTypes.INPUTTER.ordinal(), world, x, y, z);
}
return true; return true;
} }
return true; return true;
@ -120,7 +122,7 @@ public class BlockInputter extends BlockContainerBase implements IActAddItemOrBl
this.toPick = rand.nextInt(NAME_FLAVOUR_AMOUNTS)+1; this.toPick = rand.nextInt(NAME_FLAVOUR_AMOUNTS)+1;
} }
return StringUtil.localize(this.getUnlocalizedName()+".name") + " (" + StringUtil.localize("tile."+ModUtil.MOD_ID_LOWER+".blockInputter.add."+this.toPick+".name") + ")"; return StringUtil.localize(this.getUnlocalizedName()+".name")+" ("+StringUtil.localize("tile."+ModUtil.MOD_ID_LOWER+".blockInputter.add."+this.toPick+".name")+")";
} }
@Override @Override

View file

@ -63,16 +63,18 @@ public class BlockItemRepairer extends BlockContainerBase implements IActAddItem
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconReg){ public void registerBlockIcons(IIconRegister iconReg){
this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName()); this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName());
this.topIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + "Top"); this.topIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Top");
this.bottomIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + "Bottom"); 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){
TileEntityItemRepairer repairer = (TileEntityItemRepairer)world.getTileEntity(x, y, z); TileEntityItemRepairer repairer = (TileEntityItemRepairer)world.getTileEntity(x, y, z);
if (repairer != null) player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.REPAIRER.ordinal(), world, x, y, z); if(repairer != null){
player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.REPAIRER.ordinal(), world, x, y, z);
}
return true; return true;
} }
return true; return true;

View file

@ -96,8 +96,8 @@ public class BlockLampPowerer extends Block implements IActAddItemOrBlock{
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconReg){ public void registerBlockIcons(IIconRegister iconReg){
this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName()); this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName());
this.frontIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + "Front"); this.frontIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Front");
} }
public static class TheItemBlock extends ItemBlock{ public static class TheItemBlock extends ItemBlock{

View file

@ -53,8 +53,8 @@ public class BlockLavaFactoryController extends BlockContainerBase implements IA
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconReg){ public void registerBlockIcons(IIconRegister iconReg){
this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName()); this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName());
this.topIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + "Top"); this.topIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Top");
} }
@Override @Override
@ -69,7 +69,7 @@ public class BlockLavaFactoryController extends BlockContainerBase implements IA
if(state == TileEntityLavaFactoryController.HAS_AIR || state == TileEntityLavaFactoryController.HAS_LAVA){ if(state == TileEntityLavaFactoryController.HAS_AIR || state == TileEntityLavaFactoryController.HAS_LAVA){
player.addChatComponentMessage(new ChatComponentText(StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".factory.works.desc"))); player.addChatComponentMessage(new ChatComponentText(StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".factory.works.desc")));
} }
player.addChatComponentMessage(new ChatComponentText(factory.storage.getEnergyStored() + "/" + factory.storage.getMaxEnergyStored() + " RF")); player.addChatComponentMessage(new ChatComponentText(factory.storage.getEnergyStored()+"/"+factory.storage.getMaxEnergyStored()+" RF"));
} }
return true; return true;
} }

View file

@ -42,7 +42,7 @@ public class BlockMisc extends Block implements IActAddItemOrBlock{
@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){
for (int j = 0; j < allMiscBlocks.length; j++){ for(int j = 0; j < allMiscBlocks.length; j++){
list.add(new ItemStack(item, 1, j)); list.add(new ItemStack(item, 1, j));
} }
} }
@ -61,7 +61,7 @@ public class BlockMisc extends Block implements IActAddItemOrBlock{
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconReg){ public void registerBlockIcons(IIconRegister iconReg){
for(int i = 0; i < textures.length; i++){ for(int i = 0; i < textures.length; i++){
textures[i] = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + allMiscBlocks[i].getName()); textures[i] = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+allMiscBlocks[i].getName());
} }
} }
@ -88,7 +88,7 @@ public class BlockMisc extends Block implements IActAddItemOrBlock{
@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());
} }
@Override @Override

View file

@ -49,9 +49,9 @@ public class BlockOilGenerator extends BlockContainerBase implements IActAddItem
public void randomDisplayTick(World world, int x, int y, int z, Random rand){ public void randomDisplayTick(World world, int x, int y, int z, Random rand){
int meta = world.getBlockMetadata(x, y, z); int meta = world.getBlockMetadata(x, y, z);
if (meta == 1){ if(meta == 1){
for(int i = 0; i < 5; i++){ 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); world.spawnParticle("smoke", (double)x+0.5F, (double)y+1.0F, (double)z+0.5F, 0.0D, 0.0D, 0.0D);
} }
} }
} }
@ -69,16 +69,18 @@ public class BlockOilGenerator extends BlockContainerBase implements IActAddItem
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconReg){ public void registerBlockIcons(IIconRegister iconReg){
this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName()); this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName());
this.topIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + "Top"); this.topIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Top");
this.bottomIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + "Bottom"); 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){
TileEntityOilGenerator generator = (TileEntityOilGenerator)world.getTileEntity(x, y, z); TileEntityOilGenerator generator = (TileEntityOilGenerator)world.getTileEntity(x, y, z);
if (generator != null) player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.OIL_GENERATOR.ordinal(), world, x, y, z); if(generator != null){
player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.OIL_GENERATOR.ordinal(), world, x, y, z);
}
return true; return true;
} }
return true; return true;

View file

@ -63,8 +63,9 @@ public class BlockOreMagnet extends BlockContainerBase implements IActAddItemOrB
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){
TileEntityOreMagnet magnet = (TileEntityOreMagnet)world.getTileEntity(x, y, z); TileEntityOreMagnet magnet = (TileEntityOreMagnet)world.getTileEntity(x, y, z);
if(magnet != null) if(magnet != null){
player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.ORE_MAGNET.ordinal(), world, x, y, z); player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.ORE_MAGNET.ordinal(), world, x, y, z);
}
return true; return true;
} }
return true; return true;

View file

@ -77,19 +77,27 @@ public class BlockPhantom extends BlockContainerBase implements IActAddItemOrBlo
if(tile instanceof IPhantomTile){ if(tile instanceof IPhantomTile){
IPhantomTile phantom = (IPhantomTile)tile; IPhantomTile phantom = (IPhantomTile)tile;
if(player.isSneaking() || phantom.getGuiID() == -1){ if(player.isSneaking() || phantom.getGuiID() == -1){
player.addChatComponentMessage(new ChatComponentText(StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".blockPhantomRange.desc") + ": " + phantom.getRange())); player.addChatComponentMessage(new ChatComponentText(StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".blockPhantomRange.desc")+": "+phantom.getRange()));
if(phantom.hasBoundPosition()){ if(phantom.hasBoundPosition()){
int distance = (int)Vec3.createVectorHelper(x, y, z).distanceTo(Vec3.createVectorHelper(phantom.getBoundPosition().getX(), phantom.getBoundPosition().getY(), phantom.getBoundPosition().getZ())); int distance = (int)Vec3.createVectorHelper(x, y, z).distanceTo(Vec3.createVectorHelper(phantom.getBoundPosition().getX(), phantom.getBoundPosition().getY(), phantom.getBoundPosition().getZ()));
Item item = phantom.getBoundPosition().getItemBlock(); Item item = phantom.getBoundPosition().getItemBlock();
String name = item == null ? "Absolutely Nothing" : item.getItemStackDisplayName(new ItemStack(phantom.getBoundPosition().getBlock(), 1, phantom.getBoundPosition().getMetadata())); String name = item == null ? "Absolutely Nothing" : item.getItemStackDisplayName(new ItemStack(phantom.getBoundPosition().getBlock(), 1, phantom.getBoundPosition().getMetadata()));
player.addChatComponentMessage(new ChatComponentText(StringUtil.localizeFormatted("tooltip."+ModUtil.MOD_ID_LOWER+".phantom.blockInfo.desc", name, phantom.getBoundPosition().getX(), phantom.getBoundPosition().getY(), phantom.getBoundPosition().getZ(), distance))); player.addChatComponentMessage(new ChatComponentText(StringUtil.localizeFormatted("tooltip."+ModUtil.MOD_ID_LOWER+".phantom.blockInfo.desc", name, phantom.getBoundPosition().getX(), phantom.getBoundPosition().getY(), phantom.getBoundPosition().getZ(), distance)));
if(phantom.isBoundThingInRange()) player.addChatComponentMessage(new ChatComponentText(StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".phantom.connectedRange.desc"))); if(phantom.isBoundThingInRange()){
else player.addChatComponentMessage(new ChatComponentText(StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".phantom.connectedNoRange.desc"))); player.addChatComponentMessage(new ChatComponentText(StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".phantom.connectedRange.desc")));
} }
else player.addChatComponentMessage(new ChatComponentText(StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".phantom.notConnected.desc"))); else{
player.addChatComponentMessage(new ChatComponentText(StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".phantom.connectedNoRange.desc")));
}
}
else{
player.addChatComponentMessage(new ChatComponentText(StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".phantom.notConnected.desc")));
}
}
else{
player.openGui(ActuallyAdditions.instance, phantom.getGuiID(), world, x, y, z);
} }
else player.openGui(ActuallyAdditions.instance, phantom.getGuiID(), world, x, y, z);
} }
} }
} }
@ -120,7 +128,7 @@ public class BlockPhantom extends BlockContainerBase implements IActAddItemOrBlo
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconReg){ public void registerBlockIcons(IIconRegister iconReg){
this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName()); this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName());
} }
@Override @Override

View file

@ -59,10 +59,12 @@ public class BlockPlant extends BlockCrops implements IActAddItemOrBlock{
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int meta){ public IIcon getIcon(int side, int meta){
if(meta < 7){ if(meta < 7){
if (meta == 6) meta = 5; if(meta == 6) meta = 5;
return this.textures[meta >> 1]; return this.textures[meta >> 1];
} }
else return this.textures[this.textures.length-1]; else{
return this.textures[this.textures.length-1];
}
} }
@Override @Override
@ -93,8 +95,8 @@ public class BlockPlant extends BlockCrops implements IActAddItemOrBlock{
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconReg){ public void registerBlockIcons(IIconRegister iconReg){
for (int i = 0; i < this.textures.length; i++){ for(int i = 0; i < this.textures.length; i++){
textures[i] = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + "Stage" + (i+1)); textures[i] = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Stage"+(i+1));
} }
} }

View file

@ -62,8 +62,8 @@ public class BlockSlabs extends Block implements IActAddItemOrBlock{
@Override @Override
public int onBlockPlaced(World par1World, int blockX, int blockY, int blockZ, int side, float hitX, float hitY, float hitZ, int meta){ public int onBlockPlaced(World par1World, int blockX, int blockY, int blockZ, int side, float hitX, float hitY, float hitZ, int meta){
if (side == 1) return meta; if(side == 1) return meta;
if (side == 0 || hitY >= 0.5F) return meta+1; if(side == 0 || hitY >= 0.5F) return meta+1;
return meta; return meta;
} }

View file

@ -80,10 +80,10 @@ public class BlockSmileyCloud extends BlockContainerBase implements IActAddItemO
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;
if (rotation == 0) world.setBlockMetadataWithNotify(x, y, z, 2, 2); if(rotation == 0) world.setBlockMetadataWithNotify(x, y, z, 2, 2);
if (rotation == 1) world.setBlockMetadataWithNotify(x, y, z, 1, 2); if(rotation == 1) world.setBlockMetadataWithNotify(x, y, z, 1, 2);
if (rotation == 2) world.setBlockMetadataWithNotify(x, y, z, 0, 2); if(rotation == 2) world.setBlockMetadataWithNotify(x, y, z, 0, 2);
if (rotation == 3) world.setBlockMetadataWithNotify(x, y, z, 3, 2); if(rotation == 3) world.setBlockMetadataWithNotify(x, y, z, 3, 2);
} }
@Override @Override

View file

@ -57,12 +57,12 @@ public class BlockTreasureChest extends Block implements IActAddItemOrBlock{
@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;
if (rotation == 0) world.setBlockMetadataWithNotify(x, y, z, 0, 2); if(rotation == 0) world.setBlockMetadataWithNotify(x, y, z, 0, 2);
if (rotation == 1) world.setBlockMetadataWithNotify(x, y, z, 3, 2); if(rotation == 1) world.setBlockMetadataWithNotify(x, y, z, 3, 2);
if (rotation == 2) world.setBlockMetadataWithNotify(x, y, z, 1, 2); if(rotation == 2) world.setBlockMetadataWithNotify(x, y, z, 1, 2);
if (rotation == 3) world.setBlockMetadataWithNotify(x, y, z, 2, 2); if(rotation == 3) world.setBlockMetadataWithNotify(x, y, z, 2, 2);
} }
@Override @Override
@ -90,10 +90,10 @@ public class BlockTreasureChest extends Block implements IActAddItemOrBlock{
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconReg){ public void registerBlockIcons(IIconRegister iconReg){
this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName()); this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName());
this.topIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + "Top"); this.topIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Top");
this.bottomIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + "Bottom"); this.bottomIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Bottom");
this.frontIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + "Front"); this.frontIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Front");
} }
@Override @Override
@ -118,7 +118,9 @@ public class BlockTreasureChest extends Block implements IActAddItemOrBlock{
float dY = rand.nextFloat()*0.8F+0.1F; float dY = rand.nextFloat()*0.8F+0.1F;
float dZ = rand.nextFloat()*0.8F+0.1F; float dZ = rand.nextFloat()*0.8F+0.1F;
EntityItem entityItem = new EntityItem(world, x+dX, y+dY, z+dZ, itemStack.copy()); EntityItem entityItem = new EntityItem(world, x+dX, y+dY, z+dZ, itemStack.copy());
if(itemStack.hasTagCompound()) entityItem.getEntityItem().setTagCompound((NBTTagCompound)itemStack.getTagCompound().copy()); if(itemStack.hasTagCompound()){
entityItem.getEntityItem().setTagCompound((NBTTagCompound)itemStack.getTagCompound().copy());
}
float factor = 0.05F; float factor = 0.05F;
entityItem.motionX = rand.nextGaussian()*factor; entityItem.motionX = rand.nextGaussian()*factor;
entityItem.motionY = rand.nextGaussian()*factor+0.2F; entityItem.motionY = rand.nextGaussian()*factor+0.2F;

View file

@ -41,7 +41,7 @@ public class BlockWildPlant extends BlockBush implements IActAddItemOrBlock{
@Override @Override
public boolean canBlockStay(World world, int x, int y, int z){ public boolean canBlockStay(World world, int x, int y, int z){
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 @Override
@ -52,7 +52,7 @@ public class BlockWildPlant extends BlockBush implements IActAddItemOrBlock{
@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){
for (int j = 0; j < allWildPlants.length; j++){ for(int j = 0; j < allWildPlants.length; j++){
list.add(new ItemStack(item, 1, j)); list.add(new ItemStack(item, 1, j));
} }
} }
@ -103,7 +103,7 @@ public class BlockWildPlant extends BlockBush implements IActAddItemOrBlock{
@Override @Override
public String getUnlocalizedName(ItemStack stack){ public String getUnlocalizedName(ItemStack stack){
return this.getUnlocalizedName() + (stack.getItemDamage() >= allWildPlants.length ? " ERROR!" : allWildPlants[stack.getItemDamage()].getName()); return this.getUnlocalizedName()+(stack.getItemDamage() >= allWildPlants.length ? " ERROR!" : allWildPlants[stack.getItemDamage()].getName());
} }
@Override @Override

View file

@ -89,8 +89,9 @@ public class BlockXPSolidifier extends BlockContainerBase implements IActAddItem
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){
TileEntityXPSolidifier solidifier = (TileEntityXPSolidifier)world.getTileEntity(x, y, z); TileEntityXPSolidifier solidifier = (TileEntityXPSolidifier)world.getTileEntity(x, y, z);
if(solidifier != null) if(solidifier != null){
player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.XP_SOLIDIFIER.ordinal(), world, x, y, z); player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.XP_SOLIDIFIER.ordinal(), world, x, y, z);
}
return true; return true;
} }
return true; return true;

View file

@ -24,7 +24,7 @@ public class RenderItems implements IItemRenderer{
public RenderItems(ModelBaseAA model){ public RenderItems(ModelBaseAA model){
this.theModel = model; this.theModel = model;
this.theTexture = new ResourceLocation(ModUtil.MOD_ID_LOWER, "textures/blocks/models/" + this.theModel.getName() + ".png"); this.theTexture = new ResourceLocation(ModUtil.MOD_ID_LOWER, "textures/blocks/models/"+this.theModel.getName()+".png");
} }
@Override @Override

View file

@ -32,6 +32,7 @@ public class PageFurnace extends BookletPage{
this.input = input; this.input = input;
InitBooklet.pagesWithItemStackData.add(this); InitBooklet.pagesWithItemStackData.add(this);
} }
public PageFurnace(int id, ItemStack result){ public PageFurnace(int id, ItemStack result){
this(id, null, result); this(id, null, result);
} }

View file

@ -38,7 +38,9 @@ public class InterModCommunications{
CrusherRecipeManualRegistry.registerRecipe(input, outputOne, outputTwo, secondChance); CrusherRecipeManualRegistry.registerRecipe(input, outputOne, outputTwo, secondChance);
ModUtil.LOGGER.info("Crusher Recipe that was sent from Mod "+message.getSender()+" has been registered successfully: "+input.toString()+" -> "+outputOne.toString()+(outputTwo != null ? " + "+outputTwo.toString()+", Second Chance: "+secondChance : "")); ModUtil.LOGGER.info("Crusher Recipe that was sent from Mod "+message.getSender()+" has been registered successfully: "+input.toString()+" -> "+outputOne.toString()+(outputTwo != null ? " + "+outputTwo.toString()+", Second Chance: "+secondChance : ""));
} }
else ModUtil.LOGGER.error("Crusher Recipe that was sent from Mod "+message.getSender()+" could not be registered: It's missing an Input or an Output!"); else{
ModUtil.LOGGER.error("Crusher Recipe that was sent from Mod "+message.getSender()+" could not be registered: It's missing an Input or an Output!");
}
} }
} }
@ -56,7 +58,9 @@ public class InterModCommunications{
ItemCoffee.registerIngredient(new ItemCoffee.Ingredient(input, new PotionEffect[]{effect}, maxAmp)); ItemCoffee.registerIngredient(new ItemCoffee.Ingredient(input, new PotionEffect[]{effect}, maxAmp));
ModUtil.LOGGER.info("Coffee Machine Recipe that was sent from Mod "+message.getSender()+" has been registered successfully: "+input.toString()+" -> "+effect.toString()); ModUtil.LOGGER.info("Coffee Machine Recipe that was sent from Mod "+message.getSender()+" has been registered successfully: "+input.toString()+" -> "+effect.toString());
} }
else ModUtil.LOGGER.error("Coffee Machine Recipe that was sent from Mod " + message.getSender() + " could not be registered: It's missing an Input, a Potion ID, a Duration or a max Amplifier!"); else{
ModUtil.LOGGER.error("Coffee Machine Recipe that was sent from Mod "+message.getSender()+" could not be registered: It's missing an Input, a Potion ID, a Duration or a max Amplifier!");
}
} }
} }
@ -70,7 +74,9 @@ public class InterModCommunications{
HairyBallHandler.addReturn(output, chance); HairyBallHandler.addReturn(output, chance);
ModUtil.LOGGER.info("Ball Of Hair Recipe that was sent from Mod "+message.getSender()+" has been registered successfully: "+output.toString()+", Chance: "+chance); ModUtil.LOGGER.info("Ball Of Hair Recipe that was sent from Mod "+message.getSender()+" has been registered successfully: "+output.toString()+", Chance: "+chance);
} }
else ModUtil.LOGGER.error("Ball Of Hair Recipe that was sent from Mod " + message.getSender() + " could not be registered: It's missing an Output or a Chance!"); else{
ModUtil.LOGGER.error("Ball Of Hair Recipe that was sent from Mod "+message.getSender()+" could not be registered: It's missing an Output or a Chance!");
}
} }
} }
@ -86,7 +92,9 @@ public class InterModCommunications{
TreasureChestHandler.addReturn(output, chance, minAmount, maxAmount); TreasureChestHandler.addReturn(output, chance, minAmount, maxAmount);
ModUtil.LOGGER.info("Treasure Chest Recipe that was sent from Mod "+message.getSender()+" has been registered successfully: "+output.toString()+", Chance: "+chance+", Min Amount: "+minAmount+", Max Amount: "+maxAmount); ModUtil.LOGGER.info("Treasure Chest Recipe that was sent from Mod "+message.getSender()+" has been registered successfully: "+output.toString()+", Chance: "+chance+", Min Amount: "+minAmount+", Max Amount: "+maxAmount);
} }
else ModUtil.LOGGER.error("Treasure Chest Recipe that was sent from Mod " + message.getSender() + " could not be registered: It's missing an Output, a Chance or minimum and maximum Amounts!"); else{
ModUtil.LOGGER.error("Treasure Chest Recipe that was sent from Mod "+message.getSender()+" could not be registered: It's missing an Output, a Chance or minimum and maximum Amounts!");
}
} }
} }
} }

View file

@ -45,7 +45,7 @@ public class ConfigurationHandler{
@SubscribeEvent @SubscribeEvent
public void onConfigurationChangedEvent(ConfigChangedEvent.OnConfigChangedEvent event){ public void onConfigurationChangedEvent(ConfigChangedEvent.OnConfigChangedEvent event){
if (event.modID.equalsIgnoreCase(ModUtil.MOD_ID)){ if(event.modID.equalsIgnoreCase(ModUtil.MOD_ID)){
loadConfig(); loadConfig();
} }
} }

View file

@ -168,7 +168,7 @@ public enum ConfigCrafting{
this.name = name; this.name = name;
this.category = category.name; this.category = category.name;
this.defaultValue = defaultValue; this.defaultValue = defaultValue;
this.extraText = extraText.length() > 0 ? extraText + " " : ""; this.extraText = extraText.length() > 0 ? extraText+" " : "";
} }
ConfigCrafting(String name, ConfigCategories category, boolean defaultValue){ ConfigCrafting(String name, ConfigCategories category, boolean defaultValue){

View file

@ -27,19 +27,41 @@ public class CrusherCrafting{
public static void init(){ public static void init(){
ModUtil.LOGGER.info("Initializing Crusher Recipes..."); ModUtil.LOGGER.info("Initializing Crusher Recipes...");
if(ConfigCrafting.REDSTONE.isEnabled()) CrusherRecipeManualRegistry.registerRecipe(new ItemStack(Blocks.redstone_ore), new ItemStack(Items.redstone, 10)); if(ConfigCrafting.REDSTONE.isEnabled()){
if(ConfigCrafting.LAPIS.isEnabled()) CrusherRecipeManualRegistry.registerRecipe(new ItemStack(Blocks.lapis_ore), new ItemStack(Items.dye, 12, 4)); CrusherRecipeManualRegistry.registerRecipe(new ItemStack(Blocks.redstone_ore), new ItemStack(Items.redstone, 10));
if(ConfigCrafting.COAL.isEnabled()) CrusherRecipeManualRegistry.registerRecipe(new ItemStack(Items.coal), new ItemStack(InitItems.itemDust, 1, TheDusts.COAL.ordinal())); }
if(ConfigCrafting.COAL_ORE.isEnabled()) CrusherRecipeManualRegistry.registerRecipe(new ItemStack(Blocks.coal_ore), new ItemStack(Items.coal, 3)); if(ConfigCrafting.LAPIS.isEnabled()){
if(ConfigCrafting.COAL_BLOCKS.isEnabled()) CrusherRecipeManualRegistry.registerRecipe(new ItemStack(Blocks.coal_block), new ItemStack(Items.coal, 9)); CrusherRecipeManualRegistry.registerRecipe(new ItemStack(Blocks.lapis_ore), new ItemStack(Items.dye, 12, 4));
}
if(ConfigCrafting.COAL.isEnabled()){
CrusherRecipeManualRegistry.registerRecipe(new ItemStack(Items.coal), new ItemStack(InitItems.itemDust, 1, TheDusts.COAL.ordinal()));
}
if(ConfigCrafting.COAL_ORE.isEnabled()){
CrusherRecipeManualRegistry.registerRecipe(new ItemStack(Blocks.coal_ore), new ItemStack(Items.coal, 3));
}
if(ConfigCrafting.COAL_BLOCKS.isEnabled()){
CrusherRecipeManualRegistry.registerRecipe(new ItemStack(Blocks.coal_block), new ItemStack(Items.coal, 9));
}
if(ConfigCrafting.COBBLESTONE.isEnabled()) CrusherRecipeManualRegistry.registerRecipe(new ItemStack(Blocks.cobblestone), new ItemStack(Blocks.sand)); if(ConfigCrafting.COBBLESTONE.isEnabled()){
if(ConfigCrafting.GRAVEL.isEnabled()) CrusherRecipeManualRegistry.registerRecipe(new ItemStack(Blocks.gravel), new ItemStack(Items.flint)); CrusherRecipeManualRegistry.registerRecipe(new ItemStack(Blocks.cobblestone), new ItemStack(Blocks.sand));
if(ConfigCrafting.STONE.isEnabled()) CrusherRecipeManualRegistry.registerRecipe(new ItemStack(Blocks.stone), new ItemStack(Blocks.cobblestone)); }
if(ConfigCrafting.RICE_SUGAR.isEnabled()) CrusherRecipeManualRegistry.registerRecipe(new ItemStack(InitItems.itemFoods, 1, TheFoods.RICE.ordinal()), new ItemStack(Items.sugar, 2)); if(ConfigCrafting.GRAVEL.isEnabled()){
CrusherRecipeManualRegistry.registerRecipe(new ItemStack(Blocks.gravel), new ItemStack(Items.flint));
}
if(ConfigCrafting.STONE.isEnabled()){
CrusherRecipeManualRegistry.registerRecipe(new ItemStack(Blocks.stone), new ItemStack(Blocks.cobblestone));
}
if(ConfigCrafting.RICE_SUGAR.isEnabled()){
CrusherRecipeManualRegistry.registerRecipe(new ItemStack(InitItems.itemFoods, 1, TheFoods.RICE.ordinal()), new ItemStack(Items.sugar, 2));
}
if(ConfigCrafting.NICKEL.isEnabled()) CrusherRecipeManualRegistry.registerRecipe("oreNickel", "dustNickel", "dustPlatinum", 15, 2, 1); if(ConfigCrafting.NICKEL.isEnabled()){
if(ConfigCrafting.IRON.isEnabled()) CrusherRecipeManualRegistry.registerRecipe("oreIron", "dustIron", "dustGold", 20, 2, 1); CrusherRecipeManualRegistry.registerRecipe("oreNickel", "dustNickel", "dustPlatinum", 15, 2, 1);
}
if(ConfigCrafting.IRON.isEnabled()){
CrusherRecipeManualRegistry.registerRecipe("oreIron", "dustIron", "dustGold", 20, 2, 1);
}
CrusherRecipeAutoRegistry.searchCases.add(new SearchCase("oreNether", 6)); CrusherRecipeAutoRegistry.searchCases.add(new SearchCase("oreNether", 6));
CrusherRecipeAutoRegistry.searchCases.add(new SearchCase("orePoor", 4, "nugget")); CrusherRecipeAutoRegistry.searchCases.add(new SearchCase("orePoor", 4, "nugget"));

View file

@ -12,7 +12,7 @@ package ellpeck.actuallyadditions.crafting;
import ellpeck.actuallyadditions.util.ModUtil; import ellpeck.actuallyadditions.util.ModUtil;
public class InitCrafting { public class InitCrafting{
public static void init(){ public static void init(){
ModUtil.LOGGER.info("Initializing Crafting Recipes..."); ModUtil.LOGGER.info("Initializing Crafting Recipes...");

View file

@ -33,7 +33,7 @@ public class EntityLivingEvent{
EntityOcelot theOcelot = (EntityOcelot)event.entityLiving; EntityOcelot theOcelot = (EntityOcelot)event.entityLiving;
if(ConfigBoolValues.DO_CAT_DROPS.isEnabled() && theOcelot.isTamed()){ if(ConfigBoolValues.DO_CAT_DROPS.isEnabled() && theOcelot.isTamed()){
if(new Random().nextInt(ConfigIntValues.CAT_DROP_CHANCE.getValue())+1 == 1){ if(new Random().nextInt(ConfigIntValues.CAT_DROP_CHANCE.getValue())+1 == 1){
EntityItem item = new EntityItem(theOcelot.worldObj, theOcelot.posX + 0.5, theOcelot.posY + 0.5, theOcelot.posZ + 0.5, new ItemStack(InitItems.itemHairyBall)); EntityItem item = new EntityItem(theOcelot.worldObj, theOcelot.posX+0.5, theOcelot.posY+0.5, theOcelot.posZ+0.5, new ItemStack(InitItems.itemHairyBall));
theOcelot.worldObj.spawnEntityInWorld(item); theOcelot.worldObj.spawnEntityInWorld(item);
} }
} }

View file

@ -34,8 +34,8 @@ public class LivingDropEvent{
for(int i = 0; i < TheSpecialDrops.values().length; i++){ for(int i = 0; i < TheSpecialDrops.values().length; i++){
TheSpecialDrops theDrop = TheSpecialDrops.values()[i]; TheSpecialDrops theDrop = TheSpecialDrops.values()[i];
if(theDrop.canDrop && theDrop.dropFrom.isAssignableFrom(event.entityLiving.getClass())){ if(theDrop.canDrop && theDrop.dropFrom.isAssignableFrom(event.entityLiving.getClass())){
if(new Random().nextInt(100) + 1 <= theDrop.chance){ if(new Random().nextInt(100)+1 <= theDrop.chance){
event.entityLiving.entityDropItem(new ItemStack(InitItems.itemSpecialDrop, new Random().nextInt(theDrop.maxAmount) + 1, theDrop.ordinal()), 0); event.entityLiving.entityDropItem(new ItemStack(InitItems.itemSpecialDrop, new Random().nextInt(theDrop.maxAmount)+1, theDrop.ordinal()), 0);
} }
} }
} }

View file

@ -34,6 +34,6 @@ public class ModelStandardBlock extends ModelBaseAA{
@Override @Override
public String getName(){ public String getName(){
return "model" + this.name; return "model"+this.name;
} }
} }

View file

@ -34,6 +34,7 @@ public class SmileyCloudEasterEggs{
public String[] getTriggerNames(){ public String[] getTriggerNames(){
return new String[]{"glenthor", "glenthorlp", "twoofeight"}; return new String[]{"glenthor", "glenthorlp", "twoofeight"};
} }
@Override @Override
public void renderExtra(float f){ public void renderExtra(float f){
renderHoldingItem(true, new ItemStack(Items.dye, 1, 2)); renderHoldingItem(true, new ItemStack(Items.dye, 1, 2));
@ -46,6 +47,7 @@ public class SmileyCloudEasterEggs{
public String[] getTriggerNames(){ public String[] getTriggerNames(){
return new String[]{"ellpeck", "ellopecko", "peck"}; return new String[]{"ellpeck", "ellopecko", "peck"};
} }
@Override @Override
public void renderExtra(float f){ public void renderExtra(float f){
renderHoldingItem(false, new ItemStack(InitItems.itemPhantomConnector)); renderHoldingItem(false, new ItemStack(InitItems.itemPhantomConnector));
@ -58,6 +60,7 @@ public class SmileyCloudEasterEggs{
public String[] getTriggerNames(){ public String[] getTriggerNames(){
return new String[]{"tyrex", "lord_tobinho", "tobinho"}; return new String[]{"tyrex", "lord_tobinho", "tobinho"};
} }
@Override @Override
public void renderExtra(float f){ public void renderExtra(float f){
renderHoldingItem(false, new ItemStack(Items.fishing_rod)); renderHoldingItem(false, new ItemStack(Items.fishing_rod));
@ -70,6 +73,7 @@ public class SmileyCloudEasterEggs{
public String[] getTriggerNames(){ public String[] getTriggerNames(){
return new String[]{"dqmhose", "xdqmhose", "hose"}; return new String[]{"dqmhose", "xdqmhose", "hose"};
} }
@Override @Override
public void renderExtra(float f){ public void renderExtra(float f){
renderHoldingItem(false, new ItemStack(Items.reeds)); renderHoldingItem(false, new ItemStack(Items.reeds));
@ -82,6 +86,7 @@ public class SmileyCloudEasterEggs{
public String[] getTriggerNames(){ public String[] getTriggerNames(){
return new String[]{"jemx", "jemxx", "jemxxx", "spielertobi200"}; return new String[]{"jemx", "jemxx", "jemxxx", "spielertobi200"};
} }
@Override @Override
public void renderExtra(float f){ public void renderExtra(float f){
renderHoldingItem(true, new ItemStack(Items.milk_bucket)); renderHoldingItem(true, new ItemStack(Items.milk_bucket));
@ -94,6 +99,7 @@ public class SmileyCloudEasterEggs{
public String[] getTriggerNames(){ public String[] getTriggerNames(){
return new String[]{"vazkii", "vaski", "waskie"}; return new String[]{"vazkii", "vaski", "waskie"};
} }
@Override @Override
public void renderExtra(float f){ public void renderExtra(float f){
renderHoldingItem(true, new ItemStack(Items.dye, 1, 15)); renderHoldingItem(true, new ItemStack(Items.dye, 1, 15));
@ -106,6 +112,7 @@ public class SmileyCloudEasterEggs{
public String[] getTriggerNames(){ public String[] getTriggerNames(){
return new String[]{"kitty", "kiddy", "kittyvancat", "kittyvancatlp"}; return new String[]{"kitty", "kiddy", "kittyvancat", "kittyvancatlp"};
} }
@Override @Override
public void renderExtra(float f){ public void renderExtra(float f){
renderHoldingItem(true, new ItemStack(Items.fish)); renderHoldingItem(true, new ItemStack(Items.fish));
@ -119,6 +126,7 @@ public class SmileyCloudEasterEggs{
public String[] getTriggerNames(){ public String[] getTriggerNames(){
return new String[]{"canitz", "canitzp", "kannnichts", "kannnichtsp"}; return new String[]{"canitz", "canitzp", "kannnichts", "kannnichtsp"};
} }
@Override @Override
public void renderExtra(float f){ public void renderExtra(float f){
renderHoldingItem(false, new ItemStack(Items.wooden_sword)); renderHoldingItem(false, new ItemStack(Items.wooden_sword));
@ -131,6 +139,7 @@ public class SmileyCloudEasterEggs{
public String[] getTriggerNames(){ public String[] getTriggerNames(){
return new String[]{"lari", "larixine", "xine", "laxi", "lachsirine", "lala", "lalilu"}; return new String[]{"lari", "larixine", "xine", "laxi", "lachsirine", "lala", "lalilu"};
} }
@Override @Override
public void renderExtra(float f){ public void renderExtra(float f){
renderHoldingItem(false, new ItemStack(Items.iron_helmet)); renderHoldingItem(false, new ItemStack(Items.iron_helmet));
@ -143,6 +152,7 @@ public class SmileyCloudEasterEggs{
public String[] getTriggerNames(){ public String[] getTriggerNames(){
return new String[]{"rotesding", "dotesring"}; return new String[]{"rotesding", "dotesring"};
} }
@Override @Override
public void renderExtra(float f){ public void renderExtra(float f){
renderHoldingItem(false, new ItemStack(Items.milk_bucket)); renderHoldingItem(false, new ItemStack(Items.milk_bucket));
@ -156,6 +166,7 @@ public class SmileyCloudEasterEggs{
public String[] getTriggerNames(){ public String[] getTriggerNames(){
return new String[]{"bande", "bandelenth"}; return new String[]{"bande", "bandelenth"};
} }
@Override @Override
public void renderExtra(float f){ public void renderExtra(float f){
renderHoldingItem(false, new ItemStack(Items.diamond_pickaxe)); renderHoldingItem(false, new ItemStack(Items.diamond_pickaxe));
@ -168,6 +179,7 @@ public class SmileyCloudEasterEggs{
public String[] getTriggerNames(){ public String[] getTriggerNames(){
return new String[]{"wolle", "wuitoi"}; return new String[]{"wolle", "wuitoi"};
} }
@Override @Override
public void renderExtra(float f){ public void renderExtra(float f){
renderHoldingItem(false, new ItemStack(Items.string)); renderHoldingItem(false, new ItemStack(Items.string));
@ -180,6 +192,7 @@ public class SmileyCloudEasterEggs{
public String[] getTriggerNames(){ public String[] getTriggerNames(){
return new String[]{"pakto", "paktosan", "paktosanlp"}; return new String[]{"pakto", "paktosan", "paktosanlp"};
} }
@Override @Override
public void renderExtra(float f){ public void renderExtra(float f){
renderHoldingItem(false, new ItemStack(Items.dye, 1, 9)); renderHoldingItem(false, new ItemStack(Items.dye, 1, 9));
@ -192,6 +205,7 @@ public class SmileyCloudEasterEggs{
public String[] getTriggerNames(){ public String[] getTriggerNames(){
return new String[]{"honka", "honkalonka", "lonka", "lonki"}; return new String[]{"honka", "honkalonka", "lonka", "lonki"};
} }
@Override @Override
public void renderExtra(float f){ public void renderExtra(float f){
renderHoldingItem(false, new ItemStack(InitItems.itemLeafBlowerAdvanced, 1, 9)); renderHoldingItem(false, new ItemStack(InitItems.itemLeafBlowerAdvanced, 1, 9));
@ -204,6 +218,7 @@ public class SmileyCloudEasterEggs{
public String[] getTriggerNames(){ public String[] getTriggerNames(){
return new String[]{"acid", "acid_blues", "acidblues"}; return new String[]{"acid", "acid_blues", "acidblues"};
} }
@Override @Override
public void renderExtra(float f){ public void renderExtra(float f){
renderHoldingItem(false, new ItemStack(InitItems.itemFoods, 1, TheFoods.PIZZA.ordinal())); renderHoldingItem(false, new ItemStack(InitItems.itemFoods, 1, TheFoods.PIZZA.ordinal()));
@ -216,6 +231,7 @@ public class SmileyCloudEasterEggs{
public String[] getTriggerNames(){ public String[] getTriggerNames(){
return new String[]{"jasin", "jasindow"}; return new String[]{"jasin", "jasindow"};
} }
@Override @Override
public void renderExtra(float f){ public void renderExtra(float f){
renderHoldingItem(false, new ItemStack(Items.written_book)); renderHoldingItem(false, new ItemStack(Items.written_book));
@ -228,6 +244,7 @@ public class SmileyCloudEasterEggs{
public String[] getTriggerNames(){ public String[] getTriggerNames(){
return new String[]{"lordi", "lordhallo"}; return new String[]{"lordi", "lordhallo"};
} }
@Override @Override
public void renderExtra(float f){ public void renderExtra(float f){
renderHoldingItem(true, new ItemStack(Items.paper)); renderHoldingItem(true, new ItemStack(Items.paper));
@ -241,6 +258,7 @@ public class SmileyCloudEasterEggs{
public String[] getTriggerNames(){ public String[] getTriggerNames(){
return new String[]{"freakyninja", "ninja", "tl"}; return new String[]{"freakyninja", "ninja", "tl"};
} }
@Override @Override
public void renderExtra(float f){ public void renderExtra(float f){
renderHoldingItem(false, new ItemStack(Items.diamond_sword)); renderHoldingItem(false, new ItemStack(Items.diamond_sword));
@ -253,6 +271,7 @@ public class SmileyCloudEasterEggs{
public String[] getTriggerNames(){ public String[] getTriggerNames(){
return new String[]{"nihon", "nihontiger", "tiger"}; return new String[]{"nihon", "nihontiger", "tiger"};
} }
@Override @Override
public void renderExtra(float f){ public void renderExtra(float f){
renderHoldingItem(false, new ItemStack(Items.stone_pickaxe)); renderHoldingItem(false, new ItemStack(Items.stone_pickaxe));

View file

@ -63,15 +63,17 @@ public class OreGen implements IWorldGenerator{
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;
for(int i = 0; i < chancesToSpawn; i++){ for(int i = 0; i < chancesToSpawn; i++){
int posX = blockXPos + random.nextInt(16); int posX = blockXPos+random.nextInt(16);
int posY = minY + random.nextInt(yDiff); int posY = minY+random.nextInt(yDiff);
int posZ = blockZPos + random.nextInt(16); int posZ = blockZPos+random.nextInt(16);
new WorldGenMinable(block, meta, maxVeinSize, blockIn).generate(world, random, posX, posY, posZ); new WorldGenMinable(block, meta, maxVeinSize, blockIn).generate(world, random, posX, posY, posZ);
} }
} }
else ModUtil.LOGGER.fatal("Couldn't generate '" + block.getUnlocalizedName() + "' into the world because the Min Y coordinate is bigger than the Max! This is definitely a Config Error! Check the Files!"); else{
ModUtil.LOGGER.fatal("Couldn't generate '"+block.getUnlocalizedName()+"' into the world because the Min Y coordinate is bigger than the Max! This is definitely a Config Error! Check the Files!");
}
} }
public static void init(){ public static void init(){

View file

@ -56,7 +56,7 @@ public class VillageComponentCustomCropField extends StructureVillagePieces.Hous
this.fillWithBlocks(world, sbb, 0, 0, 0, xSize-1, ySize-1, zSize-1, Blocks.air); this.fillWithBlocks(world, sbb, 0, 0, 0, xSize-1, ySize-1, zSize-1, Blocks.air);
this.spawnActualHouse(world, rand, sbb); this.spawnActualHouse(world, rand, sbb);
for (int i = 0; i < xSize; i++){ for(int i = 0; i < xSize; i++){
for(int j = 0; j < zSize; j++){ for(int j = 0; j < zSize; j++){
this.clearCurrentPositionBlocksUpwards(world, i, ySize, j, sbb); this.clearCurrentPositionBlocksUpwards(world, i, ySize, j, sbb);
this.func_151554_b(world, Blocks.dirt, 0, i, -1, j, sbb); this.func_151554_b(world, Blocks.dirt, 0, i, -1, j, sbb);
@ -68,10 +68,14 @@ public class VillageComponentCustomCropField extends StructureVillagePieces.Hous
private Block getRandomCropType(Random rand){ private Block getRandomCropType(Random rand){
switch(rand.nextInt(4)){ switch(rand.nextInt(4)){
case 0: return InitBlocks.blockFlax; case 0:
case 1: return InitBlocks.blockCoffee; return InitBlocks.blockFlax;
case 2: return InitBlocks.blockRice; case 1:
default: return InitBlocks.blockCanola; return InitBlocks.blockCoffee;
case 2:
return InitBlocks.blockRice;
default:
return InitBlocks.blockCanola;
} }
} }

View file

@ -59,7 +59,7 @@ public class VillageComponentJamHouse extends StructureVillagePieces.House1{
this.fillWithBlocks(world, sbb, 0, 0, 0, xSize-1, ySize-1, zSize-1, Blocks.air); this.fillWithBlocks(world, sbb, 0, 0, 0, xSize-1, ySize-1, zSize-1, Blocks.air);
this.spawnActualHouse(world, rand, sbb); this.spawnActualHouse(world, rand, sbb);
for (int i = 0; i < xSize; i++){ for(int i = 0; i < xSize; i++){
for(int j = 0; j < zSize; j++){ for(int j = 0; j < zSize; j++){
this.clearCurrentPositionBlocksUpwards(world, i, ySize, j, sbb); this.clearCurrentPositionBlocksUpwards(world, i, ySize, j, sbb);
this.func_151554_b(world, Blocks.cobblestone, 0, i, -1, j, sbb); this.func_151554_b(world, Blocks.cobblestone, 0, i, -1, j, sbb);
@ -100,7 +100,7 @@ public class VillageComponentJamHouse extends StructureVillagePieces.House1{
this.fillWithBlocks(world, sbb, 1+i*8, 1, 7, 1+i*8, 4, 7, Blocks.cobblestone); this.fillWithBlocks(world, sbb, 1+i*8, 1, 7, 1+i*8, 4, 7, Blocks.cobblestone);
this.fillWithBlocks(world, sbb, 1+i*8, 4, 2, 1+i*8, 5, 6, Blocks.cobblestone); this.fillWithBlocks(world, sbb, 1+i*8, 4, 2, 1+i*8, 5, 6, Blocks.cobblestone);
this.fillWithBlocks(world, sbb, 1+i*8, 3, 2, 1+i*8, 3, 6, Blocks.planks); this.fillWithBlocks(world, sbb, 1+i*8, 3, 2, 1+i*8, 3, 6, Blocks.planks);
this.placeBlockAtCurrentPosition(world, Blocks.planks, 0, 1+i* 8, 2, 2, sbb); this.placeBlockAtCurrentPosition(world, Blocks.planks, 0, 1+i*8, 2, 2, sbb);
this.placeBlockAtCurrentPosition(world, Blocks.planks, 0, 1+i*8, 2, 6, sbb); this.placeBlockAtCurrentPosition(world, Blocks.planks, 0, 1+i*8, 2, 6, sbb);
this.fillWithBlocks(world, sbb, 1+i*8, 2, 3, 1+i*8, 2, 5, Blocks.glass_pane); this.fillWithBlocks(world, sbb, 1+i*8, 2, 3, 1+i*8, 2, 5, Blocks.glass_pane);
} }

View file

@ -27,19 +27,19 @@ public class ContainerBreaker extends Container{
public ContainerBreaker(InventoryPlayer inventory, TileEntityBase tile){ public ContainerBreaker(InventoryPlayer inventory, TileEntityBase tile){
this.breaker = (TileEntityBreaker)tile; this.breaker = (TileEntityBreaker)tile;
for (int i = 0; i < 3; i++){ for(int i = 0; i < 3; i++){
for (int j = 0; j < 3; j++){ for(int j = 0; j < 3; j++){
this.addSlotToContainer(new Slot(this.breaker, j+i*3, 62+j*18, 21+i*18)); this.addSlotToContainer(new Slot(this.breaker, j+i*3, 62+j*18, 21+i*18));
} }
} }
for (int i = 0; i < 3; i++){ for(int i = 0; i < 3; i++){
for (int j = 0; j < 9; j++){ for(int j = 0; j < 9; j++){
this.addSlotToContainer(new Slot(inventory, j + i * 9 + 9, 8 + j * 18, 97 + i * 18)); this.addSlotToContainer(new Slot(inventory, j+i*9+9, 8+j*18, 97+i*18));
} }
} }
for (int i = 0; i < 9; i++){ for(int i = 0; i < 9; i++){
this.addSlotToContainer(new Slot(inventory, i, 8 + i * 18, 155)); this.addSlotToContainer(new Slot(inventory, i, 8+i*18, 155));
} }
} }
@ -57,7 +57,7 @@ public class ContainerBreaker extends Container{
Slot theSlot = (Slot)this.inventorySlots.get(slot); Slot theSlot = (Slot)this.inventorySlots.get(slot);
if (theSlot != null && theSlot.getHasStack()){ if(theSlot != null && theSlot.getHasStack()){
ItemStack newStack = theSlot.getStack(); ItemStack newStack = theSlot.getStack();
ItemStack currentStack = newStack.copy(); ItemStack currentStack = newStack.copy();
@ -69,16 +69,21 @@ public class ContainerBreaker extends Container{
if(slot >= inventoryStart && slot <= inventoryEnd){ if(slot >= inventoryStart && slot <= inventoryEnd){
if(!this.mergeItemStack(newStack, hotbarStart, hotbarEnd+1, false)) return null; if(!this.mergeItemStack(newStack, hotbarStart, hotbarEnd+1, false)) return null;
} }
else if(slot >= inventoryEnd+1 && slot < hotbarEnd+1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false)) else if(slot >= inventoryEnd+1 && slot < hotbarEnd+1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false)){
return null; return null;
} }
} }
}
else if(!this.mergeItemStack(newStack, inventoryStart, hotbarEnd+1, false)) return null; else if(!this.mergeItemStack(newStack, inventoryStart, hotbarEnd+1, false)) return null;
if (newStack.stackSize == 0) theSlot.putStack(null); if(newStack.stackSize == 0){
else theSlot.onSlotChanged(); theSlot.putStack(null);
}
else{
theSlot.onSlotChanged();
}
if (newStack.stackSize == currentStack.stackSize) return null; if(newStack.stackSize == currentStack.stackSize) return null;
theSlot.onPickupFromSlot(player, newStack); theSlot.onPickupFromSlot(player, newStack);
return currentStack; return currentStack;

View file

@ -37,13 +37,13 @@ public class ContainerCanolaPress extends Container{
this.addSlotToContainer(new Slot(this.press, 1, 136, 73)); this.addSlotToContainer(new Slot(this.press, 1, 136, 73));
this.addSlotToContainer(new SlotOutput(this.press, 2, 136, 42)); this.addSlotToContainer(new SlotOutput(this.press, 2, 136, 42));
for (int i = 0; i < 3; i++){ for(int i = 0; i < 3; i++){
for (int j = 0; j < 9; j++){ for(int j = 0; j < 9; j++){
this.addSlotToContainer(new Slot(inventory, j + i * 9 + 9, 8 + j * 18, 97 + i * 18)); this.addSlotToContainer(new Slot(inventory, j+i*9+9, 8+j*18, 97+i*18));
} }
} }
for (int i = 0; i < 9; i++){ for(int i = 0; i < 9; i++){
this.addSlotToContainer(new Slot(inventory, i, 8 + i * 18, 155)); this.addSlotToContainer(new Slot(inventory, i, 8+i*18, 155));
} }
} }
@ -61,7 +61,7 @@ public class ContainerCanolaPress extends Container{
Slot theSlot = (Slot)this.inventorySlots.get(slot); Slot theSlot = (Slot)this.inventorySlots.get(slot);
if (theSlot != null && theSlot.getHasStack()){ if(theSlot != null && theSlot.getHasStack()){
ItemStack newStack = theSlot.getStack(); ItemStack newStack = theSlot.getStack();
ItemStack currentStack = newStack.copy(); ItemStack currentStack = newStack.copy();
@ -79,14 +79,20 @@ public class ContainerCanolaPress extends Container{
else if(slot >= inventoryStart && slot <= inventoryEnd){ else if(slot >= inventoryStart && slot <= inventoryEnd){
if(!this.mergeItemStack(newStack, hotbarStart, hotbarEnd+1, false)) return null; if(!this.mergeItemStack(newStack, hotbarStart, hotbarEnd+1, false)) return null;
} }
else if(slot >= inventoryEnd+1 && slot < hotbarEnd+1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false)) return null; else if(slot >= inventoryEnd+1 && slot < hotbarEnd+1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false)){
return null;
}
} }
else if(!this.mergeItemStack(newStack, inventoryStart, hotbarEnd+1, false)) return null; else if(!this.mergeItemStack(newStack, inventoryStart, hotbarEnd+1, false)) return null;
if (newStack.stackSize == 0) theSlot.putStack(null); if(newStack.stackSize == 0){
else theSlot.onSlotChanged(); theSlot.putStack(null);
}
else{
theSlot.onSlotChanged();
}
if (newStack.stackSize == currentStack.stackSize) return null; if(newStack.stackSize == currentStack.stackSize) return null;
theSlot.onPickupFromSlot(player, newStack); theSlot.onPickupFromSlot(player, newStack);
return currentStack; return currentStack;

View file

@ -30,13 +30,13 @@ public class ContainerCoalGenerator extends Container{
this.addSlotToContainer(new Slot(this.generator, 0, 87, 43)); this.addSlotToContainer(new Slot(this.generator, 0, 87, 43));
for (int i = 0; i < 3; i++){ for(int i = 0; i < 3; i++){
for (int j = 0; j < 9; j++){ for(int j = 0; j < 9; j++){
this.addSlotToContainer(new Slot(inventory, j + i * 9 + 9, 8 + j * 18, 97 + i * 18)); this.addSlotToContainer(new Slot(inventory, j+i*9+9, 8+j*18, 97+i*18));
} }
} }
for (int i = 0; i < 9; i++){ for(int i = 0; i < 9; i++){
this.addSlotToContainer(new Slot(inventory, i, 8 + i * 18, 155)); this.addSlotToContainer(new Slot(inventory, i, 8+i*18, 155));
} }
} }
@ -69,14 +69,20 @@ public class ContainerCoalGenerator extends Container{
else if(slot >= inventoryStart && slot <= inventoryEnd){ else if(slot >= inventoryStart && slot <= inventoryEnd){
if(!this.mergeItemStack(newStack, hotbarStart, hotbarEnd+1, false)) return null; if(!this.mergeItemStack(newStack, hotbarStart, hotbarEnd+1, false)) return null;
} }
else if(slot >= inventoryEnd+1 && slot < hotbarEnd+1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false)) return null; else if(slot >= inventoryEnd+1 && slot < hotbarEnd+1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false)){
return null;
}
} }
else if(!this.mergeItemStack(newStack, inventoryStart, hotbarEnd+1, false)) return null; else if(!this.mergeItemStack(newStack, inventoryStart, hotbarEnd+1, false)) return null;
if (newStack.stackSize == 0) theSlot.putStack(null); if(newStack.stackSize == 0){
else theSlot.onSlotChanged(); theSlot.putStack(null);
}
else{
theSlot.onSlotChanged();
}
if (newStack.stackSize == currentStack.stackSize) return null; if(newStack.stackSize == currentStack.stackSize) return null;
theSlot.onPickupFromSlot(player, newStack); theSlot.onPickupFromSlot(player, newStack);
return currentStack; return currentStack;

View file

@ -38,8 +38,8 @@ public class ContainerCoffeeMachine extends Container{
this.addSlotToContainer(new Slot(machine, TileEntityCoffeeMachine.SLOT_INPUT, 80, 42)); this.addSlotToContainer(new Slot(machine, TileEntityCoffeeMachine.SLOT_INPUT, 80, 42));
this.addSlotToContainer(new SlotOutput(machine, TileEntityCoffeeMachine.SLOT_OUTPUT, 80, 73)); this.addSlotToContainer(new SlotOutput(machine, TileEntityCoffeeMachine.SLOT_OUTPUT, 80, 73));
for (int i = 0; i < 4; i++){ for(int i = 0; i < 4; i++){
for (int j = 0; j < 2; j++){ for(int j = 0; j < 2; j++){
this.addSlotToContainer(new Slot(machine, j+i*2+3, 125+j*18, 6+i*18)); this.addSlotToContainer(new Slot(machine, j+i*2+3, 125+j*18, 6+i*18));
} }
} }
@ -47,13 +47,13 @@ public class ContainerCoffeeMachine extends Container{
this.addSlotToContainer(new Slot(machine, TileEntityCoffeeMachine.SLOT_WATER_INPUT, 26, 73)); this.addSlotToContainer(new Slot(machine, TileEntityCoffeeMachine.SLOT_WATER_INPUT, 26, 73));
this.addSlotToContainer(new SlotOutput(machine, TileEntityCoffeeMachine.SLOT_WATER_OUTPUT, 45, 73)); this.addSlotToContainer(new SlotOutput(machine, TileEntityCoffeeMachine.SLOT_WATER_OUTPUT, 45, 73));
for (int i = 0; i < 3; i++){ for(int i = 0; i < 3; i++){
for (int j = 0; j < 9; j++){ for(int j = 0; j < 9; j++){
this.addSlotToContainer(new Slot(inventory, j + i * 9 + 9, 8 + j * 18, 97 + i * 18)); this.addSlotToContainer(new Slot(inventory, j+i*9+9, 8+j*18, 97+i*18));
} }
} }
for (int i = 0; i < 9; i++){ for(int i = 0; i < 9; i++){
this.addSlotToContainer(new Slot(inventory, i, 8 + i * 18, 155)); this.addSlotToContainer(new Slot(inventory, i, 8+i*18, 155));
} }
} }
@ -71,7 +71,7 @@ public class ContainerCoffeeMachine extends Container{
Slot theSlot = (Slot)this.inventorySlots.get(slot); Slot theSlot = (Slot)this.inventorySlots.get(slot);
if (theSlot != null && theSlot.getHasStack()){ if(theSlot != null && theSlot.getHasStack()){
ItemStack newStack = theSlot.getStack(); ItemStack newStack = theSlot.getStack();
ItemStack currentStack = newStack.copy(); ItemStack currentStack = newStack.copy();
@ -84,30 +84,42 @@ public class ContainerCoffeeMachine extends Container{
else if(slot >= inventoryStart){ else if(slot >= inventoryStart){
//Shift from Inventory //Shift from Inventory
if(newStack.getItem() == InitItems.itemMisc && newStack.getItemDamage() == TheMiscItems.CUP.ordinal()){ if(newStack.getItem() == InitItems.itemMisc && newStack.getItemDamage() == TheMiscItems.CUP.ordinal()){
if(!this.mergeItemStack(newStack, TileEntityCoffeeMachine.SLOT_INPUT, TileEntityCoffeeMachine.SLOT_INPUT+1, false)) return null; if(!this.mergeItemStack(newStack, TileEntityCoffeeMachine.SLOT_INPUT, TileEntityCoffeeMachine.SLOT_INPUT+1, false)){
return null;
}
} }
else if(FluidContainerRegistry.containsFluid(newStack, new FluidStack(FluidRegistry.WATER, 1))){ else if(FluidContainerRegistry.containsFluid(newStack, new FluidStack(FluidRegistry.WATER, 1))){
if(!this.mergeItemStack(newStack, TileEntityCoffeeMachine.SLOT_WATER_INPUT, TileEntityCoffeeMachine.SLOT_WATER_INPUT+1, false)) return null; if(!this.mergeItemStack(newStack, TileEntityCoffeeMachine.SLOT_WATER_INPUT, TileEntityCoffeeMachine.SLOT_WATER_INPUT+1, false)){
return null;
}
} }
else if(ItemCoffee.getIngredientFromStack(newStack) != null){ else if(ItemCoffee.getIngredientFromStack(newStack) != null){
if(!this.mergeItemStack(newStack, 3, 11, false)) return null; if(!this.mergeItemStack(newStack, 3, 11, false)) return null;
} }
else if(newStack.getItem() == InitItems.itemCoffeeBean){ else if(newStack.getItem() == InitItems.itemCoffeeBean){
if(!this.mergeItemStack(newStack, TileEntityCoffeeMachine.SLOT_COFFEE_BEANS, TileEntityCoffeeMachine.SLOT_COFFEE_BEANS+1, false)) return null; if(!this.mergeItemStack(newStack, TileEntityCoffeeMachine.SLOT_COFFEE_BEANS, TileEntityCoffeeMachine.SLOT_COFFEE_BEANS+1, false)){
return null;
}
} }
// //
else if(slot >= inventoryStart && slot <= inventoryEnd){ else if(slot >= inventoryStart && slot <= inventoryEnd){
if(!this.mergeItemStack(newStack, hotbarStart, hotbarEnd+1, false)) return null; if(!this.mergeItemStack(newStack, hotbarStart, hotbarEnd+1, false)) return null;
} }
else if(slot >= inventoryEnd+1 && slot < hotbarEnd+1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false)) return null; else if(slot >= inventoryEnd+1 && slot < hotbarEnd+1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false)){
return null;
}
} }
else if(!this.mergeItemStack(newStack, inventoryStart, hotbarEnd+1, false)) return null; else if(!this.mergeItemStack(newStack, inventoryStart, hotbarEnd+1, false)) return null;
if (newStack.stackSize == 0) theSlot.putStack(null); if(newStack.stackSize == 0){
else theSlot.onSlotChanged(); theSlot.putStack(null);
}
else{
theSlot.onSlotChanged();
}
if (newStack.stackSize == currentStack.stackSize) return null; if(newStack.stackSize == currentStack.stackSize) return null;
theSlot.onPickupFromSlot(player, newStack); theSlot.onPickupFromSlot(player, newStack);
return currentStack; return currentStack;

View file

@ -38,19 +38,19 @@ public class ContainerCrafter extends Container{
this.z = (int)player.posZ; this.z = (int)player.posZ;
this.addSlotToContainer(new SlotCrafting(inventory.player, this.craftMatrix, this.craftResult, 0, 124, 35)); this.addSlotToContainer(new SlotCrafting(inventory.player, this.craftMatrix, this.craftResult, 0, 124, 35));
for (int i = 0; i < 3; i++){ for(int i = 0; i < 3; i++){
for (int j = 0; j < 3; j++){ for(int j = 0; j < 3; j++){
this.addSlotToContainer(new Slot(this.craftMatrix, j + i*3, 30 + j*18, 17 + i*18)); this.addSlotToContainer(new Slot(this.craftMatrix, j+i*3, 30+j*18, 17+i*18));
} }
} }
for (int i = 0; i < 3; i++){ for(int i = 0; i < 3; i++){
for (int j = 0; j < 9; j++){ for(int j = 0; j < 9; j++){
this.addSlotToContainer(new Slot(inventory, j + i*9 + 9, 8 + j*18, 84 + i*18)); this.addSlotToContainer(new Slot(inventory, j+i*9+9, 8+j*18, 84+i*18));
} }
} }
for (int i = 0; i < 9; i++){ for(int i = 0; i < 9; i++){
this.addSlotToContainer(new Slot(inventory, i, 8 + i*18, 142)); this.addSlotToContainer(new Slot(inventory, i, 8+i*18, 142));
} }
this.onCraftMatrixChanged(this.craftMatrix); this.onCraftMatrixChanged(this.craftMatrix);
@ -65,8 +65,8 @@ public class ContainerCrafter extends Container{
public void onContainerClosed(EntityPlayer player){ public void onContainerClosed(EntityPlayer player){
super.onContainerClosed(player); super.onContainerClosed(player);
if (!this.world.isRemote){ if(!this.world.isRemote){
for (int i = 0; i < 9; ++i){ for(int i = 0; i < 9; ++i){
ItemStack stack = this.craftMatrix.getStackInSlotOnClosing(i); ItemStack stack = this.craftMatrix.getStackInSlotOnClosing(i);
if(stack != null) player.dropPlayerItemWithRandomChoice(stack, false); if(stack != null) player.dropPlayerItemWithRandomChoice(stack, false);
} }
@ -91,12 +91,20 @@ public class ContainerCrafter extends Container{
if(!this.mergeItemStack(savedStack, 10, 46, true)) return null; if(!this.mergeItemStack(savedStack, 10, 46, true)) return null;
theSlot.onSlotChange(savedStack, stack); theSlot.onSlotChange(savedStack, stack);
} }
else if(slot >= 10 && slot < 37 && !this.mergeItemStack(savedStack, 37, 46, false)) return null; else if(slot >= 10 && slot < 37 && !this.mergeItemStack(savedStack, 37, 46, false)){
else if(slot >= 37 && slot < 46 && !this.mergeItemStack(savedStack, 10, 37, false)) return null; return null;
}
else if(slot >= 37 && slot < 46 && !this.mergeItemStack(savedStack, 10, 37, false)){
return null;
}
else if(!this.mergeItemStack(savedStack, 10, 46, false)) return null; else if(!this.mergeItemStack(savedStack, 10, 46, false)) return null;
if(savedStack.stackSize == 0) theSlot.putStack(null); if(savedStack.stackSize == 0){
else theSlot.onSlotChanged(); theSlot.putStack(null);
}
else{
theSlot.onSlotChanged();
}
if(savedStack.stackSize == stack.stackSize) return null; if(savedStack.stackSize == stack.stackSize) return null;

View file

@ -48,8 +48,12 @@ public class ContainerDrill extends Container{
} }
} }
for(int i = 0; i < 9; i++){ for(int i = 0; i < 9; i++){
if(i == inventory.currentItem) this.addSlotToContainer(new SlotImmovable(inventory, i, 8+i*18, 116)); if(i == inventory.currentItem){
else this.addSlotToContainer(new Slot(inventory, i, 8+i*18, 116)); this.addSlotToContainer(new SlotImmovable(inventory, i, 8+i*18, 116));
}
else{
this.addSlotToContainer(new Slot(inventory, i, 8+i*18, 116));
}
} }
ItemStack stack = inventory.getCurrentItem(); ItemStack stack = inventory.getCurrentItem();
@ -77,8 +81,12 @@ public class ContainerDrill extends Container{
public ItemStack slotClick(int par1, int par2, int par3, EntityPlayer player){ public ItemStack slotClick(int par1, int par2, int par3, EntityPlayer player){
//par3 appears to be the type of clicking //par3 appears to be the type of clicking
//par3 == 2 appears to be one of the number keys being hit //par3 == 2 appears to be one of the number keys being hit
if(par3 == 2 && par2 == inventory.currentItem) return null; if(par3 == 2 && par2 == inventory.currentItem){
else return super.slotClick(par1, par2, par3, player); return null;
}
else{
return super.slotClick(par1, par2, par3, player);
}
} }
@Override @Override
@ -90,7 +98,7 @@ public class ContainerDrill extends Container{
Slot theSlot = (Slot)this.inventorySlots.get(slot); Slot theSlot = (Slot)this.inventorySlots.get(slot);
if (theSlot != null && theSlot.getHasStack()){ if(theSlot != null && theSlot.getHasStack()){
ItemStack newStack = theSlot.getStack(); ItemStack newStack = theSlot.getStack();
ItemStack currentStack = newStack.copy(); ItemStack currentStack = newStack.copy();
@ -105,14 +113,20 @@ public class ContainerDrill extends Container{
else if(slot >= inventoryStart && slot <= inventoryEnd){ else if(slot >= inventoryStart && slot <= inventoryEnd){
if(!this.mergeItemStack(newStack, hotbarStart, hotbarEnd+1, false)) return null; if(!this.mergeItemStack(newStack, hotbarStart, hotbarEnd+1, false)) return null;
} }
else if(slot >= inventoryEnd+1 && slot < hotbarEnd+1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false)) return null; else if(slot >= inventoryEnd+1 && slot < hotbarEnd+1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false)){
return null;
}
} }
else if(!this.mergeItemStack(newStack, inventoryStart, hotbarEnd+1, false)) return null; else if(!this.mergeItemStack(newStack, inventoryStart, hotbarEnd+1, false)) return null;
if (newStack.stackSize == 0) theSlot.putStack(null); if(newStack.stackSize == 0){
else theSlot.onSlotChanged(); theSlot.putStack(null);
}
else{
theSlot.onSlotChanged();
}
if (newStack.stackSize == currentStack.stackSize) return null; if(newStack.stackSize == currentStack.stackSize) return null;
theSlot.onPickupFromSlot(player, newStack); theSlot.onPickupFromSlot(player, newStack);
return currentStack; return currentStack;
@ -190,7 +204,7 @@ public class ContainerDrill extends Container{
@Override @Override
public ItemStack decrStackSize(int i, int j){ public ItemStack decrStackSize(int i, int j){
if (slots[i] != null){ if(slots[i] != null){
ItemStack stackAt; ItemStack stackAt;
if(slots[i].stackSize <= j){ if(slots[i].stackSize <= j){
stackAt = slots[i]; stackAt = slots[i];
@ -200,7 +214,7 @@ public class ContainerDrill extends Container{
} }
else{ else{
stackAt = slots[i].splitStack(j); stackAt = slots[i].splitStack(j);
if (slots[i].stackSize == 0) slots[i] = null; if(slots[i].stackSize == 0) slots[i] = null;
this.markDirty(); this.markDirty();
return stackAt; return stackAt;
} }

View file

@ -27,19 +27,19 @@ public class ContainerDropper extends Container{
public ContainerDropper(InventoryPlayer inventory, TileEntityBase tile){ public ContainerDropper(InventoryPlayer inventory, TileEntityBase tile){
this.dropper = (TileEntityDropper)tile; this.dropper = (TileEntityDropper)tile;
for (int i = 0; i < 3; i++){ for(int i = 0; i < 3; i++){
for (int j = 0; j < 3; j++){ for(int j = 0; j < 3; j++){
this.addSlotToContainer(new Slot(this.dropper, j+i*3, 62+j*18, 21+i*18)); this.addSlotToContainer(new Slot(this.dropper, j+i*3, 62+j*18, 21+i*18));
} }
} }
for (int i = 0; i < 3; i++){ for(int i = 0; i < 3; i++){
for (int j = 0; j < 9; j++){ for(int j = 0; j < 9; j++){
this.addSlotToContainer(new Slot(inventory, j + i * 9 + 9, 8 + j * 18, 97 + i * 18)); this.addSlotToContainer(new Slot(inventory, j+i*9+9, 8+j*18, 97+i*18));
} }
} }
for (int i = 0; i < 9; i++){ for(int i = 0; i < 9; i++){
this.addSlotToContainer(new Slot(inventory, i, 8 + i * 18, 155)); this.addSlotToContainer(new Slot(inventory, i, 8+i*18, 155));
} }
} }
@ -57,7 +57,7 @@ public class ContainerDropper extends Container{
Slot theSlot = (Slot)this.inventorySlots.get(slot); Slot theSlot = (Slot)this.inventorySlots.get(slot);
if (theSlot != null && theSlot.getHasStack()){ if(theSlot != null && theSlot.getHasStack()){
ItemStack newStack = theSlot.getStack(); ItemStack newStack = theSlot.getStack();
ItemStack currentStack = newStack.copy(); ItemStack currentStack = newStack.copy();
@ -69,16 +69,21 @@ public class ContainerDropper extends Container{
if(slot >= inventoryStart && slot <= inventoryEnd){ if(slot >= inventoryStart && slot <= inventoryEnd){
if(!this.mergeItemStack(newStack, hotbarStart, hotbarEnd+1, false)) return null; if(!this.mergeItemStack(newStack, hotbarStart, hotbarEnd+1, false)) return null;
} }
else if(slot >= inventoryEnd+1 && slot < hotbarEnd+1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false)) else if(slot >= inventoryEnd+1 && slot < hotbarEnd+1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false)){
return null; return null;
} }
} }
}
else if(!this.mergeItemStack(newStack, inventoryStart, hotbarEnd+1, false)) return null; else if(!this.mergeItemStack(newStack, inventoryStart, hotbarEnd+1, false)) return null;
if (newStack.stackSize == 0) theSlot.putStack(null); if(newStack.stackSize == 0){
else theSlot.onSlotChanged(); theSlot.putStack(null);
}
else{
theSlot.onSlotChanged();
}
if (newStack.stackSize == currentStack.stackSize) return null; if(newStack.stackSize == currentStack.stackSize) return null;
theSlot.onPickupFromSlot(player, newStack); theSlot.onPickupFromSlot(player, newStack);
return currentStack; return currentStack;

View file

@ -37,13 +37,13 @@ public class ContainerEnergizer extends Container{
this.addSlotToContainer(new Slot(this.energizer, 0, 76, 73)); this.addSlotToContainer(new Slot(this.energizer, 0, 76, 73));
this.addSlotToContainer(new SlotOutput(this.energizer, 1, 76, 42)); this.addSlotToContainer(new SlotOutput(this.energizer, 1, 76, 42));
for (int i = 0; i < 3; i++){ for(int i = 0; i < 3; i++){
for (int j = 0; j < 9; j++){ for(int j = 0; j < 9; j++){
this.addSlotToContainer(new Slot(inventory, j + i * 9 + 9, 8 + j * 18, 97 + i * 18)); this.addSlotToContainer(new Slot(inventory, j+i*9+9, 8+j*18, 97+i*18));
} }
} }
for (int i = 0; i < 9; i++){ for(int i = 0; i < 9; i++){
this.addSlotToContainer(new Slot(inventory, i, 8 + i * 18, 155)); this.addSlotToContainer(new Slot(inventory, i, 8+i*18, 155));
} }
final EntityPlayer finalPlayer = player; final EntityPlayer finalPlayer = player;
for(int i = 0; i < 4; ++i){ for(int i = 0; i < 4; ++i){
@ -53,10 +53,12 @@ public class ContainerEnergizer extends Container{
public int getSlotStackLimit(){ public int getSlotStackLimit(){
return 1; return 1;
} }
@Override @Override
public boolean isItemValid(ItemStack stack){ public boolean isItemValid(ItemStack stack){
return stack != null && stack.getItem().isValidArmor(stack, finalI, finalPlayer); return stack != null && stack.getItem().isValidArmor(stack, finalI, finalPlayer);
} }
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public IIcon getBackgroundIconIndex(){ public IIcon getBackgroundIconIndex(){
@ -80,7 +82,7 @@ public class ContainerEnergizer extends Container{
Slot theSlot = (Slot)this.inventorySlots.get(slot); Slot theSlot = (Slot)this.inventorySlots.get(slot);
if (theSlot != null && theSlot.getHasStack()){ if(theSlot != null && theSlot.getHasStack()){
ItemStack newStack = theSlot.getStack(); ItemStack newStack = theSlot.getStack();
ItemStack currentStack = newStack.copy(); ItemStack currentStack = newStack.copy();
@ -100,14 +102,20 @@ public class ContainerEnergizer extends Container{
else if(slot >= inventoryStart && slot <= inventoryEnd){ else if(slot >= inventoryStart && slot <= inventoryEnd){
if(!this.mergeItemStack(newStack, hotbarStart, hotbarEnd+1, false)) return null; if(!this.mergeItemStack(newStack, hotbarStart, hotbarEnd+1, false)) return null;
} }
else if(slot >= inventoryEnd+1 && slot < hotbarEnd+1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false)) return null; else if(slot >= inventoryEnd+1 && slot < hotbarEnd+1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false)){
return null;
}
} }
else if(!this.mergeItemStack(newStack, inventoryStart, hotbarEnd+1, false)) return null; else if(!this.mergeItemStack(newStack, inventoryStart, hotbarEnd+1, false)) return null;
if (newStack.stackSize == 0) theSlot.putStack(null); if(newStack.stackSize == 0){
else theSlot.onSlotChanged(); theSlot.putStack(null);
}
else{
theSlot.onSlotChanged();
}
if (newStack.stackSize == currentStack.stackSize) return null; if(newStack.stackSize == currentStack.stackSize) return null;
theSlot.onPickupFromSlot(player, newStack); theSlot.onPickupFromSlot(player, newStack);
return currentStack; return currentStack;

View file

@ -37,13 +37,13 @@ public class ContainerEnervator extends Container{
this.addSlotToContainer(new Slot(this.enervator, 0, 76, 73)); this.addSlotToContainer(new Slot(this.enervator, 0, 76, 73));
this.addSlotToContainer(new SlotOutput(this.enervator, 1, 76, 42)); this.addSlotToContainer(new SlotOutput(this.enervator, 1, 76, 42));
for (int i = 0; i < 3; i++){ for(int i = 0; i < 3; i++){
for (int j = 0; j < 9; j++){ for(int j = 0; j < 9; j++){
this.addSlotToContainer(new Slot(inventory, j + i * 9 + 9, 8 + j * 18, 97 + i * 18)); this.addSlotToContainer(new Slot(inventory, j+i*9+9, 8+j*18, 97+i*18));
} }
} }
for (int i = 0; i < 9; i++){ for(int i = 0; i < 9; i++){
this.addSlotToContainer(new Slot(inventory, i, 8 + i * 18, 155)); this.addSlotToContainer(new Slot(inventory, i, 8+i*18, 155));
} }
final EntityPlayer finalPlayer = player; final EntityPlayer finalPlayer = player;
for(int i = 0; i < 4; ++i){ for(int i = 0; i < 4; ++i){
@ -53,10 +53,12 @@ public class ContainerEnervator extends Container{
public int getSlotStackLimit(){ public int getSlotStackLimit(){
return 1; return 1;
} }
@Override @Override
public boolean isItemValid(ItemStack stack){ public boolean isItemValid(ItemStack stack){
return stack != null && stack.getItem().isValidArmor(stack, finalI, finalPlayer); return stack != null && stack.getItem().isValidArmor(stack, finalI, finalPlayer);
} }
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public IIcon getBackgroundIconIndex(){ public IIcon getBackgroundIconIndex(){
@ -80,7 +82,7 @@ public class ContainerEnervator extends Container{
Slot theSlot = (Slot)this.inventorySlots.get(slot); Slot theSlot = (Slot)this.inventorySlots.get(slot);
if (theSlot != null && theSlot.getHasStack()){ if(theSlot != null && theSlot.getHasStack()){
ItemStack newStack = theSlot.getStack(); ItemStack newStack = theSlot.getStack();
ItemStack currentStack = newStack.copy(); ItemStack currentStack = newStack.copy();
@ -100,14 +102,20 @@ public class ContainerEnervator extends Container{
else if(slot >= inventoryStart && slot <= inventoryEnd){ else if(slot >= inventoryStart && slot <= inventoryEnd){
if(!this.mergeItemStack(newStack, hotbarStart, hotbarEnd+1, false)) return null; if(!this.mergeItemStack(newStack, hotbarStart, hotbarEnd+1, false)) return null;
} }
else if(slot >= inventoryEnd+1 && slot < hotbarEnd+1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false)) return null; else if(slot >= inventoryEnd+1 && slot < hotbarEnd+1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false)){
return null;
}
} }
else if(!this.mergeItemStack(newStack, inventoryStart, hotbarEnd+1, false)) return null; else if(!this.mergeItemStack(newStack, inventoryStart, hotbarEnd+1, false)) return null;
if (newStack.stackSize == 0) theSlot.putStack(null); if(newStack.stackSize == 0){
else theSlot.onSlotChanged(); theSlot.putStack(null);
}
else{
theSlot.onSlotChanged();
}
if (newStack.stackSize == currentStack.stackSize) return null; if(newStack.stackSize == currentStack.stackSize) return null;
theSlot.onPickupFromSlot(player, newStack); theSlot.onPickupFromSlot(player, newStack);
return currentStack; return currentStack;

View file

@ -28,13 +28,13 @@ public class ContainerFeeder extends Container{
this.tileFeeder = (TileEntityFeeder)tile; this.tileFeeder = (TileEntityFeeder)tile;
this.addSlotToContainer(new Slot(this.tileFeeder, 0, 80, 45)); this.addSlotToContainer(new Slot(this.tileFeeder, 0, 80, 45));
for (int i = 0; i < 3; i++){ for(int i = 0; i < 3; i++){
for (int j = 0; j < 9; j++){ for(int j = 0; j < 9; j++){
this.addSlotToContainer(new Slot(inventory, j + i * 9 + 9, 8 + j * 18, 74 + i * 18)); this.addSlotToContainer(new Slot(inventory, j+i*9+9, 8+j*18, 74+i*18));
} }
} }
for (int i = 0; i < 9; i++){ for(int i = 0; i < 9; i++){
this.addSlotToContainer(new Slot(inventory, i, 8 + i * 18, 132)); this.addSlotToContainer(new Slot(inventory, i, 8+i*18, 132));
} }
} }
@ -52,7 +52,7 @@ public class ContainerFeeder extends Container{
Slot theSlot = (Slot)this.inventorySlots.get(slot); Slot theSlot = (Slot)this.inventorySlots.get(slot);
if (theSlot != null && theSlot.getHasStack()){ if(theSlot != null && theSlot.getHasStack()){
ItemStack newStack = theSlot.getStack(); ItemStack newStack = theSlot.getStack();
ItemStack currentStack = newStack.copy(); ItemStack currentStack = newStack.copy();
@ -64,16 +64,21 @@ public class ContainerFeeder extends Container{
if(slot >= inventoryStart && slot <= inventoryEnd){ if(slot >= inventoryStart && slot <= inventoryEnd){
if(!this.mergeItemStack(newStack, hotbarStart, hotbarEnd+1, false)) return null; if(!this.mergeItemStack(newStack, hotbarStart, hotbarEnd+1, false)) return null;
} }
else if(slot >= inventoryEnd+1 && slot < hotbarEnd+1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false)) else if(slot >= inventoryEnd+1 && slot < hotbarEnd+1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false)){
return null; return null;
} }
} }
}
else if(!this.mergeItemStack(newStack, inventoryStart, hotbarEnd+1, false)) return null; else if(!this.mergeItemStack(newStack, inventoryStart, hotbarEnd+1, false)) return null;
if (newStack.stackSize == 0) theSlot.putStack(null); if(newStack.stackSize == 0){
else theSlot.onSlotChanged(); theSlot.putStack(null);
}
else{
theSlot.onSlotChanged();
}
if (newStack.stackSize == currentStack.stackSize) return null; if(newStack.stackSize == currentStack.stackSize) return null;
theSlot.onPickupFromSlot(player, newStack); theSlot.onPickupFromSlot(player, newStack);
return currentStack; return currentStack;

View file

@ -36,13 +36,13 @@ public class ContainerFermentingBarrel extends Container{
this.addSlotToContainer(new Slot(this.barrel, 2, 118, 74)); this.addSlotToContainer(new Slot(this.barrel, 2, 118, 74));
this.addSlotToContainer(new SlotOutput(this.barrel, 3, 118, 43)); this.addSlotToContainer(new SlotOutput(this.barrel, 3, 118, 43));
for (int i = 0; i < 3; i++){ for(int i = 0; i < 3; i++){
for (int j = 0; j < 9; j++){ for(int j = 0; j < 9; j++){
this.addSlotToContainer(new Slot(inventory, j + i * 9 + 9, 8 + j * 18, 97 + i * 18)); this.addSlotToContainer(new Slot(inventory, j+i*9+9, 8+j*18, 97+i*18));
} }
} }
for (int i = 0; i < 9; i++){ for(int i = 0; i < 9; i++){
this.addSlotToContainer(new Slot(inventory, i, 8 + i * 18, 155)); this.addSlotToContainer(new Slot(inventory, i, 8+i*18, 155));
} }
} }
@ -60,7 +60,7 @@ public class ContainerFermentingBarrel extends Container{
Slot theSlot = (Slot)this.inventorySlots.get(slot); Slot theSlot = (Slot)this.inventorySlots.get(slot);
if (theSlot != null && theSlot.getHasStack()){ if(theSlot != null && theSlot.getHasStack()){
ItemStack newStack = theSlot.getStack(); ItemStack newStack = theSlot.getStack();
ItemStack currentStack = newStack.copy(); ItemStack currentStack = newStack.copy();
@ -78,14 +78,20 @@ public class ContainerFermentingBarrel extends Container{
else if(slot >= inventoryStart && slot <= inventoryEnd){ else if(slot >= inventoryStart && slot <= inventoryEnd){
if(!this.mergeItemStack(newStack, hotbarStart, hotbarEnd+1, false)) return null; if(!this.mergeItemStack(newStack, hotbarStart, hotbarEnd+1, false)) return null;
} }
else if(slot >= inventoryEnd+1 && slot < hotbarEnd+1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false)) return null; else if(slot >= inventoryEnd+1 && slot < hotbarEnd+1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false)){
return null;
}
} }
else if(!this.mergeItemStack(newStack, inventoryStart, hotbarEnd+1, false)) return null; else if(!this.mergeItemStack(newStack, inventoryStart, hotbarEnd+1, false)) return null;
if (newStack.stackSize == 0) theSlot.putStack(null); if(newStack.stackSize == 0){
else theSlot.onSlotChanged(); theSlot.putStack(null);
}
else{
theSlot.onSlotChanged();
}
if (newStack.stackSize == currentStack.stackSize) return null; if(newStack.stackSize == currentStack.stackSize) return null;
theSlot.onPickupFromSlot(player, newStack); theSlot.onPickupFromSlot(player, newStack);
return currentStack; return currentStack;

View file

@ -32,13 +32,13 @@ public class ContainerFluidCollector extends Container{
this.addSlotToContainer(new Slot(collector, 0, 90, 73)); this.addSlotToContainer(new Slot(collector, 0, 90, 73));
this.addSlotToContainer(new SlotOutput(collector, 1, 90, 42)); this.addSlotToContainer(new SlotOutput(collector, 1, 90, 42));
for (int i = 0; i < 3; i++){ for(int i = 0; i < 3; i++){
for (int j = 0; j < 9; j++){ for(int j = 0; j < 9; j++){
this.addSlotToContainer(new Slot(inventory, j + i * 9 + 9, 8 + j * 18, 97 + i * 18)); this.addSlotToContainer(new Slot(inventory, j+i*9+9, 8+j*18, 97+i*18));
} }
} }
for (int i = 0; i < 9; i++){ for(int i = 0; i < 9; i++){
this.addSlotToContainer(new Slot(inventory, i, 8 + i * 18, 155)); this.addSlotToContainer(new Slot(inventory, i, 8+i*18, 155));
} }
} }
@ -56,7 +56,7 @@ public class ContainerFluidCollector extends Container{
Slot theSlot = (Slot)this.inventorySlots.get(slot); Slot theSlot = (Slot)this.inventorySlots.get(slot);
if (theSlot != null && theSlot.getHasStack()){ if(theSlot != null && theSlot.getHasStack()){
ItemStack newStack = theSlot.getStack(); ItemStack newStack = theSlot.getStack();
ItemStack currentStack = newStack.copy(); ItemStack currentStack = newStack.copy();
@ -76,14 +76,20 @@ public class ContainerFluidCollector extends Container{
else if(slot >= inventoryStart && slot <= inventoryEnd){ else if(slot >= inventoryStart && slot <= inventoryEnd){
if(!this.mergeItemStack(newStack, hotbarStart, hotbarEnd+1, false)) return null; if(!this.mergeItemStack(newStack, hotbarStart, hotbarEnd+1, false)) return null;
} }
else if(slot >= inventoryEnd+1 && slot < hotbarEnd+1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false)) return null; else if(slot >= inventoryEnd+1 && slot < hotbarEnd+1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false)){
return null;
}
} }
else if(!this.mergeItemStack(newStack, inventoryStart, hotbarEnd+1, false)) return null; else if(!this.mergeItemStack(newStack, inventoryStart, hotbarEnd+1, false)) return null;
if (newStack.stackSize == 0) theSlot.putStack(null); if(newStack.stackSize == 0){
else theSlot.onSlotChanged(); theSlot.putStack(null);
}
else{
theSlot.onSlotChanged();
}
if (newStack.stackSize == currentStack.stackSize) return null; if(newStack.stackSize == currentStack.stackSize) return null;
theSlot.onPickupFromSlot(player, newStack); theSlot.onPickupFromSlot(player, newStack);
return currentStack; return currentStack;

View file

@ -34,13 +34,13 @@ public class ContainerFurnaceDouble extends Container{
this.addSlotToContainer(new Slot(this.tileFurnace, TileEntityFurnaceDouble.SLOT_INPUT_2, 109, 21)); this.addSlotToContainer(new Slot(this.tileFurnace, TileEntityFurnaceDouble.SLOT_INPUT_2, 109, 21));
this.addSlotToContainer(new SlotFurnace(inventory.player, this.tileFurnace, TileEntityFurnaceDouble.SLOT_OUTPUT_2, 108, 69)); this.addSlotToContainer(new SlotFurnace(inventory.player, this.tileFurnace, TileEntityFurnaceDouble.SLOT_OUTPUT_2, 108, 69));
for (int i = 0; i < 3; i++){ for(int i = 0; i < 3; i++){
for (int j = 0; j < 9; j++){ for(int j = 0; j < 9; j++){
this.addSlotToContainer(new Slot(inventory, j + i * 9 + 9, 8 + j * 18, 97 + i * 18)); this.addSlotToContainer(new Slot(inventory, j+i*9+9, 8+j*18, 97+i*18));
} }
} }
for (int i = 0; i < 9; i++){ for(int i = 0; i < 9; i++){
this.addSlotToContainer(new Slot(inventory, i, 8 + i * 18, 155)); this.addSlotToContainer(new Slot(inventory, i, 8+i*18, 155));
} }
} }
@ -58,7 +58,7 @@ public class ContainerFurnaceDouble extends Container{
Slot theSlot = (Slot)this.inventorySlots.get(slot); Slot theSlot = (Slot)this.inventorySlots.get(slot);
if (theSlot != null && theSlot.getHasStack()){ if(theSlot != null && theSlot.getHasStack()){
ItemStack newStack = theSlot.getStack(); ItemStack newStack = theSlot.getStack();
ItemStack currentStack = newStack.copy(); ItemStack currentStack = newStack.copy();
@ -72,7 +72,9 @@ public class ContainerFurnaceDouble extends Container{
//Shift from Inventory //Shift from Inventory
if(FurnaceRecipes.smelting().getSmeltingResult(newStack) != null){ if(FurnaceRecipes.smelting().getSmeltingResult(newStack) != null){
if(!this.mergeItemStack(newStack, TileEntityFurnaceDouble.SLOT_INPUT_1, TileEntityFurnaceDouble.SLOT_INPUT_1+1, false)){ if(!this.mergeItemStack(newStack, TileEntityFurnaceDouble.SLOT_INPUT_1, TileEntityFurnaceDouble.SLOT_INPUT_1+1, false)){
if(!this.mergeItemStack(newStack, TileEntityFurnaceDouble.SLOT_INPUT_2, TileEntityFurnaceDouble.SLOT_INPUT_2+1, false)) return null; if(!this.mergeItemStack(newStack, TileEntityFurnaceDouble.SLOT_INPUT_2, TileEntityFurnaceDouble.SLOT_INPUT_2+1, false)){
return null;
}
} }
} }
// //
@ -80,14 +82,20 @@ public class ContainerFurnaceDouble extends Container{
else if(slot >= inventoryStart && slot <= inventoryEnd){ else if(slot >= inventoryStart && slot <= inventoryEnd){
if(!this.mergeItemStack(newStack, hotbarStart, hotbarEnd+1, false)) return null; if(!this.mergeItemStack(newStack, hotbarStart, hotbarEnd+1, false)) return null;
} }
else if(slot >= inventoryEnd+1 && slot < hotbarEnd+1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false)) return null; else if(slot >= inventoryEnd+1 && slot < hotbarEnd+1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false)){
return null;
}
} }
else if(!this.mergeItemStack(newStack, inventoryStart, hotbarEnd+1, false)) return null; else if(!this.mergeItemStack(newStack, inventoryStart, hotbarEnd+1, false)) return null;
if (newStack.stackSize == 0) theSlot.putStack(null); if(newStack.stackSize == 0){
else theSlot.onSlotChanged(); theSlot.putStack(null);
}
else{
theSlot.onSlotChanged();
}
if (newStack.stackSize == currentStack.stackSize) return null; if(newStack.stackSize == currentStack.stackSize) return null;
theSlot.onPickupFromSlot(player, newStack); theSlot.onPickupFromSlot(player, newStack);
return currentStack; return currentStack;

View file

@ -27,19 +27,19 @@ public class ContainerGiantChest extends Container{
public ContainerGiantChest(InventoryPlayer inventory, TileEntityBase tile){ public ContainerGiantChest(InventoryPlayer inventory, TileEntityBase tile){
this.tileChest = (TileEntityGiantChest)tile; this.tileChest = (TileEntityGiantChest)tile;
for (int i = 0; i < 9; i++){ for(int i = 0; i < 9; i++){
for (int j = 0; j < 13; j++){ for(int j = 0; j < 13; j++){
this.addSlotToContainer(new Slot(this.tileChest, j + (i*13), 5 + j * 18, 5 + i * 18)); this.addSlotToContainer(new Slot(this.tileChest, j+(i*13), 5+j*18, 5+i*18));
} }
} }
for (int i = 0; i < 3; i++){ for(int i = 0; i < 3; i++){
for (int j = 0; j < 9; j++){ for(int j = 0; j < 9; j++){
this.addSlotToContainer(new Slot(inventory, j + i * 9 + 9, 33 + 8 + j * 18, 172 + 4 + i * 18)); this.addSlotToContainer(new Slot(inventory, j+i*9+9, 33+8+j*18, 172+4+i*18));
} }
} }
for (int i = 0; i < 9; i++){ for(int i = 0; i < 9; i++){
this.addSlotToContainer(new Slot(inventory, i, 33 + 8 + i * 18, 172 + 62)); this.addSlotToContainer(new Slot(inventory, i, 33+8+i*18, 172+62));
} }
} }
@ -57,7 +57,7 @@ public class ContainerGiantChest extends Container{
Slot theSlot = (Slot)this.inventorySlots.get(slot); Slot theSlot = (Slot)this.inventorySlots.get(slot);
if (theSlot != null && theSlot.getHasStack()){ if(theSlot != null && theSlot.getHasStack()){
ItemStack newStack = theSlot.getStack(); ItemStack newStack = theSlot.getStack();
ItemStack currentStack = newStack.copy(); ItemStack currentStack = newStack.copy();
@ -69,16 +69,21 @@ public class ContainerGiantChest extends Container{
if(slot >= inventoryStart && slot <= inventoryEnd){ if(slot >= inventoryStart && slot <= inventoryEnd){
if(!this.mergeItemStack(newStack, hotbarStart, hotbarEnd+1, false)) return null; if(!this.mergeItemStack(newStack, hotbarStart, hotbarEnd+1, false)) return null;
} }
else if(slot >= inventoryEnd+1 && slot < hotbarEnd+1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false)) else if(slot >= inventoryEnd+1 && slot < hotbarEnd+1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false)){
return null; return null;
} }
} }
}
else if(!this.mergeItemStack(newStack, inventoryStart, hotbarEnd+1, false)) return null; else if(!this.mergeItemStack(newStack, inventoryStart, hotbarEnd+1, false)) return null;
if (newStack.stackSize == 0) theSlot.putStack(null); if(newStack.stackSize == 0){
else theSlot.onSlotChanged(); theSlot.putStack(null);
}
else{
theSlot.onSlotChanged();
}
if (newStack.stackSize == currentStack.stackSize) return null; if(newStack.stackSize == currentStack.stackSize) return null;
theSlot.onPickupFromSlot(player, newStack); theSlot.onPickupFromSlot(player, newStack);
return currentStack; return currentStack;

View file

@ -40,13 +40,13 @@ public class ContainerGrinder extends Container{
this.addSlotToContainer(new SlotOutput(this.tileGrinder, TileEntityGrinder.SLOT_OUTPUT_2_2, 121, 69)); this.addSlotToContainer(new SlotOutput(this.tileGrinder, TileEntityGrinder.SLOT_OUTPUT_2_2, 121, 69));
} }
for (int i = 0; i < 3; i++){ for(int i = 0; i < 3; i++){
for (int j = 0; j < 9; j++){ for(int j = 0; j < 9; j++){
this.addSlotToContainer(new Slot(inventory, j + i * 9 + 9, 8 + j * 18, 97 + i * 18)); this.addSlotToContainer(new Slot(inventory, j+i*9+9, 8+j*18, 97+i*18));
} }
} }
for (int i = 0; i < 9; i++){ for(int i = 0; i < 9; i++){
this.addSlotToContainer(new Slot(inventory, i, 8 + i * 18, 155)); this.addSlotToContainer(new Slot(inventory, i, 8+i*18, 155));
} }
} }
@ -64,7 +64,7 @@ public class ContainerGrinder extends Container{
Slot theSlot = (Slot)this.inventorySlots.get(slot); Slot theSlot = (Slot)this.inventorySlots.get(slot);
if (theSlot != null && theSlot.getHasStack()){ if(theSlot != null && theSlot.getHasStack()){
ItemStack newStack = theSlot.getStack(); ItemStack newStack = theSlot.getStack();
ItemStack currentStack = newStack.copy(); ItemStack currentStack = newStack.copy();
@ -79,9 +79,13 @@ public class ContainerGrinder extends Container{
if(CrusherRecipeManualRegistry.getOutput(newStack, false) != null){ if(CrusherRecipeManualRegistry.getOutput(newStack, false) != null){
if(!this.mergeItemStack(newStack, TileEntityGrinder.SLOT_INPUT_1, TileEntityGrinder.SLOT_INPUT_1+1, false)){ if(!this.mergeItemStack(newStack, TileEntityGrinder.SLOT_INPUT_1, TileEntityGrinder.SLOT_INPUT_1+1, false)){
if(this.isDouble){ if(this.isDouble){
if(!this.mergeItemStack(newStack, TileEntityGrinder.SLOT_INPUT_2, TileEntityGrinder.SLOT_INPUT_2+1, false)) return null; if(!this.mergeItemStack(newStack, TileEntityGrinder.SLOT_INPUT_2, TileEntityGrinder.SLOT_INPUT_2+1, false)){
return null;
}
}
else{
return null;
} }
else return null;
} }
} }
// //
@ -89,14 +93,20 @@ public class ContainerGrinder extends Container{
else if(slot >= inventoryStart && slot <= inventoryEnd){ else if(slot >= inventoryStart && slot <= inventoryEnd){
if(!this.mergeItemStack(newStack, hotbarStart, hotbarEnd+1, false)) return null; if(!this.mergeItemStack(newStack, hotbarStart, hotbarEnd+1, false)) return null;
} }
else if(slot >= inventoryEnd+1 && slot < hotbarEnd+1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false)) return null; else if(slot >= inventoryEnd+1 && slot < hotbarEnd+1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false)){
return null;
}
} }
else if(!this.mergeItemStack(newStack, inventoryStart, hotbarEnd+1, false)) return null; else if(!this.mergeItemStack(newStack, inventoryStart, hotbarEnd+1, false)) return null;
if (newStack.stackSize == 0) theSlot.putStack(null); if(newStack.stackSize == 0){
else theSlot.onSlotChanged(); theSlot.putStack(null);
}
else{
theSlot.onSlotChanged();
}
if (newStack.stackSize == currentStack.stackSize) return null; if(newStack.stackSize == currentStack.stackSize) return null;
theSlot.onPickupFromSlot(player, newStack); theSlot.onPickupFromSlot(player, newStack);
return currentStack; return currentStack;

View file

@ -65,7 +65,9 @@ public class ContainerInputter extends Container{
//Calls the Filter's SlotClick function //Calls the Filter's SlotClick function
return ((SlotFilter)getSlot(par1)).slotClick(player, par2); return ((SlotFilter)getSlot(par1)).slotClick(player, par2);
} }
else return super.slotClick(par1, par2, par3, player); else{
return super.slotClick(par1, par2, par3, player);
}
} }
@Override @Override
@ -89,14 +91,19 @@ public class ContainerInputter extends Container{
if(slot >= inventoryStart && slot <= inventoryEnd){ if(slot >= inventoryStart && slot <= inventoryEnd){
if(!this.mergeItemStack(newStack, hotbarStart, hotbarEnd+1, false)) return null; if(!this.mergeItemStack(newStack, hotbarStart, hotbarEnd+1, false)) return null;
} }
else if(slot >= inventoryEnd+1 && slot < hotbarEnd+1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false)) else if(slot >= inventoryEnd+1 && slot < hotbarEnd+1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false)){
return null; return null;
} }
} }
}
else if(!this.mergeItemStack(newStack, inventoryStart, hotbarEnd+1, false)) return null; else if(!this.mergeItemStack(newStack, inventoryStart, hotbarEnd+1, false)) return null;
if(newStack.stackSize == 0) theSlot.putStack(null); if(newStack.stackSize == 0){
else theSlot.onSlotChanged(); theSlot.putStack(null);
}
else{
theSlot.onSlotChanged();
}
if(newStack.stackSize == currentStack.stackSize) return null; if(newStack.stackSize == currentStack.stackSize) return null;
theSlot.onPickupFromSlot(player, newStack); theSlot.onPickupFromSlot(player, newStack);

View file

@ -34,13 +34,13 @@ public class ContainerOilGenerator extends Container{
this.addSlotToContainer(new Slot(this.generator, 0, 98, 74)); this.addSlotToContainer(new Slot(this.generator, 0, 98, 74));
this.addSlotToContainer(new SlotOutput(this.generator, 1, 98, 43)); this.addSlotToContainer(new SlotOutput(this.generator, 1, 98, 43));
for (int i = 0; i < 3; i++){ for(int i = 0; i < 3; i++){
for (int j = 0; j < 9; j++){ for(int j = 0; j < 9; j++){
this.addSlotToContainer(new Slot(inventory, j + i * 9 + 9, 8 + j * 18, 97 + i * 18)); this.addSlotToContainer(new Slot(inventory, j+i*9+9, 8+j*18, 97+i*18));
} }
} }
for (int i = 0; i < 9; i++){ for(int i = 0; i < 9; i++){
this.addSlotToContainer(new Slot(inventory, i, 8 + i * 18, 155)); this.addSlotToContainer(new Slot(inventory, i, 8+i*18, 155));
} }
} }
@ -58,7 +58,7 @@ public class ContainerOilGenerator extends Container{
Slot theSlot = (Slot)this.inventorySlots.get(slot); Slot theSlot = (Slot)this.inventorySlots.get(slot);
if (theSlot != null && theSlot.getHasStack()){ if(theSlot != null && theSlot.getHasStack()){
ItemStack newStack = theSlot.getStack(); ItemStack newStack = theSlot.getStack();
ItemStack currentStack = newStack.copy(); ItemStack currentStack = newStack.copy();
@ -73,14 +73,20 @@ public class ContainerOilGenerator extends Container{
else if(slot >= inventoryStart && slot <= inventoryEnd){ else if(slot >= inventoryStart && slot <= inventoryEnd){
if(!this.mergeItemStack(newStack, hotbarStart, hotbarEnd+1, false)) return null; if(!this.mergeItemStack(newStack, hotbarStart, hotbarEnd+1, false)) return null;
} }
else if(slot >= inventoryEnd+1 && slot < hotbarEnd+1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false)) return null; else if(slot >= inventoryEnd+1 && slot < hotbarEnd+1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false)){
return null;
}
} }
else if(!this.mergeItemStack(newStack, inventoryStart, hotbarEnd+1, false)) return null; else if(!this.mergeItemStack(newStack, inventoryStart, hotbarEnd+1, false)) return null;
if (newStack.stackSize == 0) theSlot.putStack(null); if(newStack.stackSize == 0){
else theSlot.onSlotChanged(); theSlot.putStack(null);
}
else{
theSlot.onSlotChanged();
}
if (newStack.stackSize == currentStack.stackSize) return null; if(newStack.stackSize == currentStack.stackSize) return null;
theSlot.onPickupFromSlot(player, newStack); theSlot.onPickupFromSlot(player, newStack);
return currentStack; return currentStack;

View file

@ -36,13 +36,13 @@ public class ContainerOreMagnet extends Container{
this.addSlotToContainer(new SlotOutput(this.magnet, TileEntityOreMagnet.SLOT_UPGRADE, 71, 43)); this.addSlotToContainer(new SlotOutput(this.magnet, TileEntityOreMagnet.SLOT_UPGRADE, 71, 43));
for (int i = 0; i < 3; i++){ for(int i = 0; i < 3; i++){
for (int j = 0; j < 9; j++){ for(int j = 0; j < 9; j++){
this.addSlotToContainer(new Slot(inventory, j + i * 9 + 9, 8 + j * 18, 97 + i * 18)); this.addSlotToContainer(new Slot(inventory, j+i*9+9, 8+j*18, 97+i*18));
} }
} }
for (int i = 0; i < 9; i++){ for(int i = 0; i < 9; i++){
this.addSlotToContainer(new Slot(inventory, i, 8 + i * 18, 155)); this.addSlotToContainer(new Slot(inventory, i, 8+i*18, 155));
} }
} }
@ -60,7 +60,7 @@ public class ContainerOreMagnet extends Container{
Slot theSlot = (Slot)this.inventorySlots.get(slot); Slot theSlot = (Slot)this.inventorySlots.get(slot);
if (theSlot != null && theSlot.getHasStack()){ if(theSlot != null && theSlot.getHasStack()){
ItemStack newStack = theSlot.getStack(); ItemStack newStack = theSlot.getStack();
ItemStack currentStack = newStack.copy(); ItemStack currentStack = newStack.copy();
@ -68,21 +68,29 @@ public class ContainerOreMagnet extends Container{
if(slot >= inventoryStart){ if(slot >= inventoryStart){
//Shift from Inventory //Shift from Inventory
if(FluidContainerRegistry.containsFluid(newStack, new FluidStack(InitBlocks.fluidOil, 1))){ if(FluidContainerRegistry.containsFluid(newStack, new FluidStack(InitBlocks.fluidOil, 1))){
if(!this.mergeItemStack(newStack, TileEntityOreMagnet.SLOT_OIL_INPUT, TileEntityOreMagnet.SLOT_OIL_INPUT+1, false)) return null; if(!this.mergeItemStack(newStack, TileEntityOreMagnet.SLOT_OIL_INPUT, TileEntityOreMagnet.SLOT_OIL_INPUT+1, false)){
return null;
}
} }
// //
else if(slot >= inventoryStart && slot <= inventoryEnd){ else if(slot >= inventoryStart && slot <= inventoryEnd){
if(!this.mergeItemStack(newStack, hotbarStart, hotbarEnd+1, false)) return null; if(!this.mergeItemStack(newStack, hotbarStart, hotbarEnd+1, false)) return null;
} }
else if(slot >= inventoryEnd+1 && slot < hotbarEnd+1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false)) return null; else if(slot >= inventoryEnd+1 && slot < hotbarEnd+1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false)){
return null;
}
} }
else if(!this.mergeItemStack(newStack, inventoryStart, hotbarEnd+1, false)) return null; else if(!this.mergeItemStack(newStack, inventoryStart, hotbarEnd+1, false)) return null;
if (newStack.stackSize == 0) theSlot.putStack(null); if(newStack.stackSize == 0){
else theSlot.onSlotChanged(); theSlot.putStack(null);
}
else{
theSlot.onSlotChanged();
}
if (newStack.stackSize == currentStack.stackSize) return null; if(newStack.stackSize == currentStack.stackSize) return null;
theSlot.onPickupFromSlot(player, newStack); theSlot.onPickupFromSlot(player, newStack);
return currentStack; return currentStack;

View file

@ -27,19 +27,19 @@ public class ContainerPhantomPlacer extends Container{
public ContainerPhantomPlacer(InventoryPlayer inventory, TileEntityBase tile){ public ContainerPhantomPlacer(InventoryPlayer inventory, TileEntityBase tile){
this.placer = (TileEntityPhantomPlacer)tile; this.placer = (TileEntityPhantomPlacer)tile;
for (int i = 0; i < 3; i++){ for(int i = 0; i < 3; i++){
for (int j = 0; j < 3; j++){ for(int j = 0; j < 3; j++){
this.addSlotToContainer(new Slot(this.placer, j+i*3, 62+j*18, 21+i*18)); this.addSlotToContainer(new Slot(this.placer, j+i*3, 62+j*18, 21+i*18));
} }
} }
for (int i = 0; i < 3; i++){ for(int i = 0; i < 3; i++){
for (int j = 0; j < 9; j++){ for(int j = 0; j < 9; j++){
this.addSlotToContainer(new Slot(inventory, j + i * 9 + 9, 8 + j * 18, 97 + i * 18)); this.addSlotToContainer(new Slot(inventory, j+i*9+9, 8+j*18, 97+i*18));
} }
} }
for (int i = 0; i < 9; i++){ for(int i = 0; i < 9; i++){
this.addSlotToContainer(new Slot(inventory, i, 8 + i * 18, 155)); this.addSlotToContainer(new Slot(inventory, i, 8+i*18, 155));
} }
} }
@ -69,14 +69,19 @@ public class ContainerPhantomPlacer extends Container{
if(slot >= inventoryStart && slot <= inventoryEnd){ if(slot >= inventoryStart && slot <= inventoryEnd){
if(!this.mergeItemStack(newStack, hotbarStart, hotbarEnd+1, false)) return null; if(!this.mergeItemStack(newStack, hotbarStart, hotbarEnd+1, false)) return null;
} }
else if(slot >= inventoryEnd+1 && slot < hotbarEnd+1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false)) else if(slot >= inventoryEnd+1 && slot < hotbarEnd+1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false)){
return null; return null;
} }
} }
}
else if(!this.mergeItemStack(newStack, inventoryStart, hotbarEnd+1, false)) return null; else if(!this.mergeItemStack(newStack, inventoryStart, hotbarEnd+1, false)) return null;
if(newStack.stackSize == 0) theSlot.putStack(null); if(newStack.stackSize == 0){
else theSlot.onSlotChanged(); theSlot.putStack(null);
}
else{
theSlot.onSlotChanged();
}
if(newStack.stackSize == currentStack.stackSize) return null; if(newStack.stackSize == currentStack.stackSize) return null;
theSlot.onPickupFromSlot(player, newStack); theSlot.onPickupFromSlot(player, newStack);

View file

@ -31,13 +31,13 @@ public class ContainerRepairer extends Container{
this.addSlotToContainer(new Slot(this.tileRepairer, TileEntityItemRepairer.SLOT_INPUT, 47, 53)); this.addSlotToContainer(new Slot(this.tileRepairer, TileEntityItemRepairer.SLOT_INPUT, 47, 53));
this.addSlotToContainer(new SlotOutput(this.tileRepairer, TileEntityItemRepairer.SLOT_OUTPUT, 109, 53)); this.addSlotToContainer(new SlotOutput(this.tileRepairer, TileEntityItemRepairer.SLOT_OUTPUT, 109, 53));
for (int i = 0; i < 3; i++){ for(int i = 0; i < 3; i++){
for (int j = 0; j < 9; j++){ for(int j = 0; j < 9; j++){
this.addSlotToContainer(new Slot(inventory, j + i * 9 + 9, 8 + j * 18, 97 + i * 18)); this.addSlotToContainer(new Slot(inventory, j+i*9+9, 8+j*18, 97+i*18));
} }
} }
for (int i = 0; i < 9; i++){ for(int i = 0; i < 9; i++){
this.addSlotToContainer(new Slot(inventory, i, 8 + i * 18, 155)); this.addSlotToContainer(new Slot(inventory, i, 8+i*18, 155));
} }
} }
@ -55,7 +55,7 @@ public class ContainerRepairer extends Container{
Slot theSlot = (Slot)this.inventorySlots.get(slot); Slot theSlot = (Slot)this.inventorySlots.get(slot);
if (theSlot != null && theSlot.getHasStack()){ if(theSlot != null && theSlot.getHasStack()){
ItemStack newStack = theSlot.getStack(); ItemStack newStack = theSlot.getStack();
ItemStack currentStack = newStack.copy(); ItemStack currentStack = newStack.copy();
@ -63,21 +63,29 @@ public class ContainerRepairer extends Container{
if(slot >= inventoryStart){ if(slot >= inventoryStart){
//Shift from Inventory //Shift from Inventory
if(TileEntityItemRepairer.canBeRepaired(newStack)){ if(TileEntityItemRepairer.canBeRepaired(newStack)){
if(!this.mergeItemStack(newStack, TileEntityItemRepairer.SLOT_INPUT, TileEntityItemRepairer.SLOT_INPUT+1, false)) return null; if(!this.mergeItemStack(newStack, TileEntityItemRepairer.SLOT_INPUT, TileEntityItemRepairer.SLOT_INPUT+1, false)){
return null;
}
} }
// //
else if(slot >= inventoryStart && slot <= inventoryEnd){ else if(slot >= inventoryStart && slot <= inventoryEnd){
if(!this.mergeItemStack(newStack, hotbarStart, hotbarEnd+1, false)) return null; if(!this.mergeItemStack(newStack, hotbarStart, hotbarEnd+1, false)) return null;
} }
else if(slot >= inventoryEnd+1 && slot < hotbarEnd+1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false)) return null; else if(slot >= inventoryEnd+1 && slot < hotbarEnd+1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false)){
return null;
}
} }
else if(!this.mergeItemStack(newStack, inventoryStart, hotbarEnd+1, false)) return null; else if(!this.mergeItemStack(newStack, inventoryStart, hotbarEnd+1, false)) return null;
if (newStack.stackSize == 0) theSlot.putStack(null); if(newStack.stackSize == 0){
else theSlot.onSlotChanged(); theSlot.putStack(null);
}
else{
theSlot.onSlotChanged();
}
if (newStack.stackSize == currentStack.stackSize) return null; if(newStack.stackSize == currentStack.stackSize) return null;
theSlot.onPickupFromSlot(player, newStack); theSlot.onPickupFromSlot(player, newStack);
return currentStack; return currentStack;

View file

@ -54,7 +54,7 @@ public class ContainerXPSolidifier extends Container{
Slot theSlot = (Slot)this.inventorySlots.get(slot); Slot theSlot = (Slot)this.inventorySlots.get(slot);
if (theSlot != null && theSlot.getHasStack()){ if(theSlot != null && theSlot.getHasStack()){
ItemStack newStack = theSlot.getStack(); ItemStack newStack = theSlot.getStack();
ItemStack currentStack = newStack.copy(); ItemStack currentStack = newStack.copy();
@ -63,14 +63,20 @@ public class ContainerXPSolidifier extends Container{
if(slot >= inventoryStart && slot <= inventoryEnd){ if(slot >= inventoryStart && slot <= inventoryEnd){
if(!this.mergeItemStack(newStack, hotbarStart, hotbarEnd+1, false)) return null; if(!this.mergeItemStack(newStack, hotbarStart, hotbarEnd+1, false)) return null;
} }
else if(slot >= inventoryEnd+1 && slot < hotbarEnd+1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false)) return null; else if(slot >= inventoryEnd+1 && slot < hotbarEnd+1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false)){
return null;
}
} }
else if(!this.mergeItemStack(newStack, inventoryStart, hotbarEnd+1, false)) return null; else if(!this.mergeItemStack(newStack, inventoryStart, hotbarEnd+1, false)) return null;
if (newStack.stackSize == 0) theSlot.putStack(null); if(newStack.stackSize == 0){
else theSlot.onSlotChanged(); theSlot.putStack(null);
}
else{
theSlot.onSlotChanged();
}
if (newStack.stackSize == currentStack.stackSize) return null; if(newStack.stackSize == currentStack.stackSize) return null;
theSlot.onPickupFromSlot(player, newStack); theSlot.onPickupFromSlot(player, newStack);
return currentStack; return currentStack;

View file

@ -55,29 +55,29 @@ public class GuiCanolaPress extends GuiContainer{
if(this.press.storage.getEnergyStored() > 0){ if(this.press.storage.getEnergyStored() > 0){
int i = this.press.getEnergyScaled(83); int i = this.press.getEnergyScaled(83);
drawTexturedModalRect(this.guiLeft + 43, this.guiTop+89-i, 176, 29, 16, i); drawTexturedModalRect(this.guiLeft+43, this.guiTop+89-i, 176, 29, 16, i);
} }
if(this.press.tank.getFluidAmount() > 0){ if(this.press.tank.getFluidAmount() > 0){
int i = this.press.getTankScaled(83); int i = this.press.getTankScaled(83);
drawTexturedModalRect(this.guiLeft + 117, this.guiTop+89-i, 192, 29, 16, i); drawTexturedModalRect(this.guiLeft+117, this.guiTop+89-i, 192, 29, 16, i);
} }
if(this.press.currentProcessTime > 0){ if(this.press.currentProcessTime > 0){
int i = this.press.getProcessScaled(29); int i = this.press.getProcessScaled(29);
drawTexturedModalRect(this.guiLeft + 83, this.guiTop+32, 176, 0, 12, i); drawTexturedModalRect(this.guiLeft+83, this.guiTop+32, 176, 0, 12, i);
} }
} }
@Override @Override
public void drawScreen(int x, int y, float f){ public void drawScreen(int x, int y, float f){
super.drawScreen(x, y, f); super.drawScreen(x, y, f);
String text1 = this.press.storage.getEnergyStored() + "/" + this.press.storage.getMaxEnergyStored() + " RF"; String text1 = this.press.storage.getEnergyStored()+"/"+this.press.storage.getMaxEnergyStored()+" RF";
if(x >= guiLeft+43 && y >= guiTop+6 && x <= guiLeft+58 && y <= guiTop+88){ if(x >= guiLeft+43 && y >= guiTop+6 && x <= guiLeft+58 && y <= guiTop+88){
this.func_146283_a(Collections.singletonList(text1), x, y); this.func_146283_a(Collections.singletonList(text1), x, y);
} }
String text2 = this.press.tank.getFluidAmount() + "/" + this.press.tank.getCapacity() + " mB " +StringUtil.localize("fluid.canolaoil"); 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){ if(x >= guiLeft+117 && y >= guiTop+6 && x <= guiLeft+132 && y <= guiTop+88){
this.func_146283_a(Collections.singletonList(text2), x, y); this.func_146283_a(Collections.singletonList(text2), x, y);
} }

View file

@ -66,7 +66,7 @@ public class GuiCoalGenerator extends GuiContainer{
@Override @Override
public void drawScreen(int x, int y, float f){ public void drawScreen(int x, int y, float f){
super.drawScreen(x, y, f); super.drawScreen(x, y, f);
String text1 = this.generator.storage.getEnergyStored() + "/" + this.generator.storage.getMaxEnergyStored() + " RF"; String text1 = this.generator.storage.getEnergyStored()+"/"+this.generator.storage.getMaxEnergyStored()+" RF";
if(x >= guiLeft+43 && y >= guiTop+6 && x <= guiLeft+58 && y <= guiTop+88){ if(x >= guiLeft+43 && y >= guiTop+6 && x <= guiLeft+58 && y <= guiTop+88){
this.func_146283_a(Collections.singletonList(text1), x, y); this.func_146283_a(Collections.singletonList(text1), x, y);
} }

View file

@ -110,16 +110,16 @@ public class GuiCoffeeMachine extends GuiContainer{
public void drawScreen(int x, int y, float f){ public void drawScreen(int x, int y, float f){
super.drawScreen(x, y, f); super.drawScreen(x, y, f);
String text1 = this.machine.storage.getEnergyStored() + "/" + this.machine.storage.getMaxEnergyStored() + " RF"; String text1 = this.machine.storage.getEnergyStored()+"/"+this.machine.storage.getMaxEnergyStored()+" RF";
if(x >= guiLeft+16 && y >= guiTop+5 && x <= guiLeft+23 && y <= guiTop+89){ if(x >= guiLeft+16 && y >= guiTop+5 && x <= guiLeft+23 && y <= guiTop+89){
this.func_146283_a(Collections.singletonList(text1), x, y); 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()); 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){ if(x >= guiLeft+27 && y >= guiTop+5 && x <= guiLeft+33 && y <= guiTop+70){
this.func_146283_a(Collections.singletonList(text3), x, y); 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"); 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){ if(x >= guiLeft+40 && y >= guiTop+25 && x <= guiLeft+49 && y <= guiTop+56){
this.func_146283_a(Collections.singletonList(text2), x, y); this.func_146283_a(Collections.singletonList(text2), x, y);
} }

View file

@ -61,7 +61,7 @@ public class GuiEnergizer extends GuiContainer{
@Override @Override
public void drawScreen(int x, int y, float f){ public void drawScreen(int x, int y, float f){
super.drawScreen(x, y, f); super.drawScreen(x, y, f);
String text1 = this.energizer.storage.getEnergyStored() + "/" + this.energizer.storage.getMaxEnergyStored() + " RF"; String text1 = this.energizer.storage.getEnergyStored()+"/"+this.energizer.storage.getMaxEnergyStored()+" RF";
if(x >= guiLeft+57 && y >= guiTop+6 && x <= guiLeft+72 && y <= guiTop+88){ if(x >= guiLeft+57 && y >= guiTop+6 && x <= guiLeft+72 && y <= guiTop+88){
this.func_146283_a(Collections.singletonList(text1), x, y); this.func_146283_a(Collections.singletonList(text1), x, y);
} }

View file

@ -61,7 +61,7 @@ public class GuiEnervator extends GuiContainer{
@Override @Override
public void drawScreen(int x, int y, float f){ public void drawScreen(int x, int y, float f){
super.drawScreen(x, y, f); super.drawScreen(x, y, f);
String text1 = this.enervator.storage.getEnergyStored() + "/" + this.enervator.storage.getMaxEnergyStored() + " RF"; String text1 = this.enervator.storage.getEnergyStored()+"/"+this.enervator.storage.getMaxEnergyStored()+" RF";
if(x >= guiLeft+57 && y >= guiTop+6 && x <= guiLeft+72 && y <= guiTop+88){ if(x >= guiLeft+57 && y >= guiTop+6 && x <= guiLeft+72 && y <= guiTop+88){
this.func_146283_a(Collections.singletonList(text1), x, y); this.func_146283_a(Collections.singletonList(text1), x, y);
} }

View file

@ -57,12 +57,14 @@ public class GuiFeeder extends GuiContainer{
this.drawTexturedModalRect(guiLeft+85, guiTop+42-i, 181, 19+19-i, 6, 20); this.drawTexturedModalRect(guiLeft+85, guiTop+42-i, 181, 19+19-i, 6, 20);
} }
if(this.tileFeeder.currentAnimalAmount >= 2 && this.tileFeeder.currentAnimalAmount < ConfigIntValues.FEEDER_THRESHOLD.getValue()) if(this.tileFeeder.currentAnimalAmount >= 2 && this.tileFeeder.currentAnimalAmount < ConfigIntValues.FEEDER_THRESHOLD.getValue()){
this.drawTexturedModalRect(guiLeft+70, guiTop+31, 192, 16, 8, 8); this.drawTexturedModalRect(guiLeft+70, guiTop+31, 192, 16, 8, 8);
}
if(this.tileFeeder.currentAnimalAmount >= ConfigIntValues.FEEDER_THRESHOLD.getValue()) if(this.tileFeeder.currentAnimalAmount >= ConfigIntValues.FEEDER_THRESHOLD.getValue()){
this.drawTexturedModalRect(guiLeft+70, guiTop+31, 192, 24, 8, 8); this.drawTexturedModalRect(guiLeft+70, guiTop+31, 192, 24, 8, 8);
} }
}
@Override @Override
public void drawScreen(int x, int y, float f){ public void drawScreen(int x, int y, float f){

View file

@ -55,12 +55,12 @@ public class GuiFermentingBarrel extends GuiContainer{
if(this.press.canolaTank.getFluidAmount() > 0){ if(this.press.canolaTank.getFluidAmount() > 0){
int i = this.press.getCanolaTankScaled(83); int i = this.press.getCanolaTankScaled(83);
drawTexturedModalRect(this.guiLeft + 61, this.guiTop+89-i, 192, 29, 16, i); drawTexturedModalRect(this.guiLeft+61, this.guiTop+89-i, 192, 29, 16, i);
} }
if(this.press.oilTank.getFluidAmount() > 0){ if(this.press.oilTank.getFluidAmount() > 0){
int i = this.press.getOilTankScaled(83); int i = this.press.getOilTankScaled(83);
drawTexturedModalRect(this.guiLeft + 99, this.guiTop+89-i, 176, 29, 16, i); drawTexturedModalRect(this.guiLeft+99, this.guiTop+89-i, 176, 29, 16, i);
} }
if(this.press.currentProcessTime > 0){ if(this.press.currentProcessTime > 0){
@ -73,12 +73,12 @@ public class GuiFermentingBarrel extends GuiContainer{
public void drawScreen(int x, int y, float f){ public void drawScreen(int x, int y, float f){
super.drawScreen(x, y, f); super.drawScreen(x, y, f);
String text1 = this.press.canolaTank.getFluidAmount() + "/" + this.press.canolaTank.getCapacity() + " mB " +StringUtil.localize("fluid.canolaoil"); 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){ if(x >= guiLeft+61 && y >= guiTop+6 && x <= guiLeft+76 && y <= guiTop+88){
this.func_146283_a(Collections.singletonList(text1), x, y); this.func_146283_a(Collections.singletonList(text1), x, y);
} }
String text2 = this.press.oilTank.getFluidAmount() + "/" + this.press.oilTank.getCapacity() + " mB " +StringUtil.localize("fluid.oil"); 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){ if(x >= guiLeft+99 && y >= guiTop+6 && x <= guiLeft+114 && y <= guiTop+88){
this.func_146283_a(Collections.singletonList(text2), x, y); this.func_146283_a(Collections.singletonList(text2), x, y);
} }

View file

@ -62,7 +62,7 @@ public class GuiFluidCollector extends GuiContainer{
public void drawScreen(int x, int y, float f){ public void drawScreen(int x, int y, float f){
super.drawScreen(x, y, 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() : ""); 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){ if(x >= guiLeft+68 && y >= guiTop+6 && x <= guiLeft+83 && y <= guiTop+88){
this.func_146283_a(Collections.singletonList(text2), x, y); this.func_146283_a(Collections.singletonList(text2), x, y);
} }

View file

@ -61,14 +61,14 @@ public class GuiFurnaceDouble extends GuiContainer{
} }
if(this.tileFurnace.secondSmeltTime > 0){ if(this.tileFurnace.secondSmeltTime > 0){
int i = this.tileFurnace.getSecondTimeToScale(23); int i = this.tileFurnace.getSecondTimeToScale(23);
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 @Override
public void drawScreen(int x, int y, float f){ public void drawScreen(int x, int y, float f){
super.drawScreen(x, y, f); super.drawScreen(x, y, f);
String text = this.tileFurnace.storage.getEnergyStored() + "/" + this.tileFurnace.storage.getMaxEnergyStored() + " RF"; String text = this.tileFurnace.storage.getEnergyStored()+"/"+this.tileFurnace.storage.getMaxEnergyStored()+" RF";
if(x >= guiLeft+28 && y >= guiTop+6 && x <= guiLeft+43 && y <= guiTop+88){ if(x >= guiLeft+28 && y >= guiTop+6 && x <= guiLeft+43 && y <= guiTop+88){
this.func_146283_a(Collections.singletonList(text), x, y); this.func_146283_a(Collections.singletonList(text), x, y);
} }

View file

@ -66,7 +66,7 @@ public class GuiGrinder extends GuiContainer{
if(this.tileGrinder.storage.getEnergyStored() > 0){ if(this.tileGrinder.storage.getEnergyStored() > 0){
int i = this.tileGrinder.getEnergyScaled(83); int i = this.tileGrinder.getEnergyScaled(83);
drawTexturedModalRect(this.guiLeft + (isDouble ? 14 : 43), this.guiTop+89-i, 176, (isDouble ? 44 : 23), 16, i); drawTexturedModalRect(this.guiLeft+(isDouble ? 14 : 43), this.guiTop+89-i, 176, (isDouble ? 44 : 23), 16, i);
} }
if(this.tileGrinder.firstCrushTime > 0){ if(this.tileGrinder.firstCrushTime > 0){
int i = this.tileGrinder.getFirstTimeToScale(23); int i = this.tileGrinder.getFirstTimeToScale(23);
@ -75,7 +75,7 @@ public class GuiGrinder extends GuiContainer{
if(this.isDouble){ if(this.isDouble){
if(this.tileGrinder.secondCrushTime > 0){ if(this.tileGrinder.secondCrushTime > 0){
int i = this.tileGrinder.getSecondTimeToScale(23); int i = this.tileGrinder.getSecondTimeToScale(23);
this.drawTexturedModalRect(this.guiLeft + 101, this.guiTop + 40, 176, 22, 24, i); this.drawTexturedModalRect(this.guiLeft+101, this.guiTop+40, 176, 22, 24, i);
} }
} }
} }
@ -83,7 +83,7 @@ public class GuiGrinder extends GuiContainer{
@Override @Override
public void drawScreen(int x, int y, float f){ public void drawScreen(int x, int y, float f){
super.drawScreen(x, y, f); super.drawScreen(x, y, f);
String text = this.tileGrinder.storage.getEnergyStored() + "/" + this.tileGrinder.storage.getMaxEnergyStored() + " RF"; 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)){ 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); this.func_146283_a(Collections.singletonList(text), x, y);
} }

View file

@ -265,7 +265,9 @@ public class GuiInputter extends GuiContainer{
this.setVariable(this.fieldPullStart, 2); this.setVariable(this.fieldPullStart, 2);
this.setVariable(this.fieldPullEnd, 3); this.setVariable(this.fieldPullEnd, 3);
} }
else PacketHandler.theNetwork.sendToServer(new PacketGuiButton(x, y, z, world, button.id, Minecraft.getMinecraft().thePlayer)); else{
PacketHandler.theNetwork.sendToServer(new PacketGuiButton(x, y, z, world, button.id, Minecraft.getMinecraft().thePlayer));
}
} }
public static class SmallerButton extends GuiButton{ public static class SmallerButton extends GuiButton{
@ -290,8 +292,12 @@ public class GuiInputter extends GuiContainer{
this.mouseDragged(mc, x, y); this.mouseDragged(mc, x, y);
int color = 14737632; int color = 14737632;
if(packedFGColour != 0) color = packedFGColour; if(packedFGColour != 0){
else if(!this.enabled) color = 10526880; color = packedFGColour;
}
else if(!this.enabled){
color = 10526880;
}
else if(this.field_146123_n) color = 16777120; else if(this.field_146123_n) color = 16777120;
this.drawCenteredString(mc.fontRenderer, this.displayString, this.xPosition+this.width/2, this.yPosition+(this.height-8)/2, color); this.drawCenteredString(mc.fontRenderer, this.displayString, this.xPosition+this.width/2, this.yPosition+(this.height-8)/2, color);

View file

@ -72,11 +72,11 @@ public class GuiOilGenerator extends GuiContainer{
@Override @Override
public void drawScreen(int x, int y, float f){ public void drawScreen(int x, int y, float f){
super.drawScreen(x, y, f); super.drawScreen(x, y, f);
String text1 = this.generator.storage.getEnergyStored() + "/" + this.generator.storage.getMaxEnergyStored() + " RF"; String text1 = this.generator.storage.getEnergyStored()+"/"+this.generator.storage.getMaxEnergyStored()+" RF";
if(x >= guiLeft+43 && y >= guiTop+6 && x <= guiLeft+58 && y <= guiTop+88){ if(x >= guiLeft+43 && y >= guiTop+6 && x <= guiLeft+58 && y <= guiTop+88){
this.func_146283_a(Collections.singletonList(text1), x, y); this.func_146283_a(Collections.singletonList(text1), x, y);
} }
String text2 = this.generator.tank.getFluidAmount() + "/" + this.generator.tank.getCapacity() + " mB " +StringUtil.localize("fluid.oil"); 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){ if(x >= guiLeft+117 && y >= guiTop+6 && x <= guiLeft+132 && y <= guiTop+88){
this.func_146283_a(Collections.singletonList(text2), x, y); this.func_146283_a(Collections.singletonList(text2), x, y);
} }

View file

@ -68,11 +68,11 @@ public class GuiOreMagnet extends GuiContainer{
@Override @Override
public void drawScreen(int x, int y, float f){ public void drawScreen(int x, int y, float f){
super.drawScreen(x, y, f); super.drawScreen(x, y, f);
String text1 = this.magnet.storage.getEnergyStored() + "/" + this.magnet.storage.getMaxEnergyStored() + " RF"; String text1 = this.magnet.storage.getEnergyStored()+"/"+this.magnet.storage.getMaxEnergyStored()+" RF";
if(x >= guiLeft+43 && y >= guiTop+6 && x <= guiLeft+58 && y <= guiTop+88){ if(x >= guiLeft+43 && y >= guiTop+6 && x <= guiLeft+58 && y <= guiTop+88){
this.func_146283_a(Collections.singletonList(text1), x, y); this.func_146283_a(Collections.singletonList(text1), x, y);
} }
String text2 = this.magnet.tank.getFluidAmount() + "/" + this.magnet.tank.getCapacity() + " mB " +StringUtil.localize("fluid.oil"); 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){ if(x >= guiLeft+117 && y >= guiTop+6 && x <= guiLeft+132 && y <= guiTop+88){
this.func_146283_a(Collections.singletonList(text2), x, y); this.func_146283_a(Collections.singletonList(text2), x, y);
} }

View file

@ -64,7 +64,7 @@ public class GuiRepairer extends GuiContainer{
@Override @Override
public void drawScreen(int x, int y, float f){ public void drawScreen(int x, int y, float f){
super.drawScreen(x, y, f); super.drawScreen(x, y, f);
String text = this.tileRepairer.storage.getEnergyStored() + "/" + this.tileRepairer.storage.getMaxEnergyStored() + " RF"; String text = this.tileRepairer.storage.getEnergyStored()+"/"+this.tileRepairer.storage.getMaxEnergyStored()+" RF";
if(x >= guiLeft+28 && y >= guiTop+6 && x <= guiLeft+43 && y <= guiTop+88){ if(x >= guiLeft+28 && y >= guiTop+6 && x <= guiLeft+43 && y <= guiTop+88){
this.func_146283_a(Collections.singletonList(text), x, y); this.func_146283_a(Collections.singletonList(text), x, y);
} }

View file

@ -94,7 +94,9 @@ public class GuiSmileyCloud extends GuiContainer{
this.nameField.textboxKeyTyped(theChar, key); this.nameField.textboxKeyTyped(theChar, key);
} }
} }
else super.keyTyped(theChar, key); else{
super.keyTyped(theChar, key);
}
} }
public void setVariable(GuiTextField field){ public void setVariable(GuiTextField field){

View file

@ -24,6 +24,7 @@ public class SlotFilter extends Slot{
/** /**
* Gets called when the Filter Slot is clicked * Gets called when the Filter Slot is clicked
* Needs to be called in slotClick() in the Container! * Needs to be called in slotClick() in the Container!
*
* @param player The player * @param player The player
* @param button The button pressed (1 is right mouse button!) * @param button The button pressed (1 is right mouse button!)
* @return Nothing, as the Item didn't really get "transferred" * @return Nothing, as the Item didn't really get "transferred"

View file

@ -64,7 +64,9 @@ public class InitForeignPaxels{
} }
} }
} }
else ModUtil.LOGGER.info(MEKANISM_TOOLS+" not loaded, can't initialize Special AIOTs."); else{
ModUtil.LOGGER.info(MEKANISM_TOOLS+" not loaded, can't initialize Special AIOTs.");
}
} }
//Thermal Foundation //Thermal Foundation
@ -91,7 +93,9 @@ public class InitForeignPaxels{
} }
} }
} }
else ModUtil.LOGGER.info(THERMAL_FOUNDATION+" not loaded, can't initialize Special AIOTs."); else{
ModUtil.LOGGER.info(THERMAL_FOUNDATION+" not loaded, can't initialize Special AIOTs.");
}
} }
} }

View file

@ -52,7 +52,7 @@ public class ItemArmorAA extends ItemArmor implements IActAddItemOrBlock{
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconReg){ public void registerIcons(IIconRegister iconReg){
this.itemIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName()); this.itemIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName());
} }
@Override @Override

View file

@ -41,7 +41,7 @@ public class ItemBattery extends ItemEnergy{
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconReg){ public void registerIcons(IIconRegister iconReg){
this.itemIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName()); this.itemIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName());
} }
@Override @Override

View file

@ -45,7 +45,7 @@ public class ItemBooklet extends Item implements IActAddItemOrBlock{
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconReg){ public void registerIcons(IIconRegister iconReg){
this.itemIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName()); this.itemIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName());
} }
@Override @Override

View file

@ -45,7 +45,7 @@ public class ItemBucketAA extends ItemBucket implements IActAddItemOrBlock{
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconReg){ public void registerIcons(IIconRegister iconReg){
this.itemIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName()); this.itemIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName());
} }
@Override @Override

View file

@ -41,7 +41,7 @@ public class ItemCoffeeBean extends ItemFood implements IActAddItemOrBlock{
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconReg){ public void registerIcons(IIconRegister iconReg){
this.itemIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName()); this.itemIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName());
} }
@Override @Override

View file

@ -38,12 +38,14 @@ public class ItemCrafterOnAStick extends Item implements IActAddItemOrBlock{
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconReg){ public void registerIcons(IIconRegister iconReg){
this.itemIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName()); this.itemIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName());
} }
@Override @Override
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player){ public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player){
if(!world.isRemote) player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.CRAFTER.ordinal(), world, (int)player.posX, (int)player.posY, (int)player.posZ); if(!world.isRemote){
player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.CRAFTER.ordinal(), world, (int)player.posX, (int)player.posY, (int)player.posZ);
}
return stack; return stack;
} }

View file

@ -67,8 +67,9 @@ public class ItemDrill extends ItemEnergy{
try{ try{
//Places the Block into the World //Places the Block into the World
if(equip.tryPlaceItemIntoWorld(player, world, x, y, z, hitSide, hitX, hitY, hitZ)){ if(equip.tryPlaceItemIntoWorld(player, world, x, y, z, hitSide, hitX, hitY, hitZ)){
if(!player.capabilities.isCreativeMode) if(!player.capabilities.isCreativeMode){
player.inventory.setInventorySlotContents(slot, equip.stackSize <= 0 ? null : equip.copy()); player.inventory.setInventorySlotContents(slot, equip.stackSize <= 0 ? null : equip.copy());
}
//Synchronizes the Client //Synchronizes the Client
player.inventoryContainer.detectAndSendChanges(); player.inventoryContainer.detectAndSendChanges();
return true; return true;
@ -80,7 +81,9 @@ public class ItemDrill extends ItemEnergy{
ModUtil.LOGGER.error("Player "+player.getDisplayName()+" who should place a Block using a Drill at "+player.posX+", "+player.posY+", "+player.posZ+" in World "+world.provider.dimensionId+" threw an Exception! Don't let that happen again!"); ModUtil.LOGGER.error("Player "+player.getDisplayName()+" who should place a Block using a Drill at "+player.posX+", "+player.posY+", "+player.posZ+" in World "+world.provider.dimensionId+" threw an Exception! Don't let that happen again!");
} }
} }
else return true; else{
return true;
}
} }
} }
} }
@ -111,6 +114,7 @@ public class ItemDrill extends ItemEnergy{
/** /**
* Gets the Mining Speed of the Drill * Gets the Mining Speed of the Drill
*
* @param stack The Drill * @param stack The Drill
* @return The Mining Speed depending on the Speed Upgrades * @return The Mining Speed depending on the Speed Upgrades
*/ */
@ -118,16 +122,23 @@ public class ItemDrill extends ItemEnergy{
float efficiency = ConfigFloatValues.DRILL_DAMAGE.getValue(); float efficiency = ConfigFloatValues.DRILL_DAMAGE.getValue();
if(this.getHasUpgrade(stack, ItemDrillUpgrade.UpgradeType.SPEED)){ if(this.getHasUpgrade(stack, ItemDrillUpgrade.UpgradeType.SPEED)){
if(this.getHasUpgrade(stack, ItemDrillUpgrade.UpgradeType.SPEED_II)){ if(this.getHasUpgrade(stack, ItemDrillUpgrade.UpgradeType.SPEED_II)){
if(this.getHasUpgrade(stack, ItemDrillUpgrade.UpgradeType.SPEED_III)) efficiency += 37.0F; if(this.getHasUpgrade(stack, ItemDrillUpgrade.UpgradeType.SPEED_III)){
else efficiency += 25.0F; efficiency += 37.0F;
}
else{
efficiency += 25.0F;
}
}
else{
efficiency += 8.0F;
} }
else efficiency += 8.0F;
} }
return efficiency; return efficiency;
} }
/** /**
* Gets the Energy that is used per Block broken * Gets the Energy that is used per Block broken
*
* @param stack The Drill * @param stack The Drill
* @return The Energy use per Block * @return The Energy use per Block
*/ */
@ -139,28 +150,32 @@ public class ItemDrill extends ItemEnergy{
use += ConfigIntValues.DRILL_SPEED_EXTRA_USE.getValue(); use += ConfigIntValues.DRILL_SPEED_EXTRA_USE.getValue();
if(this.getHasUpgrade(stack, ItemDrillUpgrade.UpgradeType.SPEED_II)){ if(this.getHasUpgrade(stack, ItemDrillUpgrade.UpgradeType.SPEED_II)){
use += ConfigIntValues.DRILL_SPEED_II_EXTRA_USE.getValue(); use += ConfigIntValues.DRILL_SPEED_II_EXTRA_USE.getValue();
if(this.getHasUpgrade(stack, ItemDrillUpgrade.UpgradeType.SPEED_III)) if(this.getHasUpgrade(stack, ItemDrillUpgrade.UpgradeType.SPEED_III)){
use += ConfigIntValues.DRILL_SPEED_III_EXTRA_USE.getValue(); use += ConfigIntValues.DRILL_SPEED_III_EXTRA_USE.getValue();
} }
} }
}
//Silk Touch //Silk Touch
if(this.getHasUpgrade(stack, ItemDrillUpgrade.UpgradeType.SILK_TOUCH)) if(this.getHasUpgrade(stack, ItemDrillUpgrade.UpgradeType.SILK_TOUCH)){
use += ConfigIntValues.DRILL_SILK_EXTRA_USE.getValue(); use += ConfigIntValues.DRILL_SILK_EXTRA_USE.getValue();
}
//Fortune //Fortune
if(this.getHasUpgrade(stack, ItemDrillUpgrade.UpgradeType.FORTUNE)){ if(this.getHasUpgrade(stack, ItemDrillUpgrade.UpgradeType.FORTUNE)){
use += ConfigIntValues.DRILL_FORTUNE_EXTRA_USE.getValue(); use += ConfigIntValues.DRILL_FORTUNE_EXTRA_USE.getValue();
if(this.getHasUpgrade(stack, ItemDrillUpgrade.UpgradeType.FORTUNE_II)) if(this.getHasUpgrade(stack, ItemDrillUpgrade.UpgradeType.FORTUNE_II)){
use += ConfigIntValues.DRILL_FORTUNE_II_EXTRA_USE.getValue(); use += ConfigIntValues.DRILL_FORTUNE_II_EXTRA_USE.getValue();
} }
}
//Size //Size
if(this.getHasUpgrade(stack, ItemDrillUpgrade.UpgradeType.THREE_BY_THREE)){ if(this.getHasUpgrade(stack, ItemDrillUpgrade.UpgradeType.THREE_BY_THREE)){
use += ConfigIntValues.DRILL_THREE_BY_THREE_EXTRA_USE.getValue(); use += ConfigIntValues.DRILL_THREE_BY_THREE_EXTRA_USE.getValue();
if(this.getHasUpgrade(stack, ItemDrillUpgrade.UpgradeType.FIVE_BY_FIVE)) if(this.getHasUpgrade(stack, ItemDrillUpgrade.UpgradeType.FIVE_BY_FIVE)){
use += ConfigIntValues.DRILL_FIVE_BY_FIVE_EXTRA_USE.getValue(); use += ConfigIntValues.DRILL_FIVE_BY_FIVE_EXTRA_USE.getValue();
} }
}
return use; return use;
} }
@ -172,6 +187,7 @@ public class ItemDrill extends ItemEnergy{
/** /**
* Checks if a certain Upgrade is applied * Checks if a certain Upgrade is applied
*
* @param stack The Drill * @param stack The Drill
* @param upgrade The Upgrade to be checked * @param upgrade The Upgrade to be checked
* @return Is the Upgrade applied? * @return Is the Upgrade applied?
@ -182,6 +198,7 @@ public class ItemDrill extends ItemEnergy{
/** /**
* Checks if a certain Upgrade is installed and returns it as an ItemStack * Checks if a certain Upgrade is installed and returns it as an ItemStack
*
* @param stack The Drill * @param stack The Drill
* @param upgrade The Upgrade to be checked * @param upgrade The Upgrade to be checked
* @return The Upgrade, if it's installed * @return The Upgrade, if it's installed
@ -214,6 +231,7 @@ public class ItemDrill extends ItemEnergy{
/** /**
* Writes all of the Slots to NBT * Writes all of the Slots to NBT
*
* @param slots The Slots * @param slots The Slots
* @param stack The Drill * @param stack The Drill
*/ */
@ -240,6 +258,7 @@ public class ItemDrill extends ItemEnergy{
/** /**
* Gets all of the Slots from NBT * Gets all of the Slots from NBT
*
* @param stack The Drill * @param stack The Drill
* @return All of the Slots * @return All of the Slots
*/ */
@ -266,6 +285,7 @@ public class ItemDrill extends ItemEnergy{
/** /**
* Breaks Blocks in a certain Radius * Breaks Blocks in a certain Radius
* Has to be called on both Server and Client * Has to be called on both Server and Client
*
* @param stack The Drill * @param stack The Drill
* @param radius The Radius to break Blocks in (0 means only 1 Block will be broken!) * @param radius The Radius to break Blocks in (0 means only 1 Block will be broken!)
* @param world The World * @param world The World
@ -302,7 +322,9 @@ public class ItemDrill extends ItemEnergy{
if(this.getEnergyStored(stack) >= use){ if(this.getEnergyStored(stack) >= use){
if(!this.tryHarvestBlock(world, x, y, z, false, stack, player, use)) return false; if(!this.tryHarvestBlock(world, x, y, z, false, stack, player, use)) return false;
} }
else return false; else{
return false;
}
//Break Blocks around //Break Blocks around
if(radius > 0){ if(radius > 0){
@ -316,7 +338,9 @@ public class ItemDrill extends ItemEnergy{
this.tryHarvestBlock(world, xPos, yPos, zPos, true, stack, player, use); this.tryHarvestBlock(world, xPos, yPos, zPos, true, stack, player, use);
} }
} }
else return false; else{
return false;
}
} }
} }
} }
@ -329,6 +353,7 @@ public class ItemDrill extends ItemEnergy{
* Tries to harvest a certain Block * Tries to harvest a certain Block
* Breaks the Block, drops Particles etc. * Breaks the Block, drops Particles etc.
* Has to be called on both Server and Client * Has to be called on both Server and Client
*
* @param world The World * @param world The World
* @param xPos The X Position of the Block to break * @param xPos The X Position of the Block to break
* @param yPos The Y Position of the Block to break * @param yPos The Y Position of the Block to break
@ -362,21 +387,27 @@ public class ItemDrill extends ItemEnergy{
int use = this.getEnergyUsePerBlock(stack); int use = this.getEnergyUsePerBlock(stack);
if(this.getEnergyStored(stack) >= use){ if(this.getEnergyStored(stack) >= use){
//Enchants the Drill depending on the Upgrades it has //Enchants the Drill depending on the Upgrades it has
if(this.getHasUpgrade(stack, ItemDrillUpgrade.UpgradeType.SILK_TOUCH)) if(this.getHasUpgrade(stack, ItemDrillUpgrade.UpgradeType.SILK_TOUCH)){
ItemUtil.addEnchantment(stack, Enchantment.silkTouch, 1); ItemUtil.addEnchantment(stack, Enchantment.silkTouch, 1);
}
else{ else{
if(this.getHasUpgrade(stack, ItemDrillUpgrade.UpgradeType.FORTUNE)) if(this.getHasUpgrade(stack, ItemDrillUpgrade.UpgradeType.FORTUNE)){
ItemUtil.addEnchantment(stack, Enchantment.fortune, this.getHasUpgrade(stack, ItemDrillUpgrade.UpgradeType.FORTUNE_II) ? 3 : 1); ItemUtil.addEnchantment(stack, Enchantment.fortune, this.getHasUpgrade(stack, ItemDrillUpgrade.UpgradeType.FORTUNE_II) ? 3 : 1);
} }
}
//Breaks the Blocks //Breaks the Blocks
if(!player.isSneaking() && this.getHasUpgrade(stack, ItemDrillUpgrade.UpgradeType.THREE_BY_THREE)){ if(!player.isSneaking() && this.getHasUpgrade(stack, ItemDrillUpgrade.UpgradeType.THREE_BY_THREE)){
if(this.getHasUpgrade(stack, ItemDrillUpgrade.UpgradeType.FIVE_BY_FIVE)){ if(this.getHasUpgrade(stack, ItemDrillUpgrade.UpgradeType.FIVE_BY_FIVE)){
toReturn = this.breakBlocks(stack, 2, player.worldObj, x, y, z, player); toReturn = this.breakBlocks(stack, 2, player.worldObj, x, y, z, player);
} }
else toReturn = this.breakBlocks(stack, 1, player.worldObj, x, y, z, player); else{
toReturn = this.breakBlocks(stack, 1, player.worldObj, x, y, z, player);
}
}
else{
toReturn = this.breakBlocks(stack, 0, player.worldObj, x, y, z, player);
} }
else toReturn = this.breakBlocks(stack, 0, player.worldObj, x, y, z, player);
//Removes Enchantments added above //Removes Enchantments added above
ItemUtil.removeEnchantment(stack, Enchantment.silkTouch); ItemUtil.removeEnchantment(stack, Enchantment.silkTouch);

View file

@ -78,7 +78,7 @@ public class ItemDrillUpgrade extends Item implements IActAddItemOrBlock{
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconReg){ public void registerIcons(IIconRegister iconReg){
this.itemIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName()); this.itemIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName());
} }
@Override @Override

View file

@ -57,7 +57,7 @@ public class ItemDust extends Item implements IActAddItemOrBlock{
@Override @Override
public String getUnlocalizedName(ItemStack stack){ public String getUnlocalizedName(ItemStack stack){
return this.getUnlocalizedName() + (stack.getItemDamage() >= allDusts.length ? " ERROR!" : allDusts[stack.getItemDamage()].getName()); return this.getUnlocalizedName()+(stack.getItemDamage() >= allDusts.length ? " ERROR!" : allDusts[stack.getItemDamage()].getName());
} }
@Override @Override
@ -74,6 +74,6 @@ public class ItemDust extends Item implements IActAddItemOrBlock{
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconReg){ public void registerIcons(IIconRegister iconReg){
this.itemIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName()); this.itemIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName());
} }
} }

View file

@ -47,7 +47,7 @@ public class ItemFertilizer extends Item implements IActAddItemOrBlock{
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconReg){ public void registerIcons(IIconRegister iconReg){
this.itemIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName()); this.itemIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName());
} }
@Override @Override

View file

@ -70,14 +70,14 @@ public class ItemFoods extends ItemFood implements IActAddItemOrBlock{
@SuppressWarnings("all") @SuppressWarnings("all")
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void getSubItems(Item item, CreativeTabs tab, List list){ public void getSubItems(Item item, CreativeTabs tab, List list){
for (int j = 0; j < allFoods.length; j++){ for(int j = 0; j < allFoods.length; j++){
list.add(new ItemStack(this, 1, j)); list.add(new ItemStack(this, 1, j));
} }
} }
@Override @Override
public String getUnlocalizedName(ItemStack stack){ public String getUnlocalizedName(ItemStack stack){
return this.getUnlocalizedName() + (stack.getItemDamage() >= allFoods.length ? " ERROR!" : allFoods[stack.getItemDamage()].getName()); return this.getUnlocalizedName()+(stack.getItemDamage() >= allFoods.length ? " ERROR!" : allFoods[stack.getItemDamage()].getName());
} }
@Override @Override
@ -105,7 +105,7 @@ public class ItemFoods extends ItemFood implements IActAddItemOrBlock{
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconReg){ public void registerIcons(IIconRegister iconReg){
for(int i = 0; i < textures.length; i++){ for(int i = 0; i < textures.length; i++){
textures[i] = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + allFoods[i].getName()); textures[i] = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+allFoods[i].getName());
} }
} }

View file

@ -84,7 +84,9 @@ public class ItemGrowthRing extends ItemEnergy{
stack.stackTagCompound.setInteger("WaitTime", 0); stack.stackTagCompound.setInteger("WaitTime", 0);
} }
else stack.stackTagCompound.setInteger("WaitTime", waitTime+1); else{
stack.stackTagCompound.setInteger("WaitTime", waitTime+1);
}
//Use Energy every tick //Use Energy every tick
if(!player.capabilities.isCreativeMode){ if(!player.capabilities.isCreativeMode){
@ -106,7 +108,7 @@ public class ItemGrowthRing extends ItemEnergy{
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconReg){ public void registerIcons(IIconRegister iconReg){
this.itemIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName()); this.itemIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName());
} }
@Override @Override

View file

@ -39,7 +39,7 @@ public class ItemHairyBall extends Item implements IActAddItemOrBlock{
player.worldObj.spawnEntityInWorld(entityItem); player.worldObj.spawnEntityInWorld(entityItem);
} }
stack.stackSize--; stack.stackSize--;
world.playSoundAtEntity(player, "random.pop", 0.2F, new Random().nextFloat() * 0.1F + 0.9F); world.playSoundAtEntity(player, "random.pop", 0.2F, new Random().nextFloat()*0.1F+0.9F);
} }
return stack; return stack;
} }
@ -61,7 +61,7 @@ public class ItemHairyBall extends Item implements IActAddItemOrBlock{
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconReg){ public void registerIcons(IIconRegister iconReg){
this.itemIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName()); this.itemIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName());
} }
@Override @Override

Some files were not shown because too many files have changed in this diff Show more