当前位置: 首页>>代码示例>>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;未经允许,请勿转载。