1
1
package kr .toxicity .libraries .datacomponent .api ;
2
2
3
3
import com .google .gson .JsonElement ;
4
+ import net .kyori .adventure .text .Component ;
4
5
import org .jetbrains .annotations .NotNull ;
5
6
import org .jetbrains .annotations .Nullable ;
7
+ import kr .toxicity .libraries .datacomponent .api .wrapper .*;
6
8
9
+ import java .util .List ;
10
+ import java .util .function .Supplier ;
11
+
12
+ import static kr .toxicity .libraries .datacomponent .api .NMS .nms ;
13
+
14
+ @ SuppressWarnings ("unused" )
7
15
public interface DataComponentType <T > {
16
+
17
+ Supplier <DataComponentType <Integer >> MAX_STACK_SIZE = () -> nms ().maxStackSize ();
18
+ Supplier <DataComponentType <Integer >> MAX_DAMAGE = () -> nms ().maxDamage ();
19
+ Supplier <DataComponentType <Integer >> DAMAGE = () -> nms ().damage ();
20
+ Supplier <DataComponentType <Component >> CUSTOM_NAME = () -> nms ().customName ();
21
+ Supplier <DataComponentType <Component >> ITEM_NAME = () -> nms ().itemName ();
22
+ Supplier <DataComponentType <ItemLore >> LORE = () -> nms ().lore ();
23
+ Supplier <DataComponentType <Rarity >> RARITY = () -> nms ().rarity ();
24
+ Supplier <DataComponentType <AdventureModePredicate >> CAN_PLACE_ON = () -> nms ().canPlaceOn ();
25
+ Supplier <DataComponentType <AdventureModePredicate >> CAN_BREAK = () -> nms ().canBreak ();
26
+ Supplier <DataComponentType <CustomModelData >> CUSTOM_MODEL_DATA = () -> nms ().customModelData ();
27
+ Supplier <DataComponentType <Integer >> REPAIR_COST = () -> nms ().repairCost ();
28
+ Supplier <DataComponentType <Unit >> CREATIVE_SLOT_LOCK = () -> nms ().creativeSlotLock ();
29
+ Supplier <DataComponentType <Boolean >> ENCHANTMENT_GLINT_OVERRIDE = () -> nms ().enchantmentGlintOverride ();
30
+ Supplier <DataComponentType <Unit >> INTANGIBLE_PROJECTILE = () -> nms ().intangibleProjectile ();
31
+ Supplier <DataComponentType <FoodProperties >> FOOD = () -> nms ().food ();
32
+ Supplier <DataComponentType <Unit >> FIRE_RESISTANT = () -> nms ().fireResistant ();
33
+ Supplier <DataComponentType <Tool >> TOOL = () -> nms ().tool ();
34
+ Supplier <DataComponentType <DyedItemColor >> DYED_COLOR = () -> nms ().dyedColor ();
35
+ Supplier <DataComponentType <MapItemColor >> MAP_COLOR = () -> nms ().mapColor ();
36
+ Supplier <DataComponentType <MapId >> MAP_ID = () -> nms ().mapId ();
37
+ Supplier <DataComponentType <BundleContents >> BUNDLE_CONTENTS = () -> nms ().bundleContents ();
38
+ Supplier <DataComponentType <PotionContents >> POTION_CONTENTS = () -> nms ().potionContents ();
39
+ Supplier <DataComponentType <SuspiciousStewEffects >> SUSPICIOUS_STEW_EFFECTS = () -> nms ().suspiciousStewEffects ();
40
+ Supplier <DataComponentType <WritableBookContent >> WRITABLE_BOOK_CONTENT = () -> nms ().writableBookContent ();
41
+ Supplier <DataComponentType <WrittenBookContent >> WRITTEN_BOOK_CONTENT = () -> nms ().writtenBookContent ();
42
+ Supplier <DataComponentType <ArmorTrim >> TRIM = () -> nms ().trim ();
43
+ Supplier <DataComponentType <BlockItemStateProperties >> BLOCK_STATE = () -> nms ().blockState ();
44
+ Supplier <DataComponentType <CustomData >> ENTITY_DATA = () -> nms ().entityData ();
45
+ Supplier <DataComponentType <CustomData >> BUCKET_ENTITY_DATA = () -> nms ().bucketEntityData ();
46
+ Supplier <DataComponentType <CustomData >> BLOCK_ENTITY_DATA = () -> nms ().blockEntityData ();
47
+ Supplier <DataComponentType <Integer >> OMINOUS_BOTTLE_AMPLIFIER = () -> nms ().ominousBottleAmplifier ();
48
+ Supplier <DataComponentType <List <String >>> RECIPES = () -> nms ().recipes ();
49
+
8
50
static Registry <? extends DataComponentType <?>> registry () {
9
51
return NMS .nms ().componentRegistry ();
10
52
}
53
+
11
54
@ NotNull String key ();
12
55
@ NotNull Codec <T > codec ();
13
56
@@ -16,4 +59,5 @@ static Registry<? extends DataComponentType<?>> registry() {
16
59
17
60
@ Nullable T setToJson (@ NotNull ItemAdapter adapter , @ Nullable JsonElement element );
18
61
@ Nullable JsonElement getToJson (@ NotNull ItemAdapter adapter );
62
+
19
63
}
0 commit comments