mirror of https://github.com/YatopiaMC/Yatopia.git
86 lines
5.3 KiB
Diff
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 9c7c68a3e73734ec2dbc57983ae27a16a7618fa2..45eb26b7414f39f3d4f5ca5994cd3f271f7d112f 100644
|
|
--- a/src/main/java/net/minecraft/world/level/World.java
|
|
+++ b/src/main/java/net/minecraft/world/level/World.java
|
|
@@ -1835,4 +1835,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() {
|