3
0

移除配置项

This commit is contained in:
聪聪 2017-08-03 08:29:25 +08:00
parent b4faaaeaa4
commit d099177983
2 changed files with 24 additions and 51 deletions

View File

@ -963,7 +963,7 @@
} }
catch (Throwable throwable1) catch (Throwable throwable1)
{ {
@@ -1916,30 +2420,87 @@ @@ -1916,30 +2420,84 @@
{ {
this.getChunkFromChunkCoords(j, l).removeEntity(entity); this.getChunkFromChunkCoords(j, l).removeEntity(entity);
} }
@ -1040,10 +1040,7 @@
+ } + }
+ +
+ if (tileentity.hasWorldObj() && CauldronHooks.canTileEntityTick(tileentity, this) + if (tileentity.hasWorldObj() && CauldronHooks.canTileEntityTick(tileentity, this)
+ && (MinecraftServer.cauldronConfig.tickTEOnlyChunkActive.getValue()?this.isActiveBlockCoord(tileentity.xCoord,tileentity.zCoord): + && this.blockExists(tileentity.xCoord, tileentity.yCoord, tileentity.zCoord))
+ this.blockExists(tileentity.xCoord, tileentity.yCoord, tileentity.zCoord)
+ )
+ )
+ { + {
try try
{ {
@ -1058,7 +1055,7 @@
crashreport = CrashReport.makeCrashReport(throwable, "Ticking block entity"); crashreport = CrashReport.makeCrashReport(throwable, "Ticking block entity");
crashreportcategory = crashreport.makeCategory("Block entity being ticked"); crashreportcategory = crashreport.makeCategory("Block entity being ticked");
tileentity.func_145828_a(crashreportcategory); tileentity.func_145828_a(crashreportcategory);
@@ -1955,23 +2516,13 @@ @@ -1955,23 +2513,13 @@
} }
} }
} }
@ -1087,7 +1084,7 @@
if (!this.field_147483_b.isEmpty()) if (!this.field_147483_b.isEmpty())
{ {
for (Object tile : field_147483_b) for (Object tile : field_147483_b)
@@ -1981,6 +2532,7 @@ @@ -1981,6 +2529,7 @@
this.loadedTileEntityList.removeAll(this.field_147483_b); this.loadedTileEntityList.removeAll(this.field_147483_b);
this.field_147483_b.clear(); this.field_147483_b.clear();
} }
@ -1095,7 +1092,7 @@
this.field_147481_N = false; this.field_147481_N = false;
@@ -2016,17 +2568,23 @@ @@ -2016,17 +2565,23 @@
this.addedTileEntityList.clear(); this.addedTileEntityList.clear();
} }
@ -1122,7 +1119,7 @@
} }
public void updateEntity(Entity p_72870_1_) public void updateEntity(Entity p_72870_1_)
@@ -2036,21 +2594,41 @@ @@ -2036,21 +2591,41 @@
public void updateEntityWithOptionalForce(Entity p_72866_1_, boolean p_72866_2_) public void updateEntityWithOptionalForce(Entity p_72866_1_, boolean p_72866_2_)
{ {
@ -1166,7 +1163,7 @@
p_72866_1_.lastTickPosX = p_72866_1_.posX; p_72866_1_.lastTickPosX = p_72866_1_.posX;
p_72866_1_.lastTickPosY = p_72866_1_.posY; p_72866_1_.lastTickPosY = p_72866_1_.posY;
p_72866_1_.lastTickPosZ = p_72866_1_.posZ; p_72866_1_.lastTickPosZ = p_72866_1_.posZ;
@@ -2134,6 +2712,7 @@ @@ -2134,6 +2709,7 @@
p_72866_1_.riddenByEntity = null; p_72866_1_.riddenByEntity = null;
} }
} }
@ -1174,7 +1171,7 @@
} }
} }
@@ -2570,7 +3149,7 @@ @@ -2570,7 +3146,7 @@
return; return;
} }
@ -1183,7 +1180,7 @@
{ {
if (this.field_147481_N) if (this.field_147481_N)
{ {
@@ -2612,6 +3191,9 @@ @@ -2612,6 +3188,9 @@
public void func_147457_a(TileEntity p_147457_1_) public void func_147457_a(TileEntity p_147457_1_)
{ {
@ -1193,7 +1190,7 @@
this.field_147483_b.add(p_147457_1_); this.field_147483_b.add(p_147457_1_);
} }
@@ -2718,7 +3300,15 @@ @@ -2718,7 +3297,15 @@
if (i <= 0) if (i <= 0)
{ {
@ -1210,7 +1207,7 @@
} }
} }
@@ -2754,7 +3344,15 @@ @@ -2754,7 +3341,15 @@
if (j <= 0) if (j <= 0)
{ {
@ -1227,7 +1224,7 @@
} }
} }
@@ -2777,8 +3375,41 @@ @@ -2777,8 +3372,41 @@
protected void setActivePlayerChunksAndCheckLight() protected void setActivePlayerChunksAndCheckLight()
{ {
this.activeChunkSet.clear(); this.activeChunkSet.clear();
@ -1270,7 +1267,7 @@
int i; int i;
EntityPlayer entityplayer; EntityPlayer entityplayer;
int j; int j;
@@ -2788,17 +3419,28 @@ @@ -2788,17 +3416,28 @@
for (i = 0; i < this.playerEntities.size(); ++i) for (i = 0; i < this.playerEntities.size(); ++i)
{ {
entityplayer = (EntityPlayer)this.playerEntities.get(i); entityplayer = (EntityPlayer)this.playerEntities.get(i);
@ -1305,7 +1302,7 @@
} }
this.theProfiler.endSection(); this.theProfiler.endSection();
@@ -2810,7 +3452,7 @@ @@ -2810,7 +3449,7 @@
this.theProfiler.startSection("playerCheckLight"); this.theProfiler.startSection("playerCheckLight");
@ -1314,7 +1311,7 @@
{ {
i = this.rand.nextInt(this.playerEntities.size()); i = this.rand.nextInt(this.playerEntities.size());
entityplayer = (EntityPlayer)this.playerEntities.get(i); entityplayer = (EntityPlayer)this.playerEntities.get(i);
@@ -3034,9 +3676,9 @@ @@ -3034,9 +3673,9 @@
} }
} }
@ -1322,28 +1319,11 @@
+ public boolean updateLightByType(EnumSkyBlock p_147463_1_, int p_147463_2_, int p_147463_3_, int p_147463_4_, Chunk chunk, List<Chunk> neighbors) + public boolean updateLightByType(EnumSkyBlock p_147463_1_, int p_147463_2_, int p_147463_3_, int p_147463_4_, Chunk chunk, List<Chunk> neighbors)
{ {
- if (!this.doChunksNearChunkExist(p_147463_2_, p_147463_3_, p_147463_4_, 17)) - if (!this.doChunksNearChunkExist(p_147463_2_, p_147463_3_, p_147463_4_, 17))
+ if (chunk == null) // CraftBukkit / PaperSpigot + if (chunk == null||!chunk.isChunkLoaded) // CraftBukkit / PaperSpigot
{ {
return false; return false;
} }
@@ -3166,6 +3808,16 @@ @@ -3284,8 +3923,21 @@
}
}
+ // PaperSpigot start - Asynchronous light updates
+ if (chunk.worldObj.spigotConfig.useAsyncLighting) {
+ chunk.pendingLightUpdates.decrementAndGet();
+ if (neighbors != null) {
+ for (Chunk neighbor : neighbors) {
+ neighbor.pendingLightUpdates.decrementAndGet();
+ }
+ }
+ }
+ // PaperSpigot end
this.theProfiler.endSection();
return true;
}
@@ -3284,8 +3936,21 @@
{ {
Entity entity = (Entity)this.loadedEntityList.get(j); Entity entity = (Entity)this.loadedEntityList.get(j);
@ -1366,7 +1346,7 @@
++i; ++i;
} }
} }
@@ -3298,6 +3963,7 @@ @@ -3298,6 +3950,7 @@
for (int i = 0; i < p_72868_1_.size(); ++i) for (int i = 0; i < p_72868_1_.size(); ++i)
{ {
Entity entity = (Entity)p_72868_1_.get(i); Entity entity = (Entity)p_72868_1_.get(i);
@ -1374,7 +1354,7 @@
if (!MinecraftForge.EVENT_BUS.post(new EntityJoinWorldEvent(entity, this))) if (!MinecraftForge.EVENT_BUS.post(new EntityJoinWorldEvent(entity, this)))
{ {
loadedEntityList.add(entity); loadedEntityList.add(entity);
@@ -3314,8 +3980,17 @@ @@ -3314,8 +3967,17 @@
public boolean canPlaceEntityOnSide(Block p_147472_1_, int p_147472_2_, int p_147472_3_, int p_147472_4_, boolean p_147472_5_, int p_147472_6_, Entity p_147472_7_, ItemStack p_147472_8_) public boolean canPlaceEntityOnSide(Block p_147472_1_, int p_147472_2_, int p_147472_3_, int p_147472_4_, boolean p_147472_5_, int p_147472_6_, Entity p_147472_7_, ItemStack p_147472_8_)
{ {
Block block1 = this.getBlock(p_147472_2_, p_147472_3_, p_147472_4_); Block block1 = this.getBlock(p_147472_2_, p_147472_3_, p_147472_4_);
@ -1393,7 +1373,7 @@
} }
public PathEntity getPathEntityToEntity(Entity p_72865_1_, Entity p_72865_2_, float p_72865_3_, boolean p_72865_4_, boolean p_72865_5_, boolean p_72865_6_, boolean p_72865_7_) public PathEntity getPathEntityToEntity(Entity p_72865_1_, Entity p_72865_2_, float p_72865_3_, boolean p_72865_4_, boolean p_72865_5_, boolean p_72865_6_, boolean p_72865_7_)
@@ -3464,6 +4139,12 @@ @@ -3464,6 +4126,12 @@
for (int i = 0; i < this.playerEntities.size(); ++i) for (int i = 0; i < this.playerEntities.size(); ++i)
{ {
EntityPlayer entityplayer1 = (EntityPlayer)this.playerEntities.get(i); EntityPlayer entityplayer1 = (EntityPlayer)this.playerEntities.get(i);
@ -1406,7 +1386,7 @@
double d5 = entityplayer1.getDistanceSq(p_72977_1_, p_72977_3_, p_72977_5_); double d5 = entityplayer1.getDistanceSq(p_72977_1_, p_72977_3_, p_72977_5_);
if ((p_72977_7_ < 0.0D || d5 < p_72977_7_ * p_72977_7_) && (d4 == -1.0D || d5 < d4)) if ((p_72977_7_ < 0.0D || d5 < p_72977_7_ * p_72977_7_) && (d4 == -1.0D || d5 < d4))
@@ -3489,7 +4170,12 @@ @@ -3489,7 +4157,12 @@
for (int i = 0; i < this.playerEntities.size(); ++i) for (int i = 0; i < this.playerEntities.size(); ++i)
{ {
EntityPlayer entityplayer1 = (EntityPlayer)this.playerEntities.get(i); EntityPlayer entityplayer1 = (EntityPlayer)this.playerEntities.get(i);
@ -1420,7 +1400,7 @@
if (!entityplayer1.capabilities.disableDamage && entityplayer1.isEntityAlive()) if (!entityplayer1.capabilities.disableDamage && entityplayer1.isEntityAlive())
{ {
double d5 = entityplayer1.getDistanceSq(p_72846_1_, p_72846_3_, p_72846_5_); double d5 = entityplayer1.getDistanceSq(p_72846_1_, p_72846_3_, p_72846_5_);
@@ -3660,6 +4346,18 @@ @@ -3660,6 +4333,18 @@
public void updateAllPlayersSleepingFlag() {} public void updateAllPlayersSleepingFlag() {}
@ -1439,7 +1419,7 @@
public float getWeightedThunderStrength(float p_72819_1_) public float getWeightedThunderStrength(float p_72819_1_)
{ {
return (this.prevThunderingStrength + (this.thunderingStrength - this.prevThunderingStrength) * p_72819_1_) * this.getRainStrength(p_72819_1_); return (this.prevThunderingStrength + (this.thunderingStrength - this.prevThunderingStrength) * p_72819_1_) * this.getRainStrength(p_72819_1_);
@@ -3932,8 +4630,8 @@ @@ -3932,8 +4617,8 @@
*/ */
public void addTileEntity(TileEntity entity) public void addTileEntity(TileEntity entity)
{ {
@ -1450,7 +1430,7 @@
{ {
dest.add(entity); dest.add(entity);
} }
@@ -4029,4 +4727,122 @@ @@ -4029,4 +4714,117 @@
} }
return count; return count;
} }
@ -1543,17 +1523,12 @@
+ return this.updateLightByType(enumskyblock, x, y, z, chunk, null); + return this.updateLightByType(enumskyblock, x, y, z, chunk, null);
+ } + }
+ +
+ chunk.pendingLightUpdates.incrementAndGet();
+ chunk.lightUpdateTime = chunk.worldObj.getTotalWorldTime();
+
+ final List<Chunk> neighbors = new ArrayList<Chunk>(); + final List<Chunk> neighbors = new ArrayList<Chunk>();
+ for (int cx = (x >> 4) - 1; cx <= (x >> 4) + 1; ++cx) { + for (int cx = (x >> 4) - 1; cx <= (x >> 4) + 1; ++cx) {
+ for (int cz = (z >> 4) - 1; cz <= (z >> 4) + 1; ++cz) { + for (int cz = (z >> 4) - 1; cz <= (z >> 4) + 1; ++cz) {
+ if (cx != x >> 4 && cz != z >> 4) { + if (cx != x >> 4 && cz != z >> 4) {
+ Chunk neighbor = this.getChunkIfLoaded(cx, cz); + Chunk neighbor = this.getChunkIfLoaded(cx, cz);
+ if (neighbor != null) { + if (neighbor != null) {
+ neighbor.pendingLightUpdates.incrementAndGet();
+ neighbor.lightUpdateTime = chunk.worldObj.getTotalWorldTime();
+ neighbors.add(neighbor); + neighbors.add(neighbor);
+ } + }
+ } + }

View File

@ -46,7 +46,6 @@ public class CauldronConfig extends ConfigBase
public final IntSetting largeBoundingBoxLogSize = new IntSetting(this, "settings.entity-bounding-box-max-size", 1000, "Max size of an entity's bounding box before removing it (either being too large or bugged and 'moving' too fast)"); public final IntSetting largeBoundingBoxLogSize = new IntSetting(this, "settings.entity-bounding-box-max-size", 1000, "Max size of an entity's bounding box before removing it (either being too large or bugged and 'moving' too fast)");
public final IntSetting entityMaxSpeed = new IntSetting(this, "settings.entity-max-speed", 100, "Square of the max speed of an entity before removing it"); public final IntSetting entityMaxSpeed = new IntSetting(this, "settings.entity-max-speed", 100, "Square of the max speed of an entity before removing it");
public final BoolSetting removeErroringBlocks=new BoolSetting(this,"setting.remove-erroring-blocks",true,"Set this to true to remove any Blocks that throws an error in its update method instead of closing the server and reporting a crash log."); public final BoolSetting removeErroringBlocks=new BoolSetting(this,"setting.remove-erroring-blocks",true,"Set this to true to remove any Blocks that throws an error in its update method instead of closing the server and reporting a crash log.");
public final BoolSetting tickTEOnlyChunkActive=new BoolSetting(this,"setting.tick-tileentity-only-chunk-active",false,"Set this to true,only if the chunk is active, tileentity can be tick.");
// Debug settings // Debug settings
public final BoolSetting enableThreadContentionMonitoring = new BoolSetting(this, "debug.thread-contention-monitoring", false, "Set true to enable Java's thread contention monitoring for thread dumps"); public final BoolSetting enableThreadContentionMonitoring = new BoolSetting(this, "debug.thread-contention-monitoring", false, "Set true to enable Java's thread contention monitoring for thread dumps");
@ -111,7 +110,6 @@ public class CauldronConfig extends ConfigBase
settings.put(modPacketInteract.path,modPacketInteract); settings.put(modPacketInteract.path,modPacketInteract);
settings.put(removeErroringBlocks.path,removeErroringBlocks); settings.put(removeErroringBlocks.path,removeErroringBlocks);
settings.put(tickTEOnlyChunkActive.path,tickTEOnlyChunkActive);
load(); load();
} }