mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-18 00:47:42 +01:00
42 lines
2.3 KiB
Diff
42 lines
2.3 KiB
Diff
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 02fc3ede12eadbf72e26e31b1c475c7f5b2ad73a..2288e727929ffb3a3bca138fb02894080d631594 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/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
index a9cb05554f20a5b3ac3b4368c3772ebfc77f561f..b0cf22a170d4c62bf0ffc95fc169e623ce236a24 100644
|
|
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
@@ -705,6 +705,11 @@ public class PurpurWorldConfig {
|
|
}
|
|
}
|
|
|
|
+ public boolean buddingAmethystSilkTouch = false;
|
|
+ private void buddingAmethystSettings() {
|
|
+ buddingAmethystSilkTouch = getBoolean("blocks.budding_amethyst.silk-touch", buddingAmethystSilkTouch);
|
|
+ }
|
|
+
|
|
public double caveVinesGrowthModifier = 0.10D;
|
|
public int caveVinesMaxGrowthAge = 25;
|
|
private void caveVinesSettings() {
|