aboutsummaryrefslogtreecommitdiffhomepage
path: root/Spigot-Server-Patches/0482-Add-villager-reputation-API.patch
diff options
context:
space:
mode:
Diffstat (limited to 'Spigot-Server-Patches/0482-Add-villager-reputation-API.patch')
-rw-r--r--Spigot-Server-Patches/0482-Add-villager-reputation-API.patch15
1 files changed, 8 insertions, 7 deletions
diff --git a/Spigot-Server-Patches/0482-Add-villager-reputation-API.patch b/Spigot-Server-Patches/0482-Add-villager-reputation-API.patch
index 1709aec599..a4b89e4b69 100644
--- a/Spigot-Server-Patches/0482-Add-villager-reputation-API.patch
+++ b/Spigot-Server-Patches/0482-Add-villager-reputation-API.patch
@@ -32,7 +32,7 @@ index 9f28c7e4bd70abc280a8cf3cbf5ccc84246aff12..bf019043a9338aca8d91da809f1d5520
return this.bF;
}
diff --git a/src/main/java/net/minecraft/server/Reputation.java b/src/main/java/net/minecraft/server/Reputation.java
-index 3c6d6be4485cad4f2e9a395425b5837590853eee..28c9f9ed2d532a1eb14b74c2e9723a2cf1b3c6fa 100644
+index 3c6d6be4485cad4f2e9a395425b5837590853eee..09d2fc5769089f6d29971d10de5b8209829baae8 100644
--- a/src/main/java/net/minecraft/server/Reputation.java
+++ b/src/main/java/net/minecraft/server/Reputation.java
@@ -25,7 +25,7 @@ import java.util.stream.Stream;
@@ -58,7 +58,7 @@ index 3c6d6be4485cad4f2e9a395425b5837590853eee..28c9f9ed2d532a1eb14b74c2e9723a2c
this.a = new Object2IntOpenHashMap();
}
-@@ -198,6 +198,27 @@ public class Reputation {
+@@ -198,6 +198,28 @@ public class Reputation {
public void b(ReputationType reputationtype) {
this.a.removeInt(reputationtype);
}
@@ -76,11 +76,12 @@ index 3c6d6be4485cad4f2e9a395425b5837590853eee..28c9f9ed2d532a1eb14b74c2e9723a2c
+ }
+
+ public void assignFromPaperReputation(com.destroystokyo.paper.entity.villager.Reputation rep) {
-+ this.a.put(net.minecraft.server.ReputationType.MAJOR_NEGATIVE, rep.getReputation(com.destroystokyo.paper.entity.villager.ReputationType.MAJOR_NEGATIVE));
-+ this.a.put(net.minecraft.server.ReputationType.MAJOR_POSITIVE, rep.getReputation(com.destroystokyo.paper.entity.villager.ReputationType.MAJOR_POSITIVE));
-+ this.a.put(net.minecraft.server.ReputationType.MINOR_NEGATIVE, rep.getReputation(com.destroystokyo.paper.entity.villager.ReputationType.MINOR_NEGATIVE));
-+ this.a.put(net.minecraft.server.ReputationType.MINOR_POSITIVE, rep.getReputation(com.destroystokyo.paper.entity.villager.ReputationType.MINOR_POSITIVE));
-+ this.a.put(net.minecraft.server.ReputationType.TRADING, rep.getReputation(com.destroystokyo.paper.entity.villager.ReputationType.TRADING));
++ int val;
++ if ((val = rep.getReputation(com.destroystokyo.paper.entity.villager.ReputationType.MAJOR_NEGATIVE)) != 0) this.a.put(ReputationType.MAJOR_NEGATIVE, val);
++ if ((val = rep.getReputation(com.destroystokyo.paper.entity.villager.ReputationType.MAJOR_POSITIVE)) != 0) this.a.put(ReputationType.MAJOR_POSITIVE, val);
++ if ((val = rep.getReputation(com.destroystokyo.paper.entity.villager.ReputationType.MINOR_NEGATIVE)) != 0) this.a.put(ReputationType.MINOR_NEGATIVE, val);
++ if ((val = rep.getReputation(com.destroystokyo.paper.entity.villager.ReputationType.MINOR_POSITIVE)) != 0) this.a.put(ReputationType.MINOR_POSITIVE, val);
++ if ((val = rep.getReputation(com.destroystokyo.paper.entity.villager.ReputationType.TRADING)) != 0) this.a.put(ReputationType.TRADING, val);
+ }
+ // Paper end
}