mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-18 08:57:44 +01:00
Upstream has released updates that appears to apply and compile correctly Paper Changes: 54890033 [Auto] Updated Upstream (CraftBukkit) f96c6f5c [Auto] Updated Upstream (CraftBukkit) 4be8312f [CI-SKIP] [Auto] Rebuild Patches 43e5174a Fix Entity Teleportation and cancel velocity if teleported (#4210) 0fb3daf4 [Auto] Updated Upstream (CraftBukkit) 819ff324 Use wrapped StructureManager to prevent worldgen deadlock 507f302c Fix Zombie ShouldBurnInDay API (#4268) ef5af6f6 [Auto] Updated Upstream (CraftBukkit) 101b0110 [Auto] Updated Upstream (Bukkit/CraftBukkit) 03689cf9 Fix javadoc (#4276) c247857f Cache block data strings ce2eae5c [Auto] Updated Upstream (Bukkit/CraftBukkit) 563f77ad install remapped server jar to paper package space 1ab021dd Updated Upstream (Bukkit/CraftBukkit) c970f880 Properly pass the close reason for new inventory opens (#2658) (#4247) 07bca94f Create HoverEvent from ItemStack Entity da33f8bb Add a way to get translation keys for blocks, entities and materials 5a20cbd7 Add more Evoker API 7a3e2520 [Auto] Updated Upstream (CraftBukkit) b0cbebdc Fix build conflicts dfc54a8b Add zombie targets turtle egg config (#4181) 0fe00f61 Add BellRingEvent for village bells (#2230) 414e5e1d fix #4144 (#4170) 5c7f3fc0 Fix PersistentDataContainer contract violation (_->!null returns null) (#3990) 65dbf5ff [CI-SKIP] [Auto] Rebuild Patches 7ed0f7f0 Fix NPE in getBedSpawnLocation (#4238) 9e0f1101 [CI-SKIP] Add issue template 6c138412 Fix CraftTeam null check (#4249) 32e45448 Update Paperclip b84a37b7 Update Armor items in PlayerArmorChangeEvent (#4243) a67abf5b Increase visibility of a few methods 7d69214b [Auto] Updated Upstream (CraftBukkit) cbfc2362 PortalCreateEvent needs to know its entity 29032edb Fix PersistentDataContainer contract violation (_->!null returns null) f42c53df [CI-SKIP] [Auto] Rebuild Patches 3efe45f5 Port Eigencraft to 1.16 0bad6958 Make engine-mode 2 truly random cd06ca5e Updated Upstream (CraftBukkit) ef36b4f8 Fix TNT not pushing creative players 915fe522 Fix hex colors not working in some kick messages f5904171 [Auto] Updated Upstream (Bukkit/CraftBukkit) 757948dc [Auto] Updated Upstream (CraftBukkit) 0893de14 Fix reading the brand message from clients 243d2313 Updated Upstream (Bukkit/CraftBukkit) 4cc7de6c Add playPickupItemAnimation to LivingEntity 20fc1b5c [Auto] Updated Upstream (CraftBukkit/Spigot) 655258b3 [Auto] Updated Upstream (CraftBukkit) 167b1db6 Fix some modded clients getting kicked for invalid payload - Fixes #4201 7f0786cd Fix enderdragon tracking range to honor vanilla 586073c3 [CI-SKIP] Update README.md (for 1.16.2) (#4202) 853f4168 Remove debug 4d7ea429 fix config option in last commit 74d27463 Buffer joins to world ac96307b [CI-SKIP] switch back to trusty now we figured out the issue c97ce029 1.16.2 Release (#4123) 5486b3db Fix javadocs failing jenkins builds (#4189) 1330eb5f Brand support b8372fc0 Improve handling of indestructable blocks a2a06640 Add moon phase API 47f71aea Fix SpawnChangeEvent not firing for all use-cases b6c860f2 Don't require FACING data 0c1716a1 Add #setMaxPlayers API 02aed275 [CI-SKIP] Require dependencies script (#4172) 1ccc1c67 Add smithing item helpers 627f4b85 Brand support 20d9ec6b Fix MC-197271 e9287056 [CI-SKIP] Update issue templates with notices dccaf59a MC-197883: Bandaid decode issue 99a1e58f Merge branch 'master' into progress/1.16.2 ecbc5ca0 Updated Upstream (CraftBukkit) 99362d3c Decomp fix 5f9861a0 Fix MC-197883 by specifying the typeKey 1d8c9c23 [CI-SKIP] Make checkoutpr.sh use $SHELL (#4167) 2b1ca210 update checkout-pr to latest I use 95c9b45d Fix IDE Debug JVM Flag 2 (#4141) 9e6d742c Merge remote-tracking branch 'origin/master' into progress/1.16.2 c8542f23 Fix MC-99259 Wither Boss Bar doesn't update until invulnerability period is over (#4164) 862b8c18 Updated Upstream (Bukkit/CraftBukkit) 100d51eb Do not obfuscate air (#4149) 47740f67 Updated Upstream (CraftBukkit) 948c20e0 Merge remote-tracking branch 'origin/master' into progress/1.16.2 1daafe45 Updated Upstream (Bukkit/CraftBukkit) 98828b00 Merge pull request #4132 from Proximyst/progress/1.16.2 b23f27f8 Fix incorrect return for WorldServer#addAllEntitiesSafely (#3) 5085fa30 Fix MC-187716 Use configured height c44add5a Initialise a new chunk section if none was found yet updated 74a4d5f8 Remove armour stand double add to world 6d25cc4e Don't mark null chunk sections for block updates 1ba2f214 Updated Upstream (Bukkit/CraftBukkit) d29d5aaa Fix anti xray ce6bbaa4 Import fastutil classes patch 9d4616a4 Updated Upstream (Bukkit/CraftBukkit) 109d072b Fix test, add strider mob goal and fix piglin goals e6caaa20 Fix running; forgot to push this ee7dce8b Add this to SHIT_TO_CHECK.md aswell d378257c Fix IDE debug JVM flag for 1.16.2 0d8db446 Merge pull request #4112 from BillyGalbreath/progress/1.16.2 d319d8c4 It compiles! 8f8371c5 Add an OBFHELPER 9caa8e9f missed this 3ce5a5d7 volatile 159eb2e1 Oopsies 7eb08d2f Almost ready 7ca11e97 Current progress on 1.16.2 Tuinity Changes: eaa6b50 Fix missing block property portal crash fea5fbd Retain vanilla behavior for error correction rules in collisions 9eb1a3e Do not add a delayed unload ticket for some ticket types
267 lines
12 KiB
Diff
267 lines
12 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
|
Date: Thu, 26 Mar 2020 21:39:32 -0500
|
|
Subject: [PATCH] Configurable jockey options
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntityDrowned.java b/src/main/java/net/minecraft/server/EntityDrowned.java
|
|
index ea7934060..6853ba319 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityDrowned.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityDrowned.java
|
|
@@ -21,6 +21,23 @@ public class EntityDrowned extends EntityZombie implements IRangedEntity {
|
|
this.navigationLand = new Navigation(this, world);
|
|
}
|
|
|
|
+ // Purpur start
|
|
+ @Override
|
|
+ public boolean jockeyOnlyBaby() {
|
|
+ return world.purpurConfig.drownedJockeyOnlyBaby;
|
|
+ }
|
|
+
|
|
+ @Override
|
|
+ public double jockeyChance() {
|
|
+ return world.purpurConfig.drownedJockeyChance;
|
|
+ }
|
|
+
|
|
+ @Override
|
|
+ public boolean jockeyTryExistingChickens() {
|
|
+ return world.purpurConfig.drownedJockeyTryExistingChickens;
|
|
+ }
|
|
+ // Purpur end
|
|
+
|
|
@Override
|
|
protected void m() {
|
|
this.goalSelector.a(1, new EntityDrowned.c(this, 1.0D));
|
|
diff --git a/src/main/java/net/minecraft/server/EntityPigZombie.java b/src/main/java/net/minecraft/server/EntityPigZombie.java
|
|
index 96a8abb18..194b76059 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityPigZombie.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityPigZombie.java
|
|
@@ -21,6 +21,23 @@ public class EntityPigZombie extends EntityZombie implements IEntityAngerable {
|
|
this.a(PathType.LAVA, 8.0F);
|
|
}
|
|
|
|
+ // Purpur start
|
|
+ @Override
|
|
+ public boolean jockeyOnlyBaby() {
|
|
+ return world.purpurConfig.zombifiedPiglinJockeyOnlyBaby;
|
|
+ }
|
|
+
|
|
+ @Override
|
|
+ public double jockeyChance() {
|
|
+ return world.purpurConfig.zombifiedPiglinJockeyChance;
|
|
+ }
|
|
+
|
|
+ @Override
|
|
+ public boolean jockeyTryExistingChickens() {
|
|
+ return world.purpurConfig.zombifiedPiglinJockeyTryExistingChickens;
|
|
+ }
|
|
+ // Purpur end
|
|
+
|
|
@Override
|
|
public void setAngerTarget(@Nullable UUID uuid) {
|
|
this.br = uuid;
|
|
diff --git a/src/main/java/net/minecraft/server/EntityZombie.java b/src/main/java/net/minecraft/server/EntityZombie.java
|
|
index a11612fa0..3e5c69287 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityZombie.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityZombie.java
|
|
@@ -3,6 +3,7 @@ package net.minecraft.server;
|
|
import com.mojang.serialization.DynamicOps;
|
|
import java.time.LocalDate;
|
|
import java.time.temporal.ChronoField;
|
|
+import java.util.Collections;
|
|
import java.util.List;
|
|
import java.util.Random;
|
|
import java.util.UUID;
|
|
@@ -44,6 +45,20 @@ public class EntityZombie extends EntityMonster {
|
|
this(EntityTypes.ZOMBIE, world);
|
|
}
|
|
|
|
+ // Purpur start
|
|
+ public boolean jockeyOnlyBaby() {
|
|
+ return world.purpurConfig.zombieJockeyOnlyBaby;
|
|
+ }
|
|
+
|
|
+ public double jockeyChance() {
|
|
+ return world.purpurConfig.zombieJockeyChance;
|
|
+ }
|
|
+
|
|
+ public boolean jockeyTryExistingChickens() {
|
|
+ return world.purpurConfig.zombieJockeyTryExistingChickens;
|
|
+ }
|
|
+ // Purpur end
|
|
+
|
|
@Override
|
|
protected void initPathfinder() {
|
|
if (world.paperConfig.zombiesTargetTurtleEggs) this.goalSelector.a(4, new EntityZombie.a(this, 1.0D, 3)); // Paper
|
|
@@ -439,19 +454,19 @@ public class EntityZombie extends EntityMonster {
|
|
if (object instanceof EntityZombie.GroupDataZombie) {
|
|
EntityZombie.GroupDataZombie entityzombie_groupdatazombie = (EntityZombie.GroupDataZombie) object;
|
|
|
|
- if (entityzombie_groupdatazombie.a) {
|
|
- this.setBaby(true);
|
|
+ // Purpur start
|
|
+ if (!jockeyOnlyBaby() || entityzombie_groupdatazombie.isBaby()) {
|
|
+ this.setBaby(entityzombie_groupdatazombie.isBaby());
|
|
if (entityzombie_groupdatazombie.b) {
|
|
- if ((double) worldaccess.getRandom().nextFloat() < 0.05D) {
|
|
- List<EntityChicken> list = worldaccess.a(EntityChicken.class, this.getBoundingBox().grow(5.0D, 3.0D, 5.0D), IEntitySelector.c);
|
|
+ if ((double) worldaccess.getRandom().nextFloat() < jockeyChance()) {
|
|
+ List<EntityChicken> list = jockeyTryExistingChickens() ? worldaccess.a(EntityChicken.class, this.getBoundingBox().grow(5.0D, 3.0D, 5.0D), IEntitySelector.c) : Collections.emptyList();
|
|
|
|
if (!list.isEmpty()) {
|
|
EntityChicken entitychicken = (EntityChicken) list.get(0);
|
|
|
|
entitychicken.setChickenJockey(true);
|
|
this.startRiding(entitychicken);
|
|
- }
|
|
- } else if ((double) worldaccess.getRandom().nextFloat() < 0.05D) {
|
|
+ } else { // Purpur
|
|
EntityChicken entitychicken1 = (EntityChicken) EntityTypes.CHICKEN.a(this.world);
|
|
|
|
entitychicken1.setPositionRotation(this.locX(), this.locY(), this.locZ(), this.yaw, 0.0F);
|
|
@@ -459,6 +474,7 @@ public class EntityZombie extends EntityMonster {
|
|
entitychicken1.setChickenJockey(true);
|
|
this.startRiding(entitychicken1);
|
|
worldaccess.addEntity(entitychicken1, CreatureSpawnEvent.SpawnReason.MOUNT); // CraftBukkit
|
|
+ } // Purpur
|
|
}
|
|
}
|
|
}
|
|
@@ -561,7 +577,7 @@ public class EntityZombie extends EntityMonster {
|
|
|
|
public static class GroupDataZombie implements GroupDataEntity {
|
|
|
|
- public final boolean a;
|
|
+ public final boolean a; public boolean isBaby() { return a; } // Purpur - OBFHELPER
|
|
public final boolean b;
|
|
|
|
public GroupDataZombie(boolean flag, boolean flag1) {
|
|
diff --git a/src/main/java/net/minecraft/server/EntityZombieHusk.java b/src/main/java/net/minecraft/server/EntityZombieHusk.java
|
|
index 2d2830adc..ce6d79780 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityZombieHusk.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityZombieHusk.java
|
|
@@ -8,6 +8,23 @@ public class EntityZombieHusk extends EntityZombie {
|
|
super(entitytypes, world);
|
|
}
|
|
|
|
+ // Purpur start
|
|
+ @Override
|
|
+ public boolean jockeyOnlyBaby() {
|
|
+ return world.purpurConfig.huskJockeyOnlyBaby;
|
|
+ }
|
|
+
|
|
+ @Override
|
|
+ public double jockeyChance() {
|
|
+ return world.purpurConfig.huskJockeyChance;
|
|
+ }
|
|
+
|
|
+ @Override
|
|
+ public boolean jockeyTryExistingChickens() {
|
|
+ return world.purpurConfig.huskJockeyTryExistingChickens;
|
|
+ }
|
|
+ // Purpur end
|
|
+
|
|
public static boolean a(EntityTypes<EntityZombieHusk> entitytypes, WorldAccess worldaccess, EnumMobSpawn enummobspawn, BlockPosition blockposition, Random random) {
|
|
return b(entitytypes, worldaccess, enummobspawn, blockposition, random) && (enummobspawn == EnumMobSpawn.SPAWNER || worldaccess.e(blockposition));
|
|
}
|
|
diff --git a/src/main/java/net/minecraft/server/EntityZombieVillager.java b/src/main/java/net/minecraft/server/EntityZombieVillager.java
|
|
index b52b8d0d8..69e98dceb 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityZombieVillager.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityZombieVillager.java
|
|
@@ -28,6 +28,23 @@ public class EntityZombieVillager extends EntityZombie implements VillagerDataHo
|
|
this.setVillagerData(this.getVillagerData().withProfession((VillagerProfession) IRegistry.VILLAGER_PROFESSION.a(this.random)));
|
|
}
|
|
|
|
+ // Purpur start
|
|
+ @Override
|
|
+ public boolean jockeyOnlyBaby() {
|
|
+ return world.purpurConfig.zombieVillagerJockeyOnlyBaby;
|
|
+ }
|
|
+
|
|
+ @Override
|
|
+ public double jockeyChance() {
|
|
+ return world.purpurConfig.zombieVillagerJockeyChance;
|
|
+ }
|
|
+
|
|
+ @Override
|
|
+ public boolean jockeyTryExistingChickens() {
|
|
+ return world.purpurConfig.zombieVillagerJockeyTryExistingChickens;
|
|
+ }
|
|
+ // Purpur end
|
|
+
|
|
@Override
|
|
protected void initDatawatcher() {
|
|
super.initDatawatcher();
|
|
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
index 401489cab..2c0aeeb24 100644
|
|
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
@@ -265,6 +265,15 @@ public class PurpurWorldConfig {
|
|
creeperChargedChance = getDouble("mobs.creeper.naturally-charged-chance", creeperChargedChance);
|
|
}
|
|
|
|
+ public boolean drownedJockeyOnlyBaby = true;
|
|
+ public double drownedJockeyChance = 0.05D;
|
|
+ public boolean drownedJockeyTryExistingChickens = true;
|
|
+ private void drownedSettings() {
|
|
+ drownedJockeyOnlyBaby = getBoolean("mobs.drowned.jockey.only-babies", drownedJockeyOnlyBaby);
|
|
+ drownedJockeyChance = getDouble("mobs.drowned.jockey.chance", drownedJockeyChance);
|
|
+ drownedJockeyTryExistingChickens = getBoolean("mobs.drowned.jockey.try-existing-chickens", drownedJockeyTryExistingChickens);
|
|
+ }
|
|
+
|
|
public boolean enderDragonAlwaysDropsEggBlock = false;
|
|
public boolean enderDragonAlwaysDropsFullExp = false;
|
|
private void enderDragonSettings() {
|
|
@@ -299,6 +308,15 @@ public class PurpurWorldConfig {
|
|
giantHaveHostileAI = getBoolean("mobs.giant.have-hostile-ai", giantHaveHostileAI);
|
|
}
|
|
|
|
+ public boolean huskJockeyOnlyBaby = true;
|
|
+ public double huskJockeyChance = 0.05D;
|
|
+ public boolean huskJockeyTryExistingChickens = true;
|
|
+ private void huskSettings() {
|
|
+ huskJockeyOnlyBaby = getBoolean("mobs.husk.jockey.only-babies", huskJockeyOnlyBaby);
|
|
+ huskJockeyChance = getDouble("mobs.husk.jockey.chance", huskJockeyChance);
|
|
+ huskJockeyTryExistingChickens = getBoolean("mobs.husk.jockey.try-existing-chickens", huskJockeyTryExistingChickens);
|
|
+ }
|
|
+
|
|
public double illusionerMaxHealth = 32.0D;
|
|
public double illusionerMovementSpeed = 0.5D;
|
|
public double illusionerFollowRange = 18.0D;
|
|
@@ -369,8 +387,35 @@ public class PurpurWorldConfig {
|
|
witherSkeletonTakesWitherDamage = getBoolean("mobs.wither_skeleton.takes-wither-damage", witherSkeletonTakesWitherDamage);
|
|
}
|
|
|
|
+ public boolean zombieJockeyOnlyBaby = true;
|
|
+ public double zombieJockeyChance = 0.05D;
|
|
+ public boolean zombieJockeyTryExistingChickens = true;
|
|
+ private void zombieSettings() {
|
|
+ zombieJockeyOnlyBaby = getBoolean("mobs.zombie.jockey.only-babies", zombieJockeyOnlyBaby);
|
|
+ zombieJockeyChance = getDouble("mobs.zombie.jockey.chance", zombieJockeyChance);
|
|
+ zombieJockeyTryExistingChickens = getBoolean("mobs.zombie.jockey.try-existing-chickens", zombieJockeyTryExistingChickens);
|
|
+ }
|
|
+
|
|
public double zombieHorseSpawnChance = 0.0D;
|
|
private void zombieHorseSettings() {
|
|
zombieHorseSpawnChance = getDouble("mobs.zombie_horse.spawn-chance", zombieHorseSpawnChance);
|
|
}
|
|
+
|
|
+ public boolean zombifiedPiglinJockeyOnlyBaby = true;
|
|
+ public double zombifiedPiglinJockeyChance = 0.05D;
|
|
+ public boolean zombifiedPiglinJockeyTryExistingChickens = true;
|
|
+ private void zombifiedPiglinSettings() {
|
|
+ zombifiedPiglinJockeyOnlyBaby = getBoolean("mobs.zombified_piglin.jockey.only-babies", zombifiedPiglinJockeyOnlyBaby);
|
|
+ zombifiedPiglinJockeyChance = getDouble("mobs.zombified_piglin.jockey.chance", zombifiedPiglinJockeyChance);
|
|
+ zombifiedPiglinJockeyTryExistingChickens = getBoolean("mobs.zombified_piglin.jockey.try-existing-chickens", zombifiedPiglinJockeyTryExistingChickens);
|
|
+ }
|
|
+
|
|
+ public boolean zombieVillagerJockeyOnlyBaby = true;
|
|
+ public double zombieVillagerJockeyChance = 0.05D;
|
|
+ public boolean zombieVillagerJockeyTryExistingChickens = true;
|
|
+ private void zombieVillagerSettings() {
|
|
+ zombieVillagerJockeyOnlyBaby = getBoolean("mobs.zombie_villager.jockey.only-babies", zombieVillagerJockeyOnlyBaby);
|
|
+ zombieVillagerJockeyChance = getDouble("mobs.zombie_villager.jockey.chance", zombieVillagerJockeyChance);
|
|
+ zombieVillagerJockeyTryExistingChickens = getBoolean("mobs.zombie_villager.jockey.try-existing-chickens", zombieVillagerJockeyTryExistingChickens);
|
|
+ }
|
|
}
|