From 226fc2c07c16d7c3df831da5fd4678392892115b Mon Sep 17 00:00:00 2001 From: Newwind Date: Thu, 22 Aug 2024 23:00:52 +0100 Subject: [PATCH 1/2] Create 1052-Fix-setDamage-being-ran-on-compasses.patch --- ...Fix-setDamage-being-ran-on-compasses.patch | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 patches/server/1052-Fix-setDamage-being-ran-on-compasses.patch diff --git a/patches/server/1052-Fix-setDamage-being-ran-on-compasses.patch b/patches/server/1052-Fix-setDamage-being-ran-on-compasses.patch new file mode 100644 index 000000000000..375aafa1dfc5 --- /dev/null +++ b/patches/server/1052-Fix-setDamage-being-ran-on-compasses.patch @@ -0,0 +1,21 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Newwind +Date: Thu, 22 Aug 2024 22:55:37 +0200 +Subject: [PATCH] Fix setDamage being ran on compasses + +In VanillaChestLoot, compasses accidentally have a setdamage loot function on them, but compasses don't take durability, resulting in a warning +"Couldn't set damage of loot item 1 minecraft:compass" +This patch simply removes attempting to add damage to compass + +diff --git a/src/main/java/net/minecraft/data/loot/packs/VanillaChestLoot.java b/src/main/java/net/minecraft/data/loot/packs/VanillaChestLoot.java +index 096899338..cff6b2656 100644 +--- a/src/main/java/net/minecraft/data/loot/packs/VanillaChestLoot.java ++++ b/src/main/java/net/minecraft/data/loot/packs/VanillaChestLoot.java +@@ -946,7 +946,6 @@ public record VanillaChestLoot(HolderLookup.Provider registries) implements Loot + .add( + LootItem.lootTableItem(Items.COMPASS) + .apply(SetItemCountFunction.setCount(ConstantValue.exactly(1.0F))) +- .apply(SetItemDamageFunction.setDamage(UniformGenerator.between(0.15F, 0.8F))) + .setWeight(1) + ) + .add(LootItem.lootTableItem(Items.BUCKET).apply(SetItemCountFunction.setCount(UniformGenerator.between(1.0F, 2.0F))).setWeight(1)) From 8094174fd3dd4b61f8bdbd6ca4eb1afafd0d1460 Mon Sep 17 00:00:00 2001 From: Bjarne Koll Date: Sun, 25 Aug 2024 19:46:24 +0200 Subject: [PATCH 2/2] Rename patch --- ...Fix-setDamage-being-ran-on-compasses.patch | 21 ---------- ...e-lootable-item-function-from-compas.patch | 41 +++++++++++++++++++ 2 files changed, 41 insertions(+), 21 deletions(-) delete mode 100644 patches/server/1052-Fix-setDamage-being-ran-on-compasses.patch create mode 100644 patches/server/1052-Remove-set-damage-lootable-item-function-from-compas.patch diff --git a/patches/server/1052-Fix-setDamage-being-ran-on-compasses.patch b/patches/server/1052-Fix-setDamage-being-ran-on-compasses.patch deleted file mode 100644 index 375aafa1dfc5..000000000000 --- a/patches/server/1052-Fix-setDamage-being-ran-on-compasses.patch +++ /dev/null @@ -1,21 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Newwind -Date: Thu, 22 Aug 2024 22:55:37 +0200 -Subject: [PATCH] Fix setDamage being ran on compasses - -In VanillaChestLoot, compasses accidentally have a setdamage loot function on them, but compasses don't take durability, resulting in a warning -"Couldn't set damage of loot item 1 minecraft:compass" -This patch simply removes attempting to add damage to compass - -diff --git a/src/main/java/net/minecraft/data/loot/packs/VanillaChestLoot.java b/src/main/java/net/minecraft/data/loot/packs/VanillaChestLoot.java -index 096899338..cff6b2656 100644 ---- a/src/main/java/net/minecraft/data/loot/packs/VanillaChestLoot.java -+++ b/src/main/java/net/minecraft/data/loot/packs/VanillaChestLoot.java -@@ -946,7 +946,6 @@ public record VanillaChestLoot(HolderLookup.Provider registries) implements Loot - .add( - LootItem.lootTableItem(Items.COMPASS) - .apply(SetItemCountFunction.setCount(ConstantValue.exactly(1.0F))) -- .apply(SetItemDamageFunction.setDamage(UniformGenerator.between(0.15F, 0.8F))) - .setWeight(1) - ) - .add(LootItem.lootTableItem(Items.BUCKET).apply(SetItemCountFunction.setCount(UniformGenerator.between(1.0F, 2.0F))).setWeight(1)) diff --git a/patches/server/1052-Remove-set-damage-lootable-item-function-from-compas.patch b/patches/server/1052-Remove-set-damage-lootable-item-function-from-compas.patch new file mode 100644 index 000000000000..ac0c0e3513a5 --- /dev/null +++ b/patches/server/1052-Remove-set-damage-lootable-item-function-from-compas.patch @@ -0,0 +1,41 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Newwind +Date: Thu, 22 Aug 2024 22:55:37 +0200 +Subject: [PATCH] Remove set damage lootable item function from compasses + +In VanillaChestLoot, compasses accidentally have a setdamage loot +function on them, but compasses don't take durability, resulting in a warning. +This patch simply removes attempting to add damage to the compass item. + +diff --git a/src/main/java/net/minecraft/data/loot/packs/VanillaChestLoot.java b/src/main/java/net/minecraft/data/loot/packs/VanillaChestLoot.java +index 096899338640bb8a7052db06bf55e9fe33bf1cbe..cff6b265622701266349b6cf68eb874aa6fb6321 100644 +--- a/src/main/java/net/minecraft/data/loot/packs/VanillaChestLoot.java ++++ b/src/main/java/net/minecraft/data/loot/packs/VanillaChestLoot.java +@@ -946,7 +946,6 @@ public record VanillaChestLoot(HolderLookup.Provider registries) implements Loot + .add( + LootItem.lootTableItem(Items.COMPASS) + .apply(SetItemCountFunction.setCount(ConstantValue.exactly(1.0F))) +- .apply(SetItemDamageFunction.setDamage(UniformGenerator.between(0.15F, 0.8F))) + .setWeight(1) + ) + .add(LootItem.lootTableItem(Items.BUCKET).apply(SetItemCountFunction.setCount(UniformGenerator.between(1.0F, 2.0F))).setWeight(1)) +diff --git a/src/main/resources/data/minecraft/loot_table/chests/trial_chambers/intersection_barrel.json b/src/main/resources/data/minecraft/loot_table/chests/trial_chambers/intersection_barrel.json +index b5f5415a9f8bbb9d59926dc6c09e4a12dce2e9b9..fea6273ab4fe2383101f351a13d127e615b81d71 100644 +--- a/src/main/resources/data/minecraft/loot_table/chests/trial_chambers/intersection_barrel.json ++++ b/src/main/resources/data/minecraft/loot_table/chests/trial_chambers/intersection_barrel.json +@@ -70,15 +70,6 @@ + "add": false, + "count": 1.0, + "function": "minecraft:set_count" +- }, +- { +- "add": false, +- "damage": { +- "type": "minecraft:uniform", +- "max": 0.8, +- "min": 0.15 +- }, +- "function": "minecraft:set_damage" + } + ], + "name": "minecraft:compass"