mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-19 17:37:42 +01:00
Updated Upstream (Paper)
Upstream has released updates that appear to apply and compile correctly Paper Changes: PaperMC/Paper@2a306f5 Add Multi Block Change API (#7333) PaperMC/Paper@feb72b8 Update ASM EventExecutor generator patch to respect event handler return types. Fixes #7311 (#7317)
This commit is contained in:
@@ -109,7 +109,7 @@ index a5c2d6f0c0850a99224a1a8d622fe6b341cee88b..d8777ab86465e25236e7abbafd7ff668
|
||||
return InteractionResult.PASS;
|
||||
}
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
index c3a24784e980d38ef5899985e72cd206ab5e8939..3b9114e3c0789eeb6edcd49400c7ece14dc9d7a9 100644
|
||||
index e3a4041155d2998ee840fc09ca95f117a4e160b3..022490032f8df8d4ddd920b12a7a002fd86fa219 100644
|
||||
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
@@ -510,6 +510,153 @@ public class PurpurWorldConfig {
|
||||
@@ -243,20 +243,20 @@ index c3a24784e980d38ef5899985e72cd206ab5e8939..3b9114e3c0789eeb6edcd49400c7ece1
|
||||
+ Map.entry("minecraft:rooted_dirt", Map.of("condition", "always", "into", "minecraft:dirt", "drops", Map.of("minecraft:hanging_roots", 1.0D))))
|
||||
+ ).forEach((blockId, obj) -> {
|
||||
+ Block block = Registry.BLOCK.get(new ResourceLocation(blockId));
|
||||
+ if (block == Blocks.AIR) { PurpurConfig.log(Level.SEVERE, "Invalid block for `tools.hoe.tilling`: " + blockId); return; }
|
||||
+ if (!(obj instanceof Map<?, ?> map)) { PurpurConfig.log(Level.SEVERE, "Invalid yaml for `tools.hoe.tilling." + blockId + "`"); return; }
|
||||
+ if (block == Blocks.AIR) { PurpurConfig.log(Level.SEVERE, "Invalid block for `tools.hoe.tillables`: " + blockId); return; }
|
||||
+ if (!(obj instanceof Map<?, ?> map)) { PurpurConfig.log(Level.SEVERE, "Invalid yaml for `tools.hoe.tillables." + blockId + "`"); return; }
|
||||
+ String conditionId = (String) map.get("condition");
|
||||
+ Tillable.Condition condition = Tillable.Condition.get(conditionId);
|
||||
+ if (condition == null) { PurpurConfig.log(Level.SEVERE, "Invalid condition for `tools.hoe.tilling." + blockId + ".condition`: " + conditionId); return; }
|
||||
+ if (condition == null) { PurpurConfig.log(Level.SEVERE, "Invalid condition for `tools.hoe.tillables." + blockId + ".condition`: " + conditionId); return; }
|
||||
+ String intoId = (String) map.get("into");
|
||||
+ Block into = Registry.BLOCK.get(new ResourceLocation(intoId));
|
||||
+ if (into == Blocks.AIR) { PurpurConfig.log(Level.SEVERE, "Invalid block for `tools.hoe.tilling." + blockId + ".into`: " + intoId); return; }
|
||||
+ if (into == Blocks.AIR) { PurpurConfig.log(Level.SEVERE, "Invalid block for `tools.hoe.tillables." + blockId + ".into`: " + intoId); return; }
|
||||
+ Object dropsObj = map.get("drops");
|
||||
+ if (!(dropsObj instanceof Map<?, ?> dropsMap)) { PurpurConfig.log(Level.SEVERE, "Invalid yaml for `tools.hoe.tilling." + blockId + ".drops`"); return; }
|
||||
+ if (!(dropsObj instanceof Map<?, ?> dropsMap)) { PurpurConfig.log(Level.SEVERE, "Invalid yaml for `tools.hoe.tillables." + blockId + ".drops`"); return; }
|
||||
+ Map<Item, Double> drops = new HashMap<>();
|
||||
+ dropsMap.forEach((itemId, chance) -> {
|
||||
+ Item item = Registry.ITEM.get(new ResourceLocation(itemId.toString()));
|
||||
+ if (item == Items.AIR) { PurpurConfig.log(Level.SEVERE, "Invalid item for `tools.hoe.tilling." + blockId + ".drops`: " + itemId); return; }
|
||||
+ if (item == Items.AIR) { PurpurConfig.log(Level.SEVERE, "Invalid item for `tools.hoe.tillables." + blockId + ".drops`: " + itemId); return; }
|
||||
+ drops.put(item, (double) chance);
|
||||
+ });
|
||||
+ hoeTillables.put(block, new Tillable(condition, into, drops));
|
||||
|
||||
Reference in New Issue
Block a user