mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-21 10:27:44 +01:00
Piglin portal spawn modifier
Allows changing the modifier for the piglin spawn chance from a portal block based on the world difficulty. For example, with the default vanilla value of 2000 there is a 2 out of 2000 chance for a piglin to spawn in a portal block each tick in normal mode. Equation: random.nextInt(modifier) < difficulty Difficulties: 0 - peaceful 1 - easy 2 - normal 3 - hard
This commit is contained in:
committed by
granny
parent
8ce5e9f17f
commit
5ea7aa4cc1
@@ -0,0 +1,11 @@
|
||||
--- a/net/minecraft/world/level/block/NetherPortalBlock.java
|
||||
+++ b/net/minecraft/world/level/block/NetherPortalBlock.java
|
||||
@@ -72,7 +_,7 @@
|
||||
protected void randomTick(BlockState state, ServerLevel level, BlockPos pos, RandomSource random) {
|
||||
if (level.spigotConfig.enableZombiePigmenPortalSpawns && level.dimensionType().natural() // Spigot
|
||||
&& level.getGameRules().getBoolean(GameRules.RULE_DOMOBSPAWNING)
|
||||
- && random.nextInt(2000) < level.getDifficulty().getId()) {
|
||||
+ && random.nextInt(level.purpurConfig.piglinPortalSpawnModifier) < level.getDifficulty().getId()) { // Purpur - Piglin portal spawn modifier
|
||||
while (level.getBlockState(pos).is(this)) {
|
||||
pos = pos.below();
|
||||
}
|
||||
Reference in New Issue
Block a user