death to more obfhelpers

This commit is contained in:
MiniDigger | Martin
2021-06-17 22:20:03 +02:00
parent 62fabeca0c
commit 4ac379cbd0
13 changed files with 28 additions and 132 deletions

View File

@@ -65,14 +65,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.CustomSpawner;
import net.minecraft.world.level.GameRules;
@@ -0,0 +0,0 @@ import net.minecraft.world.level.block.state.BlockState;
public class PatrolSpawner implements CustomSpawner {
- private int nextTick;
+ private int nextTick;@Deprecated private int getSpawnDelay() { return nextTick; } @Deprecated private void setSpawnDelay(int spawnDelay) { this.nextTick = spawnDelay; } // Paper - OBFHELPER
public PatrolSpawner() {}
@@ -0,0 +0,0 @@ public class PatrolSpawner implements CustomSpawner {
@Override
public int tick(ServerLevel world, boolean spawnMonsters, boolean spawnAnimals) {
@@ -106,8 +99,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
} else {
- this.nextTick += 12000 + random.nextInt(1200);
- long i = world.getDayTime() / 24000L;
+ setSpawnDelay(getSpawnDelay() - 1);
+ patrolSpawnDelay = getSpawnDelay();
+ this.nextTick--;
+ patrolSpawnDelay = this.nextTick;
+ }
+
+ if (patrolSpawnDelay > 0) {
@@ -122,7 +115,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ if (world.paperConfig.patrolPerPlayerDelay) {
+ entityhuman.patrolSpawnDelay += world.paperConfig.patrolDelay + random.nextInt(1200);
+ } else {
+ setSpawnDelay(getSpawnDelay() + world.paperConfig.patrolDelay + random.nextInt(1200));
+ this.nextTick += world.paperConfig.patrolDelay + random.nextInt(1200);
+ }
- if (i >= 5L && world.isDay()) {