use of mods.railcraft.common.util.network.PacketGuiReturn in project Railcraft by Railcraft.
the class GuiDetectorItem method actionPerformed.
@Override
protected void actionPerformed(GuiButton button) {
if (tile == null)
return;
int primary = detector.getPrimaryMode().ordinal();
int filter = detector.getFilterMode().ordinal();
switch(button.id) {
case 0:
primary--;
break;
case 1:
primary++;
break;
case 2:
filter--;
break;
case 3:
filter++;
break;
}
if (primary < 0)
primary = DetectorItem.PrimaryMode.values().length - 1;
if (primary >= DetectorItem.PrimaryMode.values().length)
primary = 0;
detector.setPrimaryMode(DetectorItem.PrimaryMode.values()[primary]);
if (filter < 0)
filter = DetectorItem.FilterMode.values().length - 1;
if (filter >= DetectorItem.FilterMode.values().length)
filter = 0;
detector.setFilterMode(DetectorItem.FilterMode.values()[filter]);
if (Game.isClient(tile.getWorld())) {
PacketGuiReturn pkt = new PacketGuiReturn(tile);
PacketDispatcher.sendToServer(pkt);
}
}
use of mods.railcraft.common.util.network.PacketGuiReturn in project Railcraft by Railcraft.
the class GuiBoxController method onGuiClosed.
@Override
public void onGuiClosed() {
if (Game.isClient(tile.getWorld())) {
tile.defaultAspect = defaultAspect;
tile.poweredAspect = poweredAspect;
PacketGuiReturn pkt = new PacketGuiReturn(tile);
PacketDispatcher.sendToServer(pkt);
}
}
use of mods.railcraft.common.util.network.PacketGuiReturn in project Railcraft by Railcraft.
the class GuiBoxAnalogController method onGuiClosed.
@Override
public void onGuiClosed() {
if (Game.isClient(tile.getWorld())) {
for (Map.Entry<SignalAspect, BitSet> entry : aspects.entrySet()) {
parseRegex(textBox.get(entry.getKey()).getText(), entry.getValue());
}
tile.aspects = aspects;
PacketGuiReturn pkt = new PacketGuiReturn(tile);
PacketDispatcher.sendToServer(pkt);
}
}
use of mods.railcraft.common.util.network.PacketGuiReturn in project Railcraft by Railcraft.
the class GuiBoxCapacitor method onGuiClosed.
@Override
public void onGuiClosed() {
if (Game.isClient(tile.getWorld())) {
tile.ticksToPower = ticksToPower;
tile.getStateModeController().setCurrentState(stateMode.getController().getCurrentState());
PacketGuiReturn pkt = new PacketGuiReturn(tile);
PacketDispatcher.sendToServer(pkt);
}
}
use of mods.railcraft.common.util.network.PacketGuiReturn in project Railcraft by Railcraft.
the class GuiTrackEmbarking method onGuiClosed.
@Override
public void onGuiClosed() {
track.setArea(radius);
if (Game.isClient(track.theWorldAsserted())) {
PacketGuiReturn pkt = new PacketGuiReturn((IGuiReturnHandler) track.getTile());
pkt.sendPacket();
}
}
Aggregations