Search in sources :

Example 16 with MinecartBase

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

the class RailMonoMagnetReception method spawnCart.

public void spawnCart(World world, int x, int y, int z) {
    TileEntityRail rail = null;
    if (world.getTileEntity(x, y, z) instanceof TileEntityRail) {
        rail = (TileEntityRail) world.getTileEntity(x, y, z);
    }
    if (rail != null) {
        if (rail.cartType.isEmpty())
            return;
        if (rail.cartType.equals("loco"))
            return;
        if (rail.cartType.equals(NSPCT4.class.getName())) {
            MinecartBase cart = new NSPCT4(world, (double) x + 0.5, (double) y + 0.5, (double) z + 0.5);
            world.spawnEntityInWorld(cart);
        } else if (rail.cartType.equals(NSPCT5.class.getName())) {
            MinecartBase cart = new NSPCT5(world, (double) x + 0.5, (double) y + 0.5, (double) z + 0.5);
            world.spawnEntityInWorld(cart);
        } else if (rail.cartType.equals(NSPCT6W.class.getName())) {
            NSPCT6W.doSpawn(world, x, y, z, "");
        } else if (rail.cartType.equals(NSPCT8W.class.getName())) {
            NSPCT8W.doSpawn(world, x, y, z, "");
        } else if (rail.cartType.equals(NSPCT9.class.getName())) {
            NSPCT9 cart = new NSPCT9(world, (double) x + 0.5, (double) y + 0.5, (double) z + 0.5);
            cart.setExtendedInfo(rail.extInfo);
            world.spawnEntityInWorld(cart);
        }
    }
}
Also used : MinecartBase(club.nsdn.nyasamarailway.entity.MinecartBase)

Example 17 with MinecartBase

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

the class RailMonoMagnetReceptionAnti method spawnCart.

public void spawnCart(World world, int x, int y, int z) {
    TileEntityRail rail = null;
    if (world.getTileEntity(x, y, z) instanceof TileEntityRail) {
        rail = (TileEntityRail) world.getTileEntity(x, y, z);
    }
    if (rail != null) {
        if (rail.cartType.isEmpty())
            return;
        if (rail.cartType.equals("loco"))
            return;
        if (rail.cartType.equals(NSPCT4.class.getName())) {
            MinecartBase cart = new NSPCT4(world, (double) x + 0.5, (double) y + 0.5, (double) z + 0.5);
            world.spawnEntityInWorld(cart);
        } else if (rail.cartType.equals(NSPCT5.class.getName())) {
            MinecartBase cart = new NSPCT5(world, (double) x + 0.5, (double) y + 0.5, (double) z + 0.5);
            world.spawnEntityInWorld(cart);
        } else if (rail.cartType.equals(NSPCT6W.class.getName())) {
            NSPCT6W.doSpawn(world, x, y, z, "");
        } else if (rail.cartType.equals(NSPCT8W.class.getName())) {
            NSPCT8W.doSpawn(world, x, y, z, "");
        } else if (rail.cartType.equals(NSPCT9.class.getName())) {
            NSPCT9 cart = new NSPCT9(world, (double) x + 0.5, (double) y + 0.5, (double) z + 0.5);
            cart.setExtendedInfo(rail.extInfo);
            world.spawnEntityInWorld(cart);
        }
    }
}
Also used : MinecartBase(club.nsdn.nyasamarailway.entity.MinecartBase)

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