Files
Purpur/patches/server/0083-Add-allow-water-in-end-world-option.patch
BillyGalbreath 1343a05085 Updated Upstream (Paper, Tuinity, & Airplane)
Upstream has released updates that appear to apply and compile correctly

Paper Changes:
f3e541ca1 Actually list all missing hard depends (#5701)
11f83fe8e [CI-SKIP] [Auto] Rebuild Patches
a36e5d65f MC-148809: Fix incorrect structure block data length

Tuinity Changes:
f0e91a4ae Update Upstream (Paper)

Airplane Changes:
50babee71 Update Upstream (Tuinity)
85e0c63f5 Revert "Allow plugins to stupidly replace server internals"
db3fe2c70 Remove auto import
6b32e01eb Allow plugins to stupidly replace server internals
f849f00fc Flare update
ac10e43a9 Flare update
2021-05-21 17:25:12 -05:00

86 lines
5.3 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
Date: Sun, 5 Jul 2020 23:40:16 -0500
Subject: [PATCH] Add allow water in end world option
diff --git a/src/main/java/net/minecraft/world/item/ItemBucket.java b/src/main/java/net/minecraft/world/item/ItemBucket.java
index d126f668828e0788e369294c0b376ef52b344f2c..154a76b1b77a97bdf65153250c41275f72f6f73f 100644
--- a/src/main/java/net/minecraft/world/item/ItemBucket.java
+++ b/src/main/java/net/minecraft/world/item/ItemBucket.java
@@ -152,7 +152,7 @@ public class ItemBucket extends Item {
// CraftBukkit end
if (!flag1) {
return movingobjectpositionblock != null && this.a(entityhuman, world, movingobjectpositionblock.getBlockPosition().shift(movingobjectpositionblock.getDirection()), (MovingObjectPositionBlock) null, enumdirection, clicked, itemstack, enumhand); // CraftBukkit // Paper - add enumhand
- } else if (world.getDimensionManager().isNether() && this.fluidType.a((Tag) TagsFluid.WATER)) {
+ } else if ((world.isNether() || (world.isTheEnd() && !net.pl3x.purpur.PurpurConfig.allowWaterPlacementInTheEnd)) && this.fluidType.a((Tag) TagsFluid.WATER)) { // Purpur
int i = blockposition.getX();
int j = blockposition.getY();
int k = blockposition.getZ();
@@ -160,7 +160,7 @@ public class ItemBucket extends Item {
world.playSound(entityhuman, blockposition, SoundEffects.BLOCK_FIRE_EXTINGUISH, SoundCategory.BLOCKS, 0.5F, 2.6F + (world.random.nextFloat() - world.random.nextFloat()) * 0.8F);
for (int l = 0; l < 8; ++l) {
- world.addParticle(Particles.LARGE_SMOKE, (double) i + Math.random(), (double) j + Math.random(), (double) k + Math.random(), 0.0D, 0.0D, 0.0D);
+ ((WorldServer) world).sendParticles(null, Particles.LARGE_SMOKE, (double) i + Math.random(), (double) j + Math.random(), (double) k + Math.random(), 1, 0.0D, 0.0D, 0.0D, 0.0D, true); // Purpur
}
return true;
diff --git a/src/main/java/net/minecraft/world/level/World.java b/src/main/java/net/minecraft/world/level/World.java
index fc5e2263d05661672b3295da46d7e7495c5b40b6..8382d0f3158da3c90bba082e62411998632c3644 100644
--- a/src/main/java/net/minecraft/world/level/World.java
+++ b/src/main/java/net/minecraft/world/level/World.java
@@ -1833,4 +1833,14 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
public final boolean isDebugWorld() {
return this.debugWorld;
}
+
+ // Purpur start
+ 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
}
diff --git a/src/main/java/net/minecraft/world/level/block/BlockIce.java b/src/main/java/net/minecraft/world/level/block/BlockIce.java
index 461c85b426aab30c34529897e55aa842b45d0555..486a03f2582d6ece2775cb2db127953d31d041f8 100644
--- a/src/main/java/net/minecraft/world/level/block/BlockIce.java
+++ b/src/main/java/net/minecraft/world/level/block/BlockIce.java
@@ -27,7 +27,7 @@ public class BlockIce extends BlockHalfTransparent {
public void a(World world, EntityHuman entityhuman, BlockPosition blockposition, IBlockData iblockdata, @Nullable TileEntity tileentity, ItemStack itemstack) {
super.a(world, entityhuman, blockposition, iblockdata, tileentity, itemstack);
if (EnchantmentManager.getEnchantmentLevel(Enchantments.SILK_TOUCH, itemstack) == 0) {
- if (world.getDimensionManager().isNether()) {
+ if (world.isNether() || (world.isTheEnd() && !net.pl3x.purpur.PurpurConfig.allowWaterPlacementInTheEnd)) { // Purpur
world.a(blockposition, false);
return;
}
@@ -55,7 +55,7 @@ public class BlockIce extends BlockHalfTransparent {
return;
}
// CraftBukkit end
- if (world.getDimensionManager().isNether()) {
+ if (world.isNether() || (world.isTheEnd() && !net.pl3x.purpur.PurpurConfig.allowWaterPlacementInTheEnd)) { // Purpur
world.a(blockposition, false);
} else {
world.setTypeUpdate(blockposition, Blocks.WATER.getBlockData());
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
index 969a4359dfb35e4cfeac26e1f6c700d7e9d142eb..5c65438c8b8acd2893346d26649c9fe142da05e9 100644
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
@@ -186,6 +186,11 @@ public class PurpurConfig {
dontSendUselessEntityPackets = getBoolean("settings.dont-send-useless-entity-packets", dontSendUselessEntityPackets);
}
+ public static boolean allowWaterPlacementInTheEnd = true;
+ private static void allowWaterPlacementInEnd() {
+ allowWaterPlacementInTheEnd = getBoolean("settings.allow-water-placement-in-the-end", allowWaterPlacementInTheEnd);
+ }
+
public static boolean loggerSuppressInitLegacyMaterialError = false;
public static boolean loggerSuppressIgnoredAdvancementWarnings = false;
private static void loggerSettings() {