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

@ -85,7 +85,9 @@ public class BlockBreaker extends BlockContainerBase implements IActAddItemOrBlo
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

@ -61,7 +61,9 @@ public class BlockCanolaPress extends BlockContainerBase implements IActAddItemO
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

@ -78,7 +78,9 @@ public class BlockCoalGenerator extends BlockContainerBase implements IActAddIte
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;
} }

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;
} }
} }

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

@ -82,7 +82,9 @@ public class BlockDropper extends BlockContainerBase implements IActAddItemOrBlo
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

@ -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

@ -61,7 +61,9 @@ public class BlockFeeder extends BlockContainerBase implements IActAddItemOrBloc
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;

View file

@ -85,7 +85,9 @@ public class BlockFluidCollector extends BlockContainerBase implements IActAddIt
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

@ -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;
} }
@ -97,7 +99,9 @@ public class BlockFurnaceDouble extends BlockContainerBase implements IActAddIte
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;

View file

@ -63,7 +63,9 @@ public class BlockGiantChest extends BlockContainerBase implements IActAddItemOr
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

@ -95,7 +95,9 @@ public class BlockGrinder extends BlockContainerBase implements IActAddItemOrBlo
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

@ -68,7 +68,9 @@ public class BlockInputter extends BlockContainerBase implements IActAddItemOrBl
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;

View file

@ -72,7 +72,9 @@ public class BlockItemRepairer 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){
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

@ -78,7 +78,9 @@ public class BlockOilGenerator 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){
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

@ -84,12 +84,20 @@ public class BlockPhantom extends BlockContainerBase implements IActAddItemOrBlo
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);
} }
} }
} }

View file

@ -62,7 +62,9 @@ public class BlockPlant extends BlockCrops implements IActAddItemOrBlock{
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

View file

@ -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

@ -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

@ -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

@ -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

@ -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

@ -71,7 +71,9 @@ public class OreGen implements IWorldGenerator{
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

@ -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

@ -69,14 +69,19 @@ 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);

View file

@ -79,12 +79,18 @@ 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);

View file

@ -69,12 +69,18 @@ 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);

View file

@ -84,28 +84,40 @@ 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);

View file

@ -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
@ -105,12 +113,18 @@ 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);

View file

@ -69,14 +69,19 @@ 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);

View file

@ -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(){
@ -100,12 +102,18 @@ 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);

View file

@ -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(){
@ -100,12 +102,18 @@ 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);

View file

@ -64,14 +64,19 @@ 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);

View file

@ -78,12 +78,18 @@ 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);

View file

@ -76,12 +76,18 @@ 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);

View file

@ -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,12 +82,18 @@ 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);

View file

@ -69,14 +69,19 @@ 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);

View file

@ -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,12 +93,18 @@ 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);

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

@ -73,12 +73,18 @@ 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);

View file

@ -68,19 +68,27 @@ 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);

View file

@ -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

@ -63,19 +63,27 @@ 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);

View file

@ -63,12 +63,18 @@ 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);

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

@ -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

@ -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

@ -43,7 +43,9 @@ public class ItemCrafterOnAStick extends Item implements IActAddItemOrBlock{
@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

@ -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){

View file

@ -49,13 +49,16 @@ public class ItemLeafBlower extends Item implements IActAddItemOrBlock{
//Breaks the Blocks //Breaks the Blocks
this.breakStuff(player.worldObj, MathHelper.floor_double(player.posX), MathHelper.floor_double(player.posY), MathHelper.floor_double(player.posZ)); this.breakStuff(player.worldObj, MathHelper.floor_double(player.posX), MathHelper.floor_double(player.posY), MathHelper.floor_double(player.posZ));
//Plays a Minecart sounds (It really sounds like a Leaf Blower!) //Plays a Minecart sounds (It really sounds like a Leaf Blower!)
if(ConfigBoolValues.LEAF_BLOWER_SOUND.isEnabled()) player.worldObj.playSoundAtEntity(player, "minecart.base", 0.3F, 0.001F); if(ConfigBoolValues.LEAF_BLOWER_SOUND.isEnabled()){
player.worldObj.playSoundAtEntity(player, "minecart.base", 0.3F, 0.001F);
}
} }
} }
} }
/** /**
* Breaks (harvests) Grass and Leaves around * Breaks (harvests) Grass and Leaves around
*
* @param world The World * @param world The World
* @param x The X Position of the Player * @param x The X Position of the Player
* @param y The Y Position of the Player * @param y The Y Position of the Player

View file

@ -58,12 +58,13 @@ public class ItemPotionRing extends Item implements IActAddItemOrBlock{
thePlayer.addPotionEffect(new PotionEffect(effect.effectID, effect.activeTime, effect.normalAmplifier, true)); thePlayer.addPotionEffect(new PotionEffect(effect.effectID, effect.activeTime, effect.normalAmplifier, true));
} }
} }
else else{
thePlayer.addPotionEffect(new PotionEffect(effect.effectID, effect.activeTime, effect.advancedAmplifier, true)); thePlayer.addPotionEffect(new PotionEffect(effect.effectID, effect.activeTime, effect.advancedAmplifier, true));
} }
} }
} }
} }
}
@Override @Override
public String getName(){ public String getName(){

View file

@ -74,8 +74,12 @@ public class ItemTeleStaff extends ItemEnergy{
private int getWaitTime(ItemStack stack){ private int getWaitTime(ItemStack stack){
NBTTagCompound compound = stack.getTagCompound(); NBTTagCompound compound = stack.getTagCompound();
if(compound == null) return 0; if(compound == null){
else return compound.getInteger("waitTime"); return 0;
}
else{
return compound.getInteger("waitTime");
}
} }
@Override @Override

View file

@ -29,10 +29,10 @@ public class ItemWingsOfTheBats extends Item implements IActAddItemOrBlock{
* A List containing all of the Players that can currently fly * A List containing all of the Players that can currently fly
* Used so that Flight from other Mods' Items doesn't get broken when * Used so that Flight from other Mods' Items doesn't get broken when
* these Wings aren't worn * these Wings aren't worn
* * <p>
* Saves Remote Players separately to make de-synced Event Calling * Saves Remote Players separately to make de-synced Event Calling
* not bug out Capabilities when taking off the Wings * not bug out Capabilities when taking off the Wings
* * <p>
* (Partially excerpted from Botania's Wing System by Vazkii (as I had fiddled around with the system and couldn't make it work) with permission, thanks!) * (Partially excerpted from Botania's Wing System by Vazkii (as I had fiddled around with the system and couldn't make it work) with permission, thanks!)
*/ */
public static ArrayList<String> wingedPlayers = new ArrayList<String>(); public static ArrayList<String> wingedPlayers = new ArrayList<String>();
@ -43,6 +43,7 @@ public class ItemWingsOfTheBats extends Item implements IActAddItemOrBlock{
/** /**
* Checks if the Player is winged * Checks if the Player is winged
*
* @param player The Player * @param player The Player
* @return Winged? * @return Winged?
*/ */
@ -52,6 +53,7 @@ public class ItemWingsOfTheBats extends Item implements IActAddItemOrBlock{
/** /**
* Removes the Player from the List of Players that have Wings * Removes the Player from the List of Players that have Wings
*
* @param player The Player * @param player The Player
* @param worldRemote If the World the Player is in is remote * @param worldRemote If the World the Player is in is remote
*/ */
@ -68,6 +70,7 @@ public class ItemWingsOfTheBats extends Item implements IActAddItemOrBlock{
/** /**
* Adds the Player to the List of Players that have Wings * Adds the Player to the List of Players that have Wings
*
* @param player The Player * @param player The Player
*/ */
public static void addWingsToPlayer(EntityPlayer player){ public static void addWingsToPlayer(EntityPlayer player){

View file

@ -73,7 +73,9 @@ public class ItemAllToolAA extends ItemTool implements IActAddItemOrBlock{
@Override @Override
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ){ public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ){
if (!player.canPlayerEdit(x, y, z, side, stack)) return false; if(!player.canPlayerEdit(x, y, z, side, stack)){
return false;
}
else{ else{
UseHoeEvent event = new UseHoeEvent(player, stack, world, x, y, z); UseHoeEvent event = new UseHoeEvent(player, stack, world, x, y, z);
if(MinecraftForge.EVENT_BUS.post(event)) return false; if(MinecraftForge.EVENT_BUS.post(event)) return false;
@ -85,14 +87,18 @@ public class ItemAllToolAA extends ItemTool implements IActAddItemOrBlock{
if(side != 0 && world.getBlock(x, y+1, z).isAir(world, x, y+1, z) && (block == Blocks.grass || block == Blocks.dirt)){ if(side != 0 && world.getBlock(x, y+1, z).isAir(world, x, y+1, z) && (block == Blocks.grass || block == Blocks.dirt)){
Block block1 = Blocks.farmland; Block block1 = Blocks.farmland;
world.playSoundEffect((double)((float)x+0.5F), (double)((float)y+0.5F), (double)((float)z+0.5F), block1.stepSound.getStepResourcePath(), (block1.stepSound.getVolume()+1.0F)/2.0F, block1.stepSound.getPitch()*0.8F); world.playSoundEffect((double)((float)x+0.5F), (double)((float)y+0.5F), (double)((float)z+0.5F), block1.stepSound.getStepResourcePath(), (block1.stepSound.getVolume()+1.0F)/2.0F, block1.stepSound.getPitch()*0.8F);
if (world.isRemote) return true; if(world.isRemote){
return true;
}
else{ else{
world.setBlock(x, y, z, block1); world.setBlock(x, y, z, block1);
stack.damageItem(1, player); stack.damageItem(1, player);
return true; return true;
} }
} }
else return false; else{
return false;
}
} }
} }

View file

@ -17,6 +17,7 @@ public interface IButtonReactor{
/** /**
* Called when a Button in a GUI is pressed * Called when a Button in a GUI is pressed
* Gets called on the Server, sent from the Client * Gets called on the Server, sent from the Client
*
* @param buttonID The button's ID * @param buttonID The button's ID
* @param player The Player pressing it * @param player The Player pressing it
*/ */

View file

@ -16,6 +16,7 @@ public interface INumberReactor{
/** /**
* Called when a Number gets received after typing it in in the GUI * Called when a Number gets received after typing it in in the GUI
*
* @param text The number that was sent (I don't remember why I called it text. Had a reason though.) * @param text The number that was sent (I don't remember why I called it text. Had a reason though.)
* @param textID The ID (meaning the place in the GUI) of the number typed in * @param textID The ID (meaning the place in the GUI) of the number typed in
* @param player The Player doing it * @param player The Player doing it

View file

@ -16,6 +16,7 @@ public interface IStringReactor{
/** /**
* Called when a text gets received after typing it in in the GUI * Called when a text gets received after typing it in in the GUI
*
* @param text The text that was sent * @param text The text that was sent
* @param textID The ID (meaning the place in the GUI) of the text typed in * @param textID The ID (meaning the place in the GUI) of the text typed in
* @param player The Player doing it * @param player The Player doing it

View file

@ -19,6 +19,7 @@ public interface IPacketSyncerToClient{
/** /**
* Sets the Values on the Client * Sets the Values on the Client
*
* @param values The Values * @param values The Values
*/ */
void setValues(int[] values); void setValues(int[] values);

View file

@ -72,12 +72,16 @@ public class TileEntityBreaker extends TileEntityInventoryBase{
else if(this.isPlacer && worldObj.getBlock(coordsBlock.getX(), coordsBlock.getY(), coordsBlock.getZ()).isReplaceable(worldObj, coordsBlock.getX(), coordsBlock.getY(), coordsBlock.getZ())){ else if(this.isPlacer && worldObj.getBlock(coordsBlock.getX(), coordsBlock.getY(), coordsBlock.getZ()).isReplaceable(worldObj, coordsBlock.getX(), coordsBlock.getY(), coordsBlock.getZ())){
int theSlot = WorldUtil.findFirstFilledSlot(this.slots); int theSlot = WorldUtil.findFirstFilledSlot(this.slots);
this.setInventorySlotContents(theSlot, WorldUtil.placeBlockAtSide(sideToManipulate, worldObj, xCoord, yCoord, zCoord, this.slots[theSlot])); this.setInventorySlotContents(theSlot, WorldUtil.placeBlockAtSide(sideToManipulate, worldObj, xCoord, yCoord, zCoord, this.slots[theSlot]));
if(this.slots[theSlot] != null && this.slots[theSlot].stackSize <= 0) this.slots[theSlot] = null; if(this.slots[theSlot] != null && this.slots[theSlot].stackSize <= 0){
this.slots[theSlot] = null;
} }
} }
} }
} }
else this.currentTime = ConfigIntValues.BREAKER_TIME_NEEDED.getValue(); }
else{
this.currentTime = ConfigIntValues.BREAKER_TIME_NEEDED.getValue();
}
} }
} }
} }

View file

@ -61,7 +61,9 @@ public class TileEntityCanolaPress extends TileEntityInventoryBase implements IE
} }
} }
} }
else this.currentProcessTime = 0; else{
this.currentProcessTime = 0;
}
WorldUtil.fillBucket(tank, slots, 1, 2); WorldUtil.fillBucket(tank, slots, 1, 2);
@ -196,7 +198,9 @@ public class TileEntityCanolaPress extends TileEntityInventoryBase implements IE
if(values[2] != -1){ if(values[2] != -1){
this.tank.setFluid(new FluidStack(FluidRegistry.getFluid(values[2]), values[1])); this.tank.setFluid(new FluidStack(FluidRegistry.getFluid(values[2]), values[1]));
} }
else this.tank.setFluid(null); else{
this.tank.setFluid(null);
}
this.storage.setEnergyStored(values[3]); this.storage.setEnergyStored(values[3]);
} }

View file

@ -54,7 +54,9 @@ public class TileEntityCoalGenerator extends TileEntityInventoryBase implements
this.maxBurnTime = burnTime; this.maxBurnTime = burnTime;
this.currentBurnTime = burnTime; this.currentBurnTime = burnTime;
this.slots[0].stackSize--; this.slots[0].stackSize--;
if(this.slots[0].stackSize == 0) this.slots[0] = this.slots[0].getItem().getContainerItem(this.slots[0]); if(this.slots[0].stackSize == 0){
this.slots[0] = this.slots[0].getItem().getContainerItem(this.slots[0]);
}
} }
} }
@ -71,10 +73,13 @@ public class TileEntityCoalGenerator extends TileEntityInventoryBase implements
this.markDirty(); this.markDirty();
int meta = worldObj.getBlockMetadata(xCoord, yCoord, zCoord); int meta = worldObj.getBlockMetadata(xCoord, yCoord, zCoord);
if(meta == 1){ if(meta == 1){
if(!(this.currentBurnTime <= 0 && this.slots[0] != null && TileEntityFurnace.getItemBurnTime(this.slots[0]) > 0 && ConfigIntValues.COAL_GEN_ENERGY_PRODUCED.getValue()*TileEntityFurnace.getItemBurnTime(this.slots[0]) <= this.getMaxEnergyStored(ForgeDirection.UNKNOWN)-this.getEnergyStored(ForgeDirection.UNKNOWN))) if(!(this.currentBurnTime <= 0 && this.slots[0] != null && TileEntityFurnace.getItemBurnTime(this.slots[0]) > 0 && ConfigIntValues.COAL_GEN_ENERGY_PRODUCED.getValue()*TileEntityFurnace.getItemBurnTime(this.slots[0]) <= this.getMaxEnergyStored(ForgeDirection.UNKNOWN)-this.getEnergyStored(ForgeDirection.UNKNOWN))){
worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, 0, 2); worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, 0, 2);
} }
else worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, 1, 2); }
else{
worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, 1, 2);
}
} }
if(this.storage.getEnergyStored() != this.lastEnergy || this.currentBurnTime != this.lastCurrentBurnTime || this.lastBurnTime != this.maxBurnTime){ if(this.storage.getEnergyStored() != this.lastEnergy || this.currentBurnTime != this.lastCurrentBurnTime || this.lastBurnTime != this.maxBurnTime){

View file

@ -100,7 +100,9 @@ public class TileEntityCoffeeMachine extends TileEntityInventoryBase implements
if(ingredient != null){ if(ingredient != null){
if(ingredient.effect(output)){ if(ingredient.effect(output)){
this.slots[i].stackSize--; this.slots[i].stackSize--;
if(this.slots[i].stackSize <= 0) this.slots[i] = this.slots[i].getItem().getContainerItem(this.slots[i]); if(this.slots[i].stackSize <= 0){
this.slots[i] = this.slots[i].getItem().getContainerItem(this.slots[i]);
}
} }
} }
} }
@ -113,7 +115,9 @@ public class TileEntityCoffeeMachine extends TileEntityInventoryBase implements
} }
} }
} }
else this.brewTime = 0; else{
this.brewTime = 0;
}
} }
} }
@ -237,7 +241,9 @@ public class TileEntityCoffeeMachine extends TileEntityInventoryBase implements
if(values[1] != -1){ if(values[1] != -1){
this.tank.setFluid(new FluidStack(FluidRegistry.getFluid(values[1]), values[0])); this.tank.setFluid(new FluidStack(FluidRegistry.getFluid(values[1]), values[0]));
} }
else this.tank.setFluid(null); else{
this.tank.setFluid(null);
}
this.storage.setEnergyStored(values[2]); this.storage.setEnergyStored(values[2]);
this.brewTime = values[3]; this.brewTime = values[3];
this.coffeeCacheAmount = values[4]; this.coffeeCacheAmount = values[4];

View file

@ -32,10 +32,14 @@ public class TileEntityCompost extends TileEntityInventoryBase{
if(this.slots[0] != null && this.slots[0].stackSize > 0){ if(this.slots[0] != null && this.slots[0].stackSize > 0){
int toSet = this.slots[0].stackSize+(this.slots[0].getItem() instanceof ItemFertilizer ? 1 : 0); int toSet = this.slots[0].stackSize+(this.slots[0].getItem() instanceof ItemFertilizer ? 1 : 0);
if(worldObj.getBlockMetadata(xCoord, yCoord, zCoord) != toSet) worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, toSet, 2); if(worldObj.getBlockMetadata(xCoord, yCoord, zCoord) != toSet){
worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, toSet, 2);
}
} }
else{ else{
if(worldObj.getBlockMetadata(xCoord, yCoord, zCoord) != 0) worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, 0, 2); if(worldObj.getBlockMetadata(xCoord, yCoord, zCoord) != 0){
worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, 0, 2);
}
} }
boolean theFlag = this.conversionTime > 0; boolean theFlag = this.conversionTime > 0;

View file

@ -39,7 +39,9 @@ public class TileEntityDropper extends TileEntityInventoryBase{
} }
} }
} }
else this.currentTime = ConfigIntValues.DROPPER_TIME_NEEDED.getValue(); else{
this.currentTime = ConfigIntValues.DROPPER_TIME_NEEDED.getValue();
}
} }
} }
} }

View file

@ -53,16 +53,23 @@ public class TileEntityFeeder extends TileEntityInventoryBase implements IPacket
this.feedAnimal(randomAnimal); this.feedAnimal(randomAnimal);
this.slots[0].stackSize--; this.slots[0].stackSize--;
if(this.slots[0].stackSize == 0) if(this.slots[0].stackSize == 0){
this.slots[0] = this.slots[0].getItem().getContainerItem(this.slots[0]); this.slots[0] = this.slots[0].getItem().getContainerItem(this.slots[0]);
} }
} }
} }
else this.currentTimer++;
} }
else this.currentTimer = 0; else{
this.currentTimer++;
}
}
else{
this.currentTimer = 0;
}
}
else{
this.currentTimer = 0;
} }
else this.currentTimer = 0;
} }
if(theFlag != this.currentTimer > 0){ if(theFlag != this.currentTimer > 0){

View file

@ -51,7 +51,9 @@ public class TileEntityFermentingBarrel extends TileEntityInventoryBase implemen
this.markDirty(); this.markDirty();
} }
} }
else this.currentProcessTime = 0; else{
this.currentProcessTime = 0;
}
WorldUtil.emptyBucket(canolaTank, slots, 0, 1, InitBlocks.fluidCanolaOil); WorldUtil.emptyBucket(canolaTank, slots, 0, 1, InitBlocks.fluidCanolaOil);
WorldUtil.fillBucket(oilTank, slots, 2, 3); WorldUtil.fillBucket(oilTank, slots, 2, 3);
@ -125,7 +127,9 @@ public class TileEntityFermentingBarrel extends TileEntityInventoryBase implemen
@Override @Override
public int fill(ForgeDirection from, FluidStack resource, boolean doFill){ public int fill(ForgeDirection from, FluidStack resource, boolean doFill){
if(from != ForgeDirection.DOWN && resource.getFluid() == InitBlocks.fluidCanolaOil) return this.canolaTank.fill(resource, doFill); if(from != ForgeDirection.DOWN && resource.getFluid() == InitBlocks.fluidCanolaOil){
return this.canolaTank.fill(resource, doFill);
}
return 0; return 0;
} }
@ -165,11 +169,15 @@ public class TileEntityFermentingBarrel extends TileEntityInventoryBase implemen
if(values[1] != -1){ if(values[1] != -1){
this.oilTank.setFluid(new FluidStack(FluidRegistry.getFluid(values[1]), values[0])); this.oilTank.setFluid(new FluidStack(FluidRegistry.getFluid(values[1]), values[0]));
} }
else this.oilTank.setFluid(null); else{
this.oilTank.setFluid(null);
}
if(values[3] != -1){ if(values[3] != -1){
this.canolaTank.setFluid(new FluidStack(FluidRegistry.getFluid(values[3]), values[2])); this.canolaTank.setFluid(new FluidStack(FluidRegistry.getFluid(values[3]), values[2]));
} }
else this.canolaTank.setFluid(null); else{
this.canolaTank.setFluid(null);
}
this.currentProcessTime = values[4]; this.currentProcessTime = values[4];
} }

View file

@ -48,7 +48,9 @@ public class TileEntityFishingNet extends TileEntityBase{
} }
} }
} }
else this.timeUntilNextDrop = ConfigIntValues.FISHER_TIME.getValue() + rand.nextInt(ConfigIntValues.FISHER_TIME.getValue() / 2); else{
this.timeUntilNextDrop = ConfigIntValues.FISHER_TIME.getValue()+rand.nextInt(ConfigIntValues.FISHER_TIME.getValue()/2);
}
} }
} }
} }

View file

@ -78,7 +78,9 @@ public class TileEntityFluidCollector extends TileEntityInventoryBase implements
if(values[1] != -1){ if(values[1] != -1){
this.tank.setFluid(new FluidStack(FluidRegistry.getFluid(values[1]), values[0])); this.tank.setFluid(new FluidStack(FluidRegistry.getFluid(values[1]), values[0]));
} }
else this.tank.setFluid(null); else{
this.tank.setFluid(null);
}
} }
@Override @Override
@ -155,11 +157,17 @@ public class TileEntityFluidCollector extends TileEntityInventoryBase implements
} }
} }
} }
else this.currentTime = ConfigIntValues.BREAKER_TIME_NEEDED.getValue(); else{
this.currentTime = ConfigIntValues.BREAKER_TIME_NEEDED.getValue();
}
} }
if(!this.isPlacer) WorldUtil.fillBucket(tank, slots, 0, 1); if(!this.isPlacer){
else WorldUtil.emptyBucket(tank, slots, 0, 1); WorldUtil.fillBucket(tank, slots, 0, 1);
}
else{
WorldUtil.emptyBucket(tank, slots, 0, 1);
}
if(!this.isPlacer && this.tank.getFluidAmount() > 0){ if(!this.isPlacer && this.tank.getFluidAmount() > 0){
WorldUtil.pushFluid(worldObj, xCoord, yCoord, zCoord, ForgeDirection.DOWN, this.tank); WorldUtil.pushFluid(worldObj, xCoord, yCoord, zCoord, ForgeDirection.DOWN, this.tank);
@ -200,8 +208,12 @@ public class TileEntityFluidCollector extends TileEntityInventoryBase implements
@Override @Override
public boolean isItemValidForSlot(int i, ItemStack stack){ public boolean isItemValidForSlot(int i, ItemStack stack){
if(i == 0){ if(i == 0){
if(this.isPlacer) return FluidContainerRegistry.isFilledContainer(stack); if(this.isPlacer){
else return stack.isItemEqual(FluidContainerRegistry.EMPTY_BUCKET); return FluidContainerRegistry.isFilledContainer(stack);
}
else{
return stack.isItemEqual(FluidContainerRegistry.EMPTY_BUCKET);
}
} }
return false; return false;
} }

View file

@ -61,7 +61,9 @@ public class TileEntityFurnaceDouble extends TileEntityInventoryBase implements
} }
} }
} }
else this.firstSmeltTime = 0; else{
this.firstSmeltTime = 0;
}
if(canSmeltOnSecond){ if(canSmeltOnSecond){
if(this.storage.getEnergyStored() >= ConfigIntValues.FURNACE_ENERGY_USED.getValue()){ if(this.storage.getEnergyStored() >= ConfigIntValues.FURNACE_ENERGY_USED.getValue()){
@ -72,17 +74,25 @@ public class TileEntityFurnaceDouble extends TileEntityInventoryBase implements
} }
} }
} }
else this.secondSmeltTime = 0; else{
this.secondSmeltTime = 0;
}
if(this.storage.getEnergyStored() >= ConfigIntValues.FURNACE_ENERGY_USED.getValue() && this.firstSmeltTime > 0 || this.secondSmeltTime > 0) this.storage.extractEnergy(ConfigIntValues.FURNACE_ENERGY_USED.getValue(), false); if(this.storage.getEnergyStored() >= ConfigIntValues.FURNACE_ENERGY_USED.getValue() && this.firstSmeltTime > 0 || this.secondSmeltTime > 0){
this.storage.extractEnergy(ConfigIntValues.FURNACE_ENERGY_USED.getValue(), false);
}
if(flag != (this.firstSmeltTime > 0 || this.secondSmeltTime > 0)){ if(flag != (this.firstSmeltTime > 0 || this.secondSmeltTime > 0)){
this.markDirty(); this.markDirty();
int meta = worldObj.getBlockMetadata(xCoord, yCoord, zCoord); int meta = worldObj.getBlockMetadata(xCoord, yCoord, zCoord);
if(meta > 3){ if(meta > 3){
if(!this.canSmeltOn(SLOT_INPUT_1, SLOT_OUTPUT_1) && !this.canSmeltOn(SLOT_INPUT_2, SLOT_OUTPUT_2)) worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, meta-4, 2); if(!this.canSmeltOn(SLOT_INPUT_1, SLOT_OUTPUT_1) && !this.canSmeltOn(SLOT_INPUT_2, SLOT_OUTPUT_2)){
worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, meta-4, 2);
}
}
else{
worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, meta+4, 2);
} }
else worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, meta+4, 2);
} }
if(lastEnergy != this.storage.getEnergyStored() || this.lastFirstSmelt != this.firstSmeltTime || this.lastSecondSmelt != this.secondSmeltTime){ if(lastEnergy != this.storage.getEnergyStored() || this.lastFirstSmelt != this.firstSmeltTime || this.lastSecondSmelt != this.secondSmeltTime){
@ -110,8 +120,12 @@ public class TileEntityFurnaceDouble extends TileEntityInventoryBase implements
public void finishBurning(int theInput, int theOutput){ public void finishBurning(int theInput, int theOutput){
ItemStack output = FurnaceRecipes.smelting().getSmeltingResult(this.slots[theInput]); ItemStack output = FurnaceRecipes.smelting().getSmeltingResult(this.slots[theInput]);
if (this.slots[theOutput] == null) this.slots[theOutput] = output.copy(); if(this.slots[theOutput] == null){
else if(this.slots[theOutput].getItem() == output.getItem()) this.slots[theOutput].stackSize += output.stackSize; this.slots[theOutput] = output.copy();
}
else if(this.slots[theOutput].getItem() == output.getItem()){
this.slots[theOutput].stackSize += output.stackSize;
}
this.slots[theInput].stackSize--; this.slots[theInput].stackSize--;
if(this.slots[theInput].stackSize <= 0) this.slots[theInput] = null; if(this.slots[theInput].stackSize <= 0) this.slots[theInput] = null;

View file

@ -40,7 +40,9 @@ public class TileEntityGreenhouseGlass extends TileEntityBase{
} }
} }
} }
else this.timeUntilNextFert = ConfigIntValues.GLASS_TIME_NEEDED.getValue()+new Random().nextInt(ConfigIntValues.GLASS_TIME_NEEDED.getValue()); else{
this.timeUntilNextFert = ConfigIntValues.GLASS_TIME_NEEDED.getValue()+new Random().nextInt(ConfigIntValues.GLASS_TIME_NEEDED.getValue());
}
} }
} }
} }
@ -53,7 +55,9 @@ public class TileEntityGreenhouseGlass extends TileEntityBase{
if((block instanceof IGrowable || block instanceof IPlantable) && !(block instanceof BlockGrass)){ if((block instanceof IGrowable || block instanceof IPlantable) && !(block instanceof BlockGrass)){
return new WorldPos(worldObj, xCoord, i, zCoord); return new WorldPos(worldObj, xCoord, i, zCoord);
} }
else return null; else{
return null;
}
} }
} }
return null; return null;

View file

@ -125,7 +125,9 @@ public class TileEntityGrinder extends TileEntityInventoryBase implements IEnerg
} }
} }
} }
else this.firstCrushTime = 0; else{
this.firstCrushTime = 0;
}
if(this.isDouble){ if(this.isDouble){
if(canCrushOnSecond){ if(canCrushOnSecond){
@ -137,18 +139,26 @@ public class TileEntityGrinder extends TileEntityInventoryBase implements IEnerg
} }
} }
} }
else this.secondCrushTime = 0; else{
this.secondCrushTime = 0;
}
} }
if(this.storage.getEnergyStored() >= getEnergyUse() && this.firstCrushTime > 0 || this.secondCrushTime > 0) this.storage.extractEnergy(getEnergyUse(), false); if(this.storage.getEnergyStored() >= getEnergyUse() && this.firstCrushTime > 0 || this.secondCrushTime > 0){
this.storage.extractEnergy(getEnergyUse(), false);
}
if(flag != (this.firstCrushTime > 0 || this.secondCrushTime > 0)){ if(flag != (this.firstCrushTime > 0 || this.secondCrushTime > 0)){
this.markDirty(); this.markDirty();
int meta = worldObj.getBlockMetadata(xCoord, yCoord, zCoord); int meta = worldObj.getBlockMetadata(xCoord, yCoord, zCoord);
if(meta == 1){ if(meta == 1){
if(!this.canCrushOn(SLOT_INPUT_1, SLOT_OUTPUT_1_1, SLOT_OUTPUT_1_2) && (!this.isDouble || !this.canCrushOn(SLOT_INPUT_2, SLOT_OUTPUT_2_1, SLOT_OUTPUT_2_2))) worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, 0, 2); if(!this.canCrushOn(SLOT_INPUT_1, SLOT_OUTPUT_1_1, SLOT_OUTPUT_1_2) && (!this.isDouble || !this.canCrushOn(SLOT_INPUT_2, SLOT_OUTPUT_2_1, SLOT_OUTPUT_2_2))){
worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, 0, 2);
}
}
else{
worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, 1, 2);
} }
else worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, 1, 2);
} }
if(lastEnergy != this.storage.getEnergyStored() || this.lastFirstCrush != this.firstCrushTime || this.lastSecondCrush != this.secondCrushTime){ if(lastEnergy != this.storage.getEnergyStored() || this.lastFirstCrush != this.firstCrushTime || this.lastSecondCrush != this.secondCrushTime){
@ -178,8 +188,12 @@ public class TileEntityGrinder extends TileEntityInventoryBase implements IEnerg
public void finishCrushing(int theInput, int theFirstOutput, int theSecondOutput){ public void finishCrushing(int theInput, int theFirstOutput, int theSecondOutput){
ItemStack outputOnFirst = CrusherRecipeManualRegistry.getOutput(this.slots[theInput], false); ItemStack outputOnFirst = CrusherRecipeManualRegistry.getOutput(this.slots[theInput], false);
if(outputOnFirst != null){ if(outputOnFirst != null){
if(this.slots[theFirstOutput] == null) this.slots[theFirstOutput] = outputOnFirst.copy(); if(this.slots[theFirstOutput] == null){
else if(this.slots[theFirstOutput].getItem() == outputOnFirst.getItem()) this.slots[theFirstOutput].stackSize += outputOnFirst.stackSize; this.slots[theFirstOutput] = outputOnFirst.copy();
}
else if(this.slots[theFirstOutput].getItem() == outputOnFirst.getItem()){
this.slots[theFirstOutput].stackSize += outputOnFirst.stackSize;
}
} }
int chance = CrusherRecipeManualRegistry.getSecondChance(this.slots[theInput]); int chance = CrusherRecipeManualRegistry.getSecondChance(this.slots[theInput]);
@ -187,8 +201,12 @@ public class TileEntityGrinder extends TileEntityInventoryBase implements IEnerg
if(outputOnSecond != null){ if(outputOnSecond != null){
int rand = new Random().nextInt(100)+1; int rand = new Random().nextInt(100)+1;
if(rand <= chance){ if(rand <= chance){
if(this.slots[theSecondOutput] == null) this.slots[theSecondOutput] = outputOnSecond.copy(); if(this.slots[theSecondOutput] == null){
else if(this.slots[theSecondOutput].getItem() == outputOnSecond.getItem()) this.slots[theSecondOutput].stackSize += outputOnSecond.stackSize; this.slots[theSecondOutput] = outputOnSecond.copy();
}
else if(this.slots[theSecondOutput].getItem() == outputOnSecond.getItem()){
this.slots[theSecondOutput].stackSize += outputOnSecond.stackSize;
}
} }
} }

View file

@ -28,13 +28,21 @@ public class TileEntityInputter extends TileEntityInventoryBase implements IButt
public void onNumberReceived(int text, int textID, EntityPlayer player){ public void onNumberReceived(int text, int textID, EntityPlayer player){
if(text != -1){ if(text != -1){
if(this.placeToPut instanceof IInventory){ if(this.placeToPut instanceof IInventory){
if(textID == 0) this.slotToPutStart = Math.max(Math.min(text, ((IInventory)this.placeToPut).getSizeInventory()-1), 0); if(textID == 0){
if(textID == 1) this.slotToPutEnd = Math.max(Math.min(text, ((IInventory)this.placeToPut).getSizeInventory()), 0); this.slotToPutStart = Math.max(Math.min(text, ((IInventory)this.placeToPut).getSizeInventory()-1), 0);
}
if(textID == 1){
this.slotToPutEnd = Math.max(Math.min(text, ((IInventory)this.placeToPut).getSizeInventory()), 0);
}
} }
if(this.placeToPull instanceof IInventory){ if(this.placeToPull instanceof IInventory){
if(textID == 2) this.slotToPullStart = Math.max(Math.min(text, ((IInventory)this.placeToPull).getSizeInventory()-1), 0); if(textID == 2){
if(textID == 3) this.slotToPullEnd = Math.max(Math.min(text, ((IInventory)this.placeToPull).getSizeInventory()), 0); this.slotToPullStart = Math.max(Math.min(text, ((IInventory)this.placeToPull).getSizeInventory()-1), 0);
}
if(textID == 3){
this.slotToPullEnd = Math.max(Math.min(text, ((IInventory)this.placeToPull).getSizeInventory()), 0);
}
} }
} }
this.markDirty(); this.markDirty();
@ -171,8 +179,12 @@ public class TileEntityInputter extends TileEntityInventoryBase implements IButt
ItemStack tempStack = theInventory.getStackInSlot(i); ItemStack tempStack = theInventory.getStackInSlot(i);
if(tempStack != null){ if(tempStack != null){
//Set maxSize to the max Size of the temporary stack if it's smaller than the Inventory's Max Size //Set maxSize to the max Size of the temporary stack if it's smaller than the Inventory's Max Size
if(tempStack.getMaxStackSize() < this.getInventoryStackLimit()) maxSize = tempStack.getMaxStackSize(); if(tempStack.getMaxStackSize() < this.getInventoryStackLimit()){
else maxSize = this.getInventoryStackLimit(); maxSize = tempStack.getMaxStackSize();
}
else{
maxSize = this.getInventoryStackLimit();
}
} }
//If ESD has enough Space & Item in question is on whitelist //If ESD has enough Space & Item in question is on whitelist
if(tempStack != null && (this.slots[0] == null || (tempStack.isItemEqual(this.slots[0]) && this.slots[0].stackSize < maxSize)) && this.checkBothFilters(tempStack)){ if(tempStack != null && (this.slots[0] == null || (tempStack.isItemEqual(this.slots[0]) && this.slots[0].stackSize < maxSize)) && this.checkBothFilters(tempStack)){
@ -222,8 +234,12 @@ public class TileEntityInputter extends TileEntityInventoryBase implements IButt
//Actually puts the Item //Actually puts the Item
this.setInventorySlotContents(0, toBePut); this.setInventorySlotContents(0, toBePut);
//Removes the Item from the inventory getting pulled from //Removes the Item from the inventory getting pulled from
if(theStack.stackSize == toBePut.stackSize) theInventory.setInventorySlotContents(theSlotToPull, null); if(theStack.stackSize == toBePut.stackSize){
else theInventory.decrStackSize(theSlotToPull, toBePut.stackSize); theInventory.setInventorySlotContents(theSlotToPull, null);
}
else{
theInventory.decrStackSize(theSlotToPull, toBePut.stackSize);
}
} }
} }
} }
@ -247,8 +263,12 @@ public class TileEntityInputter extends TileEntityInventoryBase implements IButt
for(int i = Math.max(theSlotToPut, 0); i < Math.min(this.slotToPutEnd, theInventory.getSizeInventory()); i++){ for(int i = Math.max(theSlotToPut, 0); i < Math.min(this.slotToPutEnd, theInventory.getSizeInventory()); i++){
ItemStack tempStack = theInventory.getStackInSlot(i); ItemStack tempStack = theInventory.getStackInSlot(i);
if(tempStack != null){ if(tempStack != null){
if(tempStack.getMaxStackSize() < theInventory.getInventoryStackLimit()) maxSize = tempStack.getMaxStackSize(); if(tempStack.getMaxStackSize() < theInventory.getInventoryStackLimit()){
else maxSize = theInventory.getInventoryStackLimit(); maxSize = tempStack.getMaxStackSize();
}
else{
maxSize = theInventory.getInventoryStackLimit();
}
} }
if(theInventory.isItemValidForSlot(i, this.slots[0]) && (tempStack == null || (tempStack.isItemEqual(this.slots[0]) && tempStack.stackSize < maxSize)) && this.checkBothFilters(this.slots[0])){ if(theInventory.isItemValidForSlot(i, this.slots[0]) && (tempStack == null || (tempStack.isItemEqual(this.slots[0]) && tempStack.stackSize < maxSize)) && this.checkBothFilters(this.slots[0])){
if(theSided != null){ if(theSided != null){
@ -289,8 +309,12 @@ public class TileEntityInputter extends TileEntityInventoryBase implements IButt
ItemStack toBePut = this.slots[0].copy(); ItemStack toBePut = this.slots[0].copy();
if(maxSize < toBePut.stackSize) toBePut.stackSize = maxSize; if(maxSize < toBePut.stackSize) toBePut.stackSize = maxSize;
theInventory.setInventorySlotContents(theSlotToPut, toBePut); theInventory.setInventorySlotContents(theSlotToPut, toBePut);
if(this.slots[0].stackSize == toBePut.stackSize) this.slots[0] = null; if(this.slots[0].stackSize == toBePut.stackSize){
else this.decrStackSize(0, toBePut.stackSize); this.slots[0] = null;
}
else{
this.decrStackSize(0, toBePut.stackSize);
}
} }
} }
} }
@ -300,6 +324,7 @@ public class TileEntityInputter extends TileEntityInventoryBase implements IButt
/** /**
* Checks if one of the filters contains the ItemStack * Checks if one of the filters contains the ItemStack
* (Whitelist or empty Blacklist in one of them always lets the Item through!) * (Whitelist or empty Blacklist in one of them always lets the Item through!)
*
* @param stack The ItemStack * @param stack The ItemStack
* @return If the Item is filtered correctly * @return If the Item is filtered correctly
*/ */
@ -309,6 +334,7 @@ public class TileEntityInputter extends TileEntityInventoryBase implements IButt
/** /**
* Checks the Whitelist/Blacklist to see if Item fits * Checks the Whitelist/Blacklist to see if Item fits
*
* @param stack The Stack to check for * @param stack The Stack to check for
* @param isPull If we're pulling or putting * @param isPull If we're pulling or putting
* @param isWhitelist If it's set to white- or Blacklist * @param isWhitelist If it's set to white- or Blacklist
@ -371,9 +397,15 @@ public class TileEntityInputter extends TileEntityInventoryBase implements IButt
if(buttonID == 2) this.sideToPull++; if(buttonID == 2) this.sideToPull++;
if(buttonID == 3) this.sideToPull--; if(buttonID == 3) this.sideToPull--;
if(this.sideToPut >= 6) this.sideToPut = -1; if(this.sideToPut >= 6){
else if(this.sideToPut < -1) this.sideToPut = 5; this.sideToPut = -1;
else if(this.sideToPull >= 6) this.sideToPull = -1; }
else if(this.sideToPut < -1){
this.sideToPut = 5;
}
else if(this.sideToPull >= 6){
this.sideToPull = -1;
}
else if(this.sideToPull < -1) this.sideToPull = 5; else if(this.sideToPull < -1) this.sideToPull = 5;
this.markDirty(); this.markDirty();

View file

@ -151,6 +151,8 @@ public abstract class TileEntityInventoryBase extends TileEntityBase implements
} }
return theInt; return theInt;
} }
else return new int[0]; else{
return new int[0];
}
} }
} }

View file

@ -56,7 +56,9 @@ public class TileEntityItemRepairer extends TileEntityInventoryBase implements I
} }
} }
} }
else this.nextRepairTick = 0; else{
this.nextRepairTick = 0;
}
if(this.lastEnergy != this.storage.getEnergyStored()){ if(this.lastEnergy != this.storage.getEnergyStored()){
this.lastEnergy = this.storage.getEnergyStored(); this.lastEnergy = this.storage.getEnergyStored();

View file

@ -41,7 +41,9 @@ public class TileEntityLavaFactoryController extends TileEntityBase implements I
this.storage.extractEnergy(ConfigIntValues.LAVA_FACTORY_ENERGY_USED.getValue(), false); this.storage.extractEnergy(ConfigIntValues.LAVA_FACTORY_ENERGY_USED.getValue(), false);
} }
} }
else this.currentWorkTime = 0; else{
this.currentWorkTime = 0;
}
} }
} }

View file

@ -72,10 +72,13 @@ public class TileEntityOilGenerator extends TileEntityInventoryBase implements I
this.markDirty(); this.markDirty();
int meta = worldObj.getBlockMetadata(xCoord, yCoord, zCoord); int meta = worldObj.getBlockMetadata(xCoord, yCoord, zCoord);
if(meta == 1){ if(meta == 1){
if(!(ConfigIntValues.OIL_GEN_ENERGY_PRODUCED.getValue()*ConfigIntValues.OIL_GEN_BURN_TIME.getValue() <= this.getMaxEnergyStored(ForgeDirection.UNKNOWN)-this.getEnergyStored(ForgeDirection.UNKNOWN) && FluidContainerRegistry.BUCKET_VOLUME <= this.tank.getCapacity()-this.tank.getFluidAmount())) if(!(ConfigIntValues.OIL_GEN_ENERGY_PRODUCED.getValue()*ConfigIntValues.OIL_GEN_BURN_TIME.getValue() <= this.getMaxEnergyStored(ForgeDirection.UNKNOWN)-this.getEnergyStored(ForgeDirection.UNKNOWN) && FluidContainerRegistry.BUCKET_VOLUME <= this.tank.getCapacity()-this.tank.getFluidAmount())){
worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, 0, 2); worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, 0, 2);
} }
else worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, 1, 2); }
else{
worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, 1, 2);
}
} }
if(this.storage.getEnergyStored() != this.lastEnergy || this.tank.getFluidAmount() != this.lastTank || this.lastBurnTime != this.currentBurnTime){ if(this.storage.getEnergyStored() != this.lastEnergy || this.tank.getFluidAmount() != this.lastTank || this.lastBurnTime != this.currentBurnTime){
@ -196,7 +199,9 @@ public class TileEntityOilGenerator extends TileEntityInventoryBase implements I
if(values[3] != -1){ if(values[3] != -1){
this.tank.setFluid(new FluidStack(FluidRegistry.getFluid(values[3]), values[2])); this.tank.setFluid(new FluidStack(FluidRegistry.getFluid(values[3]), values[2]));
} }
else this.tank.setFluid(null); else{
this.tank.setFluid(null);
}
} }
@Override @Override

View file

@ -64,7 +64,9 @@ public class TileEntityOreMagnet extends TileEntityInventoryBase implements IEne
this.mine(); this.mine();
} }
} }
else this.currentWorkTimer = ConfigIntValues.ORE_MAGNET_MAX_TIMER.getValue()+MathHelper.getRandomIntegerInRange(worldObj.rand, 0, ConfigIntValues.ORE_MAGNET_MAX_TIMER.getValue()); else{
this.currentWorkTimer = ConfigIntValues.ORE_MAGNET_MAX_TIMER.getValue()+MathHelper.getRandomIntegerInRange(worldObj.rand, 0, ConfigIntValues.ORE_MAGNET_MAX_TIMER.getValue());
}
//Extract energy //Extract energy
this.storage.extractEnergy(ConfigIntValues.ORE_MAGNET_ENERGY_USE.getValue(), false); this.storage.extractEnergy(ConfigIntValues.ORE_MAGNET_ENERGY_USE.getValue(), false);
@ -269,7 +271,9 @@ public class TileEntityOreMagnet extends TileEntityInventoryBase implements IEne
if(values[2] != -1){ if(values[2] != -1){
this.tank.setFluid(new FluidStack(FluidRegistry.getFluid(values[2]), values[1])); this.tank.setFluid(new FluidStack(FluidRegistry.getFluid(values[2]), values[1]));
} }
else this.tank.setFluid(null); else{
this.tank.setFluid(null);
}
} }
@Override @Override

View file

@ -83,12 +83,16 @@ public class TileEntityPhantomPlacer extends TileEntityInventoryBase implements
if(boundPosition.getWorld().getBlock(boundPosition.getX(), boundPosition.getY(), boundPosition.getZ()).isReplaceable(boundPosition.getWorld(), boundPosition.getX(), boundPosition.getY(), boundPosition.getZ())){ if(boundPosition.getWorld().getBlock(boundPosition.getX(), boundPosition.getY(), boundPosition.getZ()).isReplaceable(boundPosition.getWorld(), boundPosition.getX(), boundPosition.getY(), boundPosition.getZ())){
int theSlot = WorldUtil.findFirstFilledSlot(this.slots); int theSlot = WorldUtil.findFirstFilledSlot(this.slots);
this.setInventorySlotContents(theSlot, WorldUtil.placeBlockAtSide(ForgeDirection.UNKNOWN, boundPosition.getWorld(), boundPosition.getX(), boundPosition.getY(), boundPosition.getZ(), this.slots[theSlot])); this.setInventorySlotContents(theSlot, WorldUtil.placeBlockAtSide(ForgeDirection.UNKNOWN, boundPosition.getWorld(), boundPosition.getX(), boundPosition.getY(), boundPosition.getZ(), this.slots[theSlot]));
if(this.slots[theSlot] != null && this.slots[theSlot].stackSize <= 0) this.slots[theSlot] = null; if(this.slots[theSlot] != null && this.slots[theSlot].stackSize <= 0){
this.slots[theSlot] = null;
} }
} }
} }
} }
else this.currentTime = ConfigIntValues.PHANTOM_PLACER_TIME.getValue(); }
else{
this.currentTime = ConfigIntValues.PHANTOM_PLACER_TIME.getValue();
}
} }
} }
} }

View file

@ -52,8 +52,12 @@ public class TileEntityPhantomface extends TileEntityInventoryBase implements IP
int newRange = defaultRange; int newRange = defaultRange;
for(int i = 0; i < 3; i++){ for(int i = 0; i < 3; i++){
Block block = world.getBlock(x, y+1+i, z); Block block = world.getBlock(x, y+1+i, z);
if(block == InitBlocks.blockPhantomBooster) newRange = newRange*2; if(block == InitBlocks.blockPhantomBooster){
else break; newRange = newRange*2;
}
else{
break;
}
} }
return newRange; return newRange;
} }

View file

@ -77,7 +77,9 @@ public class TileEntitySmileyCloud extends TileEntityBase implements IPacketSync
} }
this.name = newName; this.name = newName;
} }
else this.name = null; else{
this.name = null;
}
} }
@Override @Override

View file

@ -99,6 +99,7 @@ public class TileEntityXPSolidifier extends TileEntityInventoryBase implements I
/** /**
* Gets the Player's XP * Gets the Player's XP
* (Excerpted from OpenBlocks' XP system with permission, thanks guys!) * (Excerpted from OpenBlocks' XP system with permission, thanks guys!)
*
* @param player The Player * @param player The Player
* @return The XP * @return The XP
*/ */
@ -109,6 +110,7 @@ public class TileEntityXPSolidifier extends TileEntityInventoryBase implements I
/** /**
* Adds (or removes, if negative) a certain amount of XP from a player * Adds (or removes, if negative) a certain amount of XP from a player
* (Excerpted from OpenBlocks' XP system with permission, thanks guys!) * (Excerpted from OpenBlocks' XP system with permission, thanks guys!)
*
* @param player The Player * @param player The Player
* @param amount The Amount * @param amount The Amount
*/ */
@ -129,14 +131,21 @@ public class TileEntityXPSolidifier extends TileEntityInventoryBase implements I
/** /**
* Gets the amount of experience a certain level contains * Gets the amount of experience a certain level contains
* (Excerpted from OpenBlocks' XP system with permission, thanks guys!) * (Excerpted from OpenBlocks' XP system with permission, thanks guys!)
*
* @param level The Level in question * @param level The Level in question
* @return The total XP the level has * @return The total XP the level has
*/ */
private int getExperienceForLevel(int level){ private int getExperienceForLevel(int level){
if(level > 0){ if(level > 0){
if(level > 0 && level < 16) return level*17; if(level > 0 && level < 16){
else if(level > 15 && level < 31) return (int)(1.5*Math.pow(level, 2)-29.5*level+360); return level*17;
else return (int)(3.5*Math.pow(level, 2)-151.5*level+2220); }
else if(level > 15 && level < 31){
return (int)(1.5*Math.pow(level, 2)-29.5*level+360);
}
else{
return (int)(3.5*Math.pow(level, 2)-151.5*level+2220);
}
} }
return 0; return 0;
} }

View file

@ -30,6 +30,8 @@ public class FakePlayerUtil{
} }
return theFakePlayer; return theFakePlayer;
} }
else return null; else{
return null;
}
} }
} }

View file

@ -34,8 +34,12 @@ public class StringUtil{
} }
public static String toLowerCase(String string){ public static String toLowerCase(String string){
if(string == null) return null; if(string == null){
else return string.toLowerCase(); return null;
}
else{
return string.toLowerCase();
}
} }
public static boolean equalsToLowerCase(String one, String two){ public static boolean equalsToLowerCase(String one, String two){

View file

@ -168,9 +168,12 @@ public class WorldUtil{
if(filled != null && FluidContainerRegistry.isEmptyContainer(slots[inputSlot]) && (slots[outputSlot] == null || (slots[outputSlot].isItemEqual(filled) && slots[outputSlot].stackSize < slots[outputSlot].getMaxStackSize()))){ if(filled != null && FluidContainerRegistry.isEmptyContainer(slots[inputSlot]) && (slots[outputSlot] == null || (slots[outputSlot].isItemEqual(filled) && slots[outputSlot].stackSize < slots[outputSlot].getMaxStackSize()))){
int cap = FluidContainerRegistry.getContainerCapacity(tank.getFluid(), slots[inputSlot]); int cap = FluidContainerRegistry.getContainerCapacity(tank.getFluid(), slots[inputSlot]);
if(cap > 0 && cap <= tank.getFluidAmount()){ if(cap > 0 && cap <= tank.getFluidAmount()){
if(slots[outputSlot] == null) if(slots[outputSlot] == null){
slots[outputSlot] = FluidContainerRegistry.fillFluidContainer(tank.getFluid(), slots[inputSlot].copy()); slots[outputSlot] = FluidContainerRegistry.fillFluidContainer(tank.getFluid(), slots[inputSlot].copy());
else slots[outputSlot].stackSize++; }
else{
slots[outputSlot].stackSize++;
}
if(slots[outputSlot] != null){ if(slots[outputSlot] != null){
tank.drain(cap, true); tank.drain(cap, true);
@ -190,9 +193,12 @@ public class WorldUtil{
if(slots[inputSlot] != null && FluidContainerRegistry.isFilledContainer(slots[inputSlot]) && (slots[outputSlot] == null || (slots[outputSlot].isItemEqual(FluidContainerRegistry.drainFluidContainer(slots[inputSlot].copy())) && slots[outputSlot].stackSize < slots[outputSlot].getMaxStackSize()))){ if(slots[inputSlot] != null && FluidContainerRegistry.isFilledContainer(slots[inputSlot]) && (slots[outputSlot] == null || (slots[outputSlot].isItemEqual(FluidContainerRegistry.drainFluidContainer(slots[inputSlot].copy())) && slots[outputSlot].stackSize < slots[outputSlot].getMaxStackSize()))){
if(containedFluid == null || FluidContainerRegistry.containsFluid(slots[inputSlot], new FluidStack(containedFluid, 0))){ if(containedFluid == null || FluidContainerRegistry.containsFluid(slots[inputSlot], new FluidStack(containedFluid, 0))){
if((tank.getFluid() == null || FluidContainerRegistry.getFluidForFilledItem(slots[inputSlot]).isFluidEqual(tank.getFluid())) && tank.getCapacity()-tank.getFluidAmount() >= FluidContainerRegistry.getContainerCapacity(slots[inputSlot])){ if((tank.getFluid() == null || FluidContainerRegistry.getFluidForFilledItem(slots[inputSlot]).isFluidEqual(tank.getFluid())) && tank.getCapacity()-tank.getFluidAmount() >= FluidContainerRegistry.getContainerCapacity(slots[inputSlot])){
if(slots[outputSlot] == null) if(slots[outputSlot] == null){
slots[outputSlot] = FluidContainerRegistry.drainFluidContainer(slots[inputSlot].copy()); slots[outputSlot] = FluidContainerRegistry.drainFluidContainer(slots[inputSlot].copy());
else slots[outputSlot].stackSize++; }
else{
slots[outputSlot].stackSize++;
}
tank.fill(FluidContainerRegistry.getFluidForFilledItem(slots[inputSlot]), true); tank.fill(FluidContainerRegistry.getFluidForFilledItem(slots[inputSlot]), true);
slots[inputSlot].stackSize--; slots[inputSlot].stackSize--;
@ -218,7 +224,9 @@ public class WorldUtil{
if(side < VERTICAL_DIRECTIONS_ORDER.length){ if(side < VERTICAL_DIRECTIONS_ORDER.length){
return VERTICAL_DIRECTIONS_ORDER[side]; return VERTICAL_DIRECTIONS_ORDER[side];
} }
else return CARDINAL_DIRECTIONS_ORDER[side-VERTICAL_DIRECTIONS_ORDER.length]; else{
return CARDINAL_DIRECTIONS_ORDER[side-VERTICAL_DIRECTIONS_ORDER.length];
}
} }
return ForgeDirection.UNKNOWN; return ForgeDirection.UNKNOWN;
} }
@ -240,8 +248,12 @@ public class WorldUtil{
if(slots[i] == null || (slots[i].isItemEqual(stack) && slots[i].stackSize <= stack.getMaxStackSize()-stack.stackSize)){ if(slots[i] == null || (slots[i].isItemEqual(stack) && slots[i].stackSize <= stack.getMaxStackSize()-stack.stackSize)){
working++; working++;
if(actuallyDo){ if(actuallyDo){
if(slots[i] == null) slots[i] = stack.copy(); if(slots[i] == null){
else slots[i].stackSize += stack.stackSize; slots[i] = stack.copy();
}
else{
slots[i].stackSize += stack.stackSize;
}
} }
break; break;
} }