mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-17 02:45:13 +00:00
Get rid of some of the many stupid parXX parameter names
This commit is contained in:
91 files changed
+584
-584
No files matched your search
@@ -126,9 +126,9 @@ public class BlockAltar extends BlockMod implements ILexiconable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEntityCollidedWithBlock(World par1World, BlockPos pos, IBlockState state, Entity par5Entity) {
|
||||
public void onEntityCollidedWithBlock(World world, BlockPos pos, IBlockState state, Entity par5Entity) {
|
||||
if(par5Entity instanceof EntityItem) {
|
||||
TileAltar tile = (TileAltar) par1World.getTileEntity(pos);
|
||||
TileAltar tile = (TileAltar) world.getTileEntity(pos);
|
||||
if(tile.collideEntityItem((EntityItem) par5Entity))
|
||||
VanillaPacketDispatcher.dispatchTEToNearbyPlayers(tile);
|
||||
}
|
||||
@@ -143,51 +143,51 @@ public class BlockAltar extends BlockMod implements ILexiconable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World par1World, BlockPos pos, IBlockState state, EntityPlayer par5EntityPlayer, EnumHand hand, ItemStack stack, EnumFacing par6, float par7, float par8, float par9) {
|
||||
TileAltar tile = (TileAltar) par1World.getTileEntity(pos);
|
||||
if(par5EntityPlayer.isSneaking()) {
|
||||
InventoryHelper.withdrawFromInventory(tile, par5EntityPlayer);
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stack, EnumFacing par6, float par7, float par8, float par9) {
|
||||
TileAltar tile = (TileAltar) world.getTileEntity(pos);
|
||||
if(player.isSneaking()) {
|
||||
InventoryHelper.withdrawFromInventory(tile, player);
|
||||
} else if(tile.isEmpty() && tile.hasWater && stack == null)
|
||||
tile.trySetLastRecipe(par5EntityPlayer);
|
||||
tile.trySetLastRecipe(player);
|
||||
else {
|
||||
if(stack != null && (isValidWaterContainer(stack) || stack.getItem() == ModItems.waterRod && ManaItemHandler.requestManaExact(stack, par5EntityPlayer, ItemWaterRod.COST, false))) {
|
||||
if(stack != null && (isValidWaterContainer(stack) || stack.getItem() == ModItems.waterRod && ManaItemHandler.requestManaExact(stack, player, ItemWaterRod.COST, false))) {
|
||||
if(!tile.hasWater) {
|
||||
if(stack.getItem() == ModItems.waterRod)
|
||||
ManaItemHandler.requestManaExact(stack, par5EntityPlayer, ItemWaterRod.COST, true);
|
||||
else if(!par5EntityPlayer.capabilities.isCreativeMode)
|
||||
par5EntityPlayer.inventory.setInventorySlotContents(par5EntityPlayer.inventory.currentItem, getContainer(stack));
|
||||
ManaItemHandler.requestManaExact(stack, player, ItemWaterRod.COST, true);
|
||||
else if(!player.capabilities.isCreativeMode)
|
||||
player.inventory.setInventorySlotContents(player.inventory.currentItem, getContainer(stack));
|
||||
|
||||
tile.setWater(true);
|
||||
par1World.updateComparatorOutputLevel(pos, this);
|
||||
par1World.checkLight(pos);
|
||||
world.updateComparatorOutputLevel(pos, this);
|
||||
world.checkLight(pos);
|
||||
}
|
||||
|
||||
return true;
|
||||
} else if(stack != null && stack.getItem() == Items.LAVA_BUCKET) {
|
||||
if(!par5EntityPlayer.capabilities.isCreativeMode)
|
||||
par5EntityPlayer.inventory.setInventorySlotContents(par5EntityPlayer.inventory.currentItem, getContainer(stack));
|
||||
if(!player.capabilities.isCreativeMode)
|
||||
player.inventory.setInventorySlotContents(player.inventory.currentItem, getContainer(stack));
|
||||
|
||||
tile.setLava(true);
|
||||
tile.setWater(false);
|
||||
par1World.updateComparatorOutputLevel(pos, this);
|
||||
par1World.checkLight(pos);
|
||||
world.updateComparatorOutputLevel(pos, this);
|
||||
world.checkLight(pos);
|
||||
|
||||
return true;
|
||||
} else if(stack != null && stack.getItem() == Items.BUCKET && (tile.hasWater || tile.hasLava) && !Botania.gardenOfGlassLoaded) {
|
||||
ItemStack bucket = tile.hasLava ? new ItemStack(Items.LAVA_BUCKET) : new ItemStack(Items.WATER_BUCKET);
|
||||
if(stack.stackSize == 1)
|
||||
par5EntityPlayer.inventory.setInventorySlotContents(par5EntityPlayer.inventory.currentItem, bucket);
|
||||
player.inventory.setInventorySlotContents(player.inventory.currentItem, bucket);
|
||||
else {
|
||||
if(!par5EntityPlayer.inventory.addItemStackToInventory(bucket))
|
||||
par5EntityPlayer.dropItem(bucket, false);
|
||||
if(!player.inventory.addItemStackToInventory(bucket))
|
||||
player.dropItem(bucket, false);
|
||||
stack.stackSize--;
|
||||
}
|
||||
|
||||
if(tile.hasLava)
|
||||
tile.setLava(false);
|
||||
else tile.setWater(false);
|
||||
par1World.updateComparatorOutputLevel(pos, this);
|
||||
par1World.checkLight(pos);
|
||||
world.updateComparatorOutputLevel(pos, this);
|
||||
world.checkLight(pos);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -262,12 +262,12 @@ public class BlockAltar extends BlockMod implements ILexiconable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(@Nonnull World par1World, @Nonnull BlockPos pos, @Nonnull IBlockState state) {
|
||||
TileSimpleInventory inv = (TileSimpleInventory) par1World.getTileEntity(pos);
|
||||
public void breakBlock(@Nonnull World world, @Nonnull BlockPos pos, @Nonnull IBlockState state) {
|
||||
TileSimpleInventory inv = (TileSimpleInventory) world.getTileEntity(pos);
|
||||
|
||||
InventoryHelper.dropInventory(inv, par1World, state, pos);
|
||||
InventoryHelper.dropInventory(inv, world, state, pos);
|
||||
|
||||
super.breakBlock(par1World, pos, state);
|
||||
super.breakBlock(world, pos, state);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -276,8 +276,8 @@ public class BlockAltar extends BlockMod implements ILexiconable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getComparatorInputOverride(IBlockState state, World par1World, BlockPos pos) {
|
||||
TileAltar altar = (TileAltar) par1World.getTileEntity(pos);
|
||||
public int getComparatorInputOverride(IBlockState state, World world, BlockPos pos) {
|
||||
TileAltar altar = (TileAltar) world.getTileEntity(pos);
|
||||
return altar.hasWater ? 15 : 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -101,12 +101,12 @@ public class BlockAvatar extends BlockMod implements ILexiconable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(@Nonnull World par1World, @Nonnull BlockPos pos, @Nonnull IBlockState state) {
|
||||
TileSimpleInventory inv = (TileSimpleInventory) par1World.getTileEntity(pos);
|
||||
public void breakBlock(@Nonnull World world, @Nonnull BlockPos pos, @Nonnull IBlockState state) {
|
||||
TileSimpleInventory inv = (TileSimpleInventory) world.getTileEntity(pos);
|
||||
|
||||
InventoryHelper.dropInventory(inv, par1World, state, pos);
|
||||
InventoryHelper.dropInventory(inv, world, state, pos);
|
||||
|
||||
super.breakBlock(par1World, pos, state);
|
||||
super.breakBlock(world, pos, state);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -35,21 +35,21 @@ public abstract class BlockCamo extends BlockMod {
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public boolean onBlockActivated(World par1World, BlockPos pos, IBlockState state, EntityPlayer par5EntityPlayer, EnumHand hand, ItemStack currentStack, EnumFacing side, float hitX, float hitY, float hitZ) {
|
||||
TileEntity tile = par1World.getTileEntity(pos);
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack currentStack, EnumFacing side, float hitX, float hitY, float hitZ) {
|
||||
TileEntity tile = world.getTileEntity(pos);
|
||||
|
||||
if(par1World.isRemote)
|
||||
if(world.isRemote)
|
||||
return true;
|
||||
|
||||
if(currentStack != null
|
||||
&& Block.getBlockFromItem(currentStack.getItem()) != null
|
||||
&& tile instanceof TileCamo) {
|
||||
TileCamo camo = (TileCamo) tile;
|
||||
IBlockState changeState = Block.getBlockFromItem(currentStack.getItem()).onBlockPlaced(par1World, pos, side, hitX, hitY, hitZ, currentStack.getItemDamage(), par5EntityPlayer);
|
||||
IBlockState changeState = Block.getBlockFromItem(currentStack.getItem()).onBlockPlaced(world, pos, side, hitX, hitY, hitZ, currentStack.getItemDamage(), player);
|
||||
|
||||
if(isValidBlock(changeState) && !(changeState.getBlock() instanceof BlockCamo) && changeState.getMaterial() != Material.AIR) {
|
||||
camo.camoState = changeState;
|
||||
par1World.notifyBlockUpdate(pos, state, state, 8);
|
||||
world.notifyBlockUpdate(pos, state, state, 8);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -118,7 +118,7 @@ public class BlockFakeAir extends BlockMod {
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getCollisionBoundingBox(IBlockState state, @Nonnull World par1World, @Nonnull BlockPos pos) {
|
||||
public AxisAlignedBB getCollisionBoundingBox(IBlockState state, @Nonnull World world, @Nonnull BlockPos pos) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -120,16 +120,16 @@ public class BlockFloatingSpecialFlower extends BlockFloatingFlower implements I
|
||||
}
|
||||
|
||||
@Override
|
||||
public void randomDisplayTick(IBlockState state, World par1World, BlockPos pos, Random par5Random) {
|
||||
public void randomDisplayTick(IBlockState state, World world, BlockPos pos, Random rand) {
|
||||
// NO-OP
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(@Nonnull Item par1, CreativeTabs par2CreativeTabs, List<ItemStack> par3List) {
|
||||
public void getSubBlocks(@Nonnull Item item, CreativeTabs tab, List<ItemStack> stacks) {
|
||||
for(String s : BotaniaAPI.subtilesForCreativeMenu) {
|
||||
par3List.add(ItemBlockSpecialFlower.ofType(new ItemStack(par1), s));
|
||||
stacks.add(ItemBlockSpecialFlower.ofType(new ItemStack(item), s));
|
||||
if(BotaniaAPI.miniFlowers.containsKey(s))
|
||||
par3List.add(ItemBlockSpecialFlower.ofType(new ItemStack(par1), BotaniaAPI.miniFlowers.get(s)));
|
||||
stacks.add(ItemBlockSpecialFlower.ofType(new ItemStack(item), BotaniaAPI.miniFlowers.get(s)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -180,9 +180,9 @@ public class BlockFloatingSpecialFlower extends BlockFloatingFlower implements I
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean eventReceived(IBlockState state, World par1World, BlockPos pos, int eventID, int value) {
|
||||
super.eventReceived(state, par1World, pos, eventID, value);
|
||||
TileEntity tileentity = par1World.getTileEntity(pos);
|
||||
public boolean eventReceived(IBlockState state, World world, BlockPos pos, int eventID, int value) {
|
||||
super.eventReceived(state, world, pos, eventID, value);
|
||||
TileEntity tileentity = world.getTileEntity(pos);
|
||||
return tileentity != null ? tileentity.receiveClientEvent(eventID, value) : false;
|
||||
}
|
||||
|
||||
|
||||
@@ -61,8 +61,8 @@ public class BlockForestEye extends BlockMod implements ILexiconable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getComparatorInputOverride(IBlockState state, World par1World, BlockPos pos) {
|
||||
TileForestEye eye = (TileForestEye) par1World.getTileEntity(pos);
|
||||
public int getComparatorInputOverride(IBlockState state, World world, BlockPos pos) {
|
||||
TileForestEye eye = (TileForestEye) world.getTileEntity(pos);
|
||||
return eye == null ? 0 : Math.min(15, Math.max(0, eye.entities - 1));
|
||||
}
|
||||
|
||||
|
||||
@@ -133,12 +133,12 @@ public class BlockHourglass extends BlockMod implements IManaTrigger, IWandable,
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(@Nonnull World par1World, @Nonnull BlockPos pos, @Nonnull IBlockState state) {
|
||||
TileSimpleInventory inv = (TileSimpleInventory) par1World.getTileEntity(pos);
|
||||
public void breakBlock(@Nonnull World world, @Nonnull BlockPos pos, @Nonnull IBlockState state) {
|
||||
TileSimpleInventory inv = (TileSimpleInventory) world.getTileEntity(pos);
|
||||
|
||||
InventoryHelper.dropInventory(inv, par1World, state, pos);
|
||||
InventoryHelper.dropInventory(inv, world, state, pos);
|
||||
|
||||
super.breakBlock(par1World, pos, state);
|
||||
super.breakBlock(world, pos, state);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -74,9 +74,9 @@ public class BlockLivingrock extends BlockMod implements ILexiconable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(@Nonnull Item par1, CreativeTabs par2CreativeTabs, List<ItemStack> par3List) {
|
||||
public void getSubBlocks(@Nonnull Item item, CreativeTabs tab, List<ItemStack> stacks) {
|
||||
for(int i = 0; i < LivingRockVariant.values().length; i++)
|
||||
par3List.add(new ItemStack(par1, 1, i));
|
||||
stacks.add(new ItemStack(item, 1, i));
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
|
||||
@@ -78,9 +78,9 @@ public class BlockLivingwood extends BlockMod implements ILexiconable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(@Nonnull Item par1, CreativeTabs par2CreativeTabs, List<ItemStack> par3List) {
|
||||
public void getSubBlocks(@Nonnull Item item, CreativeTabs tab, List<ItemStack> stacks) {
|
||||
for(int i = 0; i < LivingWoodVariant.values().length; i++)
|
||||
par3List.add(new ItemStack(par1, 1, i));
|
||||
stacks.add(new ItemStack(item, 1, i));
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
|
||||
@@ -178,15 +178,15 @@ public abstract class BlockModDoubleFlower extends BlockDoublePlant implements I
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void randomDisplayTick(IBlockState state, World world, BlockPos pos, Random par5Random) {
|
||||
public void randomDisplayTick(IBlockState state, World world, BlockPos pos, Random rand) {
|
||||
state = getActualState(state, world, pos);
|
||||
int hex = state.getValue(second ? BotaniaStateProps.DOUBLEFLOWER_VARIANT_2 : BotaniaStateProps.DOUBLEFLOWER_VARIANT_1).getMapColor().colorValue;
|
||||
int r = (hex & 0xFF0000) >> 16;
|
||||
int g = (hex & 0xFF00) >> 8;
|
||||
int b = (hex & 0xFF);
|
||||
|
||||
if(par5Random.nextDouble() < ConfigHandler.flowerParticleFrequency)
|
||||
Botania.proxy.sparkleFX(world, pos.getX() + 0.3 + par5Random.nextFloat() * 0.5, pos.getY() + 0.5 + par5Random.nextFloat() * 0.5, pos.getZ() + 0.3 + par5Random.nextFloat() * 0.5, r / 255F, g / 255F, b / 255F, par5Random.nextFloat(), 5);
|
||||
if(rand.nextDouble() < ConfigHandler.flowerParticleFrequency)
|
||||
Botania.proxy.sparkleFX(world, pos.getX() + 0.3 + rand.nextFloat() * 0.5, pos.getY() + 0.5 + rand.nextFloat() * 0.5, pos.getZ() + 0.3 + rand.nextFloat() * 0.5, r / 255F, g / 255F, b / 255F, rand.nextFloat(), 5);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -113,9 +113,9 @@ public class BlockModFlower extends BlockFlower implements ILexiconable, IPickup
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(@Nonnull Item par1, CreativeTabs par2CreativeTabs, @Nonnull List<ItemStack> par3List) {
|
||||
public void getSubBlocks(@Nonnull Item item, CreativeTabs tab, @Nonnull List<ItemStack> stacks) {
|
||||
for(int i = 0; i < 16; i++)
|
||||
par3List.add(new ItemStack(par1, 1, i));
|
||||
stacks.add(new ItemStack(item, 1, i));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -124,14 +124,14 @@ public class BlockModFlower extends BlockFlower implements ILexiconable, IPickup
|
||||
}
|
||||
|
||||
@Override
|
||||
public void randomDisplayTick(IBlockState state, World par1World, BlockPos pos, Random par5Random) {
|
||||
public void randomDisplayTick(IBlockState state, World world, BlockPos pos, Random rand) {
|
||||
int hex = state.getValue(BotaniaStateProps.COLOR).getMapColor().colorValue;
|
||||
int r = (hex & 0xFF0000) >> 16;
|
||||
int g = (hex & 0xFF00) >> 8;
|
||||
int b = (hex & 0xFF);
|
||||
|
||||
if(par5Random.nextDouble() < ConfigHandler.flowerParticleFrequency)
|
||||
Botania.proxy.sparkleFX(par1World, pos.getX() + 0.3 + par5Random.nextFloat() * 0.5, pos.getY() + 0.5 + par5Random.nextFloat() * 0.5, pos.getZ() + 0.3 + par5Random.nextFloat() * 0.5, r / 255F, g / 255F, b / 255F, par5Random.nextFloat(), 5);
|
||||
if(rand.nextDouble() < ConfigHandler.flowerParticleFrequency)
|
||||
Botania.proxy.sparkleFX(world, pos.getX() + 0.3 + rand.nextFloat() * 0.5, pos.getY() + 0.5 + rand.nextFloat() * 0.5, pos.getZ() + 0.3 + rand.nextFloat() * 0.5, r / 255F, g / 255F, b / 255F, rand.nextFloat(), 5);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -99,9 +99,9 @@ public class BlockOpenCrate extends BlockMod implements ILexiconable, IWandable,
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(@Nonnull Item par1, CreativeTabs par2CreativeTabs, List<ItemStack> par3List) {
|
||||
public void getSubBlocks(@Nonnull Item item, CreativeTabs tab, List<ItemStack> stacks) {
|
||||
for(int i = 0; i < CrateVariant.values().length; i++)
|
||||
par3List.add(new ItemStack(par1, 1, i));
|
||||
stacks.add(new ItemStack(item, 1, i));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -116,19 +116,19 @@ public class BlockOpenCrate extends BlockMod implements ILexiconable, IWandable,
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getComparatorInputOverride(IBlockState state, World par1World, BlockPos pos) {
|
||||
TileOpenCrate crate = (TileOpenCrate) par1World.getTileEntity(pos);
|
||||
public int getComparatorInputOverride(IBlockState state, World world, BlockPos pos) {
|
||||
TileOpenCrate crate = (TileOpenCrate) world.getTileEntity(pos);
|
||||
return crate.getSignal();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(@Nonnull World par1World, @Nonnull BlockPos pos, @Nonnull IBlockState state) {
|
||||
if (!par1World.isRemote) {
|
||||
TileSimpleInventory inv = (TileSimpleInventory) par1World.getTileEntity(pos);
|
||||
InventoryHelper.dropInventory(inv, par1World, state, pos);
|
||||
public void breakBlock(@Nonnull World world, @Nonnull BlockPos pos, @Nonnull IBlockState state) {
|
||||
if (!world.isRemote) {
|
||||
TileSimpleInventory inv = (TileSimpleInventory) world.getTileEntity(pos);
|
||||
InventoryHelper.dropInventory(inv, world, state, pos);
|
||||
}
|
||||
|
||||
super.breakBlock(par1World, pos, state);
|
||||
super.breakBlock(world, pos, state);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -87,9 +87,9 @@ public class BlockPistonRelay extends BlockMod implements IWandable, ILexiconabl
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(@Nonnull World par1World, @Nonnull BlockPos pos, @Nonnull IBlockState state) {
|
||||
if(!par1World.isRemote)
|
||||
mapCoords(par1World.provider.getDimension(), pos, 2);
|
||||
public void breakBlock(@Nonnull World world, @Nonnull BlockPos pos, @Nonnull IBlockState state) {
|
||||
if(!world.isRemote)
|
||||
mapCoords(world.provider.getDimension(), pos, 2);
|
||||
}
|
||||
|
||||
private void mapCoords(int world, BlockPos pos, int time) {
|
||||
|
||||
@@ -112,22 +112,22 @@ public class BlockPlatform extends BlockCamo implements ILexiconable, IWandable,
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(@Nonnull Item par1, CreativeTabs par2CreativeTabs, List<ItemStack> par3List) {
|
||||
public void getSubBlocks(@Nonnull Item item, CreativeTabs tab, List<ItemStack> stacks) {
|
||||
for(int i = 0; i < PlatformVariant.values().length; i++)
|
||||
par3List.add(new ItemStack(par1, 1, i));
|
||||
stacks.add(new ItemStack(item, 1, i));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCollisionBoxToList(IBlockState state, @Nonnull World par1World, @Nonnull BlockPos pos, @Nonnull AxisAlignedBB par5AxisAlignedBB, @Nonnull List<AxisAlignedBB> par6List, Entity par7Entity) {
|
||||
public void addCollisionBoxToList(IBlockState state, @Nonnull World world, @Nonnull BlockPos pos, @Nonnull AxisAlignedBB par5AxisAlignedBB, @Nonnull List<AxisAlignedBB> stacks, Entity par7Entity) {
|
||||
PlatformVariant variant = state.getValue(BotaniaStateProps.PLATFORM_VARIANT);
|
||||
if(variant == PlatformVariant.INFRANGIBLE || variant == PlatformVariant.ABSTRUSE && par7Entity != null && par7Entity.posY > pos.getY() + 0.9 && (!(par7Entity instanceof EntityPlayer) || !par7Entity.isSneaking()))
|
||||
super.addCollisionBoxToList(state, par1World, pos, par5AxisAlignedBB, par6List, par7Entity);
|
||||
super.addCollisionBoxToList(state, world, pos, par5AxisAlignedBB, stacks, par7Entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getBlockHardness(IBlockState state, World par1World, BlockPos pos) {
|
||||
PlatformVariant variant = par1World.getBlockState(pos).getValue(BotaniaStateProps.PLATFORM_VARIANT);
|
||||
return variant == PlatformVariant.INFRANGIBLE ? -1F : super.getBlockHardness(state, par1World, pos);
|
||||
public float getBlockHardness(IBlockState state, World world, BlockPos pos) {
|
||||
PlatformVariant variant = world.getBlockState(pos).getValue(BotaniaStateProps.PLATFORM_VARIANT);
|
||||
return variant == PlatformVariant.INFRANGIBLE ? -1F : super.getBlockHardness(state, world, pos);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
|
||||
@@ -91,9 +91,9 @@ public class BlockPylon extends BlockMod implements ILexiconable, IInfusionStabi
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(@Nonnull Item par1, CreativeTabs par2, List<ItemStack> par3) {
|
||||
public void getSubBlocks(@Nonnull Item item, CreativeTabs par2, List<ItemStack> par3) {
|
||||
for(int i = 0; i < PylonVariant.values().length; i++)
|
||||
par3.add(new ItemStack(par1, 1, i));
|
||||
par3.add(new ItemStack(item, 1, i));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -128,12 +128,12 @@ public class BlockSparkChanger extends BlockMod implements ILexiconable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(@Nonnull World par1World, @Nonnull BlockPos pos, @Nonnull IBlockState state) {
|
||||
TileSimpleInventory inv = (TileSimpleInventory) par1World.getTileEntity(pos);
|
||||
public void breakBlock(@Nonnull World world, @Nonnull BlockPos pos, @Nonnull IBlockState state) {
|
||||
TileSimpleInventory inv = (TileSimpleInventory) world.getTileEntity(pos);
|
||||
|
||||
InventoryHelper.dropInventory(inv, par1World, state, pos);
|
||||
InventoryHelper.dropInventory(inv, world, state, pos);
|
||||
|
||||
super.breakBlock(par1World, pos, state);
|
||||
super.breakBlock(world, pos, state);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -213,11 +213,11 @@ public class BlockSpecialFlower extends BlockFlower implements ISpecialFlower, I
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(@Nonnull Item par1, CreativeTabs par2CreativeTabs, @Nonnull List<ItemStack> par3List) {
|
||||
public void getSubBlocks(@Nonnull Item item, CreativeTabs tab, @Nonnull List<ItemStack> stacks) {
|
||||
for(String s : BotaniaAPI.subtilesForCreativeMenu) {
|
||||
par3List.add(ItemBlockSpecialFlower.ofType(s));
|
||||
stacks.add(ItemBlockSpecialFlower.ofType(s));
|
||||
if(BotaniaAPI.miniFlowers.containsKey(s))
|
||||
par3List.add(ItemBlockSpecialFlower.ofType(BotaniaAPI.miniFlowers.get(s)));
|
||||
stacks.add(ItemBlockSpecialFlower.ofType(BotaniaAPI.miniFlowers.get(s)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -279,9 +279,9 @@ public class BlockSpecialFlower extends BlockFlower implements ISpecialFlower, I
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean eventReceived(IBlockState state, World par1World, BlockPos pos, int par5, int par6) {
|
||||
super.eventReceived(state, par1World, pos, par5, par6);
|
||||
TileEntity tileentity = par1World.getTileEntity(pos);
|
||||
public boolean eventReceived(IBlockState state, World world, BlockPos pos, int par5, int par6) {
|
||||
super.eventReceived(state, world, pos, par5, par6);
|
||||
TileEntity tileentity = world.getTileEntity(pos);
|
||||
return tileentity != null ? tileentity.receiveClientEvent(par5, par6) : false;
|
||||
}
|
||||
|
||||
|
||||
@@ -64,9 +64,9 @@ public class BlockStorage extends BlockMod implements ILexiconable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(@Nonnull Item par1, CreativeTabs par2, List<ItemStack> par3) {
|
||||
public void getSubBlocks(@Nonnull Item item, CreativeTabs par2, List<ItemStack> par3) {
|
||||
for(int i = 0; i < StorageVariant.values().length; i++)
|
||||
par3.add(new ItemStack(par1, 1, i));
|
||||
par3.add(new ItemStack(item, 1, i));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -36,12 +36,12 @@ public abstract class BlockCorporeaBase extends BlockMod implements ICraftAchiev
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(@Nonnull World par1World, @Nonnull BlockPos pos, @Nonnull IBlockState state) {
|
||||
TileSimpleInventory inv = (TileSimpleInventory) par1World.getTileEntity(pos);
|
||||
public void breakBlock(@Nonnull World world, @Nonnull BlockPos pos, @Nonnull IBlockState state) {
|
||||
TileSimpleInventory inv = (TileSimpleInventory) world.getTileEntity(pos);
|
||||
|
||||
InventoryHelper.dropInventory(inv, par1World, state, pos);
|
||||
InventoryHelper.dropInventory(inv, world, state, pos);
|
||||
|
||||
super.breakBlock(par1World, pos, state);
|
||||
super.breakBlock(world, pos, state);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -43,7 +43,7 @@ public class BlockBuriedPetals extends BlockModFlower {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void randomDisplayTick(IBlockState state, World par1World, BlockPos pos, Random par5Random) {
|
||||
public void randomDisplayTick(IBlockState state, World world, BlockPos pos, Random rand) {
|
||||
EnumDyeColor color = state.getValue(BotaniaStateProps.COLOR);
|
||||
int hex = color.getMapColor().colorValue;
|
||||
int r = (hex & 0xFF0000) >> 16;
|
||||
@@ -51,7 +51,7 @@ public class BlockBuriedPetals extends BlockModFlower {
|
||||
int b = (hex & 0xFF);
|
||||
|
||||
Botania.proxy.setSparkleFXNoClip(true);
|
||||
Botania.proxy.sparkleFX(par1World, pos.getX() + 0.3 + par5Random.nextFloat() * 0.5, pos.getY() + 0.1 + par5Random.nextFloat() * 0.1, pos.getZ() + 0.3 + par5Random.nextFloat() * 0.5, r / 255F, g / 255F, b / 255F, par5Random.nextFloat(), 5);
|
||||
Botania.proxy.sparkleFX(world, pos.getX() + 0.3 + rand.nextFloat() * 0.5, pos.getY() + 0.1 + rand.nextFloat() * 0.1, pos.getZ() + 0.3 + rand.nextFloat() * 0.5, r / 255F, g / 255F, b / 255F, rand.nextFloat(), 5);
|
||||
|
||||
Botania.proxy.setSparkleFXNoClip(false);
|
||||
}
|
||||
|
||||
@@ -75,9 +75,9 @@ public class BlockCustomBrick extends BlockMod implements ILexiconable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(@Nonnull Item par1, CreativeTabs par2CreativeTabs, List<ItemStack> par3List) {
|
||||
public void getSubBlocks(@Nonnull Item item, CreativeTabs tab, List<ItemStack> stacks) {
|
||||
for(int i = 0; i < CustomBrickVariant.values().length; i++)
|
||||
par3List.add(new ItemStack(par1, 1, i));
|
||||
stacks.add(new ItemStack(item, 1, i));
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
|
||||
@@ -169,20 +169,20 @@ public class BlockFloatingFlower extends BlockMod implements ILexiconable, IInfu
|
||||
}
|
||||
|
||||
@Override
|
||||
public void randomDisplayTick(IBlockState state, World par1World, BlockPos pos, Random par5Random) {
|
||||
public void randomDisplayTick(IBlockState state, World world, BlockPos pos, Random rand) {
|
||||
int hex = state.getValue(BotaniaStateProps.COLOR).getMapColor().colorValue;
|
||||
int r = (hex & 0xFF0000) >> 16;
|
||||
int g = (hex & 0xFF00) >> 8;
|
||||
int b = (hex & 0xFF);
|
||||
|
||||
if(par5Random.nextDouble() < ConfigHandler.flowerParticleFrequency)
|
||||
Botania.proxy.sparkleFX(par1World, pos.getX() + 0.3 + par5Random.nextFloat() * 0.5, pos.getY() + 0.5 + par5Random.nextFloat() * 0.5, pos.getZ() + 0.3 + par5Random.nextFloat() * 0.5, r / 255F, g / 255F, b / 255F, par5Random.nextFloat(), 5);
|
||||
if(rand.nextDouble() < ConfigHandler.flowerParticleFrequency)
|
||||
Botania.proxy.sparkleFX(world, pos.getX() + 0.3 + rand.nextFloat() * 0.5, pos.getY() + 0.5 + rand.nextFloat() * 0.5, pos.getZ() + 0.3 + rand.nextFloat() * 0.5, r / 255F, g / 255F, b / 255F, rand.nextFloat(), 5);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(@Nonnull Item par1, CreativeTabs par2, List<ItemStack> par3) {
|
||||
public void getSubBlocks(@Nonnull Item item, CreativeTabs par2, List<ItemStack> par3) {
|
||||
for(int i = 0; i < 16; i++)
|
||||
par3.add(new ItemStack(par1, 1, i));
|
||||
par3.add(new ItemStack(item, 1, i));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -76,9 +76,9 @@ public class BlockManaBeacon extends BlockMod implements ILexiconable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(@Nonnull Item par1, CreativeTabs par2CreativeTabs, List<ItemStack> par3List) {
|
||||
public void getSubBlocks(@Nonnull Item item, CreativeTabs tab, List<ItemStack> stacks) {
|
||||
for(int i = 0; i < 16; i++)
|
||||
par3List.add(new ItemStack(par1, 1, i));
|
||||
stacks.add(new ItemStack(item, 1, i));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -107,9 +107,9 @@ public class BlockModMushroom extends BlockMushroom implements IInfusionStabilis
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(@Nonnull Item par1, CreativeTabs par2CreativeTabs, List<ItemStack> par3List) {
|
||||
public void getSubBlocks(@Nonnull Item item, CreativeTabs tab, List<ItemStack> stacks) {
|
||||
for(int i = 0; i < 16; i++)
|
||||
par3List.add(new ItemStack(par1, 1, i));
|
||||
stacks.add(new ItemStack(item, 1, i));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -118,14 +118,14 @@ public class BlockModMushroom extends BlockMushroom implements IInfusionStabilis
|
||||
}
|
||||
|
||||
@Override
|
||||
public void randomDisplayTick(IBlockState state, World par1World, BlockPos pos, Random par5Random) {
|
||||
public void randomDisplayTick(IBlockState state, World world, BlockPos pos, Random rand) {
|
||||
int hex = state.getValue(BotaniaStateProps.COLOR).getMapColor().colorValue;
|
||||
int r = (hex & 0xFF0000) >> 16;
|
||||
int g = (hex & 0xFF00) >> 8;
|
||||
int b = (hex & 0xFF);
|
||||
|
||||
if(par5Random.nextDouble() < ConfigHandler.flowerParticleFrequency * 0.25F)
|
||||
Botania.proxy.sparkleFX(par1World, pos.getX() + 0.3 + par5Random.nextFloat() * 0.5, pos.getY() + 0.5 + par5Random.nextFloat() * 0.5, pos.getZ() + 0.3 + par5Random.nextFloat() * 0.5, r / 255F, g / 255F, b / 255F, par5Random.nextFloat(), 5);
|
||||
if(rand.nextDouble() < ConfigHandler.flowerParticleFrequency * 0.25F)
|
||||
Botania.proxy.sparkleFX(world, pos.getX() + 0.3 + rand.nextFloat() * 0.5, pos.getY() + 0.5 + rand.nextFloat() * 0.5, pos.getZ() + 0.3 + rand.nextFloat() * 0.5, r / 255F, g / 255F, b / 255F, rand.nextFloat(), 5);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -93,9 +93,9 @@ public class BlockPavement extends BlockMod {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(@Nonnull Item par1, CreativeTabs par2CreativeTabs, List<ItemStack> par3List) {
|
||||
public void getSubBlocks(@Nonnull Item item, CreativeTabs tab, List<ItemStack> stacks) {
|
||||
for(int i = 0; i < TYPES; i++)
|
||||
par3List.add(new ItemStack(par1, 1, i));
|
||||
stacks.add(new ItemStack(item, 1, i));
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
|
||||
@@ -77,9 +77,9 @@ public class BlockPrismarine extends BlockMod implements ILexiconable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(@Nonnull Item par1, CreativeTabs par2CreativeTabs, List<ItemStack> par3List) {
|
||||
public void getSubBlocks(@Nonnull Item item, CreativeTabs tab, List<ItemStack> stacks) {
|
||||
for(int i = 0; i < TYPES; i++)
|
||||
par3List.add(new ItemStack(par1, 1, i));
|
||||
stacks.add(new ItemStack(item, 1, i));
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
|
||||
@@ -96,21 +96,21 @@ public class BlockTinyPotato extends BlockMod implements ILexiconable {
|
||||
GameRegistry.register(new ItemBlockTinyPotato(this), getRegistryName());
|
||||
}
|
||||
@Override
|
||||
public boolean onBlockActivated(World par1World, BlockPos pos, IBlockState state, EntityPlayer par5EntityPlayer, EnumHand hand, ItemStack stack, EnumFacing par6, float par7, float par8, float par9) {
|
||||
TileEntity tile = par1World.getTileEntity(pos);
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stack, EnumFacing par6, float par7, float par8, float par9) {
|
||||
TileEntity tile = world.getTileEntity(pos);
|
||||
if(tile instanceof TileTinyPotato) {
|
||||
((TileTinyPotato) tile).interact();
|
||||
par5EntityPlayer.addStat(ModAchievements.tinyPotatoPet, 1);
|
||||
par1World.spawnParticle(EnumParticleTypes.HEART, pos.getX() + AABB.minX + Math.random() * (AABB.maxX - AABB.minX), pos.getY() + AABB.maxY, pos.getZ() + AABB.minZ + Math.random() * (AABB.maxZ - AABB.minZ), 0, 0 ,0);
|
||||
player.addStat(ModAchievements.tinyPotatoPet, 1);
|
||||
world.spawnParticle(EnumParticleTypes.HEART, pos.getX() + AABB.minX + Math.random() * (AABB.maxX - AABB.minX), pos.getY() + AABB.maxY, pos.getZ() + AABB.minZ + Math.random() * (AABB.maxZ - AABB.minZ), 0, 0 ,0);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(World par1World, BlockPos pos, IBlockState state, EntityLivingBase par5EntityLiving, ItemStack par6ItemStack) {
|
||||
par1World.setBlockState(pos, state.withProperty(BotaniaStateProps.CARDINALS, par5EntityLiving.getHorizontalFacing().getOpposite()));
|
||||
public void onBlockPlacedBy(World world, BlockPos pos, IBlockState state, EntityLivingBase par5EntityLiving, ItemStack par6ItemStack) {
|
||||
world.setBlockState(pos, state.withProperty(BotaniaStateProps.CARDINALS, par5EntityLiving.getHorizontalFacing().getOpposite()));
|
||||
if (par6ItemStack.hasDisplayName())
|
||||
((TileTinyPotato) par1World.getTileEntity(pos)).name = par6ItemStack.getDisplayName();
|
||||
((TileTinyPotato) world.getTileEntity(pos)).name = par6ItemStack.getDisplayName();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -81,9 +81,9 @@ public class BlockUnstable extends BlockMod implements ILexiconable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(@Nonnull Item par1, CreativeTabs par2CreativeTabs, List<ItemStack> par3List) {
|
||||
public void getSubBlocks(@Nonnull Item item, CreativeTabs tab, List<ItemStack> stacks) {
|
||||
for(int i = 0; i < 16; i++)
|
||||
par3List.add(new ItemStack(par1, 1, i));
|
||||
stacks.add(new ItemStack(item, 1, i));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -103,14 +103,14 @@ public class BlockUnstable extends BlockMod implements ILexiconable {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void randomDisplayTick(IBlockState state, World par1World, BlockPos pos, Random par5Random) {
|
||||
int color = Minecraft.getMinecraft().getBlockColors().colorMultiplier(state, par1World, pos, 0);
|
||||
public void randomDisplayTick(IBlockState state, World world, BlockPos pos, Random rand) {
|
||||
int color = Minecraft.getMinecraft().getBlockColors().colorMultiplier(state, world, pos, 0);
|
||||
int colorBright = new Color(color).brighter().getRGB();
|
||||
int colorDark = new Color(color).darker().getRGB();
|
||||
|
||||
Vector3 origVector = new Vector3(pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5);
|
||||
Vector3 endVector = origVector.copy().add(par1World.rand.nextDouble() * 2 - 1, par1World.rand.nextDouble() * 2 - 1, par1World.rand.nextDouble() * 2 - 1);
|
||||
Botania.proxy.lightningFX(par1World, origVector, endVector, 5F, colorDark, colorBright);
|
||||
Vector3 endVector = origVector.copy().add(world.rand.nextDouble() * 2 - 1, world.rand.nextDouble() * 2 - 1, world.rand.nextDouble() * 2 - 1);
|
||||
Botania.proxy.lightningFX(world, origVector, endVector, 5F, colorDark, colorBright);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -83,7 +83,7 @@ public class BlockSpecialQuartz extends BlockMod implements ILexiconable {
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IBlockState onBlockPlaced(World par1World, BlockPos pos, EnumFacing side, float par6, float par7, float par8, int meta, EntityLivingBase placer) {
|
||||
public IBlockState onBlockPlaced(World world, BlockPos pos, EnumFacing side, float par6, float par7, float par8, int meta, EntityLivingBase placer) {
|
||||
if (meta == 2) { // Pillar quartz variant
|
||||
switch (side.getAxis()) {
|
||||
case Y:
|
||||
@@ -114,10 +114,10 @@ public class BlockSpecialQuartz extends BlockMod implements ILexiconable {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(@Nonnull Item item, CreativeTabs tab, List<ItemStack> par3List) {
|
||||
par3List.add(new ItemStack(this, 1, 0));
|
||||
par3List.add(new ItemStack(this, 1, 1));
|
||||
par3List.add(new ItemStack(this, 1, 2));
|
||||
public void getSubBlocks(@Nonnull Item item, CreativeTabs tab, List<ItemStack> stacks) {
|
||||
stacks.add(new ItemStack(this, 1, 0));
|
||||
stacks.add(new ItemStack(this, 1, 1));
|
||||
stacks.add(new ItemStack(this, 1, 2));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -78,26 +78,26 @@ public class BlockBrewery extends BlockMod implements ILexiconable, IWandHUD {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World par1World, BlockPos pos, IBlockState state, EntityPlayer par5EntityPlayer, EnumHand hand, ItemStack stack, EnumFacing side, float par7, float par8, float par9) {
|
||||
TileBrewery brew = (TileBrewery) par1World.getTileEntity(pos);
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stack, EnumFacing side, float par7, float par8, float par9) {
|
||||
TileBrewery brew = (TileBrewery) world.getTileEntity(pos);
|
||||
|
||||
if(par5EntityPlayer.isSneaking()) {
|
||||
if(player.isSneaking()) {
|
||||
if(brew.recipe == null && !state.getValue(BotaniaStateProps.POWERED))
|
||||
InventoryHelper.withdrawFromInventory(brew, par5EntityPlayer);
|
||||
InventoryHelper.withdrawFromInventory(brew, player);
|
||||
} else {
|
||||
if(stack != null)
|
||||
return brew.addItem(par5EntityPlayer, stack);
|
||||
return brew.addItem(player, stack);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(@Nonnull World par1World, @Nonnull BlockPos pos, @Nonnull IBlockState state) {
|
||||
TileSimpleInventory inv = (TileSimpleInventory) par1World.getTileEntity(pos);
|
||||
public void breakBlock(@Nonnull World world, @Nonnull BlockPos pos, @Nonnull IBlockState state) {
|
||||
TileSimpleInventory inv = (TileSimpleInventory) world.getTileEntity(pos);
|
||||
|
||||
InventoryHelper.dropInventory(inv, par1World, state, pos);
|
||||
InventoryHelper.dropInventory(inv, world, state, pos);
|
||||
|
||||
super.breakBlock(par1World, pos, state);
|
||||
super.breakBlock(world, pos, state);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -106,8 +106,8 @@ public class BlockBrewery extends BlockMod implements ILexiconable, IWandHUD {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getComparatorInputOverride(IBlockState state, World par1World, BlockPos pos) {
|
||||
TileBrewery brew = (TileBrewery) par1World.getTileEntity(pos);
|
||||
public int getComparatorInputOverride(IBlockState state, World world, BlockPos pos) {
|
||||
TileBrewery brew = (TileBrewery) world.getTileEntity(pos);
|
||||
return brew.signal;
|
||||
}
|
||||
|
||||
|
||||
@@ -104,8 +104,8 @@ public class BlockEnchanter extends BlockMod implements IWandable, ILexiconable,
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World par1World, BlockPos pos, IBlockState state, EntityPlayer par5EntityPlayer, EnumHand hand, ItemStack stack, EnumFacing side, float par7, float par8, float par9) {
|
||||
TileEnchanter enchanter = (TileEnchanter) par1World.getTileEntity(pos);
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stack, EnumFacing side, float par7, float par8, float par9) {
|
||||
TileEnchanter enchanter = (TileEnchanter) world.getTileEntity(pos);
|
||||
if(stack != null && stack.getItem() == ModItems.twigWand)
|
||||
return false;
|
||||
|
||||
@@ -114,22 +114,22 @@ public class BlockEnchanter extends BlockMod implements IWandable, ILexiconable,
|
||||
if(enchanter.itemToEnchant == null) {
|
||||
if(stackEnchantable) {
|
||||
enchanter.itemToEnchant = stack.copy();
|
||||
par5EntityPlayer.inventory.setInventorySlotContents(par5EntityPlayer.inventory.currentItem, null);
|
||||
player.inventory.setInventorySlotContents(player.inventory.currentItem, null);
|
||||
enchanter.sync();
|
||||
}
|
||||
} else if(enchanter.stage == 0) {
|
||||
if(par5EntityPlayer.inventory.addItemStackToInventory(enchanter.itemToEnchant.copy())) {
|
||||
if(player.inventory.addItemStackToInventory(enchanter.itemToEnchant.copy())) {
|
||||
enchanter.itemToEnchant = null;
|
||||
enchanter.sync();
|
||||
} else par5EntityPlayer.addChatMessage(new TextComponentTranslation("botaniamisc.invFull"));
|
||||
} else player.addChatMessage(new TextComponentTranslation("botaniamisc.invFull"));
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(@Nonnull World par1World, @Nonnull BlockPos pos, @Nonnull IBlockState state) {
|
||||
TileEnchanter enchanter = (TileEnchanter) par1World.getTileEntity(pos);
|
||||
public void breakBlock(@Nonnull World world, @Nonnull BlockPos pos, @Nonnull IBlockState state) {
|
||||
TileEnchanter enchanter = (TileEnchanter) world.getTileEntity(pos);
|
||||
|
||||
ItemStack itemstack = enchanter.itemToEnchant;
|
||||
|
||||
@@ -138,14 +138,14 @@ public class BlockEnchanter extends BlockMod implements IWandable, ILexiconable,
|
||||
float f1 = random.nextFloat() * 0.8F + 0.1F;
|
||||
EntityItem entityitem;
|
||||
|
||||
for (float f2 = random.nextFloat() * 0.8F + 0.1F; itemstack.stackSize > 0; par1World.spawnEntityInWorld(entityitem)) {
|
||||
for (float f2 = random.nextFloat() * 0.8F + 0.1F; itemstack.stackSize > 0; world.spawnEntityInWorld(entityitem)) {
|
||||
int k1 = random.nextInt(21) + 10;
|
||||
|
||||
if (k1 > itemstack.stackSize)
|
||||
k1 = itemstack.stackSize;
|
||||
|
||||
itemstack.stackSize -= k1;
|
||||
entityitem = new EntityItem(par1World, pos.getX() + f, pos.getY() + f1, pos.getZ() + f2, new ItemStack(itemstack.getItem(), k1, itemstack.getItemDamage()));
|
||||
entityitem = new EntityItem(world, pos.getX() + f, pos.getY() + f1, pos.getZ() + f2, new ItemStack(itemstack.getItem(), k1, itemstack.getItemDamage()));
|
||||
float f3 = 0.05F;
|
||||
entityitem.motionX = (float)random.nextGaussian() * f3 * 0.5;
|
||||
entityitem.motionY = (float)random.nextGaussian() * f3 + 0.2F;
|
||||
@@ -156,9 +156,9 @@ public class BlockEnchanter extends BlockMod implements IWandable, ILexiconable,
|
||||
}
|
||||
}
|
||||
|
||||
par1World.updateComparatorOutputLevel(pos, state.getBlock());
|
||||
world.updateComparatorOutputLevel(pos, state.getBlock());
|
||||
|
||||
super.breakBlock(par1World, pos, state);
|
||||
super.breakBlock(world, pos, state);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -74,9 +74,9 @@ public class BlockManaDetector extends BlockMod implements ILexiconable, IManaCo
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCollisionBoxToList(IBlockState state, @Nonnull World par1World, @Nonnull BlockPos pos, @Nonnull AxisAlignedBB par5AxisAlignedBB, @Nonnull List<AxisAlignedBB> par6List, Entity par7Entity) {
|
||||
public void addCollisionBoxToList(IBlockState state, @Nonnull World world, @Nonnull BlockPos pos, @Nonnull AxisAlignedBB par5AxisAlignedBB, @Nonnull List<AxisAlignedBB> stacks, Entity par7Entity) {
|
||||
if(par7Entity != null && !(par7Entity instanceof IManaBurst))
|
||||
super.addCollisionBoxToList(state, par1World, pos, par5AxisAlignedBB, par6List, par7Entity);
|
||||
super.addCollisionBoxToList(state, world, pos, par5AxisAlignedBB, stacks, par7Entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -118,10 +118,10 @@ public class BlockPool extends BlockMod implements IWandHUD, IWandable, ILexicon
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(@Nonnull World par1World, @Nonnull BlockPos pos, @Nonnull IBlockState state) {
|
||||
TilePool pool = (TilePool) par1World.getTileEntity(pos);
|
||||
public void breakBlock(@Nonnull World world, @Nonnull BlockPos pos, @Nonnull IBlockState state) {
|
||||
TilePool pool = (TilePool) world.getTileEntity(pos);
|
||||
lastFragile = pool.fragile;
|
||||
super.breakBlock(par1World, pos, state);
|
||||
super.breakBlock(world, pos, state);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@@ -136,11 +136,11 @@ public class BlockPool extends BlockMod implements IWandHUD, IWandable, ILexicon
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(@Nonnull Item par1, CreativeTabs par2, List<ItemStack> par3) {
|
||||
par3.add(new ItemStack(par1, 1, 0));
|
||||
par3.add(new ItemStack(par1, 1, 2));
|
||||
par3.add(new ItemStack(par1, 1, 3));
|
||||
par3.add(new ItemStack(par1, 1, 1));
|
||||
public void getSubBlocks(@Nonnull Item item, CreativeTabs par2, List<ItemStack> par3) {
|
||||
par3.add(new ItemStack(item, 1, 0));
|
||||
par3.add(new ItemStack(item, 1, 2));
|
||||
par3.add(new ItemStack(item, 1, 3));
|
||||
par3.add(new ItemStack(item, 1, 1));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -155,11 +155,11 @@ public class BlockPool extends BlockMod implements IWandHUD, IWandable, ILexicon
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEntityCollidedWithBlock(World par1World, BlockPos pos, IBlockState state, Entity par5Entity) {
|
||||
public void onEntityCollidedWithBlock(World world, BlockPos pos, IBlockState state, Entity par5Entity) {
|
||||
if(par5Entity instanceof EntityItem) {
|
||||
TilePool tile = (TilePool) par1World.getTileEntity(pos);
|
||||
TilePool tile = (TilePool) world.getTileEntity(pos);
|
||||
if(tile.collideEntityItem((EntityItem) par5Entity))
|
||||
VanillaPacketDispatcher.dispatchTEToNearbyPlayers(par1World, pos);
|
||||
VanillaPacketDispatcher.dispatchTEToNearbyPlayers(world, pos);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -208,8 +208,8 @@ public class BlockPool extends BlockMod implements IWandHUD, IWandable, ILexicon
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getComparatorInputOverride(IBlockState state, World par1World, BlockPos pos) {
|
||||
TilePool pool = (TilePool) par1World.getTileEntity(pos);
|
||||
public int getComparatorInputOverride(IBlockState state, World world, BlockPos pos) {
|
||||
TilePool pool = (TilePool) world.getTileEntity(pos);
|
||||
int val = (int) ((double) pool.getCurrentMana() / (double) pool.manaCap * 15.0);
|
||||
if(pool.getCurrentMana() > 0)
|
||||
val = Math.max(val, 1);
|
||||
|
||||
@@ -111,8 +111,8 @@ public class BlockPrism extends BlockMod implements IManaTrigger, ILexiconable,
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World par1World, BlockPos pos, IBlockState state, EntityPlayer par5EntityPlayer, EnumHand hand, ItemStack heldItem, EnumFacing side, float par7, float par8, float par9) {
|
||||
TileEntity tile = par1World.getTileEntity(pos);
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack heldItem, EnumFacing side, float par7, float par8, float par9) {
|
||||
TileEntity tile = world.getTileEntity(pos);
|
||||
if(!(tile instanceof TilePrism))
|
||||
return false;
|
||||
|
||||
@@ -121,19 +121,19 @@ public class BlockPrism extends BlockMod implements IManaTrigger, ILexiconable,
|
||||
boolean isHeldItemLens = heldItem != null && heldItem.getItem() instanceof ILens;
|
||||
|
||||
if(lens == null && isHeldItemLens) {
|
||||
if(!par5EntityPlayer.capabilities.isCreativeMode)
|
||||
par5EntityPlayer.inventory.setInventorySlotContents(par5EntityPlayer.inventory.currentItem, null);
|
||||
if(!player.capabilities.isCreativeMode)
|
||||
player.inventory.setInventorySlotContents(player.inventory.currentItem, null);
|
||||
|
||||
prism.getItemHandler().setStackInSlot(0, heldItem.copy());
|
||||
prism.markDirty();
|
||||
par1World.setBlockState(pos, state.withProperty(BotaniaStateProps.HAS_LENS, true), 1 | 2);
|
||||
world.setBlockState(pos, state.withProperty(BotaniaStateProps.HAS_LENS, true), 1 | 2);
|
||||
} else if(lens != null) {
|
||||
ItemStack add = lens.copy();
|
||||
if(!par5EntityPlayer.inventory.addItemStackToInventory(add))
|
||||
par5EntityPlayer.dropItem(add, false);
|
||||
if(!player.inventory.addItemStackToInventory(add))
|
||||
player.dropItem(add, false);
|
||||
prism.getItemHandler().setStackInSlot(0, null);
|
||||
prism.markDirty();
|
||||
par1World.setBlockState(pos, state.withProperty(BotaniaStateProps.HAS_LENS, false), 1 | 2);
|
||||
world.setBlockState(pos, state.withProperty(BotaniaStateProps.HAS_LENS, false), 1 | 2);
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -153,12 +153,12 @@ public class BlockPrism extends BlockMod implements IManaTrigger, ILexiconable,
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(@Nonnull World par1World, @Nonnull BlockPos pos, @Nonnull IBlockState state) {
|
||||
TileSimpleInventory inv = (TileSimpleInventory) par1World.getTileEntity(pos);
|
||||
public void breakBlock(@Nonnull World world, @Nonnull BlockPos pos, @Nonnull IBlockState state) {
|
||||
TileSimpleInventory inv = (TileSimpleInventory) world.getTileEntity(pos);
|
||||
|
||||
InventoryHelper.dropInventory(inv, par1World, state, pos);
|
||||
InventoryHelper.dropInventory(inv, world, state, pos);
|
||||
|
||||
super.breakBlock(par1World, pos, state);
|
||||
super.breakBlock(world, pos, state);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -67,26 +67,26 @@ public class BlockRuneAltar extends BlockMod implements IWandable, ILexiconable
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World par1World, BlockPos pos, IBlockState state, EntityPlayer par5EntityPlayer, EnumHand hand, ItemStack stack, EnumFacing side, float par7, float par8, float par9) {
|
||||
TileRuneAltar altar = (TileRuneAltar) par1World.getTileEntity(pos);
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stack, EnumFacing side, float par7, float par8, float par9) {
|
||||
TileRuneAltar altar = (TileRuneAltar) world.getTileEntity(pos);
|
||||
|
||||
if(par5EntityPlayer.isSneaking()) {
|
||||
if(player.isSneaking()) {
|
||||
if(altar.manaToGet == 0)
|
||||
InventoryHelper.withdrawFromInventory(altar, par5EntityPlayer);
|
||||
InventoryHelper.withdrawFromInventory(altar, player);
|
||||
} else if(altar.isEmpty() && stack == null)
|
||||
altar.trySetLastRecipe(par5EntityPlayer);
|
||||
altar.trySetLastRecipe(player);
|
||||
else if(stack != null)
|
||||
return altar.addItem(par5EntityPlayer, stack);
|
||||
return altar.addItem(player, stack);
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(@Nonnull World par1World, @Nonnull BlockPos pos, @Nonnull IBlockState state) {
|
||||
TileSimpleInventory inv = (TileSimpleInventory) par1World.getTileEntity(pos);
|
||||
public void breakBlock(@Nonnull World world, @Nonnull BlockPos pos, @Nonnull IBlockState state) {
|
||||
TileSimpleInventory inv = (TileSimpleInventory) world.getTileEntity(pos);
|
||||
|
||||
InventoryHelper.dropInventory(inv, par1World, state, pos);
|
||||
InventoryHelper.dropInventory(inv, world, state, pos);
|
||||
|
||||
super.breakBlock(par1World, pos, state);
|
||||
super.breakBlock(world, pos, state);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -106,8 +106,8 @@ public class BlockRuneAltar extends BlockMod implements IWandable, ILexiconable
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getComparatorInputOverride(IBlockState state, World par1World, BlockPos pos) {
|
||||
TileRuneAltar altar = (TileRuneAltar) par1World.getTileEntity(pos);
|
||||
public int getComparatorInputOverride(IBlockState state, World world, BlockPos pos) {
|
||||
TileRuneAltar altar = (TileRuneAltar) world.getTileEntity(pos);
|
||||
return altar.signal;
|
||||
}
|
||||
|
||||
|
||||
@@ -86,16 +86,16 @@ public class BlockSpreader extends BlockMod implements IWandable, IWandHUD, ILex
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(@Nonnull Item par1, CreativeTabs par2, List<ItemStack> par3) {
|
||||
public void getSubBlocks(@Nonnull Item item, CreativeTabs par2, List<ItemStack> par3) {
|
||||
for(int i = 0; i < 4; i++)
|
||||
par3.add(new ItemStack(par1, 1, i));
|
||||
par3.add(new ItemStack(item, 1, i));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(World par1World, BlockPos pos, IBlockState state, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack) {
|
||||
public void onBlockPlacedBy(World world, BlockPos pos, IBlockState state, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack) {
|
||||
EnumFacing orientation = BlockPistonBase.getFacingFromEntity(pos, par5EntityLivingBase);
|
||||
TileSpreader spreader = (TileSpreader) par1World.getTileEntity(pos);
|
||||
par1World.setBlockState(pos, getStateFromMeta(par6ItemStack.getItemDamage()), 1 | 2);
|
||||
TileSpreader spreader = (TileSpreader) world.getTileEntity(pos);
|
||||
world.setBlockState(pos, getStateFromMeta(par6ItemStack.getItemDamage()), 1 | 2);
|
||||
|
||||
switch(orientation) {
|
||||
case DOWN:
|
||||
@@ -140,8 +140,8 @@ public class BlockSpreader extends BlockMod implements IWandable, IWandHUD, ILex
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World par1World, BlockPos pos, IBlockState state, EntityPlayer par5EntityPlayer, EnumHand hand, ItemStack heldItem, EnumFacing par6, float par7, float par8, float par9) {
|
||||
TileEntity tile = par1World.getTileEntity(pos);
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack heldItem, EnumFacing par6, float par7, float par8, float par9) {
|
||||
TileEntity tile = world.getTileEntity(pos);
|
||||
if(!(tile instanceof TileSpreader))
|
||||
return false;
|
||||
|
||||
@@ -155,15 +155,15 @@ public class BlockSpreader extends BlockMod implements IWandable, IWandHUD, ILex
|
||||
return false;
|
||||
|
||||
if(lens == null && isHeldItemLens) {
|
||||
if (!par5EntityPlayer.capabilities.isCreativeMode)
|
||||
par5EntityPlayer.inventory.setInventorySlotContents(par5EntityPlayer.inventory.currentItem, null);
|
||||
if (!player.capabilities.isCreativeMode)
|
||||
player.inventory.setInventorySlotContents(player.inventory.currentItem, null);
|
||||
|
||||
spreader.getItemHandler().setStackInSlot(0, heldItem.copy());
|
||||
spreader.markDirty();
|
||||
} else if(lens != null && !wool) {
|
||||
ItemStack add = lens.copy();
|
||||
if(!par5EntityPlayer.inventory.addItemStackToInventory(add))
|
||||
par5EntityPlayer.dropItem(add, false);
|
||||
if(!player.inventory.addItemStackToInventory(add))
|
||||
player.dropItem(add, false);
|
||||
spreader.getItemHandler().setStackInSlot(0, null);
|
||||
spreader.markDirty();
|
||||
}
|
||||
@@ -172,11 +172,11 @@ public class BlockSpreader extends BlockMod implements IWandable, IWandHUD, ILex
|
||||
spreader.paddingColor = heldItem.getItemDamage();
|
||||
heldItem.stackSize--;
|
||||
if(heldItem.stackSize == 0)
|
||||
par5EntityPlayer.inventory.setInventorySlotContents(par5EntityPlayer.inventory.currentItem, null);
|
||||
player.inventory.setInventorySlotContents(player.inventory.currentItem, null);
|
||||
} else if(heldItem == null && spreader.paddingColor != -1 && lens == null) {
|
||||
ItemStack pad = new ItemStack(Blocks.WOOL, 1, spreader.paddingColor);
|
||||
if(!par5EntityPlayer.inventory.addItemStackToInventory(pad))
|
||||
par5EntityPlayer.dropItem(pad, false);
|
||||
if(!player.inventory.addItemStackToInventory(pad))
|
||||
player.dropItem(pad, false);
|
||||
spreader.paddingColor = -1;
|
||||
spreader.markDirty();
|
||||
}
|
||||
@@ -185,20 +185,20 @@ public class BlockSpreader extends BlockMod implements IWandable, IWandHUD, ILex
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(@Nonnull World par1World, @Nonnull BlockPos pos, @Nonnull IBlockState state) {
|
||||
TileEntity tile = par1World.getTileEntity(pos);
|
||||
public void breakBlock(@Nonnull World world, @Nonnull BlockPos pos, @Nonnull IBlockState state) {
|
||||
TileEntity tile = world.getTileEntity(pos);
|
||||
if(!(tile instanceof TileSpreader))
|
||||
return;
|
||||
|
||||
TileSpreader inv = (TileSpreader) tile;
|
||||
|
||||
if(inv.paddingColor != -1) {
|
||||
net.minecraft.inventory.InventoryHelper.spawnItemStack(par1World, pos.getX(), pos.getY(), pos.getZ(), new ItemStack(Blocks.WOOL, 1, inv.paddingColor));
|
||||
net.minecraft.inventory.InventoryHelper.spawnItemStack(world, pos.getX(), pos.getY(), pos.getZ(), new ItemStack(Blocks.WOOL, 1, inv.paddingColor));
|
||||
}
|
||||
|
||||
InventoryHelper.dropInventory(inv, par1World, state, pos);
|
||||
InventoryHelper.dropInventory(inv, world, state, pos);
|
||||
|
||||
super.breakBlock(par1World, pos, state);
|
||||
super.breakBlock(world, pos, state);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -112,8 +112,8 @@ public class BlockTerraPlate extends BlockMod implements ILexiconable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getComparatorInputOverride(IBlockState state, World par1World, BlockPos pos) {
|
||||
TileTerraPlate plate = (TileTerraPlate) par1World.getTileEntity(pos);
|
||||
public int getComparatorInputOverride(IBlockState state, World world, BlockPos pos) {
|
||||
TileTerraPlate plate = (TileTerraPlate) world.getTileEntity(pos);
|
||||
int val = (int) ((double) plate.getCurrentMana() / (double) TileTerraPlate.MAX_MANA * 15.0);
|
||||
if(plate.getCurrentMana() > 0)
|
||||
val = Math.max(val, 1);
|
||||
|
||||
@@ -45,9 +45,9 @@ public abstract class BlockRedString extends BlockMod implements ILexiconable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(World par1World, BlockPos pos, IBlockState state, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack) {
|
||||
public void onBlockPlacedBy(World world, BlockPos pos, IBlockState state, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack) {
|
||||
EnumFacing orientation = BlockPistonBase.getFacingFromEntity(pos, par5EntityLivingBase);
|
||||
par1World.setBlockState(pos, state.withProperty(BotaniaStateProps.FACING, orientation), 1 | 2);
|
||||
world.setBlockState(pos, state.withProperty(BotaniaStateProps.FACING, orientation), 1 | 2);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -143,8 +143,8 @@ public class EntityDoppleganger extends EntityCreature implements IBotaniaBoss {
|
||||
|
||||
private final BossInfoServer bossInfo = (BossInfoServer) (new BossInfoServer(this.getDisplayName(), BossInfo.Color.PINK, BossInfo.Overlay.PROGRESS)).setCreateFog(true);
|
||||
|
||||
public EntityDoppleganger(World par1World) {
|
||||
super(par1World);
|
||||
public EntityDoppleganger(World world) {
|
||||
super(world);
|
||||
setSize(0.6F, 1.8F);
|
||||
((PathNavigateGround) getNavigator()).setCanSwim(true);
|
||||
tasks.addTask(0, new EntityAISwimming(this));
|
||||
|
||||
@@ -21,8 +21,8 @@ import javax.annotation.Nonnull;
|
||||
|
||||
public class EntityFlyingCreature extends EntityAmbientCreature {
|
||||
|
||||
public EntityFlyingCreature(World par1World) {
|
||||
super(par1World);
|
||||
public EntityFlyingCreature(World world) {
|
||||
super(world);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -29,8 +29,8 @@ public class EntityMagicLandmine extends Entity {
|
||||
|
||||
public EntityDoppleganger summoner;
|
||||
|
||||
public EntityMagicLandmine(World par1World) {
|
||||
super(par1World);
|
||||
public EntityMagicLandmine(World world) {
|
||||
super(world);
|
||||
setSize(0F, 0F);
|
||||
}
|
||||
|
||||
|
||||
@@ -29,8 +29,8 @@ public class EntitySignalFlare extends Entity {
|
||||
private static final DataParameter<Integer> COLOR = EntityDataManager.createKey(EntitySignalFlare.class, DataSerializers.VARINT);
|
||||
private static final DataParameter<Integer> FIRED_Y = EntityDataManager.createKey(EntitySignalFlare.class, DataSerializers.VARINT);
|
||||
|
||||
public EntitySignalFlare(World par1World) {
|
||||
super(par1World);
|
||||
public EntitySignalFlare(World world) {
|
||||
super(world);
|
||||
setSize(0F, 0F);
|
||||
}
|
||||
|
||||
|
||||
@@ -27,8 +27,8 @@ import java.util.List;
|
||||
|
||||
public class EntityThrownItem extends EntityItem {
|
||||
|
||||
public EntityThrownItem(World par1World) {
|
||||
super(par1World);
|
||||
public EntityThrownItem(World world) {
|
||||
super(world);
|
||||
}
|
||||
|
||||
public EntityThrownItem(World world, double x,
|
||||
|
||||
@@ -38,8 +38,8 @@ public class EntityVineBall extends EntityThrowable {
|
||||
private static final Map<EnumFacing, PropertyBool> propMap = ImmutableMap.of(EnumFacing.NORTH, BlockVine.NORTH, EnumFacing.SOUTH, BlockVine.SOUTH,
|
||||
EnumFacing.WEST, BlockVine.WEST, EnumFacing.EAST, BlockVine.EAST);
|
||||
|
||||
public EntityVineBall(World par1World) {
|
||||
super(par1World);
|
||||
public EntityVineBall(World world) {
|
||||
super(world);
|
||||
}
|
||||
|
||||
public EntityVineBall(EntityLivingBase thrower, boolean gravity) {
|
||||
|
||||
@@ -31,9 +31,9 @@ public class Item16Colors extends ItemMod implements IColorable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubItems(@Nonnull Item item, CreativeTabs par2CreativeTabs, List<ItemStack> par3List) {
|
||||
public void getSubItems(@Nonnull Item item, CreativeTabs tab, List<ItemStack> stacks) {
|
||||
for(int i = 0; i < 16; i++)
|
||||
par3List.add(new ItemStack(item, 1, i));
|
||||
stacks.add(new ItemStack(item, 1, i));
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
|
||||
@@ -65,11 +65,11 @@ public class ItemBlackHoleTalisman extends ItemMod implements IBlockProvider {
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ActionResult<ItemStack> onItemRightClick(@Nonnull ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer, EnumHand hand) {
|
||||
if(getBlock(par1ItemStack) != Blocks.AIR && par3EntityPlayer.isSneaking()) {
|
||||
public ActionResult<ItemStack> onItemRightClick(@Nonnull ItemStack par1ItemStack, World world, EntityPlayer player, EnumHand hand) {
|
||||
if(getBlock(par1ItemStack) != Blocks.AIR && player.isSneaking()) {
|
||||
int dmg = par1ItemStack.getItemDamage();
|
||||
par1ItemStack.setItemDamage(~dmg & 1);
|
||||
par3EntityPlayer.playSound(SoundEvents.ENTITY_EXPERIENCE_ORB_PICKUP, 0.3F, 0.1F);
|
||||
player.playSound(SoundEvents.ENTITY_EXPERIENCE_ORB_PICKUP, 0.3F, 0.1F);
|
||||
return ActionResult.newResult(EnumActionResult.SUCCESS, par1ItemStack);
|
||||
}
|
||||
|
||||
@@ -78,15 +78,15 @@ public class ItemBlackHoleTalisman extends ItemMod implements IBlockProvider {
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public EnumActionResult onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, BlockPos pos, EnumHand hand, EnumFacing side, float par8, float par9, float par10) {
|
||||
IBlockState state = par3World.getBlockState(pos);
|
||||
public EnumActionResult onItemUse(ItemStack par1ItemStack, EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing side, float par8, float par9, float par10) {
|
||||
IBlockState state = world.getBlockState(pos);
|
||||
boolean set = setBlock(par1ItemStack, state.getBlock(), state.getBlock().getMetaFromState(state));
|
||||
|
||||
if(!set) {
|
||||
Block bBlock = getBlock(par1ItemStack);
|
||||
int bmeta = getBlockMeta(par1ItemStack);
|
||||
|
||||
TileEntity tile = par3World.getTileEntity(pos);
|
||||
TileEntity tile = world.getTileEntity(pos);
|
||||
if(tile != null && tile instanceof IInventory) {
|
||||
IInventory inv = (IInventory) tile;
|
||||
int[] slots = inv instanceof ISidedInventory ? ((ISidedInventory) inv).getSlotsForFace(side) : InventoryHelper.buildSlotsForLinearInventory(inv);
|
||||
@@ -114,23 +114,23 @@ public class ItemBlackHoleTalisman extends ItemMod implements IBlockProvider {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
int entities = par3World.getEntitiesWithinAABB(EntityLivingBase.class, new AxisAlignedBB(pos.offset(side), pos.offset(side).add(1, 1, 1))).size();
|
||||
BlockPos correctedPos = bBlock.isReplaceable(par3World, pos) ? pos : pos.offset(side);
|
||||
int entities = world.getEntitiesWithinAABB(EntityLivingBase.class, new AxisAlignedBB(pos.offset(side), pos.offset(side).add(1, 1, 1))).size();
|
||||
BlockPos correctedPos = bBlock.isReplaceable(world, pos) ? pos : pos.offset(side);
|
||||
|
||||
if(entities == 0 && !(correctedPos.getY() < 0) && !(correctedPos.getY() >= 256)) {
|
||||
int remove = par2EntityPlayer.capabilities.isCreativeMode ? 1 : remove(par1ItemStack, 1);
|
||||
int remove = player.capabilities.isCreativeMode ? 1 : remove(par1ItemStack, 1);
|
||||
if(remove > 0) {
|
||||
ItemStack stack = new ItemStack(bBlock, 1, bmeta);
|
||||
ItemsRemainingRenderHandler.set(stack, getBlockCount(par1ItemStack));
|
||||
|
||||
Item.getItemFromBlock(bBlock).onItemUse(stack, par2EntityPlayer, par3World, pos, hand, side, par8, par9, par10);
|
||||
Item.getItemFromBlock(bBlock).onItemUse(stack, player, world, pos, hand, side, par8, par9, par10);
|
||||
set = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
par2EntityPlayer.setItemStackToSlot(hand == EnumHand.MAIN_HAND ? EntityEquipmentSlot.MAINHAND : EntityEquipmentSlot.OFFHAND, par1ItemStack);
|
||||
player.setItemStackToSlot(hand == EnumHand.MAIN_HAND ? EntityEquipmentSlot.MAINHAND : EntityEquipmentSlot.OFFHAND, par1ItemStack);
|
||||
return set ? EnumActionResult.SUCCESS : EnumActionResult.PASS;
|
||||
}
|
||||
|
||||
@@ -240,16 +240,16 @@ public class ItemBlackHoleTalisman extends ItemMod implements IBlockProvider {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List<String> par3List, boolean par4) {
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer player, List<String> stacks, boolean par4) {
|
||||
Block block = getBlock(par1ItemStack);
|
||||
if(block != null && block != Blocks.AIR) {
|
||||
int count = getBlockCount(par1ItemStack);
|
||||
par3List.add(count + " " + I18n.format(new ItemStack(block, 1, getBlockMeta(par1ItemStack)).getUnlocalizedName() + ".name"));
|
||||
stacks.add(count + " " + I18n.format(new ItemStack(block, 1, getBlockMeta(par1ItemStack)).getUnlocalizedName() + ".name"));
|
||||
}
|
||||
|
||||
if(par1ItemStack.getItemDamage() == 1)
|
||||
addStringToTooltip(I18n.format("botaniamisc.active"), par3List);
|
||||
else addStringToTooltip(I18n.format("botaniamisc.inactive"), par3List);
|
||||
addStringToTooltip(I18n.format("botaniamisc.active"), stacks);
|
||||
else addStringToTooltip(I18n.format("botaniamisc.inactive"), stacks);
|
||||
}
|
||||
|
||||
void addStringToTooltip(String s, List<String> tooltip) {
|
||||
|
||||
@@ -188,7 +188,7 @@ public class ItemBottledMana extends ItemMod {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5) {
|
||||
public void onUpdate(ItemStack par1ItemStack, World world, Entity par3Entity, int par4, boolean par5) {
|
||||
getSeed(par1ItemStack);
|
||||
}
|
||||
|
||||
@@ -211,19 +211,19 @@ public class ItemBottledMana extends ItemMod {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List<String> par3List, boolean par4) {
|
||||
par3List.add(I18n.format("botaniamisc.bottleTooltip"));
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer player, List<String> stacks, boolean par4) {
|
||||
stacks.add(I18n.format("botaniamisc.bottleTooltip"));
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ActionResult<ItemStack> onItemRightClick(@Nonnull ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer, EnumHand hand) {
|
||||
par3EntityPlayer.setActiveHand(hand);
|
||||
public ActionResult<ItemStack> onItemRightClick(@Nonnull ItemStack par1ItemStack, World world, EntityPlayer player, EnumHand hand) {
|
||||
player.setActiveHand(hand);
|
||||
return ActionResult.newResult(EnumActionResult.SUCCESS, par1ItemStack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemUseFinish(@Nonnull ItemStack par1ItemStack, World par2World, EntityLivingBase living) {
|
||||
public ItemStack onItemUseFinish(@Nonnull ItemStack par1ItemStack, World world, EntityLivingBase living) {
|
||||
randomEffect(living, par1ItemStack);
|
||||
par1ItemStack.setItemDamage(par1ItemStack.getItemDamage() + 1);
|
||||
randomSeed(par1ItemStack);
|
||||
|
||||
@@ -138,9 +138,9 @@ public class ItemCacophonium extends ItemMod implements ICraftAchievement {
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ActionResult<ItemStack> onItemRightClick(@Nonnull ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer, EnumHand hand) {
|
||||
public ActionResult<ItemStack> onItemRightClick(@Nonnull ItemStack par1ItemStack, World world, EntityPlayer player, EnumHand hand) {
|
||||
if(ItemNBTHelper.getBoolean(par1ItemStack, TAG_HAS_SOUND, false) || isDOIT(par1ItemStack))
|
||||
par3EntityPlayer.setActiveHand(hand);
|
||||
player.setActiveHand(hand);
|
||||
return ActionResult.newResult(EnumActionResult.SUCCESS, par1ItemStack);
|
||||
}
|
||||
|
||||
|
||||
@@ -35,36 +35,36 @@ public class ItemFertilizer extends ItemMod {
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public EnumActionResult onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, BlockPos pos, EnumHand hand, EnumFacing side, float par8, float par9, float par10) {
|
||||
public EnumActionResult onItemUse(ItemStack par1ItemStack, EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing side, float par8, float par9, float par10) {
|
||||
final int range = 3;
|
||||
if(!par3World.isRemote) {
|
||||
if(!world.isRemote) {
|
||||
List<BlockPos> validCoords = new ArrayList<>();
|
||||
|
||||
for(int i = -range - 1; i < range; i++)
|
||||
for(int j = -range - 1; j < range; j++) {
|
||||
for(int k = 2; k >= -2; k--) {
|
||||
BlockPos pos_ = pos.add(i + 1, k + 1, j + 1);
|
||||
if(par3World.isAirBlock(pos_) && (!par3World.provider.getHasNoSky() || pos_.getY() < 255) && ModBlocks.flower.canPlaceBlockAt(par3World, pos_))
|
||||
if(world.isAirBlock(pos_) && (!world.provider.getHasNoSky() || pos_.getY() < 255) && ModBlocks.flower.canPlaceBlockAt(world, pos_))
|
||||
validCoords.add(pos_);
|
||||
}
|
||||
}
|
||||
|
||||
int flowerCount = Math.min(validCoords.size(), par3World.rand.nextBoolean() ? 3 : 4);
|
||||
int flowerCount = Math.min(validCoords.size(), world.rand.nextBoolean() ? 3 : 4);
|
||||
for(int i = 0; i < flowerCount; i++) {
|
||||
BlockPos coords = validCoords.get(par3World.rand.nextInt(validCoords.size()));
|
||||
BlockPos coords = validCoords.get(world.rand.nextInt(validCoords.size()));
|
||||
validCoords.remove(coords);
|
||||
par3World.setBlockState(coords, ModBlocks.flower.getDefaultState().withProperty(BotaniaStateProps.COLOR, EnumDyeColor.byMetadata(par3World.rand.nextInt(16))), 1 | 2);
|
||||
world.setBlockState(coords, ModBlocks.flower.getDefaultState().withProperty(BotaniaStateProps.COLOR, EnumDyeColor.byMetadata(world.rand.nextInt(16))), 1 | 2);
|
||||
}
|
||||
par1ItemStack.stackSize--;
|
||||
} else {
|
||||
for(int i = 0; i < 15; i++) {
|
||||
double x = pos.getX() - range + par3World.rand.nextInt(range * 2 + 1) + Math.random();
|
||||
double x = pos.getX() - range + world.rand.nextInt(range * 2 + 1) + Math.random();
|
||||
double y = pos.getY() + 1;
|
||||
double z = pos.getZ() - range + par3World.rand.nextInt(range * 2 + 1) + Math.random();
|
||||
double z = pos.getZ() - range + world.rand.nextInt(range * 2 + 1) + Math.random();
|
||||
float red = (float) Math.random();
|
||||
float green = (float) Math.random();
|
||||
float blue = (float) Math.random();
|
||||
Botania.proxy.wispFX(par3World, x, y, z, red, green, blue, 0.15F + (float) Math.random() * 0.25F, -(float) Math.random() * 0.1F - 0.05F);
|
||||
Botania.proxy.wispFX(world, x, y, z, red, green, blue, 0.15F + (float) Math.random() * 0.25F, -(float) Math.random() * 0.1F - 0.05F);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -75,8 +75,8 @@ public class ItemGrassHorn extends ItemMod {
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ActionResult<ItemStack> onItemRightClick(@Nonnull ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer, EnumHand hand) {
|
||||
par3EntityPlayer.setActiveHand(hand);
|
||||
public ActionResult<ItemStack> onItemRightClick(@Nonnull ItemStack par1ItemStack, World world, EntityPlayer player, EnumHand hand) {
|
||||
player.setActiveHand(hand);
|
||||
return ActionResult.newResult(EnumActionResult.SUCCESS, par1ItemStack);
|
||||
}
|
||||
|
||||
|
||||
@@ -66,9 +66,9 @@ public class ItemGrassSeeds extends ItemMod implements IFloatingFlowerVariant {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubItems(@Nonnull Item par1, CreativeTabs par2, List<ItemStack> par3) {
|
||||
public void getSubItems(@Nonnull Item item, CreativeTabs par2, List<ItemStack> par3) {
|
||||
for(int i = 0; i < SUBTYPES; i++)
|
||||
par3.add(new ItemStack(par1, 1, i));
|
||||
par3.add(new ItemStack(item, 1, i));
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@@ -79,14 +79,14 @@ public class ItemGrassSeeds extends ItemMod implements IFloatingFlowerVariant {
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public EnumActionResult onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, BlockPos pos, EnumHand hand, EnumFacing side, float par8, float par9, float par10) {
|
||||
IBlockState state = par3World.getBlockState(pos);
|
||||
public EnumActionResult onItemUse(ItemStack par1ItemStack, EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing side, float par8, float par9, float par10) {
|
||||
IBlockState state = world.getBlockState(pos);
|
||||
|
||||
if((state.getBlock() == Blocks.DIRT && state.getValue(BlockDirt.VARIANT) == BlockDirt.DirtType.DIRT) || (state.getBlock() == Blocks.GRASS && par1ItemStack.getItemDamage() != 0)) {
|
||||
int meta = par1ItemStack.getItemDamage();
|
||||
|
||||
BlockSwapper swapper = addBlockSwapper(par3World, pos, meta);
|
||||
par3World.setBlockState(pos, swapper.stateToSet, 1 | 2);
|
||||
BlockSwapper swapper = addBlockSwapper(world, pos, meta);
|
||||
world.setBlockState(pos, swapper.stateToSet, 1 | 2);
|
||||
for(int i = 0; i < 50; i++) {
|
||||
double x = (Math.random() - 0.5) * 3;
|
||||
double y = Math.random() - 0.5 + 1;
|
||||
@@ -148,7 +148,7 @@ public class ItemGrassSeeds extends ItemMod implements IFloatingFlowerVariant {
|
||||
|
||||
float velMul = 0.025F;
|
||||
|
||||
Botania.proxy.wispFX(par3World, pos.getX() + 0.5 + x, pos.getY() + 0.5 + y, pos.getZ() + 0.5 + z, r, g, b, (float) Math.random() * 0.15F + 0.15F, (float) -x * velMul, (float) -y * velMul, (float) -z * velMul);
|
||||
Botania.proxy.wispFX(world, pos.getX() + 0.5 + x, pos.getY() + 0.5 + y, pos.getZ() + 0.5 + z, r, g, b, (float) Math.random() * 0.15F + 0.15F, (float) -x * velMul, (float) -y * velMul, (float) -z * velMul);
|
||||
}
|
||||
|
||||
par1ItemStack.stackSize--;
|
||||
|
||||
@@ -86,13 +86,13 @@ public class ItemLaputaShard extends ItemMod implements ILensEffect, ITinyPlanet
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public EnumActionResult onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, BlockPos pos, EnumHand hand, EnumFacing side, float par8, float par9, float par10) {
|
||||
if(!par3World.isRemote && pos.getY() < 160 && !par3World.provider.doesWaterVaporize()) {
|
||||
par3World.playSound(null, pos, BotaniaSoundEvents.laputaStart, SoundCategory.BLOCKS, 1.0F + par3World.rand.nextFloat(), par3World.rand.nextFloat() * 0.7F + 1.3F);
|
||||
spawnBurstFirst(par3World, pos, par1ItemStack);
|
||||
public EnumActionResult onItemUse(ItemStack par1ItemStack, EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing side, float par8, float par9, float par10) {
|
||||
if(!world.isRemote && pos.getY() < 160 && !world.provider.doesWaterVaporize()) {
|
||||
world.playSound(null, pos, BotaniaSoundEvents.laputaStart, SoundCategory.BLOCKS, 1.0F + world.rand.nextFloat(), world.rand.nextFloat() * 0.7F + 1.3F);
|
||||
spawnBurstFirst(world, pos, par1ItemStack);
|
||||
par1ItemStack.stackSize--;
|
||||
if(par1ItemStack.getItemDamage() == 19)
|
||||
par2EntityPlayer.addStat(ModAchievements.l20ShardUse, 1);
|
||||
player.addStat(ModAchievements.l20ShardUse, 1);
|
||||
}
|
||||
|
||||
return EnumActionResult.SUCCESS;
|
||||
|
||||
@@ -68,23 +68,23 @@ public class ItemLexicon extends ItemMod implements ILexicon, IElvenItem {
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public EnumActionResult onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, BlockPos pos, EnumHand hand, EnumFacing side, float par8, float par9, float par10) {
|
||||
if(par2EntityPlayer.isSneaking()) {
|
||||
Block block = par3World.getBlockState(pos).getBlock();
|
||||
public EnumActionResult onItemUse(ItemStack par1ItemStack, EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing side, float par8, float par9, float par10) {
|
||||
if(player.isSneaking()) {
|
||||
Block block = world.getBlockState(pos).getBlock();
|
||||
|
||||
if(block != null) {
|
||||
if(block instanceof ILexiconable) {
|
||||
LexiconEntry entry = ((ILexiconable) block).getEntry(par3World, pos, par2EntityPlayer, par1ItemStack);
|
||||
LexiconEntry entry = ((ILexiconable) block).getEntry(world, pos, player, par1ItemStack);
|
||||
if(entry != null && isKnowledgeUnlocked(par1ItemStack, entry.getKnowledgeType())) {
|
||||
Botania.proxy.setEntryToOpen(entry);
|
||||
Botania.proxy.setLexiconStack(par1ItemStack);
|
||||
|
||||
openBook(par2EntityPlayer, par1ItemStack, par3World, false);
|
||||
openBook(player, par1ItemStack, world, false);
|
||||
return EnumActionResult.SUCCESS;
|
||||
}
|
||||
} else if(par3World.isRemote) {
|
||||
} else if(world.isRemote) {
|
||||
RayTraceResult mop = new RayTraceResult(new Vec3d(par8, par9, par10), side, pos);
|
||||
return Botania.proxy.openWikiPage(par3World, block, mop) ? EnumActionResult.SUCCESS : EnumActionResult.FAIL;
|
||||
return Botania.proxy.openWikiPage(world, block, mop) ? EnumActionResult.SUCCESS : EnumActionResult.FAIL;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -105,11 +105,11 @@ public class ItemLexicon extends ItemMod implements ILexicon, IElvenItem {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List<String> par3List, boolean par4) {
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer player, List<String> stacks, boolean par4) {
|
||||
if(GuiScreen.isShiftKeyDown()) {
|
||||
String edition = TextFormatting.GOLD + I18n.format("botaniamisc.edition", getEdition());
|
||||
if(!edition.isEmpty())
|
||||
par3List.add(edition);
|
||||
stacks.add(edition);
|
||||
|
||||
List<KnowledgeType> typesKnown = new ArrayList<>();
|
||||
for(String s : BotaniaAPI.knowledgeTypes.keySet()) {
|
||||
@@ -119,12 +119,12 @@ public class ItemLexicon extends ItemMod implements ILexicon, IElvenItem {
|
||||
}
|
||||
|
||||
String format = typesKnown.size() == 1 ? "botaniamisc.knowledgeTypesSingular" : "botaniamisc.knowledgeTypesPlural";
|
||||
addStringToTooltip(I18n.format(format, typesKnown.size()), par3List);
|
||||
addStringToTooltip(I18n.format(format, typesKnown.size()), stacks);
|
||||
|
||||
for(KnowledgeType type : typesKnown)
|
||||
addStringToTooltip(" \u2022 " + I18n.format(type.getUnlocalizedName()), par3List);
|
||||
addStringToTooltip(" \u2022 " + I18n.format(type.getUnlocalizedName()), stacks);
|
||||
|
||||
} else addStringToTooltip(I18n.format("botaniamisc.shiftinfo"), par3List);
|
||||
} else addStringToTooltip(I18n.format("botaniamisc.shiftinfo"), stacks);
|
||||
}
|
||||
|
||||
private void addStringToTooltip(String s, List<String> tooltip) {
|
||||
@@ -140,17 +140,17 @@ public class ItemLexicon extends ItemMod implements ILexicon, IElvenItem {
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ActionResult<ItemStack> onItemRightClick(@Nonnull ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer, EnumHand hand) {
|
||||
public ActionResult<ItemStack> onItemRightClick(@Nonnull ItemStack par1ItemStack, World world, EntityPlayer player, EnumHand hand) {
|
||||
String force = getForcedPage(par1ItemStack);
|
||||
if(force != null && !force.isEmpty()) {
|
||||
LexiconEntry entry = getEntryFromForce(par1ItemStack);
|
||||
if(entry != null)
|
||||
Botania.proxy.setEntryToOpen(entry);
|
||||
else par3EntityPlayer.addChatMessage(new TextComponentTranslation("botaniamisc.cantOpen").setStyle(new Style().setColor(TextFormatting.RED)));
|
||||
else player.addChatMessage(new TextComponentTranslation("botaniamisc.cantOpen").setStyle(new Style().setColor(TextFormatting.RED)));
|
||||
setForcedPage(par1ItemStack, "");
|
||||
}
|
||||
|
||||
openBook(par3EntityPlayer, par1ItemStack, par2World, skipSound);
|
||||
openBook(player, par1ItemStack, world, skipSound);
|
||||
skipSound = false;
|
||||
|
||||
return ActionResult.newResult(EnumActionResult.SUCCESS, par1ItemStack);
|
||||
|
||||
@@ -92,39 +92,39 @@ public class ItemManaGun extends ItemMod implements IManaUsingItem, IColorable {
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ActionResult<ItemStack> onItemRightClick(@Nonnull ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer, EnumHand hand) {
|
||||
public ActionResult<ItemStack> onItemRightClick(@Nonnull ItemStack par1ItemStack, World world, EntityPlayer player, EnumHand hand) {
|
||||
int effCd = COOLDOWN;
|
||||
PotionEffect effect = par3EntityPlayer.getActivePotionEffect(MobEffects.HASTE);
|
||||
PotionEffect effect = player.getActivePotionEffect(MobEffects.HASTE);
|
||||
if(effect != null)
|
||||
effCd -= (effect.getAmplifier() + 1) * 8;
|
||||
|
||||
if(par3EntityPlayer.isSneaking() && hasClip(par1ItemStack)) {
|
||||
if(player.isSneaking() && hasClip(par1ItemStack)) {
|
||||
rotatePos(par1ItemStack);
|
||||
par2World.playSound(null, par3EntityPlayer.posX, par3EntityPlayer.posY, par3EntityPlayer.posZ, SoundEvents.BLOCK_STONE_BUTTON_CLICK_ON, SoundCategory.PLAYERS, 0.6F, (1.0F + (par2World.rand.nextFloat() - par2World.rand.nextFloat()) * 0.2F) * 0.7F);
|
||||
if(par2World.isRemote)
|
||||
par3EntityPlayer.swingArm(hand);
|
||||
world.playSound(null, player.posX, player.posY, player.posZ, SoundEvents.BLOCK_STONE_BUTTON_CLICK_ON, SoundCategory.PLAYERS, 0.6F, (1.0F + (world.rand.nextFloat() - world.rand.nextFloat()) * 0.2F) * 0.7F);
|
||||
if(world.isRemote)
|
||||
player.swingArm(hand);
|
||||
ItemStack lens = getLens(par1ItemStack);
|
||||
ItemsRemainingRenderHandler.set(lens, -2);
|
||||
par1ItemStack.setItemDamage(effCd);
|
||||
return ActionResult.newResult(EnumActionResult.SUCCESS, par1ItemStack);
|
||||
} else if(par1ItemStack.getItemDamage() == 0) {
|
||||
EntityManaBurst burst = getBurst(par3EntityPlayer, par1ItemStack, true);
|
||||
if(burst != null && ManaItemHandler.requestManaExact(par1ItemStack, par3EntityPlayer, burst.getMana(), true)) {
|
||||
if(!par2World.isRemote) {
|
||||
par2World.playSound(null, par3EntityPlayer.posX, par3EntityPlayer.posY, par3EntityPlayer.posZ, BotaniaSoundEvents.manaBlaster, SoundCategory.PLAYERS, 0.6F, 1);
|
||||
par3EntityPlayer.addStat(ModAchievements.manaBlasterShoot, 1);
|
||||
EntityManaBurst burst = getBurst(player, par1ItemStack, true);
|
||||
if(burst != null && ManaItemHandler.requestManaExact(par1ItemStack, player, burst.getMana(), true)) {
|
||||
if(!world.isRemote) {
|
||||
world.playSound(null, player.posX, player.posY, player.posZ, BotaniaSoundEvents.manaBlaster, SoundCategory.PLAYERS, 0.6F, 1);
|
||||
player.addStat(ModAchievements.manaBlasterShoot, 1);
|
||||
if(isSugoiKawaiiDesuNe(par1ItemStack))
|
||||
par3EntityPlayer.addStat(ModAchievements.desuGun, 1);
|
||||
par2World.spawnEntityInWorld(burst);
|
||||
player.addStat(ModAchievements.desuGun, 1);
|
||||
world.spawnEntityInWorld(burst);
|
||||
} else {
|
||||
par3EntityPlayer.swingArm(hand);
|
||||
par3EntityPlayer.motionX -= burst.motionX * 0.1;
|
||||
par3EntityPlayer.motionY -= burst.motionY * 0.3;
|
||||
par3EntityPlayer.motionZ -= burst.motionZ * 0.1;
|
||||
player.swingArm(hand);
|
||||
player.motionX -= burst.motionX * 0.1;
|
||||
player.motionY -= burst.motionY * 0.3;
|
||||
player.motionZ -= burst.motionZ * 0.1;
|
||||
}
|
||||
par1ItemStack.setItemDamage(effCd);
|
||||
} else if(!par2World.isRemote)
|
||||
par2World.playSound(null, par3EntityPlayer.posX, par3EntityPlayer.posY, par3EntityPlayer.posZ, SoundEvents.BLOCK_LEVER_CLICK, SoundCategory.PLAYERS, 0.6F, (1.0F + (par2World.rand.nextFloat() - par2World.rand.nextFloat()) * 0.2F) * 0.7F);
|
||||
} else if(!world.isRemote)
|
||||
world.playSound(null, player.posX, player.posY, player.posZ, SoundEvents.BLOCK_LEVER_CLICK, SoundCategory.PLAYERS, 0.6F, (1.0F + (world.rand.nextFloat() - world.rand.nextFloat()) * 0.2F) * 0.7F);
|
||||
return ActionResult.newResult(EnumActionResult.SUCCESS, par1ItemStack);
|
||||
}
|
||||
|
||||
@@ -208,23 +208,23 @@ public class ItemManaGun extends ItemMod implements IManaUsingItem, IColorable {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List<String> par3List, boolean par4) {
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer player, List<String> stacks, boolean par4) {
|
||||
boolean clip = hasClip(par1ItemStack);
|
||||
if(clip && !GuiScreen.isShiftKeyDown()) {
|
||||
addStringToTooltip(I18n.format("botaniamisc.shiftinfo"), par3List);
|
||||
addStringToTooltip(I18n.format("botaniamisc.shiftinfo"), stacks);
|
||||
return;
|
||||
}
|
||||
|
||||
ItemStack lens = getLens(par1ItemStack);
|
||||
if(lens != null) {
|
||||
List<String> tooltip = lens.getTooltip(par2EntityPlayer, false);
|
||||
List<String> tooltip = lens.getTooltip(player, false);
|
||||
if(tooltip.size() > 1)
|
||||
par3List.addAll(tooltip.subList(1, tooltip.size()));
|
||||
stacks.addAll(tooltip.subList(1, tooltip.size()));
|
||||
}
|
||||
|
||||
if(clip) {
|
||||
int pos = getClipPos(par1ItemStack);
|
||||
addStringToTooltip(I18n.format("botaniamisc.hasClip"), par3List);
|
||||
addStringToTooltip(I18n.format("botaniamisc.hasClip"), stacks);
|
||||
for(int i = 0; i < CLIP_SLOTS; i++) {
|
||||
String name;
|
||||
TextFormatting formatting = i == pos ? TextFormatting.GREEN : TextFormatting.GRAY;
|
||||
@@ -232,7 +232,7 @@ public class ItemManaGun extends ItemMod implements IManaUsingItem, IColorable {
|
||||
if(lensAt == null)
|
||||
name = I18n.format("botaniamisc.clipEmpty");
|
||||
else name = lensAt.getDisplayName();
|
||||
addStringToTooltip(formatting + " - " + name, par3List);
|
||||
addStringToTooltip(formatting + " - " + name, stacks);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -332,7 +332,7 @@ public class ItemManaGun extends ItemMod implements IManaUsingItem, IColorable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5) {
|
||||
public void onUpdate(ItemStack par1ItemStack, World world, Entity par3Entity, int par4, boolean par5) {
|
||||
if(par1ItemStack.isItemDamaged())
|
||||
par1ItemStack.setItemDamage(par1ItemStack.getItemDamage() - 1);
|
||||
}
|
||||
|
||||
@@ -67,8 +67,8 @@ public class ItemManaMirror extends ItemMod implements IManaItem, ICoordBoundIte
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5) {
|
||||
if(par2World.isRemote)
|
||||
public void onUpdate(ItemStack par1ItemStack, World world, Entity par3Entity, int par4, boolean par5) {
|
||||
if(world.isRemote)
|
||||
return;
|
||||
|
||||
IManaPool pool = getManaPool(par1ItemStack);
|
||||
@@ -85,12 +85,12 @@ public class ItemManaMirror extends ItemMod implements IManaItem, ICoordBoundIte
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public EnumActionResult onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, BlockPos pos, EnumHand hand, EnumFacing side, float par8, float par9, float par10) {
|
||||
if(par2EntityPlayer.isSneaking() && !par3World.isRemote) {
|
||||
TileEntity tile = par3World.getTileEntity(pos);
|
||||
public EnumActionResult onItemUse(ItemStack par1ItemStack, EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing side, float par8, float par9, float par10) {
|
||||
if(player.isSneaking() && !world.isRemote) {
|
||||
TileEntity tile = world.getTileEntity(pos);
|
||||
if(tile != null && tile instanceof IManaPool) {
|
||||
bindPool(par1ItemStack, tile);
|
||||
par3World.playSound(null, par2EntityPlayer.posX, par2EntityPlayer.posY, par2EntityPlayer.posZ, BotaniaSoundEvents.ding, SoundCategory.PLAYERS, 1F, 1F);
|
||||
world.playSound(null, player.posX, player.posY, player.posZ, BotaniaSoundEvents.ding, SoundCategory.PLAYERS, 1F, 1F);
|
||||
return EnumActionResult.SUCCESS;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,20 +45,20 @@ public class ItemManaTablet extends ItemMod implements IManaItem, ICreativeManaP
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubItems(@Nonnull Item par1, CreativeTabs par2CreativeTabs, List<ItemStack> par3List) {
|
||||
public void getSubItems(@Nonnull Item item, CreativeTabs tab, List<ItemStack> stacks) {
|
||||
// Empty tablet
|
||||
par3List.add(new ItemStack(par1, 1));
|
||||
stacks.add(new ItemStack(item, 1));
|
||||
|
||||
// Full tablet
|
||||
ItemStack fullPower = new ItemStack(par1, 1);
|
||||
ItemStack fullPower = new ItemStack(item, 1);
|
||||
setMana(fullPower, MAX_MANA);
|
||||
par3List.add(fullPower);
|
||||
stacks.add(fullPower);
|
||||
|
||||
// Creative Tablet
|
||||
ItemStack creative = new ItemStack(par1, 1);
|
||||
ItemStack creative = new ItemStack(item, 1);
|
||||
setMana(creative, MAX_MANA);
|
||||
setStackCreative(creative);
|
||||
par3List.add(creative);
|
||||
stacks.add(creative);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -79,9 +79,9 @@ public class ItemManaTablet extends ItemMod implements IManaItem, ICreativeManaP
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List<String> par3List, boolean par4) {
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer player, List<String> stacks, boolean par4) {
|
||||
if(isStackCreative(par1ItemStack))
|
||||
par3List.add(I18n.format("botaniamisc.creative"));
|
||||
stacks.add(I18n.format("botaniamisc.creative"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -33,8 +33,8 @@ public class ItemOpenBucket extends ItemMod {
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ActionResult<ItemStack> onItemRightClick(@Nonnull ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer, EnumHand hand) {
|
||||
RayTraceResult RayTraceResult = rayTrace(par2World, par3EntityPlayer, true);
|
||||
public ActionResult<ItemStack> onItemRightClick(@Nonnull ItemStack par1ItemStack, World world, EntityPlayer player, EnumHand hand) {
|
||||
RayTraceResult RayTraceResult = rayTrace(world, player, true);
|
||||
|
||||
if(RayTraceResult == null)
|
||||
return ActionResult.newResult(EnumActionResult.PASS, par1ItemStack);
|
||||
@@ -42,20 +42,20 @@ public class ItemOpenBucket extends ItemMod {
|
||||
if(RayTraceResult.typeOfHit == net.minecraft.util.math.RayTraceResult.Type.BLOCK) {
|
||||
BlockPos pos = RayTraceResult.getBlockPos();
|
||||
|
||||
if(!par2World.isBlockModifiable(par3EntityPlayer, pos))
|
||||
if(!world.isBlockModifiable(player, pos))
|
||||
return ActionResult.newResult(EnumActionResult.PASS, par1ItemStack);
|
||||
|
||||
if(!par3EntityPlayer.canPlayerEdit(pos, RayTraceResult.sideHit, par1ItemStack))
|
||||
if(!player.canPlayerEdit(pos, RayTraceResult.sideHit, par1ItemStack))
|
||||
return ActionResult.newResult(EnumActionResult.PASS, par1ItemStack);
|
||||
|
||||
Material material = par2World.getBlockState(pos).getMaterial();
|
||||
int l = par2World.getBlockState(pos).getBlock().getMetaFromState(par2World.getBlockState(pos)); // hack to get meta so we don't have to know the level prop
|
||||
Material material = world.getBlockState(pos).getMaterial();
|
||||
int l = world.getBlockState(pos).getBlock().getMetaFromState(world.getBlockState(pos)); // hack to get meta so we don't have to know the level prop
|
||||
|
||||
if((material == Material.LAVA || material == Material.WATER) && l == 0) {
|
||||
par2World.setBlockToAir(pos);
|
||||
world.setBlockToAir(pos);
|
||||
|
||||
for(int x = 0; x < 5; x++)
|
||||
par2World.spawnParticle(EnumParticleTypes.EXPLOSION_NORMAL, pos.getX() + Math.random(), pos.getY() + Math.random(), pos.getZ() + Math.random(), 0, 0, 0);
|
||||
world.spawnParticle(EnumParticleTypes.EXPLOSION_NORMAL, pos.getX() + Math.random(), pos.getY() + Math.random(), pos.getZ() + Math.random(), 0, 0, 0);
|
||||
|
||||
return ActionResult.newResult(EnumActionResult.SUCCESS, par1ItemStack);
|
||||
}
|
||||
|
||||
@@ -103,20 +103,20 @@ public class ItemSextant extends ItemMod {
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ActionResult<ItemStack> onItemRightClick(@Nonnull ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer, EnumHand hand) {
|
||||
public ActionResult<ItemStack> onItemRightClick(@Nonnull ItemStack par1ItemStack, World world, EntityPlayer player, EnumHand hand) {
|
||||
Botania.proxy.removeSextantMultiblock();
|
||||
|
||||
if(!par3EntityPlayer.isSneaking()) {
|
||||
RayTraceResult pos = ToolCommons.raytraceFromEntity(par2World, par3EntityPlayer, false, 128);
|
||||
if(!player.isSneaking()) {
|
||||
RayTraceResult pos = ToolCommons.raytraceFromEntity(world, player, false, 128);
|
||||
if(pos != null && pos.entityHit == null && pos.getBlockPos() != null) {
|
||||
if(!par2World.isRemote) {
|
||||
if(!world.isRemote) {
|
||||
ItemNBTHelper.setInt(par1ItemStack, TAG_SOURCE_X, pos.getBlockPos().getX());
|
||||
ItemNBTHelper.setInt(par1ItemStack, TAG_SOURCE_Y, pos.getBlockPos().getY());
|
||||
ItemNBTHelper.setInt(par1ItemStack, TAG_SOURCE_Z, pos.getBlockPos().getZ());
|
||||
}
|
||||
} else ItemNBTHelper.setInt(par1ItemStack, TAG_SOURCE_Y, -1);
|
||||
|
||||
par3EntityPlayer.setActiveHand(hand);
|
||||
player.setActiveHand(hand);
|
||||
}
|
||||
|
||||
return ActionResult.newResult(EnumActionResult.SUCCESS, par1ItemStack);
|
||||
|
||||
@@ -51,32 +51,32 @@ public class ItemSignalFlare extends ItemMod implements IColorable {
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ActionResult<ItemStack> onItemRightClick(@Nonnull ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer, EnumHand hand) {
|
||||
public ActionResult<ItemStack> onItemRightClick(@Nonnull ItemStack par1ItemStack, World world, EntityPlayer player, EnumHand hand) {
|
||||
if(par1ItemStack.getItemDamage() == 0) {
|
||||
if(par2World.isRemote)
|
||||
par3EntityPlayer.swingArm(hand);
|
||||
if(world.isRemote)
|
||||
player.swingArm(hand);
|
||||
else {
|
||||
EntitySignalFlare flare = new EntitySignalFlare(par2World);
|
||||
flare.setPosition(par3EntityPlayer.posX, par3EntityPlayer.posY, par3EntityPlayer.posZ);
|
||||
EntitySignalFlare flare = new EntitySignalFlare(world);
|
||||
flare.setPosition(player.posX, player.posY, player.posZ);
|
||||
flare.setColor(getColor(par1ItemStack));
|
||||
flare.setFiredAt((int) par3EntityPlayer.posY);
|
||||
par2World.playSound(null, par3EntityPlayer.posX, par3EntityPlayer.posY, par3EntityPlayer.posZ, SoundEvents.ENTITY_GENERIC_EXPLODE, SoundCategory.PLAYERS, 40F, (1.0F + (par2World.rand.nextFloat() - par2World.rand.nextFloat()) * 0.2F) * 0.7F);
|
||||
flare.setFiredAt((int) player.posY);
|
||||
world.playSound(null, player.posX, player.posY, player.posZ, SoundEvents.ENTITY_GENERIC_EXPLODE, SoundCategory.PLAYERS, 40F, (1.0F + (world.rand.nextFloat() - world.rand.nextFloat()) * 0.2F) * 0.7F);
|
||||
|
||||
par2World.spawnEntityInWorld(flare);
|
||||
world.spawnEntityInWorld(flare);
|
||||
|
||||
int stunned = 0;
|
||||
int range = 5;
|
||||
List<EntityLivingBase> entities = par2World.getEntitiesWithinAABB(EntityLivingBase.class, new AxisAlignedBB(par3EntityPlayer.posX - range, par3EntityPlayer.posY - range, par3EntityPlayer.posZ - range, par3EntityPlayer.posX + range, par3EntityPlayer.posY + range, par3EntityPlayer.posZ + range));
|
||||
List<EntityLivingBase> entities = world.getEntitiesWithinAABB(EntityLivingBase.class, new AxisAlignedBB(player.posX - range, player.posY - range, player.posZ - range, player.posX + range, player.posY + range, player.posZ + range));
|
||||
for(EntityLivingBase entity : entities)
|
||||
if(entity != par3EntityPlayer && (!(entity instanceof EntityPlayer) || FMLCommonHandler.instance().getMinecraftServerInstance() == null || FMLCommonHandler.instance().getMinecraftServerInstance().isPVPEnabled())) {
|
||||
if(entity != player && (!(entity instanceof EntityPlayer) || FMLCommonHandler.instance().getMinecraftServerInstance() == null || FMLCommonHandler.instance().getMinecraftServerInstance().isPVPEnabled())) {
|
||||
entity.addPotionEffect(new PotionEffect(MobEffects.SLOWNESS, 50, 5));
|
||||
stunned++;
|
||||
}
|
||||
|
||||
if(stunned >= 100)
|
||||
par3EntityPlayer.addStat(ModAchievements.signalFlareStun, 1);
|
||||
player.addStat(ModAchievements.signalFlareStun, 1);
|
||||
}
|
||||
par1ItemStack.damageItem(200, par3EntityPlayer);
|
||||
par1ItemStack.damageItem(200, player);
|
||||
return ActionResult.newResult(EnumActionResult.SUCCESS, par1ItemStack);
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ public class ItemSignalFlare extends ItemMod implements IColorable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5) {
|
||||
public void onUpdate(ItemStack par1ItemStack, World world, Entity par3Entity, int par4, boolean par5) {
|
||||
if(par1ItemStack.isItemDamaged())
|
||||
par1ItemStack.setItemDamage(par1ItemStack.getItemDamage() - 1);
|
||||
}
|
||||
@@ -98,16 +98,16 @@ public class ItemSignalFlare extends ItemMod implements IColorable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubItems(@Nonnull Item par1, CreativeTabs par2CreativeTabs, List<ItemStack> par3List) {
|
||||
public void getSubItems(@Nonnull Item item, CreativeTabs tab, List<ItemStack> stacks) {
|
||||
for(int i = 0; i < 16; i++)
|
||||
par3List.add(forColor(i));
|
||||
stacks.add(forColor(i));
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List<String> par3List, boolean par4) {
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer player, List<String> stacks, boolean par4) {
|
||||
int storedColor = getColor(par1ItemStack);
|
||||
par3List.add(I18n.format("botaniamisc.flareColor", I18n.format("botania.color" + storedColor)));
|
||||
stacks.add(I18n.format("botaniamisc.flareColor", I18n.format("botania.color" + storedColor)));
|
||||
}
|
||||
|
||||
public static ItemStack forColor(int color) {
|
||||
|
||||
@@ -35,7 +35,7 @@ public class ItemSlingshot extends ItemMod {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPlayerStoppedUsing(ItemStack par1ItemStack, World par2World, EntityLivingBase living, int par4) {
|
||||
public void onPlayerStoppedUsing(ItemStack par1ItemStack, World world, EntityLivingBase living, int par4) {
|
||||
int j = getMaxItemUseDuration(par1ItemStack) - par4;
|
||||
|
||||
if(!(living instanceof EntityPlayer) || ((EntityPlayer) living).capabilities.isCreativeMode || PlayerHelper.hasAmmo(((EntityPlayer) living), AMMO_FUNC)) {
|
||||
@@ -48,18 +48,18 @@ public class ItemSlingshot extends ItemMod {
|
||||
if(living instanceof EntityPlayer && !((EntityPlayer) living).capabilities.isCreativeMode)
|
||||
PlayerHelper.consumeAmmo(((EntityPlayer) living), AMMO_FUNC);
|
||||
|
||||
if(!par2World.isRemote) {
|
||||
if(!world.isRemote) {
|
||||
EntityVineBall ball = new EntityVineBall(living, false);
|
||||
ball.motionX *= 1.6;
|
||||
ball.motionY *= 1.6;
|
||||
ball.motionZ *= 1.6;
|
||||
par2World.spawnEntityInWorld(ball);
|
||||
world.spawnEntityInWorld(ball);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemUseFinish(@Nonnull ItemStack par1ItemStack, World par2World, EntityLivingBase living) {
|
||||
public ItemStack onItemUseFinish(@Nonnull ItemStack par1ItemStack, World world, EntityLivingBase living) {
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
@@ -76,9 +76,9 @@ public class ItemSlingshot extends ItemMod {
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ActionResult<ItemStack> onItemRightClick(@Nonnull ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer, EnumHand hand) {
|
||||
if(par3EntityPlayer.capabilities.isCreativeMode || PlayerHelper.hasAmmo(par3EntityPlayer, AMMO_FUNC)) {
|
||||
par3EntityPlayer.setActiveHand(hand);
|
||||
public ActionResult<ItemStack> onItemRightClick(@Nonnull ItemStack par1ItemStack, World world, EntityPlayer player, EnumHand hand) {
|
||||
if(player.capabilities.isCreativeMode || PlayerHelper.hasAmmo(player, AMMO_FUNC)) {
|
||||
player.setActiveHand(hand);
|
||||
return ActionResult.newResult(EnumActionResult.SUCCESS, par1ItemStack);
|
||||
}
|
||||
|
||||
|
||||
@@ -46,10 +46,10 @@ public class ItemTemperanceStone extends ItemMod {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List<String> par3List, boolean par4) {
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer player, List<String> stacks, boolean par4) {
|
||||
if(par1ItemStack.getItemDamage() == 1)
|
||||
addStringToTooltip(I18n.format("botaniamisc.active"), par3List);
|
||||
else addStringToTooltip(I18n.format("botaniamisc.inactive"), par3List);
|
||||
addStringToTooltip(I18n.format("botaniamisc.active"), stacks);
|
||||
else addStringToTooltip(I18n.format("botaniamisc.inactive"), stacks);
|
||||
}
|
||||
|
||||
void addStringToTooltip(String s, List<String> tooltip) {
|
||||
|
||||
@@ -79,41 +79,41 @@ public class ItemTwigWand extends Item16Colors implements ICoordBoundItem {
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public EnumActionResult onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, BlockPos pos, EnumHand hand, EnumFacing side, float par8, float par9, float par10) {
|
||||
Block block = par3World.getBlockState(pos).getBlock();
|
||||
public EnumActionResult onItemUse(ItemStack par1ItemStack, EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing side, float par8, float par9, float par10) {
|
||||
Block block = world.getBlockState(pos).getBlock();
|
||||
BlockPos boundTile = getBoundTile(par1ItemStack);
|
||||
|
||||
if(boundTile.getY() != -1 && par2EntityPlayer.isSneaking() && !pos.equals(boundTile)) {
|
||||
TileEntity tile = par3World.getTileEntity(boundTile);
|
||||
if(boundTile.getY() != -1 && player.isSneaking() && !pos.equals(boundTile)) {
|
||||
TileEntity tile = world.getTileEntity(boundTile);
|
||||
if(tile instanceof IWandBindable) {
|
||||
if(((IWandBindable) tile).bindTo(par2EntityPlayer, par1ItemStack, pos, side)) {
|
||||
if(((IWandBindable) tile).bindTo(player, par1ItemStack, pos, side)) {
|
||||
Vector3 orig = new Vector3(boundTile.getX() + 0.5, boundTile.getY() + 0.5, boundTile.getZ() + 0.5);
|
||||
Vector3 end = new Vector3(pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5);
|
||||
doParticleBeam(par3World, orig, end);
|
||||
doParticleBeam(world, orig, end);
|
||||
|
||||
VanillaPacketDispatcher.dispatchTEToNearbyPlayers(par3World, boundTile);
|
||||
VanillaPacketDispatcher.dispatchTEToNearbyPlayers(world, boundTile);
|
||||
setBoundTile(par1ItemStack, UNBOUND_POS);
|
||||
}
|
||||
|
||||
return EnumActionResult.SUCCESS;
|
||||
} else setBoundTile(par1ItemStack, UNBOUND_POS);
|
||||
} else if(par2EntityPlayer.isSneaking()) {
|
||||
block.rotateBlock(par3World, pos, side);
|
||||
if(par3World.isRemote)
|
||||
par2EntityPlayer.swingArm(hand);
|
||||
} else if(player.isSneaking()) {
|
||||
block.rotateBlock(world, pos, side);
|
||||
if(world.isRemote)
|
||||
player.swingArm(hand);
|
||||
}
|
||||
|
||||
if(block == Blocks.LAPIS_BLOCK && ConfigHandler.enchanterEnabled) {
|
||||
EnumFacing.Axis axis = null;
|
||||
if(TileEnchanter.canEnchanterExist(par3World, pos, EnumFacing.Axis.X))
|
||||
if(TileEnchanter.canEnchanterExist(world, pos, EnumFacing.Axis.X))
|
||||
axis = EnumFacing.Axis.X;
|
||||
else if(TileEnchanter.canEnchanterExist(par3World, pos, EnumFacing.Axis.Z))
|
||||
else if(TileEnchanter.canEnchanterExist(world, pos, EnumFacing.Axis.Z))
|
||||
axis = EnumFacing.Axis.Z;
|
||||
|
||||
if(axis != null && !par3World.isRemote) {
|
||||
par3World.setBlockState(pos, ModBlocks.enchanter.getDefaultState().withProperty(BotaniaStateProps.ENCHANTER_DIRECTION, axis), 1 | 2);
|
||||
par2EntityPlayer.addStat(ModAchievements.enchanterMake, 1);
|
||||
par3World.playSound(null, pos, BotaniaSoundEvents.enchanterForm, SoundCategory.BLOCKS, 0.5F, 0.6F);
|
||||
if(axis != null && !world.isRemote) {
|
||||
world.setBlockState(pos, ModBlocks.enchanter.getDefaultState().withProperty(BotaniaStateProps.ENCHANTER_DIRECTION, axis), 1 | 2);
|
||||
player.addStat(ModAchievements.enchanterMake, 1);
|
||||
world.playSound(null, pos, BotaniaSoundEvents.enchanterForm, SoundCategory.BLOCKS, 0.5F, 0.6F);
|
||||
for(int i = 0; i < 50; i++) {
|
||||
float red = (float) Math.random();
|
||||
float green = (float) Math.random();
|
||||
@@ -125,40 +125,40 @@ public class ItemTwigWand extends Item16Colors implements ICoordBoundItem {
|
||||
|
||||
float velMul = 0.07F;
|
||||
|
||||
Botania.proxy.wispFX(par3World, pos.getX() + 0.5 + x, pos.getY() + 0.5 + y, pos.getZ() + 0.5 + z, red, green, blue, (float) Math.random() * 0.15F + 0.15F, (float) -x * velMul, (float) -y * velMul, (float) -z * velMul);
|
||||
Botania.proxy.wispFX(world, pos.getX() + 0.5 + x, pos.getY() + 0.5 + y, pos.getZ() + 0.5 + z, red, green, blue, (float) Math.random() * 0.15F + 0.15F, (float) -x * velMul, (float) -y * velMul, (float) -z * velMul);
|
||||
}
|
||||
}
|
||||
} else if(block instanceof IWandable) {
|
||||
TileEntity tile = par3World.getTileEntity(pos);
|
||||
TileEntity tile = world.getTileEntity(pos);
|
||||
boolean bindable = tile instanceof IWandBindable;
|
||||
|
||||
boolean wanded;
|
||||
if(getBindMode(par1ItemStack) && bindable && par2EntityPlayer.isSneaking() && ((IWandBindable) tile).canSelect(par2EntityPlayer, par1ItemStack, pos, side)) {
|
||||
if(getBindMode(par1ItemStack) && bindable && player.isSneaking() && ((IWandBindable) tile).canSelect(player, par1ItemStack, pos, side)) {
|
||||
if(boundTile.equals(pos))
|
||||
setBoundTile(par1ItemStack, UNBOUND_POS);
|
||||
else setBoundTile(par1ItemStack, pos);
|
||||
|
||||
if(par3World.isRemote)
|
||||
par2EntityPlayer.swingArm(hand);
|
||||
par3World.playSound(null, par2EntityPlayer.posX, par2EntityPlayer.posY, par2EntityPlayer.posZ, BotaniaSoundEvents.ding, SoundCategory.PLAYERS, 0.11F, 1F);
|
||||
if(world.isRemote)
|
||||
player.swingArm(hand);
|
||||
world.playSound(null, player.posX, player.posY, player.posZ, BotaniaSoundEvents.ding, SoundCategory.PLAYERS, 0.11F, 1F);
|
||||
|
||||
wanded = true;
|
||||
} else {
|
||||
wanded = ((IWandable) block).onUsedByWand(par2EntityPlayer, par1ItemStack, par3World, pos, side);
|
||||
if(wanded && par3World.isRemote)
|
||||
par2EntityPlayer.swingArm(hand);
|
||||
wanded = ((IWandable) block).onUsedByWand(player, par1ItemStack, world, pos, side);
|
||||
if(wanded && world.isRemote)
|
||||
player.swingArm(hand);
|
||||
}
|
||||
|
||||
return wanded ? EnumActionResult.SUCCESS : EnumActionResult.FAIL;
|
||||
} else if(((BlockPistonRelay) (ModBlocks.pistonRelay)).playerPositions.containsKey(par2EntityPlayer.getUniqueID()) && !par3World.isRemote) {
|
||||
BlockPistonRelay.DimWithPos bindPos = ((BlockPistonRelay) (ModBlocks.pistonRelay)).playerPositions.get(par2EntityPlayer.getUniqueID());
|
||||
BlockPistonRelay.DimWithPos currentPos = new BlockPistonRelay.DimWithPos(par3World.provider.getDimension(), pos);
|
||||
} else if(((BlockPistonRelay) (ModBlocks.pistonRelay)).playerPositions.containsKey(player.getUniqueID()) && !world.isRemote) {
|
||||
BlockPistonRelay.DimWithPos bindPos = ((BlockPistonRelay) (ModBlocks.pistonRelay)).playerPositions.get(player.getUniqueID());
|
||||
BlockPistonRelay.DimWithPos currentPos = new BlockPistonRelay.DimWithPos(world.provider.getDimension(), pos);
|
||||
|
||||
((BlockPistonRelay) (ModBlocks.pistonRelay)).playerPositions.remove(par2EntityPlayer.getUniqueID());
|
||||
((BlockPistonRelay) (ModBlocks.pistonRelay)).playerPositions.remove(player.getUniqueID());
|
||||
((BlockPistonRelay) (ModBlocks.pistonRelay)).mappedPositions.put(bindPos, currentPos);
|
||||
BlockPistonRelay.WorldData.get(par3World).markDirty();
|
||||
BlockPistonRelay.WorldData.get(world).markDirty();
|
||||
|
||||
par3World.playSound(null, par2EntityPlayer.posX, par2EntityPlayer.posY, par2EntityPlayer.posZ, BotaniaSoundEvents.ding, SoundCategory.PLAYERS, 1F, 1F);
|
||||
world.playSound(null, player.posX, player.posY, player.posZ, BotaniaSoundEvents.ding, SoundCategory.PLAYERS, 1F, 1F);
|
||||
return EnumActionResult.SUCCESS;
|
||||
}
|
||||
|
||||
@@ -191,9 +191,9 @@ public class ItemTwigWand extends Item16Colors implements ICoordBoundItem {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5) {
|
||||
public void onUpdate(ItemStack par1ItemStack, World world, Entity par3Entity, int par4, boolean par5) {
|
||||
BlockPos coords = getBoundTile(par1ItemStack);
|
||||
TileEntity tile = par2World.getTileEntity(coords);
|
||||
TileEntity tile = world.getTileEntity(coords);
|
||||
if(tile == null || !(tile instanceof IWandBindable))
|
||||
setBoundTile(par1ItemStack, UNBOUND_POS);
|
||||
}
|
||||
@@ -219,9 +219,9 @@ public class ItemTwigWand extends Item16Colors implements ICoordBoundItem {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubItems(@Nonnull Item par1, CreativeTabs par2CreativeTabs, List<ItemStack> par3List) {
|
||||
public void getSubItems(@Nonnull Item item, CreativeTabs tab, List<ItemStack> stacks) {
|
||||
for(int i = 0; i < 16; i++)
|
||||
par3List.add(forColors(i, i));
|
||||
stacks.add(forColors(i, i));
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
|
||||
@@ -31,16 +31,16 @@ public class ItemVineBall extends ItemMod {
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ActionResult<ItemStack> onItemRightClick(@Nonnull ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer, EnumHand hand) {
|
||||
if(!par3EntityPlayer.capabilities.isCreativeMode)
|
||||
public ActionResult<ItemStack> onItemRightClick(@Nonnull ItemStack par1ItemStack, World world, EntityPlayer player, EnumHand hand) {
|
||||
if(!player.capabilities.isCreativeMode)
|
||||
--par1ItemStack.stackSize;
|
||||
|
||||
par2World.playSound(null, par3EntityPlayer.posX, par3EntityPlayer.posY, par3EntityPlayer.posZ, SoundEvents.ENTITY_ARROW_SHOOT, SoundCategory.NEUTRAL, 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));
|
||||
world.playSound(null, player.posX, player.posY, player.posZ, SoundEvents.ENTITY_ARROW_SHOOT, SoundCategory.NEUTRAL, 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));
|
||||
|
||||
if(!par2World.isRemote) {
|
||||
EntityVineBall ball = new EntityVineBall(par3EntityPlayer, true);
|
||||
ball.setHeadingFromThrower(par3EntityPlayer, par3EntityPlayer.rotationPitch, par3EntityPlayer.rotationYaw, 0.0F, 1.5F, 1.0F);
|
||||
par2World.spawnEntityInWorld(ball);
|
||||
if(!world.isRemote) {
|
||||
EntityVineBall ball = new EntityVineBall(player, true);
|
||||
ball.setHeadingFromThrower(player, player.rotationPitch, player.rotationYaw, 0.0F, 1.5F, 1.0F);
|
||||
world.spawnEntityInWorld(ball);
|
||||
}
|
||||
|
||||
return ActionResult.newResult(EnumActionResult.SUCCESS, par1ItemStack);
|
||||
|
||||
@@ -52,9 +52,9 @@ public class ItemVirus extends ItemMod {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean itemInteractionForEntity(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, EntityLivingBase par3EntityLivingBase, EnumHand hand) {
|
||||
public boolean itemInteractionForEntity(ItemStack par1ItemStack, EntityPlayer player, EntityLivingBase par3EntityLivingBase, EnumHand hand) {
|
||||
if(par3EntityLivingBase instanceof EntityHorse) {
|
||||
if(par2EntityPlayer.worldObj.isRemote)
|
||||
if(player.worldObj.isRemote)
|
||||
return true;
|
||||
EntityHorse horse = (EntityHorse) par3EntityLivingBase;
|
||||
if(horse.getType() != HorseType.ZOMBIE && horse.getType() != HorseType.SKELETON && horse.isTame()) {
|
||||
|
||||
@@ -28,10 +28,10 @@ public class ItemBlockPool extends ItemBlockWithMetaNameAndColor {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void addInformation(@Nonnull ItemStack par1ItemStack, @Nonnull EntityPlayer par2EntityPlayer, @Nonnull List<String> par3List, boolean par4) {
|
||||
public void addInformation(@Nonnull ItemStack par1ItemStack, @Nonnull EntityPlayer player, @Nonnull List<String> stacks, boolean par4) {
|
||||
if(par1ItemStack.getItemDamage() == 1)
|
||||
for(int i = 0; i < 2; i++)
|
||||
par3List.add(I18n.format("botaniamisc.creativePool" + i));
|
||||
stacks.add(I18n.format("botaniamisc.creativePool" + i));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -79,22 +79,22 @@ public class ItemBlockSpecialFlower extends ItemBlockMod implements IRecipeKeyPr
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void addInformation(@Nonnull ItemStack par1ItemStack, @Nonnull EntityPlayer par2EntityPlayer, @Nonnull List<String> par3List, boolean par4) {
|
||||
public void addInformation(@Nonnull ItemStack par1ItemStack, @Nonnull EntityPlayer player, @Nonnull List<String> stacks, boolean par4) {
|
||||
String type = getType(par1ItemStack);
|
||||
SubTileSignature sig = BotaniaAPI.getSignatureForName(type);
|
||||
|
||||
sig.addTooltip(par1ItemStack, par2EntityPlayer, par3List);
|
||||
sig.addTooltip(par1ItemStack, player, stacks);
|
||||
|
||||
if(ConfigHandler.referencesEnabled) {
|
||||
String refUnlocalized = sig.getUnlocalizedLoreTextForStack(par1ItemStack);
|
||||
String refLocalized = I18n.format(refUnlocalized);
|
||||
if(!refLocalized.equals(refUnlocalized))
|
||||
par3List.add(TextFormatting.ITALIC + refLocalized);
|
||||
stacks.add(TextFormatting.ITALIC + refLocalized);
|
||||
}
|
||||
|
||||
String mod = BotaniaAPI.subTileMods.get(type);
|
||||
if(!mod.equals(LibMisc.MOD_ID))
|
||||
par3List.add(TextFormatting.ITALIC + "[" + mod + "]");
|
||||
stacks.add(TextFormatting.ITALIC + "[" + mod + "]");
|
||||
}
|
||||
|
||||
public static String getType(ItemStack stack) {
|
||||
|
||||
@@ -57,24 +57,24 @@ public abstract class ItemBauble extends ItemMod implements IBauble, ICosmeticAt
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ActionResult<ItemStack> onItemRightClick(@Nonnull ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer, EnumHand hand) {
|
||||
if(!EntityDoppleganger.isTruePlayer(par3EntityPlayer))
|
||||
public ActionResult<ItemStack> onItemRightClick(@Nonnull ItemStack par1ItemStack, World world, EntityPlayer player, EnumHand hand) {
|
||||
if(!EntityDoppleganger.isTruePlayer(player))
|
||||
return ActionResult.newResult(EnumActionResult.FAIL, par1ItemStack);
|
||||
|
||||
if(canEquip(par1ItemStack, par3EntityPlayer)) {
|
||||
InventoryBaubles baubles = PlayerHandler.getPlayerBaubles(par3EntityPlayer);
|
||||
if(canEquip(par1ItemStack, player)) {
|
||||
InventoryBaubles baubles = PlayerHandler.getPlayerBaubles(player);
|
||||
for(int i = 0; i < baubles.getSizeInventory(); i++) {
|
||||
if(baubles.isItemValidForSlot(i, par1ItemStack)) {
|
||||
ItemStack stackInSlot = baubles.getStackInSlot(i);
|
||||
if(stackInSlot == null || ((IBauble) stackInSlot.getItem()).canUnequip(stackInSlot, par3EntityPlayer)) {
|
||||
if(!par2World.isRemote) {
|
||||
if(stackInSlot == null || ((IBauble) stackInSlot.getItem()).canUnequip(stackInSlot, player)) {
|
||||
if(!world.isRemote) {
|
||||
baubles.setInventorySlotContents(i, par1ItemStack.copy());
|
||||
if(!par3EntityPlayer.capabilities.isCreativeMode)
|
||||
par3EntityPlayer.inventory.setInventorySlotContents(par3EntityPlayer.inventory.currentItem, null);
|
||||
if(!player.capabilities.isCreativeMode)
|
||||
player.inventory.setInventorySlotContents(player.inventory.currentItem, null);
|
||||
}
|
||||
|
||||
if(stackInSlot != null) {
|
||||
((IBauble) stackInSlot.getItem()).onUnequipped(stackInSlot, par3EntityPlayer);
|
||||
((IBauble) stackInSlot.getItem()).onUnequipped(stackInSlot, player);
|
||||
return ActionResult.newResult(EnumActionResult.SUCCESS, stackInSlot.copy());
|
||||
}
|
||||
break;
|
||||
@@ -88,28 +88,28 @@ public abstract class ItemBauble extends ItemMod implements IBauble, ICosmeticAt
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List<String> par3List, boolean par4) {
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer player, List<String> stacks, boolean par4) {
|
||||
if(GuiScreen.isShiftKeyDown())
|
||||
addHiddenTooltip(par1ItemStack, par2EntityPlayer, par3List, par4);
|
||||
else addStringToTooltip(I18n.format("botaniamisc.shiftinfo"), par3List);
|
||||
addHiddenTooltip(par1ItemStack, player, stacks, par4);
|
||||
else addStringToTooltip(I18n.format("botaniamisc.shiftinfo"), stacks);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addHiddenTooltip(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List<String> par3List, boolean par4) {
|
||||
public void addHiddenTooltip(ItemStack par1ItemStack, EntityPlayer player, List<String> stacks, boolean par4) {
|
||||
BaubleType type = getBaubleType(par1ItemStack);
|
||||
addStringToTooltip(I18n.format("botania.baubletype." + type.name().toLowerCase()), par3List);
|
||||
addStringToTooltip(I18n.format("botania.baubletype." + type.name().toLowerCase()), stacks);
|
||||
|
||||
String key = vazkii.botania.client.core.helper.RenderHelper.getKeyDisplayString("Baubles Inventory");
|
||||
|
||||
if(key != null)
|
||||
addStringToTooltip(I18n.format("botania.baubletooltip", key), par3List);
|
||||
addStringToTooltip(I18n.format("botania.baubletooltip", key), stacks);
|
||||
|
||||
ItemStack cosmetic = getCosmeticItem(par1ItemStack);
|
||||
if(cosmetic != null)
|
||||
addStringToTooltip(I18n.format("botaniamisc.hasCosmetic", cosmetic.getDisplayName()), par3List);
|
||||
addStringToTooltip(I18n.format("botaniamisc.hasCosmetic", cosmetic.getDisplayName()), stacks);
|
||||
|
||||
if(hasPhantomInk(par1ItemStack))
|
||||
addStringToTooltip(I18n.format("botaniamisc.hasPhantomInk"), par3List);
|
||||
addStringToTooltip(I18n.format("botaniamisc.hasPhantomInk"), stacks);
|
||||
}
|
||||
|
||||
void addStringToTooltip(String s, List<String> tooltip) {
|
||||
|
||||
@@ -83,9 +83,9 @@ public class ItemBaubleCosmetic extends ItemBauble implements ICosmeticBauble {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void addHiddenTooltip(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List<String> par3List, boolean par4) {
|
||||
addStringToTooltip(I18n.format("botaniamisc.cosmeticBauble"), par3List);
|
||||
super.addHiddenTooltip(par1ItemStack, par2EntityPlayer, par3List, par4);
|
||||
public void addHiddenTooltip(ItemStack par1ItemStack, EntityPlayer player, List<String> stacks, boolean par4) {
|
||||
addStringToTooltip(I18n.format("botaniamisc.cosmeticBauble"), stacks);
|
||||
super.addHiddenTooltip(par1ItemStack, player, stacks, par4);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -104,9 +104,9 @@ public class ItemFlightTiara extends ItemBauble implements IManaUsingItem, IBaub
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void addHiddenTooltip(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List<String> par3List, boolean par4) {
|
||||
super.addHiddenTooltip(par1ItemStack, par2EntityPlayer, par3List, par4);
|
||||
par3List.add(I18n.format("botania.wings" + par1ItemStack.getItemDamage()));
|
||||
public void addHiddenTooltip(ItemStack par1ItemStack, EntityPlayer player, List<String> stacks, boolean par4) {
|
||||
super.addHiddenTooltip(par1ItemStack, player, stacks, par4);
|
||||
stacks.add(I18n.format("botania.wings" + par1ItemStack.getItemDamage()));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -47,8 +47,8 @@ public class ItemManaRing extends ItemBauble implements IManaItem, IManaTooltipD
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubItems(@Nonnull Item par1, CreativeTabs par2CreativeTabs, List<ItemStack> par3List) {
|
||||
par3List.add(new ItemStack(par1, 1, 10000));
|
||||
public void getSubItems(@Nonnull Item item, CreativeTabs tab, List<ItemStack> stacks) {
|
||||
stacks.add(new ItemStack(item, 1, 10000));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -41,41 +41,41 @@ public class ItemStarSword extends ItemManasteelSword implements ICraftAchieveme
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5) {
|
||||
super.onUpdate(par1ItemStack, par2World, par3Entity, par4, par5);
|
||||
public void onUpdate(ItemStack par1ItemStack, World world, Entity par3Entity, int par4, boolean par5) {
|
||||
super.onUpdate(par1ItemStack, world, par3Entity, par4, par5);
|
||||
if(par3Entity instanceof EntityPlayer) {
|
||||
EntityPlayer player = (EntityPlayer) par3Entity;
|
||||
PotionEffect haste = player.getActivePotionEffect(MobEffects.HASTE);
|
||||
float check = haste == null ? 0.16666667F : haste.getAmplifier() == 1 ? 0.5F : 0.4F;
|
||||
|
||||
if(player.getHeldItemMainhand() == par1ItemStack && player.swingProgress == check && !par2World.isRemote) {
|
||||
RayTraceResult pos = ToolCommons.raytraceFromEntity(par2World, par3Entity, true, 48);
|
||||
if(player.getHeldItemMainhand() == par1ItemStack && player.swingProgress == check && !world.isRemote) {
|
||||
RayTraceResult pos = ToolCommons.raytraceFromEntity(world, par3Entity, true, 48);
|
||||
if(pos != null && pos.getBlockPos() != null) {
|
||||
Vector3 posVec = new Vector3(pos.getBlockPos().getX(), pos.getBlockPos().getY(), pos.getBlockPos().getZ());
|
||||
Vector3 motVec = new Vector3((0.5 * Math.random() - 0.25) * 18, 24, (0.5 * Math.random() - 0.25) * 18);
|
||||
posVec.add(motVec);
|
||||
motVec.normalize().negate().multiply(1.5);
|
||||
|
||||
EntityFallingStar star = new EntityFallingStar(par2World, player);
|
||||
EntityFallingStar star = new EntityFallingStar(world, player);
|
||||
star.setPosition(posVec.x, posVec.y, posVec.z);
|
||||
star.motionX = motVec.x;
|
||||
star.motionY = motVec.y;
|
||||
star.motionZ = motVec.z;
|
||||
par2World.spawnEntityInWorld(star);
|
||||
world.spawnEntityInWorld(star);
|
||||
|
||||
if (!par2World.isRaining()
|
||||
&& Math.abs(par2World.getWorldTime() - 18000) < 1800
|
||||
if (!world.isRaining()
|
||||
&& Math.abs(world.getWorldTime() - 18000) < 1800
|
||||
&& Math.random() < 0.125) {
|
||||
EntityFallingStar bonusStar = new EntityFallingStar(par2World, player);
|
||||
EntityFallingStar bonusStar = new EntityFallingStar(world, player);
|
||||
bonusStar.setPosition(posVec.x, posVec.y, posVec.z);
|
||||
bonusStar.motionX = motVec.x + Math.random() - 0.5;
|
||||
bonusStar.motionY = motVec.y + Math.random() - 0.5;
|
||||
bonusStar.motionZ = motVec.z + Math.random() - 0.5;
|
||||
par2World.spawnEntityInWorld(bonusStar);
|
||||
world.spawnEntityInWorld(bonusStar);
|
||||
}
|
||||
|
||||
ToolCommons.damageItem(par1ItemStack, 1, player, MANA_PER_DAMAGE);
|
||||
par2World.playSound(null, player.posX, player.posY, player.posZ, BotaniaSoundEvents.starcaller, SoundCategory.PLAYERS, 0.4F, 1.4F);
|
||||
world.playSound(null, player.posX, player.posY, player.posZ, BotaniaSoundEvents.starcaller, SoundCategory.PLAYERS, 0.4F, 1.4F);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -43,7 +43,7 @@ public class ItemElementiumShears extends ItemManasteelShears {
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ActionResult<ItemStack> onItemRightClick(@Nonnull ItemStack par1ItemStack, World par2World, EntityPlayer player, EnumHand hand) {
|
||||
public ActionResult<ItemStack> onItemRightClick(@Nonnull ItemStack par1ItemStack, World world, EntityPlayer player, EnumHand hand) {
|
||||
player.setActiveHand(hand);
|
||||
return ActionResult.newResult(EnumActionResult.SUCCESS, par1ItemStack);
|
||||
}
|
||||
|
||||
+8
-8
@@ -106,24 +106,24 @@ public class ItemTerraPick extends ItemManasteelPick implements IManaItem, ISequ
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List<String> par3List, boolean par4) {
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer player, List<String> stacks, boolean par4) {
|
||||
String rank = I18n.format("botania.rank" + getLevel(par1ItemStack));
|
||||
String rankFormat = I18n.format("botaniamisc.toolRank", rank);
|
||||
par3List.add(rankFormat.replaceAll("&", "\u00a7"));
|
||||
stacks.add(rankFormat.replaceAll("&", "\u00a7"));
|
||||
if(getMana(par1ItemStack) == Integer.MAX_VALUE)
|
||||
par3List.add(TextFormatting.RED + I18n.format("botaniamisc.getALife"));
|
||||
stacks.add(TextFormatting.RED + I18n.format("botaniamisc.getALife"));
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ActionResult<ItemStack> onItemRightClick(@Nonnull ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer, EnumHand hand) {
|
||||
public ActionResult<ItemStack> onItemRightClick(@Nonnull ItemStack par1ItemStack, World world, EntityPlayer player, EnumHand hand) {
|
||||
getMana(par1ItemStack);
|
||||
int level = getLevel(par1ItemStack);
|
||||
|
||||
if(level != 0) {
|
||||
setEnabled(par1ItemStack, !isEnabled(par1ItemStack));
|
||||
if(!par2World.isRemote)
|
||||
par2World.playSound(null, par3EntityPlayer.posX, par3EntityPlayer.posY, par3EntityPlayer.posZ, BotaniaSoundEvents.terraPickMode, SoundCategory.PLAYERS, 0.5F, 0.4F);
|
||||
if(!world.isRemote)
|
||||
world.playSound(null, player.posX, player.posY, player.posZ, BotaniaSoundEvents.terraPickMode, SoundCategory.PLAYERS, 0.5F, 0.4F);
|
||||
}
|
||||
|
||||
return ActionResult.newResult(EnumActionResult.SUCCESS, par1ItemStack);
|
||||
@@ -137,8 +137,8 @@ public class ItemTerraPick extends ItemManasteelPick implements IManaItem, ISequ
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5) {
|
||||
super.onUpdate(par1ItemStack, par2World, par3Entity, par4, par5);
|
||||
public void onUpdate(ItemStack par1ItemStack, World world, Entity par3Entity, int par4, boolean par5) {
|
||||
super.onUpdate(par1ItemStack, world, par3Entity, par4, par5);
|
||||
if(isEnabled(par1ItemStack)) {
|
||||
int level = getLevel(par1ItemStack);
|
||||
|
||||
|
||||
+5
-5
@@ -53,18 +53,18 @@ public class ItemTerraSword extends ItemManasteelSword implements ILensEffect, I
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5) {
|
||||
super.onUpdate(par1ItemStack, par2World, par3Entity, par4, par5);
|
||||
public void onUpdate(ItemStack par1ItemStack, World world, Entity par3Entity, int par4, boolean par5) {
|
||||
super.onUpdate(par1ItemStack, world, par3Entity, par4, par5);
|
||||
if(par3Entity instanceof EntityPlayer) {
|
||||
EntityPlayer player = (EntityPlayer) par3Entity;
|
||||
PotionEffect haste = player.getActivePotionEffect(MobEffects.HASTE);
|
||||
float check = haste == null ? 0.16666667F : haste.getAmplifier() == 1 ? 0.5F : 0.4F;
|
||||
|
||||
if(player.getHeldItemMainhand() == par1ItemStack && player.swingProgress == check && !par2World.isRemote && par2World.rand.nextInt(2) == 0) {
|
||||
if(player.getHeldItemMainhand() == par1ItemStack && player.swingProgress == check && !world.isRemote && world.rand.nextInt(2) == 0) {
|
||||
EntityManaBurst burst = getBurst(player, par1ItemStack);
|
||||
par2World.spawnEntityInWorld(burst);
|
||||
world.spawnEntityInWorld(burst);
|
||||
ToolCommons.damageItem(par1ItemStack, 1, player, MANA_PER_DAMAGE);
|
||||
par2World.playSound(null, player.posX, player.posY, player.posZ, BotaniaSoundEvents.terraBlade, SoundCategory.PLAYERS, 0.4F, 1.4F);
|
||||
world.playSound(null, player.posX, player.posY, player.posZ, BotaniaSoundEvents.terraBlade, SoundCategory.PLAYERS, 0.4F, 1.4F);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -148,9 +148,9 @@ public class ItemLens extends ItemMod implements ILensControl, ICompositableLens
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubItems(@Nonnull Item par1, CreativeTabs par2CreativeTabs, List<ItemStack> par3List) {
|
||||
public void getSubItems(@Nonnull Item item, CreativeTabs tab, List<ItemStack> stacks) {
|
||||
for(int i = 0; i < SUBTYPES; i++)
|
||||
par3List.add(new ItemStack(par1, 1, i));
|
||||
stacks.add(new ItemStack(item, 1, i));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -166,10 +166,10 @@ public class ItemLens extends ItemMod implements ILensControl, ICompositableLens
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List<String> par3List, boolean par4) {
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer player, List<String> stacks, boolean par4) {
|
||||
int storedColor = getStoredColor(par1ItemStack);
|
||||
if(storedColor != -1)
|
||||
par3List.add(I18n.format("botaniamisc.color", I18n.format("botania.color" + storedColor)));
|
||||
stacks.add(I18n.format("botaniamisc.color", I18n.format("botania.color" + storedColor)));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -39,17 +39,17 @@ public class ItemDye extends Item16Colors {
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public EnumActionResult onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, BlockPos pos, EnumHand hand, EnumFacing side, float par8, float par9, float par10) {
|
||||
Block block = par3World.getBlockState(pos).getBlock();
|
||||
public EnumActionResult onItemUse(ItemStack par1ItemStack, EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing side, float par8, float par9, float par10) {
|
||||
Block block = world.getBlockState(pos).getBlock();
|
||||
EnumDyeColor color = EnumDyeColor.byMetadata(par1ItemStack.getItemDamage());
|
||||
if(block == Blocks.WOOL && color != par3World.getBlockState(pos).getValue(BlockColored.COLOR)
|
||||
|| block == Blocks.CARPET && color != par3World.getBlockState(pos).getValue(BlockCarpet.COLOR)) {
|
||||
par3World.setBlockState(pos, par3World.getBlockState(pos).withProperty(block == Blocks.WOOL ? BlockColored.COLOR : BlockCarpet.COLOR, color), 1 | 2);
|
||||
if(block == Blocks.WOOL && color != world.getBlockState(pos).getValue(BlockColored.COLOR)
|
||||
|| block == Blocks.CARPET && color != world.getBlockState(pos).getValue(BlockCarpet.COLOR)) {
|
||||
world.setBlockState(pos, world.getBlockState(pos).withProperty(block == Blocks.WOOL ? BlockColored.COLOR : BlockCarpet.COLOR, color), 1 | 2);
|
||||
par1ItemStack.stackSize--;
|
||||
return EnumActionResult.SUCCESS;
|
||||
}
|
||||
|
||||
TileEntity tile = par3World.getTileEntity(pos);
|
||||
TileEntity tile = world.getTileEntity(pos);
|
||||
if(tile instanceof IManaPool) {
|
||||
IManaPool pool = (IManaPool) tile;
|
||||
if(color != pool.getColor()) {
|
||||
|
||||
@@ -87,34 +87,34 @@ public class ItemManaResource extends ItemMod implements IFlowerComponent, IElve
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public EnumActionResult onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, BlockPos pos, EnumHand hand, EnumFacing side, float par8, float par9, float par10) {
|
||||
public EnumActionResult onItemUse(ItemStack par1ItemStack, EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing side, float par8, float par9, float par10) {
|
||||
if(par1ItemStack.getItemDamage() == 4 || par1ItemStack.getItemDamage() == 14)
|
||||
return par3World.isRemote || EntityDoppleganger.spawn(par2EntityPlayer, par1ItemStack, par3World, pos, par1ItemStack.getItemDamage() == 14) ? EnumActionResult.SUCCESS : EnumActionResult.FAIL;
|
||||
else if(par1ItemStack.getItemDamage() == 20 && net.minecraft.item.ItemDye.applyBonemeal(par1ItemStack, par3World, pos, par2EntityPlayer)) {
|
||||
if(!par3World.isRemote)
|
||||
par3World.playEvent(2005, pos, 0);
|
||||
return world.isRemote || EntityDoppleganger.spawn(player, par1ItemStack, world, pos, par1ItemStack.getItemDamage() == 14) ? EnumActionResult.SUCCESS : EnumActionResult.FAIL;
|
||||
else if(par1ItemStack.getItemDamage() == 20 && net.minecraft.item.ItemDye.applyBonemeal(par1ItemStack, world, pos, player)) {
|
||||
if(!world.isRemote)
|
||||
world.playEvent(2005, pos, 0);
|
||||
|
||||
return EnumActionResult.SUCCESS;
|
||||
}
|
||||
|
||||
return super.onItemUse(par1ItemStack, par2EntityPlayer, par3World, pos, hand, side, par8, par9, par10);
|
||||
return super.onItemUse(par1ItemStack, player, world, pos, hand, side, par8, par9, par10);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ActionResult<ItemStack> onItemRightClick(@Nonnull ItemStack par1ItemStack, World par3World, EntityPlayer par2EntityPlayer, EnumHand hand) {
|
||||
public ActionResult<ItemStack> onItemRightClick(@Nonnull ItemStack par1ItemStack, World world, EntityPlayer player, EnumHand hand) {
|
||||
if(par1ItemStack.getItemDamage() == 15) {
|
||||
if(!par2EntityPlayer.capabilities.isCreativeMode)
|
||||
if(!player.capabilities.isCreativeMode)
|
||||
--par1ItemStack.stackSize;
|
||||
|
||||
par3World.playSound(null, par2EntityPlayer.posX, par2EntityPlayer.posY, par2EntityPlayer.posZ, SoundEvents.ENTITY_ARROW_SHOOT, SoundCategory.PLAYERS, 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));
|
||||
world.playSound(null, player.posX, player.posY, player.posZ, SoundEvents.ENTITY_ARROW_SHOOT, SoundCategory.PLAYERS, 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));
|
||||
|
||||
if(!par3World.isRemote) {
|
||||
EntityEnderAirBottle b = new EntityEnderAirBottle(par3World, par2EntityPlayer);
|
||||
b.setHeadingFromThrower(par2EntityPlayer, par2EntityPlayer.rotationPitch, par2EntityPlayer.rotationYaw, 0F, 1.5F, 1F);
|
||||
par3World.spawnEntityInWorld(b);
|
||||
if(!world.isRemote) {
|
||||
EntityEnderAirBottle b = new EntityEnderAirBottle(world, player);
|
||||
b.setHeadingFromThrower(player, player.rotationPitch, player.rotationYaw, 0F, 1.5F, 1F);
|
||||
world.spawnEntityInWorld(b);
|
||||
}
|
||||
else par2EntityPlayer.swingArm(hand);
|
||||
else player.swingArm(hand);
|
||||
return ActionResult.newResult(EnumActionResult.SUCCESS, par1ItemStack);
|
||||
}
|
||||
|
||||
@@ -123,10 +123,10 @@ public class ItemManaResource extends ItemMod implements IFlowerComponent, IElve
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(@Nonnull Item par1, CreativeTabs par2CreativeTabs, List<ItemStack> par3List) {
|
||||
public void getSubItems(@Nonnull Item item, CreativeTabs tab, List<ItemStack> stacks) {
|
||||
for(int i = 0; i < types; i++)
|
||||
if(Botania.gardenOfGlassLoaded || i != 20 && i != 21)
|
||||
par3List.add(new ItemStack(par1, 1, i));
|
||||
stacks.add(new ItemStack(item, 1, i));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -34,9 +34,9 @@ public class ItemRune extends ItemMod implements IFlowerComponent, IPickupAchiev
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubItems(@Nonnull Item par1, CreativeTabs par2CreativeTabs, List<ItemStack> par3List) {
|
||||
public void getSubItems(@Nonnull Item item, CreativeTabs tab, List<ItemStack> stacks) {
|
||||
for(int i = 0; i < 16; i++)
|
||||
par3List.add(new ItemStack(par1, 1, i));
|
||||
stacks.add(new ItemStack(item, 1, i));
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
|
||||
@@ -79,8 +79,8 @@ public class ItemFlugelEye extends ItemRelic implements ICoordBoundItem, IManaUs
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ActionResult<ItemStack> onItemRightClick(@Nonnull ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer, EnumHand hand) {
|
||||
par3EntityPlayer.setActiveHand(hand);
|
||||
public ActionResult<ItemStack> onItemRightClick(@Nonnull ItemStack par1ItemStack, World world, EntityPlayer player, EnumHand hand) {
|
||||
player.setActiveHand(hand);
|
||||
return ActionResult.newResult(EnumActionResult.SUCCESS, par1ItemStack);
|
||||
}
|
||||
|
||||
|
||||
@@ -43,8 +43,8 @@ public class ItemKingKey extends ItemRelic implements IManaUsingItem {
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ActionResult<ItemStack> onItemRightClick(@Nonnull ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer, EnumHand hand) {
|
||||
par3EntityPlayer.setActiveHand(hand);
|
||||
public ActionResult<ItemStack> onItemRightClick(@Nonnull ItemStack par1ItemStack, World world, EntityPlayer player, EnumHand hand) {
|
||||
player.setActiveHand(hand);
|
||||
setCharging(par1ItemStack, true);
|
||||
return ActionResult.newResult(EnumActionResult.SUCCESS, par1ItemStack);
|
||||
}
|
||||
|
||||
@@ -60,9 +60,9 @@ public abstract class ItemRelicBauble extends ItemBauble implements IRelic {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void addHiddenTooltip(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List<String> par3List, boolean par4) {
|
||||
super.addHiddenTooltip(par1ItemStack, par2EntityPlayer, par3List, par4);
|
||||
dummy.addBindInfo(par3List, par1ItemStack, par2EntityPlayer);
|
||||
public void addHiddenTooltip(ItemStack par1ItemStack, EntityPlayer player, List<String> stacks, boolean par4) {
|
||||
super.addHiddenTooltip(par1ItemStack, player, stacks, par4);
|
||||
dummy.addBindInfo(stacks, par1ItemStack, player);
|
||||
}
|
||||
|
||||
public void onValidPlayerWornTick(ItemStack stack, EntityPlayer player) {
|
||||
|
||||
@@ -38,8 +38,8 @@ public class ItemCobbleRod extends ItemMod implements IManaUsingItem, IBlockProv
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public EnumActionResult onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, BlockPos pos, EnumHand hand, EnumFacing side, float par8, float par9, float par10) {
|
||||
return ItemDirtRod.place(par1ItemStack, par2EntityPlayer, par3World, pos, hand, side, par8, par9, par10, Blocks.COBBLESTONE, COST, 0.3F, 0.3F, 0.3F);
|
||||
public EnumActionResult onItemUse(ItemStack par1ItemStack, EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing side, float par8, float par9, float par10) {
|
||||
return ItemDirtRod.place(par1ItemStack, player, world, pos, hand, side, par8, par9, par10, Blocks.COBBLESTONE, COST, 0.3F, 0.3F, 0.3F);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -49,22 +49,22 @@ public class ItemDirtRod extends ItemMod implements IManaUsingItem, ICraftAchiev
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public EnumActionResult onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, BlockPos pos, EnumHand hand, EnumFacing side, float par8, float par9, float par10) {
|
||||
return place(par1ItemStack, par2EntityPlayer, par3World, pos, hand, side, par8, par9, par10, Blocks.DIRT, COST, 0.35F, 0.2F, 0.05F);
|
||||
public EnumActionResult onItemUse(ItemStack par1ItemStack, EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing side, float par8, float par9, float par10) {
|
||||
return place(par1ItemStack, player, world, pos, hand, side, par8, par9, par10, Blocks.DIRT, COST, 0.35F, 0.2F, 0.05F);
|
||||
}
|
||||
|
||||
public static EnumActionResult place(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, BlockPos pos, EnumHand hand, EnumFacing side, float par8, float par9, float par10, Block block, int cost, float r, float g, float b) {
|
||||
if(ManaItemHandler.requestManaExactForTool(par1ItemStack, par2EntityPlayer, cost, false)) {
|
||||
int entities = par3World.getEntitiesWithinAABB(EntityLivingBase.class, new AxisAlignedBB(pos.offset(side), pos.offset(side).add(1, 1, 1))).size();
|
||||
public static EnumActionResult place(ItemStack par1ItemStack, EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing side, float par8, float par9, float par10, Block block, int cost, float r, float g, float b) {
|
||||
if(ManaItemHandler.requestManaExactForTool(par1ItemStack, player, cost, false)) {
|
||||
int entities = world.getEntitiesWithinAABB(EntityLivingBase.class, new AxisAlignedBB(pos.offset(side), pos.offset(side).add(1, 1, 1))).size();
|
||||
|
||||
if(entities == 0) {
|
||||
ItemStack stackToPlace = new ItemStack(block);
|
||||
stackToPlace.onItemUse(par2EntityPlayer, par3World, pos, hand, side, par8, par9, par10);
|
||||
stackToPlace.onItemUse(player, world, pos, hand, side, par8, par9, par10);
|
||||
|
||||
if(stackToPlace.stackSize == 0) {
|
||||
ManaItemHandler.requestManaExactForTool(par1ItemStack, par2EntityPlayer, cost, true);
|
||||
ManaItemHandler.requestManaExactForTool(par1ItemStack, player, cost, true);
|
||||
for(int i = 0; i < 6; i++)
|
||||
Botania.proxy.sparkleFX(par3World, pos.getX() + side.getFrontOffsetX() + Math.random(), pos.getY() + side.getFrontOffsetY() + Math.random(), pos.getZ() + side.getFrontOffsetZ() + Math.random(), r, g, b, 1F, 5);
|
||||
Botania.proxy.sparkleFX(world, pos.getX() + side.getFrontOffsetX() + Math.random(), pos.getY() + side.getFrontOffsetY() + Math.random(), pos.getZ() + side.getFrontOffsetZ() + Math.random(), r, g, b, 1F, 5);
|
||||
return EnumActionResult.SUCCESS;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,34 +74,34 @@ public class ItemExchangeRod extends ItemMod implements IManaUsingItem, IWirefra
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public EnumActionResult onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, BlockPos pos, EnumHand hand, EnumFacing side, float par8, float par9, float par10) {
|
||||
IBlockState wstate = par3World.getBlockState(pos);
|
||||
public EnumActionResult onItemUse(ItemStack par1ItemStack, EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing side, float par8, float par9, float par10) {
|
||||
IBlockState wstate = world.getBlockState(pos);
|
||||
|
||||
if(par2EntityPlayer.isSneaking()) {
|
||||
TileEntity tile = par3World.getTileEntity(pos);
|
||||
if(player.isSneaking()) {
|
||||
TileEntity tile = world.getTileEntity(pos);
|
||||
if(tile == null) {
|
||||
if(BlockCamo.isValidBlock(wstate)) {
|
||||
Item item = Item.getItemFromBlock(wstate.getBlock());
|
||||
|
||||
boolean set = setBlock(par1ItemStack, wstate.getBlock(), !item.getHasSubtypes() ? 0 : wstate.getBlock().getMetaFromState(wstate));
|
||||
par2EntityPlayer.setItemStackToSlot(hand == EnumHand.MAIN_HAND ? EntityEquipmentSlot.MAINHAND : EntityEquipmentSlot.OFFHAND, par1ItemStack);
|
||||
player.setItemStackToSlot(hand == EnumHand.MAIN_HAND ? EntityEquipmentSlot.MAINHAND : EntityEquipmentSlot.OFFHAND, par1ItemStack);
|
||||
|
||||
displayRemainderCounter(par2EntityPlayer, par1ItemStack);
|
||||
displayRemainderCounter(player, par1ItemStack);
|
||||
return EnumActionResult.SUCCESS;
|
||||
}
|
||||
}
|
||||
} else if(canExchange(par1ItemStack) && !ItemNBTHelper.getBoolean(par1ItemStack, TAG_SWAPPING, false)) {
|
||||
Block block = getBlock(par1ItemStack);
|
||||
int meta = getBlockMeta(par1ItemStack);
|
||||
List<BlockPos> swap = getBlocksToSwap(par3World, par1ItemStack, block.getStateFromMeta(meta), pos, null);
|
||||
List<BlockPos> swap = getBlocksToSwap(world, par1ItemStack, block.getStateFromMeta(meta), pos, null);
|
||||
if(swap.size() > 0) {
|
||||
ItemNBTHelper.setBoolean(par1ItemStack, TAG_SWAPPING, true);
|
||||
ItemNBTHelper.setInt(par1ItemStack, TAG_SELECT_X, pos.getX());
|
||||
ItemNBTHelper.setInt(par1ItemStack, TAG_SELECT_Y, pos.getY());
|
||||
ItemNBTHelper.setInt(par1ItemStack, TAG_SELECT_Z, pos.getZ());
|
||||
setTargetBlock(par1ItemStack, wstate.getBlock(), wstate.getBlock().getMetaFromState(wstate));
|
||||
if(par3World.isRemote)
|
||||
par2EntityPlayer.swingArm(hand);
|
||||
if(world.isRemote)
|
||||
player.swingArm(hand);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -48,8 +48,8 @@ public class ItemFireRod extends ItemMod implements IManaUsingItem, IAvatarWield
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public EnumActionResult onItemUse(ItemStack par1ItemStack, EntityPlayer player, World par3World, BlockPos pos, EnumHand hand, EnumFacing side, float par8, float par9, float par10) {
|
||||
if(!par3World.isRemote && ManaItemHandler.requestManaExactForTool(par1ItemStack, player, COST, false)) {
|
||||
public EnumActionResult onItemUse(ItemStack par1ItemStack, EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing side, float par8, float par9, float par10) {
|
||||
if(!world.isRemote && ManaItemHandler.requestManaExactForTool(par1ItemStack, player, COST, false)) {
|
||||
EntityFlameRing entity = new EntityFlameRing(player.worldObj);
|
||||
entity.setPosition(pos.getX() + 0.5, pos.getY() + 1, pos.getZ() + 0.5);
|
||||
player.worldObj.spawnEntityInWorld(entity);
|
||||
@@ -57,14 +57,14 @@ public class ItemFireRod extends ItemMod implements IManaUsingItem, IAvatarWield
|
||||
player.getCooldownTracker().setCooldown(this, IManaProficiencyArmor.Helper.hasProficiency(player) ? COOLDOWN / 2 : COOLDOWN);
|
||||
|
||||
ManaItemHandler.requestManaExactForTool(par1ItemStack, player, COST, true);
|
||||
par3World.playSound(null, player.posX, player.posY, player.posZ, SoundEvents.ENTITY_BLAZE_AMBIENT, SoundCategory.PLAYERS, 1F, 1F);
|
||||
world.playSound(null, player.posX, player.posY, player.posZ, SoundEvents.ENTITY_BLAZE_AMBIENT, SoundCategory.PLAYERS, 1F, 1F);
|
||||
}
|
||||
|
||||
return EnumActionResult.SUCCESS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5) {
|
||||
public void onUpdate(ItemStack par1ItemStack, World world, Entity par3Entity, int par4, boolean par5) {
|
||||
// Keep for backward compat
|
||||
if(par1ItemStack.getItemDamage() > 0)
|
||||
par1ItemStack.setItemDamage(0);
|
||||
|
||||
@@ -90,8 +90,8 @@ public class ItemMissileRod extends ItemMod implements IManaUsingItem, IAvatarWi
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ActionResult<ItemStack> onItemRightClick(@Nonnull ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer, EnumHand hand) {
|
||||
par3EntityPlayer.setActiveHand(hand);
|
||||
public ActionResult<ItemStack> onItemRightClick(@Nonnull ItemStack par1ItemStack, World world, EntityPlayer player, EnumHand hand) {
|
||||
player.setActiveHand(hand);
|
||||
return ActionResult.newResult(EnumActionResult.SUCCESS, par1ItemStack);
|
||||
}
|
||||
|
||||
|
||||
@@ -58,38 +58,38 @@ public class ItemRainbowRod extends ItemMod implements IManaUsingItem, IAvatarWi
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ActionResult<ItemStack> onItemRightClick(@Nonnull ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer, EnumHand hand) {
|
||||
if(!par2World.isRemote && ManaItemHandler.requestManaExactForTool(par1ItemStack, par3EntityPlayer, MANA_COST, false)) {
|
||||
public ActionResult<ItemStack> onItemRightClick(@Nonnull ItemStack par1ItemStack, World world, EntityPlayer player, EnumHand hand) {
|
||||
if(!world.isRemote && ManaItemHandler.requestManaExactForTool(par1ItemStack, player, MANA_COST, false)) {
|
||||
Block place = ModBlocks.bifrost;
|
||||
Vector3 vector = new Vector3(par3EntityPlayer.getLookVec()).normalize();
|
||||
Vector3 vector = new Vector3(player.getLookVec()).normalize();
|
||||
|
||||
double x = par3EntityPlayer.posX;
|
||||
double y = par3EntityPlayer.posY;
|
||||
double z = par3EntityPlayer.posZ;
|
||||
double x = player.posX;
|
||||
double y = player.posY;
|
||||
double z = player.posZ;
|
||||
|
||||
double lx = 0;
|
||||
double ly = -1;
|
||||
double lz = 0;
|
||||
|
||||
int count = 0;
|
||||
boolean prof = IManaProficiencyArmor.Helper.hasProficiency(par3EntityPlayer);
|
||||
boolean prof = IManaProficiencyArmor.Helper.hasProficiency(player);
|
||||
int maxlen = prof ? 160 : 100;
|
||||
int time = prof ? (int) (TIME * 1.6) : TIME;
|
||||
|
||||
BlockPos playerPos = new BlockPos((int) x, (int) y, (int) z);
|
||||
while(count < maxlen && (int) lx == (int) x && (int) ly == (int) y && (int) lz == (int) z || count < 4 || par2World.getBlockState(playerPos).getBlock().isAir(par2World.getBlockState(playerPos), par2World, playerPos) || par2World.getBlockState(playerPos).getBlock() == place) {
|
||||
while(count < maxlen && (int) lx == (int) x && (int) ly == (int) y && (int) lz == (int) z || count < 4 || world.getBlockState(playerPos).getBlock().isAir(world.getBlockState(playerPos), world, playerPos) || world.getBlockState(playerPos).getBlock() == place) {
|
||||
if(y >= 256 || y <= 0)
|
||||
break;
|
||||
|
||||
for(int i = -2; i < 1; i++)
|
||||
for(int j = -2; j < 1; j++) {
|
||||
BlockPos pos_ = new BlockPos((int) x + i, (int) y, (int) z + j);
|
||||
if(par2World.getBlockState(pos_).getBlock().isAir(par2World.getBlockState(pos_), par2World, pos_) || par2World.getBlockState(pos_).getBlock() == place) {
|
||||
par2World.setBlockState(pos_, place.getDefaultState());
|
||||
TileBifrost tile = (TileBifrost) par2World.getTileEntity(pos_);
|
||||
if(world.getBlockState(pos_).getBlock().isAir(world.getBlockState(pos_), world, pos_) || world.getBlockState(pos_).getBlock() == place) {
|
||||
world.setBlockState(pos_, place.getDefaultState());
|
||||
TileBifrost tile = (TileBifrost) world.getTileEntity(pos_);
|
||||
if(tile != null) {
|
||||
for(int k = 0; k < 4; k++)
|
||||
Botania.proxy.sparkleFX(par2World, tile.getPos().getX() + Math.random(), tile.getPos().getY() + Math.random(), tile.getPos().getZ() + Math.random(), (float) Math.random(), (float) Math.random(), (float) Math.random(), 0.45F + 0.2F * (float) Math.random(), 6);
|
||||
Botania.proxy.sparkleFX(world, tile.getPos().getX() + Math.random(), tile.getPos().getY() + Math.random(), tile.getPos().getZ() + Math.random(), (float) Math.random(), (float) Math.random(), (float) Math.random(), 0.45F + 0.2F * (float) Math.random(), 6);
|
||||
tile.ticks = time;
|
||||
}
|
||||
}
|
||||
@@ -107,9 +107,9 @@ public class ItemRainbowRod extends ItemMod implements IManaUsingItem, IAvatarWi
|
||||
}
|
||||
|
||||
if(count > 0) {
|
||||
par2World.playSound(null, par3EntityPlayer.posX, par3EntityPlayer.posY, par3EntityPlayer.posZ, BotaniaSoundEvents.bifrostRod, SoundCategory.PLAYERS, 0.5F, 0.25F);
|
||||
ManaItemHandler.requestManaExactForTool(par1ItemStack, par3EntityPlayer, MANA_COST, false);
|
||||
par3EntityPlayer.getCooldownTracker().setCooldown(this, TIME);
|
||||
world.playSound(null, player.posX, player.posY, player.posZ, BotaniaSoundEvents.bifrostRod, SoundCategory.PLAYERS, 0.5F, 0.25F);
|
||||
ManaItemHandler.requestManaExactForTool(par1ItemStack, player, MANA_COST, false);
|
||||
player.getCooldownTracker().setCooldown(this, TIME);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -128,7 +128,7 @@ public class ItemRainbowRod extends ItemMod implements IManaUsingItem, IAvatarWi
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5) {
|
||||
public void onUpdate(ItemStack par1ItemStack, World world, Entity par3Entity, int par4, boolean par5) {
|
||||
// Kept for backward compat
|
||||
if (par1ItemStack.getItemDamage() > 0)
|
||||
par1ItemStack.setItemDamage(0);
|
||||
|
||||
@@ -63,8 +63,8 @@ public class ItemSmeltRod extends ItemMod implements IManaUsingItem {
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ActionResult<ItemStack> onItemRightClick(@Nonnull ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer, EnumHand hand) {
|
||||
par3EntityPlayer.setActiveHand(hand);
|
||||
public ActionResult<ItemStack> onItemRightClick(@Nonnull ItemStack par1ItemStack, World world, EntityPlayer player, EnumHand hand) {
|
||||
player.setActiveHand(hand);
|
||||
return ActionResult.newResult(EnumActionResult.SUCCESS, par1ItemStack);
|
||||
}
|
||||
|
||||
|
||||
@@ -99,23 +99,23 @@ public class ItemTerraformRod extends ItemMod implements IManaUsingItem, IBlockP
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ActionResult<ItemStack> onItemRightClick(@Nonnull ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer, EnumHand hand) {
|
||||
par3EntityPlayer.setActiveHand(hand);
|
||||
public ActionResult<ItemStack> onItemRightClick(@Nonnull ItemStack par1ItemStack, World world, EntityPlayer player, EnumHand hand) {
|
||||
player.setActiveHand(hand);
|
||||
return ActionResult.newResult(EnumActionResult.SUCCESS, par1ItemStack);
|
||||
}
|
||||
|
||||
private void terraform(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
|
||||
int range = IManaProficiencyArmor.Helper.hasProficiency(par3EntityPlayer) ? 22 : 16;
|
||||
private void terraform(ItemStack par1ItemStack, World world, EntityPlayer player) {
|
||||
int range = IManaProficiencyArmor.Helper.hasProficiency(player) ? 22 : 16;
|
||||
|
||||
BlockPos startCenter = new BlockPos(par3EntityPlayer).down();
|
||||
BlockPos startCenter = new BlockPos(player).down();
|
||||
|
||||
if(startCenter.getY() < par2World.getSeaLevel()) // Not below sea level
|
||||
if(startCenter.getY() < world.getSeaLevel()) // Not below sea level
|
||||
return;
|
||||
|
||||
List<CoordsWithBlock> blocks = new ArrayList<>();
|
||||
|
||||
for(BlockPos pos : BlockPos.getAllInBoxMutable(startCenter.add(-range, -range, -range), startCenter.add(range, range, range))) {
|
||||
IBlockState state = par2World.getBlockState(pos);
|
||||
IBlockState state = world.getBlockState(pos);
|
||||
if(state.getBlock() == Blocks.AIR)
|
||||
continue;
|
||||
else if(Item.getItemFromBlock(state.getBlock()) == null)
|
||||
@@ -127,8 +127,8 @@ public class ItemTerraformRod extends ItemMod implements IManaUsingItem, IBlockP
|
||||
|
||||
for(EnumFacing dir : EnumFacing.HORIZONTALS) {
|
||||
BlockPos pos_ = pos.offset(dir);
|
||||
Block block_ = par2World.getBlockState(pos_).getBlock();
|
||||
if(block_.isAir(par2World.getBlockState(pos_), par2World, pos_) || block_.isReplaceable(par2World, pos_) || block_ instanceof BlockFlower && !(block_ instanceof ISpecialFlower) || block_ == Blocks.DOUBLE_PLANT) {
|
||||
Block block_ = world.getBlockState(pos_).getBlock();
|
||||
if(block_.isAir(world.getBlockState(pos_), world, pos_) || block_.isReplaceable(world, pos_) || block_ instanceof BlockFlower && !(block_ instanceof ISpecialFlower) || block_ == Blocks.DOUBLE_PLANT) {
|
||||
airBlocks.add(pos_);
|
||||
}
|
||||
}
|
||||
@@ -137,7 +137,7 @@ public class ItemTerraformRod extends ItemMod implements IManaUsingItem, IBlockP
|
||||
if(pos.getY() > startCenter.getY())
|
||||
blocks.add(new CoordsWithBlock(pos, Blocks.AIR));
|
||||
else for(BlockPos coords : airBlocks) {
|
||||
if(par2World.getBlockState(coords.down()).getBlock() != Blocks.AIR)
|
||||
if(world.getBlockState(coords.down()).getBlock() != Blocks.AIR)
|
||||
blocks.add(new CoordsWithBlock(coords, Blocks.DIRT));
|
||||
}
|
||||
}
|
||||
@@ -147,16 +147,16 @@ public class ItemTerraformRod extends ItemMod implements IManaUsingItem, IBlockP
|
||||
|
||||
int cost = COST_PER * blocks.size();
|
||||
|
||||
if(par2World.isRemote || ManaItemHandler.requestManaExactForTool(par1ItemStack, par3EntityPlayer, cost, true)) {
|
||||
if(!par2World.isRemote)
|
||||
if(world.isRemote || ManaItemHandler.requestManaExactForTool(par1ItemStack, player, cost, true)) {
|
||||
if(!world.isRemote)
|
||||
for(CoordsWithBlock block : blocks)
|
||||
par2World.setBlockState(block, block.block.getDefaultState());
|
||||
world.setBlockState(block, block.block.getDefaultState());
|
||||
|
||||
if(!blocks.isEmpty()) {
|
||||
for(int i = 0; i < 10; i++)
|
||||
par2World.playSound(par3EntityPlayer, par3EntityPlayer.posX, par3EntityPlayer.posY, par3EntityPlayer.posZ, SoundEvents.BLOCK_SAND_STEP, SoundCategory.BLOCKS, 1F, 0.4F);
|
||||
world.playSound(player, player.posX, player.posY, player.posZ, SoundEvents.BLOCK_SAND_STEP, SoundCategory.BLOCKS, 1F, 0.4F);
|
||||
for(int i = 0; i < 120; i++)
|
||||
Botania.proxy.sparkleFX(par2World, startCenter.getX() - range + range * 2 * Math.random(), startCenter.getY() + 2 + (Math.random() - 0.5) * 2, startCenter.getZ() - range + range * 2 * Math.random(), 0.35F, 0.2F, 0.05F, 2F, 5);
|
||||
Botania.proxy.sparkleFX(world, startCenter.getX() - range + range * 2 * Math.random(), startCenter.getY() + 2 + (Math.random() - 0.5) * 2, startCenter.getZ() - range + range * 2 * Math.random(), 0.35F, 0.2F, 0.05F, 2F, 5);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ public class ItemTornadoRod extends ItemMod implements IManaUsingItem, IAvatarWi
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean holding) {
|
||||
public void onUpdate(ItemStack par1ItemStack, World world, Entity par3Entity, int par4, boolean holding) {
|
||||
if(par3Entity instanceof EntityPlayer) {
|
||||
EntityPlayer player = (EntityPlayer) par3Entity;
|
||||
boolean damaged = par1ItemStack.getItemDamage() > 0;
|
||||
@@ -99,12 +99,12 @@ public class ItemTornadoRod extends ItemMod implements IManaUsingItem, IAvatarWi
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ActionResult<ItemStack> onItemRightClick(@Nonnull ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer, EnumHand hand) {
|
||||
public ActionResult<ItemStack> onItemRightClick(@Nonnull ItemStack par1ItemStack, World world, EntityPlayer player, EnumHand hand) {
|
||||
int meta = par1ItemStack.getItemDamage();
|
||||
if(meta != 0 || ManaItemHandler.requestManaExactForTool(par1ItemStack, par3EntityPlayer, COST, false)) {
|
||||
par3EntityPlayer.setActiveHand(hand);
|
||||
if(meta != 0 || ManaItemHandler.requestManaExactForTool(par1ItemStack, player, COST, false)) {
|
||||
player.setActiveHand(hand);
|
||||
if(meta == 0) {
|
||||
ManaItemHandler.requestManaExactForTool(par1ItemStack, par3EntityPlayer, COST, true);
|
||||
ManaItemHandler.requestManaExactForTool(par1ItemStack, player, COST, true);
|
||||
setFlying(par1ItemStack, true);
|
||||
}
|
||||
return ActionResult.newResult(EnumActionResult.SUCCESS, par1ItemStack);
|
||||
|
||||
@@ -29,21 +29,21 @@ public class ItemWaterRod extends ItemMod implements IManaUsingItem {
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public EnumActionResult onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, BlockPos pos, EnumHand hand, EnumFacing side, float par8, float par9, float par10) {
|
||||
if(ManaItemHandler.requestManaExactForTool(par1ItemStack, par2EntityPlayer, COST, false) && !par3World.provider.doesWaterVaporize()) {
|
||||
public EnumActionResult onItemUse(ItemStack par1ItemStack, EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing side, float par8, float par9, float par10) {
|
||||
if(ManaItemHandler.requestManaExactForTool(par1ItemStack, player, COST, false) && !world.provider.doesWaterVaporize()) {
|
||||
// Adapted from bucket code
|
||||
RayTraceResult mop = rayTrace(par3World, par2EntityPlayer, false);
|
||||
RayTraceResult mop = rayTrace(world, player, false);
|
||||
|
||||
if (mop != null && mop.typeOfHit == RayTraceResult.Type.BLOCK) {
|
||||
BlockPos hitPos = mop.getBlockPos();
|
||||
if(!par3World.isBlockModifiable(par2EntityPlayer, hitPos))
|
||||
if(!world.isBlockModifiable(player, hitPos))
|
||||
return EnumActionResult.FAIL;
|
||||
BlockPos placePos = hitPos.offset(mop.sideHit);
|
||||
if(par2EntityPlayer.canPlayerEdit(placePos, mop.sideHit, par1ItemStack)) {
|
||||
if (ManaItemHandler.requestManaExactForTool(par1ItemStack, par2EntityPlayer, COST, true)
|
||||
&& ((ItemBucket) Items.WATER_BUCKET).tryPlaceContainedLiquid(par2EntityPlayer, par3World, placePos)) {
|
||||
if(player.canPlayerEdit(placePos, mop.sideHit, par1ItemStack)) {
|
||||
if (ManaItemHandler.requestManaExactForTool(par1ItemStack, player, COST, true)
|
||||
&& ((ItemBucket) Items.WATER_BUCKET).tryPlaceContainedLiquid(player, world, placePos)) {
|
||||
for(int i = 0; i < 6; i++)
|
||||
Botania.proxy.sparkleFX(par3World, pos.getX() + side.getFrontOffsetX() + Math.random(), pos.getY() + side.getFrontOffsetY() + Math.random(), pos.getZ() + side.getFrontOffsetZ() + Math.random(), 0.2F, 0.2F, 1F, 1F, 5);
|
||||
Botania.proxy.sparkleFX(world, pos.getX() + side.getFrontOffsetX() + Math.random(), pos.getY() + side.getFrontOffsetY() + Math.random(), pos.getZ() + side.getFrontOffsetZ() + Math.random(), 0.2F, 0.2F, 1F, 1F, 5);
|
||||
return EnumActionResult.SUCCESS;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user