-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f90588a
commit 4822965
Showing
11 changed files
with
121 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
src/main/java/lee/code/pets/pets/pet/util/HorseMarkingUtil.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package lee.code.pets.pets.pet.util; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import net.minecraft.world.entity.animal.horse.Horse; | ||
import net.minecraft.world.entity.animal.horse.Markings; | ||
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftEntity; | ||
import org.bukkit.entity.Entity; | ||
|
||
@AllArgsConstructor | ||
public enum HorseMarkingUtil { | ||
WHITE(Markings.WHITE), | ||
BLACK_DOTS(Markings.BLACK_DOTS), | ||
WHITE_DOTS(Markings.WHITE_DOTS), | ||
WHITE_FIELD(Markings.WHITE_FIELD), | ||
NONE(Markings.NONE) | ||
; | ||
@Getter private final Markings marking; | ||
|
||
public static HorseMarkingUtil getMarking(Entity entity) { | ||
if (((CraftEntity) entity).getHandle() instanceof Horse horse) return HorseMarkingUtil.valueOf(horse.getMarkings().name()); | ||
return HorseMarkingUtil.NONE; | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
src/main/java/lee/code/pets/pets/pet/util/HorseVariantUtil.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package lee.code.pets.pets.pet.util; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import net.minecraft.world.entity.animal.horse.Horse; | ||
import net.minecraft.world.entity.animal.horse.Variant; | ||
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftEntity; | ||
import org.bukkit.entity.Entity; | ||
|
||
@AllArgsConstructor | ||
public enum HorseVariantUtil { | ||
WHITE(Variant.WHITE), | ||
BLACK(Variant.BLACK), | ||
BROWN(Variant.BROWN), | ||
DARK_BROWN(Variant.DARK_BROWN), | ||
CREAMY(Variant.CREAMY), | ||
CHESTNUT(Variant.CHESTNUT), | ||
GRAY(Variant.GRAY) | ||
; | ||
@Getter private final Variant horseVariant; | ||
|
||
public static HorseVariantUtil getVariant(Entity entity) { | ||
if (((CraftEntity) entity).getHandle() instanceof Horse horse) return HorseVariantUtil.valueOf(horse.getVariant().name()); | ||
return HorseVariantUtil.WHITE; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters