mirror of
https://github.com/GTNewHorizons/Draconic-Evolution.git
synced 2026-11-21 04:32:12 +00:00
nothing worth mentioning
This commit is contained in:
1 parent
59a88cb778
commit
521577580d
1 file changed
+5
-31
@@ -2,6 +2,7 @@ package draconicevolution.common.items;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import draconicevolution.common.items.tools.ToolHandler;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
@@ -75,8 +76,8 @@ public class Tclogo extends TolkienItem {
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player)
|
||||
{
|
||||
if (world.isRemote)
|
||||
ParticleHandler.spawnParticle("testParticle", player.posX, player.posY, player.posZ, 0, 0, 0, 1);
|
||||
//if (world.isRemote)
|
||||
//ParticleHandler.spawnParticle("testParticle", player.posX, player.posY, player.posZ, 0, 0, 0, 1);
|
||||
return stack;
|
||||
}
|
||||
|
||||
@@ -84,9 +85,9 @@ public class Tclogo extends TolkienItem {
|
||||
public boolean onBlockStartBreak(ItemStack itemstack, int X, int Y, int Z, EntityPlayer player)
|
||||
{
|
||||
//player.worldObj.scheduleBlockUpdate(X, Y, Z, player.worldObj.getBlock(X, Y, Z), 10);
|
||||
MovingObjectPosition mop = raytraceFromEntity(player.worldObj, player, true, 4.5D);
|
||||
MovingObjectPosition mop = ToolHandler.raytraceFromEntity(player.worldObj, player, true, 4.5D);
|
||||
System.out.println(mop.sideHit);
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -123,31 +124,4 @@ public class Tclogo extends TolkienItem {
|
||||
list.add(EnumChatFormatting.UNDERLINE + "UNDERLINE");
|
||||
list.add(EnumChatFormatting.STRIKETHROUGH + "STRIKETHROUGH");
|
||||
}
|
||||
|
||||
|
||||
public static MovingObjectPosition raytraceFromEntity (World world, Entity player, boolean par3, double range)
|
||||
{
|
||||
float f = 1.0F;
|
||||
float f1 = player.prevRotationPitch + (player.rotationPitch - player.prevRotationPitch) * f;
|
||||
float f2 = player.prevRotationYaw + (player.rotationYaw - player.prevRotationYaw) * f;
|
||||
double d0 = player.prevPosX + (player.posX - player.prevPosX) * (double) f;
|
||||
double d1 = player.prevPosY + (player.posY - player.prevPosY) * (double) f;
|
||||
if (!world.isRemote && player instanceof EntityPlayer)
|
||||
d1 += 1.62D;
|
||||
double d2 = player.prevPosZ + (player.posZ - player.prevPosZ) * (double) f;
|
||||
Vec3 vec3 = world.getWorldVec3Pool().getVecFromPool(d0, d1, d2);
|
||||
float f3 = MathHelper.cos(-f2 * 0.017453292F - (float) Math.PI);
|
||||
float f4 = MathHelper.sin(-f2 * 0.017453292F - (float) Math.PI);
|
||||
float f5 = -MathHelper.cos(-f1 * 0.017453292F);
|
||||
float f6 = MathHelper.sin(-f1 * 0.017453292F);
|
||||
float f7 = f4 * f5;
|
||||
float f8 = f3 * f5;
|
||||
double d3 = range;
|
||||
if (player instanceof EntityPlayerMP)
|
||||
{
|
||||
d3 = ((EntityPlayerMP) player).theItemInWorldManager.getBlockReachDistance();
|
||||
}
|
||||
Vec3 vec31 = vec3.addVector((double) f7 * d3, (double) f6 * d3, (double) f8 * d3);
|
||||
return world.func_147447_a(vec3, vec31, par3, !par3, par3);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user