diff --git a/patches/server/0282-place-end-crystal-on-any-block.patch b/patches/server/0282-place-end-crystal-on-any-block.patch deleted file mode 100644 index 751a16754..000000000 --- a/patches/server/0282-place-end-crystal-on-any-block.patch +++ /dev/null @@ -1,39 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: granny -Date: Wed, 23 Aug 2023 01:39:14 -0700 -Subject: [PATCH] place end crystal on any block - - -diff --git a/net/minecraft/world/item/EndCrystalItem.java b/net/minecraft/world/item/EndCrystalItem.java -index b62db8c7c8c57e43869ee239ebf4b02f112355d9..f60e39e56a5dab2de62ae9cfd7a30a70b4985c09 100644 ---- a/net/minecraft/world/item/EndCrystalItem.java -+++ b/net/minecraft/world/item/EndCrystalItem.java -@@ -27,7 +27,7 @@ public class EndCrystalItem extends Item { - BlockPos blockposition = context.getClickedPos(); - BlockState iblockdata = world.getBlockState(blockposition); - -- if (!iblockdata.is(Blocks.OBSIDIAN) && !iblockdata.is(Blocks.BEDROCK)) { -+ if (!world.purpurConfig.endCrystalPlaceAnywhere && !iblockdata.is(Blocks.OBSIDIAN) && !iblockdata.is(Blocks.BEDROCK)) { - return InteractionResult.FAIL; - } else { - BlockPos blockposition1 = blockposition.above(); final BlockPos aboveBlockPosition = blockposition1; // Paper - OBFHELPER -diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java -index 3308e2ce5bf49996c7dd75bb604989225cabd16d..552993124deefef3b9875608cea545b3a97b8bc6 100644 ---- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java -+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java -@@ -944,6 +944,7 @@ public class PurpurWorldConfig { - public boolean basedEndCrystalExplosionFire = false; - public net.minecraft.world.level.Level.ExplosionInteraction basedEndCrystalExplosionEffect = net.minecraft.world.level.Level.ExplosionInteraction.BLOCK; - public int endCrystalCramming = 0; -+ public boolean endCrystalPlaceAnywhere = false; - private void endCrystalSettings() { - if (PurpurConfig.version < 31) { - if ("DESTROY".equals(getString("blocks.end-crystal.baseless.explosion-effect", baselessEndCrystalExplosionEffect.name()))) { -@@ -972,6 +973,7 @@ public class PurpurWorldConfig { - basedEndCrystalExplosionEffect = net.minecraft.world.level.Level.ExplosionInteraction.BLOCK; - } - endCrystalCramming = getInt("blocks.end-crystal.cramming-amount", endCrystalCramming); -+ endCrystalPlaceAnywhere = getBoolean("gameplay-mechanics.item.end-crystal.place-anywhere", endCrystalPlaceAnywhere); - } - - public boolean farmlandBypassMobGriefing = false; diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/item/EndCrystalItem.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/item/EndCrystalItem.java.patch new file mode 100644 index 000000000..d46e5ccc9 --- /dev/null +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/item/EndCrystalItem.java.patch @@ -0,0 +1,11 @@ +--- a/net/minecraft/world/item/EndCrystalItem.java ++++ b/net/minecraft/world/item/EndCrystalItem.java +@@ -24,7 +_,7 @@ + Level level = context.getLevel(); + BlockPos clickedPos = context.getClickedPos(); + BlockState blockState = level.getBlockState(clickedPos); +- if (!blockState.is(Blocks.OBSIDIAN) && !blockState.is(Blocks.BEDROCK)) { ++ if (!level.purpurConfig.endCrystalPlaceAnywhere && !blockState.is(Blocks.OBSIDIAN) && !blockState.is(Blocks.BEDROCK)) { // Purpur - place end crystal on any block + return InteractionResult.FAIL; + } else { + BlockPos blockPos = clickedPos.above(); final BlockPos aboveBlockPosition = blockPos; // Paper - OBFHELPER diff --git a/purpur-server/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/purpur-server/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java index 4374ba8b2..44614c418 100644 --- a/purpur-server/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java +++ b/purpur-server/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java @@ -943,6 +943,7 @@ public class PurpurWorldConfig { public boolean basedEndCrystalExplosionFire = false; public net.minecraft.world.level.Level.ExplosionInteraction basedEndCrystalExplosionEffect = net.minecraft.world.level.Level.ExplosionInteraction.BLOCK; public int endCrystalCramming = 0; + public boolean endCrystalPlaceAnywhere = false; private void endCrystalSettings() { if (PurpurConfig.version < 31) { if ("DESTROY".equals(getString("blocks.end-crystal.baseless.explosion-effect", baselessEndCrystalExplosionEffect.name()))) { @@ -971,6 +972,7 @@ public class PurpurWorldConfig { basedEndCrystalExplosionEffect = net.minecraft.world.level.Level.ExplosionInteraction.BLOCK; } endCrystalCramming = getInt("blocks.end-crystal.cramming-amount", endCrystalCramming); + endCrystalPlaceAnywhere = getBoolean("gameplay-mechanics.item.end-crystal.place-anywhere", endCrystalPlaceAnywhere); } public boolean farmlandBypassMobGriefing = false;