Skip to content

Commit

Permalink
option to place end crystal on any block
Browse files Browse the repository at this point in the history
  • Loading branch information
granny committed Aug 23, 2023
1 parent cf23229 commit ad645dc
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions patches/server/0307-place-end-crystal-on-any-block.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: granny <contact@granny.dev>
Date: Wed, 23 Aug 2023 01:39:14 -0700
Subject: [PATCH] place end crystal on any block


diff --git a/src/main/java/net/minecraft/world/item/EndCrystalItem.java b/src/main/java/net/minecraft/world/item/EndCrystalItem.java
index dc695c518beed770e787d61bcda7e1cd28bc43eb..528f836dfc220dc4b929c321dafc6a78b54d899b 100644
--- a/src/main/java/net/minecraft/world/item/EndCrystalItem.java
+++ b/src/main/java/net/minecraft/world/item/EndCrystalItem.java
@@ -26,7 +26,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();
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
index ec6c29638935835d590823c5cc35141a7f4d32f2..078102e636803f38facc049952813ff2f8b63594 100644
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
@@ -903,6 +903,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()))) {
@@ -931,6 +932,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;

1 comment on commit ad645dc

@cL3v3r47
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

End crystals can only be placed on Obsidian and nothing else

Please sign in to comment.