Search in sources :

Example 1 with NSET1

use of club.nsdn.nyasamarailway.entity.loco.NSET1 in project NyaSamaRailway by NSDN.

the class ItemNSET1 method onItemUse.

@Override
public boolean onItemUse(ItemStack itemStack, EntityPlayer player, World world, int x, int y, int z, int side, float px, float py, float pz) {
    if (BlockRailBase.func_150051_a(world.getBlock(x, y, z))) {
        if (!world.isRemote) {
            LocoBase entityminecart = new NSET1(world, (double) x + 0.5, (double) y + 0.5, (double) z + 0.5);
            if (itemStack.hasDisplayName()) {
                entityminecart.setMinecartName(itemStack.getDisplayName());
            }
            world.spawnEntityInWorld(entityminecart);
        }
        --itemStack.stackSize;
        return true;
    } else {
        return false;
    }
}
Also used : LocoBase(club.nsdn.nyasamarailway.entity.LocoBase) NSET1(club.nsdn.nyasamarailway.entity.loco.NSET1)

Aggregations

LocoBase (club.nsdn.nyasamarailway.entity.LocoBase)1 NSET1 (club.nsdn.nyasamarailway.entity.loco.NSET1)1