use of forestry.core.network.IForestryPacketClient in project ForestryMC by ForestryMC.
the class ContainerMinecartBeehouse method detectAndSendChanges.
@Override
public void detectAndSendChanges() {
super.detectAndSendChanges();
int beeProgress = entity.getBeekeepingLogic().getBeeProgressPercent();
if (this.beeProgress != beeProgress) {
this.beeProgress = beeProgress;
IForestryPacketClient packet = new PacketGuiUpdateEntity(entity, entity);
sendPacketToListeners(packet);
}
}
use of forestry.core.network.IForestryPacketClient in project ForestryMC by ForestryMC.
the class ContainerAlveary method detectAndSendChanges.
@Override
public void detectAndSendChanges() {
super.detectAndSendChanges();
int beeProgress = tile.getBeekeepingLogic().getBeeProgressPercent();
if (this.beeProgress != beeProgress) {
this.beeProgress = beeProgress;
IForestryPacketClient packet = new PacketGuiUpdate(tile);
sendPacketToListeners(packet);
}
}
use of forestry.core.network.IForestryPacketClient in project ForestryMC by ForestryMC.
the class TankManager method sendTankUpdate.
private void sendTankUpdate(Container container, Iterable<IContainerListener> crafters, StandardTank tank) {
if (tile != null) {
int tankIndex = tank.getTankIndex();
FluidStack fluid = tank.getFluid();
IForestryPacketClient packet = new PacketTankLevelUpdate(tile, tankIndex, fluid);
for (IContainerListener crafter : crafters) {
if (crafter instanceof EntityPlayerMP) {
NetworkUtil.sendToPlayer(packet, (EntityPlayerMP) crafter);
}
}
if (fluid == null) {
prevFluidStacks.remove(container, tankIndex);
} else {
prevFluidStacks.put(container, tankIndex, fluid.copy());
}
}
}
use of forestry.core.network.IForestryPacketClient in project ForestryMC by ForestryMC.
the class ContainerSolderingIron method handleSelectionRequest.
@Override
public void handleSelectionRequest(EntityPlayerMP player, int primary, int secondary) {
if (secondary == 0) {
if (primary == 0) {
inventory.advanceLayout();
}
} else if (primary == 0) {
inventory.regressLayout();
}
IForestryPacketClient packetResponse = new PacketGuiLayoutSelect(inventory.getLayout().getUID());
NetworkUtil.sendToPlayer(packetResponse, player);
}
use of forestry.core.network.IForestryPacketClient in project ForestryMC by ForestryMC.
the class ContainerBeeHousing method detectAndSendChanges.
@Override
public void detectAndSendChanges() {
super.detectAndSendChanges();
int beeProgress = tile.getBeekeepingLogic().getBeeProgressPercent();
if (this.beeProgress != beeProgress) {
this.beeProgress = beeProgress;
IForestryPacketClient packet = new PacketGuiUpdate(tile);
sendPacketToListeners(packet);
}
}
Aggregations