mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-18 00:47:42 +01:00
Upstream has released updates that appear to apply and compile correctly Paper Changes: 840e72091 [CI-SKIP] [Auto] Rebuild Patches a33232d4a Add beacon activation and deactivation events (#5121) bc7ea673a Add internal channel initialization listeners (#5557) b28ad17ac Check for world change in MoveEvent API methods 3095c7592 [Auto] Updated Upstream (CraftBukkit) f56989c97 Add RespawnFlags to PlayerRespawnEvent (#5533) 7579c2667 Add more API to PlayerMoveEvent (#5553)
48 lines
2.4 KiB
Diff
48 lines
2.4 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
|
Date: Fri, 24 Jul 2020 19:38:21 -0500
|
|
Subject: [PATCH] Add vindicator johnny spawn chance
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/entity/monster/EntityVindicator.java b/src/main/java/net/minecraft/world/entity/monster/EntityVindicator.java
|
|
index f0eda0b83bab8e3a8adbb569b5997402b0e08e9a..fe84d6d2b74b6ae00c4c66682107296a40b69adc 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/monster/EntityVindicator.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/monster/EntityVindicator.java
|
|
@@ -6,6 +6,7 @@ import java.util.Map;
|
|
import java.util.function.Predicate;
|
|
import javax.annotation.Nullable;
|
|
import net.minecraft.nbt.NBTTagCompound;
|
|
+import net.minecraft.network.chat.ChatMessage;
|
|
import net.minecraft.network.chat.IChatBaseComponent;
|
|
import net.minecraft.server.level.WorldServer;
|
|
import net.minecraft.sounds.SoundEffect;
|
|
@@ -122,6 +123,12 @@ public class EntityVindicator extends EntityIllagerAbstract {
|
|
((Navigation) this.getNavigation()).a(true);
|
|
this.a(difficultydamagescaler);
|
|
this.b(difficultydamagescaler);
|
|
+ // Purpur start
|
|
+ World world = worldaccess.getMinecraftWorld();
|
|
+ if (world.purpurConfig.vindicatorJohnnySpawnChance > 0D && random.nextDouble() <= world.purpurConfig.vindicatorJohnnySpawnChance) {
|
|
+ setCustomName(new ChatMessage("Johnny"));
|
|
+ }
|
|
+ // Purpur end
|
|
return groupdataentity1;
|
|
}
|
|
|
|
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
index 1ddd2ca349e303c75e0bb9b848c25f92383e84b5..55d7c48f0dd03c690b0d0b1fee4f3a5306de8d1d 100644
|
|
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
@@ -40,6 +40,11 @@ public class PurpurWorldConfig {
|
|
}
|
|
}
|
|
|
|
+ public double vindicatorJohnnySpawnChance = 0D;
|
|
+ private void vindicatorSettings() {
|
|
+ vindicatorJohnnySpawnChance = getDouble("mobs.vindicator.johnny.spawn-chance", vindicatorJohnnySpawnChance);
|
|
+ }
|
|
+
|
|
private ConfigurationSection getConfigurationSection(String path) {
|
|
ConfigurationSection section = PurpurConfig.config.getConfigurationSection("world-settings." + worldName + "." + path);
|
|
return section != null ? section : PurpurConfig.config.getConfigurationSection("world-settings.default." + path);
|