- 129
- 0
Почему не работает пытался сделать предмет который бы менял текстуру если над ним находиться определенный блок
Код:
package com.yoube.syhd;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
public class ItemRadar extends Item {
public static String texture ="Radar";
public ItemRadar() {
super();
this.setCreativeTab(CreativeTabs.tabBlock);
this.setTextureName("syhd"+":"+texture);
this.setUnlocalizedName("Radar");
this.setMaxStackSize(1);
}
public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5)
{
EntityPlayer p = ((EntityPlayer)par3Entity);
if(par2World.getBlock((int)p.posX,(int) p.posY+3,(int) p.posZ) == syhd.SteelBlock){texture = "Radar2";}
}
}