use of club.nsdn.nyasamarailway.item.cart.ItemNSPCT5 in project NyaSamaRailway by NSDN.
the class EntityInteractHandler method onEntityInteract.
@SubscribeEvent
public void onEntityInteract(EntityInteractEvent event) {
if (event.entityLiving instanceof EntityPlayer) {
EntityPlayer player = (EntityPlayer) event.entityLiving;
if (player.worldObj.isRemote)
return;
Entity entity = event.target;
ItemStack stack = player.getCurrentEquippedItem();
if (stack != null) {
if (stack.getItem() instanceof ItemNTP8Bit) {
if (player.isSneaking()) {
((ItemNTP8Bit) stack.getItem()).clearCart(stack, player);
return;
}
if (entity instanceof EntityMinecart) {
((ItemNTP8Bit) stack.getItem()).addCart(stack, player, entity);
}
} else if (stack.getItem() instanceof ItemNTP32Bit) {
if (player.isSneaking()) {
((ItemNTP32Bit) stack.getItem()).clearCart(stack, player);
return;
}
if (entity instanceof EntityMinecart) {
((ItemNTP32Bit) stack.getItem()).addCart(stack, player, entity);
} else {
if (ExRollerCoaster.getInstance() != null) {
if (ExRollerCoaster.getInstance().verifyEntity(entity)) {
((ItemNTP32Bit) stack.getItem()).addCart(stack, player, entity);
}
}
if (RailsOfWar.getInstance() != null) {
if (RailsOfWar.getInstance().verifyEntity(entity)) {
((ItemNTP32Bit) stack.getItem()).addCart(stack, player, entity);
}
}
}
} else if (stack.getItem() instanceof Item1N4148) {
if (entity instanceof NSPCT8J) {
NSPCT8J loco = (NSPCT8J) entity;
loco.modifyHighSpeedMode(player);
}
} else if (stack.getItem() instanceof ItemNSPCT5) {
if (entity instanceof NSPCT5) {
((NSPCT5) entity).modifyLength();
}
} else if (stack.getItem() instanceof ItemNSPCT5L) {
if (entity instanceof NSPCT5L) {
((NSPCT5L) entity).modifyLength();
}
}
}
}
}
Aggregations