Skip to content

Commit

Permalink
various cleanup, creative tab, fix mobeffectcallback only working on …
Browse files Browse the repository at this point in the history
…players

address #682
  • Loading branch information
iron431 committed Dec 11, 2024
1 parent c40c094 commit 4f8a20a
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 4f8a20a

Please sign in to comment.