use of mods.railcraft.common.blocks.RailcraftTileEntity in project Railcraft by Railcraft.
the class PacketTileRequest method readData.
@Override
public void readData(RailcraftInputStream data) throws IOException {
World world = DimensionManager.getWorld(data.readInt());
if (world == null)
return;
int x = data.readInt();
int y = data.readInt();
int z = data.readInt();
tile = world.getTileEntity(new BlockPos(x, y, z));
if (tile instanceof RailcraftTileEntity && player != null)
PacketBuilder.instance().sendTileEntityPacket(tile, player);
}
use of mods.railcraft.common.blocks.RailcraftTileEntity in project Railcraft by Railcraft.
the class CommandDebug method executeSubCommand.
@Override
public void executeSubCommand(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException {
if (args.length != 0)
CommandHelpers.throwWrongUsage(sender, this);
RayTraceResult rayTraceResult = MiscTools.rayTracePlayerLook((EntityPlayer) sender);
List<String> debug = Collections.emptyList();
switch(rayTraceResult.typeOfHit) {
case ENTITY:
Entity entity = rayTraceResult.entityHit;
if (entity instanceof EntityMinecart) {
debug = CartTools.getDebugOutput((EntityMinecart) entity);
} else {
CommandHelpers.throwWrongUsage(sender, this);
}
break;
case BLOCK:
World world = CommandHelpers.getWorld(sender);
TileEntity tile = WorldPlugin.getBlockTile(world, rayTraceResult.getBlockPos());
if (tile instanceof RailcraftTileEntity) {
debug = ((RailcraftTileEntity) tile).getDebugOutput();
} else {
CommandHelpers.throwWrongUsage(sender, this);
}
break;
}
for (String s : debug) {
printLine(sender, s);
}
}
Aggregations