当前位置: 首页>>代码示例>>Java>>正文


Java NextTickListEntry类代码示例

本文整理汇总了Java中net.minecraft.world.NextTickListEntry的典型用法代码示例。如果您正苦于以下问题:Java NextTickListEntry类的具体用法?Java NextTickListEntry怎么用?Java NextTickListEntry使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


NextTickListEntry类属于net.minecraft.world包,在下文中一共展示了NextTickListEntry类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: iterator

import net.minecraft.world.NextTickListEntry; //导入依赖的package包/类
@Override
public Iterator<NextTickListEntry> iterator() {
    return new Iterator<NextTickListEntry>() {
        private final TLongObjectIterator<BlockUpdateEntry> iterator = trackerMap.iterator();;

        @Override
        public boolean hasNext() {
            return iterator.hasNext();
        }

        @Override
        public NextTickListEntry next() {
            iterator.advance();
            return iterator.value().asMCEntry();
        }

        @Override
        public void remove() {
            removeEntry(iterator.value(), true);
        }
    };
}
 
开发者ID:UraniumMC,项目名称:Uranium,代码行数:23,代码来源:BlockUpdatesTracker.java

示例2: add

import net.minecraft.world.NextTickListEntry; //导入依赖的package包/类
public boolean add(NextTickListEntry e) {
    if (add.remove(e)) {
        allocateEntry(e.xCoord, e.yCoord, e.zCoord, e.priority, e.scheduledTime, e.func_151351_a());
        return true;
    }
    return add.add(e);
}
 
开发者ID:UraniumMC,项目名称:Uranium,代码行数:8,代码来源:BlockUpdatesTracker.java

示例3: remove

import net.minecraft.world.NextTickListEntry; //导入依赖的package包/类
public boolean remove(NextTickListEntry e) {
    if (remove.remove(e)) {
        removeEntry(e.xCoord, e.yCoord, e.zCoord);
        return true;
    }
    return remove.add(e);
}
 
开发者ID:UraniumMC,项目名称:Uranium,代码行数:8,代码来源:BlockUpdatesTracker.java

示例4: contains

import net.minecraft.world.NextTickListEntry; //导入依赖的package包/类
public boolean contains(NextTickListEntry e, boolean allowInterscan) {
    if (allowInterscan) {
        if (add.contains(e))
            return true;
        if (remove.contains(e))
            return false;
    }
    return getEntry(e.xCoord, e.yCoord, e.zCoord) != null;
}
 
开发者ID:UraniumMC,项目名称:Uranium,代码行数:10,代码来源:BlockUpdatesTracker.java

示例5: contains

import net.minecraft.world.NextTickListEntry; //导入依赖的package包/类
public boolean contains(Object p_contains_1_)
{
    if (!(p_contains_1_ instanceof NextTickListEntry))
    {
        return false;
    }
    else
    {
        NextTickListEntry nextticklistentry = (NextTickListEntry)p_contains_1_;
        Set set = this.getSubSet(nextticklistentry, false);
        return set == null ? false : set.contains(nextticklistentry);
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:14,代码来源:NextTickHashSet.java

示例6: add

import net.minecraft.world.NextTickListEntry; //导入依赖的package包/类
public boolean add(Object p_add_1_)
{
    if (!(p_add_1_ instanceof NextTickListEntry))
    {
        return false;
    }
    else
    {
        NextTickListEntry nextticklistentry = (NextTickListEntry)p_add_1_;

        if (nextticklistentry == null)
        {
            return false;
        }
        else
        {
            Set set = this.getSubSet(nextticklistentry, true);
            boolean flag = set.add(nextticklistentry);
            boolean flag1 = super.add(p_add_1_);

            if (flag != flag1)
            {
                throw new IllegalStateException("Added: " + flag + ", addedParent: " + flag1);
            }
            else
            {
                return flag1;
            }
        }
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:32,代码来源:NextTickHashSet.java

示例7: remove

import net.minecraft.world.NextTickListEntry; //导入依赖的package包/类
public boolean remove(Object p_remove_1_)
{
    if (!(p_remove_1_ instanceof NextTickListEntry))
    {
        return false;
    }
    else
    {
        NextTickListEntry nextticklistentry = (NextTickListEntry)p_remove_1_;
        Set set = this.getSubSet(nextticklistentry, false);

        if (set == null)
        {
            return false;
        }
        else
        {
            boolean flag = set.remove(nextticklistentry);
            boolean flag1 = super.remove(nextticklistentry);

            if (flag != flag1)
            {
                throw new IllegalStateException("Added: " + flag + ", addedParent: " + flag1);
            }
            else
            {
                return flag1;
            }
        }
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:32,代码来源:NextTickHashSet.java

示例8: getSubSet

import net.minecraft.world.NextTickListEntry; //导入依赖的package包/类
private Set getSubSet(NextTickListEntry p_getSubSet_1_, boolean p_getSubSet_2_)
{
    if (p_getSubSet_1_ == null)
    {
        return null;
    }
    else
    {
        BlockPos blockpos = p_getSubSet_1_.position;
        int i = blockpos.getX() >> 4;
        int j = blockpos.getZ() >> 4;
        return this.getSubSet(i, j, p_getSubSet_2_);
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:15,代码来源:NextTickHashSet.java

示例9: getPendingBlockUpdates

import net.minecraft.world.NextTickListEntry; //导入依赖的package包/类
@Override
public List<NextTickListEntry> getPendingBlockUpdates(Chunk chunkIn, boolean remove) {
	if (m_proxyWorld != null && Util.isPrefixInCallStack(m_modPrefix)) {
		return m_proxyWorld.getPendingBlockUpdates(chunkIn, remove);
	} else if (m_realWorld != null) {
		return m_realWorld.getPendingBlockUpdates(chunkIn, remove);
	} else {
		return super.getPendingBlockUpdates(chunkIn, remove);
	}
}
 
开发者ID:orbwoi,项目名称:UniversalRemote,代码行数:11,代码来源:WorldServerProxy.java

示例10: updateBlockTick

import net.minecraft.world.NextTickListEntry; //导入依赖的package包/类
@Override
public void updateBlockTick(BlockPos pos, Block block, int delay, int priority) {
    if (pos instanceof BlockPos.MutableBlockPos) {
        pos = new BlockPos(pos);
        LogManager.getLogger().warn("Tried to assign a mutable BlockPos to tick data...", new Error(pos.getClass().toString()));
    }
    Material material = block.getDefaultState().getMaterial();
    if (this.scheduledUpdatesAreImmediate && material != Material.AIR) {
        if (block.requiresUpdates()) {
            boolean isForced = this.getPersistentChunks().containsKey(new ChunkPos(pos));
            int range = isForced ? 0 : 8;
            if (this.isAreaLoaded(pos.add(-range, -range, -range), pos.add(range, range, range))) {
                IBlockState state = this.getBlockState(pos);
                if (state.getMaterial() != Material.AIR && state.getBlock() == block) {
                    state.getBlock().updateTick(this, pos, state, this.rand);
                }
            }
            return;
        }
        delay = 1;
    }
    NextTickListEntry schedule = new NextTickListEntry(pos, block);
    if (this.isBlockLoaded(pos)) {
        if (material != Material.AIR) {
            schedule.setScheduledTime((long) delay + this.worldInfo.getWorldTotalTime());
            schedule.setPriority(priority);
        }
        if (!this.scheduledTicksSet.contains(schedule)) {
            this.scheduledTicksSet.add(schedule);
            this.scheduledTicksTree.add(schedule);
        }
    }
}
 
开发者ID:gegy1000,项目名称:BlockSystems,代码行数:34,代码来源:BlockSystemServer.java

示例11: scheduleBlockUpdate

import net.minecraft.world.NextTickListEntry; //导入依赖的package包/类
@Override
public void scheduleBlockUpdate(BlockPos pos, Block block, int delay, int priority) {
    NextTickListEntry schedule = new NextTickListEntry(pos, block);
    schedule.setPriority(priority);
    Material material = block.getDefaultState().getMaterial();
    if (material != Material.AIR) {
        schedule.setScheduledTime((long) delay + this.worldInfo.getWorldTotalTime());
    }
    if (!this.scheduledTicksSet.contains(schedule)) {
        this.scheduledTicksSet.add(schedule);
        this.scheduledTicksTree.add(schedule);
    }
}
 
开发者ID:gegy1000,项目名称:BlockSystems,代码行数:14,代码来源:BlockSystemServer.java

示例12: getPendingBlockUpdates

import net.minecraft.world.NextTickListEntry; //导入依赖的package包/类
@Override
public List<NextTickListEntry> getPendingBlockUpdates(StructureBoundingBox bounds, boolean remove) {
    List<NextTickListEntry> updates = null;
    for (int i = 0; i < 2; i++) {
        Iterator<NextTickListEntry> iterator;
        if (i == 0) {
            iterator = this.scheduledTicksTree.iterator();
        } else {
            iterator = this.currentScheduledTicks.iterator();
        }
        while (iterator.hasNext()) {
            NextTickListEntry scheduledUpdate = iterator.next();
            BlockPos position = scheduledUpdate.position;
            if (position.getX() >= bounds.minX && position.getX() < bounds.maxX && position.getZ() >= bounds.minZ && position.getZ() < bounds.maxZ) {
                if (remove) {
                    if (i == 0) {
                        this.scheduledTicksSet.remove(scheduledUpdate);
                    }
                    iterator.remove();
                }
                if (updates == null) {
                    updates = Lists.newArrayList();
                }
                updates.add(scheduledUpdate);
            }
        }
    }
    return updates;
}
 
开发者ID:gegy1000,项目名称:BlockSystems,代码行数:30,代码来源:BlockSystemServer.java

示例13: func_147446_b

import net.minecraft.world.NextTickListEntry; //导入依赖的package包/类
public void func_147446_b(int x, int y, int z, Block block, int delay, int priority) {
	if (block.getMaterial() == Material.air)
		return;

	final NextTickListEntry tickEntry = new NextTickListEntry(x, y, z, block);

	// If we can add it isn't a duplicate
	if (this.containment.add(tickEntry)) {
		tickEntry.setPriority(priority);
		tickEntry.setScheduledTime((long) delay + this.worldInfo.getWorldTotalTime());
		this.pendingTickListEntries.add(tickEntry);
	}
}
 
开发者ID:OreCruncher,项目名称:Jiffy,代码行数:14,代码来源:WorldServer.java

示例14: initialize

import net.minecraft.world.NextTickListEntry; //导入依赖的package包/类
protected void initialize(WorldSettings settings) {
	// This is here because the World CTOR triggers world
	// gen that can occur *before* WorldServer has a chance
	// to initialize. :\
	if (this.entityIdMap == null)
		this.entityIdMap = new IntHashMap();
	if (this.pendingTickListEntries == null)
		this.pendingTickListEntries = new PriorityQueue<NextTickListEntry>(QUEUE_SIZE);
	if (this.containment == null)
		containment = new HashSet<NextTickListEntry>(QUEUE_SIZE);

	this.createSpawnPosition(settings);
	super.initialize(settings);
}
 
开发者ID:OreCruncher,项目名称:Jiffy,代码行数:15,代码来源:WorldServer.java

示例15: contains

import net.minecraft.world.NextTickListEntry; //导入依赖的package包/类
public boolean contains(Object obj)
 {
     if (!(obj instanceof NextTickListEntry))
     {
         return false;
     }
     else
     {
         NextTickListEntry entry = (NextTickListEntry)obj;

         long key = ChunkCoordIntPair.chunkXZ2Int(entry.xCoord >> 4, entry.zCoord >> 4);
HashSet set = (HashSet)this.longHashMap.getValueByKey(key);
return set == null ? false : set.contains(entry);
     }
 }
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:16,代码来源:NextTickHashSet.java


注:本文中的net.minecraft.world.NextTickListEntry类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。