mirror of
https://github.com/PaperMC/Paper.git
synced 2025-03-22 06:55:36 +01:00
<3 jmp
This commit is contained in:
parent
e8ece1a43a
commit
ac0e1997ee
22 changed files with 13 additions and 13 deletions
|
@ -151,9 +151,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
this.profiler.pop();
|
this.profiler.pop();
|
||||||
org.spigotmc.WatchdogThread.tick(); // Spigot
|
org.spigotmc.WatchdogThread.tick(); // Spigot
|
||||||
@@ -0,0 +0,0 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -0,0 +0,0 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
};
|
public static record ServerResourcePackInfo(String url, String hash, boolean isRequired, @Nullable Component prompt) {
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
+
|
||||||
+ // Paper start
|
+ // Paper start
|
||||||
+ public static class TickTimes {
|
+ public static class TickTimes {
|
||||||
+ private final long[] times;
|
+ private final long[] times;
|
|
@ -28,17 +28,18 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
--- a/src/main/java/net/minecraft/world/entity/monster/Zombie.java
|
--- a/src/main/java/net/minecraft/world/entity/monster/Zombie.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/monster/Zombie.java
|
+++ b/src/main/java/net/minecraft/world/entity/monster/Zombie.java
|
||||||
@@ -0,0 +0,0 @@ public class Zombie extends Monster {
|
@@ -0,0 +0,0 @@ public class Zombie extends Monster {
|
||||||
@Override
|
public boolean wasKilled(ServerLevel world, LivingEntity other) {
|
||||||
public void killed(ServerLevel world, LivingEntity other) {
|
boolean flag = super.wasKilled(world, other);
|
||||||
super.killed(world, other);
|
|
||||||
- if ((world.getDifficulty() == Difficulty.NORMAL || world.getDifficulty() == Difficulty.HARD) && other instanceof Villager) {
|
- if ((world.getDifficulty() == Difficulty.NORMAL || world.getDifficulty() == Difficulty.HARD) && other instanceof Villager) {
|
||||||
- if (world.getDifficulty() != Difficulty.HARD && this.random.nextBoolean()) {
|
- if (world.getDifficulty() != Difficulty.HARD && this.random.nextBoolean()) {
|
||||||
|
+ // Paper start
|
||||||
+ if (level.paperConfig.zombieVillagerInfectionChance != 0.0 && (level.paperConfig.zombieVillagerInfectionChance != -1.0 || world.getDifficulty() == Difficulty.NORMAL || world.getDifficulty() == Difficulty.HARD) && other instanceof Villager) {
|
+ if (level.paperConfig.zombieVillagerInfectionChance != 0.0 && (level.paperConfig.zombieVillagerInfectionChance != -1.0 || world.getDifficulty() == Difficulty.NORMAL || world.getDifficulty() == Difficulty.HARD) && other instanceof Villager) {
|
||||||
+ if (level.paperConfig.zombieVillagerInfectionChance == -1.0 && world.getDifficulty() != Difficulty.HARD && this.random.nextBoolean()) {
|
+ if (level.paperConfig.zombieVillagerInfectionChance == -1.0 && world.getDifficulty() != Difficulty.HARD && this.random.nextBoolean()) {
|
||||||
return;
|
return flag;
|
||||||
}
|
}
|
||||||
+ if (level.paperConfig.zombieVillagerInfectionChance != -1.0 && (this.random.nextDouble() * 100.0) > level.paperConfig.zombieVillagerInfectionChance) {
|
+ if (level.paperConfig.zombieVillagerInfectionChance != -1.0 && (this.random.nextDouble() * 100.0) > level.paperConfig.zombieVillagerInfectionChance) {
|
||||||
+ return;
|
+ return flag;
|
||||||
+ } // Paper end
|
+ } // Paper end
|
||||||
|
|
||||||
Villager entityvillager = (Villager) other;
|
Villager entityvillager = (Villager) other;
|
|
@ -10,7 +10,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
+++ b/src/main/java/net/minecraft/world/level/block/TripWireHookBlock.java
|
+++ b/src/main/java/net/minecraft/world/level/block/TripWireHookBlock.java
|
||||||
@@ -0,0 +0,0 @@ public class TripWireHookBlock extends Block {
|
@@ -0,0 +0,0 @@ public class TripWireHookBlock extends Block {
|
||||||
|
|
||||||
this.playSound(world, pos, flag4, flag5, flag2, flag3);
|
this.emitState(world, pos, flag4, flag5, flag2, flag3);
|
||||||
if (!beingRemoved) {
|
if (!beingRemoved) {
|
||||||
+ if (world.getBlockState(pos).getBlock() == Blocks.TRIPWIRE_HOOK) // Paper - validate
|
+ if (world.getBlockState(pos).getBlock() == Blocks.TRIPWIRE_HOOK) // Paper - validate
|
||||||
world.setBlock(pos, (BlockState) iblockdata3.setValue(TripWireHookBlock.FACING, enumdirection), 3);
|
world.setBlock(pos, (BlockState) iblockdata3.setValue(TripWireHookBlock.FACING, enumdirection), 3);
|
|
@ -422,11 +422,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
--- a/src/main/java/net/minecraft/world/level/NaturalSpawner.java
|
--- a/src/main/java/net/minecraft/world/level/NaturalSpawner.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/NaturalSpawner.java
|
+++ b/src/main/java/net/minecraft/world/level/NaturalSpawner.java
|
||||||
@@ -0,0 +0,0 @@ public final class NaturalSpawner {
|
@@ -0,0 +0,0 @@ public final class NaturalSpawner {
|
||||||
|
|
||||||
private NaturalSpawner() {}
|
private NaturalSpawner() {}
|
||||||
|
|
||||||
+ // Paper start - add countMobs parameter
|
|
||||||
public static NaturalSpawner.SpawnState createState(int spawningChunkCount, Iterable<Entity> entities, NaturalSpawner.ChunkGetter chunkSource, LocalMobCapCalculator localmobcapcalculator) {
|
public static NaturalSpawner.SpawnState createState(int spawningChunkCount, Iterable<Entity> entities, NaturalSpawner.ChunkGetter chunkSource, LocalMobCapCalculator localmobcapcalculator) {
|
||||||
|
+ // Paper start - add countMobs parameter
|
||||||
+ return createState(spawningChunkCount, entities, chunkSource, localmobcapcalculator, false);
|
+ return createState(spawningChunkCount, entities, chunkSource, localmobcapcalculator, false);
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
|
@ -494,11 +493,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -0,0 +0,0 @@ public final class NaturalSpawner {
|
@@ -0,0 +0,0 @@ public final class NaturalSpawner {
|
||||||
world.getProfiler().pop();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
+ // Paper start - add parameters and int ret type
|
|
||||||
public static void spawnCategoryForChunk(MobCategory group, ServerLevel world, LevelChunk chunk, NaturalSpawner.SpawnPredicate checker, NaturalSpawner.AfterSpawnCallback runner) {
|
public static void spawnCategoryForChunk(MobCategory group, ServerLevel world, LevelChunk chunk, NaturalSpawner.SpawnPredicate checker, NaturalSpawner.AfterSpawnCallback runner) {
|
||||||
|
+ // Paper start - add parameters and int ret type
|
||||||
+ spawnCategoryForChunk(group, world, chunk, checker, runner, Integer.MAX_VALUE, null);
|
+ spawnCategoryForChunk(group, world, chunk, checker, runner, Integer.MAX_VALUE, null);
|
||||||
+ }
|
+ }
|
||||||
+ public static int spawnCategoryForChunk(MobCategory group, ServerLevel world, LevelChunk chunk, NaturalSpawner.SpawnPredicate checker, NaturalSpawner.AfterSpawnCallback runner, int maxSpawns, Consumer<Entity> trackEntity) {
|
+ public static int spawnCategoryForChunk(MobCategory group, ServerLevel world, LevelChunk chunk, NaturalSpawner.SpawnPredicate checker, NaturalSpawner.AfterSpawnCallback runner, int maxSpawns, Consumer<Entity> trackEntity) {
|
||||||
|
@ -523,7 +521,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
+ }
|
+ }
|
||||||
+ public static int spawnCategoryForPosition(MobCategory group, ServerLevel world, ChunkAccess chunk, BlockPos pos, NaturalSpawner.SpawnPredicate checker, NaturalSpawner.AfterSpawnCallback runner, int maxSpawns, Consumer<Entity> trackEntity) {
|
+ public static int spawnCategoryForPosition(MobCategory group, ServerLevel world, ChunkAccess chunk, BlockPos pos, NaturalSpawner.SpawnPredicate checker, NaturalSpawner.AfterSpawnCallback runner, int maxSpawns, Consumer<Entity> trackEntity) {
|
||||||
+ // Paper end - add maxSpawns parameter and return spawned mobs
|
+ // Paper end - add maxSpawns parameter and return spawned mobs
|
||||||
StructureFeatureManager structuremanager = world.structureFeatureManager();
|
StructureManager structuremanager = world.structureManager();
|
||||||
ChunkGenerator chunkgenerator = world.getChunkSource().getGenerator();
|
ChunkGenerator chunkgenerator = world.getChunkSource().getGenerator();
|
||||||
int i = pos.getY();
|
int i = pos.getY();
|
||||||
BlockState iblockdata = world.getBlockStateIfLoadedAndInBounds(pos); // Paper - don't load chunks for mob spawn
|
BlockState iblockdata = world.getBlockStateIfLoadedAndInBounds(pos); // Paper - don't load chunks for mob spawn
|
Loading…
Add table
Reference in a new issue