Update Forge + mappings

This commit is contained in:
Nicholas Ignoffo 2016-04-24 10:06:28 -07:00
parent b408234ab0
commit d550513f0a
98 changed files with 313 additions and 296 deletions

View file

@ -81,17 +81,17 @@ public class ItemAltarMaker extends Item implements IAltarManipulator, IVariantP
return super.onItemRightClick(stack, world, player, hand);
}
RayTraceResult mop = getMovingObjectPositionFromPlayer(world, player, false);
if (mop == null || mop.typeOfHit == RayTraceResult.Type.MISS || mop.typeOfHit == RayTraceResult.Type.ENTITY)
RayTraceResult rayTrace = rayTrace(world, player, false);
if (rayTrace == null || rayTrace.typeOfHit == RayTraceResult.Type.MISS || rayTrace.typeOfHit == RayTraceResult.Type.ENTITY)
return super.onItemRightClick(stack, world, player, hand);
if (mop.typeOfHit == RayTraceResult.Type.BLOCK && world.getBlockState(mop.getBlockPos()).getBlock() instanceof BlockAltar)
if (rayTrace.typeOfHit == RayTraceResult.Type.BLOCK && world.getBlockState(rayTrace.getBlockPos()).getBlock() instanceof BlockAltar)
{
ChatUtil.sendNoSpam(player, TextHelper.localizeEffect("chat.BloodMagic.altarMaker.building", NumeralHelper.toRoman(tierToBuild.toInt())));
buildAltar(world, mop.getBlockPos());
IBlockState state = world.getBlockState(mop.getBlockPos());
buildAltar(world, rayTrace.getBlockPos());
IBlockState state = world.getBlockState(rayTrace.getBlockPos());
world.notifyBlockUpdate(mop.getBlockPos(), state, state, 3);
world.notifyBlockUpdate(rayTrace.getBlockPos(), state, state, 3);
}
return super.onItemRightClick(stack, world, player, hand);
@ -135,8 +135,8 @@ public class ItemAltarMaker extends Item implements IAltarManipulator, IVariantP
if (world.isRemote)
return "";
RayTraceResult mop = getMovingObjectPositionFromPlayer(world, player, false);
BlockPos pos = mop.getBlockPos();
RayTraceResult rayTrace = rayTrace(world, player, false);
BlockPos pos = rayTrace.getBlockPos();
IBlockState state = world.getBlockState(pos);
EnumAltarTier altarTier = BloodAltar.getAltarTier(world, pos);

View file

@ -53,7 +53,7 @@ public class ItemBloodOrb extends ItemBindableBase implements IBloodOrb, IBindab
if (world == null)
return super.onItemRightClick(stack, null, player, hand);
world.playSound(null, player.posX, player.posY, player.posZ, SoundEvents.block_fire_extinguish, SoundCategory.BLOCKS, 0.5F, 2.6F + (world.rand.nextFloat() - world.rand.nextFloat()) * 0.8F);
world.playSound(null, player.posX, player.posY, player.posZ, SoundEvents.BLOCK_FIRE_EXTINGUISH, SoundCategory.BLOCKS, 0.5F, 2.6F + (world.rand.nextFloat() - world.rand.nextFloat()) * 0.8F);
// SpellHelper.sendIndexedParticleToAllAround(world, posX, posY, posZ,
// 20, world.provider.getDimensionId(), 4, posX, posY, posZ);

View file

@ -39,7 +39,7 @@ import javax.annotation.Nullable;
public class ItemBoundAxe extends ItemBoundTool implements IMeshProvider
{
private static final Set<Block> EFFECTIVE_ON = Sets.newHashSet(Blocks.planks, Blocks.bookshelf, Blocks.log, Blocks.log2, Blocks.chest, Blocks.pumpkin, Blocks.lit_pumpkin, Blocks.melon_block, Blocks.ladder);
private static final Set<Block> EFFECTIVE_ON = Sets.newHashSet(Blocks.PLANKS, Blocks.BOOKSHELF, Blocks.LOG, Blocks.LOG2, Blocks.CHEST, Blocks.PUMPKIN, Blocks.LIT_PUMPKIN, Blocks.MELON_BLOCK, Blocks.LADDER);
public ItemBoundAxe()
{
@ -64,8 +64,8 @@ public class ItemBoundAxe extends ItemBoundTool implements IMeshProvider
if (world.isRemote)
return;
boolean silkTouch = EnchantmentHelper.getEnchantmentLevel(Enchantments.silkTouch, stack) > 0;
int fortuneLvl = EnchantmentHelper.getEnchantmentLevel(Enchantments.fortune, stack);
boolean silkTouch = EnchantmentHelper.getEnchantmentLevel(Enchantments.SILK_TOUCH, stack) > 0;
int fortuneLvl = EnchantmentHelper.getEnchantmentLevel(Enchantments.FORTUNE, stack);
int range = (int) (charge / 6); //Charge is a max of 30 - want 5 to be the max
HashMultiset<ItemStackWrapper> drops = HashMultiset.create();

View file

@ -39,7 +39,7 @@ import javax.annotation.Nullable;
public class ItemBoundPickaxe extends ItemBoundTool implements IMeshProvider
{
private static final Set<Block> EFFECTIVE_ON = Sets.newHashSet(Blocks.activator_rail, Blocks.coal_ore, Blocks.cobblestone, Blocks.detector_rail, Blocks.diamond_block, Blocks.diamond_ore, Blocks.double_stone_slab, Blocks.golden_rail, Blocks.gold_block, Blocks.gold_ore, Blocks.ice, Blocks.iron_block, Blocks.iron_ore, Blocks.lapis_block, Blocks.lapis_ore, Blocks.lit_redstone_ore, Blocks.mossy_cobblestone, Blocks.netherrack, Blocks.packed_ice, Blocks.rail, Blocks.redstone_ore, Blocks.sandstone, Blocks.red_sandstone, Blocks.stone, Blocks.stone_slab);
private static final Set<Block> EFFECTIVE_ON = Sets.newHashSet(Blocks.ACTIVATOR_RAIL, Blocks.COAL_ORE, Blocks.COBBLESTONE, Blocks.DETECTOR_RAIL, Blocks.DIAMOND_BLOCK, Blocks.DIAMOND_ORE, Blocks.STONE_SLAB, Blocks.GOLDEN_RAIL, Blocks.GOLD_BLOCK, Blocks.GOLD_ORE, Blocks.ICE, Blocks.IRON_BLOCK, Blocks.IRON_ORE, Blocks.LAPIS_BLOCK, Blocks.LAPIS_ORE, Blocks.LIT_REDSTONE_ORE, Blocks.MOSSY_COBBLESTONE, Blocks.NETHERRACK, Blocks.PACKED_ICE, Blocks.RAIL, Blocks.REDSTONE_ORE, Blocks.SANDSTONE, Blocks.RED_SANDSTONE, Blocks.STONE, Blocks.STONE_SLAB);
public ItemBoundPickaxe()
{
@ -61,8 +61,8 @@ public class ItemBoundPickaxe extends ItemBoundTool implements IMeshProvider
@Override
public boolean canHarvestBlock(IBlockState blockIn)
{
return blockIn == Blocks.obsidian ? this.toolMaterial.getHarvestLevel() == 3
: (blockIn != Blocks.diamond_block && blockIn != Blocks.diamond_ore ? (blockIn != Blocks.emerald_ore && blockIn != Blocks.emerald_block ? (blockIn != Blocks.gold_block && blockIn != Blocks.gold_ore ? (blockIn != Blocks.iron_block && blockIn != Blocks.iron_ore ? (blockIn != Blocks.lapis_block && blockIn != Blocks.lapis_ore ? (blockIn != Blocks.redstone_ore && blockIn != Blocks.lit_redstone_ore ? (blockIn.getMaterial() == Material.rock || (blockIn.getMaterial() == Material.iron || blockIn.getMaterial() == Material.anvil)) : this.toolMaterial.getHarvestLevel() >= 2)
return blockIn == Blocks.OBSIDIAN ? this.toolMaterial.getHarvestLevel() == 3
: (blockIn != Blocks.DIAMOND_BLOCK && blockIn != Blocks.DIAMOND_ORE ? (blockIn != Blocks.EMERALD_ORE && blockIn != Blocks.EMERALD_BLOCK ? (blockIn != Blocks.GOLD_BLOCK && blockIn != Blocks.GOLD_ORE ? (blockIn != Blocks.IRON_BLOCK && blockIn != Blocks.IRON_ORE ? (blockIn != Blocks.LAPIS_BLOCK && blockIn != Blocks.LAPIS_ORE ? (blockIn != Blocks.REDSTONE_ORE && blockIn != Blocks.LIT_REDSTONE_ORE ? (blockIn.getMaterial() == Material.ROCK || (blockIn.getMaterial() == Material.IRON || blockIn.getMaterial() == Material.ANVIL)) : this.toolMaterial.getHarvestLevel() >= 2)
: this.toolMaterial.getHarvestLevel() >= 1) : this.toolMaterial.getHarvestLevel() >= 1) : this.toolMaterial.getHarvestLevel() >= 2) : this.toolMaterial.getHarvestLevel() >= 2) : this.toolMaterial.getHarvestLevel() >= 2);
}
@ -72,7 +72,7 @@ public class ItemBoundPickaxe extends ItemBoundTool implements IMeshProvider
if (!getActivated(stack))
return 1.0F;
return state.getMaterial() != Material.iron && state.getMaterial() != Material.anvil && state.getMaterial() != Material.rock ? super.getStrVsBlock(stack, state) : this.efficiencyOnProperMaterial;
return state.getMaterial() != Material.IRON && state.getMaterial() != Material.ANVIL&& state.getMaterial() != Material.ROCK ? super.getStrVsBlock(stack, state) : this.efficiencyOnProperMaterial;
}
@Override
@ -81,8 +81,8 @@ public class ItemBoundPickaxe extends ItemBoundTool implements IMeshProvider
if (world.isRemote)
return;
boolean silkTouch = EnchantmentHelper.getEnchantmentLevel(Enchantments.silkTouch, stack) > 0;
int fortuneLvl = EnchantmentHelper.getEnchantmentLevel(Enchantments.fortune, stack);
boolean silkTouch = EnchantmentHelper.getEnchantmentLevel(Enchantments.SILK_TOUCH, stack) > 0;
int fortuneLvl = EnchantmentHelper.getEnchantmentLevel(Enchantments.FORTUNE, stack);
int range = (charge / 6); //Charge is a max of 30 - want 5 to be the max
HashMultiset<ItemStackWrapper> drops = HashMultiset.create();

View file

@ -38,7 +38,7 @@ import javax.annotation.Nullable;
public class ItemBoundShovel extends ItemBoundTool implements IMeshProvider
{
private static final Set<Block> EFFECTIVE_ON = Sets.newHashSet(Blocks.clay, Blocks.dirt, Blocks.farmland, Blocks.grass, Blocks.gravel, Blocks.mycelium, Blocks.sand, Blocks.snow, Blocks.snow_layer, Blocks.soul_sand);
private static final Set<Block> EFFECTIVE_ON = Sets.newHashSet(Blocks.CLAY, Blocks.DIRT, Blocks.FARMLAND, Blocks.GRASS, Blocks.GRAVEL, Blocks.MYCELIUM, Blocks.SAND, Blocks.SNOW, Blocks.SNOW_LAYER, Blocks.SOUL_SAND);
public ItemBoundShovel()
{
@ -63,8 +63,8 @@ public class ItemBoundShovel extends ItemBoundTool implements IMeshProvider
if (world.isRemote)
return;
boolean silkTouch = EnchantmentHelper.getEnchantmentLevel(Enchantments.silkTouch, stack) > 0;
int fortuneLvl = EnchantmentHelper.getEnchantmentLevel(Enchantments.fortune, stack);
boolean silkTouch = EnchantmentHelper.getEnchantmentLevel(Enchantments.SILK_TOUCH, stack) > 0;
int fortuneLvl = EnchantmentHelper.getEnchantmentLevel(Enchantments.FORTUNE, stack);
int range = (int) (charge / 6); //Charge is a max of 30 - want 5 to be the max
HashMultiset<ItemStackWrapper> drops = HashMultiset.create();

View file

@ -13,7 +13,7 @@ public class ItemBucketEssence extends ItemBucket
super(ModBlocks.lifeEssence);
setUnlocalizedName(Constants.Mod.MODID + ".bucket.lifeEssence");
setContainerItem(Items.bucket);
setContainerItem(Items.BUCKET);
setCreativeTab(BloodMagic.tabBloodMagic);
}
}

View file

@ -54,7 +54,7 @@ public class ItemDaggerOfSacrifice extends Item implements IVariantProvider
if (PlayerSacrificeHelper.findAndFillAltar(attacker.worldObj, target, lifeEssence, true))
{
target.worldObj.playSound(null, target.posX, target.posY, target.posZ, SoundEvents.block_fire_extinguish, SoundCategory.BLOCKS, 0.5F, 2.6F + (target.worldObj.rand.nextFloat() - target.worldObj.rand.nextFloat()) * 0.8F);
target.worldObj.playSound(null, target.posX, target.posY, target.posZ, SoundEvents.BLOCK_FIRE_EXTINGUISH, SoundCategory.BLOCKS, 0.5F, 2.6F + (target.worldObj.rand.nextFloat() - target.worldObj.rand.nextFloat()) * 0.8F);
target.setHealth(-1);
target.onDeath(BloodMagicAPI.getDamageSource());
}

View file

@ -86,7 +86,7 @@ public class ItemExperienceBook extends Item implements IVariantProvider
if (player.experienceLevel % 5 == 0)
{
float f = player.experienceLevel > 30 ? 1.0F : (float) player.experienceLevel / 30.0F;
player.worldObj.playSound((EntityPlayer) null, player.posX, player.posY, player.posZ, SoundEvents.entity_player_levelup, player.getSoundCategory(), f * 0.75F, 1.0F);
player.worldObj.playSound((EntityPlayer) null, player.posX, player.posY, player.posZ, SoundEvents.ENTITY_PLAYER_LEVELUP, player.getSoundCategory(), f * 0.75F, 1.0F);
}
} else
{

View file

@ -72,7 +72,7 @@ public class ItemLavaCrystal extends ItemBindableBase implements IFuelHandler, I
EntityPlayer player = PlayerHelper.getPlayerFromUUID(this.getOwnerUUID(fuel));
if (player != null)
{
player.addPotionEffect(new PotionEffect(MobEffects.confusion, 99));
player.addPotionEffect(new PotionEffect(MobEffects.NAUSEA, 99));
}
}

View file

@ -286,7 +286,7 @@ public class ItemRitualDiviner extends Item implements IVariantProvider
@Override
public ActionResult<ItemStack> onItemRightClick(ItemStack stack, World world, EntityPlayer player, EnumHand hand)
{
RayTraceResult ray = this.getMovingObjectPositionFromPlayer(world, player, false);
RayTraceResult ray = this.rayTrace(world, player, false);
if (ray != null && ray.typeOfHit == RayTraceResult.Type.BLOCK)
{
return new ActionResult<ItemStack>(EnumActionResult.PASS, stack);
@ -312,7 +312,7 @@ public class ItemRitualDiviner extends Item implements IVariantProvider
{
EntityPlayer player = (EntityPlayer) entityLiving;
RayTraceResult ray = this.getMovingObjectPositionFromPlayer(player.worldObj, player, false);
RayTraceResult ray = this.rayTrace(player.worldObj, player, false);
if (ray != null && ray.typeOfHit == RayTraceResult.Type.BLOCK)
{
return false;

View file

@ -70,7 +70,7 @@ public class ItemRitualReader extends Item implements IVariantProvider
@Override
public ActionResult<ItemStack> onItemRightClick(ItemStack stack, World world, EntityPlayer player, EnumHand hand)
{
RayTraceResult ray = this.getMovingObjectPositionFromPlayer(world, player, false);
RayTraceResult ray = this.rayTrace(world, player, false);
if (ray != null && ray.typeOfHit == RayTraceResult.Type.BLOCK)
{
return new ActionResult<ItemStack>(EnumActionResult.PASS, stack);

View file

@ -107,10 +107,10 @@ public class ItemSacrificialDagger extends Item implements IMeshProvider
int lpAdded = 200;
RayTraceResult mop = getMovingObjectPositionFromPlayer(world, player, false);
if (mop != null && mop.typeOfHit == RayTraceResult.Type.BLOCK)
RayTraceResult rayTrace = rayTrace(world, player, false);
if (rayTrace != null && rayTrace.typeOfHit == RayTraceResult.Type.BLOCK)
{
TileEntity tile = world.getTileEntity(mop.getBlockPos());
TileEntity tile = world.getTileEntity(rayTrace.getBlockPos());
if (tile != null && tile instanceof TileAltar && stack.getItemDamage() == 1)
lpAdded = ((TileAltar) tile).getCapacity();
@ -144,7 +144,7 @@ public class ItemSacrificialDagger extends Item implements IMeshProvider
double posX = player.posX;
double posY = player.posY;
double posZ = player.posZ;
world.playSound(null, posX, posY, posZ, SoundEvents.block_fire_extinguish, SoundCategory.BLOCKS, 0.5F, 2.6F + (world.rand.nextFloat() - world.rand.nextFloat()) * 0.8F);
world.playSound(null, posX, posY, posZ, SoundEvents.BLOCK_FIRE_EXTINGUISH, SoundCategory.BLOCKS, 0.5F, 2.6F + (world.rand.nextFloat() - world.rand.nextFloat()) * 0.8F);
for (int l = 0; l < 8; ++l)
world.spawnParticle(EnumParticleTypes.REDSTONE, posX + Math.random() - Math.random(), posY + Math.random() - Math.random(), posZ + Math.random() - Math.random(), 0, 0, 0);

View file

@ -58,7 +58,7 @@ public class ItemTelepositionFocus extends ItemBindableBase implements IVariantP
{
if (player.isSneaking())
{
RayTraceResult mop = getMovingObjectPositionFromPlayer(world, player, false);
RayTraceResult mop = rayTrace(world, player, false);
if (mop != null && mop.typeOfHit == RayTraceResult.Type.BLOCK)
{

View file

@ -115,13 +115,13 @@ public class ItemSentientArmour extends ItemArmor implements ISpecialArmor, IMes
switch (type)
{
case CORROSIVE:
if (player.isPotionActive(MobEffects.poison))
if (player.isPotionActive(MobEffects.POISON))
{
player.removeActivePotionEffect(MobEffects.poison);
player.removeActivePotionEffect(MobEffects.POISON);
}
if (player.isPotionActive(MobEffects.wither))
if (player.isPotionActive(MobEffects.WITHER))
{
player.removeActivePotionEffect(MobEffects.wither);
player.removeActivePotionEffect(MobEffects.WITHER);
}
break;
default:
@ -140,7 +140,7 @@ public class ItemSentientArmour extends ItemArmor implements ISpecialArmor, IMes
case CORROSIVE:
if (!source.isProjectile())
{
attacker.addPotionEffect(new PotionEffect(MobEffects.poison, 100)); //TODO: customize duration
attacker.addPotionEffect(new PotionEffect(MobEffects.POISON, 100)); //TODO: customize duration
}
break;
case DEFAULT:

View file

@ -43,21 +43,21 @@ public class ItemPackSacrifice extends ItemArmor implements IAltarManipulator, I
if (world.isRemote)
return ActionResult.newResult(EnumActionResult.FAIL, stack);
RayTraceResult position = this.getMovingObjectPositionFromPlayer(world, player, false);
RayTraceResult rayTrace = this.rayTrace(world, player, false);
if (position == null)
if (rayTrace == null)
{
return super.onItemRightClick(stack, world, player, EnumHand.MAIN_HAND);
} else
{
if (position.typeOfHit == RayTraceResult.Type.BLOCK)
if (rayTrace.typeOfHit == RayTraceResult.Type.BLOCK)
{
TileEntity tile = world.getTileEntity(position.getBlockPos());
TileEntity tile = world.getTileEntity(rayTrace.getBlockPos());
if (!(tile instanceof IBloodAltar))
return super.onItemRightClick(stack, world, player, EnumHand.MAIN_HAND);
LPContainer.tryAndFillAltar((IBloodAltar) tile, stack, world, position.getBlockPos());
LPContainer.tryAndFillAltar((IBloodAltar) tile, stack, world, rayTrace.getBlockPos());
}
}

View file

@ -59,7 +59,7 @@ public class ItemPackSelfSacrifice extends ItemArmor implements IAltarManipulato
if (world.isRemote)
return ActionResult.newResult(EnumActionResult.FAIL, stack);
RayTraceResult position = this.getMovingObjectPositionFromPlayer(world, player, false);
RayTraceResult position = this.rayTrace(world, player, false);
if (position == null)
{

View file

@ -42,7 +42,7 @@ public class ItemSigilAir extends ItemSigilBase implements ISentientSwordEffectP
player.motionY = vec.yCoord * wantedVelocity;
player.motionZ = vec.zCoord * wantedVelocity;
player.velocityChanged = true;
world.playSound(null, player.posX, player.posY, player.posZ, SoundEvents.block_fire_extinguish, SoundCategory.BLOCKS, 0.5F, 2.6F + (world.rand.nextFloat() - world.rand.nextFloat()) * 0.8F);
world.playSound(null, player.posX, player.posY, player.posZ, SoundEvents.BLOCK_FIRE_EXTINGUISH, SoundCategory.BLOCKS, 0.5F, 2.6F + (world.rand.nextFloat() - world.rand.nextFloat()) * 0.8F);
player.fallDistance = 0;
@ -56,7 +56,7 @@ public class ItemSigilAir extends ItemSigilBase implements ISentientSwordEffectP
@Override
public boolean applyOnHitEffect(EnumDemonWillType type, ItemStack swordStack, ItemStack providerStack, EntityLivingBase attacker, EntityLivingBase target)
{
target.addPotionEffect(new PotionEffect(MobEffects.levitation, 200, 0));
target.addPotionEffect(new PotionEffect(MobEffects.LEVITATION, 200, 0));
return true;
}

View file

@ -31,7 +31,7 @@ public class ItemSigilBloodLight extends ItemSigilBase
@Override
public ActionResult<ItemStack> onItemRightClick(ItemStack stack, World world, EntityPlayer player, EnumHand hand)
{
RayTraceResult mop = this.getMovingObjectPositionFromPlayer(world, player, false);
RayTraceResult mop = this.rayTrace(world, player, false);
if (getCooldownRemainder(stack) > 0)
return super.onItemRightClick(stack, world, player, hand);

View file

@ -35,7 +35,7 @@ public class ItemSigilDivination extends ItemSigilBase implements IAltarReader
{
super.onItemRightClick(stack, world, player, hand);
RayTraceResult position = getMovingObjectPositionFromPlayer(world, player, false);
RayTraceResult position = rayTrace(world, player, false);
if (position == null)
{

View file

@ -19,7 +19,7 @@ public class ItemSigilElementalAffinity extends ItemSigilToggleableBase
{
player.fallDistance = 0;
player.extinguish();
player.addPotionEffect(new PotionEffect(MobEffects.fireResistance, 2, 1, true, false));
player.addPotionEffect(new PotionEffect(MobEffects.waterBreathing, 2, 0, true, false));
player.addPotionEffect(new PotionEffect(MobEffects.FIRE_RESISTANCE, 2, 1, true, false));
player.addPotionEffect(new PotionEffect(MobEffects.WATER_BREATHING, 2, 0, true, false));
}
}

View file

@ -17,6 +17,6 @@ public class ItemSigilFastMiner extends ItemSigilToggleableBase
@Override
public void onSigilUpdate(ItemStack stack, World world, EntityPlayer player, int itemSlot, boolean isSelected)
{
player.addPotionEffect(new PotionEffect(MobEffects.digSpeed, 2, 0, true, false));
player.addPotionEffect(new PotionEffect(MobEffects.HASTE, 2, 0, true, false));
}
}

View file

@ -31,31 +31,31 @@ public class ItemSigilLava extends ItemSigilBase
{
if (!world.isRemote && !isUnusable(stack))
{
RayTraceResult movingobjectposition = this.getMovingObjectPositionFromPlayer(world, player, false);
RayTraceResult rayTrace = this.rayTrace(world, player, false);
if (movingobjectposition != null)
if (rayTrace != null)
{
ActionResult<ItemStack> ret = ForgeEventFactory.onBucketUse(player, world, stack, movingobjectposition);
ActionResult<ItemStack> ret = ForgeEventFactory.onBucketUse(player, world, stack, rayTrace);
if (ret != null)
return ret;
if (movingobjectposition.typeOfHit == RayTraceResult.Type.BLOCK)
if (rayTrace.typeOfHit == RayTraceResult.Type.BLOCK)
{
BlockPos blockpos = movingobjectposition.getBlockPos();
BlockPos blockpos = rayTrace.getBlockPos();
if (!world.isBlockModifiable(player, blockpos))
{
return super.onItemRightClick(stack, world, player, hand);
}
if (!player.canPlayerEdit(blockpos.offset(movingobjectposition.sideHit), movingobjectposition.sideHit, stack))
if (!player.canPlayerEdit(blockpos.offset(rayTrace.sideHit), rayTrace.sideHit, stack))
{
return super.onItemRightClick(stack, world, player, hand);
}
BlockPos blockpos1 = blockpos.offset(movingobjectposition.sideHit);
BlockPos blockpos1 = blockpos.offset(rayTrace.sideHit);
if (!player.canPlayerEdit(blockpos1, movingobjectposition.sideHit, stack))
if (!player.canPlayerEdit(blockpos1, rayTrace.sideHit, stack))
{
return super.onItemRightClick(stack, world, player, hand);
}
@ -106,12 +106,12 @@ public class ItemSigilLava extends ItemSigilBase
if (!world.isAirBlock(blockPos) && world.getBlockState(blockPos).getBlock().getMaterial(world.getBlockState(blockPos)).isSolid())
{
return false;
} else if ((world.getBlockState(blockPos).getBlock() == Blocks.lava || world.getBlockState(blockPos).getBlock() == Blocks.flowing_lava) && world.getBlockState(blockPos).getBlock().getMetaFromState(world.getBlockState(blockPos)) == 0)
} else if ((world.getBlockState(blockPos).getBlock() == Blocks.LAVA || world.getBlockState(blockPos).getBlock() == Blocks.FLOWING_LAVA) && world.getBlockState(blockPos).getBlock().getMetaFromState(world.getBlockState(blockPos)) == 0)
{
return false;
} else
{
world.setBlockState(blockPos, Blocks.flowing_lava.getBlockState().getBaseState(), 3);
world.setBlockState(blockPos, Blocks.FLOWING_LAVA.getBlockState().getBaseState(), 3);
return true;
}
}

View file

@ -35,9 +35,9 @@ public class ItemSigilSeer extends ItemSigilBase implements IAltarReader
if (!world.isRemote)
{
super.onItemRightClick(stack, world, player, hand);
RayTraceResult position = getMovingObjectPositionFromPlayer(world, player, false);
RayTraceResult rayTrace = rayTrace(world, player, false);
if (position == null)
if (rayTrace == null)
{
int currentEssence = NetworkHelper.getSoulNetwork(getOwnerUUID(stack)).getCurrentEssence();
@ -48,10 +48,10 @@ public class ItemSigilSeer extends ItemSigilBase implements IAltarReader
ChatUtil.sendNoSpam(player, toSend.toArray(new ITextComponent[toSend.size()]));
} else
{
if (position.typeOfHit == RayTraceResult.Type.BLOCK)
if (rayTrace.typeOfHit == RayTraceResult.Type.BLOCK)
{
TileEntity tile = world.getTileEntity(position.getBlockPos());
TileEntity tile = world.getTileEntity(rayTrace.getBlockPos());
if (tile != null && tile instanceof IBloodAltar)
{

View file

@ -29,29 +29,29 @@ public class ItemSigilVoid extends ItemSigilBase
{
if (!world.isRemote && !isUnusable(stack))
{
RayTraceResult movingobjectposition = this.getMovingObjectPositionFromPlayer(world, player, true);
RayTraceResult rayTrace = this.rayTrace(world, player, true);
if (movingobjectposition != null)
if (rayTrace != null)
{
ActionResult<ItemStack> ret = ForgeEventFactory.onBucketUse(player, world, stack, movingobjectposition);
ActionResult<ItemStack> ret = ForgeEventFactory.onBucketUse(player, world, stack, rayTrace);
if (ret != null)
return ret;
if (movingobjectposition.typeOfHit == RayTraceResult.Type.BLOCK)
if (rayTrace.typeOfHit == RayTraceResult.Type.BLOCK)
{
BlockPos blockpos = movingobjectposition.getBlockPos();
BlockPos blockpos = rayTrace.getBlockPos();
if (!world.isBlockModifiable(player, blockpos))
{
return super.onItemRightClick(stack, world, player, hand);
}
if (!player.canPlayerEdit(blockpos.offset(movingobjectposition.sideHit), movingobjectposition.sideHit, stack))
if (!player.canPlayerEdit(blockpos.offset(rayTrace.sideHit), rayTrace.sideHit, stack))
{
return super.onItemRightClick(stack, world, player, hand);
}
if (!player.canPlayerEdit(blockpos, movingobjectposition.sideHit, stack))
if (!player.canPlayerEdit(blockpos, rayTrace.sideHit, stack))
{
return super.onItemRightClick(stack, world, player, hand);
}

View file

@ -34,27 +34,27 @@ public class ItemSigilWater extends ItemSigilBase
{
if (!world.isRemote && !isUnusable(stack))
{
RayTraceResult movingobjectposition = this.getMovingObjectPositionFromPlayer(world, player, false);
RayTraceResult rayTrace = this.rayTrace(world, player, false);
if (movingobjectposition != null)
if (rayTrace != null)
{
ActionResult<ItemStack> ret = net.minecraftforge.event.ForgeEventFactory.onBucketUse(player, world, stack, movingobjectposition);
ActionResult<ItemStack> ret = net.minecraftforge.event.ForgeEventFactory.onBucketUse(player, world, stack, rayTrace);
if (ret != null)
return ret;
if (movingobjectposition.typeOfHit == RayTraceResult.Type.BLOCK)
if (rayTrace.typeOfHit == RayTraceResult.Type.BLOCK)
{
BlockPos blockpos = movingobjectposition.getBlockPos();
BlockPos blockpos = rayTrace.getBlockPos();
if (!world.isBlockModifiable(player, blockpos))
return super.onItemRightClick(stack, world, player, hand);
if (!player.canPlayerEdit(blockpos.offset(movingobjectposition.sideHit), movingobjectposition.sideHit, stack))
if (!player.canPlayerEdit(blockpos.offset(rayTrace.sideHit), rayTrace.sideHit, stack))
return super.onItemRightClick(stack, world, player, hand);
BlockPos blockpos1 = blockpos.offset(movingobjectposition.sideHit);
BlockPos blockpos1 = blockpos.offset(rayTrace.sideHit);
if (!player.canPlayerEdit(blockpos1, movingobjectposition.sideHit, stack))
if (!player.canPlayerEdit(blockpos1, rayTrace.sideHit, stack))
return super.onItemRightClick(stack, world, player, hand);
if (this.canPlaceWater(world, blockpos1) && NetworkHelper.getSoulNetwork(player).syphonAndDamage(player, getLpUsed()) && this.tryPlaceWater(world, blockpos1))
@ -90,9 +90,9 @@ public class ItemSigilWater extends ItemSigilBase
return EnumActionResult.FAIL;
}
if (world.getBlockState(blockPos).getBlock() == Blocks.cauldron && NetworkHelper.getSoulNetwork(player).syphonAndDamage(player, getLpUsed()))
if (world.getBlockState(blockPos).getBlock() == Blocks.CAULDRON && NetworkHelper.getSoulNetwork(player).syphonAndDamage(player, getLpUsed()))
{
world.setBlockState(blockPos, Blocks.cauldron.getDefaultState().withProperty(BlockCauldron.LEVEL, 3));
world.setBlockState(blockPos, Blocks.CAULDRON.getDefaultState().withProperty(BlockCauldron.LEVEL, 3));
return EnumActionResult.SUCCESS;
}
@ -103,7 +103,7 @@ public class ItemSigilWater extends ItemSigilBase
{
if (!world.isAirBlock(blockPos) && world.getBlockState(blockPos).getBlock().getMaterial(world.getBlockState(blockPos)).isSolid())
return false;
else if ((world.getBlockState(blockPos).getBlock() == Blocks.water || world.getBlockState(blockPos).getBlock() == Blocks.flowing_water) && world.getBlockState(blockPos).getBlock().getMetaFromState(world.getBlockState(blockPos)) == 0)
else if ((world.getBlockState(blockPos).getBlock() == Blocks.WATER || world.getBlockState(blockPos).getBlock() == Blocks.FLOWING_WATER) && world.getBlockState(blockPos).getBlock().getMetaFromState(world.getBlockState(blockPos)) == 0)
return false;
else
return true;
@ -125,7 +125,7 @@ public class ItemSigilWater extends ItemSigilBase
int i = pos.getX();
int j = pos.getY();
int k = pos.getZ();
worldIn.playSound((EntityPlayer) null, i, j, k, SoundEvents.block_fire_extinguish, SoundCategory.BLOCKS, 0.5F, 2.6F + (worldIn.rand.nextFloat() - worldIn.rand.nextFloat()) * 0.8F);
worldIn.playSound(null, i, j, k, SoundEvents.BLOCK_FIRE_EXTINGUISH, SoundCategory.BLOCKS, 0.5F, 2.6F + (worldIn.rand.nextFloat() - worldIn.rand.nextFloat()) * 0.8F);
for (int l = 0; l < 8; ++l)
worldIn.spawnParticle(EnumParticleTypes.SMOKE_LARGE, (double) i + Math.random(), (double) j + Math.random(), (double) k + Math.random(), 0.0D, 0.0D, 0.0D, 0);
@ -134,7 +134,7 @@ public class ItemSigilWater extends ItemSigilBase
if (!worldIn.isRemote && notSolid && !material.isLiquid())
worldIn.destroyBlock(pos, true);
worldIn.setBlockState(pos, Blocks.flowing_water.getDefaultState(), 3);
worldIn.setBlockState(pos, Blocks.FLOWING_WATER.getDefaultState(), 3);
}
return true;

View file

@ -211,7 +211,7 @@ public class ItemSentientBow extends ItemBow implements IMultiWillTool//, IMeshP
if (entityLiving instanceof EntityPlayer)
{
EntityPlayer player = (EntityPlayer) entityLiving;
boolean flag = player.capabilities.isCreativeMode || EnchantmentHelper.getEnchantmentLevel(Enchantments.infinity, stack) > 0;
boolean flag = player.capabilities.isCreativeMode || EnchantmentHelper.getEnchantmentLevel(Enchantments.INFINITY, stack) > 0;
ItemStack itemstack = this.getFiredArrow(player);
int i = this.getMaxItemUseDuration(stack) - timeLeft;
@ -223,7 +223,7 @@ public class ItemSentientBow extends ItemBow implements IMultiWillTool//, IMeshP
{
if (itemstack == null)
{
itemstack = new ItemStack(Items.arrow);
itemstack = new ItemStack(Items.ARROW);
}
float arrowVelocity = getArrowVelocity(i);
@ -241,25 +241,25 @@ public class ItemSentientBow extends ItemBow implements IMultiWillTool//, IMeshP
// ItemArrow itemarrow = ((ItemArrow) (itemstack.getItem() instanceof ItemArrow ? itemstack.getItem() : Items.arrow));
// EntityArrow entityArrow = itemarrow.createArrow(world, itemstack, player);
EntityArrow entityArrow = new EntitySentientArrow(world, entityLiving, type);
entityArrow.func_184547_a(player, player.rotationPitch, player.rotationYaw, 0.0F, arrowVelocity * getVelocityOfArrow(stack), 1.0F);
entityArrow.setAim(player, player.rotationPitch, player.rotationYaw, 0.0F, arrowVelocity * getVelocityOfArrow(stack), 1.0F);
if (arrowVelocity == 1.0F)
{
entityArrow.setIsCritical(true);
}
int j = EnchantmentHelper.getEnchantmentLevel(Enchantments.power, stack);
int j = EnchantmentHelper.getEnchantmentLevel(Enchantments.POWER, stack);
entityArrow.setDamage(entityArrow.getDamage() + this.getDamageAdded(stack) + (j > 0 ? j * 0.5 + 0.5 : 0));
int k = EnchantmentHelper.getEnchantmentLevel(Enchantments.punch, stack);
int k = EnchantmentHelper.getEnchantmentLevel(Enchantments.PUNCH, stack);
if (k > 0)
{
entityArrow.setKnockbackStrength(k);
}
if (EnchantmentHelper.getEnchantmentLevel(Enchantments.flame, stack) > 0)
if (EnchantmentHelper.getEnchantmentLevel(Enchantments.FLAME, stack) > 0)
{
entityArrow.setFire(100);
}
@ -268,13 +268,13 @@ public class ItemSentientBow extends ItemBow implements IMultiWillTool//, IMeshP
if (flag1)
{
entityArrow.canBePickedUp = EntityArrow.PickupStatus.CREATIVE_ONLY;
entityArrow.pickupStatus = EntityArrow.PickupStatus.CREATIVE_ONLY;
}
world.spawnEntityInWorld(entityArrow);
}
world.playSound(null, player.posX, player.posY, player.posZ, SoundEvents.entity_arrow_shoot, SoundCategory.NEUTRAL, 1.0F, 1.0F / (itemRand.nextFloat() * 0.4F + 1.2F) + arrowVelocity * 0.5F);
world.playSound(null, player.posX, player.posY, player.posZ, SoundEvents.ENTITY_ARROW_SHOOT, SoundCategory.NEUTRAL, 1.0F, 1.0F / (itemRand.nextFloat() * 0.4F + 1.2F) + arrowVelocity * 0.5F);
if (!flag1)
{

View file

@ -158,7 +158,7 @@ public class ItemSentientSword extends ItemSword implements IDemonWillWeapon, IM
switch (type)
{
case CORROSIVE:
target.addPotionEffect(new PotionEffect(MobEffects.wither, poisonTime[willBracket], poisonLevel[willBracket]));
target.addPotionEffect(new PotionEffect(MobEffects.WITHER, poisonTime[willBracket], poisonLevel[willBracket]));
break;
case DEFAULT:
break;
@ -168,7 +168,7 @@ public class ItemSentientSword extends ItemSword implements IDemonWillWeapon, IM
if (!target.isEntityAlive())
{
float absorption = attacker.getAbsorptionAmount();
attacker.addPotionEffect(new PotionEffect(MobEffects.absorption, absorptionTime[willBracket]));
attacker.addPotionEffect(new PotionEffect(MobEffects.ABSORPTION, absorptionTime[willBracket]));
attacker.setAbsorptionAmount((float) Math.min(absorption + target.getMaxHealth() * 0.05f, maxAbsorptionHearts));
}
break;

View file

@ -47,12 +47,12 @@ public class ItemSoulSnare extends Item implements IVariantProvider
--itemStackIn.stackSize;
}
worldIn.playSound((EntityPlayer) null, playerIn.posX, playerIn.posY, playerIn.posZ, SoundEvents.entity_snowball_throw, SoundCategory.NEUTRAL, 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));
worldIn.playSound((EntityPlayer) null, playerIn.posX, playerIn.posY, playerIn.posZ, SoundEvents.ENTITY_SNOWBALL_THROW, SoundCategory.NEUTRAL, 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));
if (!worldIn.isRemote)
{
EntitySoulSnare snare = new EntitySoulSnare(worldIn, playerIn);
snare.func_184538_a(playerIn, playerIn.rotationPitch, playerIn.rotationYaw, 0.0F, 1.5F, 1.0F);
snare.setHeadingFromThrower(playerIn, playerIn.rotationPitch, playerIn.rotationYaw, 0.0F, 1.5F, 1.0F);
worldIn.spawnEntityInWorld(snare);
}