Skip to content
This repository has been archived by the owner on Jun 29, 2023. It is now read-only.

1.19 pets #603

Merged
merged 16 commits into from
Jun 28, 2022
Merged
4 changes: 2 additions & 2 deletions COMPILING.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
This project depends on NMS, which shouldn't be redistributed. This means you'll have to build some of the dependencies yourself. (TODO: a script/tool for this would be handy)

How to compile:
1. Use BuildTools normally and create a (remapped when supported) jar for every NMS version UC depends on. At the time of writing, the versions are: 1.8.8, 1.12.2, 1.16.5, 1.17.1\*, and 1.18.2\*.
2. Open a shell in the UC folder, and run `./gradlew clean obfuscate`. Using tasks `build` or `jar` will not produce a jar that works with 1.17 and up because of the new mappings. `clean` is sometimes required for some reason.
1. Use BuildTools normally and create a (remapped when supported) jar for every NMS version UC depends on. At the time of writing, the versions are: 1.8.8, 1.12.2, 1.16.5, 1.17.1*, 1.18.2*, and 1.19*.
2. Open a shell in the UC folder, and run `./gradlew clean obfuscate`. Using tasks `build` or `jar` will not produce a jar that works with 1.17+ because of the new mappings. `clean` is sometimes required for some reason.
3. The built UC jar is at `build/libs/UltraCosmetics-<version>-<buildtype>.jar`. Do NOT use the other jar that says `obfuscated-donotuse`, it won't work.

\* make sure you use the --remapped flag when building this version
Expand Down
4 changes: 2 additions & 2 deletions core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins {

dependencies {
// ideally matches the dependency version of the latest NMS module
compileOnly 'org.spigotmc:spigot-api:1.18.2-R0.1-SNAPSHOT'
compileOnly 'org.spigotmc:spigot-api:1.19-R0.1-SNAPSHOT'
compileOnly('LibsDisguises:LibsDisguises:10.0.28') {
exclude group: 'org.spigotmc'
exclude group: 'com.comphenix.protocol'
Expand All @@ -23,7 +23,7 @@ dependencies {
// NMS modules can't actually use XSeries but it doesn't compile without 'api'.
// IDEs do not like it when 'core' references XSeries directly
// but subprojects must reference XSeries as shaded.
api 'com.github.cryptomorin:XSeries:8.7.1'
api 'com.github.cryptomorin:XSeries:8.8.0'
implementation 'org.bstats:bstats-bukkit:3.0.0'
compileOnly 'net.luckperms:api:5.4'
implementation 'com.zaxxer:HikariCP:4.0.3'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,6 @@ private static void loadMessages() {
addMessage("Pets.Goat.entity-displayname", "&l%playername%'s Goat");
addMessage("Pets.Silverfish.menu-name", "&7&lSilverfish");
addMessage("Pets.Silverfish.entity-displayname", "&l%playername%'s Silverfish");

addMessage("Pets.Horse.menu-name", "&a&lHorse");
addMessage("Pets.Horse.entity-displayname", "&l%playername%'s Horse");
addMessage("Pets.Blaze.menu-name", "&c&lBlaze");
Expand All @@ -326,6 +325,12 @@ private static void loadMessages() {
addMessage("Pets.Skeleton.entity-displayname", "&l%playername%'s Skeleton");
addMessage("Pets.Zombie.menu-name", "&2&lZombie");
addMessage("Pets.Zombie.entity-displayname", "&l%playername%'s Zombie");
addMessage("Pets.Frog.menu-name", "&2&lFrog");
addMessage("Pets.Frog.entity-displayname", "&l%playername%'s Frog");
addMessage("Pets.Warden.menu-name", "&3&lWarden");
addMessage("Pets.Warden.entity-displayname", "&l%playername%'s Warden");
addMessage("Pets.Allay.menu-name", "&a&lAllay");
addMessage("Pets.Allay.entity-displayname", "&l%playername%'s Allay");
addMessage("Pets.Equip", "%prefix% &9You spawned %petname%");
addMessage("Pets.Unequip", "%prefix% &9You despawned %petname%");

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package be.isach.ultracosmetics.cosmetics.pets;

import be.isach.ultracosmetics.UltraCosmetics;
import be.isach.ultracosmetics.cosmetics.type.PetType;
import be.isach.ultracosmetics.player.UltraPlayer;
import com.cryptomorin.xseries.XMaterial;

/**
* Represents an instance of a allay pet summoned by a player.
*
* @author Chris6ix
* @since 08-06-2022
*/
public class PetAllay extends Pet {
public PetAllay(UltraPlayer owner, UltraCosmetics ultraCosmetics) {
super(owner, ultraCosmetics, PetType.getByName("allay"), XMaterial.ALLAY_SPAWN_EGG);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package be.isach.ultracosmetics.cosmetics.pets;

import be.isach.ultracosmetics.UltraCosmetics;
import be.isach.ultracosmetics.cosmetics.type.PetType;
import be.isach.ultracosmetics.player.UltraPlayer;
import com.cryptomorin.xseries.XMaterial;

/**
* Represents an instance of a frog pet summoned by a player.
*
* @author Chris6ix
* @since 08-06-2022
*/
public class PetFrog extends Pet {
public PetFrog(UltraPlayer owner, UltraCosmetics ultraCosmetics) {
super(owner, ultraCosmetics, PetType.getByName("frog"), XMaterial.LILY_PAD);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@
* @since 18-01-2022
*/

/*Temporarily using WHEAT as material until https://minecraft.fandom.com/wiki/Goat_Horn comes to Java edition*/
public class PetGoat extends Pet {
public PetGoat(UltraPlayer owner, UltraCosmetics ultraCosmetics) {
super(owner, ultraCosmetics, PetType.getByName("goat"), XMaterial.WHEAT);
super(owner, ultraCosmetics, PetType.getByName("goat"), XMaterial.GOAT_HORN);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package be.isach.ultracosmetics.cosmetics.pets;

import be.isach.ultracosmetics.UltraCosmetics;
import be.isach.ultracosmetics.cosmetics.type.PetType;
import be.isach.ultracosmetics.player.UltraPlayer;
import com.cryptomorin.xseries.XMaterial;

/**
* Represents an instance of a warden pet summoned by a player.
*
* @author Chris6ix
* @since 08-06-2022
*/
public class PetWarden extends Pet {
public PetWarden(UltraPlayer owner, UltraCosmetics ultraCosmetics) {
super(owner, ultraCosmetics, PetType.getByName("warden"), XMaterial.SCULK_SHRIEKER);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,15 @@ public static void register() {
new PetType("Skeleton", XMaterial.BOW, "&7&oWatch out, it will try to shoot you!", EntityType.SKELETON, PetSkeleton.class);
new PetType("Zombie", XMaterial.ROTTEN_FLESH, "&7&oQuick! Hide your Villagers!", EntityType.ZOMBIE, PetZombie.class);

if (serverVersion.isAtLeast(ServerVersion.v1_19_R1)) {
new PetType("Frog", XMaterial.LILY_PAD, "&7&oDoesn't like Fireflies!", EntityType.FROG, PetFrog.class);
new PetType("Warden", XMaterial.SCULK_SHRIEKER, "&7&oThe scariest Mob in Minecraft!", EntityType.WARDEN, PetWarden.class);
new PetType("Allay", XMaterial.ALLAY_SPAWN_EGG, "&7&oA new Friend!", EntityType.ALLAY, PetAllay.class);
new PetType("Goat", XMaterial.GOAT_HORN, "&7&oBAAAA!", EntityType.GOAT, PetGoat.class);
}

if (serverVersion.isAtLeast(ServerVersion.v1_17_R1)) {
new PetType("Axolotl", XMaterial.AXOLOTL_BUCKET, "&7&oSooo Cute!", EntityType.AXOLOTL, PetAxolotl.class);
/*Temporarily using WHEAT as material for the Goat until https://minecraft.fandom.com/wiki/Goat_Horn comes to Java edition*/
new PetType("Goat", XMaterial.WHEAT, "&7&oBAAAA!", EntityType.GOAT, PetGoat.class);
}

if (serverVersion.isAtLeast(ServerVersion.v1_16_R3)) {
Expand Down