More error fixes (down to 381)
This commit is contained in:
parent
7706d0667a
commit
09168fa386
11 changed files with 206 additions and 134 deletions
|
@ -1,10 +1,14 @@
|
|||
package WayofTime.bloodmagic.item.sigil;
|
||||
|
||||
import WayofTime.bloodmagic.api.Constants;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.SoundEvents;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.SoundCategory;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.bloodmagic.api.Constants;
|
||||
|
||||
public class ItemSigilAir extends ItemSigilBase
|
||||
{
|
||||
|
@ -15,11 +19,11 @@ public class ItemSigilAir extends ItemSigilBase
|
|||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player)
|
||||
public ActionResult<ItemStack> onItemRightClick(ItemStack stack, World world, EntityPlayer player, EnumHand hand)
|
||||
{
|
||||
if (!world.isRemote && !isUnusable(stack))
|
||||
{
|
||||
Vec3 vec = player.getLookVec();
|
||||
Vec3d vec = player.getLookVec();
|
||||
double wantedVelocity = 1.7;
|
||||
|
||||
// TODO - Revisit after potions
|
||||
|
@ -33,13 +37,14 @@ public class ItemSigilAir extends ItemSigilBase
|
|||
player.motionY = vec.yCoord * wantedVelocity;
|
||||
player.motionZ = vec.zCoord * wantedVelocity;
|
||||
player.velocityChanged = true;
|
||||
world.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 + (world.rand.nextFloat() - world.rand.nextFloat()) * 0.8F);
|
||||
world.playSound((EntityPlayer) 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;
|
||||
|
||||
if (!player.capabilities.isCreativeMode)
|
||||
this.setUnusable(stack, !syphonNetwork(stack, player, getLPUsed()));
|
||||
}
|
||||
|
||||
return super.onItemRightClick(stack, world, player);
|
||||
return super.onItemRightClick(stack, world, player, hand);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,24 +1,27 @@
|
|||
package WayofTime.bloodmagic.item.sigil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Getter;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import org.apache.commons.lang3.tuple.ImmutablePair;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
import WayofTime.bloodmagic.api.Constants;
|
||||
import WayofTime.bloodmagic.api.iface.ISigil;
|
||||
import WayofTime.bloodmagic.api.util.helper.NBTHelper;
|
||||
import WayofTime.bloodmagic.client.IVariantProvider;
|
||||
import WayofTime.bloodmagic.item.ItemBindable;
|
||||
import WayofTime.bloodmagic.util.helper.TextHelper;
|
||||
import lombok.Getter;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import org.apache.commons.lang3.tuple.ImmutablePair;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
@Getter
|
||||
public class ItemSigilBase extends ItemBindable implements ISigil, IVariantProvider
|
||||
|
@ -44,19 +47,17 @@ public class ItemSigilBase extends ItemBindable implements ISigil, IVariantProvi
|
|||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player)
|
||||
public ActionResult<ItemStack> onItemRightClick(ItemStack stack, World world, EntityPlayer player, EnumHand hand)
|
||||
{
|
||||
super.onItemRightClick(stack, world, player);
|
||||
|
||||
return stack;
|
||||
return super.onItemRightClick(stack, world, player, hand);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List<String> tooltip, boolean advanced)
|
||||
{
|
||||
if (StatCollector.canTranslate(tooltipBase + "desc"))
|
||||
tooltip.addAll(Arrays.asList(TextHelper.cutLongString(TextHelper.localizeEffect(tooltipBase + "desc"))));
|
||||
// if (StatCollector.canTranslate(tooltipBase + "desc"))
|
||||
tooltip.addAll(Arrays.asList(TextHelper.cutLongString(TextHelper.localizeEffect(tooltipBase + "desc"))));
|
||||
|
||||
super.addInformation(stack, player, tooltip, advanced);
|
||||
}
|
||||
|
|
|
@ -1,16 +1,18 @@
|
|||
package WayofTime.bloodmagic.item.sigil;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.RayTraceResult;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.bloodmagic.api.Constants;
|
||||
import WayofTime.bloodmagic.api.util.helper.NBTHelper;
|
||||
import WayofTime.bloodmagic.api.util.helper.NetworkHelper;
|
||||
import WayofTime.bloodmagic.entity.projectile.EntityBloodLight;
|
||||
import WayofTime.bloodmagic.registry.ModBlocks;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class ItemSigilBloodLight extends ItemSigilBase
|
||||
{
|
||||
|
@ -28,14 +30,14 @@ public class ItemSigilBloodLight extends ItemSigilBase
|
|||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player)
|
||||
public ActionResult<ItemStack> onItemRightClick(ItemStack stack, World world, EntityPlayer player, EnumHand hand)
|
||||
{
|
||||
MovingObjectPosition mop = this.getMovingObjectPositionFromPlayer(world, player, false);
|
||||
RayTraceResult mop = this.getMovingObjectPositionFromPlayer(world, player, false);
|
||||
|
||||
if (getCooldownRemainder(stack) > 0)
|
||||
return stack;
|
||||
return super.onItemRightClick(stack, world, player, hand);
|
||||
|
||||
if (mop != null && mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK)
|
||||
if (mop != null && mop.typeOfHit == RayTraceResult.Type.BLOCK)
|
||||
{
|
||||
BlockPos blockPos = mop.getBlockPos().offset(mop.sideHit);
|
||||
|
||||
|
@ -45,8 +47,8 @@ public class ItemSigilBloodLight extends ItemSigilBase
|
|||
if (!world.isRemote)
|
||||
NetworkHelper.syphonAndDamage(NetworkHelper.getSoulNetwork(player), player, getLPUsed());
|
||||
resetCooldown(stack);
|
||||
player.swingItem();
|
||||
return stack;
|
||||
player.swingArm(hand);
|
||||
return super.onItemRightClick(stack, world, player, hand);
|
||||
}
|
||||
} else
|
||||
{
|
||||
|
@ -58,7 +60,7 @@ public class ItemSigilBloodLight extends ItemSigilBase
|
|||
resetCooldown(stack);
|
||||
}
|
||||
|
||||
return stack;
|
||||
return super.onItemRightClick(stack, world, player, hand);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,21 +1,26 @@
|
|||
package WayofTime.bloodmagic.item.sigil;
|
||||
|
||||
import WayofTime.bloodmagic.item.ItemBindable;
|
||||
import WayofTime.bloodmagic.util.helper.TextHelper;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.EnumActionResult;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import org.apache.commons.lang3.tuple.ImmutablePair;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import WayofTime.bloodmagic.item.ItemBindable;
|
||||
import WayofTime.bloodmagic.util.helper.TextHelper;
|
||||
|
||||
public class ItemSigilToggleable extends ItemSigilBase
|
||||
{
|
||||
|
@ -37,23 +42,23 @@ public class ItemSigilToggleable extends ItemSigilBase
|
|||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player)
|
||||
public ActionResult<ItemStack> onItemRightClick(ItemStack stack, World world, EntityPlayer player, EnumHand hand)
|
||||
{
|
||||
if (!world.isRemote && !isUnusable(stack))
|
||||
{
|
||||
if (player.isSneaking())
|
||||
setActivated(stack, !getActivated(stack));
|
||||
if (getActivated(stack) && ItemBindable.syphonNetwork(stack, player, getLPUsed()))
|
||||
return stack;
|
||||
return super.onItemRightClick(stack, world, player, hand);
|
||||
}
|
||||
|
||||
return stack;
|
||||
return super.onItemRightClick(stack, world, player, hand);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, BlockPos blockPos, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
public EnumActionResult onItemUse(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
return ItemBindable.syphonNetwork(stack, player, getLPUsed()) && onSigilUse(stack, player, world, blockPos, side, hitX, hitY, hitZ);
|
||||
return (ItemBindable.syphonNetwork(stack, player, getLPUsed()) && onSigilUse(stack, player, world, pos, side, hitX, hitY, hitZ)) ? EnumActionResult.SUCCESS : EnumActionResult.FAIL;
|
||||
}
|
||||
|
||||
public boolean onSigilUse(ItemStack itemStack, EntityPlayer player, World world, BlockPos blockPos, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue