diff --git a/gradle.properties b/gradle.properties index 34c0eb24..c2d7b9a0 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,12 +1,12 @@ -project_version=1.4.0.beta1 +project_version=1.5.0.beta1 # FM Protocols protocols_version=b15c1841 protocols_use_local_build=false protocols_local_version=1.1.5 -mc_version=1.21.3 -minecraft_version=1.21.3-R0.1-SNAPSHOT +mc_version=1.21.4 +minecraft_version=1.21.4-R0.1-SNAPSHOT # Dependencies protocollib_version=5.3.0 diff --git a/src/main/java/xyz/nifeather/morph/MorphPlugin.java b/src/main/java/xyz/nifeather/morph/MorphPlugin.java index ebad1050..85eb8719 100644 --- a/src/main/java/xyz/nifeather/morph/MorphPlugin.java +++ b/src/main/java/xyz/nifeather/morph/MorphPlugin.java @@ -129,7 +129,7 @@ public void onEnable() pluginManager = Bukkit.getPluginManager(); var bukkitVersion = Bukkit.getMinecraftVersion(); - String primaryVersion = "1.21.3"; + String primaryVersion = "1.21.4"; String[] compatVersions = new String[] { primaryVersion }; if (Arrays.stream(compatVersions).noneMatch(bukkitVersion::equals)) { diff --git a/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/PacketFactory.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/PacketFactory.java index 79b1db4c..de1115e6 100644 --- a/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/PacketFactory.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/PacketFactory.java @@ -166,7 +166,7 @@ public List> buildPlayerInfoPackets(SingleWatcher watcher) spawnUUID, watcher.readEntryOrThrow(CustomEntries.PROFILE), watcher.readEntryOrDefault(CustomEntries.PROFILE_LISTED, false), 114514, GameType.DEFAULT_MODE, - null, 0, null + null, true, 0, null ) ); diff --git a/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/listeners/SoundListener.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/listeners/SoundListener.java index 3edb4b86..e0b32e4c 100644 --- a/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/listeners/SoundListener.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/listeners/SoundListener.java @@ -116,8 +116,7 @@ private ClientboundSoundPacket getClientboundSoundPacket(PacketEvent event, Pack || path.endsWith(".hurt_freeze") || path.endsWith(".hurt_sweet_berry_bush")) { - var soundId = EntityTypeUtils.getDamageSound(watcher.getEntityType()); - if (soundId == null) return null; + var soundId = EntityTypeUtils.getDamageSoundKey(watcher.getEntityType()); ResourceLocation rL = ResourceLocation.tryParse(soundId); if (rL == null) return null; diff --git a/src/main/java/xyz/nifeather/morph/events/CommonEventProcessor.java b/src/main/java/xyz/nifeather/morph/events/CommonEventProcessor.java index 651db47a..ce8b06ea 100644 --- a/src/main/java/xyz/nifeather/morph/events/CommonEventProcessor.java +++ b/src/main/java/xyz/nifeather/morph/events/CommonEventProcessor.java @@ -619,7 +619,7 @@ public void onAdvancement(BlockBreakEvent event) if (!(block.getBlockData() instanceof CreakingHeart creakingHeart)) return; - if (creakingHeart.getCreaking() != CreakingHeart.Creaking.ACTIVE) + if (!creakingHeart.isActive()) return; morphs.grantMorphToPlayer(event.getPlayer(), EntityType.CREAKING.getKey().asString()); @@ -638,9 +638,6 @@ private void onPlayerKillEntity(Player player, Entity entity) else { var type = entity.getType(); - if (type == EntityType.CREAKING_TRANSIENT) - type = EntityType.CREAKING; - morphs.grantMorphToPlayer(player, type.getKey().asString()); } } diff --git a/src/main/java/xyz/nifeather/morph/misc/playerList/PlayerListHandler.java b/src/main/java/xyz/nifeather/morph/misc/playerList/PlayerListHandler.java index df30d673..2bbad8d2 100644 --- a/src/main/java/xyz/nifeather/morph/misc/playerList/PlayerListHandler.java +++ b/src/main/java/xyz/nifeather/morph/misc/playerList/PlayerListHandler.java @@ -116,7 +116,7 @@ public void showFakePlayer(UUID disguiseUUID, GameProfile profile) disguiseUUID, profile, true, 114514, GameType.DEFAULT_MODE, - null, 0, null + null, true, 0, null ) ); @@ -166,7 +166,7 @@ public void handle(Player player) disguiseUUID, profile, true, 114514, GameType.DEFAULT_MODE, - null, 0, null + null, true, 0, null ) ); diff --git a/src/main/java/xyz/nifeather/morph/providers/disguise/VanillaDisguiseProvider.java b/src/main/java/xyz/nifeather/morph/providers/disguise/VanillaDisguiseProvider.java index 39052869..fbfc9a74 100644 --- a/src/main/java/xyz/nifeather/morph/providers/disguise/VanillaDisguiseProvider.java +++ b/src/main/java/xyz/nifeather/morph/providers/disguise/VanillaDisguiseProvider.java @@ -77,7 +77,7 @@ public VanillaDisguiseProvider() for (var eT : EntityType.values()) { - if (eT == EntityType.UNKNOWN || eT == EntityType.CREAKING_TRANSIENT || !eT.isAlive()) continue; + if (eT == EntityType.UNKNOWN || !eT.isAlive()) continue; list.add(eT.getKey().getKey()); } @@ -255,7 +255,7 @@ private void tryAddModifier(DisguiseState state) var mobMaxHealth = craftLiving.craftAttributes.getAttribute(Attribute.MAX_HEALTH).getBaseValue(); // patch: CREAKING only have half heart, and we don't want that. - if (state.getEntityType() == EntityType.CREAKING || state.getEntityType() == EntityType.CREAKING_TRANSIENT) + if (state.getEntityType() == EntityType.CREAKING) mobMaxHealth = 20; var playerAttribute = player.getAttribute(Attribute.MAX_HEALTH); diff --git a/src/main/java/xyz/nifeather/morph/utilities/EntityTypeUtils.java b/src/main/java/xyz/nifeather/morph/utilities/EntityTypeUtils.java index 80a375a6..53bb40f3 100644 --- a/src/main/java/xyz/nifeather/morph/utilities/EntityTypeUtils.java +++ b/src/main/java/xyz/nifeather/morph/utilities/EntityTypeUtils.java @@ -3,6 +3,7 @@ import it.unimi.dsi.fastutil.objects.Object2ObjectArrayMap; import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap; import it.unimi.dsi.fastutil.objects.ObjectSet; +import net.kyori.adventure.key.Key; import net.minecraft.core.BlockPos; import net.minecraft.sounds.SoundEvent; import net.minecraft.sounds.SoundEvents; @@ -12,12 +13,14 @@ import net.minecraft.world.entity.Mob; import net.minecraft.world.entity.player.Player; import org.bukkit.Location; +import org.bukkit.Registry; import org.bukkit.Sound; import org.bukkit.World; import org.bukkit.block.Block; import org.bukkit.craftbukkit.CraftWorld; import org.bukkit.entity.Enemy; import org.bukkit.entity.EntityType; +import org.checkerframework.checker.units.qual.K; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import xyz.nifeather.morph.MorphPlugin; @@ -405,15 +408,15 @@ public static String getStepSound(EntityType type) } @Nullable - public static String getDamageSound(EntityType type) + public static String getDamageSoundKey(EntityType type) { if (type == EntityType.PLAYER) return null; if (type == EntityType.ARMOR_STAND) - return Sound.ENTITY_ARMOR_STAND_HIT.key().asString(); + return "entity.armor_stand.hit"; if (type == EntityType.TRADER_LLAMA) - return Sound.ENTITY_LLAMA_HURT.key().asString(); + return "entity.llama.hurt"; return "entity.%s.hurt".formatted(type.getKey().getKey()); }