Class GossipContainer
java.lang.Object
net.minecraft.world.entity.ai.gossip.GossipContainer
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static class(package private) static final record -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<GossipContainer> static final intprivate final Map<UUID, GossipContainer.EntityGossips> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(UUID identifier, GossipType gossipType, int gossipValue) voidclear()copy()voiddecay()longgetCountForType(GossipType gossipType, DoublePredicate gossipPredicate) Map<UUID, it.unimi.dsi.fastutil.objects.Object2IntMap<GossipType>> private GossipContainer.EntityGossipsgetOrCreate(UUID identifier) intgetReputation(UUID identifier, Predicate<GossipType> gossip) private intmergeValuesForAddition(GossipType gossipType, int existing, int additive) private static intmergeValuesForTransfer(int value1, int value2) Returns the greater of two int valuesvoidputAll(GossipContainer other) voidremove(UUID identifier, GossipType gossipType) voidremove(UUID identifier, GossipType gossipType, int gossipValue) voidremove(GossipType gossipType) private Collection<GossipContainer.GossipEntry> selectGossipsForTransfer(RandomSource random, int amount) voidtransferFrom(GossipContainer container, RandomSource randomSource, int amount) private Stream<GossipContainer.GossipEntry> unpack()
-
Field Details
-
CODEC
-
DISCARD_THRESHOLD
public static final int DISCARD_THRESHOLD- See Also:
-
gossips
-
-
Constructor Details
-
GossipContainer
public GossipContainer() -
GossipContainer
-
-
Method Details
-
getGossipEntries
-
decay
public void decay() -
unpack
-
selectGossipsForTransfer
private Collection<GossipContainer.GossipEntry> selectGossipsForTransfer(RandomSource random, int amount) -
getOrCreate
-
transferFrom
-
getReputation
-
getCountForType
-
add
-
remove
-
remove
-
remove
-
clear
public void clear() -
putAll
-
mergeValuesForTransfer
private static int mergeValuesForTransfer(int value1, int value2) Returns the greater of two int values -
mergeValuesForAddition
-
copy
-