mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
Add allow water in end world option
This commit is contained in:
@@ -0,0 +1,93 @@
|
||||
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 aba5c6b871..b75f6ded5d 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 120bf8436f..848a185c04 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 14eadf64e7..4df988a694 100644
|
||||
--- a/src/main/java/net/minecraft/server/World.java
|
||||
+++ b/src/main/java/net/minecraft/server/World.java
|
||||
@@ -1573,4 +1573,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 066ae1fecb..494d36085e 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;
|
||||
@@ -187,6 +186,11 @@ public class PurpurConfig {
|
||||
private static void fixItemPositionDesync() {
|
||||
fixItemPositionDesync = getBoolean("settings.fix-item-position-desync", fixItemPositionDesync);
|
||||
}
|
||||
+
|
||||
+ 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;
|
||||
Reference in New Issue
Block a user