--- a/net/minecraft/world/entity/ai/gossip/GossipContainer.java
+++ b/net/minecraft/world/entity/ai/gossip/GossipContainer.java
@@ -59,8 +59,22 @@
         return this.gossips.entrySet().stream().flatMap(entry -> entry.getValue().unpack(entry.getKey()));
     }
 
+    // Paper start - Perf: Remove streams from hot code
+    private List<GossipContainer.GossipEntry> decompress() {
+        List<GossipContainer.GossipEntry> list = new it.unimi.dsi.fastutil.objects.ObjectArrayList<>();
+        for (Map.Entry<UUID, GossipContainer.EntityGossips> entry : this.gossips.entrySet()) {
+            for (GossipContainer.GossipEntry cur : entry.getValue().decompress(entry.getKey())) {
+                if (cur.weightedValue() != 0) {
+                    list.add(cur);
+                }
+            }
+        }
+        return list;
+    }
+    // Paper end - Perf: Remove streams from hot code
+
     private Collection<GossipContainer.GossipEntry> selectGossipsForTransfer(RandomSource random, int count) {
-        List<GossipContainer.GossipEntry> list = this.unpack().toList();
+        List<GossipContainer.GossipEntry> list = this.decompress(); // Paper - Perf: Remove streams from hot code
         if (list.isEmpty()) {
             return Collections.emptyList();
         } else {
@@ -145,7 +159,7 @@
 
     public <T> T store(DynamicOps<T> ops) {
         return GossipContainer.GossipEntry.LIST_CODEC
-            .encodeStart(ops, this.unpack().toList())
+            .encodeStart(ops, this.decompress()) // Paper - Perf: Remove streams from hot code
             .resultOrPartial(error -> LOGGER.warn("Failed to serialize gossips: {}", error))
             .orElseGet(ops::emptyList);
     }
@@ -172,12 +186,23 @@
         final Object2IntMap<GossipType> entries = new Object2IntOpenHashMap<>();
 
         public int weightedValue(Predicate<GossipType> gossipTypeFilter) {
-            return this.entries
-                .object2IntEntrySet()
-                .stream()
-                .filter(entry -> gossipTypeFilter.test(entry.getKey()))
-                .mapToInt(entry -> entry.getIntValue() * entry.getKey().weight)
-                .sum();
+            // Paper start - Perf: Remove streams from hot code
+            int weight = 0;
+            for (Object2IntMap.Entry<GossipType> entry : entries.object2IntEntrySet()) {
+                if (gossipTypeFilter.test(entry.getKey())) {
+                    weight += entry.getIntValue() * entry.getKey().weight;
+                }
+            }
+            return weight;
+        }
+
+        public List<GossipContainer.GossipEntry> decompress(UUID uuid) {
+            List<GossipContainer.GossipEntry> list = new it.unimi.dsi.fastutil.objects.ObjectArrayList<>();
+            for (Object2IntMap.Entry<GossipType> entry : entries.object2IntEntrySet()) {
+                list.add(new GossipContainer.GossipEntry(uuid, entry.getKey(), entry.getIntValue()));
+            }
+            return list;
+            // Paper end - Perf: Remove streams from hot code
         }
 
         public Stream<GossipContainer.GossipEntry> unpack(UUID target) {
@@ -216,6 +241,43 @@
         public void remove(GossipType gossipType) {
             this.entries.removeInt(gossipType);
         }
+
+        // Paper start - Add villager reputation API
+        private static final GossipType[] TYPES = GossipType.values();
+        public com.destroystokyo.paper.entity.villager.Reputation getPaperReputation() {
+            Map<com.destroystokyo.paper.entity.villager.ReputationType, Integer> map = new java.util.EnumMap<>(com.destroystokyo.paper.entity.villager.ReputationType.class);
+            for (Object2IntMap.Entry<GossipType> type : this.entries.object2IntEntrySet()) {
+                map.put(toApi(type.getKey()), type.getIntValue());
+            }
+
+            return new com.destroystokyo.paper.entity.villager.Reputation(map);
+        }
+
+        public void assignFromPaperReputation(com.destroystokyo.paper.entity.villager.Reputation rep) {
+            for (GossipType type : TYPES) {
+                com.destroystokyo.paper.entity.villager.ReputationType api = toApi(type);
+
+                if (rep.hasReputationSet(api)) {
+                    int reputation = rep.getReputation(api);
+                    if (reputation == 0) {
+                        this.entries.removeInt(type);
+                    } else {
+                        this.entries.put(type, reputation);
+                    }
+                }
+            }
+        }
+
+        private static com.destroystokyo.paper.entity.villager.ReputationType toApi(GossipType type) {
+            return switch (type) {
+                case MAJOR_NEGATIVE -> com.destroystokyo.paper.entity.villager.ReputationType.MAJOR_NEGATIVE;
+                case MINOR_NEGATIVE -> com.destroystokyo.paper.entity.villager.ReputationType.MINOR_NEGATIVE;
+                case MINOR_POSITIVE -> com.destroystokyo.paper.entity.villager.ReputationType.MINOR_POSITIVE;
+                case MAJOR_POSITIVE -> com.destroystokyo.paper.entity.villager.ReputationType.MAJOR_POSITIVE;
+                case TRADING -> com.destroystokyo.paper.entity.villager.ReputationType.TRADING;
+            };
+        }
+        // Paper end - Add villager reputation API
     }
 
     static record GossipEntry(UUID target, GossipType type, int value) {
