Disable spigot tick limiters

This commit is contained in:
Zach Brown
2016-03-02 23:45:17 -06:00
parent da1b68adca
commit c8c53412a4

View File

@@ -284,7 +284,7 @@
if (this.isOutsideBuildHeight(pos)) { if (this.isOutsideBuildHeight(pos)) {
return false; return false;
} else if (!this.isClientSide && this.isDebug()) { } else if (!this.isClientSide && this.isDebug()) {
@@ -214,45 +378,124 @@ @@ -214,44 +378,123 @@
} else { } else {
LevelChunk chunk = this.getChunkAt(pos); LevelChunk chunk = this.getChunkAt(pos);
Block block = state.getBlock(); Block block = state.getBlock();
@@ -368,10 +368,10 @@
+ // CraftBukkit end + // CraftBukkit end
+ +
return true; return true;
} + }
} + }
} + }
+
+ // CraftBukkit start - Split off from above in order to directly send client and physic updates + // CraftBukkit start - Split off from above in order to directly send client and physic updates
+ public void notifyAndUpdatePhysics(BlockPos blockposition, LevelChunk chunk, BlockState oldBlock, BlockState newBlock, BlockState actualBlock, int i, int j) { + public void notifyAndUpdatePhysics(BlockPos blockposition, LevelChunk chunk, BlockState oldBlock, BlockState newBlock, BlockState actualBlock, int i, int j) {
+ BlockState iblockdata = newBlock; + BlockState iblockdata = newBlock;
@@ -391,7 +391,7 @@
+ if (!this.isClientSide && iblockdata.hasAnalogOutputSignal()) { + if (!this.isClientSide && iblockdata.hasAnalogOutputSignal()) {
+ this.updateNeighbourForOutputSignal(blockposition, newBlock.getBlock()); + this.updateNeighbourForOutputSignal(blockposition, newBlock.getBlock());
+ } + }
+ } }
+ +
+ if ((i & 16) == 0 && j > 0) { + if ((i & 16) == 0 && j > 0) {
+ int k = i & -34; + int k = i & -34;
@@ -417,13 +417,12 @@
+ this.onBlockStateChange(blockposition, iblockdata1, iblockdata2); + this.onBlockStateChange(blockposition, iblockdata1, iblockdata2);
+ } + }
+ // CraftBukkit end + // CraftBukkit end
+ } }
+ } }
+ // CraftBukkit end + // CraftBukkit end
+
public void onBlockStateChange(BlockPos pos, BlockState oldBlock, BlockState newBlock) {} public void onBlockStateChange(BlockPos pos, BlockState oldBlock, BlockState newBlock) {}
@Override
@@ -340,10 +583,18 @@ @@ -340,10 +583,18 @@
@Override @Override
@@ -444,7 +443,7 @@
return chunk.getBlockState(pos); return chunk.getBlockState(pos);
} }
@@ -446,14 +697,23 @@ @@ -446,14 +697,21 @@
this.pendingBlockEntityTickers.clear(); this.pendingBlockEntityTickers.clear();
} }
@@ -456,9 +455,7 @@
- while (iterator.hasNext()) { - while (iterator.hasNext()) {
- TickingBlockEntity tickingblockentity = (TickingBlockEntity) iterator.next(); - TickingBlockEntity tickingblockentity = (TickingBlockEntity) iterator.next();
+ int tilesThisCycle = 0; + int tilesThisCycle = 0;
+ for (this.tileLimiter.initTick(); + for (tileTickPosition = 0; tileTickPosition < this.blockEntityTickers.size(); tileTickPosition++) { // Paper - Disable tick limiters
+ tilesThisCycle < this.blockEntityTickers.size() && (tilesThisCycle % 10 != 0 || this.tileLimiter.shouldContinue());
+ this.tileTickPosition++, tilesThisCycle++) {
+ this.tileTickPosition = (this.tileTickPosition < this.blockEntityTickers.size()) ? this.tileTickPosition : 0; + this.tileTickPosition = (this.tileTickPosition < this.blockEntityTickers.size()) ? this.tileTickPosition : 0;
+ TickingBlockEntity tickingblockentity = (TickingBlockEntity) this.blockEntityTickers.get(this.tileTickPosition); + TickingBlockEntity tickingblockentity = (TickingBlockEntity) this.blockEntityTickers.get(this.tileTickPosition);
+ // Spigot end + // Spigot end
@@ -472,7 +469,7 @@
} else if (flag && this.shouldTickBlocksAt(tickingblockentity.getPos())) { } else if (flag && this.shouldTickBlocksAt(tickingblockentity.getPos())) {
tickingblockentity.tick(); tickingblockentity.tick();
} }
@@ -461,17 +721,18 @@ @@ -461,17 +719,18 @@
this.tickingBlockEntities = false; this.tickingBlockEntities = false;
gameprofilerfiller.pop(); gameprofilerfiller.pop();
@@ -496,7 +493,7 @@
} }
} }
@@ -510,13 +771,29 @@ @@ -510,13 +769,29 @@
@Nullable @Nullable
@Override @Override
public BlockEntity getBlockEntity(BlockPos pos) { public BlockEntity getBlockEntity(BlockPos pos) {
@@ -527,7 +524,7 @@
this.getChunkAt(blockposition).addAndRegisterBlockEntity(blockEntity); this.getChunkAt(blockposition).addAndRegisterBlockEntity(blockEntity);
} }
} }
@@ -643,7 +920,7 @@ @@ -643,7 +918,7 @@
for (int k = 0; k < j; ++k) { for (int k = 0; k < j; ++k) {
EnderDragonPart entitycomplexpart = aentitycomplexpart[k]; EnderDragonPart entitycomplexpart = aentitycomplexpart[k];
@@ -536,7 +533,7 @@
if (t0 != null && predicate.test(t0)) { if (t0 != null && predicate.test(t0)) {
result.add(t0); result.add(t0);
@@ -912,7 +1189,7 @@ @@ -912,7 +1187,7 @@
public static enum ExplosionInteraction implements StringRepresentable { public static enum ExplosionInteraction implements StringRepresentable {