Skip to content

Commit

Permalink
clean stuffs more
Browse files Browse the repository at this point in the history
  • Loading branch information
CammiePone committed Jan 10, 2025
1 parent a7cea86 commit 59e6697
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,23 @@
import net.minecraft.world.entity.ai.attributes.AttributeMap;

public class ArcanusStatusEffect extends MobEffect {
public ArcanusStatusEffect(MobEffectCategory type, int color) {
private final boolean shouldSync;

public ArcanusStatusEffect(MobEffectCategory type, int color, boolean shouldSync) {
super(type, color);
this.shouldSync = shouldSync;
}

public ArcanusStatusEffect(MobEffectCategory type, int color) {
this(type, color, false);
}

@Override
public void addAttributeModifiers(LivingEntity entity, AttributeMap attributes, int amplifier) {
super.addAttributeModifiers(entity, attributes, amplifier);

if(entity.level() instanceof ServerLevel) {
// FIXME temporal dilation no worky
if(this == ArcanusMobEffects.ANONYMITY.get() || /*this == ArcanusStatusEffects.TEMPORAL_DILATION.get() ||*/ this == ArcanusMobEffects.MANA_WINGS.get())
if(shouldSync)
SyncStatusEffectPacket.sendToAll(entity, this, true);

if(this == ArcanusMobEffects.FLOAT.get())
Expand All @@ -32,8 +38,7 @@ public void removeAttributeModifiers(LivingEntity entity, AttributeMap attribute
super.removeAttributeModifiers(entity, attributes, amplifier);

if(entity.level() instanceof ServerLevel) {
// FIXME temporal dilation no worky
if(this == ArcanusMobEffects.ANONYMITY.get() || /*this == ArcanusStatusEffects.TEMPORAL_DILATION.get() ||*/ this == ArcanusMobEffects.MANA_WINGS.get())
if(shouldSync)
SyncStatusEffectPacket.sendToAll(entity, this, false);

if(this == ArcanusMobEffects.FLOAT.get())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ public class ArcanusMobEffects {
public static final RegistrySupplier<MobEffect> VULNERABILITY = MOB_EFFECTS.register("vulnerability", () -> new ArcanusStatusEffect(MobEffectCategory.HARMFUL, 0x3a8e99));
public static final RegistrySupplier<MobEffect> FORTIFY = MOB_EFFECTS.register("fortify", () -> new ArcanusStatusEffect(MobEffectCategory.BENEFICIAL, 0xbbbbbb));
public static final RegistrySupplier<MobEffect> BOUNCY = MOB_EFFECTS.register("bouncy", () -> new ArcanusStatusEffect(MobEffectCategory.NEUTRAL, 0x77ff88));
public static final RegistrySupplier<MobEffect> ANONYMITY = MOB_EFFECTS.register("anonymity", () -> new ArcanusStatusEffect(MobEffectCategory.NEUTRAL, 0x555555));
public static final RegistrySupplier<MobEffect> ANONYMITY = MOB_EFFECTS.register("anonymity", () -> new ArcanusStatusEffect(MobEffectCategory.NEUTRAL, 0x555555, true));
public static final RegistrySupplier<MobEffect> COPPER_CURSE = MOB_EFFECTS.register("copper_curse", () -> new ArcanusStatusEffect(MobEffectCategory.HARMFUL, 0xc15a36));
public static final RegistrySupplier<MobEffect> DISCOMBOBULATE = MOB_EFFECTS.register("discombobulate", () -> new ArcanusStatusEffect(MobEffectCategory.HARMFUL, 0x7b1375));
// public static final RegistrySupplier<StatusEffect> TEMPORAL_DILATION = STATUS_EFFECTS.register("temporal_dilation", () -> new ArcanusStatusEffect(StatusEffectType.BENEFICIAL, 0x68e1ff));
// public static final RegistrySupplier<StatusEffect> TEMPORAL_DILATION = STATUS_EFFECTS.register("temporal_dilation", () -> new ArcanusStatusEffect(StatusEffectType.BENEFICIAL, 0x68e1ff, true));
public static final RegistrySupplier<MobEffect> FLOAT = MOB_EFFECTS.register("float", () -> new ArcanusStatusEffect(MobEffectCategory.NEUTRAL, 0xceffff));
public static final RegistrySupplier<MobEffect> MANA_WINGS = MOB_EFFECTS.register("mana_wings", () -> new ArcanusStatusEffect(MobEffectCategory.BENEFICIAL, 0x716e8c));
public static final RegistrySupplier<MobEffect> MANA_WINGS = MOB_EFFECTS.register("mana_wings", () -> new ArcanusStatusEffect(MobEffectCategory.BENEFICIAL, 0x716e8c, true));
public static final RegistrySupplier<MobEffect> STOCKPILE = MOB_EFFECTS.register("stockpile", () -> new ArcanusStatusEffect(MobEffectCategory.BENEFICIAL, 0x550000));
public static final RegistrySupplier<MobEffect> DANGER_SENSE = MOB_EFFECTS.register("danger_sense", () -> new ArcanusStatusEffect(MobEffectCategory.BENEFICIAL, 0xaeeff2));
public static final RegistrySupplier<MobEffect> SHRINK = MOB_EFFECTS.register("shrink", () -> new ArcanusStatusEffect(MobEffectCategory.NEUTRAL, 0x00ffc8));
public static final RegistrySupplier<MobEffect> ENLARGE = MOB_EFFECTS.register("enlarge", () -> new ArcanusStatusEffect(MobEffectCategory.NEUTRAL, 0xff9600));
public static final RegistrySupplier<MobEffect> SHRINK = MOB_EFFECTS.register("shrink", () -> new ArcanusStatusEffect(MobEffectCategory.NEUTRAL, 0x00ffc8, true));
public static final RegistrySupplier<MobEffect> ENLARGE = MOB_EFFECTS.register("enlarge", () -> new ArcanusStatusEffect(MobEffectCategory.NEUTRAL, 0xff9600, true));
}

0 comments on commit 59e6697

Please sign in to comment.