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 int
private final Map
<UUID, GossipContainer.EntityGossips> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
GossipContainer
(List<GossipContainer.GossipEntry> pEntries) -
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(UUID pIdentifier, GossipType pGossipType, int pGossipValue) void
clear()
copy()
void
decay()
long
getCountForType
(GossipType pGossipType, DoublePredicate pGossipPredicate) Map
<UUID, it.unimi.dsi.fastutil.objects.Object2IntMap<GossipType>> private GossipContainer.EntityGossips
getOrCreate
(UUID pIdentifier) int
getReputation
(UUID pIdentifier, Predicate<GossipType> pGossip) private int
mergeValuesForAddition
(GossipType pGossipType, int pExisting, int pAdditive) private static int
mergeValuesForTransfer
(int pValue1, int pValue2) Returns the greater of two int valuesvoid
putAll
(GossipContainer pOther) void
remove
(UUID pIdentifier, GossipType pGossipType) void
remove
(UUID pIdentifier, GossipType pGossipType, int pGossipValue) void
remove
(GossipType pGossipType) private Collection
<GossipContainer.GossipEntry> selectGossipsForTransfer
(RandomSource pRandom, int pAmount) void
transferFrom
(GossipContainer pContainer, RandomSource pRandomSource, int pAmount) 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 pRandom, int pAmount) -
getOrCreate
-
transferFrom
-
getReputation
-
getCountForType
-
add
-
remove
-
remove
-
remove
-
clear
public void clear() -
putAll
-
mergeValuesForTransfer
private static int mergeValuesForTransfer(int pValue1, int pValue2) Returns the greater of two int values -
mergeValuesForAddition
-
copy
-