Expose attribute sentiment (#12974)
Co-authored-by: Lulu13022002 <41980282+Lulu13022002@users.noreply.github.com>
This commit is contained in:
@@ -254,6 +254,7 @@ public net.minecraft.world.entity.Mob lootTable
|
|||||||
public net.minecraft.world.entity.Mob lootTableSeed
|
public net.minecraft.world.entity.Mob lootTableSeed
|
||||||
public net.minecraft.world.entity.OminousItemSpawner setItem(Lnet/minecraft/world/item/ItemStack;)V
|
public net.minecraft.world.entity.OminousItemSpawner setItem(Lnet/minecraft/world/item/ItemStack;)V
|
||||||
public net.minecraft.world.entity.OminousItemSpawner spawnItemAfterTicks
|
public net.minecraft.world.entity.OminousItemSpawner spawnItemAfterTicks
|
||||||
|
public net.minecraft.world.entity.ai.attributes.Attribute sentiment
|
||||||
public net.minecraft.world.entity.ai.attributes.AttributeSupplier getAttributeInstance(Lnet/minecraft/core/Holder;)Lnet/minecraft/world/entity/ai/attributes/AttributeInstance;
|
public net.minecraft.world.entity.ai.attributes.AttributeSupplier getAttributeInstance(Lnet/minecraft/core/Holder;)Lnet/minecraft/world/entity/ai/attributes/AttributeInstance;
|
||||||
public net.minecraft.world.entity.ai.control.MoveControl$Operation
|
public net.minecraft.world.entity.ai.control.MoveControl$Operation
|
||||||
public net.minecraft.world.entity.ai.gossip.GossipContainer gossips
|
public net.minecraft.world.entity.ai.gossip.GossipContainer gossips
|
||||||
|
|||||||
@@ -163,6 +163,12 @@ public interface Attribute extends OldEnum<Attribute>, Keyed, Translatable, net.
|
|||||||
return Registry.ATTRIBUTE.getOrThrow(NamespacedKey.minecraft(key));
|
return Registry.ATTRIBUTE.getOrThrow(NamespacedKey.minecraft(key));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@return the sentiment of this attribute}
|
||||||
|
*/
|
||||||
|
@NotNull
|
||||||
|
Sentiment getSentiment();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param name of the attribute.
|
* @param name of the attribute.
|
||||||
* @return the attribute with the given name.
|
* @return the attribute with the given name.
|
||||||
@@ -185,4 +191,17 @@ public interface Attribute extends OldEnum<Attribute>, Keyed, Translatable, net.
|
|||||||
static Attribute[] values() {
|
static Attribute[] values() {
|
||||||
return Lists.newArrayList(Registry.ATTRIBUTE).toArray(new Attribute[0]);
|
return Lists.newArrayList(Registry.ATTRIBUTE).toArray(new Attribute[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An attribute sentiment describes the intent behind the attribute, meaning
|
||||||
|
* whether it is supposed to be a positive, neutral, or negative attribute.
|
||||||
|
*/
|
||||||
|
enum Sentiment {
|
||||||
|
// Start generate - AttributeSentiment
|
||||||
|
// @GeneratedFrom 1.21.8
|
||||||
|
POSITIVE,
|
||||||
|
NEUTRAL,
|
||||||
|
NEGATIVE;
|
||||||
|
// End generate - AttributeSentiment
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ import org.bukkit.Sound;
|
|||||||
import org.bukkit.SoundCategory;
|
import org.bukkit.SoundCategory;
|
||||||
import org.bukkit.Statistic;
|
import org.bukkit.Statistic;
|
||||||
import org.bukkit.Tag;
|
import org.bukkit.Tag;
|
||||||
|
import org.bukkit.attribute.Attribute;
|
||||||
import org.bukkit.block.Biome;
|
import org.bukkit.block.Biome;
|
||||||
import org.bukkit.block.BlockType;
|
import org.bukkit.block.BlockType;
|
||||||
import org.bukkit.block.banner.PatternType;
|
import org.bukkit.block.banner.PatternType;
|
||||||
@@ -129,6 +130,7 @@ public final class Rewriters {
|
|||||||
.register("SalmonVariant", Salmon.Variant.class, new EnumCloneRewriter<>(net.minecraft.world.entity.animal.Salmon.Variant.class))
|
.register("SalmonVariant", Salmon.Variant.class, new EnumCloneRewriter<>(net.minecraft.world.entity.animal.Salmon.Variant.class))
|
||||||
.register("ArmadilloState", Armadillo.State.class, new EnumCloneRewriter<>(net.minecraft.world.entity.animal.armadillo.Armadillo.ArmadilloState.class))
|
.register("ArmadilloState", Armadillo.State.class, new EnumCloneRewriter<>(net.minecraft.world.entity.animal.armadillo.Armadillo.ArmadilloState.class))
|
||||||
.register("SoundCategory", SoundCategory.class, new EnumCloneRewriter<>(SoundSource.class))
|
.register("SoundCategory", SoundCategory.class, new EnumCloneRewriter<>(SoundSource.class))
|
||||||
|
.register("AttributeSentiment", Attribute.Sentiment.class, new EnumCloneRewriter<>(net.minecraft.world.entity.ai.attributes.Attribute.Sentiment.class))
|
||||||
.register("ItemUseAnimation", ItemUseAnimation.class, new EnumCloneRewriter<>(net.minecraft.world.item.ItemUseAnimation.class))
|
.register("ItemUseAnimation", ItemUseAnimation.class, new EnumCloneRewriter<>(net.minecraft.world.item.ItemUseAnimation.class))
|
||||||
.register("ItemRarity", ItemRarity.class, new EnumCloneRewriter<>(Rarity.class) {
|
.register("ItemRarity", ItemRarity.class, new EnumCloneRewriter<>(Rarity.class) {
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -5,9 +5,9 @@
|
|||||||
ResourceKey<Recipe<?>> resourceKey = recipeHolder.id();
|
ResourceKey<Recipe<?>> resourceKey = recipeHolder.id();
|
||||||
if (!this.known.contains(resourceKey) && !recipeHolder.value().isSpecial()) {
|
if (!this.known.contains(resourceKey) && !recipeHolder.value().isSpecial()) {
|
||||||
+ // Paper start - PlayerRecipeDiscoverEvent event
|
+ // Paper start - PlayerRecipeDiscoverEvent event
|
||||||
+ org.bukkit.event.player.PlayerRecipeDiscoverEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerRecipeListUpdateEvent(player, recipeHolder);
|
+ final org.bukkit.event.player.PlayerRecipeDiscoverEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerRecipeListUpdateEvent(player, recipeHolder);
|
||||||
+ if (event.isCancelled()) continue;
|
+ if (event.isCancelled()) continue;
|
||||||
+ // Paper end
|
+ // Paper end - PlayerRecipeDiscoverEvent event
|
||||||
this.add(resourceKey);
|
this.add(resourceKey);
|
||||||
this.addHighlight(resourceKey);
|
this.addHighlight(resourceKey);
|
||||||
this.displayResolver
|
this.displayResolver
|
||||||
|
|||||||
@@ -56,6 +56,11 @@ public class CraftAttribute extends OldEnumHolderable<Attribute, net.minecraft.w
|
|||||||
super(holder, count++);
|
super(holder, count++);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Sentiment getSentiment() {
|
||||||
|
return Sentiment.valueOf(this.getHandle().sentiment.name());
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getTranslationKey() {
|
public String getTranslationKey() {
|
||||||
return this.getHandle().getDescriptionId();
|
return this.getHandle().getDescriptionId();
|
||||||
|
|||||||
Reference in New Issue
Block a user