-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Expand file tree
/
Copy pathChicken.java
More file actions
106 lines (87 loc) · 2.8 KB
/
Chicken.java
File metadata and controls
106 lines (87 loc) · 2.8 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
package org.bukkit.entity;
import io.papermc.paper.registry.RegistryAccess;
import io.papermc.paper.registry.RegistryElement;
import io.papermc.paper.registry.RegistryKey;
import net.kyori.adventure.key.Key;
import net.kyori.adventure.key.KeyPattern;
import org.bukkit.Keyed;
import org.jspecify.annotations.NullMarked;
/**
* Represents a Chicken.
*/
@NullMarked
public interface Chicken extends Animals {
/**
* Gets the variant of this chicken.
*
* @return the chicken variant
*/
Variant getVariant();
/**
* Sets the variant of this chicken.
*
* @param variant the chicken variant
*/
void setVariant(Variant variant);
/**
* Get the sound variant of this chicken.
*
* @return chicken sound variant
*/
SoundVariant getSoundVariant();
/**
* Set the sound variant of this chicken.
*
* @param variant chicken sound variant
*/
void setSoundVariant(SoundVariant variant);
/**
* Gets if this chicken was spawned as a chicken jockey.
*
* @return is chicken jockey
*/
boolean isChickenJockey();
/**
* Sets if this chicken was spawned as a chicken jockey.
*
* @param isChickenJockey is chicken jockey
*/
void setIsChickenJockey(boolean isChickenJockey);
/**
* Gets the number of ticks till this chicken lays an egg.
*
* @return ticks till the chicken lays an egg
*/
int getEggLayTime();
/**
* Sets the number of ticks till this chicken lays an egg.
*
* @param eggLayTime ticks till the chicken lays an egg
*/
void setEggLayTime(int eggLayTime);
/**
* Represents the variant of a chicken.
*/
interface Variant extends RegistryElement<Variant>, Keyed {
// Start generate - ChickenVariant
Variant COLD = getVariant("cold");
Variant TEMPERATE = getVariant("temperate");
Variant WARM = getVariant("warm");
// End generate - ChickenVariant
private static Variant getVariant(@KeyPattern.Value String key) {
return RegistryAccess.registryAccess().getRegistry(RegistryKey.CHICKEN_VARIANT).getOrThrow(Key.key(Key.MINECRAFT_NAMESPACE, key));
}
}
/**
* Represents the sound variant of a chicken.
*/
interface SoundVariant extends RegistryElement<SoundVariant>, Keyed {
// Start generate - ChickenSoundVariant
SoundVariant CLASSIC = getSoundVariant("classic");
SoundVariant PICKY = getSoundVariant("picky");
// End generate - ChickenSoundVariant
private static SoundVariant getSoundVariant(final @KeyPattern.Value String key) {
return RegistryAccess.registryAccess().getRegistry(RegistryKey.CHICKEN_SOUND_VARIANT).getOrThrow(Key.key(Key.MINECRAFT_NAMESPACE, key));
}
}
}