Remove unneeded casts since 1.8.8 restores generics

This commit is contained in:
Vincent Lee committed 2015-12-21 12:53:59 -06:00
1 parent dbb549ba2a
commit c480a3303a
46 files changed
+71 -71

No files matched your search

@@ -63,7 +63,7 @@ public class CorporeaAutoCompleteHandler {
if(item != null && item.getCreativeTab() != null) {
curList.clear();
try {
item.getSubItems(item, (CreativeTabs) null, curList);
item.getSubItems(item, null, curList);
for(ItemStack stack : curList)
itemNames.add(CorporeaHelper.stripControlCodes(stack.getDisplayName().trim()));
}
@@ -27,7 +27,7 @@ public class GuiAchievementsHacky extends GuiAchievements {
@Override
public void initGui() {
super.initGui();
((GuiButton) buttonList.get(1)).displayString = ModAchievements.botaniaPage.getName();
buttonList.get(1).displayString = ModAchievements.botaniaPage.getName();
}
}
@@ -65,7 +65,7 @@ public class ContainerFlowerBag extends Container {
@Override
public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int p_82846_2_) {
ItemStack itemstack = null;
Slot slot = (Slot)inventorySlots.get(p_82846_2_);
Slot slot = inventorySlots.get(p_82846_2_);
if(slot != null && slot.getHasStack()) {
ItemStack itemstack1 = slot.getStack();
@@ -77,14 +77,14 @@ public class ContainerFlowerBag extends Container {
} else {
int i = itemstack.getItemDamage();
if(i < 16) {
Slot slot1 = (Slot)inventorySlots.get(i);
Slot slot1 = inventorySlots.get(i);
if(slot1.isItemValid(itemstack) && !mergeItemStack(itemstack1, i, i + 1, true))
return null;
}
}
if(itemstack1.stackSize == 0)
slot.putStack((ItemStack)null);
slot.putStack(null);
else slot.onSlotChanged();
if(itemstack1.stackSize == itemstack.stackSize)
@@ -91,7 +91,7 @@ public class ContainerBaubleBox extends Container {
@Override
public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int p_82846_2_) {
ItemStack itemstack = null;
Slot slot = (Slot)inventorySlots.get(p_82846_2_);
Slot slot = inventorySlots.get(p_82846_2_);
if(slot != null && slot.getHasStack()) {
ItemStack itemstack1 = slot.getStack();
@@ -107,7 +107,7 @@ public class ContainerBaubleBox extends Container {
}
if(itemstack1.stackSize == 0)
slot.putStack((ItemStack)null);
slot.putStack(null);
else slot.onSlotChanged();
if(itemstack1.stackSize == itemstack.stackSize)
@@ -43,7 +43,7 @@ public class GuiBaubleBox extends InventoryEffectRenderer {
drawTexturedModalRect(k, l, 0, 0, xSize, ySize);
for(int i1 = 0; i1 < 4; ++i1) {
Slot slot = (Slot) inventorySlots.inventorySlots.get(i1);
Slot slot = inventorySlots.inventorySlots.get(i1);
if(slot.getHasStack() && slot.getSlotStackLimit() == 1)
drawTexturedModalRect(k+slot.xDisplayPosition, l+slot.yDisplayPosition, 200, 0, 16, 16);
}
@@ -320,7 +320,7 @@ public class GuiLexiconEntry extends GuiLexicon implements IGuiLexiconEntry, IPa
page.onKeyPressed(par1, par2);
if(par2 == 1) {
mc.displayGuiScreen((GuiScreen)null);
mc.displayGuiScreen(null);
mc.setIngameFocus();
} else if(par2 == 203 || par2 == 200 || par2 == 201) // Left, Up, Page Up
prevPage();
@@ -91,7 +91,7 @@ public class BlockAlfPortal extends BlockModContainer implements IWandable, ILex
@Override
public int getLightValue(IBlockAccess world, BlockPos pos) {
return ((AlfPortalState) world.getBlockState(pos).getValue(BotaniaStateProps.ALFPORTAL_STATE)) == AlfPortalState.OFF ? 0 : 15;
return world.getBlockState(pos).getValue(BotaniaStateProps.ALFPORTAL_STATE) == AlfPortalState.OFF ? 0 : 15;
}
}
@@ -45,7 +45,7 @@ public class BlockCacophonium extends BlockModContainer {
@Override
public int getMetaFromState(IBlockState state) {
return ((Boolean) state.getValue(BotaniaStateProps.POWERED)) ? 8 : 0;
return state.getValue(BotaniaStateProps.POWERED) ? 8 : 0;
}
@Override
@@ -66,7 +66,7 @@ public class BlockCacophonium extends BlockModContainer {
@Override
public void onNeighborBlockChange(World world, BlockPos pos, IBlockState state, Block block) {
boolean power = world.isBlockIndirectlyGettingPowered(pos) > 0 || world.isBlockIndirectlyGettingPowered(pos.up()) > 0;
boolean powered = ((Boolean) state.getValue(BotaniaStateProps.POWERED));
boolean powered = state.getValue(BotaniaStateProps.POWERED);
if(power && !powered) {
TileEntity tile = world.getTileEntity(pos);
@@ -50,7 +50,7 @@ public class BlockEnderEye extends BlockModContainer implements ILexiconable {
@Override
public int getMetaFromState(IBlockState state) {
return ((Boolean) state.getValue(BotaniaStateProps.POWERED)) ? 15 : 0;
return state.getValue(BotaniaStateProps.POWERED) ? 15 : 0;
}
@Override
@@ -60,7 +60,7 @@ public class BlockEnderEye extends BlockModContainer implements ILexiconable {
@Override
public int getWeakPower(IBlockAccess world, BlockPos pos, IBlockState state, EnumFacing side) {
return ((Integer) state.getValue(BotaniaStateProps.POWER));
return state.getValue(BotaniaStateProps.POWER);
}
@Override
@@ -56,7 +56,7 @@ public class BlockGaiaHead extends BlockSkull {
public List<ItemStack> getDrops(IBlockAccess p_149749_1_, BlockPos pos, IBlockState state, int fortune) {
ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
if(!((Boolean) state.getValue(NODROP))) {
if(!state.getValue(NODROP)) {
ItemStack itemstack = new ItemStack(ModItems.gaiaHead, 1);
TileEntitySkull tileentityskull = (TileEntitySkull)p_149749_1_.getTileEntity(pos);
@@ -69,7 +69,7 @@ public class BlockHourglass extends BlockModContainer implements IManaTrigger, I
@Override
public int getMetaFromState(IBlockState state) {
return ((Boolean) state.getValue(BotaniaStateProps.POWERED)) ? 1 : 0;
return state.getValue(BotaniaStateProps.POWERED) ? 1 : 0;
}
@Override
@@ -115,7 +115,7 @@ public class BlockHourglass extends BlockModContainer implements IManaTrigger, I
@Override
public int getWeakPower(IBlockAccess world, BlockPos pos, IBlockState state, EnumFacing side) {
return ((Boolean) state.getValue(BotaniaStateProps.POWERED)) ? 0 : 15;
return state.getValue(BotaniaStateProps.POWERED) ? 0 : 15;
}
@Override
@@ -67,7 +67,7 @@ public class BlockLightRelay extends BlockModContainer implements IWandable, ILe
@Override
public int getMetaFromState(IBlockState state) {
int meta = state.getValue(BotaniaStateProps.LUMINIZER_VARIANT) == LuminizerVariant.DETECTOR ? 1 : 0;
if (((Boolean) state.getValue(BotaniaStateProps.POWERED))) {
if (state.getValue(BotaniaStateProps.POWERED)) {
meta |= 8;
} else {
meta &= -9;
@@ -149,7 +149,7 @@ public class BlockLightRelay extends BlockModContainer implements IWandable, ILe
@Override
public int getWeakPower(IBlockAccess world, BlockPos pos, IBlockState state, EnumFacing s) {
return state.getValue(BotaniaStateProps.LUMINIZER_VARIANT) == LuminizerVariant.DEFAULT
&& ((Boolean) state.getValue(BotaniaStateProps.POWERED)) ? 15 : 0;
&& state.getValue(BotaniaStateProps.POWERED) ? 15 : 0;
}
@Override
@@ -211,7 +211,7 @@ public class BlockPistonRelay extends BlockMod implements IWandable, ILexiconabl
if(block == Blocks.piston_extension) {
IBlockState state = getStateAt(s);
boolean sticky = BlockPistonExtension.EnumPistonType.STICKY == state.getValue(BlockPistonMoving.TYPE);
EnumFacing dir = ((EnumFacing) state.getValue(BlockPistonMoving.FACING)).getOpposite();
EnumFacing dir = state.getValue(BlockPistonMoving.FACING).getOpposite();
MinecraftServer server = MinecraftServer.getServer();
@@ -57,7 +57,7 @@ public class BlockSparkChanger extends BlockModContainer implements ILexiconable
@Override
public int getMetaFromState(IBlockState state) {
return ((Boolean) state.getValue(BotaniaStateProps.POWERED)) ? 8 : 0;
return state.getValue(BotaniaStateProps.POWERED) ? 8 : 0;
}
@Override
@@ -83,7 +83,7 @@ public class BlockSparkChanger extends BlockModContainer implements ILexiconable
@Override
public void onNeighborBlockChange(World world, BlockPos pos, IBlockState state, Block block) {
boolean power = world.isBlockIndirectlyGettingPowered(pos) > 0 || world.isBlockIndirectlyGettingPowered(pos.up()) > 0;
boolean powered = ((Boolean) state.getValue(BotaniaStateProps.POWERED));
boolean powered = state.getValue(BotaniaStateProps.POWERED);
if(power && !powered) {
((TileSparkChanger) world.getTileEntity(pos)).doSwap();
@@ -43,7 +43,7 @@ public class BlockCorporeaFunnel extends BlockCorporeaBase implements ILexiconab
@Override
public int getMetaFromState(IBlockState state) {
return ((Boolean) state.getValue(BotaniaStateProps.POWERED)) ? 8 : 0;
return state.getValue(BotaniaStateProps.POWERED) ? 8 : 0;
}
@Override
@@ -54,7 +54,7 @@ public class BlockCorporeaFunnel extends BlockCorporeaBase implements ILexiconab
@Override
public void onNeighborBlockChange(World world, BlockPos pos, IBlockState state, Block block) {
boolean power = world.isBlockIndirectlyGettingPowered(pos) > 0 || world.isBlockIndirectlyGettingPowered(pos.up()) > 0;
boolean powered = ((Boolean) state.getValue(BotaniaStateProps.POWERED));
boolean powered = state.getValue(BotaniaStateProps.POWERED);
if(power && !powered) {
((TileCorporeaFunnel) world.getTileEntity(pos)).doRequest();
@@ -46,7 +46,7 @@ public class BlockCorporeaInterceptor extends BlockCorporeaBase implements ILexi
@Override
public int getMetaFromState(IBlockState state) {
return ((Boolean) state.getValue(BotaniaStateProps.POWERED)) ? 1 : 0;
return state.getValue(BotaniaStateProps.POWERED) ? 1 : 0;
}
@Override
@@ -66,7 +66,7 @@ public class BlockCorporeaInterceptor extends BlockCorporeaBase implements ILexi
@Override
public int getWeakPower(IBlockAccess world, BlockPos pos, IBlockState state, EnumFacing side) {
return ((Boolean) state.getValue(BotaniaStateProps.POWERED)) ? 15 : 0;
return state.getValue(BotaniaStateProps.POWERED) ? 15 : 0;
}
@Override
@@ -48,7 +48,7 @@ public class BlockCorporeaRetainer extends BlockModContainer implements ILexicon
@Override
public int getMetaFromState(IBlockState state) {
return ((Boolean) state.getValue(BotaniaStateProps.POWERED)) ? 8 : 0;
return state.getValue(BotaniaStateProps.POWERED) ? 8 : 0;
}
@Override
@@ -59,7 +59,7 @@ public class BlockCorporeaRetainer extends BlockModContainer implements ILexicon
@Override
public void onNeighborBlockChange(World world, BlockPos pos, IBlockState state, Block block) {
boolean power = world.isBlockIndirectlyGettingPowered(pos) > 0 || world.isBlockIndirectlyGettingPowered(pos.up()) > 0;
boolean powered = ((Boolean) state.getValue(BotaniaStateProps.POWERED));
boolean powered = state.getValue(BotaniaStateProps.POWERED);
if(power && !powered) {
((TileCorporeaRetainer) world.getTileEntity(pos)).fulfilRequest();
@@ -46,7 +46,7 @@ public class BlockStarfield extends BlockModContainer implements ILexiconable {
@Override
public int getMetaFromState(IBlockState state) {
return ((Boolean) state.getValue(BotaniaStateProps.POWERED)) ? 1 : 0;
return state.getValue(BotaniaStateProps.POWERED) ? 1 : 0;
}
@Override
@@ -63,7 +63,7 @@ public class BlockBrewery extends BlockModContainer implements ILexiconable, IWa
@Override
public int getMetaFromState(IBlockState state) {
return ((Boolean) state.getValue(BotaniaStateProps.POWERED)) ? 1 : 0;
return state.getValue(BotaniaStateProps.POWERED) ? 1 : 0;
}
@Override
@@ -76,7 +76,7 @@ public class BlockBrewery extends BlockModContainer implements ILexiconable, IWa
TileBrewery brew = (TileBrewery) par1World.getTileEntity(pos);
if(par5EntityPlayer.isSneaking()) {
if(brew.recipe == null && !((Boolean) state.getValue(BotaniaStateProps.POWERED)))
if(brew.recipe == null && !state.getValue(BotaniaStateProps.POWERED))
for(int i = brew.getSizeInventory() - 1; i >= 0; i--) {
ItemStack stackAt = brew.getStackInSlot(i);
if(stackAt != null) {
@@ -53,7 +53,7 @@ public class BlockManaDetector extends BlockModContainer implements ILexiconable
@Override
public int getMetaFromState(IBlockState state) {
return ((Boolean) state.getValue(BotaniaStateProps.POWERED)) ? 1 : 0;
return state.getValue(BotaniaStateProps.POWERED) ? 1 : 0;
}
@Override
@@ -68,7 +68,7 @@ public class BlockManaDetector extends BlockModContainer implements ILexiconable
@Override
public int getWeakPower(IBlockAccess par1iBlockAccess, BlockPos pos, IBlockState state, EnumFacing side) {
return ((Boolean) state.getValue(BotaniaStateProps.POWERED)) ? 15 : 0;
return state.getValue(BotaniaStateProps.POWERED) ? 15 : 0;
}
@Override
@@ -67,8 +67,8 @@ public class BlockPrism extends BlockModContainer implements IManaTrigger, ILexi
@Override
public int getMetaFromState(IBlockState state) {
return (((Boolean) state.getValue(BotaniaStateProps.POWERED)) ? 8 : 0)
+ (((Boolean) state.getValue(BotaniaStateProps.HAS_LENS)) ? 1 : 0);
return (state.getValue(BotaniaStateProps.POWERED) ? 8 : 0)
+ (state.getValue(BotaniaStateProps.HAS_LENS) ? 1 : 0);
}
@Override
@@ -132,7 +132,7 @@ public class BlockPrism extends BlockModContainer implements IManaTrigger, ILexi
@Override
public void onNeighborBlockChange(World world, BlockPos pos, IBlockState state, Block block) {
boolean power = world.isBlockIndirectlyGettingPowered(pos) > 0 || world.isBlockIndirectlyGettingPowered(pos.up()) > 0;
boolean powered = ((Boolean) state.getValue(BotaniaStateProps.POWERED));
boolean powered = state.getValue(BotaniaStateProps.POWERED);
if(!world.isRemote) {
if(power && !powered)
@@ -36,7 +36,7 @@ public class BlockRedStringDispenser extends BlockRedString {
@Override
public int getMetaFromState(IBlockState state) {
int meta = ((EnumFacing) state.getValue(BotaniaStateProps.FACING)).getIndex();
if (((Boolean) state.getValue(BotaniaStateProps.POWERED))) {
if (state.getValue(BotaniaStateProps.POWERED)) {
meta |= 8;
} else {
meta &= -9;
@@ -55,7 +55,7 @@ public class BlockRedStringDispenser extends BlockRedString {
@Override
public void onNeighborBlockChange(World world, BlockPos pos, IBlockState state, Block block) {
boolean power = world.isBlockIndirectlyGettingPowered(pos) > 0 || world.isBlockIndirectlyGettingPowered(pos.up()) > 0;
boolean powered = ((Boolean) state.getValue(BotaniaStateProps.POWERED));
boolean powered = state.getValue(BotaniaStateProps.POWERED);
if(power && !powered) {
((TileRedStringDispenser) world.getTileEntity(pos)).tickDispenser();
@@ -43,7 +43,7 @@ public class BlockRedStringInterceptor extends BlockRedString {
@Override
public int getMetaFromState(IBlockState state) {
int meta = ((EnumFacing) state.getValue(BotaniaStateProps.FACING)).getIndex();
if (((Boolean) state.getValue(BotaniaStateProps.POWERED))) {
if (state.getValue(BotaniaStateProps.POWERED)) {
meta |= 8;
} else {
meta &= -9;
@@ -72,7 +72,7 @@ public class BlockRedStringInterceptor extends BlockRedString {
@Override
public int getWeakPower(IBlockAccess world, BlockPos pos, IBlockState state, EnumFacing side) {
return ((Boolean) state.getValue(BotaniaStateProps.POWERED)) ? 15 : 0;
return state.getValue(BotaniaStateProps.POWERED) ? 15 : 0;
}
@Override
@@ -63,7 +63,7 @@ public class SubTileHydroangeas extends SubTilePassiveGenerating {
BlockPos pos = supertile.getPos().add(offset);
Material search = getMaterialToSearchFor();
if(supertile.getWorld().getBlockState(pos).getBlock().getMaterial() == search && (getBlockToSearchBelow() == null || supertile.getWorld().getBlockState(pos.down()).getBlock() == getBlockToSearchBelow()) && ((Integer) supertile.getWorld().getBlockState(pos).getValue(BlockLiquid.LEVEL))/* todo 1.8 may crash */ == 0) {
if(supertile.getWorld().getBlockState(pos).getBlock().getMaterial() == search && (getBlockToSearchBelow() == null || supertile.getWorld().getBlockState(pos.down()).getBlock() == getBlockToSearchBelow()) && supertile.getWorld().getBlockState(pos).getValue(BlockLiquid.LEVEL)/* todo 1.8 may crash */ == 0) {
if(search != Material.water)
supertile.getWorld().setBlockToAir(pos);
else {
@@ -37,7 +37,7 @@ public class SubTileKekimurus extends SubTileGenerating {
IBlockState state = supertile.getWorld().getBlockState(pos);
Block block = state.getBlock();
if(block instanceof BlockCake) {
int nextSlicesEaten = ((Integer) state.getValue(BlockCake.BITES)) + 1;
int nextSlicesEaten = state.getValue(BlockCake.BITES) + 1;
if(nextSlicesEaten == 6)
supertile.getWorld().setBlockToAir(pos);
else supertile.getWorld().setBlockState(pos, state.withProperty(BlockCake.BITES, nextSlicesEaten), 1 | 2);
@@ -27,7 +27,7 @@ public class TileEnderEye extends TileMod implements ITickable {
@Override
public void update() {
boolean wasLooking = ((Boolean) worldObj.getBlockState(getPos()).getValue(BotaniaStateProps.POWERED));
boolean wasLooking = worldObj.getBlockState(getPos()).getValue(BotaniaStateProps.POWERED);
int range = 80;
List<EntityPlayer> players = worldObj.getEntitiesWithinAABB(EntityPlayer.class, new AxisAlignedBB(pos.add(-range, -range, -range), pos.add(range, range, range)));
@@ -18,7 +18,7 @@ public class TileStarfield extends TileMod implements ITickable {
@Override
public void update() {
boolean state = ((Boolean) worldObj.getBlockState(getPos()).getValue(BotaniaStateProps.POWERED));
boolean state = worldObj.getBlockState(getPos()).getValue(BotaniaStateProps.POWERED);
if(!worldObj.isRemote) {
boolean newState = !worldObj.isDaytime();
if(newState != state) {
@@ -57,7 +57,7 @@ public class TileCorporeaInterceptor extends TileCorporeaBase implements ICorpor
for(ItemStack stack_ : stacks)
missing -= stack_.stackSize;
if(missing > 0 && !((Boolean) worldObj.getBlockState(getPos()).getValue(BotaniaStateProps.POWERED))) {
if(missing > 0 && !worldObj.getBlockState(getPos()).getValue(BotaniaStateProps.POWERED)) {
worldObj.setBlockState(getPos(), worldObj.getBlockState(getPos()).withProperty(BotaniaStateProps.POWERED, true), 1 | 2);
worldObj.scheduleUpdate(getPos(), getBlockType(), 2);
@@ -68,7 +68,7 @@ public class TileBellows extends TileMod implements ITickable {
if(furnace.getBlockType() == Blocks.lit_furnace) {
// Copypasta from BlockFurnace
EnumFacing enumfacing = (EnumFacing)worldObj.getBlockState(furnace.getPos()).getValue(BlockFurnace.FACING);
EnumFacing enumfacing = worldObj.getBlockState(furnace.getPos()).getValue(BlockFurnace.FACING);
double d0 = (double)pos.getX() + 0.5D;
double d1 = (double)pos.getY() + worldObj.rand.nextDouble() * 6.0D / 16.0D;
double d2 = (double)pos.getZ() + 0.5D;
@@ -25,7 +25,7 @@ public class TileManaDetector extends TileMod implements IManaCollisionGhost, IT
@Override
public void update() {
if(!worldObj.isRemote) {
boolean state = ((Boolean) worldObj.getBlockState(getPos()).getValue(BotaniaStateProps.POWERED));
boolean state = worldObj.getBlockState(getPos()).getValue(BotaniaStateProps.POWERED);
boolean expectedState = worldObj.getEntitiesWithinAABB(Entity.class, new AxisAlignedBB(pos, pos.add(1, 1, 1)), Predicates.instanceOf(IManaBurst.class)).size() != 0;
if(state != expectedState)
worldObj.setBlockState(getPos(), worldObj.getBlockState(getPos()).withProperty(BotaniaStateProps.POWERED, expectedState), 1 | 2);
@@ -45,7 +45,7 @@ public final class AliasHandler {
private static Item getItem(String name) {
for(Object o : Item.itemRegistry.getKeys()) {
Item i = (Item) Item.itemRegistry.getObject(new ResourceLocation(o));
Item i = Item.itemRegistry.getObject(new ResourceLocation(o));
if(i.getUnlocalizedName().substring("item.".length()).equals(name))
return i;
}
@@ -55,7 +55,7 @@ public final class AliasHandler {
private static Block getBlock(String name) {
for(Object o : Block.blockRegistry.getKeys()) {
Block b = (Block) Block.blockRegistry.getObject(new ResourceLocation(o));
Block b = Block.blockRegistry.getObject(new ResourceLocation(o));
if(b.getUnlocalizedName().substring("tile.".length()).equals(name))
return b;
}
@@ -70,7 +70,7 @@ public final class SheddingHandler {
int i = 1;
for(ShedPattern pattern : patterns) {
PageShedding page = new PageShedding(String.valueOf(i), (String)EntityList.classToStringMapping.get(pattern.EntityClass), pattern.lexiconSize, pattern.getItemStack());
PageShedding page = new PageShedding(String.valueOf(i), EntityList.classToStringMapping.get(pattern.EntityClass), pattern.lexiconSize, pattern.getItemStack());
LexiconData.shedding.addPage(page);
}
}
@@ -124,7 +124,7 @@ public final class SheddingHandler {
lexiconSize = config.get("Shedding", key + ".lexiconDisplaySize", lexiconSize).getInt();
if(itemName != null && !itemName.isEmpty() && rate != -1)
patterns.add(new ShedPattern((Class<?>) EntityList.stringToClassMapping.get(key), new ItemStack((Item) Item.itemRegistry.getObject(itemName), 1, metadata), rate, lexiconSize));
patterns.add(new ShedPattern(EntityList.stringToClassMapping.get(key), new ItemStack(Item.itemRegistry.getObject(itemName), 1, metadata), rate, lexiconSize));
}
public static class ShedPattern {
@@ -149,7 +149,7 @@ public final class SheddingHandler {
}
public String getEntityString() {
return (String) EntityList.classToStringMapping.get(EntityClass);
return EntityList.classToStringMapping.get(EntityClass);
}
}
@@ -70,8 +70,8 @@ public class ModBrewRecipes {
}
public static void initTC() {
Item resource = (Item) Item.itemRegistry.getObject("Thaumcraft:ItemResource");
Item bathSalts = (Item) Item.itemRegistry.getObject("Thaumcraft:ItemBathSalts");
Item resource = Item.itemRegistry.getObject("Thaumcraft:ItemResource");
Item bathSalts = Item.itemRegistry.getObject("Thaumcraft:ItemBathSalts");
warpWardBrew = BotaniaAPI.registerBrewRecipe(ModBrews.warpWard, new ItemStack(Items.nether_wart), new ItemStack(resource, 1, 14), new ItemStack(bathSalts), new ItemStack(resource, 1, 6));
}
@@ -24,7 +24,7 @@ public class HelmRevealingRecipe implements IRecipe {
@Override
public boolean matches(InventoryCrafting var1, World var2) {
Item goggles = (Item) Item.itemRegistry.getObject("Thaumcraft:ItemGoggles");
Item goggles = Item.itemRegistry.getObject("Thaumcraft:ItemGoggles");
if(goggles == null)
return false; // NO TC loaded
@@ -628,10 +628,10 @@ public class EntityDoppleganger extends EntityCreature implements IBotaniaBossWi
}
case 1 : {
entity = new EntitySkeleton(worldObj);
((EntitySkeleton) entity).setCurrentItemOrArmor(0, new ItemStack(Items.bow));
entity.setCurrentItemOrArmor(0, new ItemStack(Items.bow));
if(worldObj.rand.nextInt(8) == 0) {
((EntitySkeleton) entity).setSkeletonType(1);
((EntitySkeleton) entity).setCurrentItemOrArmor(0, new ItemStack(hard ? ModItems.elementiumSword : Items.stone_sword));
entity.setCurrentItemOrArmor(0, new ItemStack(hard ? ModItems.elementiumSword : Items.stone_sword));
}
break;
}
@@ -53,7 +53,7 @@ public class EntityEnderAirBottle extends EntityThrowable {
int range = 4;
int rangeY = 4;
for (BlockPos bPos : ((Iterable<BlockPos>) BlockPos.getAllInBox(pos.add(-range, -rangeY, -range), pos.add(range, rangeY, range)))) {
for (BlockPos bPos : BlockPos.getAllInBox(pos.add(-range, -rangeY, -range), pos.add(range, rangeY, range))) {
Block block = worldObj.getBlockState(pos).getBlock();
if(block != null && block.isReplaceableOreGen(worldObj, pos, BlockHelper.forBlock(Blocks.stone)))
possibleCoords.add(pos);
@@ -119,9 +119,9 @@ public class EntityThornChakram extends EntityThrowable {
boolean fire = isFire();
EntityLivingBase thrower = getThrower();
if(pos.entityHit != null && pos.entityHit instanceof EntityLivingBase && pos.entityHit != thrower) {
((EntityLivingBase) pos.entityHit).attackEntityFrom(thrower != null ? thrower instanceof EntityPlayer ? DamageSource.causePlayerDamage((EntityPlayer) thrower) : DamageSource.causeMobDamage(thrower) : DamageSource.generic, 12);
pos.entityHit.attackEntityFrom(thrower != null ? thrower instanceof EntityPlayer ? DamageSource.causePlayerDamage((EntityPlayer) thrower) : DamageSource.causeMobDamage(thrower) : DamageSource.generic, 12);
if(fire)
((EntityLivingBase) pos.entityHit).setFire(5);
pos.entityHit.setFire(5);
else if(worldObj.rand.nextInt(3) == 0)
((EntityLivingBase) pos.entityHit).addPotionEffect(new PotionEffect(Potion.poison.id, 60, 0));
} else {
@@ -311,7 +311,7 @@ public abstract class EntityThrowableCopy extends Entity implements IProjectile
tagCompound.setShort("xTile", (short)this.xTile);
tagCompound.setShort("yTile", (short)this.yTile);
tagCompound.setShort("zTile", (short)this.zTile);
ResourceLocation resourcelocation = (ResourceLocation)Block.blockRegistry.getNameForObject(this.inTile);
ResourceLocation resourcelocation = Block.blockRegistry.getNameForObject(this.inTile);
tagCompound.setString("inTile", resourcelocation == null ? "" : resourcelocation.toString());
tagCompound.setByte("shake", (byte)this.throwableShake);
tagCompound.setByte("inGround", (byte)(this.inGround ? 1 : 0));
@@ -44,7 +44,7 @@ public class ItemOpenBucket extends ItemMod {
return par1ItemStack;
Material material = par2World.getBlockState(pos).getBlock().getMaterial();
int l = ((Integer) par2World.getBlockState(pos).getValue(BlockLiquid.LEVEL));
int l = par2World.getBlockState(pos).getValue(BlockLiquid.LEVEL);
if((material == Material.lava || material == Material.water) && l == 0) {
par2World.setBlockToAir(pos);
@@ -93,7 +93,7 @@ public class ItemIcePendant extends ItemBauble implements IBaubleRender {
playerIceBlocks.put(user, new ArrayList());
List<IceRemover> ice = playerIceBlocks.get(user);
if(player.worldObj.getBlockState(coords).getBlock() == Blocks.water && ((Integer) player.worldObj.getBlockState(coords).getValue(BlockLiquid.LEVEL)) == 0) {
if(player.worldObj.getBlockState(coords).getBlock() == Blocks.water && player.worldObj.getBlockState(coords).getValue(BlockLiquid.LEVEL) == 0) {
player.worldObj.setBlockState(coords, Blocks.ice.getDefaultState());
if(!player.worldObj.isRemote)
@@ -51,7 +51,7 @@ public final class ToolCommons {
public static void removeBlocksInIteration(EntityPlayer player, ItemStack stack, World world, BlockPos pos, BlockPos posStart, BlockPos posEnd, Block block, Material[] materialsListing, boolean silk, int fortune, boolean dispose) {
float blockHardness = block == null ? 1F : block.getBlockHardness(world, pos);
for (BlockPos iterPos : ((Iterable<BlockPos>) BlockPos.getAllInBox(posStart, posEnd))) {
for (BlockPos iterPos : BlockPos.getAllInBox(posStart, posEnd)) {
removeBlockWithDrops(player, stack, world, iterPos, pos, block, materialsListing, silk, fortune, blockHardness, dispose);
}
}
@@ -50,7 +50,7 @@ public class ItemElementiumAxe extends ItemManasteelAxe {
addDrop(event, new ItemStack(Items.skull, 1, 4));
else if(event.entityLiving instanceof EntityPlayer && rand.nextInt(11) <= 1 + looting) {
ItemStack stack = new ItemStack(Items.skull, 1, 3);
ItemNBTHelper.setString(stack, "SkullOwner", ((EntityPlayer)event.entityLiving).getName());
ItemNBTHelper.setString(stack, "SkullOwner", event.entityLiving.getName());
addDrop(event, stack);
} else if(event.entityLiving instanceof EntityDoppleganger && rand.nextInt(13) < 1 + looting)
addDrop(event, new ItemStack(ModItems.gaiaHead));
@@ -108,7 +108,7 @@ public class ItemTerraSword extends ItemManasteelSword implements ILensEffect, I
String attacker = ItemNBTHelper.getString(burst.getSourceLens(), TAG_ATTACKER_USERNAME, "");
for(EntityLivingBase living : entities) {
if(living instanceof EntityPlayer && (((EntityPlayer) living).getName().equals(attacker) || MinecraftServer.getServer() != null && !MinecraftServer.getServer().isPVPEnabled()))
if(living instanceof EntityPlayer && (living.getName().equals(attacker) || MinecraftServer.getServer() != null && !MinecraftServer.getServer().isPVPEnabled()))
continue;
if(living.hurtTime == 0) {
@@ -33,7 +33,7 @@ public class LensMagnet extends Lens {
int range = 3;
magnetize : {
for (BlockPos pos : ((Iterable<BlockPos>) BlockPos.getAllInBox(basePos.add(-range, -range, -range), basePos.add(range, range, range)))) {
for (BlockPos pos : BlockPos.getAllInBox(basePos.add(-range, -range, -range), basePos.add(range, range, range))) {
if(entity.worldObj.getTileEntity(pos) instanceof IManaReceiver) {
TileEntity tile = entity.worldObj.getTileEntity(pos);
@@ -131,8 +131,8 @@ public class PageCraftingRecipe extends PageRecipe {
renderItemAtGridPos(gui, 1 + x, 1 + y, shaped.recipeItems[y * shaped.recipeWidth + x], true);
} else if(recipe instanceof ShapedOreRecipe) {
ShapedOreRecipe shaped = (ShapedOreRecipe) recipe;
int width = (Integer) ReflectionHelper.getPrivateValue(ShapedOreRecipe.class, shaped, 4);
int height = (Integer) ReflectionHelper.getPrivateValue(ShapedOreRecipe.class, shaped, 5);
int width = ReflectionHelper.getPrivateValue(ShapedOreRecipe.class, shaped, 4);
int height = ReflectionHelper.getPrivateValue(ShapedOreRecipe.class, shaped, 5);
for(int y = 0; y < height; y++)
for(int x = 0; x < width; x++) {
@@ -153,7 +153,7 @@ public class PageCraftingRecipe extends PageRecipe {
if(index >= shapeless.recipeItems.size())
break drawGrid;
renderItemAtGridPos(gui, 1 + x, 1 + y, (ItemStack) shapeless.recipeItems.get(index), true);
renderItemAtGridPos(gui, 1 + x, 1 + y, shapeless.recipeItems.get(index), true);
}
}
@@ -71,7 +71,7 @@ public class PagePetalRecipe<T extends RecipePetals> extends PageRecipe {
List<Object> inputs = recipe.getInputs();
int degreePerInput = (int) (360F / inputs.size());
float currentDegree = ConfigHandler.lexiconRotatingItems ? GuiScreen.isShiftKeyDown() ? ticksElapsed : (float) (ticksElapsed + ClientTickHandler.partialTicks) : 0;
float currentDegree = ConfigHandler.lexiconRotatingItems ? GuiScreen.isShiftKeyDown() ? ticksElapsed : ticksElapsed + ClientTickHandler.partialTicks : 0;
for(Object obj : inputs) {
Object input = obj;