mirror of
https://github.com/BX-Team/DivineMC.git
synced 2025-12-22 08:19:19 +00:00
Upstream has released updates that appear to apply and compile correctly Purpur Changes: PurpurMC/Purpur@987f46f Update remapper version PurpurMC/Purpur@65150b4 Updated Upstream (Paper)
325 lines
16 KiB
Diff
325 lines
16 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: NONPLAYT <76615486+NONPLAYT@users.noreply.github.com>
|
|
Date: Mon, 12 Jun 2023 15:31:21 +0300
|
|
Subject: [PATCH] Add missing purpur config options
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/entity/animal/allay/Allay.java b/src/main/java/net/minecraft/world/entity/animal/allay/Allay.java
|
|
index c783ce59ea766e6c46a3313628b961f27e01ee8b..4f6b6967f7f632752fcc4faac47dca51cfac1b79 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/animal/allay/Allay.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/animal/allay/Allay.java
|
|
@@ -152,6 +152,23 @@ public class Allay extends PathfinderMob implements InventoryCarrier, VibrationS
|
|
}
|
|
// Purpur end
|
|
|
|
+ // DivineMC start - Add missing purpur config options
|
|
+ @Override
|
|
+ public boolean isSensitiveToWater() {
|
|
+ return level().purpurConfig.allayTakeDamageFromWater;
|
|
+ }
|
|
+
|
|
+ @Override
|
|
+ public boolean isAlwaysExperienceDropper() {
|
|
+ return level().purpurConfig.allayAlwaysDropExp;
|
|
+ }
|
|
+
|
|
+ @Override
|
|
+ public void initAttributes() {
|
|
+ this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(level().purpurConfig.allayMaxHealth);
|
|
+ }
|
|
+ // DivineMC end
|
|
+
|
|
@Override
|
|
protected Brain.Provider<Allay> brainProvider() {
|
|
return Brain.provider(Allay.MEMORY_TYPES, Allay.SENSOR_TYPES);
|
|
diff --git a/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java b/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java
|
|
index 8616a8c09a21f576a07daaa93ebf64e0f03d0c88..6725e22ef763b3cd374ff38f5f36ad6ef97c8a19 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java
|
|
@@ -99,6 +99,18 @@ public class Camel extends AbstractHorse implements PlayerRideableJumping, Saddl
|
|
}
|
|
// Purpur end
|
|
|
|
+ // DivineMC start - Add missing purpur config options
|
|
+ @Override
|
|
+ public boolean isSensitiveToWater() {
|
|
+ return level().purpurConfig.camelTakeDamageFromWater;
|
|
+ }
|
|
+
|
|
+ @Override
|
|
+ public boolean isAlwaysExperienceDropper() {
|
|
+ return level().purpurConfig.camelAlwaysDropExp;
|
|
+ }
|
|
+ // DivineMC end
|
|
+
|
|
@Override
|
|
public void addAdditionalSaveData(CompoundTag nbt) {
|
|
super.addAdditionalSaveData(nbt);
|
|
diff --git a/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java b/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java
|
|
index d6340d0a1308bafd3ba176562bf08dcadec02b34..bc991589effff1a0c9bd48a16c7d460bed3dfd95 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java
|
|
@@ -142,6 +142,23 @@ public class Frog extends Animal implements VariantHolder<FrogVariant> {
|
|
return this.level().purpurConfig.frogBreedingTicks;
|
|
}
|
|
|
|
+ // DivineMC start - Add missing purpur config options
|
|
+ @Override
|
|
+ public boolean isSensitiveToWater() {
|
|
+ return level().purpurConfig.frogTakeDamageFromWater;
|
|
+ }
|
|
+
|
|
+ @Override
|
|
+ public boolean isAlwaysExperienceDropper() {
|
|
+ return level().purpurConfig.frogAlwaysDropExp;
|
|
+ }
|
|
+
|
|
+ @Override
|
|
+ public void initAttributes() {
|
|
+ this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(level().purpurConfig.frogMaxHealth);
|
|
+ }
|
|
+ // DivineMC end
|
|
+
|
|
@Override
|
|
protected Brain.Provider<Frog> brainProvider() {
|
|
return Brain.provider(MEMORY_TYPES, SENSOR_TYPES);
|
|
diff --git a/src/main/java/net/minecraft/world/entity/animal/frog/Tadpole.java b/src/main/java/net/minecraft/world/entity/animal/frog/Tadpole.java
|
|
index 2a9c2a69a0589e4e7b7c79d3716376b360a2eba1..b12b79765301782202abfe6b6da2b279a015e927 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/animal/frog/Tadpole.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/animal/frog/Tadpole.java
|
|
@@ -92,6 +92,23 @@ public class Tadpole extends AbstractFish {
|
|
}
|
|
// Purpur end
|
|
|
|
+ // DivineMC start - Add missing purpur config options
|
|
+ @Override
|
|
+ public boolean isSensitiveToWater() {
|
|
+ return level().purpurConfig.tadpoleTakeDamageFromWater;
|
|
+ }
|
|
+
|
|
+ @Override
|
|
+ public boolean isAlwaysExperienceDropper() {
|
|
+ return level().purpurConfig.tadpoleAlwaysDropExp;
|
|
+ }
|
|
+
|
|
+ @Override
|
|
+ public void initAttributes() {
|
|
+ this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(level().purpurConfig.tadpoleMaxHealth);
|
|
+ }
|
|
+ // DivineMC end
|
|
+
|
|
@Override
|
|
protected PathNavigation createNavigation(Level world) {
|
|
return new WaterBoundPathNavigation(this, world);
|
|
diff --git a/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java b/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java
|
|
index 5e7d76dcdc170b809ab82f6e2259c9b4d3d741be..459ea45bcd23ea55da6e561216eb664f97cacfa5 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java
|
|
@@ -118,6 +118,18 @@ public class Sniffer extends Animal {
|
|
return this.level().purpurConfig.snifferBreedingTicks;
|
|
}
|
|
|
|
+ // DivineMC start - Add missing purpur config options
|
|
+ @Override
|
|
+ public boolean isSensitiveToWater() {
|
|
+ return level().purpurConfig.snifferTakeDamageFromWater;
|
|
+ }
|
|
+
|
|
+ @Override
|
|
+ public boolean isAlwaysExperienceDropper() {
|
|
+ return level().purpurConfig.snifferAlwaysDropExp;
|
|
+ }
|
|
+ // DivineMC end
|
|
+
|
|
// CraftBukkit start - SPIGOT-7295: moved from constructor to appropriate location
|
|
@Override
|
|
protected void defineSynchedData() {
|
|
diff --git a/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java b/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java
|
|
index bf7ef72a7d92db8f11789a69583270644de0dac7..1bcdee570baf1499d660d019cf03b66dd4d05195 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java
|
|
@@ -149,6 +149,23 @@ public class Warden extends Monster implements VibrationSystem {
|
|
}
|
|
// Purpur end
|
|
|
|
+ // DivineMC start - Add missing purpur config options
|
|
+ @Override
|
|
+ public boolean isSensitiveToWater() {
|
|
+ return level().purpurConfig.wardenTakeDamageFromWater;
|
|
+ }
|
|
+
|
|
+ @Override
|
|
+ public boolean isAlwaysExperienceDropper() {
|
|
+ return level().purpurConfig.wardenAlwaysDropExp;
|
|
+ }
|
|
+
|
|
+ @Override
|
|
+ public void initAttributes() {
|
|
+ this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(level().purpurConfig.wardenMaxHealth);
|
|
+ }
|
|
+ // DivineMC end
|
|
+
|
|
@Override
|
|
public Packet<ClientGamePacketListener> getAddEntityPacket() {
|
|
return new ClientboundAddEntityPacket(this, this.hasPose(Pose.EMERGING) ? 1 : 0);
|
|
diff --git a/src/main/java/net/minecraft/world/entity/vehicle/ChestBoat.java b/src/main/java/net/minecraft/world/entity/vehicle/ChestBoat.java
|
|
index 58af87b8faf4f8d6bdb111c49a429466acface68..bbadae5873db4b49273b054c1921a401f119fc3a 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/vehicle/ChestBoat.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/vehicle/ChestBoat.java
|
|
@@ -32,6 +32,9 @@ import org.bukkit.entity.HumanEntity;
|
|
import org.bukkit.event.entity.EntityRemoveEvent;
|
|
import org.bukkit.inventory.InventoryHolder;
|
|
// CraftBukkit end
|
|
+// DivineMC start
|
|
+import org.purpurmc.purpur.PurpurConfig;
|
|
+// DivineMC end
|
|
|
|
public class ChestBoat extends Boat implements HasCustomInventoryScreen, ContainerEntity {
|
|
|
|
@@ -43,7 +46,7 @@ public class ChestBoat extends Boat implements HasCustomInventoryScreen, Contain
|
|
|
|
public ChestBoat(EntityType<? extends Boat> type, Level world) {
|
|
super(type, world);
|
|
- this.itemStacks = NonNullList.withSize(27, ItemStack.EMPTY);
|
|
+ this.itemStacks = NonNullList.withSize(PurpurConfig.chestBoatRows * 9, ItemStack.EMPTY); // DivineMC start - Add missing purpur config options
|
|
}
|
|
|
|
public ChestBoat(Level world, double d0, double d1, double d2) {
|
|
@@ -170,7 +173,7 @@ public class ChestBoat extends Boat implements HasCustomInventoryScreen, Contain
|
|
|
|
@Override
|
|
public int getContainerSize() {
|
|
- return 27;
|
|
+ return PurpurConfig.chestBoatRows * 9; // DivineMC - Add missing purpur config options
|
|
}
|
|
|
|
@Override
|
|
diff --git a/src/main/java/org/purpurmc/purpur/PurpurConfig.java b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
|
index fe4c1659f0ca111db8a6d2d6b06d1783872705d6..80a5df11f57fb39a71461b774f0f5bcf94cd4c5c 100644
|
|
--- a/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
|
+++ b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
|
@@ -328,6 +328,7 @@ public class PurpurConfig {
|
|
}
|
|
|
|
public static int barrelRows = 3;
|
|
+ public static int chestBoatRows = 3; // DivineMC - Add missing purpur config options
|
|
public static boolean enderChestSixRows = false;
|
|
public static boolean enderChestPermissionRows = false;
|
|
public static boolean cryingObsidianValidForPortalFrame = false;
|
|
@@ -368,6 +369,7 @@ public class PurpurConfig {
|
|
case 1 -> 9;
|
|
default -> 27;
|
|
});
|
|
+ chestBoatRows = getInt("settings.blocks.chest_boat.rows", chestBoatRows); // DivineMC - Add missing purpur config options
|
|
enderChestSixRows = getBoolean("settings.blocks.ender_chest.six-rows", enderChestSixRows);
|
|
org.bukkit.event.inventory.InventoryType.ENDER_CHEST.setDefaultSize(enderChestSixRows ? 54 : 27);
|
|
enderChestPermissionRows = getBoolean("settings.blocks.ender_chest.use-permissions-for-rows", enderChestPermissionRows);
|
|
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
index 002c9bba93dede25111c653ec1df38316f19421f..2d829f61b66cc3b2ff9e90cac038c67b8620a9c3 100644
|
|
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
@@ -1170,7 +1170,17 @@ public class PurpurWorldConfig {
|
|
public boolean allayRidableInWater = true;
|
|
public boolean allayControllable = true;
|
|
public List<String> allayRespectNBT = new ArrayList<>();
|
|
+ // DivineMC start - Add missing purpur config options
|
|
+ public double allayMaxHealth = 20.0D;
|
|
+ public boolean allayTakeDamageFromWater = false;
|
|
+ public boolean allayAlwaysDropExp = false;
|
|
+ // DivineMC end
|
|
private void allaySettings() {
|
|
+ // DivineMC start - Add missing purpur config options
|
|
+ allayMaxHealth = getDouble("mobs.allay.max-health", allayMaxHealth);
|
|
+ allayTakeDamageFromWater = getBoolean("mobs.allay.take-damage-from-water", allayTakeDamageFromWater);
|
|
+ allayAlwaysDropExp = getBoolean("mobs.allay.always-drop-exp", allayAlwaysDropExp);
|
|
+ // DivineMC end
|
|
allayRidable = getBoolean("mobs.allay.ridable", allayRidable);
|
|
allayRidableInWater = getBoolean("mobs.allay.ridable-in-water", allayRidableInWater);
|
|
allayControllable = getBoolean("mobs.allay.controllable", allayControllable);
|
|
@@ -1289,7 +1299,15 @@ public class PurpurWorldConfig {
|
|
public double camelMovementSpeedMin = 0.09D;
|
|
public double camelMovementSpeedMax = 0.09D;
|
|
public int camelBreedingTicks = 6000;
|
|
+ // DivineMC start - Add missing purpur config options
|
|
+ public boolean camelTakeDamageFromWater = false;
|
|
+ public boolean camelAlwaysDropExp = false;
|
|
+ // DivineMC end
|
|
private void camelSettings() {
|
|
+ // DivineMC start - Add missing purpur config options
|
|
+ camelTakeDamageFromWater = getBoolean("mobs.camel.takes-damage-from-water", camelTakeDamageFromWater);
|
|
+ camelAlwaysDropExp = getBoolean("mobs.camel.always-drop-exp", camelAlwaysDropExp);
|
|
+ // DivineMC end
|
|
camelRidableInWater = getBoolean("mobs.camel.ridable-in-water", camelRidableInWater);
|
|
camelMaxHealthMin = getDouble("mobs.camel.attributes.max_health.min", camelMaxHealthMin);
|
|
camelMaxHealthMax = getDouble("mobs.camel.attributes.max_health.max", camelMaxHealthMax);
|
|
@@ -1717,7 +1735,17 @@ public class PurpurWorldConfig {
|
|
public boolean frogControllable = true;
|
|
public float frogRidableJumpHeight = 0.65F;
|
|
public int frogBreedingTicks = 6000;
|
|
+ // DivineMC start - Add missing purpur config options
|
|
+ public double frogMaxHealth = 10.0D;
|
|
+ public boolean frogTakeDamageFromWater = false;
|
|
+ public boolean frogAlwaysDropExp = false;
|
|
+ // DivineMC end
|
|
private void frogSettings() {
|
|
+ // DivineMC start - Add missing purpur config options
|
|
+ frogMaxHealth = getDouble("mobs.frog.attributes.max_health", frogMaxHealth);
|
|
+ frogTakeDamageFromWater = getBoolean("mobs.frog.takes-damage-from-water", frogTakeDamageFromWater);
|
|
+ frogAlwaysDropExp = getBoolean("mobs.frog.always-drop-exp", frogAlwaysDropExp);
|
|
+ // DivineMC end
|
|
frogRidable = getBoolean("mobs.frog.ridable", frogRidable);
|
|
frogRidableInWater = getBoolean("mobs.frog.ridable-in-water", frogRidableInWater);
|
|
frogControllable = getBoolean("mobs.frog.controllable", frogControllable);
|
|
@@ -2668,7 +2696,15 @@ public class PurpurWorldConfig {
|
|
public boolean snifferControllable = true;
|
|
public double snifferMaxHealth = 14.0D;
|
|
public int snifferBreedingTicks = 6000;
|
|
+ // DivineMC start - Add missing purpur config options
|
|
+ public boolean snifferTakeDamageFromWater = false;
|
|
+ public boolean snifferAlwaysDropExp = false;
|
|
+ // DivineMC end
|
|
private void snifferSettings() {
|
|
+ // DivineMC start - Add missing purpur config options
|
|
+ snifferTakeDamageFromWater = getBoolean("mobs.sniffer.takes-damage-from-water", snifferTakeDamageFromWater);
|
|
+ snifferAlwaysDropExp = getBoolean("mobs.sniffer.always-drop-exp", snifferAlwaysDropExp);
|
|
+ // DivineMC end
|
|
snifferRidable = getBoolean("mobs.sniffer.ridable", snifferRidable);
|
|
snifferRidableInWater = getBoolean("mobs.sniffer.ridable-in-water", snifferRidableInWater);
|
|
snifferControllable = getBoolean("mobs.sniffer.controllable", snifferControllable);
|
|
@@ -2767,7 +2803,17 @@ public class PurpurWorldConfig {
|
|
public boolean tadpoleRidable = false;
|
|
public boolean tadpoleRidableInWater = true;
|
|
public boolean tadpoleControllable = true;
|
|
+ // DivineMC start - Add missing purpur config options
|
|
+ public double tadpoleMaxHealth = 10.0D;
|
|
+ public boolean tadpoleTakeDamageFromWater = false;
|
|
+ public boolean tadpoleAlwaysDropExp = false;
|
|
+ // DivineMC end
|
|
private void tadpoleSettings() {
|
|
+ // DivineMC start - Add missing purpur config options
|
|
+ tadpoleMaxHealth = getDouble("mobs.tadpole.attributes.max_health", tadpoleMaxHealth);
|
|
+ tadpoleTakeDamageFromWater = getBoolean("mobs.tadpole.takes-damage-from-water", tadpoleTakeDamageFromWater);
|
|
+ tadpoleAlwaysDropExp = getBoolean("mobs.tadpole.always-drop-exp", tadpoleAlwaysDropExp);
|
|
+ // DivineMC end
|
|
tadpoleRidable = getBoolean("mobs.tadpole.ridable", tadpoleRidable);
|
|
tadpoleRidableInWater = getBoolean("mobs.tadpole.ridable-in-water", tadpoleRidableInWater);
|
|
tadpoleControllable = getBoolean("mobs.tadpole.controllable", tadpoleControllable);
|
|
@@ -2979,7 +3025,17 @@ public class PurpurWorldConfig {
|
|
public boolean wardenRidable = false;
|
|
public boolean wardenRidableInWater = true;
|
|
public boolean wardenControllable = true;
|
|
+ // DivineMC start - Add missing purpur config options
|
|
+ public double wardenMaxHealth = 500.0D;
|
|
+ public boolean wardenTakeDamageFromWater = false;
|
|
+ public boolean wardenAlwaysDropExp = false;
|
|
+ // DivineMC end
|
|
private void wardenSettings() {
|
|
+ // DivineMC start - Add missing purpur config options
|
|
+ wardenMaxHealth = getDouble("mobs.warden.attributes.max_health", wardenMaxHealth);
|
|
+ wardenTakeDamageFromWater = getBoolean("mobs.warden.takes-damage-from-water", wardenTakeDamageFromWater);
|
|
+ wardenAlwaysDropExp = getBoolean("mobs.warden.always-drop-exp", wardenAlwaysDropExp);
|
|
+ // DivineMC end
|
|
wardenRidable = getBoolean("mobs.warden.ridable", wardenRidable);
|
|
wardenRidableInWater = getBoolean("mobs.warden.ridable-in-water", wardenRidableInWater);
|
|
wardenControllable = getBoolean("mobs.warden.controllable", wardenControllable);
|