Reformatting with Vindex's magic

This commit is contained in:
WayofTime 2015-12-31 13:50:38 -05:00
parent 67a9d5c1e9
commit e8d1ff4997
18 changed files with 421 additions and 414 deletions

View file

@ -37,13 +37,13 @@ public class ItemBindable extends Item implements IBindable
public static boolean syphonNetwork(ItemStack stack, EntityPlayer player, int lpUsed)
{
if (player == null) return false;
if (player == null)
return false;
if (!player.worldObj.isRemote)
{
return NetworkHelper.syphonAndDamage(NetworkHelper.getSoulNetwork(player, player.worldObj), lpUsed);
}
else
} else
{
double posX = player.posX;
double posY = player.posY;
@ -77,10 +77,10 @@ public class ItemBindable extends Item implements IBindable
user.attackEntityFrom(BloodMagicAPI.getDamageSource(), 0F); // Emulate an attack
user.setHealth(user.getHealth() - 1);
if (user.getHealth() <= 0.0005f) user.onDeath(BloodMagicAPI.getDamageSource());
if (user.getHealth() <= 0.0005f)
user.onDeath(BloodMagicAPI.getDamageSource());
}
}
else if (lpSyphoned >= 100)
} else if (lpSyphoned >= 100)
{
if (!user.capabilities.isCreativeMode)
{

View file

@ -78,7 +78,8 @@ public class ItemBoundTool extends ItemBindable
// if (!world.isRemote)
{
if (player.isSneaking()) setActivated(stack, !getActivated(stack));
if (player.isSneaking())
setActivated(stack, !getActivated(stack));
// if (getActivated(stack) && ItemBindable.syphonBatteries(stack,
// player, getLPUsed()))
// return stack;
@ -88,7 +89,8 @@ public class ItemBoundTool extends ItemBindable
if (!player.isSneaking() && getActivated(stack))
{
BoundToolEvent.Charge event = new BoundToolEvent.Charge(player, stack);
if (MinecraftForge.EVENT_BUS.post(event)) return event.result;
if (MinecraftForge.EVENT_BUS.post(event))
return event.result;
player.setItemInUse(stack, this.getMaxItemUseDuration(stack));
beingHeldDown = true;
@ -122,7 +124,8 @@ public class ItemBoundTool extends ItemBindable
{
int i = this.getMaxItemUseDuration(stack) - timeLeft;
BoundToolEvent.Release event = new BoundToolEvent.Release(playerIn, stack, i);
if (MinecraftForge.EVENT_BUS.post(event)) return;
if (MinecraftForge.EVENT_BUS.post(event))
return;
i = event.charge;
@ -167,8 +170,10 @@ public class ItemBoundTool extends ItemBindable
if (StatCollector.canTranslate(tooltipBase + "desc"))
tooltip.add(TextHelper.localizeEffect(tooltipBase + "desc"));
if (getActivated(stack)) tooltip.add(TextHelper.localize("tooltip.BloodMagic.activated"));
else tooltip.add(TextHelper.localize("tooltip.BloodMagic.deactivated"));
if (getActivated(stack))
tooltip.add(TextHelper.localize("tooltip.BloodMagic.activated"));
else
tooltip.add(TextHelper.localize("tooltip.BloodMagic.deactivated"));
super.addInformation(stack, player, tooltip, advanced);
}

View file

@ -49,16 +49,17 @@ public class ItemLavaCrystal extends ItemBindable implements IFuelHandler
if (syphonNetwork(fuel, getLPUsed()))
{
return 1;
}
else
} else
{
NBTTagCompound tag = fuel.getTagCompound();
if (tag == null || MinecraftServer.getServer() == null || MinecraftServer.getServer().getConfigurationManager() == null)
return 0;
if (Strings.isNullOrEmpty(((ItemLavaCrystal) fuelItem).getBindableOwner(fuel))) return 0;
else hurtPlayer(PlayerHelper.getPlayerFromUUID(getBindableOwner(fuel)), getLPUsed());
if (Strings.isNullOrEmpty(((ItemLavaCrystal) fuelItem).getBindableOwner(fuel)))
return 0;
else
hurtPlayer(PlayerHelper.getPlayerFromUUID(getBindableOwner(fuel)), getLPUsed());
return 0;
}

View file

@ -30,7 +30,8 @@ public class ItemSigilBloodLight extends ItemSigilBase
@Override
public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, BlockPos blockPos, EnumFacing side, float hitX, float hitY, float hitZ)
{
if (world.isRemote) return false;
if (world.isRemote)
return false;
if (BindableHelper.checkAndSetItemOwner(stack, player) && ItemBindable.syphonNetwork(stack, player, getLPUsed()))
{

View file

@ -32,7 +32,8 @@ public class ItemSigilLava extends ItemSigilBase
if (movingobjectposition != null)
{
ItemStack ret = net.minecraftforge.event.ForgeEventFactory.onBucketUse(player, world, stack, movingobjectposition);
if (ret != null) return ret;
if (ret != null)
return ret;
if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK)
{
@ -118,12 +119,10 @@ public class ItemSigilLava extends ItemSigilBase
if (!world.isAirBlock(blockPos) && world.getBlockState(blockPos).getBlock().getMaterial().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
} else
{
world.setBlockState(blockPos, Blocks.lava.getBlockState().getBaseState(), 3);
return true;

View file

@ -29,8 +29,10 @@ public class ItemSigilToggleable extends ItemSigilBase
public void addInformation(ItemStack stack, EntityPlayer player, List<String> tooltip, boolean advanced)
{
super.addInformation(stack, player, tooltip, advanced);
if (getActivated(stack)) tooltip.add(TextHelper.localize("tooltip.BloodMagic.activated"));
else tooltip.add(TextHelper.localize("tooltip.BloodMagic.deactivated"));
if (getActivated(stack))
tooltip.add(TextHelper.localize("tooltip.BloodMagic.activated"));
else
tooltip.add(TextHelper.localize("tooltip.BloodMagic.deactivated"));
}
@Override
@ -38,8 +40,10 @@ public class ItemSigilToggleable extends ItemSigilBase
{
if (!world.isRemote && !isUnusable(stack))
{
if (player.isSneaking()) setActivated(stack, !getActivated(stack));
if (getActivated(stack) && ItemBindable.syphonNetwork(stack, player, getLPUsed())) return stack;
if (player.isSneaking())
setActivated(stack, !getActivated(stack));
if (getActivated(stack) && ItemBindable.syphonNetwork(stack, player, getLPUsed()))
return stack;
}
return stack;

View file

@ -29,7 +29,8 @@ public class ItemSigilVoid extends ItemSigilBase
if (movingobjectposition != null)
{
ItemStack ret = net.minecraftforge.event.ForgeEventFactory.onBucketUse(player, world, stack, movingobjectposition);
if (ret != null) return ret;
if (ret != null)
return ret;
if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK)
{
@ -56,8 +57,7 @@ public class ItemSigilVoid extends ItemSigilBase
return stack;
}
}
}
else
} else
{
return stack;
}

View file

@ -32,7 +32,8 @@ public class ItemSigilWater extends ItemSigilBase
if (movingobjectposition != null)
{
ItemStack ret = net.minecraftforge.event.ForgeEventFactory.onBucketUse(player, world, stack, movingobjectposition);
if (ret != null) return ret;
if (ret != null)
return ret;
if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK)
{
@ -119,12 +120,10 @@ public class ItemSigilWater extends ItemSigilBase
if (!world.isAirBlock(blockPos) && world.getBlockState(blockPos).getBlock().getMaterial().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
} else
{
return true;
}
@ -139,8 +138,7 @@ public class ItemSigilWater extends ItemSigilBase
if (!worldIn.isAirBlock(pos) && !flag)
{
return false;
}
else
} else
{
if (worldIn.provider.doesWaterVaporize())
{
@ -153,8 +151,7 @@ public class ItemSigilWater extends ItemSigilBase
{
worldIn.spawnParticle(EnumParticleTypes.SMOKE_LARGE, (double) i + Math.random(), (double) j + Math.random(), (double) k + Math.random(), 0.0D, 0.0D, 0.0D, 0);
}
}
else
} else
{
if (!worldIn.isRemote && flag && !material.isLiquid())
{

View file

@ -43,7 +43,7 @@ public class RitualGreenGrove extends Ritual
AreaDescriptor growingRange = getBlockRange(GROW_RANGE);
for(BlockPos newPos : growingRange.getContainedPositions(masterRitualStone.getPos()))
for (BlockPos newPos : growingRange.getContainedPositions(masterRitualStone.getPos()))
{
IBlockState state = world.getBlockState(newPos);
Block block = state.getBlock();