mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-20 09:57:43 +01:00
Updated Upstream (Paper & Tuinity)
Upstream has released updates that appear to apply and compile correctly Paper Changes: d985976 Add config for mobs immune to default effects (#4835) Tuinity Changes: ea43797 Fix portalling from the overworld above y 255
This commit is contained in:
@@ -1,52 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Tue, 13 Apr 2021 11:19:35 -0500
|
||||
Subject: [PATCH] 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
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/NetherPortalBlock.java b/src/main/java/net/minecraft/world/level/block/NetherPortalBlock.java
|
||||
index fef1027829c44957e23c0a121033bfb7640d06f0..c42349d0f6b0025525278295b36f4030f122800e 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/NetherPortalBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/NetherPortalBlock.java
|
||||
@@ -55,7 +55,7 @@ public class NetherPortalBlock extends Block {
|
||||
|
||||
@Override
|
||||
public void randomTick(BlockState state, ServerLevel world, BlockPos pos, Random random) {
|
||||
- if (world.spigotConfig.enableZombiePigmenPortalSpawns && world.dimensionType().natural() && world.getGameRules().getBoolean(GameRules.RULE_DOMOBSPAWNING) && random.nextInt(2000) < world.getDifficulty().getId()) { // Spigot
|
||||
+ if (world.spigotConfig.enableZombiePigmenPortalSpawns && world.dimensionType().natural() && world.getGameRules().getBoolean(GameRules.RULE_DOMOBSPAWNING) && random.nextInt(world.purpurConfig.piglinPortalSpawnModifier) < world.getDifficulty().getId()) { // Spigot // Purpur
|
||||
while (world.getBlockState(pos).is((Block) this)) {
|
||||
pos = pos.below();
|
||||
}
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 9df8de15eb37c248ad5240564ad4213ae9445a9e..b6964ab54d20fb6d5579db2e95cf4aaa5f563439 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -1459,6 +1459,7 @@ public class PurpurWorldConfig {
|
||||
public boolean piglinRidableInWater = false;
|
||||
public double piglinMaxHealth = 16.0D;
|
||||
public boolean piglinBypassMobGriefing = false;
|
||||
+ public int piglinPortalSpawnModifier = 2000;
|
||||
private void piglinSettings() {
|
||||
piglinRidable = getBoolean("mobs.piglin.ridable", piglinRidable);
|
||||
piglinRidableInWater = getBoolean("mobs.piglin.ridable-in-water", piglinRidableInWater);
|
||||
@@ -1469,6 +1470,7 @@ public class PurpurWorldConfig {
|
||||
}
|
||||
piglinMaxHealth = getDouble("mobs.piglin.attributes.max_health", piglinMaxHealth);
|
||||
piglinBypassMobGriefing = getBoolean("mobs.piglin.bypass-mob-griefing", piglinBypassMobGriefing);
|
||||
+ piglinPortalSpawnModifier = getInt("mobs.piglin.portal-spawn-modifier", piglinPortalSpawnModifier);
|
||||
}
|
||||
|
||||
public boolean piglinBruteRidable = false;
|
||||
Reference in New Issue
Block a user