use of mcjty.rftools.blocks.teleporter.TeleportDestinationClientInfo in project RFTools by McJty.
the class GuiTeleportProbe method teleport.
private void teleport(int index) {
TeleportDestinationClientInfo destination = destinationList.get(index);
BlockPos c = destination.getCoordinate();
RFToolsMessages.sendToServer(CommandHandler.CMD_FORCE_TELEPORT, Arguments.builder().value(destination.getDimension()).value(c));
}
use of mcjty.rftools.blocks.teleporter.TeleportDestinationClientInfo in project RFTools by McJty.
the class GuiTeleportProbe method populateList.
private void populateList() {
if (serverDestinationList == null) {
return;
}
if (serverDestinationList.equals(destinationList)) {
return;
}
destinationList = new ArrayList<>(serverDestinationList);
list.removeChildren();
for (TeleportDestinationClientInfo destination : destinationList) {
BlockPos coordinate = destination.getCoordinate();
int dim = destination.getDimension();
Panel panel = new Panel(mc, this).setLayout(new HorizontalLayout());
panel.addChild(new Label(mc, this).setColor(StyleConfig.colorTextInListNormal).setHorizontalAlignment(HorizontalAlignment.ALIGH_LEFT).setText(destination.getName()).setDesiredWidth(100));
panel.addChild(new Label(mc, this).setColor(StyleConfig.colorTextInListNormal).setHorizontalAlignment(HorizontalAlignment.ALIGH_LEFT).setText(BlockPosTools.toString(coordinate)).setDesiredWidth(75));
panel.addChild(new Label(mc, this).setColor(StyleConfig.colorTextInListNormal).setHorizontalAlignment(HorizontalAlignment.ALIGH_LEFT).setText("Id " + dim).setDesiredWidth(75));
list.addChild(panel);
}
}
use of mcjty.rftools.blocks.teleporter.TeleportDestinationClientInfo in project RFTools by McJty.
the class PacketAllReceiversReady method fromBytes.
@Override
public void fromBytes(ByteBuf buf) {
int size = buf.readInt();
destinationList = new ArrayList<>(size);
for (int i = 0; i < size; i++) {
destinationList.add(new TeleportDestinationClientInfo(buf));
}
}
use of mcjty.rftools.blocks.teleporter.TeleportDestinationClientInfo in project RFTools by McJty.
the class CmdListReceivers method execute.
@Override
public void execute(ICommandSender sender, String[] args) {
TeleportDestinations destinations = TeleportDestinations.getDestinations(sender.getEntityWorld());
Collection<TeleportDestinationClientInfo> validDestinations = destinations.getValidDestinations(sender.getEntityWorld(), null);
for (TeleportDestinationClientInfo clientInfo : validDestinations) {
int id = clientInfo.getDimension();
ITextComponent component = new TextComponentString(" Receiver: dimension=" + id + ", location=" + BlockPosTools.toString(clientInfo.getCoordinate()));
if (sender instanceof EntityPlayer) {
((EntityPlayer) sender).sendStatusMessage(component, false);
} else {
sender.sendMessage(component);
}
}
}
Aggregations