use of org.spongepowered.api.block.ScheduledBlockUpdate in project SpongeCommon by SpongePowered.
the class MixinWorldServer method addScheduledUpdate.
@Override
public ScheduledBlockUpdate addScheduledUpdate(int x, int y, int z, int priority, int ticks) {
BlockPos pos = new BlockPos(x, y, z);
this.updateBlockTick(pos, getBlockState(pos).getBlock(), ticks, priority);
ScheduledBlockUpdate sbu = (ScheduledBlockUpdate) this.tmpScheduledObj;
this.tmpScheduledObj = null;
return sbu;
}
use of org.spongepowered.api.block.ScheduledBlockUpdate in project SpongeCommon by SpongePowered.
the class MixinWorldServer method getScheduledUpdates.
@Override
public Collection<ScheduledBlockUpdate> getScheduledUpdates(int x, int y, int z) {
BlockPos position = new BlockPos(x, y, z);
ImmutableList.Builder<ScheduledBlockUpdate> builder = ImmutableList.builder();
for (NextTickListEntry sbu : this.pendingTickListEntriesTreeSet) {
if (sbu.position.equals(position)) {
builder.add((ScheduledBlockUpdate) sbu);
}
}
return builder.build();
}
use of org.spongepowered.api.block.ScheduledBlockUpdate in project LanternServer by LanternPowered.
the class LanternChunk method getScheduledUpdates.
@Override
public Collection<ScheduledBlockUpdate> getScheduledUpdates(int x, int y, int z) {
checkVolumeBounds(x, y, z);
if (!this.loaded) {
return Collections.emptyList();
}
final Vector3i position = new Vector3i(x, y, z);
return this.scheduledBlockUpdateQueue.stream().filter(update -> update.getLocation().getBlockPosition().equals(position)).collect(ImmutableSet.toImmutableSet());
}
Aggregations