mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-19 17:37:42 +01:00
269/273
This commit is contained in:
46
patches/server/0205-Silk-touchable-budding-amethyst.patch
Normal file
46
patches/server/0205-Silk-touchable-budding-amethyst.patch
Normal file
@@ -0,0 +1,46 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Fri, 16 Jul 2021 22:00:17 -0500
|
||||
Subject: [PATCH] Silk touchable budding amethyst
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/BuddingAmethystBlock.java b/src/main/java/net/minecraft/world/level/block/BuddingAmethystBlock.java
|
||||
index bedccb8717d08d5a60058445b04ddff149e7d36c..5293ffca3da94c9c485a87d1232b6a902fcafd6a 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/BuddingAmethystBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/BuddingAmethystBlock.java
|
||||
@@ -53,4 +53,14 @@ public class BuddingAmethystBlock extends AmethystBlock {
|
||||
public static boolean canClusterGrowAtState(BlockState state) {
|
||||
return state.isAir() || state.is(Blocks.WATER) && state.getFluidState().getAmount() == 8;
|
||||
}
|
||||
+
|
||||
+ // Purpur start
|
||||
+ @Override
|
||||
+ public void playerDestroy(net.minecraft.world.level.Level level, net.minecraft.world.entity.player.Player player, BlockPos pos, BlockState state, net.minecraft.world.level.block.entity.BlockEntity blockEntity, net.minecraft.world.item.ItemStack stack) {
|
||||
+ if (level.purpurConfig.buddingAmethystSilkTouch && net.minecraft.world.item.enchantment.EnchantmentHelper.getItemEnchantmentLevel(net.minecraft.world.item.enchantment.Enchantments.SILK_TOUCH, stack) > 0) {
|
||||
+ popResource(level, pos, net.minecraft.world.item.Items.BUDDING_AMETHYST.getDefaultInstance());
|
||||
+ }
|
||||
+ super.playerDestroy(level, player, pos, state, blockEntity, stack);
|
||||
+ }
|
||||
+ // Purpur end
|
||||
}
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
index 6826a2bc2a359140e562b5e3278b31d878216bd6..3a9cb286cc53011cf50d00098fc2e02e58929be4 100644
|
||||
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
@@ -691,6 +691,11 @@ public class PurpurWorldConfig {
|
||||
}
|
||||
}
|
||||
|
||||
+ public boolean buddingAmethystSilkTouch = false;
|
||||
+ private void buddingAmethystSettings() {
|
||||
+ buddingAmethystSilkTouch = getBoolean("blocks.budding_amethyst.silk-touch", buddingAmethystSilkTouch);
|
||||
+ }
|
||||
+
|
||||
public boolean chestOpenWithBlockOnTop = false;
|
||||
private void chestSettings() {
|
||||
chestOpenWithBlockOnTop = getBoolean("blocks.chest.open-with-solid-block-on-top", chestOpenWithBlockOnTop);
|
||||
@@ -2665,3 +2670,4 @@ public class PurpurWorldConfig {
|
||||
hungerStarvationDamage = (float) getDouble("hunger.starvation-damage", hungerStarvationDamage);
|
||||
}
|
||||
}
|
||||
+
|
||||
Reference in New Issue
Block a user