mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 08:27:43 +01:00
Add allow water in end world option
This commit is contained in:
committed by
granny
parent
ce40bab666
commit
89f059a25a
@@ -1,85 +0,0 @@
|
||||
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/net/minecraft/world/item/BucketItem.java b/net/minecraft/world/item/BucketItem.java
|
||||
index 3bddfb6f7412ab86e0c090d0cbc6cf254b3f891c..b9190acbcb256a3072f0a5f1c4c731f1222b459f 100644
|
||||
--- a/net/minecraft/world/item/BucketItem.java
|
||||
+++ b/net/minecraft/world/item/BucketItem.java
|
||||
@@ -196,7 +196,7 @@ public class BucketItem extends Item implements DispensibleContainerItem {
|
||||
// CraftBukkit end
|
||||
if (!flag2) {
|
||||
return movingobjectpositionblock != null && this.emptyContents(entityhuman, world, movingobjectpositionblock.getBlockPos().relative(movingobjectpositionblock.getDirection()), (BlockHitResult) null, enumdirection, clicked, itemstack, enumhand); // CraftBukkit
|
||||
- } else if (world.dimensionType().ultraWarm() && this.content.is(FluidTags.WATER)) {
|
||||
+ } else if ((world.dimensionType().ultraWarm() || (world.isTheEnd() && !org.purpurmc.purpur.PurpurConfig.allowWaterPlacementInTheEnd)) && this.content.is(FluidTags.WATER)) { // Purpur - Add allow water in end world option
|
||||
int i = blockposition.getX();
|
||||
int j = blockposition.getY();
|
||||
int k = blockposition.getZ();
|
||||
@@ -204,7 +204,7 @@ public class BucketItem extends Item implements DispensibleContainerItem {
|
||||
world.playSound(entityhuman, blockposition, SoundEvents.FIRE_EXTINGUISH, SoundSource.BLOCKS, 0.5F, 2.6F + (world.random.nextFloat() - world.random.nextFloat()) * 0.8F);
|
||||
|
||||
for (int l = 0; l < 8; ++l) {
|
||||
- world.addParticle(ParticleTypes.LARGE_SMOKE, (double) i + Math.random(), (double) j + Math.random(), (double) k + Math.random(), 0.0D, 0.0D, 0.0D);
|
||||
+ ((ServerLevel) world).sendParticlesSource(null, ParticleTypes.LARGE_SMOKE, false, true, (double) i + Math.random(), (double) j + Math.random(), (double) k + Math.random(), 1, 0.0D, 0.0D, 0.0D, 0.0D); // Purpur - Add allow water in end world option
|
||||
}
|
||||
|
||||
return true;
|
||||
diff --git a/net/minecraft/world/level/Level.java b/net/minecraft/world/level/Level.java
|
||||
index f3c5e076558cd8d7b9d9b3212872f8675670b2dd..13c99a770e8c466cdba5f397cf8156aed42b55ba 100644
|
||||
--- a/net/minecraft/world/level/Level.java
|
||||
+++ b/net/minecraft/world/level/Level.java
|
||||
@@ -2047,4 +2047,14 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||
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
|
||||
}
|
||||
diff --git a/net/minecraft/world/level/block/IceBlock.java b/net/minecraft/world/level/block/IceBlock.java
|
||||
index a94762e65853ccad38cf90b0049ca256106c0c9f..aa93b5041b65dbcdc5bbea65567eaf5d8c433a0d 100644
|
||||
--- a/net/minecraft/world/level/block/IceBlock.java
|
||||
+++ b/net/minecraft/world/level/block/IceBlock.java
|
||||
@@ -42,7 +42,7 @@ public class IceBlock extends HalfTransparentBlock {
|
||||
public void afterDestroy(Level world, BlockPos pos, ItemStack tool) {
|
||||
// Paper end - Improve Block#breakNaturally API
|
||||
if (!EnchantmentHelper.hasTag(tool, EnchantmentTags.PREVENTS_ICE_MELTING)) {
|
||||
- if (world.dimensionType().ultraWarm()) {
|
||||
+ if (world.isNether() || (world.isTheEnd() && !org.purpurmc.purpur.PurpurConfig.allowWaterPlacementInTheEnd)) { // Purpur - Add allow water in end world option
|
||||
world.removeBlock(pos, false);
|
||||
return;
|
||||
}
|
||||
@@ -70,7 +70,7 @@ public class IceBlock extends HalfTransparentBlock {
|
||||
return;
|
||||
}
|
||||
// CraftBukkit end
|
||||
- if (world.dimensionType().ultraWarm()) {
|
||||
+ if (world.isNether() || (world.isTheEnd() && !org.purpurmc.purpur.PurpurConfig.allowWaterPlacementInTheEnd)) { // Purpur - Add allow water in end world option
|
||||
world.removeBlock(pos, false);
|
||||
} else {
|
||||
world.setBlockAndUpdate(pos, IceBlock.meltsInto());
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/PurpurConfig.java b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
||||
index df61db286f8b098a16c59a64714554d6d4c60655..5aa172d86f3d36a239147438e8d71c73ec2a3cf0 100644
|
||||
--- a/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
||||
+++ b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
||||
@@ -247,6 +247,11 @@ public class PurpurConfig {
|
||||
enderChestPermissionRows = getBoolean("settings.blocks.ender_chest.use-permissions-for-rows", enderChestPermissionRows);
|
||||
}
|
||||
|
||||
+ 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;
|
||||
public static boolean loggerSuppressUnrecognizedRecipeErrors = false;
|
||||
@@ -0,0 +1,20 @@
|
||||
--- a/net/minecraft/world/item/BucketItem.java
|
||||
+++ b/net/minecraft/world/item/BucketItem.java
|
||||
@@ -147,7 +_,7 @@
|
||||
// CraftBukkit end
|
||||
if (!flag) {
|
||||
return result != null && this.emptyContents(player, level, result.getBlockPos().relative(result.getDirection()), null, enumdirection, clicked, itemstack, enumhand); // CraftBukkit
|
||||
- } else if (level.dimensionType().ultraWarm() && this.content.is(FluidTags.WATER)) {
|
||||
+ } else if ((level.dimensionType().ultraWarm() || (level.isTheEnd() && !org.purpurmc.purpur.PurpurConfig.allowWaterPlacementInTheEnd)) && this.content.is(FluidTags.WATER)) { // Purpur - Add allow water in end world option
|
||||
int x = pos.getX();
|
||||
int y = pos.getY();
|
||||
int z = pos.getZ();
|
||||
@@ -156,7 +_,7 @@
|
||||
);
|
||||
|
||||
for (int i = 0; i < 8; i++) {
|
||||
- level.addParticle(ParticleTypes.LARGE_SMOKE, x + Math.random(), y + Math.random(), z + Math.random(), 0.0, 0.0, 0.0);
|
||||
+ ((net.minecraft.server.level.ServerLevel) level).sendParticlesSource(null, ParticleTypes.LARGE_SMOKE, false, true, x + Math.random(), y + Math.random(), z + Math.random(), 1, 0.0D, 0.0D, 0.0D, 0.0D); // Purpur - Add allow water in end world option
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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());
|
||||
@@ -228,6 +228,11 @@ public class PurpurConfig {
|
||||
enderChestPermissionRows = getBoolean("settings.blocks.ender_chest.use-permissions-for-rows", enderChestPermissionRows);
|
||||
}
|
||||
|
||||
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;
|
||||
public static boolean loggerSuppressUnrecognizedRecipeErrors = false;
|
||||
|
||||
Reference in New Issue
Block a user