Minecraft.getMinecraft().thePlayer.getItemStackMainHand().getTagCompound().getInteger("ABC");
int _x=Minecraft.getMinecraft().thePlayer.getCurrentEquippedItem().stackTagCompound.getInteger("pfX"),
_y=Minecraft.getMinecraft().thePlayer.getItemInUse().stackTagCompound.getInteger("pfY");
int _x=0,_y=0;
if (Minecraft.getMinecraft().thePlayer.getCurrentEquippedItem() == new ItemStack(2478,1,0))
{
_x=Minecraft.getMinecraft().thePlayer.getCurrentEquippedItem().stackTagCompound.getInteger("pfX");
_y=Minecraft.getMinecraft().thePlayer.getItemInUse().stackTagCompound.getInteger("pfY");
}
Т.е.getCurrentEquippedItem() != null stackTagCompound != null stackTagCompound.hasKey("pfX")
if (getCurrentEquippedItem() != null && stackTagCompound != null && stackTagCompound.hasKey("pfX"))
{
_x = блаблабла
}
ItemStack itemStack = Minecraft.getMinecraft().thePlayer.getCurrentEquippedItem()
if (itemStack != null && itemStack.stackTagCompound != null) {
if (itemStack.stackTagCompound.hasKey("pfX")) {
int _x = itemStack.stackTagCompound.getInteger("pfX");
}
if (itemStack.stackTagCompound.hasKey("pfY")) {
int _y = itemStack.stackTagCompound.getInteger("pfY");
}
}
ItemStack itemStack = Minecraft.getMinecraft().thePlayer.getCurrentEquippedItem();
крашитсяЧто-то в инициализации класса ModelLultimaHammer, крашит на ошибку null. По ищи нету-ли set'а для поля, который ещё null.ModelLultimaHammer.<init>
Код один в один? Если да, то пиши ошибку сюда. Давай пока у меня время есть добьём этоНет, т.е.
Java:ItemStack itemStack = Minecraft.getMinecraft().thePlayer.getCurrentEquippedItem() if (itemStack != null && itemStack.stackTagCompound != null) { if (itemStack.stackTagCompound.hasKey("pfX")) { int _x = itemStack.stackTagCompound.getInteger("pfX"); } if (itemStack.stackTagCompound.hasKey("pfY")) { int _y = itemStack.stackTagCompound.getInteger("pfY"); } }