diff --git a/paper-server/patches/sources/net/minecraft/world/entity/npc/VillagerTrades.java.patch b/paper-server/patches/sources/net/minecraft/world/entity/npc/VillagerTrades.java.patch new file mode 100644 index 0000000000..a21a5e780e --- /dev/null +++ b/paper-server/patches/sources/net/minecraft/world/entity/npc/VillagerTrades.java.patch @@ -0,0 +1,12 @@ +--- a/net/minecraft/world/entity/npc/VillagerTrades.java ++++ b/net/minecraft/world/entity/npc/VillagerTrades.java +@@ -1834,7 +1834,8 @@ + return null; + } else { + ServerLevel serverLevel = (ServerLevel)entity.level(); +- BlockPos blockPos = serverLevel.findNearestMapStructure(this.destination, entity.blockPosition(), 100, true); ++ if (!serverLevel.paperConfig().environment.treasureMaps.enabled) return null; // Paper - Configurable cartographer treasure maps ++ BlockPos blockPos = serverLevel.findNearestMapStructure(this.destination, entity.blockPosition(), 100, !serverLevel.paperConfig().environment.treasureMaps.findAlreadyDiscoveredVillager); // Paper - Configurable cartographer treasure maps + if (blockPos != null) { + ItemStack itemStack = MapItem.create(serverLevel, blockPos.getX(), blockPos.getZ(), (byte)2, true, true); + MapItem.renderBiomePreviewMap(serverLevel, itemStack); diff --git a/paper-server/patches/sources/net/minecraft/world/level/storage/loot/functions/ExplorationMapFunction.java.patch b/paper-server/patches/sources/net/minecraft/world/level/storage/loot/functions/ExplorationMapFunction.java.patch new file mode 100644 index 0000000000..130a1b59c6 --- /dev/null +++ b/paper-server/patches/sources/net/minecraft/world/level/storage/loot/functions/ExplorationMapFunction.java.patch @@ -0,0 +1,21 @@ +--- a/net/minecraft/world/level/storage/loot/functions/ExplorationMapFunction.java ++++ b/net/minecraft/world/level/storage/loot/functions/ExplorationMapFunction.java +@@ -83,8 +83,17 @@ + Vec3 vec3 = context.getOptionalParameter(LootContextParams.ORIGIN); + if (vec3 != null) { + ServerLevel serverLevel = context.getLevel(); ++ // Paper start - Configurable cartographer treasure maps ++ if (!serverLevel.paperConfig().environment.treasureMaps.enabled) { ++ /* ++ * NOTE: I fear users will just get a plain map as their "treasure" ++ * This is preferable to disrespecting the config. ++ */ ++ return stack; ++ } ++ // Paper end - Configurable cartographer treasure maps + BlockPos blockPos = serverLevel.findNearestMapStructure( +- this.destination, BlockPos.containing(vec3), this.searchRadius, this.skipKnownStructures ++ this.destination, BlockPos.containing(vec3), this.searchRadius, !serverLevel.paperConfig().environment.treasureMaps.findAlreadyDiscoveredLootTable.or(!this.skipKnownStructures) // Paper - Configurable cartographer treasure maps + ); + if (blockPos != null) { + ItemStack itemStack = MapItem.create(serverLevel, blockPos.getX(), blockPos.getZ(), this.zoom, true, true);