-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathEnchantGlow.java
More file actions
188 lines (151 loc) · 3.43 KB
/
EnchantGlow.java
File metadata and controls
188 lines (151 loc) · 3.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
package parallelmc.parallelutils.modules.charms.util;
import io.papermc.paper.enchantments.EnchantmentRarity;
import io.papermc.paper.registry.set.RegistryKeySet;
import net.kyori.adventure.key.Key;
import net.kyori.adventure.text.Component;
import org.bukkit.NamespacedKey;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.enchantments.EnchantmentTarget;
import org.bukkit.entity.EntityCategory;
import org.bukkit.entity.EntityType;
import org.bukkit.inventory.EquipmentSlot;
import org.bukkit.inventory.EquipmentSlotGroup;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.ItemType;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import parallelmc.parallelutils.ParallelUtils;
import java.util.Set;
public class EnchantGlow extends Enchantment {
private final NamespacedKey key;
public EnchantGlow(@NotNull NamespacedKey key) {
this.key = key;
}
@Override
public @NotNull String getName() {
return "";
}
@Override
public int getMaxLevel() {
return 0;
}
@Override
public int getStartLevel() {
return 0;
}
@Override
public @NotNull EnchantmentTarget getItemTarget() {
return null;
}
@Override
public boolean isTreasure() {
return false;
}
@Override
public boolean isCursed() {
return false;
}
@Override
public boolean conflictsWith(@NotNull Enchantment other) {
return false;
}
@Override
public boolean canEnchantItem(@NotNull ItemStack item) {
return false;
}
@Override
public @NotNull Component displayName(int level) {
return Component.empty();
}
@Override
public boolean isTradeable() {
return false;
}
@Override
public boolean isDiscoverable() {
return false;
}
@Override
public int getMinModifiedCost(int level) {
return 0;
}
@Override
public int getMaxModifiedCost(int level) {
return 0;
}
@Override
public int getAnvilCost() {
return 0;
}
@Override
public @NotNull EnchantmentRarity getRarity() {
return null;
}
@Override
public float getDamageIncrease(int i, @NotNull EntityCategory entityCategory) {
return 0;
}
@Override
public float getDamageIncrease(int i, @NotNull EntityType entityType) {
return 0;
}
@Override
public @NotNull Set<EquipmentSlot> getActiveSlots() {
return Set.of();
}
@Override
public @NotNull Set<EquipmentSlotGroup> getActiveSlotGroups() {
return Set.of();
}
@Override
public @NotNull Component description() {
return null;
}
@Override
public @NotNull RegistryKeySet<ItemType> getSupportedItems() {
return null;
}
@Override
public @Nullable RegistryKeySet<ItemType> getPrimaryItems() {
return null;
}
@Override
public int getWeight() {
return 0;
}
@Override
public @NotNull RegistryKeySet<Enchantment> getExclusiveWith() {
return null;
}
@Override
public @NotNull String translationKey() {
return "";
}
public static EnchantGlow instance = null;
public static void registerFakeGlow(ParallelUtils puPlugin) {
// try {
// Field f = Enchantment.class.getDeclaredField("acceptingNew");
// f.setAccessible(true);
// f.set(null, true);
// } catch (Exception e) {
// e.printStackTrace();
// }
try {
instance = new EnchantGlow(new NamespacedKey(puPlugin, "glow"));
} catch (Exception e) {
e.printStackTrace();
}
}
@Override
public @NotNull NamespacedKey getKey() {
return key;
}
@Override
public @NotNull Key key() {
return super.key();
}
@Override
public @NotNull String getTranslationKey() {
return null;
}
}