use of logisticspipes.utils.gui.UpgradeSlot in project LogisticsPipes by RS485.
the class OpenUpgradePacket method processPacket.
@Override
public void processPacket(EntityPlayer player) {
UpgradeSlot slot = getSlot(player, UpgradeSlot.class);
IPipeUpgrade upgrade = slot.getUpgrade();
if (upgrade instanceof IConfigPipeUpgrade) {
UpgradeCoordinatesGuiProvider gui = ((IConfigPipeUpgrade) upgrade).getGUI();
if (gui != null) {
gui.setSlot(slot).setLPPos(slot.getManager().getPipePosition()).open(player);
}
}
}
use of logisticspipes.utils.gui.UpgradeSlot in project LogisticsPipes by RS485.
the class ToogleDisconnectionUpgradeSidePacket method processPacket.
@Override
public void processPacket(EntityPlayer player) {
UpgradeSlot slot = getSlot(player, UpgradeSlot.class);
ItemStack stack = slot.getStack();
if (stack.isEmpty())
return;
if (!stack.hasTagCompound()) {
stack.setTagCompound(new NBTTagCompound());
}
NBTTagCompound tag = Objects.requireNonNull(stack.getTagCompound());
String sideName = ConnectionUpgradeConfig.Sides.getNameForDirection(side);
tag.setBoolean(sideName, !tag.getBoolean(sideName));
stack.setTagCompound(tag);
slot.putStack(stack);
}
use of logisticspipes.utils.gui.UpgradeSlot in project LogisticsPipes by RS485.
the class SneakyUpgradeSidePacket method processPacket.
@Override
public void processPacket(EntityPlayer player) {
UpgradeSlot slot = getSlot(player, UpgradeSlot.class);
ItemStack stack = slot.getStack();
if (stack.isEmpty())
return;
if (!stack.hasTagCompound()) {
stack.setTagCompound(new NBTTagCompound());
}
final NBTTagCompound tag = Objects.requireNonNull(stack.getTagCompound());
tag.setString(SneakyUpgradeConfig.SIDE_KEY, SneakyUpgradeConfig.Sides.getNameForDirection(side));
slot.putStack(stack);
}
Aggregations