本文整理汇总了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);
}
}
示例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();
}
}
}
示例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();
}
}
}