use of club.nsdn.nyasamarailway.entity.LocoBase in project NyaSamaRailway by NSDN.
the class ItemNTP32Bit method addCart.
public void addCart(ItemStack itemStack, EntityPlayer player, Entity entity) {
if (entity instanceof LocoBase) {
player.addChatComponentMessage(new ChatComponentTranslation("info.ntp.error"));
return;
}
int[] array = carts.get(itemStack);
ArrayList<Integer> list = new ArrayList<>();
for (int i : array) list.add(i);
int id = entity.getEntityId();
if (!list.contains(id)) {
list.add(id);
player.addChatComponentMessage(new ChatComponentTranslation("info.ntp.controlled"));
}
array = new int[list.size()];
for (int i = 0; i < list.size(); i++) array[i] = list.get(i);
carts.set(itemStack, array);
}
use of club.nsdn.nyasamarailway.entity.LocoBase in project NyaSamaRailway by NSDN.
the class ItemNSPCT8M 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 NSPCT8M(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 ItemNSET2 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 NSET2(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 ItemNSPCT10M 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 NSPCT10M(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 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;
}
}
Aggregations