Recipes commit
Fix
This commit is contained in:
parent
e48eedb874
commit
07097c00a9
16 changed files with 213 additions and 112 deletions
|
@ -25,7 +25,6 @@ import java.util.List;
|
|||
|
||||
public class ItemBindable extends Item implements IBindable
|
||||
{
|
||||
|
||||
private int lpUsed;
|
||||
|
||||
public ItemBindable()
|
||||
|
@ -36,54 +35,65 @@ public class ItemBindable extends Item implements IBindable
|
|||
setMaxStackSize(1);
|
||||
}
|
||||
|
||||
public static boolean syphonBatteries(ItemStack stack, EntityPlayer player, int damageToBeDone)
|
||||
public static boolean syphonNetwork(ItemStack stack, EntityPlayer player, int lpUsed)
|
||||
{
|
||||
if (player == null) return false;
|
||||
|
||||
if (!player.worldObj.isRemote)
|
||||
{
|
||||
return NetworkHelper.syphonAndDamage(NetworkHelper.getSoulNetwork(player, player.worldObj), damageToBeDone);
|
||||
} else
|
||||
return NetworkHelper.syphonAndDamage(NetworkHelper.getSoulNetwork(player, player.worldObj), lpUsed);
|
||||
}
|
||||
else
|
||||
{
|
||||
double posX = player.posX;
|
||||
double posY = player.posY;
|
||||
double posZ = player.posZ;
|
||||
|
||||
// SpellHelper.sendIndexedParticleToAllAround(player.worldObj, posX,
|
||||
// posY, posZ, 20, player.worldObj.provider.getDimensionId(), 4,
|
||||
// posX, posY, posZ);
|
||||
// SpellHelper.sendIndexedParticleToAllAround(player.worldObj, posX,posY, posZ, 20, player.worldObj.provider.getDimensionId(), 4, posX, posY, posZ);
|
||||
player.worldObj.playSoundEffect((double) ((float) player.posX + 0.5F), (double) ((float) player.posY + 0.5F), (double) ((float) player.posZ + 0.5F), "random.fizz", 0.5F, 2.6F + (player.worldObj.rand.nextFloat() - player.worldObj.rand.nextFloat()) * 0.8F);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public static void hurtPlayer(EntityPlayer user, int energySyphoned)
|
||||
public static boolean syphonNetwork(ItemStack itemStack, int lpUsed)
|
||||
{
|
||||
if (energySyphoned < 100 && energySyphoned > 0)
|
||||
if (itemStack.getItem() instanceof ItemBindable)
|
||||
{
|
||||
if (!user.capabilities.isCreativeMode)
|
||||
{
|
||||
user.attackEntityFrom(BloodMagicAPI.getDamageSource(), 0F); // Emulate
|
||||
// an
|
||||
// attack
|
||||
user.setHealth(user.getHealth() - 1);
|
||||
ItemBindable itemBindable = (ItemBindable) itemStack.getItem();
|
||||
return !Strings.isNullOrEmpty(itemBindable.getBindableOwner(itemStack)) && syphonNetwork(itemStack, PlayerHelper.getPlayerFromUUID(itemBindable.getBindableOwner(itemStack)), lpUsed);
|
||||
}
|
||||
|
||||
if (user.getHealth() <= 0.0005f)
|
||||
user.onDeath(BloodMagicAPI.getDamageSource());
|
||||
}
|
||||
} else if (energySyphoned >= 100)
|
||||
return false;
|
||||
}
|
||||
|
||||
public static void hurtPlayer(EntityPlayer user, int lpSyphoned)
|
||||
{
|
||||
if (user != null)
|
||||
{
|
||||
if (!user.capabilities.isCreativeMode)
|
||||
if (lpSyphoned < 100 && lpSyphoned > 0)
|
||||
{
|
||||
for (int i = 0; i < ((energySyphoned + 99) / 100); i++)
|
||||
if (!user.capabilities.isCreativeMode)
|
||||
{
|
||||
user.attackEntityFrom(BloodMagicAPI.getDamageSource(), 0F); // Emulate
|
||||
// an
|
||||
// attack
|
||||
user.attackEntityFrom(BloodMagicAPI.getDamageSource(), 0F); // Emulate an attack
|
||||
user.setHealth(user.getHealth() - 1);
|
||||
|
||||
if (user.getHealth() <= 0.0005f)
|
||||
if (user.getHealth() <= 0.0005f) user.onDeath(BloodMagicAPI.getDamageSource());
|
||||
}
|
||||
}
|
||||
else if (lpSyphoned >= 100)
|
||||
{
|
||||
if (!user.capabilities.isCreativeMode)
|
||||
{
|
||||
for (int i = 0; i < ((lpSyphoned + 99) / 100); i++)
|
||||
{
|
||||
user.onDeath(BloodMagicAPI.getDamageSource());
|
||||
break;
|
||||
user.attackEntityFrom(BloodMagicAPI.getDamageSource(), 0F); // Emulate an attack
|
||||
user.setHealth(user.getHealth() - 1);
|
||||
|
||||
if (user.getHealth() <= 0.0005f)
|
||||
{
|
||||
user.onDeath(BloodMagicAPI.getDamageSource());
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -134,8 +144,8 @@ public class ItemBindable extends Item implements IBindable
|
|||
for (int i = 0; i < damage; i++)
|
||||
{
|
||||
player.attackEntityFrom(BloodMagicAPI.getDamageSource(), 0F); // Emulate
|
||||
// an
|
||||
// attack
|
||||
// an
|
||||
// attack
|
||||
player.setHealth(player.getHealth() - 1);
|
||||
|
||||
if (player.getHealth() <= 0.0005)
|
||||
|
|
|
@ -27,7 +27,6 @@ import java.util.List;
|
|||
|
||||
public class ItemBoundSword extends ItemSword
|
||||
{
|
||||
|
||||
private int lpUsed;
|
||||
|
||||
public ItemBoundSword()
|
||||
|
@ -73,7 +72,7 @@ public class ItemBoundSword extends ItemSword
|
|||
{
|
||||
if (player.isSneaking())
|
||||
setActivated(stack, !getActivated(stack));
|
||||
if (getActivated(stack) && ItemBindable.syphonBatteries(stack, player, lpUsed))
|
||||
if (getActivated(stack) && ItemBindable.syphonNetwork(stack, player, lpUsed))
|
||||
return stack;
|
||||
|
||||
if (!player.isSneaking() && getActivated(stack))
|
||||
|
|
|
@ -27,7 +27,6 @@ import java.util.Set;
|
|||
@Getter
|
||||
public class ItemBoundTool extends ItemBindable
|
||||
{
|
||||
|
||||
private Set<Block> effectiveBlocks;
|
||||
protected final String tooltipBase;
|
||||
private final String name;
|
||||
|
@ -79,17 +78,17 @@ 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;
|
||||
// if (getActivated(stack) && ItemBindable.syphonNetwork(stack, player, getLPUsed()))
|
||||
// return stack;
|
||||
|
||||
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;
|
||||
|
@ -102,7 +101,7 @@ public class ItemBoundTool extends ItemBindable
|
|||
@Override
|
||||
public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, BlockPos blockPos, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
if (BindableHelper.checkAndSetItemOwner(stack, player) && ItemBindable.syphonBatteries(stack, player, getLPUsed()))
|
||||
if (BindableHelper.checkAndSetItemOwner(stack, player) && ItemBindable.syphonNetwork(stack, player, getLPUsed()))
|
||||
return false;
|
||||
|
||||
return false;
|
||||
|
@ -123,8 +122,7 @@ 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;
|
||||
|
||||
|
@ -169,10 +167,8 @@ 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);
|
||||
}
|
||||
|
|
69
src/main/java/WayofTime/bloodmagic/item/ItemLavaCrystal.java
Normal file
69
src/main/java/WayofTime/bloodmagic/item/ItemLavaCrystal.java
Normal file
|
@ -0,0 +1,69 @@
|
|||
package WayofTime.bloodmagic.item;
|
||||
|
||||
import WayofTime.bloodmagic.api.Constants;
|
||||
import WayofTime.bloodmagic.api.util.helper.PlayerHelper;
|
||||
import com.google.common.base.Strings;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraftforge.fml.common.IFuelHandler;
|
||||
|
||||
public class ItemLavaCrystal extends ItemBindable implements IFuelHandler
|
||||
{
|
||||
public ItemLavaCrystal()
|
||||
{
|
||||
super();
|
||||
setUnlocalizedName(Constants.Mod.MODID + ".lavaCrystal");
|
||||
setLPUsed(1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getContainerItem(ItemStack itemStack)
|
||||
{
|
||||
syphonNetwork(itemStack, getLPUsed());
|
||||
ItemStack copiedStack = itemStack.copy();
|
||||
copiedStack.setItemDamage(copiedStack.getItemDamage());
|
||||
copiedStack.stackSize = 1;
|
||||
return copiedStack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasContainerItem(ItemStack itemStack)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getBurnTime(ItemStack fuel)
|
||||
{
|
||||
if (fuel == null)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
Item fuelItem = fuel.getItem();
|
||||
|
||||
if (fuelItem instanceof ItemLavaCrystal)
|
||||
{
|
||||
if (syphonNetwork(fuel, getLPUsed()))
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
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());
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
|
@ -18,7 +18,6 @@ import java.util.List;
|
|||
|
||||
public class ItemPackSacrifice extends ItemArmor implements IAltarManipulator
|
||||
{
|
||||
|
||||
public final int CONVERSION = 100; // How much LP per heart
|
||||
public final int CAPACITY = 10000; // Max LP storage
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ public class ItemSigilAir extends ItemSigilBase
|
|||
player.fallDistance = 0;
|
||||
|
||||
if (!player.capabilities.isCreativeMode)
|
||||
this.setUnusable(stack, !syphonBatteries(stack, player, getLPUsed()));
|
||||
this.setUnusable(stack, !syphonNetwork(stack, player, getLPUsed()));
|
||||
}
|
||||
|
||||
return super.onItemRightClick(stack, world, player);
|
||||
|
|
|
@ -21,7 +21,7 @@ public class ItemSigilBloodLight extends ItemSigilBase
|
|||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player)
|
||||
{
|
||||
if (BindableHelper.checkAndSetItemOwner(stack, player) && ItemBindable.syphonBatteries(stack, player, getLPUsed() * 5) && !world.isRemote)
|
||||
if (BindableHelper.checkAndSetItemOwner(stack, player) && ItemBindable.syphonNetwork(stack, player, getLPUsed() * 5) && !world.isRemote)
|
||||
world.spawnEntityInWorld(new EntityBloodLight(world, player));
|
||||
|
||||
return stack;
|
||||
|
@ -30,10 +30,9 @@ 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.syphonBatteries(stack, player, getLPUsed()))
|
||||
if (BindableHelper.checkAndSetItemOwner(stack, player) && ItemBindable.syphonNetwork(stack, player, getLPUsed()))
|
||||
{
|
||||
BlockPos newPos = blockPos.offset(side);
|
||||
|
||||
|
|
|
@ -32,8 +32,7 @@ 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)
|
||||
{
|
||||
|
@ -56,7 +55,7 @@ public class ItemSigilLava extends ItemSigilBase
|
|||
return stack;
|
||||
}
|
||||
|
||||
if (this.canPlaceLava(world, blockpos1) && syphonBatteries(stack, player, getLPUsed()) && this.tryPlaceLava(world, blockpos1))
|
||||
if (this.canPlaceLava(world, blockpos1) && syphonNetwork(stack, player, getLPUsed()) && this.tryPlaceLava(world, blockpos1))
|
||||
{
|
||||
return stack;
|
||||
}
|
||||
|
@ -64,7 +63,7 @@ public class ItemSigilLava extends ItemSigilBase
|
|||
}
|
||||
|
||||
if (!player.capabilities.isCreativeMode)
|
||||
this.setUnusable(stack, !syphonBatteries(stack, player, getLPUsed()));
|
||||
this.setUnusable(stack, !syphonNetwork(stack, player, getLPUsed()));
|
||||
}
|
||||
|
||||
return stack;
|
||||
|
@ -88,7 +87,7 @@ public class ItemSigilLava extends ItemSigilBase
|
|||
FluidStack fluid = new FluidStack(FluidRegistry.LAVA, 1000);
|
||||
int amount = ((IFluidHandler) tile).fill(side, fluid, false);
|
||||
|
||||
if (amount > 0 && syphonBatteries(stack, player, getLPUsed()))
|
||||
if (amount > 0 && syphonNetwork(stack, player, getLPUsed()))
|
||||
{
|
||||
((IFluidHandler) tile).fill(side, fluid, true);
|
||||
}
|
||||
|
@ -106,7 +105,7 @@ public class ItemSigilLava extends ItemSigilBase
|
|||
return false;
|
||||
}
|
||||
|
||||
if (this.canPlaceLava(world, newPos) && syphonBatteries(stack, player, getLPUsed()))
|
||||
if (this.canPlaceLava(world, newPos) && syphonNetwork(stack, player, getLPUsed()))
|
||||
{
|
||||
return this.tryPlaceLava(world, newPos);
|
||||
}
|
||||
|
@ -119,10 +118,12 @@ 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;
|
||||
|
|
|
@ -29,10 +29,8 @@ 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
|
||||
|
@ -40,10 +38,8 @@ public class ItemSigilToggleable extends ItemSigilBase
|
|||
{
|
||||
if (!world.isRemote && !isUnusable(stack))
|
||||
{
|
||||
if (player.isSneaking())
|
||||
setActivated(stack, !getActivated(stack));
|
||||
if (getActivated(stack) && ItemBindable.syphonBatteries(stack, player, getLPUsed()))
|
||||
return stack;
|
||||
if (player.isSneaking()) setActivated(stack, !getActivated(stack));
|
||||
if (getActivated(stack) && ItemBindable.syphonNetwork(stack, player, getLPUsed())) return stack;
|
||||
}
|
||||
|
||||
return stack;
|
||||
|
@ -52,7 +48,7 @@ public class ItemSigilToggleable extends ItemSigilBase
|
|||
@Override
|
||||
public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, BlockPos blockPos, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
if (BindableHelper.checkAndSetItemOwner(stack, player) && ItemBindable.syphonBatteries(stack, player, getLPUsed()))
|
||||
if (BindableHelper.checkAndSetItemOwner(stack, player) && ItemBindable.syphonNetwork(stack, player, getLPUsed()))
|
||||
return onSigilUseFirst(stack, player, world, blockPos, side, hitX, hitY, hitZ);
|
||||
|
||||
return false;
|
||||
|
@ -70,7 +66,7 @@ public class ItemSigilToggleable extends ItemSigilBase
|
|||
{
|
||||
if (worldIn.getWorldTime() % 100 == 0)
|
||||
{
|
||||
if (!ItemBindable.syphonBatteries(stack, (EntityPlayer) entityIn, getLPUsed()))
|
||||
if (!ItemBindable.syphonNetwork(stack, (EntityPlayer) entityIn, getLPUsed()))
|
||||
{
|
||||
setActivated(stack, false);
|
||||
}
|
||||
|
|
|
@ -14,7 +14,6 @@ import net.minecraftforge.fluids.IFluidHandler;
|
|||
|
||||
public class ItemSigilVoid extends ItemSigilBase
|
||||
{
|
||||
|
||||
public ItemSigilVoid()
|
||||
{
|
||||
super("void", 50);
|
||||
|
@ -30,8 +29,7 @@ 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)
|
||||
{
|
||||
|
@ -52,19 +50,20 @@ public class ItemSigilVoid extends ItemSigilBase
|
|||
return stack;
|
||||
}
|
||||
|
||||
if (world.getBlockState(blockpos).getBlock().getMaterial().isLiquid() && syphonBatteries(stack, player, getLPUsed()))
|
||||
if (world.getBlockState(blockpos).getBlock().getMaterial().isLiquid() && syphonNetwork(stack, player, getLPUsed()))
|
||||
{
|
||||
world.setBlockToAir(blockpos);
|
||||
return stack;
|
||||
}
|
||||
}
|
||||
} else
|
||||
}
|
||||
else
|
||||
{
|
||||
return stack;
|
||||
}
|
||||
|
||||
if (!player.capabilities.isCreativeMode)
|
||||
this.setUnusable(stack, !syphonBatteries(stack, player, getLPUsed()));
|
||||
this.setUnusable(stack, !syphonNetwork(stack, player, getLPUsed()));
|
||||
}
|
||||
|
||||
return stack;
|
||||
|
@ -88,7 +87,7 @@ public class ItemSigilVoid extends ItemSigilBase
|
|||
{
|
||||
FluidStack amount = ((IFluidHandler) tile).drain(side, 1000, false);
|
||||
|
||||
if (amount != null && amount.amount > 0 && syphonBatteries(stack, player, getLPUsed()))
|
||||
if (amount != null && amount.amount > 0 && syphonNetwork(stack, player, getLPUsed()))
|
||||
{
|
||||
((IFluidHandler) tile).drain(side, 1000, true);
|
||||
return true;
|
||||
|
@ -104,7 +103,7 @@ public class ItemSigilVoid extends ItemSigilBase
|
|||
return false;
|
||||
}
|
||||
|
||||
if (world.getBlockState(newPos).getBlock() instanceof IFluidBlock && syphonBatteries(stack, player, getLPUsed()))
|
||||
if (world.getBlockState(newPos).getBlock() instanceof IFluidBlock && syphonNetwork(stack, player, getLPUsed()))
|
||||
{
|
||||
world.setBlockToAir(newPos);
|
||||
return true;
|
||||
|
|
|
@ -17,7 +17,6 @@ import net.minecraftforge.fluids.IFluidHandler;
|
|||
|
||||
public class ItemSigilWater extends ItemSigilBase
|
||||
{
|
||||
|
||||
public ItemSigilWater()
|
||||
{
|
||||
super("water", 100);
|
||||
|
@ -33,8 +32,7 @@ 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)
|
||||
{
|
||||
|
@ -57,7 +55,7 @@ public class ItemSigilWater extends ItemSigilBase
|
|||
return stack;
|
||||
}
|
||||
|
||||
if (this.canPlaceWater(world, blockpos1) && syphonBatteries(stack, player, getLPUsed()) && this.tryPlaceWater(world, blockpos1))
|
||||
if (this.canPlaceWater(world, blockpos1) && syphonNetwork(stack, player, getLPUsed()) && this.tryPlaceWater(world, blockpos1))
|
||||
{
|
||||
return stack;
|
||||
}
|
||||
|
@ -65,7 +63,7 @@ public class ItemSigilWater extends ItemSigilBase
|
|||
}
|
||||
|
||||
if (!player.capabilities.isCreativeMode)
|
||||
this.setUnusable(stack, !syphonBatteries(stack, player, getLPUsed()));
|
||||
this.setUnusable(stack, !syphonNetwork(stack, player, getLPUsed()));
|
||||
}
|
||||
|
||||
return stack;
|
||||
|
@ -90,7 +88,7 @@ public class ItemSigilWater extends ItemSigilBase
|
|||
FluidStack fluid = new FluidStack(FluidRegistry.WATER, 1000);
|
||||
int amount = ((IFluidHandler) tile).fill(side, fluid, false);
|
||||
|
||||
if (amount > 0 && syphonBatteries(stack, player, getLPUsed()))
|
||||
if (amount > 0 && syphonNetwork(stack, player, getLPUsed()))
|
||||
{
|
||||
((IFluidHandler) tile).fill(side, fluid, true);
|
||||
}
|
||||
|
@ -108,7 +106,7 @@ public class ItemSigilWater extends ItemSigilBase
|
|||
return false;
|
||||
}
|
||||
|
||||
if (this.canPlaceWater(world, newPos) && syphonBatteries(stack, player, getLPUsed()))
|
||||
if (this.canPlaceWater(world, newPos) && syphonNetwork(stack, player, getLPUsed()))
|
||||
{
|
||||
return this.tryPlaceWater(world, newPos);
|
||||
}
|
||||
|
@ -121,10 +119,12 @@ 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,7 +139,8 @@ public class ItemSigilWater extends ItemSigilBase
|
|||
if (!worldIn.isAirBlock(pos) && !flag)
|
||||
{
|
||||
return false;
|
||||
} else
|
||||
}
|
||||
else
|
||||
{
|
||||
if (worldIn.provider.doesWaterVaporize())
|
||||
{
|
||||
|
@ -152,7 +153,8 @@ 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())
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue