Get rid of all 1.7-era 'parN' style parameter names

This commit is contained in:
Vincent Lee committed 2020-01-31 13:08:16 -06:00
1 parent ef79dc7507
commit ca8f61b8b1
50 files changed
+202 -244

No files matched your search

@@ -1,42 +0,0 @@
/**
* This class was created by <Vazkii>. It's distributed as
* part of the Botania Mod. Get the Source Code in github:
* https://github.com/Vazkii/Botania
*
* Botania is Open Source and distributed under the
* Botania License: http://botaniamod.net/license.php
*
* File Created @ [Jan 16, 2014, 5:30:52 PM (GMT)]
*/
package vazkii.botania.client.core.helper;
public final class FontHelper {
private static boolean isFormatColor(char par0) {
return par0 >= '0' && par0 <= '9' || par0 >= 'a' && par0 <= 'f' || par0 >= 'A' && par0 <= 'F';
}
private static boolean isFormatSpecial(char par0) {
return par0 >= 'k' && par0 <= 'o' || par0 >= 'K' && par0 <= 'O' || par0 == 'r' || par0 == 'R';
}
public static String getFormatFromString(String par0Str) {
String s1 = "";
int i = -1;
int j = par0Str.length();
while ((i = par0Str.indexOf('w', i + 1)) != -1) {
if (i < j - 1) {
char c0 = par0Str.charAt(i + 1);
if (isFormatColor(c0))
s1 = "\u00a7" + c0;
else if (isFormatSpecial(c0))
s1 = s1 + "\u00a7" + c0;
}
}
return s1;
}
}
@@ -165,17 +165,17 @@ public final class RenderHelper {
ENTITY_TRANSLUCENT_GOLD = new ShaderWrappedRenderLayer(ShaderHelper.BotaniaShader.GOLD, null, RenderType.of(LibResources.PREFIX_MOD + "astrolabe_preview", DefaultVertexFormats.POSITION_COLOR_TEXTURE_OVERLAY_LIGHT_NORMAL, 7, 128, true, true, glState));
}
public static void drawTexturedModalRect(int par1, int par2, float z, int par3, int par4, int par5, int par6) {
drawTexturedModalRect(par1, par2, z, par3, par4, par5, par6, 0.00390625F, 0.00390625F);
public static void drawTexturedModalRect(int x, int y, float z, int u, int v, int width, int height) {
drawTexturedModalRect(x, y, z, u, v, width, height, 0.00390625F, 0.00390625F);
}
public static void drawTexturedModalRect(int par1, int par2, float z, int par3, int par4, int par5, int par6, float f, float f1) {
public static void drawTexturedModalRect(int x, int y, float z, int u, int v, int width, int height, float f, float f1) {
Tessellator tessellator = Tessellator.getInstance();
tessellator.getBuffer().begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX);
tessellator.getBuffer().vertex(par1, par2 + par6, z).texture(par3 * f, (par4 + par6) * f1).endVertex();
tessellator.getBuffer().vertex(par1 + par5, par2 + par6, z).texture((par3 + par5) * f, (par4 + par6) * f1).endVertex();
tessellator.getBuffer().vertex(par1 + par5, par2, z).texture((par3 + par5) * f, par4 * f1).endVertex();
tessellator.getBuffer().vertex(par1, par2, z).texture(par3 * f, par4 * f1).endVertex();
tessellator.getBuffer().vertex(x, y + height, z).texture(u * f, (v + height) * f1).endVertex();
tessellator.getBuffer().vertex(x + width, y + height, z).texture((u + width) * f, (v + height) * f1).endVertex();
tessellator.getBuffer().vertex(x + width, y, z).texture((u + width) * f, v * f1).endVertex();
tessellator.getBuffer().vertex(x, y, z).texture(u * f, v * f1).endVertex();
tessellator.draw();
}
@@ -112,10 +112,10 @@ public class BlockSpecialFlower extends FlowerBlock implements IWandable, IWandH
}
@Override
public boolean eventReceived(BlockState state, World world, BlockPos pos, int par5, int par6) {
super.eventReceived(state, world, pos, par5, par6);
public boolean eventReceived(BlockState state, World world, BlockPos pos, int event, int param) {
super.eventReceived(state, world, pos, event, param);
TileEntity tileentity = world.getTileEntity(pos);
return tileentity != null && tileentity.receiveClientEvent(par5, par6);
return tileentity != null && tileentity.receiveClientEvent(event, param);
}
@Override
@@ -88,7 +88,7 @@ public class BlockTinyPotato extends BlockMod {
}
@Override
public void onBlockPlacedBy(World world, BlockPos pos, BlockState state, LivingEntity par5EntityLiving, ItemStack stack) {
public void onBlockPlacedBy(World world, BlockPos pos, BlockState state, LivingEntity entity, ItemStack stack) {
if (stack.hasDisplayName())
((TileTinyPotato) world.getTileEntity(pos)).name = stack.getDisplayName();
}
@@ -47,7 +47,7 @@ public class BlockManaDetector extends BlockMod implements IManaCollisionGhost {
}
@Override
public int getWeakPower(BlockState state, IBlockReader par1iBlockAccess, BlockPos pos, Direction side) {
public int getWeakPower(BlockState state, IBlockReader world, BlockPos pos, Direction side) {
return state.get(BotaniaStateProps.POWERED) ? 15 : 0;
}
@@ -66,19 +66,19 @@ public class TileAvatar extends TileSimpleInventory implements IAvatarTile, ITic
}
@Override
public void writePacketNBT(CompoundNBT par1nbtTagCompound) {
super.writePacketNBT(par1nbtTagCompound);
par1nbtTagCompound.putBoolean(TAG_ENABLED, enabled);
par1nbtTagCompound.putInt(TAG_TICKS_ELAPSED, ticksElapsed);
par1nbtTagCompound.putInt(TAG_MANA, mana);
public void writePacketNBT(CompoundNBT tag) {
super.writePacketNBT(tag);
tag.putBoolean(TAG_ENABLED, enabled);
tag.putInt(TAG_TICKS_ELAPSED, ticksElapsed);
tag.putInt(TAG_MANA, mana);
}
@Override
public void readPacketNBT(CompoundNBT par1nbtTagCompound) {
super.readPacketNBT(par1nbtTagCompound);
enabled = par1nbtTagCompound.getBoolean(TAG_ENABLED);
ticksElapsed = par1nbtTagCompound.getInt(TAG_TICKS_ELAPSED);
mana = par1nbtTagCompound.getInt(TAG_MANA);
public void readPacketNBT(CompoundNBT tag) {
super.readPacketNBT(tag);
enabled = tag.getBoolean(TAG_ENABLED);
ticksElapsed = tag.getInt(TAG_TICKS_ELAPSED);
mana = tag.getInt(TAG_MANA);
}
@Override
@@ -42,16 +42,16 @@ public class TileBifrost extends TileMod implements ITickableTileEntity {
@Nonnull
@Override
public CompoundNBT write(CompoundNBT par1nbtTagCompound) {
CompoundNBT ret = super.write(par1nbtTagCompound);
public CompoundNBT write(CompoundNBT tag) {
CompoundNBT ret = super.write(tag);
ret.putInt(TAG_TICKS, ticks);
return ret;
}
@Override
public void read(CompoundNBT par1nbtTagCompound) {
super.read(par1nbtTagCompound);
ticks = par1nbtTagCompound.getInt(TAG_TICKS);
public void read(CompoundNBT tag) {
super.read(tag);
ticks = tag.getInt(TAG_TICKS);
}
}
@@ -197,17 +197,17 @@ public class TileBrewery extends TileSimpleInventory implements IManaReceiver, I
}
@Override
public void writePacketNBT(CompoundNBT par1nbtTagCompound) {
super.writePacketNBT(par1nbtTagCompound);
public void writePacketNBT(CompoundNBT tag) {
super.writePacketNBT(tag);
par1nbtTagCompound.putInt(TAG_MANA, mana);
tag.putInt(TAG_MANA, mana);
}
@Override
public void readPacketNBT(CompoundNBT par1nbtTagCompound) {
super.readPacketNBT(par1nbtTagCompound);
public void readPacketNBT(CompoundNBT tag) {
super.readPacketNBT(tag);
mana = par1nbtTagCompound.getInt(TAG_MANA);
mana = tag.getInt(TAG_MANA);
}
@Override
@@ -46,8 +46,8 @@ public class TileFakeAir extends TileMod {
@Nonnull
@Override
public CompoundNBT write(CompoundNBT par1nbtTagCompound) {
CompoundNBT ret = super.write(par1nbtTagCompound);
public CompoundNBT write(CompoundNBT tag) {
CompoundNBT ret = super.write(tag);
ret.putInt(TAG_FLOWER_X, flowerPos.getX());
ret.putInt(TAG_FLOWER_Y, flowerPos.getY());
ret.putInt(TAG_FLOWER_Z, flowerPos.getZ());
@@ -55,12 +55,12 @@ public class TileFakeAir extends TileMod {
}
@Override
public void read(CompoundNBT par1nbtTagCompound) {
super.read(par1nbtTagCompound);
public void read(CompoundNBT tag) {
super.read(tag);
flowerPos = new BlockPos(
par1nbtTagCompound.getInt(TAG_FLOWER_X),
par1nbtTagCompound.getInt(TAG_FLOWER_Y),
par1nbtTagCompound.getInt(TAG_FLOWER_Z)
tag.getInt(TAG_FLOWER_X),
tag.getInt(TAG_FLOWER_Y),
tag.getInt(TAG_FLOWER_Z)
);
}
@@ -174,25 +174,25 @@ public class TileHourglass extends TileSimpleInventory implements ITickableTileE
}
@Override
public void writePacketNBT(CompoundNBT par1nbtTagCompound) {
super.writePacketNBT(par1nbtTagCompound);
par1nbtTagCompound.putInt(TAG_TIME, time);
par1nbtTagCompound.putFloat(TAG_TIME_FRACTION, timeFraction);
par1nbtTagCompound.putBoolean(TAG_FLIP, flip);
par1nbtTagCompound.putInt(TAG_FLIP_TICKS, flipTicks);
par1nbtTagCompound.putBoolean(TAG_MOVE, move);
par1nbtTagCompound.putBoolean(TAG_LOCK, lock);
public void writePacketNBT(CompoundNBT tag) {
super.writePacketNBT(tag);
tag.putInt(TAG_TIME, time);
tag.putFloat(TAG_TIME_FRACTION, timeFraction);
tag.putBoolean(TAG_FLIP, flip);
tag.putInt(TAG_FLIP_TICKS, flipTicks);
tag.putBoolean(TAG_MOVE, move);
tag.putBoolean(TAG_LOCK, lock);
}
@Override
public void readPacketNBT(CompoundNBT par1nbtTagCompound) {
super.readPacketNBT(par1nbtTagCompound);
time = par1nbtTagCompound.getInt(TAG_TIME);
timeFraction = par1nbtTagCompound.getFloat(TAG_TIME_FRACTION);
flip = par1nbtTagCompound.getBoolean(TAG_FLIP);
flipTicks = par1nbtTagCompound.getInt(TAG_FLIP_TICKS);
move = par1nbtTagCompound.getBoolean(TAG_MOVE);
lock = par1nbtTagCompound.getBoolean(TAG_LOCK);
public void readPacketNBT(CompoundNBT tag) {
super.readPacketNBT(tag);
time = tag.getInt(TAG_TIME);
timeFraction = tag.getFloat(TAG_TIME_FRACTION);
flip = tag.getBoolean(TAG_FLIP);
flipTicks = tag.getInt(TAG_FLIP_TICKS);
move = tag.getBoolean(TAG_MOVE);
lock = tag.getBoolean(TAG_LOCK);
}
@Override
@@ -119,17 +119,17 @@ public class TileIncensePlate extends TileSimpleInventory implements ITickableTi
}
@Override
public void writePacketNBT(CompoundNBT par1nbtTagCompound) {
super.writePacketNBT(par1nbtTagCompound);
par1nbtTagCompound.putInt(TAG_TIME_LEFT, timeLeft);
par1nbtTagCompound.putBoolean(TAG_BURNING, burning);
public void writePacketNBT(CompoundNBT tag) {
super.writePacketNBT(tag);
tag.putInt(TAG_TIME_LEFT, timeLeft);
tag.putBoolean(TAG_BURNING, burning);
}
@Override
public void readPacketNBT(CompoundNBT par1nbtTagCompound) {
super.readPacketNBT(par1nbtTagCompound);
timeLeft = par1nbtTagCompound.getInt(TAG_TIME_LEFT);
burning = par1nbtTagCompound.getBoolean(TAG_BURNING);
public void readPacketNBT(CompoundNBT tag) {
super.readPacketNBT(tag);
timeLeft = tag.getInt(TAG_TIME_LEFT);
burning = tag.getBoolean(TAG_BURNING);
}
public boolean acceptsItem(ItemStack stack) {
@@ -25,8 +25,8 @@ public class TileMod extends TileEntity {
@Nonnull
@Override
public CompoundNBT write(CompoundNBT par1nbtTagCompound) {
CompoundNBT ret = super.write(par1nbtTagCompound);
public CompoundNBT write(CompoundNBT tag) {
CompoundNBT ret = super.write(tag);
writePacketNBT(ret);
return ret;
}
@@ -38,9 +38,9 @@ public class TileMod extends TileEntity {
}
@Override
public void read(CompoundNBT par1nbtTagCompound) {
super.read(par1nbtTagCompound);
readPacketNBT(par1nbtTagCompound);
public void read(CompoundNBT tag) {
super.read(tag);
readPacketNBT(tag);
}
public void writePacketNBT(CompoundNBT cmp) {}
@@ -295,19 +295,19 @@ public class TileRuneAltar extends TileSimpleInventory implements IManaReceiver,
}
@Override
public void writePacketNBT(CompoundNBT par1nbtTagCompound) {
super.writePacketNBT(par1nbtTagCompound);
public void writePacketNBT(CompoundNBT tag) {
super.writePacketNBT(tag);
par1nbtTagCompound.putInt(TAG_MANA, mana);
par1nbtTagCompound.putInt(TAG_MANA_TO_GET, manaToGet);
tag.putInt(TAG_MANA, mana);
tag.putInt(TAG_MANA_TO_GET, manaToGet);
}
@Override
public void readPacketNBT(CompoundNBT par1nbtTagCompound) {
super.readPacketNBT(par1nbtTagCompound);
public void readPacketNBT(CompoundNBT tag) {
super.readPacketNBT(tag);
mana = par1nbtTagCompound.getInt(TAG_MANA);
manaToGet = par1nbtTagCompound.getInt(TAG_MANA_TO_GET);
mana = tag.getInt(TAG_MANA);
manaToGet = tag.getInt(TAG_MANA_TO_GET);
}
@Override
@@ -33,14 +33,14 @@ public abstract class TileSimpleInventory extends TileMod {
}
@Override
public void readPacketNBT(CompoundNBT par1NBTTagCompound) {
public void readPacketNBT(CompoundNBT tag) {
itemHandler = createItemHandler();
itemHandler.deserializeNBT(par1NBTTagCompound);
itemHandler.deserializeNBT(tag);
}
@Override
public void writePacketNBT(CompoundNBT par1NBTTagCompound) {
par1NBTTagCompound.merge(itemHandler.serializeNBT());
public void writePacketNBT(CompoundNBT tag) {
tag.merge(itemHandler.serializeNBT());
}
public abstract int getSizeInventory();
@@ -108,23 +108,23 @@ public class TileCorporeaCrystalCube extends TileCorporeaBase implements ICorpor
}
@Override
public void writePacketNBT(CompoundNBT par1nbtTagCompound) {
super.writePacketNBT(par1nbtTagCompound);
public void writePacketNBT(CompoundNBT tag) {
super.writePacketNBT(tag);
CompoundNBT cmp = new CompoundNBT();
if(!requestTarget.isEmpty())
cmp = requestTarget.write(cmp);
par1nbtTagCompound.put(TAG_REQUEST_TARGET, cmp);
par1nbtTagCompound.putInt(TAG_ITEM_COUNT, itemCount);
par1nbtTagCompound.putBoolean(TAG_LOCK, locked);
tag.put(TAG_REQUEST_TARGET, cmp);
tag.putInt(TAG_ITEM_COUNT, itemCount);
tag.putBoolean(TAG_LOCK, locked);
}
@Override
public void readPacketNBT(CompoundNBT par1nbtTagCompound) {
super.readPacketNBT(par1nbtTagCompound);
CompoundNBT cmp = par1nbtTagCompound.getCompound(TAG_REQUEST_TARGET);
public void readPacketNBT(CompoundNBT tag) {
super.readPacketNBT(tag);
CompoundNBT cmp = tag.getCompound(TAG_REQUEST_TARGET);
requestTarget = ItemStack.read(cmp);
itemCount = par1nbtTagCompound.getInt(TAG_ITEM_COUNT);
locked = par1nbtTagCompound.getBoolean(TAG_LOCK);
itemCount = tag.getInt(TAG_ITEM_COUNT);
locked = tag.getBoolean(TAG_LOCK);
}
public int getComparatorValue() {
@@ -373,7 +373,7 @@ public class EntityDoppleganger extends MobEntity implements IBotaniaBoss, IEnti
}
@Override
public boolean attackEntityFrom(@Nonnull DamageSource source, float par2) {
public boolean attackEntityFrom(@Nonnull DamageSource source, float amount) {
Entity e = source.getTrueSource();
if (e instanceof PlayerEntity && isTruePlayer(e) && getInvulTime() == 0) {
PlayerEntity player = (PlayerEntity) e;
@@ -382,7 +382,7 @@ public class EntityDoppleganger extends MobEntity implements IBotaniaBoss, IEnti
playersWhoAttacked.add(player.getUniqueID());
int cap = 25;
return super.attackEntityFrom(source, Math.min(cap, par2));
return super.attackEntityFrom(source, Math.min(cap, amount));
}
return false;
@@ -400,8 +400,8 @@ public class EntityDoppleganger extends MobEntity implements IBotaniaBoss, IEnti
}
@Override
protected void damageEntity(@Nonnull DamageSource source, float par2) {
super.damageEntity(source, par2);
protected void damageEntity(@Nonnull DamageSource source, float amount) {
super.damageEntity(source, amount);
Entity attacker = source.getImmediateSource();
if(attacker != null) {
@@ -101,7 +101,7 @@ public class EntityFlameRing extends Entity {
}
@Override
public boolean attackEntityFrom(@Nonnull DamageSource par1DamageSource, float par2) {
public boolean attackEntityFrom(@Nonnull DamageSource source, float amount) {
return false;
}
@@ -339,37 +339,37 @@ public class EntityManaBurst extends ThrowableEntity implements IManaBurst {
}
@Override
public void writeAdditional(CompoundNBT par1nbtTagCompound) {
super.writeAdditional(par1nbtTagCompound);
par1nbtTagCompound.putInt(TAG_TICKS_EXISTED, getTicksExisted());
par1nbtTagCompound.putInt(TAG_COLOR, getColor());
par1nbtTagCompound.putInt(TAG_MANA, getMana());
par1nbtTagCompound.putInt(TAG_STARTING_MANA, getStartingMana());
par1nbtTagCompound.putInt(TAG_MIN_MANA_LOSS, getMinManaLoss());
par1nbtTagCompound.putFloat(TAG_TICK_MANA_LOSS, getManaLossPerTick());
par1nbtTagCompound.putFloat(TAG_GRAVITY, getGravity());
public void writeAdditional(CompoundNBT tag) {
super.writeAdditional(tag);
tag.putInt(TAG_TICKS_EXISTED, getTicksExisted());
tag.putInt(TAG_COLOR, getColor());
tag.putInt(TAG_MANA, getMana());
tag.putInt(TAG_STARTING_MANA, getStartingMana());
tag.putInt(TAG_MIN_MANA_LOSS, getMinManaLoss());
tag.putFloat(TAG_TICK_MANA_LOSS, getManaLossPerTick());
tag.putFloat(TAG_GRAVITY, getGravity());
ItemStack stack = getSourceLens();
CompoundNBT lensCmp = new CompoundNBT();
if(!stack.isEmpty())
lensCmp = stack.write(lensCmp);
par1nbtTagCompound.put(TAG_LENS_STACK, lensCmp);
tag.put(TAG_LENS_STACK, lensCmp);
BlockPos coords = getBurstSourceBlockPos();
par1nbtTagCompound.putInt(TAG_SPREADER_X, coords.getX());
par1nbtTagCompound.putInt(TAG_SPREADER_Y, coords.getY());
par1nbtTagCompound.putInt(TAG_SPREADER_Z, coords.getZ());
tag.putInt(TAG_SPREADER_X, coords.getX());
tag.putInt(TAG_SPREADER_Y, coords.getY());
tag.putInt(TAG_SPREADER_Z, coords.getZ());
par1nbtTagCompound.putDouble(TAG_LAST_MOTION_X, getMotion().getX());
par1nbtTagCompound.putDouble(TAG_LAST_MOTION_Y, getMotion().getY());
par1nbtTagCompound.putDouble(TAG_LAST_MOTION_Z, getMotion().getZ());
tag.putDouble(TAG_LAST_MOTION_X, getMotion().getX());
tag.putDouble(TAG_LAST_MOTION_Y, getMotion().getY());
tag.putDouble(TAG_LAST_MOTION_Z, getMotion().getZ());
UUID identity = getShooterUUID();
boolean hasShooter = identity != null;
par1nbtTagCompound.putBoolean(TAG_HAS_SHOOTER, hasShooter);
tag.putBoolean(TAG_HAS_SHOOTER, hasShooter);
if(hasShooter) {
par1nbtTagCompound.putLong(TAG_SHOOTER_UUID_MOST, identity.getMostSignificantBits());
par1nbtTagCompound.putLong(TAG_SHOOTER_UUID_LEAST, identity.getLeastSignificantBits());
tag.putLong(TAG_SHOOTER_UUID_MOST, identity.getMostSignificantBits());
tag.putLong(TAG_SHOOTER_UUID_LEAST, identity.getLeastSignificantBits());
}
}
@@ -117,9 +117,9 @@ public class EntityPixie extends FlyingEntity {
}
@Override
public boolean attackEntityFrom(@Nonnull DamageSource par1DamageSource, float par2) {
if(getPixieType() == 0 && par1DamageSource.getTrueSource() != summoner || getPixieType() == 1 && par1DamageSource.getTrueSource() instanceof PlayerEntity)
return super.attackEntityFrom(par1DamageSource, par2);
public boolean attackEntityFrom(@Nonnull DamageSource source, float amount) {
if(getPixieType() == 0 && source.getTrueSource() != summoner || getPixieType() == 1 && source.getTrueSource() instanceof PlayerEntity)
return super.attackEntityFrom(source, amount);
return false;
}
@@ -262,9 +262,9 @@ public class ItemAstrolabe extends Item {
@Override
@OnlyIn(Dist.CLIENT)
public void addInformation(ItemStack par1ItemStack, World world, List<ITextComponent> tip, ITooltipFlag flags) {
Block block = getBlock(par1ItemStack);
int size = getSize(par1ItemStack);
public void addInformation(ItemStack stack, World world, List<ITextComponent> tip, ITooltipFlag flags) {
Block block = getBlock(stack);
int size = getSize(stack);
tip.add(new StringTextComponent(size + " x " + size));
if (block != Blocks.AIR)
@@ -211,7 +211,7 @@ public class ItemBottledMana extends Item {
@OnlyIn(Dist.CLIENT)
@Override
public void addInformation(ItemStack par1ItemStack, World world, List<ITextComponent> stacks, ITooltipFlag flags) {
public void addInformation(ItemStack stack, World world, List<ITextComponent> stacks, ITooltipFlag flags) {
stacks.add(new TranslationTextComponent("botaniamisc.bottleTooltip"));
}
@@ -237,13 +237,13 @@ public class ItemBottledMana extends Item {
}
@Override
public int getUseDuration(ItemStack par1ItemStack) {
public int getUseDuration(ItemStack stack) {
return 20;
}
@Nonnull
@Override
public UseAction getUseAction(ItemStack par1ItemStack) {
public UseAction getUseAction(ItemStack stack) {
return UseAction.DRINK;
}
@@ -125,7 +125,7 @@ public class ItemCacophonium extends Item {
}
@Override
public int getUseDuration(ItemStack par1ItemStack) {
public int getUseDuration(ItemStack stack) {
return 72000;
}
@@ -48,12 +48,12 @@ public class ItemHorn extends Item {
@Nonnull
@Override
public UseAction getUseAction(ItemStack par1ItemStack) {
public UseAction getUseAction(ItemStack stack) {
return UseAction.BOW;
}
@Override
public int getUseDuration(ItemStack par1ItemStack) {
public int getUseDuration(ItemStack stack) {
return 72000;
}
@@ -301,9 +301,9 @@ public class ItemManaGun extends Item implements IManaUsingItem {
}
@Override
public void inventoryTick(ItemStack par1ItemStack, World world, Entity par3Entity, int par4, boolean par5) {
if(par1ItemStack.isDamaged())
par1ItemStack.setDamage(par1ItemStack.getDamage() - 1);
public void inventoryTick(ItemStack stack, World world, Entity entity, int slot, boolean selected) {
if(stack.isDamaged())
stack.setDamage(stack.getDamage() - 1);
}
@Override
@@ -62,18 +62,18 @@ public class ItemManaMirror extends Item implements IManaItem, ICoordBoundItem,
}
@Override
public void inventoryTick(ItemStack par1ItemStack, World world, Entity par3Entity, int par4, boolean par5) {
public void inventoryTick(ItemStack stack, World world, Entity entity, int slot, boolean selected) {
if(world.isRemote)
return;
IManaPool pool = getManaPool(par1ItemStack);
IManaPool pool = getManaPool(stack);
if(!(pool instanceof DummyPool)) {
if(pool == null)
setMana(par1ItemStack, 0);
setMana(stack, 0);
else {
pool.recieveMana(getManaBacklog(par1ItemStack));
setManaBacklog(par1ItemStack, 0);
setMana(par1ItemStack, pool.getCurrentMana());
pool.recieveMana(getManaBacklog(stack));
setManaBacklog(stack, 0);
setMana(stack, pool.getCurrentMana());
}
}
}
@@ -61,8 +61,8 @@ public class ItemManaTablet extends Item implements IManaItem, ICreativeManaProv
@OnlyIn(Dist.CLIENT)
@Override
public void addInformation(ItemStack par1ItemStack, World world, List<ITextComponent> stacks, ITooltipFlag flags) {
if(isStackCreative(par1ItemStack))
public void addInformation(ItemStack stack, World world, List<ITextComponent> stacks, ITooltipFlag flags) {
if(isStackCreative(stack))
stacks.add(new TranslationTextComponent("botaniamisc.creative").applyTextStyle(TextFormatting.GRAY));
}
@@ -65,12 +65,12 @@ public class ItemSextant extends Item {
@Nonnull
@Override
public UseAction getUseAction(ItemStack par1ItemStack) {
public UseAction getUseAction(ItemStack stack) {
return UseAction.BOW;
}
@Override
public int getUseDuration(ItemStack par1ItemStack) {
public int getUseDuration(ItemStack stack) {
return 72000;
}
@@ -36,8 +36,8 @@ public class ItemSlingshot extends Item {
}
@Override
public void onPlayerStoppedUsing(ItemStack par1ItemStack, World world, LivingEntity living, int par4) {
int j = getUseDuration(par1ItemStack) - par4;
public void onPlayerStoppedUsing(ItemStack stack, World world, LivingEntity living, int duration) {
int j = getUseDuration(stack) - duration;
if(!world.isRemote && (!(living instanceof PlayerEntity) || ((PlayerEntity) living).abilities.isCreativeMode || PlayerHelper.hasAmmo((PlayerEntity) living, AMMO_FUNC))) {
float f = j / 20.0F;
@@ -58,13 +58,13 @@ public class ItemSlingshot extends Item {
}
@Override
public int getUseDuration(ItemStack par1ItemStack) {
public int getUseDuration(ItemStack stack) {
return 72000;
}
@Nonnull
@Override
public UseAction getUseAction(ItemStack par1ItemStack) {
public UseAction getUseAction(ItemStack stack) {
return UseAction.BOW;
}
@@ -311,11 +311,11 @@ public class ItemTwigWand extends Item implements ICoordBoundItem {
}
@Override
public void inventoryTick(ItemStack par1ItemStack, World world, Entity par3Entity, int par4, boolean par5) {
getBindingAttempt(par1ItemStack).ifPresent(coords -> {
public void inventoryTick(ItemStack stack, World world, Entity entity, int slot, boolean selected) {
getBindingAttempt(stack).ifPresent(coords -> {
TileEntity tile = world.getTileEntity(coords);
if(!(tile instanceof IWandBindable))
setBindingAttempt(par1ItemStack, UNBOUND_POS);
setBindingAttempt(stack, UNBOUND_POS);
});
}
@@ -348,7 +348,7 @@ public class ItemTwigWand extends Item implements ICoordBoundItem {
@Nonnull
@Override
public Rarity getRarity(ItemStack par1ItemStack) {
public Rarity getRarity(ItemStack stack) {
return Rarity.RARE;
}
@@ -39,7 +39,7 @@ public class ItemBlockPool extends BlockItem {
@OnlyIn(Dist.CLIENT)
@Override
public void addInformation(@Nonnull ItemStack par1ItemStack, World world, @Nonnull List<ITextComponent> stacks, @Nonnull ITooltipFlag flag) {
public void addInformation(@Nonnull ItemStack stack, World world, @Nonnull List<ITextComponent> stacks, @Nonnull ITooltipFlag flag) {
if(((BlockPool) getBlock()).variant == BlockPool.Variant.CREATIVE)
for(int i = 0; i < 2; i++)
stacks.add(new TranslationTextComponent("botaniamisc.creativePool" + i).applyTextStyle(TextFormatting.GRAY));
@@ -68,7 +68,7 @@ public class ItemManasteelArmor extends ArmorItem implements IManaUsingItem, IPh
}
@Override
public void inventoryTick(ItemStack stack, World world, Entity player, int par4, boolean par5) {
public void inventoryTick(ItemStack stack, World world, Entity player, int slot, boolean selected) {
if(player instanceof PlayerEntity)
onArmorTick(stack, world, (PlayerEntity) player);
}
@@ -58,24 +58,24 @@ public abstract class ItemBauble extends Item implements ICosmeticAttachable, IP
@Override
@OnlyIn(Dist.CLIENT)
public void addInformation(ItemStack par1ItemStack, World world, List<ITextComponent> stacks, ITooltipFlag flags) {
public void addInformation(ItemStack stack, World world, List<ITextComponent> stacks, ITooltipFlag flags) {
if(Screen.hasShiftDown())
addHiddenTooltip(par1ItemStack, world, stacks, flags);
addHiddenTooltip(stack, world, stacks, flags);
else stacks.add(new TranslationTextComponent("botaniamisc.shiftinfo"));
}
@OnlyIn(Dist.CLIENT)
public void addHiddenTooltip(ItemStack par1ItemStack, World world, List<ITextComponent> stacks, ITooltipFlag flags) {
public void addHiddenTooltip(ItemStack stack, World world, List<ITextComponent> stacks, ITooltipFlag flags) {
String key = vazkii.botania.client.core.helper.RenderHelper.getKeyDisplayString("key.curios.open.desc");
if(key != null)
stacks.add(new TranslationTextComponent("botania.baubletooltip", key));
ItemStack cosmetic = getCosmeticItem(par1ItemStack);
ItemStack cosmetic = getCosmeticItem(stack);
if(!cosmetic.isEmpty())
stacks.add(new TranslationTextComponent("botaniamisc.hasCosmetic", cosmetic.getDisplayName()));
if(hasPhantomInk(par1ItemStack))
if(hasPhantomInk(stack))
stacks.add(new TranslationTextComponent("botaniamisc.hasPhantomInk"));
}
@@ -52,7 +52,7 @@ public class ItemEnderDagger extends ItemManasteelSword {
}
@Override
public void inventoryTick(ItemStack stack, World world, Entity player, int par4, boolean par5) {}
public void inventoryTick(ItemStack stack, World world, Entity player, int slot, boolean selected) {}
@Override
public boolean usesMana(ItemStack stack) {
@@ -35,14 +35,14 @@ public class ItemStarSword extends ItemManasteelSword {
}
@Override
public void inventoryTick(ItemStack par1ItemStack, World world, Entity par3Entity, int par4, boolean par5) {
super.inventoryTick(par1ItemStack, world, par3Entity, par4, par5);
if(par3Entity instanceof PlayerEntity) {
PlayerEntity player = (PlayerEntity) par3Entity;
public void inventoryTick(ItemStack stack, World world, Entity entity, int slot, boolean selected) {
super.inventoryTick(stack, world, entity, slot, selected);
if(entity instanceof PlayerEntity) {
PlayerEntity player = (PlayerEntity) entity;
EffectInstance haste = player.getActivePotionEffect(Effects.HASTE);
float check = haste == null ? 0.16666667F : haste.getAmplifier() == 1 ? 0.5F : 0.4F;
if(player.getHeldItemMainhand() == par1ItemStack && player.swingProgress == check && !world.isRemote) {
if(player.getHeldItemMainhand() == stack && player.swingProgress == check && !world.isRemote) {
RayTraceResult pos = ToolCommons.raytraceFromEntity(world, player, RayTraceContext.FluidMode.NONE, 48);
if(pos.getType() == RayTraceResult.Type.BLOCK) {
Vector3 posVec = Vector3.fromBlockPos(((BlockRayTraceResult) pos).getPos());
@@ -65,7 +65,7 @@ public class ItemStarSword extends ItemManasteelSword {
world.addEntity(bonusStar);
}
ToolCommons.damageItem(par1ItemStack, 1, player, MANA_PER_DAMAGE);
ToolCommons.damageItem(stack, 1, player, MANA_PER_DAMAGE);
world.playSound(null, player.getX(), player.getY(), player.getZ(), ModSounds.starcaller, SoundCategory.PLAYERS, 0.4F, 1.4F);
}
}
@@ -153,7 +153,7 @@ public class ItemLivingwoodBow extends BowItem implements IManaUsingItem {
}
@Override
public void inventoryTick(ItemStack stack, World world, Entity player, int par4, boolean par5) {
public void inventoryTick(ItemStack stack, World world, Entity player, int slot, boolean selected) {
if(!world.isRemote && player instanceof PlayerEntity && stack.getDamage() > 0 && ManaItemHandler.requestManaExactForTool(stack, (PlayerEntity) player, MANA_PER_DAMAGE * 2, true))
stack.setDamage(stack.getDamage() - 1);
}
@@ -34,12 +34,12 @@ public class ItemElementiumShears extends ItemManasteelShears {
@Nonnull
@Override
public UseAction getUseAction(ItemStack par1ItemStack) {
public UseAction getUseAction(ItemStack stack) {
return UseAction.BOW;
}
@Override
public int getUseDuration(ItemStack par1ItemStack) {
public int getUseDuration(ItemStack stack) {
return 72000;
}
@@ -76,7 +76,7 @@ public class ItemManasteelAxe extends AxeItem implements IManaUsingItem, ISortab
@Override
public void inventoryTick(ItemStack stack, World world, Entity player, int par4, boolean par5) {
public void inventoryTick(ItemStack stack, World world, Entity player, int slot, boolean selected) {
if(!world.isRemote && player instanceof PlayerEntity && stack.getDamage() > 0 && ManaItemHandler.requestManaExactForTool(stack, (PlayerEntity) player, getManaPerDamage() * 2, true))
stack.setDamage(stack.getDamage() - 1);
}
@@ -85,7 +85,7 @@ public class ItemManasteelPick extends PickaxeItem implements IManaUsingItem, IS
}
@Override
public void inventoryTick(ItemStack stack, World world, Entity player, int par4, boolean par5) {
public void inventoryTick(ItemStack stack, World world, Entity player, int slot, boolean selected) {
if(!world.isRemote && player instanceof PlayerEntity && stack.getDamage() > 0 && ManaItemHandler.requestManaExactForTool(stack, (PlayerEntity) player, MANA_PER_DAMAGE * 2, true))
stack.setDamage(stack.getDamage() - 1);
}
@@ -105,7 +105,7 @@ public class ItemManasteelShears extends ShearsItem implements IManaUsingItem {
}
@Override
public void inventoryTick(ItemStack stack, World world, Entity player, int par4, boolean par5) {
public void inventoryTick(ItemStack stack, World world, Entity player, int slot, boolean selected) {
if(!world.isRemote && player instanceof PlayerEntity && stack.getDamage() > 0 && ManaItemHandler.requestManaExactForTool(stack, (PlayerEntity) player, MANA_PER_DAMAGE * 2, true))
stack.setDamage(stack.getDamage() - 1);
}
@@ -54,8 +54,8 @@ public class ItemManasteelShovel extends ShovelItem implements IManaUsingItem, I
}
@Override
public boolean hitEntity(ItemStack par1ItemStack, LivingEntity par2EntityLivingBase, @Nonnull LivingEntity par3EntityLivingBase) {
ToolCommons.damageItem(par1ItemStack, 1, par3EntityLivingBase, getManaPerDamage());
public boolean hitEntity(ItemStack stack, LivingEntity target, @Nonnull LivingEntity attacker) {
ToolCommons.damageItem(stack, 1, attacker, getManaPerDamage());
return true;
}
@@ -115,7 +115,7 @@ public class ItemManasteelShovel extends ShovelItem implements IManaUsingItem, I
}
@Override
public void inventoryTick(ItemStack stack, World world, Entity player, int par4, boolean par5) {
public void inventoryTick(ItemStack stack, World world, Entity player, int slot, boolean selected) {
if (!world.isRemote && player instanceof PlayerEntity && stack.getDamage() > 0 && ManaItemHandler.requestManaExactForTool(stack, (PlayerEntity) player, getManaPerDamage() * 2, true))
stack.setDamage(stack.getDamage() - 1);
}
@@ -45,7 +45,7 @@ public class ItemManasteelSword extends SwordItem implements IManaUsingItem {
}
@Override
public void inventoryTick(ItemStack stack, World world, Entity player, int par4, boolean par5) {
public void inventoryTick(ItemStack stack, World world, Entity player, int slot, boolean selected) {
if(!world.isRemote && player instanceof PlayerEntity && stack.getDamage() > 0 && ManaItemHandler.requestManaExactForTool(stack, (PlayerEntity) player, getManaPerDamage() * 2, true))
stack.setDamage(stack.getDamage() - 1);
}
@@ -101,11 +101,11 @@ public class ItemTerraPick extends ItemManasteelPick implements IManaItem, ISequ
@OnlyIn(Dist.CLIENT)
@Override
public void addInformation(ItemStack par1ItemStack, World world, List<ITextComponent> stacks, ITooltipFlag flags) {
ITextComponent rank = new TranslationTextComponent("botania.rank" + getLevel(par1ItemStack));
public void addInformation(ItemStack stack, World world, List<ITextComponent> stacks, ITooltipFlag flags) {
ITextComponent rank = new TranslationTextComponent("botania.rank" + getLevel(stack));
ITextComponent rankFormat = new TranslationTextComponent("botaniamisc.toolRank", rank);
stacks.add(rankFormat);
if(getMana(par1ItemStack) == Integer.MAX_VALUE)
if(getMana(stack) == Integer.MAX_VALUE)
stacks.add(new TranslationTextComponent("botaniamisc.getALife").applyTextStyle(TextFormatting.RED));
}
@@ -134,15 +134,15 @@ public class ItemTerraPick extends ItemManasteelPick implements IManaItem, ISequ
}
@Override
public void inventoryTick(ItemStack par1ItemStack, World world, Entity par3Entity, int par4, boolean par5) {
super.inventoryTick(par1ItemStack, world, par3Entity, par4, par5);
if(isEnabled(par1ItemStack)) {
int level = getLevel(par1ItemStack);
public void inventoryTick(ItemStack stack, World world, Entity entity, int slot, boolean selected) {
super.inventoryTick(stack, world, entity, slot, selected);
if(isEnabled(stack)) {
int level = getLevel(stack);
if(level == 0)
setEnabled(par1ItemStack, false);
else if(par3Entity instanceof PlayerEntity && !((PlayerEntity) par3Entity).isSwingInProgress)
addMana(par1ItemStack, -level);
setEnabled(stack, false);
else if(entity instanceof PlayerEntity && !((PlayerEntity) entity).isSwingInProgress)
addMana(stack, -level);
}
}
@@ -63,8 +63,8 @@ public class ItemLens extends Item implements ILensControl, ICompositableLens, I
@OnlyIn(Dist.CLIENT)
@Override
public void addInformation(ItemStack par1ItemStack, World world, List<ITextComponent> stacks, ITooltipFlag flags) {
int storedColor = getStoredColor(par1ItemStack);
public void addInformation(ItemStack stack, World world, List<ITextComponent> stacks, ITooltipFlag flags) {
int storedColor = getStoredColor(stack);
if(storedColor != -1) {
TranslationTextComponent colorName = new TranslationTextComponent(storedColor == 16 ? "botania.color.rainbow" : "color.minecraft." + DyeColor.byId(storedColor));
stacks.add(new TranslationTextComponent("botaniamisc.color", colorName).applyTextStyle(TextFormatting.GRAY));
@@ -124,13 +124,13 @@ public class ItemFlugelEye extends ItemRelic implements ICoordBoundItem, IManaUs
}
@Override
public int getUseDuration(ItemStack par1ItemStack) {
public int getUseDuration(ItemStack stack) {
return 40;
}
@Nonnull
@Override
public UseAction getUseAction(ItemStack par1ItemStack) {
public UseAction getUseAction(ItemStack stack) {
return UseAction.BOW;
}
@@ -71,8 +71,8 @@ public class ItemInfiniteFruit extends ItemRelic implements IManaUsingItem {
}
}
private static boolean isBoot(ItemStack par1ItemStack) {
String name = par1ItemStack.getDisplayName().getString().toLowerCase(Locale.ROOT).trim();
private static boolean isBoot(ItemStack stack) {
String name = stack.getDisplayName().getString().toLowerCase(Locale.ROOT).trim();
return name.equals("das boot");
}
@@ -104,12 +104,12 @@ public class ItemKingKey extends ItemRelic implements IManaUsingItem {
@Nonnull
@Override
public UseAction getUseAction(ItemStack par1ItemStack) {
public UseAction getUseAction(ItemStack stack) {
return UseAction.BOW;
}
@Override
public int getUseDuration(ItemStack par1ItemStack) {
public int getUseDuration(ItemStack stack) {
return 72000;
}
@@ -48,9 +48,9 @@ public abstract class ItemRelicBauble extends ItemBauble implements IRelic {
@OnlyIn(Dist.CLIENT)
@Override
public void addHiddenTooltip(ItemStack par1ItemStack, World world, List<ITextComponent> stacks, ITooltipFlag flags) {
super.addHiddenTooltip(par1ItemStack, world, stacks, flags);
dummy.addBindInfo(stacks, par1ItemStack);
public void addHiddenTooltip(ItemStack stack, World world, List<ITextComponent> stacks, ITooltipFlag flags) {
super.addHiddenTooltip(stack, world, stacks, flags);
dummy.addBindInfo(stacks, stack);
}
@Override
@@ -46,12 +46,12 @@ public class ItemMissileRod extends Item implements IManaUsingItem, IAvatarWield
@Nonnull
@Override
public UseAction getUseAction(ItemStack par1ItemStack) {
public UseAction getUseAction(ItemStack stack) {
return UseAction.BOW;
}
@Override
public int getUseDuration(ItemStack par1ItemStack) {
public int getUseDuration(ItemStack stack) {
return 72000;
}
@@ -55,12 +55,12 @@ public class ItemSmeltRod extends Item implements IManaUsingItem {
@Nonnull
@Override
public UseAction getUseAction(ItemStack par1ItemStack) {
public UseAction getUseAction(ItemStack stack) {
return UseAction.BOW;
}
@Override
public int getUseDuration(ItemStack par1ItemStack) {
public int getUseDuration(ItemStack stack) {
return 72000;
}
@@ -64,12 +64,12 @@ public class ItemTerraformRod extends Item implements IManaUsingItem, IBlockProv
@Nonnull
@Override
public UseAction getUseAction(ItemStack par1ItemStack) {
public UseAction getUseAction(ItemStack stack) {
return UseAction.BOW;
}
@Override
public int getUseDuration(ItemStack par1ItemStack) {
public int getUseDuration(ItemStack stack) {
return 72000;
}
@@ -86,8 +86,8 @@ public class ItemTerraformRod extends Item implements IManaUsingItem, IBlockProv
return ActionResult.success(player.getHeldItem(hand));
}
private void terraform(ItemStack par1ItemStack, World world, PlayerEntity player) {
int range = IManaProficiencyArmor.Helper.hasProficiency(player, par1ItemStack) ? 22 : 16;
private void terraform(ItemStack stack, World world, PlayerEntity player) {
int range = IManaProficiencyArmor.Helper.hasProficiency(player, stack) ? 22 : 16;
BlockPos startCenter = new BlockPos(player).down();
@@ -128,7 +128,7 @@ public class ItemTerraformRod extends Item implements IManaUsingItem, IBlockProv
int cost = COST_PER * blocks.size();
if(world.isRemote || ManaItemHandler.requestManaExactForTool(par1ItemStack, player, cost, true)) {
if(world.isRemote || ManaItemHandler.requestManaExactForTool(stack, player, cost, true)) {
if(!world.isRemote)
for(CoordsWithBlock block : blocks)
world.setBlockState(block, block.block.getDefaultState());