Class GossipContainer
java.lang.Object
net.minecraft.world.entity.ai.gossip.GossipContainer
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static classprivate 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 target, GossipType type, int amountToAdd) voidclear()copy()voiddecay()longgetCountForType(GossipType type, DoublePredicate valueTest) Map<UUID, it.unimi.dsi.fastutil.objects.Object2IntMap<GossipType>> private GossipContainer.EntityGossipsgetOrCreate(UUID target) intgetReputation(UUID entity, Predicate<GossipType> types) private intmergeValuesForAddition(GossipType type, int oldValue, int newValue) private static intmergeValuesForTransfer(int oldValue, int newValue) Returns the greater of two int valuesvoidputAll(GossipContainer container) voidremove(UUID target, GossipType type) voidremove(UUID target, GossipType type, int amountToRemove) voidremove(GossipType type) private Collection<GossipContainer.GossipEntry> selectGossipsForTransfer(RandomSource random, int maxCount) voidtransferFrom(GossipContainer source, RandomSource random, int maxCount) 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 maxCount) -
getOrCreate
-
transferFrom
-
getReputation
-
getCountForType
-
add
-
remove
-
remove
-
remove
-
clear
public void clear() -
putAll
-
mergeValuesForTransfer
private static int mergeValuesForTransfer(int oldValue, int newValue) Returns the greater of two int values -
mergeValuesForAddition
-
copy
-