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


Java Block.isEqualTo方法代碼示例

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


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

示例1: equals

import net.minecraft.block.Block; //導入方法依賴的package包/類
public boolean equals(Object p_equals_1_)
{
    if (!(p_equals_1_ instanceof NextTickListEntry))
    {
        return false;
    }
    else
    {
        NextTickListEntry nextticklistentry = (NextTickListEntry)p_equals_1_;
        return this.position.equals(nextticklistentry.position) && Block.isEqualTo(this.block, nextticklistentry.block);
    }
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:13,代碼來源:NextTickListEntry.java

示例2: tickUpdates

import net.minecraft.block.Block; //導入方法依賴的package包/類
/**
 * Runs through the list of updates to run and ticks them
 */
public boolean tickUpdates(boolean p_72955_1_)
{
    if (this.worldInfo.getTerrainType() == WorldType.DEBUG_WORLD)
    {
        return false;
    }
    else
    {
        int i = this.pendingTickListEntriesTreeSet.size();

        if (i != this.pendingTickListEntriesHashSet.size())
        {
            throw new IllegalStateException("TickNextTick list out of synch");
        }
        else
        {
            if (i > 1000)
            {
                i = 1000;
            }

            this.theProfiler.startSection("cleaning");

            for (int j = 0; j < i; ++j)
            {
                NextTickListEntry nextticklistentry = (NextTickListEntry)this.pendingTickListEntriesTreeSet.first();

                if (!p_72955_1_ && nextticklistentry.scheduledTime > this.worldInfo.getWorldTotalTime())
                {
                    break;
                }

                this.pendingTickListEntriesTreeSet.remove(nextticklistentry);
                this.pendingTickListEntriesHashSet.remove(nextticklistentry);
                this.pendingTickListEntriesThisTick.add(nextticklistentry);
            }

            this.theProfiler.endSection();
            this.theProfiler.startSection("ticking");
            Iterator<NextTickListEntry> iterator = this.pendingTickListEntriesThisTick.iterator();

            while (iterator.hasNext())
            {
                NextTickListEntry nextticklistentry1 = (NextTickListEntry)iterator.next();
                iterator.remove();
                int k = 0;

                if (this.isAreaLoaded(nextticklistentry1.position.add(-k, -k, -k), nextticklistentry1.position.add(k, k, k)))
                {
                    IBlockState iblockstate = this.getBlockState(nextticklistentry1.position);

                    if (iblockstate.getBlock().getMaterial() != Material.air && Block.isEqualTo(iblockstate.getBlock(), nextticklistentry1.getBlock()))
                    {
                        try
                        {
                            iblockstate.getBlock().updateTick(this, nextticklistentry1.position, iblockstate, this.rand);
                        }
                        catch (Throwable throwable)
                        {
                            CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Exception while ticking a block");
                            CrashReportCategory crashreportcategory = crashreport.makeCategory("Block being ticked");
                            CrashReportCategory.addBlockInfo(crashreportcategory, nextticklistentry1.position, iblockstate);
                            throw new ReportedException(crashreport);
                        }
                    }
                }
                else
                {
                    this.scheduleUpdate(nextticklistentry1.position, nextticklistentry1.getBlock(), 0);
                }
            }

            this.theProfiler.endSection();
            this.pendingTickListEntriesThisTick.clear();
            return !this.pendingTickListEntriesTreeSet.isEmpty();
        }
    }
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:82,代碼來源:WorldServer.java

示例3: tickUpdates

import net.minecraft.block.Block; //導入方法依賴的package包/類
/**
 * Runs through the list of updates to run and ticks them
 */
public boolean tickUpdates(boolean p_72955_1_)
{
    if (this.worldInfo.getTerrainType() == WorldType.DEBUG_WORLD)
    {
        return false;
    }
    else
    {
        int i = this.pendingTickListEntriesTreeSet.size();

        if (i != this.pendingTickListEntriesHashSet.size())
        {
            throw new IllegalStateException("TickNextTick list out of synch");
        }
        else
        {
            if (i > 65536)
            {
                i = 65536;
            }

            this.theProfiler.startSection("cleaning");

            for (int j = 0; j < i; ++j)
            {
                NextTickListEntry nextticklistentry = (NextTickListEntry)this.pendingTickListEntriesTreeSet.first();

                if (!p_72955_1_ && nextticklistentry.scheduledTime > this.worldInfo.getWorldTotalTime())
                {
                    break;
                }

                this.pendingTickListEntriesTreeSet.remove(nextticklistentry);
                this.pendingTickListEntriesHashSet.remove(nextticklistentry);
                this.pendingTickListEntriesThisTick.add(nextticklistentry);
            }

            this.theProfiler.endSection();
            this.theProfiler.startSection("ticking");
            Iterator<NextTickListEntry> iterator = this.pendingTickListEntriesThisTick.iterator();

            while (iterator.hasNext())
            {
                NextTickListEntry nextticklistentry1 = (NextTickListEntry)iterator.next();
                iterator.remove();
                int k = 0;

                if (this.isAreaLoaded(nextticklistentry1.position.add(0, 0, 0), nextticklistentry1.position.add(0, 0, 0)))
                {
                    IBlockState iblockstate = this.getBlockState(nextticklistentry1.position);

                    if (iblockstate.getMaterial() != Material.AIR && Block.isEqualTo(iblockstate.getBlock(), nextticklistentry1.getBlock()))
                    {
                        try
                        {
                            iblockstate.getBlock().updateTick(this, nextticklistentry1.position, iblockstate, this.rand);
                        }
                        catch (Throwable throwable)
                        {
                            CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Exception while ticking a block");
                            CrashReportCategory crashreportcategory = crashreport.makeCategory("Block being ticked");
                            CrashReportCategory.addBlockInfo(crashreportcategory, nextticklistentry1.position, iblockstate);
                            throw new ReportedException(crashreport);
                        }
                    }
                }
                else
                {
                    this.scheduleUpdate(nextticklistentry1.position, nextticklistentry1.getBlock(), 0);
                }
            }

            this.theProfiler.endSection();
            this.pendingTickListEntriesThisTick.clear();
            return !this.pendingTickListEntriesTreeSet.isEmpty();
        }
    }
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:82,代碼來源:WorldServer.java


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