0
私はMinecraft Fairy Tail Modを作成しようとしていますが、今は私がcursesを作成していますが、これは爆発しますが、modのアイテムを使用すると、TNTブロックはブロックの下を右クリックしますコメントとして投稿するMinecraft Modブロックエラー
package com.Trafalgar_DLaw.main.Curses;
import net.minecraft.entity.item.EntityTNTPrimed;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.MathHelper;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
public class Curse1 extends Item {
public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer entityplayer) {
float f = 0.0f;
float f1 = entityplayer.prevRotationPitch + (entityplayer.rotationPitch - entityplayer.prevRotationPitch) * f;
float f2 = entityplayer.prevRotationYaw + (entityplayer.rotationYaw - entityplayer.prevRotationYaw) * f;
double d = (double)f;
double d1 = entityplayer.prevPosX + (entityplayer.posX - entityplayer.prevPosX) * d;
double d2 = (entityplayer.prevPosY + (entityplayer.posY - entityplayer.prevPosY) * d + 1.6200000000000001d) - (double)entityplayer.yOffset;
double d3 = entityplayer.prevPosZ + (entityplayer.posZ - entityplayer.prevPosZ) * d;
Vec3 vec1 = Vec3.createVectorHelper(d1, d2, d3);
float f11 = MathHelper.cos(-f2 * 0.01745329f - 3.141593f);
float f12 = MathHelper.sin(-f2 * 0.01745329f - 3.141593f);
float f13 = -MathHelper.cos(-f1 * 0.01745329f);
float f14 = MathHelper.sin(-f1 * 0.01745329f);
float f15 = f12 * f13;
float f16 = f14;
float f17 = f11 * f13;
double d11 = 5000d;
Vec3 vec2 = vec1.addVector((double)f15 * d11, (double)f16 * d11, (double)f17 * d11);
MovingObjectPosition position = world.func_147447_a(vec1, vec2, false, true, true);
if(position != null && position.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) {
int x = position.blockX;
int y = position.blockY;
int z = position.blockZ;
world.spawnEntityInWorld(new EntityTNTPrimed(world, x, y, z, entityplayer));
}
return itemstack;
}
}
誰ですか?お願いします! –