From 4f8a20a2de2d6e28381524de4baa562651c6d82c Mon Sep 17 00:00:00 2001 From: iron431 <34083081+iron431@users.noreply.github.com> Date: Tue, 10 Dec 2024 18:10:32 -0600 Subject: [PATCH] various cleanup, creative tab, fix mobeffectcallback only working on players address #682 --- .../player/ClientSpellCastHelper.java | 1 - .../player/ServerPlayerEvents.java | 13 ++++++++----- .../registries/CreativeTabRegistry.java | 2 ++ .../setup/IronsAdjustmentModifier.java | 5 +++++ .../textures/gui/spell_icons/ice_spikes.png | Bin 288 -> 288 bytes .../textures/item/void_rune.png | Bin 4698 -> 706 bytes 6 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/main/java/io/redspace/ironsspellbooks/player/ClientSpellCastHelper.java b/src/main/java/io/redspace/ironsspellbooks/player/ClientSpellCastHelper.java index 679b152d9..c24fccd62 100644 --- a/src/main/java/io/redspace/ironsspellbooks/player/ClientSpellCastHelper.java +++ b/src/main/java/io/redspace/ironsspellbooks/player/ClientSpellCastHelper.java @@ -202,7 +202,6 @@ public void stop() { IronsAdjustmentModifier.INSTANCE.fadeOut(5); } }; -// ClientMagicData.castingAnimationPlayerLookup.put(player.getUUID(), animation); var armsFlag = SHOW_FIRST_PERSON_ARMS.get(); var itemsFlag = SHOW_FIRST_PERSON_ITEMS.get(); if (armsFlag || itemsFlag) { diff --git a/src/main/java/io/redspace/ironsspellbooks/player/ServerPlayerEvents.java b/src/main/java/io/redspace/ironsspellbooks/player/ServerPlayerEvents.java index 1868f94cc..1ae592964 100644 --- a/src/main/java/io/redspace/ironsspellbooks/player/ServerPlayerEvents.java +++ b/src/main/java/io/redspace/ironsspellbooks/player/ServerPlayerEvents.java @@ -314,12 +314,15 @@ public static void onPlayerLoggedIn(PlayerEvent.PlayerLoggedInEvent event) { @SubscribeEvent public static void onLivingDeathEvent(LivingDeathEvent event) { - if (event.getEntity() instanceof ServerPlayer serverPlayer) { - Utils.serverSideCancelCast(serverPlayer); - MagicData.getPlayerMagicData(serverPlayer).getPlayerRecasts().removeAll(RecastResult.DEATH); - serverPlayer.getActiveEffects().forEach(mobEffectInstance -> { + var entity = event.getEntity(); + if(!entity.level.isClientSide){ + if (entity instanceof ServerPlayer serverPlayer) { + Utils.serverSideCancelCast(serverPlayer); + MagicData.getPlayerMagicData(serverPlayer).getPlayerRecasts().removeAll(RecastResult.DEATH); + } + entity.getActiveEffects().forEach(mobEffectInstance -> { if (mobEffectInstance.getEffect().value() instanceof IMobEffectEndCallback callback) { - callback.onEffectRemoved(serverPlayer, mobEffectInstance.getAmplifier()); + callback.onEffectRemoved(entity, mobEffectInstance.getAmplifier()); } }); } diff --git a/src/main/java/io/redspace/ironsspellbooks/registries/CreativeTabRegistry.java b/src/main/java/io/redspace/ironsspellbooks/registries/CreativeTabRegistry.java index 831ba032c..284eae918 100644 --- a/src/main/java/io/redspace/ironsspellbooks/registries/CreativeTabRegistry.java +++ b/src/main/java/io/redspace/ironsspellbooks/registries/CreativeTabRegistry.java @@ -100,6 +100,8 @@ public static void register(IEventBus eventBus) { entries.accept(ItemRegistry.NETHERITE_MAGE_CHESTPLATE.get()); entries.accept(ItemRegistry.NETHERITE_MAGE_LEGGINGS.get()); entries.accept(ItemRegistry.NETHERITE_MAGE_BOOTS.get()); + entries.accept(ItemRegistry.PALADIN_CHESTPLATE.get()); + entries.accept(ItemRegistry.BOOTS_OF_SPEED.get()); entries.accept(ItemRegistry.TARNISHED_CROWN.get()); entries.accept(ItemRegistry.HITHER_THITHER_WAND.get()); diff --git a/src/main/java/io/redspace/ironsspellbooks/setup/IronsAdjustmentModifier.java b/src/main/java/io/redspace/ironsspellbooks/setup/IronsAdjustmentModifier.java index a3d0b16f9..85af83ee8 100644 --- a/src/main/java/io/redspace/ironsspellbooks/setup/IronsAdjustmentModifier.java +++ b/src/main/java/io/redspace/ironsspellbooks/setup/IronsAdjustmentModifier.java @@ -60,6 +60,11 @@ public void fadeOut(int fadeOut) { } } + public void resetFadeOut(){ + instructedFadeout = 0; + remainingFadeout = 0; + } + protected float getFadeOut(float delta) { float fadeOut = 1; if (remainingFadeout > 0 && instructedFadeout > 0) { diff --git a/src/main/resources/assets/irons_spellbooks/textures/gui/spell_icons/ice_spikes.png b/src/main/resources/assets/irons_spellbooks/textures/gui/spell_icons/ice_spikes.png index 916b266cc147cdcf488fafc6e7405d8aa64ad615..548d1025822fe82050c1eb33d9b99ab6c29052b6 100644 GIT binary patch delta 41 zcmV+^0M`GY0-yqrP9FdyKnP875re&s=lCAY`#q@B|NsBa_x}`|(G}a|>5*--hw>J8 delta 41 zcmV+^0M`GY0-yqrP9F?^Mg3k@xc&g{#mEepx)%c~6w2{kpa z408+Vi>d7ksws2KD09gu^T{lW$TT&w46_L-v&jfk4=&ToC^O0kGYBd3&J1%82@44I zaPahS_EeHn^U(7sv&$&c%_vh$2U-^<6&z+5Qs$po7N6;1=jq|(>7n6KCZAp=p67nltrXNzKo?d31VXACls%fbtqvoOG5vCRFA@6RgXkn^hsU)rD zVdfDg6l^MPVX9!EB%$VE?%|>95vCg)CLin}?rth+;bG|+<`fcU5)vjGTqc`dCYf$3 zYGEp4p(LiJB&8N+7ZRou9HtiRA?5C&;BKm9;bGtrW)b3{>EWT}p(Ls1Vd7z`WobOO zKMv^naxTN4)d zMnufI_uW`uA#)AWw`q%}wpKA7-Cwcb<2Qp>BB$RR-(<~wiRs}~%V~^DRw~vX2vJb? zjj>z6vNm{K0w-_GAJ4C*x$`R5g|n@_ad7Vsp?ORjnQ|2t?)DY)ci}48=wBHe6_&vF zN`JQXX+f9mS^}#!Gan7Nxp?4aiUE_D>|7BJiy8WNjyzk!pDq7t$-j%Uc^i9mT5sx4 p&Q+CI|N8mM@0PE2vQHA+ZGKO{tdQ%Hr5n&Y44$rjF6*2UngH9EB~t(Z literal 4698 zcmcgwdvH|M8Q;)WK%}izN|h?hI*iD8cF(={+{d{lkjEw@qoFax5>h+kdEI0syLZ{$ zJcw0%78ocfI=)7$&M1|KQbwqXFl7c!twyQV>L}F5Ad0W@hf-@tZNIy_Swfqb9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