mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-20 18:07:43 +01:00
Upstream has released updates that appear to apply and compile correctly Paper Changes: 12dec20 Bump paerweight to 1.1.7 e33ed89 Get short commit ref using a more proper method 7d6147d Remove now unneeded patch due to paperweight 1.1.7 e72fa41 Update task dependency for includeMappings so the new task isn't skipped 0ad5526 Trim whitspace off of git hash (oops) Tuinity Changes: e878ba9 Update paper 2bd2849 Bring back fix codec spam patch
46 lines
2.5 KiB
Diff
46 lines
2.5 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: 12emin34 <macanovic.emin@gmail.com>
|
|
Date: Thu, 29 Apr 2021 23:56:02 +0200
|
|
Subject: [PATCH] Config for changing the blocks that turn into dirt paths
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/item/ShovelItem.java b/src/main/java/net/minecraft/world/item/ShovelItem.java
|
|
index e5562b407bba35ab93bf8bc3c22ac9d45e8353cb..c688bb73cd062f36524cfc231cb691f29f7998c2 100644
|
|
--- a/src/main/java/net/minecraft/world/item/ShovelItem.java
|
|
+++ b/src/main/java/net/minecraft/world/item/ShovelItem.java
|
|
@@ -33,7 +33,7 @@ public class ShovelItem extends DiggerItem {
|
|
return InteractionResult.PASS;
|
|
} else {
|
|
Player player = context.getPlayer();
|
|
- BlockState blockState2 = FLATTENABLES.get(blockState.getBlock());
|
|
+ BlockState blockState2 = level.purpurConfig.shovelTurnsBlockToGrassPath.contains(blockState.getBlock()) ? Blocks.DIRT_PATH.defaultBlockState() : null; // Purpur
|
|
BlockState blockState3 = null;
|
|
if (blockState2 != null && level.getBlockState(blockPos.above()).isAir()) {
|
|
level.playSound(player, blockPos, SoundEvents.SHOVEL_FLATTEN, SoundSource.BLOCKS, 1.0F, 1.0F);
|
|
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
index f374f4feee29c798416eec156af3f90af96199b2..c5dd8489877f6ff62db785bc0811b506d5556350 100644
|
|
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
@@ -380,6 +380,21 @@ public class PurpurWorldConfig {
|
|
snowballProjectileOffset = getDouble("gameplay-mechanics.projectile-offset.snowball", snowballProjectileOffset);
|
|
}
|
|
|
|
+ public List<Block> shovelTurnsBlockToGrassPath = new ArrayList<>();
|
|
+ private void shovelSettings() {
|
|
+ getList("gameplay-mechanics.shovel-turns-block-to-grass-path", new ArrayList<String>(){{
|
|
+ add("minecraft:coarse_dirt");
|
|
+ add("minecraft:dirt");
|
|
+ add("minecraft:grass_block");
|
|
+ add("minecraft:mycelium");
|
|
+ add("minecraft:podzol");
|
|
+ add("minecraft:rooted_dirt");
|
|
+ }}).forEach(key -> {
|
|
+ Block block = Registry.BLOCK.get(new ResourceLocation(key.toString()));
|
|
+ if (block != Blocks.AIR) shovelTurnsBlockToGrassPath.add(block);
|
|
+ });
|
|
+ }
|
|
+
|
|
public boolean silkTouchEnabled = false;
|
|
public String silkTouchSpawnerName = "Spawner";
|
|
public List<String> silkTouchSpawnerLore = new ArrayList<>();
|