當前位置: 首頁>>代碼示例>>Java>>正文


Java TileEntitySign.func_145914_a方法代碼示例

本文整理匯總了Java中net.minecraft.tileentity.TileEntitySign.func_145914_a方法的典型用法代碼示例。如果您正苦於以下問題:Java TileEntitySign.func_145914_a方法的具體用法?Java TileEntitySign.func_145914_a怎麽用?Java TileEntitySign.func_145914_a使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在net.minecraft.tileentity.TileEntitySign的用法示例。


在下文中一共展示了TileEntitySign.func_145914_a方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: handleUpdateSign

import net.minecraft.tileentity.TileEntitySign; //導入方法依賴的package包/類
/**
 * Updates a specified sign with the specified text lines
 */
public void handleUpdateSign(S33PacketUpdateSign p_147248_1_)
{
    boolean var2 = false;

    if (this.gameController.theWorld.blockExists(p_147248_1_.func_149346_c(), p_147248_1_.func_149345_d(), p_147248_1_.func_149344_e()))
    {
        TileEntity var3 = this.gameController.theWorld.getTileEntity(p_147248_1_.func_149346_c(), p_147248_1_.func_149345_d(), p_147248_1_.func_149344_e());

        if (var3 instanceof TileEntitySign)
        {
            TileEntitySign var4 = (TileEntitySign)var3;

            if (var4.func_145914_a())
            {
                for (int var5 = 0; var5 < 4; ++var5)
                {
                    var4.field_145915_a[var5] = p_147248_1_.func_149347_f()[var5];
                }

                var4.onInventoryChanged();
            }

            var2 = true;
        }
    }

    if (!var2 && this.gameController.thePlayer != null)
    {
        this.gameController.thePlayer.addChatMessage(new ChatComponentText("Unable to locate sign at " + p_147248_1_.func_149346_c() + ", " + p_147248_1_.func_149345_d() + ", " + p_147248_1_.func_149344_e()));
    }
}
 
開發者ID:MinecraftModdedClients,項目名稱:Resilience-Client-Source,代碼行數:35,代碼來源:NetHandlerPlayClient.java

示例2: handleUpdateSign

import net.minecraft.tileentity.TileEntitySign; //導入方法依賴的package包/類
public void handleUpdateSign(S33PacketUpdateSign p_147248_1_)
{
    boolean flag = false;

    if (this.gameController.theWorld.blockExists(p_147248_1_.func_149346_c(), p_147248_1_.func_149345_d(), p_147248_1_.func_149344_e()))
    {
        TileEntity tileentity = this.gameController.theWorld.getTileEntity(p_147248_1_.func_149346_c(), p_147248_1_.func_149345_d(), p_147248_1_.func_149344_e());

        if (tileentity instanceof TileEntitySign)
        {
            TileEntitySign tileentitysign = (TileEntitySign)tileentity;

            if (tileentitysign.func_145914_a())
            {
                for (int i = 0; i < 4; ++i)
                {
                    tileentitysign.signText[i] = p_147248_1_.func_149347_f()[i];
                }

                tileentitysign.markDirty();
            }

            flag = true;
        }
    }

    if (!flag && this.gameController.thePlayer != null)
    {
        this.gameController.thePlayer.addChatMessage(new ChatComponentText("Unable to locate sign at " + p_147248_1_.func_149346_c() + ", " + p_147248_1_.func_149345_d() + ", " + p_147248_1_.func_149344_e()));
    }
}
 
開發者ID:xtrafrancyz,項目名稱:Cauldron,代碼行數:32,代碼來源:NetHandlerPlayClient.java

示例3: processUpdateSign

import net.minecraft.tileentity.TileEntitySign; //導入方法依賴的package包/類
public void processUpdateSign(C12PacketUpdateSign p_147343_1_)
{
    this.playerEntity.func_143004_u();
    WorldServer var2 = this.serverController.worldServerForDimension(this.playerEntity.dimension);

    if (var2.blockExists(p_147343_1_.func_149588_c(), p_147343_1_.func_149586_d(), p_147343_1_.func_149585_e()))
    {
        TileEntity var3 = var2.getTileEntity(p_147343_1_.func_149588_c(), p_147343_1_.func_149586_d(), p_147343_1_.func_149585_e());

        if (var3 instanceof TileEntitySign)
        {
            TileEntitySign var4 = (TileEntitySign)var3;

            if (!var4.func_145914_a() || var4.func_145911_b() != this.playerEntity)
            {
                this.serverController.logWarning("Player " + this.playerEntity.getCommandSenderName() + " just tried to change non-editable sign");
                return;
            }
        }

        int var6;
        int var8;

        for (var8 = 0; var8 < 4; ++var8)
        {
            boolean var5 = true;

            if (p_147343_1_.func_149589_f()[var8].length() > 15)
            {
                var5 = false;
            }
            else
            {
                for (var6 = 0; var6 < p_147343_1_.func_149589_f()[var8].length(); ++var6)
                {
                    if (!ChatAllowedCharacters.isAllowedCharacter(p_147343_1_.func_149589_f()[var8].charAt(var6)))
                    {
                        var5 = false;
                    }
                }
            }

            if (!var5)
            {
                p_147343_1_.func_149589_f()[var8] = "!?";
            }
        }

        if (var3 instanceof TileEntitySign)
        {
            var8 = p_147343_1_.func_149588_c();
            int var9 = p_147343_1_.func_149586_d();
            var6 = p_147343_1_.func_149585_e();
            TileEntitySign var7 = (TileEntitySign)var3;
            System.arraycopy(p_147343_1_.func_149589_f(), 0, var7.field_145915_a, 0, 4);
            var7.onInventoryChanged();
            var2.func_147471_g(var8, var9, var6);
        }
    }
}
 
開發者ID:MinecraftModdedClients,項目名稱:Resilience-Client-Source,代碼行數:61,代碼來源:NetHandlerPlayServer.java

示例4: processUpdateSign

import net.minecraft.tileentity.TileEntitySign; //導入方法依賴的package包/類
public void processUpdateSign(C12PacketUpdateSign p_147343_1_)
{
    this.playerEntity.func_143004_u();
    WorldServer worldserver = this.serverController.worldServerForDimension(this.playerEntity.dimension);

    if (worldserver.blockExists(p_147343_1_.func_149588_c(), p_147343_1_.func_149586_d(), p_147343_1_.func_149585_e()))
    {
        TileEntity tileentity = worldserver.getTileEntity(p_147343_1_.func_149588_c(), p_147343_1_.func_149586_d(), p_147343_1_.func_149585_e());

        if (tileentity instanceof TileEntitySign)
        {
            TileEntitySign tileentitysign = (TileEntitySign)tileentity;

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

        int i;
        int j;

        for (j = 0; j < 4; ++j)
        {
            boolean flag = true;

            if (p_147343_1_.func_149589_f()[j].length() > 15)
            {
                flag = false;
            }
            else
            {
                for (i = 0; i < p_147343_1_.func_149589_f()[j].length(); ++i)
                {
                    if (!ChatAllowedCharacters.isAllowedCharacter(p_147343_1_.func_149589_f()[j].charAt(i)))
                    {
                        flag = false;
                    }
                }
            }

            if (!flag)
            {
                p_147343_1_.func_149589_f()[j] = "!?";
            }
        }

        if (tileentity instanceof TileEntitySign)
        {
            j = p_147343_1_.func_149588_c();
            int k = p_147343_1_.func_149586_d();
            i = p_147343_1_.func_149585_e();
            TileEntitySign tileentitysign1 = (TileEntitySign)tileentity;
            System.arraycopy(p_147343_1_.func_149589_f(), 0, tileentitysign1.signText, 0, 4);
            tileentitysign1.markDirty();
            worldserver.markBlockForUpdate(j, k, i);
        }
    }
}
 
開發者ID:xtrafrancyz,項目名稱:Cauldron,代碼行數:61,代碼來源:NetHandlerPlayServer.java


注:本文中的net.minecraft.tileentity.TileEntitySign.func_145914_a方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。