Search in sources :

Example 11 with MessageTileSync

use of blusunrize.immersiveengineering.common.util.network.MessageTileSync in project ImmersiveEngineering by BluSunrize.

the class GuiFluidSorter method actionPerformed.

@Override
protected void actionPerformed(GuiButton button) {
    if (button instanceof ButtonSorter && FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT) {
        int side = button.id;
        this.tile.sortWithNBT[side] = (byte) (this.tile.sortWithNBT[side] == 1 ? 0 : 1);
        NBTTagCompound tag = new NBTTagCompound();
        tag.setByteArray("sideConfig", this.tile.sortWithNBT);
        ImmersiveEngineering.packetHandler.sendToServer(new MessageTileSync(tile, tag));
        this.initGui();
    }
}
Also used : ButtonSorter(blusunrize.immersiveengineering.client.gui.GuiSorter.ButtonSorter) NBTTagCompound(net.minecraft.nbt.NBTTagCompound) MessageTileSync(blusunrize.immersiveengineering.common.util.network.MessageTileSync)

Example 12 with MessageTileSync

use of blusunrize.immersiveengineering.common.util.network.MessageTileSync in project ImmersiveEngineering by BluSunrize.

the class GuiTurret method keyTyped.

@Override
protected void keyTyped(char typedChar, int keyCode) throws IOException {
    if (this.nameField.isFocused() && keyCode == 28) {
        String name = this.nameField.getText();
        if (!tile.targetList.contains(name)) {
            NBTTagCompound tag = new NBTTagCompound();
            tag.setString("add", name);
            tile.targetList.add(name);
            ImmersiveEngineering.packetHandler.sendToServer(new MessageTileSync(tile, tag));
            this.initGui();
            ((GuiReactiveList) this.buttonList.get(0)).setOffset(((GuiReactiveList) this.buttonList.get(0)).getMaxOffset());
        }
    } else if (!this.nameField.textboxKeyTyped(typedChar, keyCode))
        super.keyTyped(typedChar, keyCode);
}
Also used : GuiReactiveList(blusunrize.immersiveengineering.client.gui.elements.GuiReactiveList) NBTTagCompound(net.minecraft.nbt.NBTTagCompound) MessageTileSync(blusunrize.immersiveengineering.common.util.network.MessageTileSync)

Example 13 with MessageTileSync

use of blusunrize.immersiveengineering.common.util.network.MessageTileSync in project ImmersiveEngineering by BluSunrize.

the class TileEntityTurretGun method sendRenderPacket.

protected void sendRenderPacket() {
    NBTTagCompound tag = new NBTTagCompound();
    tag.setBoolean("cycle", true);
    ImmersiveEngineering.packetHandler.sendToAll(new MessageTileSync(this, tag));
}
Also used : NBTTagCompound(net.minecraft.nbt.NBTTagCompound) MessageTileSync(blusunrize.immersiveengineering.common.util.network.MessageTileSync)

Aggregations

MessageTileSync (blusunrize.immersiveengineering.common.util.network.MessageTileSync)13 NBTTagCompound (net.minecraft.nbt.NBTTagCompound)13 GuiReactiveList (blusunrize.immersiveengineering.client.gui.elements.GuiReactiveList)2 ItemStack (net.minecraft.item.ItemStack)2 TargetPoint (net.minecraftforge.fml.common.network.NetworkRegistry.TargetPoint)2 ExcavatorHandler (blusunrize.immersiveengineering.api.tool.ExcavatorHandler)1 IConfigurableTool (blusunrize.immersiveengineering.api.tool.IConfigurableTool)1 ToolConfigBoolean (blusunrize.immersiveengineering.api.tool.IConfigurableTool.ToolConfig.ToolConfigBoolean)1 ToolConfigFloat (blusunrize.immersiveengineering.api.tool.IConfigurableTool.ToolConfig.ToolConfigFloat)1 ButtonSorter (blusunrize.immersiveengineering.client.gui.GuiSorter.ButtonSorter)1 GuiButtonCheckbox (blusunrize.immersiveengineering.client.gui.elements.GuiButtonCheckbox)1 GuiButtonItem (blusunrize.immersiveengineering.client.gui.elements.GuiButtonItem)1 GuiButtonState (blusunrize.immersiveengineering.client.gui.elements.GuiButtonState)1 GuiSliderIE (blusunrize.immersiveengineering.client.gui.elements.GuiSliderIE)1 TileEntityTurretChem (blusunrize.immersiveengineering.common.blocks.metal.TileEntityTurretChem)1 TileEntityTurretGun (blusunrize.immersiveengineering.common.blocks.metal.TileEntityTurretGun)1 IESlot (blusunrize.immersiveengineering.common.gui.IESlot)1 Block (net.minecraft.block.Block)1 GuiButton (net.minecraft.client.gui.GuiButton)1 Slot (net.minecraft.inventory.Slot)1