public static void sendToAll(AbstractPacket packet) { instance.network.sendToAll(packet); }
/** * Send this message to everyone. * See {@link SimpleNetworkWrapper#sendToAll(IMessage)} */ public static void sendToAll(IMessage message) { PacketDispatcher.dispatcher.sendToAll(message); }
/** * Sends a packet to all the clients.<br> * Must be called Server side. */ public static void sendToAll(IMessage msg) { HANDLER.sendToAll(msg); }
@Override public void sendToAll(final MessageBase packet) { this.getMod().getNetworkWrapper().sendToAll(packet.GetMessage()); }
public void setSinging(boolean singing) { if(singCooldown > 0){ singing = false; } this.dataManager.set(SINGING, singing); if (!world.isRemote) { this.isSinging = singing; IceAndFire.NETWORK_WRAPPER.sendToAll(new MessageSirenSong(this.getEntityId(), singing)); } }
@Override public void removeAttributesModifiersFromEntity(EntityLivingBase entityLivingBaseIn, @Nonnull AbstractAttributeMap attributeMapIn, int amplifier) { super.removeAttributesModifiersFromEntity(entityLivingBaseIn, attributeMapIn, amplifier); entityLivingBaseIn.world.playSound(null, entityLivingBaseIn.getPosition(), ModSounds.ETHEREAL_PASS_BY, SoundCategory.NEUTRAL, 0.5f, 1); if (!(entityLivingBaseIn instanceof EntityPlayer)) PacketHandler.NETWORK.sendToAll(new PacketVanishPotion(entityLivingBaseIn.getEntityId())); }
@Override public void applyAttributesModifiersToEntity(EntityLivingBase entityLivingBaseIn, @Nonnull AbstractAttributeMap attributeMapIn, int amplifier) { super.applyAttributesModifiersToEntity(entityLivingBaseIn, attributeMapIn, amplifier); entityLivingBaseIn.world.playSound(null, entityLivingBaseIn.getPosition(), ModSounds.ETHEREAL_PASS_BY, SoundCategory.NEUTRAL, 0.5f, 1); if (!(entityLivingBaseIn instanceof EntityPlayer)) PacketHandler.NETWORK.sendToAll(new PacketVanishPotion(entityLivingBaseIn.getEntityId(), 0, 100)); }
@Override public void onServerReceived(MinecraftServer minecraftServer, SwitchHybridizerCombinatorMode message, EntityPlayer player, MessageContext messageContext) { boolean mode = message.hybridizer; BlockPos pos = message.pos; DNACombinatorHybridizerBlockEntity tile = (DNACombinatorHybridizerBlockEntity) player.world.getTileEntity(pos); tile.setMode(mode); JurassiCraft.NETWORK_WRAPPER.sendToAll(new SwitchHybridizerCombinatorMode(pos, mode)); Container openContainer = player.openContainer; if (openContainer instanceof DNACombinatorHybridizerContainer) { ((DNACombinatorHybridizerContainer) openContainer).updateSlots(mode); } }
@Override public void onServerReceived(MinecraftServer server, ChangeTemperatureMessage message, EntityPlayer player, MessageContext messageContext) { TileEntity tile = player.world.getTileEntity(message.pos); if (tile instanceof TemperatureControl) { TemperatureControl control = (TemperatureControl) tile; if (control.isUsableByPlayer(player) && message.index >= 0 && message.index < control.getTemperatureCount()) { control.setTemperature(message.index, message.temperature); JurassiCraft.NETWORK_WRAPPER.sendToAll(new ChangeTemperatureMessage(message.pos, message.index, message.temperature)); } } }
@Override public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity packet) { readFromNBT(packet.getNbtCompound()); if (!world.isRemote) { IceAndFire.NETWORK_WRAPPER.sendToAll(new MessageUpdatePodium(pos.toLong(), this.getStackInSlot(0))); } } @Override
public void setDeathWormScale(float scale) { this.dataManager.set(SCALE, Float.valueOf(scale)); this.updateAttributes(); clearSegments(); if (!this.world.isRemote) { initSegments(scale * (this.getWormAge() / 5F)); IceAndFire.NETWORK_WRAPPER.sendToAll(new MessageDeathWormHitbox(this.getEntityId(), scale * (this.getWormAge() / 5F))); } }
@Override protected void processItem(int process) { Random rand = new Random(); int tissue = process * 2; ItemStack sequencableStack = this.slots.get(tissue); this.mergeStack(process + 6, SequencableItem.getSequencableItem(sequencableStack).getSequenceOutput(sequencableStack, rand)); this.decreaseStackSize(tissue); this.decreaseStackSize(tissue + 1); JurassiCraft.NETWORK_WRAPPER.sendToAll(new TileEntityFieldsMessage(getSyncFields(NonNullList.create()), this)); }
@Override public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity packet) { readFromNBT(packet.getNbtCompound()); if (!world.isRemote) { IceAndFire.NETWORK_WRAPPER.sendToAll(new MessageUpdatePixieHouseModel(pos.toLong(), packet.getNbtCompound().getInteger("PixieType"))); } }
@Override public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity packet) { readFromNBT(packet.getNbtCompound()); if (!world.isRemote) { IceAndFire.NETWORK_WRAPPER.sendToAll(new MessageUpdatePixieHouseModel(pos.toLong(), packet.getNbtCompound().getInteger("HouseType"))); } }
@Override public void setInventorySlotContents(int index, ItemStack stack) { boolean send = false; if (!this.world.isRemote && index >= 0 && index <= 4 && this.slots.get(index).getItem() != stack.getItem()) { send = true; } super.setInventorySlotContents(index, stack); if (send) { JurassiCraft.NETWORK_WRAPPER.sendToAll(new TileEntityFieldsMessage(getSyncFields(NonNullList.create()), this)); } }
@Override public void sendToAll(QuestingPacket payload) { payload.getPayload().setString("ID", payload.getHandler().toString()); for(NBTTagCompound p : PacketAssembly.INSTANCE.splitPacket(payload.getPayload())) { BetterQuesting.instance.network.sendToAll(new PacketQuesting(p)); } }
@Override public void setInventorySlotContents(int index, ItemStack stack) { boolean send = false; if (!this.world.isRemote && index == 0 && this.slots.get(0).getItem() != stack.getItem()) { send = true; } super.setInventorySlotContents(index, stack); if (send) JurassiCraft.NETWORK_WRAPPER.sendToAll(new TileEntityFieldsMessage(getSyncFields(NonNullList.create()), this)); }
@Override public void setInventorySlotContents(int index, ItemStack stack) { boolean send = false; if (!this.world.isRemote && index % 2 == 0 && this.slots.get(index).getItem() != stack.getItem()) { send = true; } super.setInventorySlotContents(index, stack); if (send) JurassiCraft.NETWORK_WRAPPER.sendToAll(new TileEntityFieldsMessage(getSyncFields(NonNullList.create()), this)); }
public void setOwner(String name) { owner = name; if (!getWorld().isRemote) Erebus.NETWORK_WRAPPER.sendToAll(new PacketBones(getPos().getX(), getPos().getY(), getPos().getZ(), name)); }
@Override public void onUpdate() { if (!getEntityWorld().isRemote && getAttackTarget() == null && isOnSand() && !isInsideOfMaterial(Material.SAND)) { setPosition(posX, posY - 1, posZ); } if (!getEntityWorld().isRemote && getAttackTarget() != null && isInsideOfMaterial(Material.SAND)) { Erebus.NETWORK_WRAPPER.sendToAll(new PacketParticle(ParticleType.ANTLION_DIG, (float) posX, (float)posY + 1F, (float)posZ)); setPosition(posX, posY + 1, posZ); } super.onUpdate(); }