use of club.nsdn.nyasamarailway.util.ExtInfoCore in project NyaSamaRailway by NSDN.
the class ItemNSC1AM 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) {
NSC1AM cart = new NSC1AM(world, (double) x + 0.5, (double) y + 0.5, (double) z + 0.5);
if (itemStack.hasDisplayName()) {
cart.setMinecartName(itemStack.getDisplayName());
}
ItemStack stack;
for (int i = 0; i < 9; i++) {
stack = player.inventory.mainInventory[i];
if (stack == null)
continue;
if (stack.getItem() == null)
continue;
if (stack.getItem() instanceof NGTablet) {
NBTTagList list = Util.getTagListFromNGT(stack);
if (list != null) {
String[][] code = NSASM.getCode(list);
new ExtInfoCore(code) {
@Override
public World getWorld() {
return world;
}
@Override
public double getX() {
return x;
}
@Override
public double getY() {
return y;
}
@Override
public double getZ() {
return z;
}
@Override
public EntityPlayer getPlayer() {
return player;
}
@Override
public IExtendedInfoCart getCart() {
return cart;
}
}.run();
}
}
}
world.spawnEntityInWorld(cart);
}
--itemStack.stackSize;
return true;
} else {
return false;
}
}
use of club.nsdn.nyasamarailway.util.ExtInfoCore in project NyaSamaRailway by NSDN.
the class ItemNSC3A 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) {
NSC3A cart = new NSC3A(world, (double) x + 0.5, (double) y + 0.5, (double) z + 0.5);
if (itemStack.hasDisplayName()) {
cart.setMinecartName(itemStack.getDisplayName());
}
ItemStack stack;
for (int i = 0; i < 9; i++) {
stack = player.inventory.mainInventory[i];
if (stack == null)
continue;
if (stack.getItem() == null)
continue;
if (stack.getItem() instanceof NGTablet) {
NBTTagList list = Util.getTagListFromNGT(stack);
if (list != null) {
String[][] code = NSASM.getCode(list);
new ExtInfoCore(code) {
@Override
public World getWorld() {
return world;
}
@Override
public double getX() {
return x;
}
@Override
public double getY() {
return y;
}
@Override
public double getZ() {
return z;
}
@Override
public EntityPlayer getPlayer() {
return player;
}
@Override
public IExtendedInfoCart getCart() {
return cart;
}
}.run();
}
}
}
world.spawnEntityInWorld(cart);
}
--itemStack.stackSize;
return true;
} else {
return false;
}
}
use of club.nsdn.nyasamarailway.util.ExtInfoCore in project NyaSamaRailway by NSDN.
the class ItemNSPCT9 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) {
NSPCT9 cart = new NSPCT9(world, (double) x + 0.5, (double) y + 0.5, (double) z + 0.5);
if (itemStack.hasDisplayName()) {
cart.setMinecartName(itemStack.getDisplayName());
}
ItemStack stack;
for (int i = 0; i < 9; i++) {
stack = player.inventory.mainInventory[i];
if (stack == null)
continue;
if (stack.getItem() == null)
continue;
if (stack.getItem() instanceof NGTablet) {
NBTTagList list = Util.getTagListFromNGT(stack);
if (list != null) {
String[][] code = NSASM.getCode(list);
new ExtInfoCore(code) {
@Override
public World getWorld() {
return world;
}
@Override
public double getX() {
return x;
}
@Override
public double getY() {
return y;
}
@Override
public double getZ() {
return z;
}
@Override
public EntityPlayer getPlayer() {
return player;
}
@Override
public IExtendedInfoCart getCart() {
return cart;
}
}.run();
}
}
}
world.spawnEntityInWorld(cart);
}
--itemStack.stackSize;
return true;
} else {
return false;
}
}
use of club.nsdn.nyasamarailway.util.ExtInfoCore in project NyaSamaRailway by NSDN.
the class ItemNSC1A 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) {
NSC1A cart = new NSC1A(world, (double) x + 0.5, (double) y + 0.5, (double) z + 0.5);
if (itemStack.hasDisplayName()) {
cart.setMinecartName(itemStack.getDisplayName());
}
ItemStack stack;
for (int i = 0; i < 9; i++) {
stack = player.inventory.mainInventory[i];
if (stack == null)
continue;
if (stack.getItem() == null)
continue;
if (stack.getItem() instanceof NGTablet) {
NBTTagList list = Util.getTagListFromNGT(stack);
if (list != null) {
String[][] code = NSASM.getCode(list);
new ExtInfoCore(code) {
@Override
public World getWorld() {
return world;
}
@Override
public double getX() {
return x;
}
@Override
public double getY() {
return y;
}
@Override
public double getZ() {
return z;
}
@Override
public EntityPlayer getPlayer() {
return player;
}
@Override
public IExtendedInfoCart getCart() {
return cart;
}
}.run();
}
}
}
world.spawnEntityInWorld(cart);
}
--itemStack.stackSize;
return true;
} else {
return false;
}
}
use of club.nsdn.nyasamarailway.util.ExtInfoCore in project NyaSamaRailway by NSDN.
the class ItemNSC3AM 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) {
NSC3AM cart = new NSC3AM(world, (double) x + 0.5, (double) y + 0.5, (double) z + 0.5);
if (itemStack.hasDisplayName()) {
cart.setMinecartName(itemStack.getDisplayName());
}
ItemStack stack;
for (int i = 0; i < 9; i++) {
stack = player.inventory.mainInventory[i];
if (stack == null)
continue;
if (stack.getItem() == null)
continue;
if (stack.getItem() instanceof NGTablet) {
NBTTagList list = Util.getTagListFromNGT(stack);
if (list != null) {
String[][] code = NSASM.getCode(list);
new ExtInfoCore(code) {
@Override
public World getWorld() {
return world;
}
@Override
public double getX() {
return x;
}
@Override
public double getY() {
return y;
}
@Override
public double getZ() {
return z;
}
@Override
public EntityPlayer getPlayer() {
return player;
}
@Override
public IExtendedInfoCart getCart() {
return cart;
}
}.run();
}
}
}
world.spawnEntityInWorld(cart);
}
--itemStack.stackSize;
return true;
} else {
return false;
}
}
Aggregations