death to more obfhelpers

This commit is contained in:
MiniDigger | Martin
2021-06-17 22:20:03 +02:00
parent 62fabeca0c
commit 4ac379cbd0
13 changed files with 28 additions and 132 deletions

View File

@@ -61,18 +61,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
}
static class GossipEntry {
diff --git a/src/main/java/net/minecraft/world/entity/npc/Villager.java b/src/main/java/net/minecraft/world/entity/npc/Villager.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/world/entity/npc/Villager.java
+++ b/src/main/java/net/minecraft/world/entity/npc/Villager.java
@@ -0,0 +0,0 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
this.numberOfRestocksToday = 0;
}
+ @Deprecated public GossipContainer getReputation() { return this.getGossips(); } // Paper - OBFHELPER
public GossipContainer getGossips() {
return this.gossips;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java
@@ -99,7 +87,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ // Paper start - Add villager reputation API
+ @Override
+ public Reputation getReputation(UUID uniqueId) {
+ net.minecraft.world.entity.ai.gossip.GossipContainer.EntityGossips rep = getHandle().getReputation().getReputations().get(uniqueId);
+ net.minecraft.world.entity.ai.gossip.GossipContainer.EntityGossips rep = getHandle().getGossips().getReputations().get(uniqueId);
+ if (rep == null) {
+ return new Reputation(Maps.newHashMap());
+ }
@@ -109,7 +97,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+
+ @Override
+ public Map<UUID, Reputation> getReputations() {
+ return getHandle().getReputation().getReputations().entrySet()
+ return getHandle().getGossips().getReputations().entrySet()
+ .stream()
+ .collect(java.util.stream.Collectors.toMap(Map.Entry::getKey, entry -> entry.getValue().getPaperReputation()));
+ }
@@ -117,7 +105,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ @Override
+ public void setReputation(UUID uniqueId, Reputation reputation) {
+ net.minecraft.world.entity.ai.gossip.GossipContainer.EntityGossips nmsReputation =
+ getHandle().getReputation().getReputations().computeIfAbsent(
+ getHandle().getGossips().getReputations().computeIfAbsent(
+ uniqueId,
+ key -> new net.minecraft.world.entity.ai.gossip.GossipContainer.EntityGossips()
+ );
@@ -133,7 +121,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+
+ @Override
+ public void clearReputations() {
+ getHandle().getReputation().getReputations().clear();
+ getHandle().getGossips().getReputations().clear();
+ }
+ // Paper end
}