Search in sources :

Example 6 with PacketTile

use of com.builtbroken.mc.core.network.packet.PacketTile in project ICBM-Classic by BuiltBrokenModding.

the class GuiEMPTower method keyTyped.

/** Call this method from you GuiScreen to process the keys into textbox. */
@Override
public void keyTyped(char par1, int par2) {
    super.keyTyped(par1, par2);
    this.textFieldBanJing.textboxKeyTyped(par1, par2);
    try {
        int radius = Math.min(Math.max(Integer.parseInt(this.textFieldBanJing.getText()), 10), TileEMPTower.MAX_RADIUS);
        this.tileEntity.empRadius = radius;
        Engine.instance.packetHandler.sendToServer(new PacketTile(this.tileEntity, 1, this.tileEntity.empRadius));
    } catch (NumberFormatException e) {
    }
}
Also used : PacketTile(com.builtbroken.mc.core.network.packet.PacketTile)

Example 7 with PacketTile

use of com.builtbroken.mc.core.network.packet.PacketTile in project Engine by VoltzEngine-Project.

the class AbstractTileTest method testSendPacketToGuiUsers.

@Test
public void testSendPacketToGuiUsers() {
    FakeWorld world = FakeWorld.newWorld("TestSendpacketToGuiUsers");
    world.setBlock(0, 0, 0, block);
    Tile tile = ((Tile) world.getTileEntity(0, 0, 0));
    tile.sendPacketToGuiUsers(new PacketTile(tile));
}
Also used : PacketTile(com.builtbroken.mc.core.network.packet.PacketTile) FakeWorld(com.builtbroken.mc.testing.junit.world.FakeWorld) PacketTile(com.builtbroken.mc.core.network.packet.PacketTile) BlockTile(com.builtbroken.mc.prefab.tile.BlockTile) Tile(com.builtbroken.mc.prefab.tile.Tile) Test(org.junit.Test)

Aggregations

PacketTile (com.builtbroken.mc.core.network.packet.PacketTile)7 Pos (com.builtbroken.mc.imp.transform.vector.Pos)2 BlockTile (com.builtbroken.mc.prefab.tile.BlockTile)2 Tile (com.builtbroken.mc.prefab.tile.Tile)2 FakeWorld (com.builtbroken.mc.testing.junit.world.FakeWorld)2 Test (org.junit.Test)2 Point (com.builtbroken.mc.imp.transform.vector.Point)1