use of club.nsdn.nyasamarailway.entity.LocoBase in project NyaSamaRailway by NSDN.
the class ItemNSPCT6L 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 NSPCT6L(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;
}
}
use of club.nsdn.nyasamarailway.entity.LocoBase in project NyaSamaRailway by NSDN.
the class ItemNSPCT8J 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 NSPCT8J(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;
}
}
use of club.nsdn.nyasamarailway.entity.LocoBase in project NyaSamaRailway by NSDN.
the class NSPCT6C method doSpawn.
public static void doSpawn(World world, int x, int y, int z, String name) {
LocoBase head = new NSPCT6C(world, (double) x + 0.5, (double) y + 0.5, (double) z + 0.5);
if (!name.isEmpty())
head.setMinecartName(name);
world.spawnEntityInWorld(head);
MinecartBase container = new NSPCT6C.Container(world, (double) x + 0.5, (double) y + 0.5 - 2.0, (double) z + 0.5);
world.spawnEntityInWorld(container);
container.mountEntity(head);
}
use of club.nsdn.nyasamarailway.entity.LocoBase in project NyaSamaRailway by NSDN.
the class ChunkLoaderHandler method ticketsLoaded.
@Override
public List<ForgeChunkManager.Ticket> ticketsLoaded(List<ForgeChunkManager.Ticket> tickets, World world, int maxTicketCount) {
Set<ForgeChunkManager.Ticket> worldTickets = new HashSet<ForgeChunkManager.Ticket>();
Set<ForgeChunkManager.Ticket> cartTickets = new HashSet<ForgeChunkManager.Ticket>();
for (ForgeChunkManager.Ticket ticket : tickets) {
Entity entity = ticket.getEntity();
if (entity == null) {
int y = ticket.getModData().getInteger("yCoord");
if (y >= 0) {
worldTickets.add(ticket);
}
} else {
if (entity instanceof LocoBase) {
cartTickets.add(ticket);
}
}
}
List<ForgeChunkManager.Ticket> claimedTickets = new LinkedList<ForgeChunkManager.Ticket>();
claimedTickets.addAll(cartTickets);
claimedTickets.addAll(worldTickets);
return claimedTickets;
}
Aggregations