Skip to content

Commit

Permalink
Added rule playerCheckLightDisabled
Browse files Browse the repository at this point in the history
  • Loading branch information
Fallen-Breath committed May 3, 2023
1 parent 308f6c7 commit 8588216
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 12 deletions.
37 changes: 25 additions & 12 deletions patches/net/minecraft/world/WorldServer.java.patch
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,20 @@
for (EntityPlayer entityplayer : this.playerEntities)
{
if (!entityplayer.isSpectator() && !entityplayer.isPlayerFullyAsleep())
@@ -397,9 +555,12 @@
@@ -362,6 +520,12 @@

protected void playerCheckLight()
{
+ // TISCM playerCheckLightDisabled
+ if (CarpetSettings.playerCheckLightDisabled)
+ {
+ return;
+ }
+
this.profiler.startSection("playerCheckLight");

if (!this.playerEntities.isEmpty())
@@ -397,9 +561,12 @@
boolean flag1 = this.isThundering();
this.profiler.startSection("pollingChunks");

Expand All @@ -352,7 +365,7 @@
Chunk chunk = iterator.next();
int j = chunk.x * 16;
int k = chunk.z * 16;
@@ -407,7 +568,21 @@
@@ -407,7 +574,21 @@
chunk.enqueueRelightChecks();
this.profiler.endStartSection("tickChunk");
chunk.tick(false);
Expand All @@ -374,7 +387,7 @@

if (flag && flag1 && this.rand.nextInt(100000) == 0)
{
@@ -434,6 +609,8 @@
@@ -434,6 +615,8 @@
}

this.profiler.endStartSection("iceandsnow");
Expand All @@ -383,7 +396,7 @@

if (this.rand.nextInt(16) == 0)
{
@@ -460,6 +637,8 @@
@@ -460,6 +643,8 @@
}

this.profiler.endStartSection("tickBlocks");
Expand All @@ -392,7 +405,7 @@

if (i > 0)
{
@@ -493,13 +672,25 @@
@@ -493,13 +678,25 @@
}
}
}
Expand All @@ -419,23 +432,23 @@
{
BlockPos blockpos = this.getHeight(Heightmap.Type.MOTION_BLOCKING, pos);
AxisAlignedBB axisalignedbb = (new AxisAlignedBB(blockpos, new BlockPos(blockpos.getX(), this.getHeight(), blockpos.getZ()))).grow(3.0D);
@@ -543,6 +734,7 @@
@@ -543,6 +740,7 @@

protected void tickPlayers()
{
+ startTickTask(TickTask.PLAYERS); // RSMM
super.tickPlayers();
this.profiler.endStartSection("players");

@@ -597,6 +789,7 @@
@@ -597,6 +795,7 @@

this.profiler.endSection();
}
+ endTickTask(); // RSMM
}

public void resetUpdateEntityTick()
@@ -608,8 +801,11 @@
@@ -608,8 +807,11 @@
{
if (this.worldInfo.getGenerator() != WorldType.DEBUG_ALL_BLOCK_STATES)
{
Expand All @@ -447,7 +460,7 @@
}
}

@@ -619,18 +815,32 @@
@@ -619,18 +821,32 @@

if (ifluidstate.getFluid() == fluidTickEntry.getTarget())
{
Expand Down Expand Up @@ -480,7 +493,7 @@
}

public void tickEntity(Entity entityIn, boolean forceUpdate)
@@ -1010,7 +1220,7 @@
@@ -1010,7 +1226,7 @@

for (EntityPlayer entityplayer : this.playerEntities)
{
Expand All @@ -489,7 +502,7 @@
{
((EntityPlayerMP)entityplayer).connection.sendPacket(new SPacketExplosion(x, y, z, strength, explosion.getAffectedBlockPositions(), explosion.getPlayerKnockbackMap().get(entityplayer)));
}
@@ -1021,26 +1231,60 @@
@@ -1021,26 +1237,60 @@

public void addBlockEvent(BlockPos pos, Block blockIn, int eventID, int eventParam)
{
Expand Down Expand Up @@ -553,7 +566,7 @@
}

public void close()
@@ -1194,4 +1438,54 @@
@@ -1194,4 +1444,54 @@
{
return this.server.getNetworkTagManager();
}
Expand Down
6 changes: 6 additions & 0 deletions src/main/java/carpet/settings/CarpetSettings.java
Original file line number Diff line number Diff line change
Expand Up @@ -844,6 +844,12 @@ public String description()
)
public static boolean threadstoneLogger = false;

@Rule(
desc = "Disable random light checks nearby players",
category = CREATIVE
)
public static boolean playerCheckLightDisabled = false;


// /$$$$$$$$ /$$$$$$ /$$$$$$ /$$$$$$ /$$ /$$
//|__ $$__/|_ $$_/ /$$__ $$ /$$__ $$| $$$ /$$$
Expand Down

0 comments on commit 8588216

Please sign in to comment.