Make discovered maps config work in treasure maps from loot tables too

This commit is contained in:
Phoenix616 2021-01-28 20:18:38 +01:00
parent 2fdb229830
commit 6e29351ca9

View File

@ -35,6 +35,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
if (vec3d != null) {
WorldServer worldserver = loottableinfo.getWorld();
- BlockPosition blockposition = worldserver.a(this.e, new BlockPosition(vec3d), this.h, this.i);
+ // Paper start
+ if (!worldserver.paperConfig.enableTreasureMaps) {
+ /*
@ -44,9 +45,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ return itemstack;
+ }
+ // Paper end
BlockPosition blockposition = worldserver.a(this.e, new BlockPosition(vec3d), this.h, this.i);
+ BlockPosition blockposition = worldserver.a(this.e, new BlockPosition(vec3d), this.h, !worldserver.paperConfig.treasureMapsAlreadyDiscovered && this.i); // Paper
if (blockposition != null) {
ItemStack itemstack1 = ItemWorldMap.createFilledMapView(worldserver, blockposition.getX(), blockposition.getZ(), this.g, true, true);
diff --git a/src/main/java/net/minecraft/server/VillagerTrades.java b/src/main/java/net/minecraft/server/VillagerTrades.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/VillagerTrades.java