Search in sources :

Example 11 with MinecartBase

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

the class ItemNSPCT1 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) {
            MinecartBase entityminecart = new NSPCT1(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 : MinecartBase(club.nsdn.nyasamarailway.entity.MinecartBase) NSPCT1(club.nsdn.nyasamarailway.entity.cart.NSPCT1)

Example 12 with MinecartBase

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

the class ItemNSPCT3 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) {
            MinecartBase entityminecart = new NSPCT3(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 : MinecartBase(club.nsdn.nyasamarailway.entity.MinecartBase) NSPCT3(club.nsdn.nyasamarailway.entity.cart.NSPCT3)

Example 13 with MinecartBase

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

the class ItemNSPCT4 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)) && world.getBlock(x, y, z) instanceof RailMonoMagnetBase) {
        if (!world.isRemote) {
            MinecartBase entityminecart = new NSPCT4(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 : MinecartBase(club.nsdn.nyasamarailway.entity.MinecartBase) RailMonoMagnetBase(club.nsdn.nyasamarailway.tileblock.rail.mono.RailMonoMagnetBase) NSPCT4(club.nsdn.nyasamarailway.entity.cart.NSPCT4)

Example 14 with MinecartBase

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

the class ItemNSPCT5 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) {
            MinecartBase entityminecart = new NSPCT5(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 : MinecartBase(club.nsdn.nyasamarailway.entity.MinecartBase) NSPCT5(club.nsdn.nyasamarailway.entity.cart.NSPCT5)

Example 15 with MinecartBase

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

the class ItemNSPCT8 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) {
            MinecartBase entityminecart = new NSPCT8(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 : MinecartBase(club.nsdn.nyasamarailway.entity.MinecartBase) NSPCT8(club.nsdn.nyasamarailway.entity.cart.NSPCT8)

Aggregations

MinecartBase (club.nsdn.nyasamarailway.entity.MinecartBase)17 LocoBase (club.nsdn.nyasamarailway.entity.LocoBase)2 NSBT1 (club.nsdn.nyasamarailway.entity.cart.NSBT1)2 TrainBase (club.nsdn.nyasamarailway.entity.TrainBase)1 NSPCT1 (club.nsdn.nyasamarailway.entity.cart.NSPCT1)1 NSPCT2 (club.nsdn.nyasamarailway.entity.cart.NSPCT2)1 NSPCT3 (club.nsdn.nyasamarailway.entity.cart.NSPCT3)1 NSPCT4 (club.nsdn.nyasamarailway.entity.cart.NSPCT4)1 NSPCT5 (club.nsdn.nyasamarailway.entity.cart.NSPCT5)1 NSPCT5L (club.nsdn.nyasamarailway.entity.cart.NSPCT5L)1 NSPCT6 (club.nsdn.nyasamarailway.entity.cart.NSPCT6)1 NSPCT8 (club.nsdn.nyasamarailway.entity.cart.NSPCT8)1 NSTCT1 (club.nsdn.nyasamarailway.entity.cart.NSTCT1)1 RailMonoMagnetBase (club.nsdn.nyasamarailway.tileblock.rail.mono.RailMonoMagnetBase)1