Java 类net.minecraft.network.play.client.CPacketUpdateSign 实例源码

项目:Zombe-Modpack    文件:NetHandlerPlayServer.java   
public void processUpdateSign(CPacketUpdateSign packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.playerEntity.getServerWorld());
    this.playerEntity.markPlayerActive();
    WorldServer worldserver = this.serverController.worldServerForDimension(this.playerEntity.dimension);
    BlockPos blockpos = packetIn.getPosition();

    if (worldserver.isBlockLoaded(blockpos))
    {
        IBlockState iblockstate = worldserver.getBlockState(blockpos);
        TileEntity tileentity = worldserver.getTileEntity(blockpos);

        if (!(tileentity instanceof TileEntitySign))
        {
            return;
        }

        TileEntitySign tileentitysign = (TileEntitySign)tileentity;

        if (!tileentitysign.getIsEditable() || tileentitysign.getPlayer() != this.playerEntity)
        {
            this.serverController.logWarning("Player " + this.playerEntity.getName() + " just tried to change non-editable sign");
            return;
        }

        String[] astring = packetIn.getLines();

        for (int i = 0; i < astring.length; ++i)
        {
            tileentitysign.signText[i] = new TextComponentString(TextFormatting.getTextWithoutFormattingCodes(astring[i]));
        }

        tileentitysign.markDirty();
        worldserver.notifyBlockUpdate(blockpos, iblockstate, iblockstate, 3);
    }
}
项目:Backmemed    文件:NetHandlerPlayServer.java   
public void processUpdateSign(CPacketUpdateSign packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.playerEntity.getServerWorld());
    this.playerEntity.markPlayerActive();
    WorldServer worldserver = this.serverController.worldServerForDimension(this.playerEntity.dimension);
    BlockPos blockpos = packetIn.getPosition();

    if (worldserver.isBlockLoaded(blockpos))
    {
        IBlockState iblockstate = worldserver.getBlockState(blockpos);
        TileEntity tileentity = worldserver.getTileEntity(blockpos);

        if (!(tileentity instanceof TileEntitySign))
        {
            return;
        }

        TileEntitySign tileentitysign = (TileEntitySign)tileentity;

        if (!tileentitysign.getIsEditable() || tileentitysign.getPlayer() != this.playerEntity)
        {
            this.serverController.logWarning("Player " + this.playerEntity.getName() + " just tried to change non-editable sign");
            return;
        }

        String[] astring = packetIn.getLines();

        for (int i = 0; i < astring.length; ++i)
        {
            tileentitysign.signText[i] = new TextComponentString(TextFormatting.getTextWithoutFormattingCodes(astring[i]));
        }

        tileentitysign.markDirty();
        worldserver.notifyBlockUpdate(blockpos, iblockstate, iblockstate, 3);
    }
}
项目:Backmemed    文件:GuiEditSign.java   
/**
 * Called when the screen is unloaded. Used to disable keyboard repeat events
 */
public void onGuiClosed()
{
    Keyboard.enableRepeatEvents(false);
    NetHandlerPlayClient nethandlerplayclient = this.mc.getConnection();

    if (nethandlerplayclient != null)
    {
        nethandlerplayclient.sendPacket(new CPacketUpdateSign(this.tileSign.getPos(), this.tileSign.signText));
    }

    this.tileSign.setEditable(true);
}
项目:CustomWorldGen    文件:NetHandlerPlayServer.java   
public void processUpdateSign(CPacketUpdateSign packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.playerEntity.getServerWorld());
    this.playerEntity.markPlayerActive();
    WorldServer worldserver = this.serverController.worldServerForDimension(this.playerEntity.dimension);
    BlockPos blockpos = packetIn.getPosition();

    if (worldserver.isBlockLoaded(blockpos))
    {
        IBlockState iblockstate = worldserver.getBlockState(blockpos);
        TileEntity tileentity = worldserver.getTileEntity(blockpos);

        if (!(tileentity instanceof TileEntitySign))
        {
            return;
        }

        TileEntitySign tileentitysign = (TileEntitySign)tileentity;

        if (!tileentitysign.getIsEditable() || tileentitysign.getPlayer() != this.playerEntity)
        {
            this.serverController.logWarning("Player " + this.playerEntity.getName() + " just tried to change non-editable sign");
            return;
        }

        String[] astring = packetIn.getLines();

        for (int i = 0; i < astring.length; ++i)
        {
            tileentitysign.signText[i] = new TextComponentString(TextFormatting.getTextWithoutFormattingCodes(astring[i]));
        }

        tileentitysign.markDirty();
        worldserver.notifyBlockUpdate(blockpos, iblockstate, iblockstate, 3);
    }
}
项目:CustomWorldGen    文件:GuiEditSign.java   
/**
 * Called when the screen is unloaded. Used to disable keyboard repeat events
 */
public void onGuiClosed()
{
    Keyboard.enableRepeatEvents(false);
    NetHandlerPlayClient nethandlerplayclient = this.mc.getConnection();

    if (nethandlerplayclient != null)
    {
        nethandlerplayclient.sendPacket(new CPacketUpdateSign(this.tileSign.getPos(), this.tileSign.signText));
    }

    this.tileSign.setEditable(true);
}
项目:Floocraft    文件:GuiFlooSign.java   
/**
 * Called when the screen is unloaded. Used to disable keyboard repeat events
 */
public void onGuiClosed()
{
    Keyboard.enableRepeatEvents(false);
    NetHandlerPlayClient netclienthandler = this.mc.getConnection();
    if (netclienthandler != null)
    {
        netclienthandler.sendPacket(new CPacketUpdateSign(this.fireplaceTE.getPos(), this.fireplaceTE.signText));
    }
}
项目:ExpandedRailsMod    文件:NetHandlerPlayServer.java   
public void processUpdateSign(CPacketUpdateSign packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.playerEntity.getServerWorld());
    this.playerEntity.markPlayerActive();
    WorldServer worldserver = this.serverController.worldServerForDimension(this.playerEntity.dimension);
    BlockPos blockpos = packetIn.getPosition();

    if (worldserver.isBlockLoaded(blockpos))
    {
        IBlockState iblockstate = worldserver.getBlockState(blockpos);
        TileEntity tileentity = worldserver.getTileEntity(blockpos);

        if (!(tileentity instanceof TileEntitySign))
        {
            return;
        }

        TileEntitySign tileentitysign = (TileEntitySign)tileentity;

        if (!tileentitysign.getIsEditable() || tileentitysign.getPlayer() != this.playerEntity)
        {
            this.serverController.logWarning("Player " + this.playerEntity.getName() + " just tried to change non-editable sign");
            return;
        }

        String[] astring = packetIn.getLines();

        for (int i = 0; i < astring.length; ++i)
        {
            tileentitysign.signText[i] = new TextComponentString(TextFormatting.getTextWithoutFormattingCodes(astring[i]));
        }

        tileentitysign.markDirty();
        worldserver.notifyBlockUpdate(blockpos, iblockstate, iblockstate, 3);
    }
}
项目:ExpandedRailsMod    文件:GuiEditSign.java   
/**
 * Called when the screen is unloaded. Used to disable keyboard repeat events
 */
public void onGuiClosed()
{
    Keyboard.enableRepeatEvents(false);
    NetHandlerPlayClient nethandlerplayclient = this.mc.getConnection();

    if (nethandlerplayclient != null)
    {
        nethandlerplayclient.sendPacket(new CPacketUpdateSign(this.tileSign.getPos(), this.tileSign.signText));
    }

    this.tileSign.setEditable(true);
}
项目:PacketControl    文件:PacketRegistryModule.java   
@DelayedRegistration(RegistrationPhase.PRE_INIT)
@Override
public void registerDefaults() {
    // Handshake
    register("handshake", "Handshake", PacketSide.SERVERBOUND, PacketPhase.HANDSHAKE, C00Handshake.class);

    // Entity
    clientbound("destroy_entities", "Destroy Entities", SPacketDestroyEntities.class, PacketControlFactory::createDestroyEntities);
    clientbound("entity_metadata", "Entity Metadata", SPacketEntityMetadata.class, PacketControlFactory::createEntityMetadata);
    clientbound("entity_velocity", "Entity Velocity", SPacketEntityVelocity.class);
    clientbound("spawn_experience_orb", "Spawn Experience Orb", SPacketSpawnExperienceOrb.class);
    clientbound("spawn_global_entity", "Spawn Global Entity", SPacketSpawnGlobalEntity.class);
    clientbound("spawn_mob", "Spawn Mob", SPacketSpawnMob.class);
    clientbound("spawn_object", "Spawn Object", SPacketSpawnObject.class, PacketControlFactory::createSpawnObject);
    clientbound("spawn_painting", "Spawn Painting", SPacketSpawnPainting.class);

    // Inventory
    clientbound("close_window", "Close Window", SPacketCloseWindow.class, PacketControlFactory::createCloseWindow);
    clientbound("confirm_transaction", "Confirm Transaction", SPacketConfirmTransaction.class, PacketControlFactory::createConfirmTransaction);
    clientbound("open_window", "Open Window", SPacketOpenWindow.class, PacketControlFactory::createOpenWindow);
    clientbound("set_slot", "Set Slot", SPacketSetSlot.class, PacketControlFactory::createSetSlot);
    clientbound("window_items", "Window Items", SPacketWindowItems.class, PacketControlFactory::createWindowItems);

    // Player
    clientbound("player_abilities", "Player Abilities", SPacketPlayerAbilities.class, PacketControlFactory::createPlayerAbilities);
    clientbound("spawn_player", "Spawn Player", SPacketSpawnPlayer.class);
    clientbound("use_bed", "Use Bed", SPacketUseBed.class, PacketControlFactory::createUseBed);
    clientbound("vehicle_position", "Vehicle Position", SPacketMoveVehicle.class);

    // World
    clientbound("custom_sound", "Custom Sound", SPacketCustomSound.class, PacketControlFactory::createCustomSound);
    clientbound("game_sound", "Game Sound", SPacketSoundEffect.class, PacketControlFactory::createGameSound);
    clientbound("open_sign_editor", "Open Sign Editor", SPacketSignEditorOpen.class, PacketControlFactory::createOpenSignEditor);
    clientbound("world_time", "World Time", SPacketTimeUpdate.class, PacketControlFactory::createWorldTime);

    // Client
    serverbound("click_window", "Click Window", CPacketClickWindow.class);
    serverbound("move_vehicle", "Move Vehicle", CPacketVehicleMove.class);
    serverbound("update_sign", "Update Sign", CPacketUpdateSign.class);
    serverbound("window_close", "Window Close", CPacketCloseWindow.class);
}
项目:CrystalMod    文件:FakeNetHandlerPlayServer.java   
@Override
public void processUpdateSign(CPacketUpdateSign p_147343_1_) {
}
项目:EnderIO    文件:FakeNetHandlerPlayServer.java   
@Override
public void processUpdateSign(@Nonnull CPacketUpdateSign p_147343_1_) {
}
项目:DankNull    文件:NetServerHandlerFake.java   
@Override
public void processUpdateSign(CPacketUpdateSign packetIn) {

}
项目:Backmemed    文件:INetHandlerPlayServer.java   
void processUpdateSign(CPacketUpdateSign packetIn);
项目:CustomWorldGen    文件:INetHandlerPlayServer.java   
void processUpdateSign(CPacketUpdateSign packetIn);