Add allow water in end world option

This commit is contained in:
William Blake Galbreath
2025-01-05 22:08:11 -08:00
committed by granny
parent ce40bab666
commit 89f059a25a
5 changed files with 60 additions and 85 deletions

View File

@@ -16,3 +16,18 @@
this.generator = gen;
this.world = new CraftWorld((ServerLevel) this, gen, biomeProvider, env);
@@ -2130,4 +_,14 @@
return this.id;
}
}
+
+ // Purpur start - Add allow water in end world option
+ public boolean isNether() {
+ return getWorld().getEnvironment() == org.bukkit.World.Environment.NETHER;
+ }
+
+ public boolean isTheEnd() {
+ return getWorld().getEnvironment() == org.bukkit.World.Environment.THE_END;
+ }
+ // Purpur end - Add allow water in end world option
}

View File

@@ -0,0 +1,20 @@
--- a/net/minecraft/world/level/block/IceBlock.java
+++ b/net/minecraft/world/level/block/IceBlock.java
@@ -40,7 +_,7 @@
public void afterDestroy(Level level, BlockPos pos, ItemStack stack) {
// Paper end - Improve Block#breakNaturally API
if (!EnchantmentHelper.hasTag(stack, EnchantmentTags.PREVENTS_ICE_MELTING)) {
- if (level.dimensionType().ultraWarm()) {
+ if (level.isNether() || (level.isTheEnd() && !org.purpurmc.purpur.PurpurConfig.allowWaterPlacementInTheEnd)) { // Purpur - Add allow water in end world option
level.removeBlock(pos, false);
return;
}
@@ -65,7 +_,7 @@
return;
}
// CraftBukkit end
- if (level.dimensionType().ultraWarm()) {
+ if (level.isNether() || (level.isTheEnd() && !org.purpurmc.purpur.PurpurConfig.allowWaterPlacementInTheEnd)) { // Purpur - Add allow water in end world option
level.removeBlock(pos, false);
} else {
level.setBlockAndUpdate(pos, meltsInto());