mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
Upstream has released updates that appear to apply and compile correctly Paper Changes: 7232d8f2a EntityLoadCrossbowEvent#shouldConsumeItem 4740bd6c8 Mark PlayerInventory#getItem as nullable bd9ace578 Add a config option to limit the number of entities of each type to load/save in a chunk (#4792) 6bafeb5a9 Move logic from last patch into correct place 9668118fd disable entity ticking flag after watchdog obliteration
94 lines
5.4 KiB
Diff
94 lines
5.4 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/server/BlockIce.java b/src/main/java/net/minecraft/server/BlockIce.java
|
|
index aba5c6b8713c04302632bd1d289fd968c9e0607a..b75f6ded5d4bd3150789fba773a2c76c3e55bb90 100644
|
|
--- a/src/main/java/net/minecraft/server/BlockIce.java
|
|
+++ b/src/main/java/net/minecraft/server/BlockIce.java
|
|
@@ -13,7 +13,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;
|
|
}
|
|
@@ -41,7 +41,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/minecraft/server/ItemBucket.java b/src/main/java/net/minecraft/server/ItemBucket.java
|
|
index 120bf8436fd82294c339add2e7bff1cda8311aea..848a185c04aa90a62e6bcc49ad68a7489ca28970 100644
|
|
--- a/src/main/java/net/minecraft/server/ItemBucket.java
|
|
+++ b/src/main/java/net/minecraft/server/ItemBucket.java
|
|
@@ -122,7 +122,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();
|
|
@@ -130,7 +130,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/server/World.java b/src/main/java/net/minecraft/server/World.java
|
|
index 68cce071c740c90149225b4a28af849237b4492b..f260d01aad4db512952e5a53bf5bc01023bbd43d 100644
|
|
--- a/src/main/java/net/minecraft/server/World.java
|
|
+++ b/src/main/java/net/minecraft/server/World.java
|
|
@@ -1642,4 +1642,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/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
|
index ebf74ddb9786d3bcccb62c85352bb6c2278433f3..c12146fe8ac1d89c6c1051a8f64ea29a9214e64b 100644
|
|
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
|
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
|
@@ -1,7 +1,6 @@
|
|
package net.pl3x.purpur;
|
|
|
|
import com.google.common.base.Throwables;
|
|
-import net.minecraft.server.LocaleLanguage;
|
|
import net.minecraft.server.MinecraftServer;
|
|
import net.pl3x.purpur.command.PurpurCommand;
|
|
import org.bukkit.Bukkit;
|
|
@@ -186,6 +185,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() {
|