From e0107b7e34cf0051265f401fbda06f97a3d810d9 Mon Sep 17 00:00:00 2001 From: Christian Date: Sat, 25 Nov 2023 18:38:38 -0600 Subject: [PATCH] remove unused mobeffect, raise shockwave particle --- .../ironsspellbooks/mixin/EntityMixin.java | 26 +++++++++---------- .../registries/MobEffectRegistry.java | 3 ++- .../spells/holy/DivineSmiteSpell.java | 2 +- .../spells/ice/ColdwaveSpell.java | 6 ++--- 4 files changed, 19 insertions(+), 18 deletions(-) diff --git a/src/main/java/io/redspace/ironsspellbooks/mixin/EntityMixin.java b/src/main/java/io/redspace/ironsspellbooks/mixin/EntityMixin.java index 284aac6e8..b8aba8eb0 100644 --- a/src/main/java/io/redspace/ironsspellbooks/mixin/EntityMixin.java +++ b/src/main/java/io/redspace/ironsspellbooks/mixin/EntityMixin.java @@ -38,19 +38,19 @@ public void isAlliedTo(Entity entity, CallbackInfoReturnable cir) { cir.setReturnValue(self.isAlliedTo(summon.getSummoner()) || self.equals(summon.getSummoner())); } - - @Inject(method = "setTicksFrozen", at = @At(value = "HEAD"), cancellable = true) - public void setTicksFrozen(int pTicksFrozen, CallbackInfo ci) { - if ((Object) (this) instanceof LivingEntity livingEntity && livingEntity.hasEffect(MobEffectRegistry.CHILLED.get())) { - int currentTicks = ((Entity) (Object) this).getTicksFrozen(); - int deltaTicks = pTicksFrozen - currentTicks; - if (deltaTicks > 0) { - deltaTicks *= 2; - entityData.set(DATA_TICKS_FROZEN, currentTicks + deltaTicks); - ci.cancel(); - } - } - } +// TODO: +// @Inject(method = "setTicksFrozen", at = @At(value = "HEAD"), cancellable = true) +// public void setTicksFrozen(int pTicksFrozen, CallbackInfo ci) { +// if ((Object) (this) instanceof LivingEntity livingEntity && livingEntity.hasEffect(MobEffectRegistry.CHILLED.get())) { +// int currentTicks = ((Entity) (Object) this).getTicksFrozen(); +// int deltaTicks = pTicksFrozen - currentTicks; +// if (deltaTicks > 0) { +// deltaTicks *= 2; +// entityData.set(DATA_TICKS_FROZEN, currentTicks + deltaTicks); +// ci.cancel(); +// } +// } +// } /** * Necessary see all invisible mobs diff --git a/src/main/java/io/redspace/ironsspellbooks/registries/MobEffectRegistry.java b/src/main/java/io/redspace/ironsspellbooks/registries/MobEffectRegistry.java index 9ebebea6f..70c2a280b 100644 --- a/src/main/java/io/redspace/ironsspellbooks/registries/MobEffectRegistry.java +++ b/src/main/java/io/redspace/ironsspellbooks/registries/MobEffectRegistry.java @@ -45,7 +45,8 @@ public static void register(IEventBus eventBus) { public static final RegistryObject OAKSKIN = MOB_EFFECT_DEFERRED_REGISTER.register("oakskin", () -> new OakskinEffect(MobEffectCategory.BENEFICIAL, 0xffef95) ); public static final RegistryObject PLANAR_SIGHT = MOB_EFFECT_DEFERRED_REGISTER.register("planar_sight", () -> new PlanarSightEffect(MobEffectCategory.BENEFICIAL, 0x6c42f5)); public static final RegistryObject ANTIGRAVITY = MOB_EFFECT_DEFERRED_REGISTER.register("antigravity", () -> new MobEffect(MobEffectCategory.NEUTRAL, 0x6c42f5){}.addAttributeModifier(ForgeMod.ENTITY_GRAVITY.get(), "d2b7228b-3ded-412e-940b-8f9f1e2cf882", -1.02, AttributeModifier.Operation.MULTIPLY_BASE)); - public static final RegistryObject CHILLED = MOB_EFFECT_DEFERRED_REGISTER.register("chilled", () -> new MobEffect(MobEffectCategory.HARMFUL, 0x6c42f5){}.addAttributeModifier(Attributes.MOVEMENT_SPEED, "d2b7229b-3ded-412e-940b-8f9f1e2cf882", -.1, AttributeModifier.Operation.MULTIPLY_TOTAL)); + //TODO: uncomment mixin, uncomment spell logic + // public static final RegistryObject CHILLED = MOB_EFFECT_DEFERRED_REGISTER.register("chilled", () -> new MobEffect(MobEffectCategory.HARMFUL, 0x6c42f5){}.addAttributeModifier(Attributes.MOVEMENT_SPEED, "d2b7229b-3ded-412e-940b-8f9f1e2cf882", -.1, AttributeModifier.Operation.MULTIPLY_TOTAL)); //public static final RegistryObject ROOT = MOB_EFFECT_DEFERRED_REGISTER.register("root", () -> new RootEffect(MobEffectCategory.HARMFUL, 0x604730)); //public static final RegistryObject ENCHANTED_WARD = MOB_EFFECT_DEFERRED_REGISTER.register("enchanted_ward", () -> new EnchantedWardEffect(MobEffectCategory.HARMFUL, 3311322)); } diff --git a/src/main/java/io/redspace/ironsspellbooks/spells/holy/DivineSmiteSpell.java b/src/main/java/io/redspace/ironsspellbooks/spells/holy/DivineSmiteSpell.java index d2fed3aaf..e5267a34e 100644 --- a/src/main/java/io/redspace/ironsspellbooks/spells/holy/DivineSmiteSpell.java +++ b/src/main/java/io/redspace/ironsspellbooks/spells/holy/DivineSmiteSpell.java @@ -96,7 +96,7 @@ public Optional getCastFinishSound() { public void onCast(Level level, int spellLevel, LivingEntity entity, MagicData playerMagicData) { float radius = 1.75f; Vec3 smiteLocation = Utils.moveToRelativeGroundLevel(level, entity.getEyePosition().add(entity.getForward().multiply(1, 0, 1).normalize().scale(1.35f)), 2); - MagicManager.spawnParticles(level, new ShockwaveParticleOptions(SchoolRegistry.HOLY.get().getTargetingColor(), radius * 2), smiteLocation.x, smiteLocation.y, smiteLocation.z, 1, 0, 0, 0, 0, true); + MagicManager.spawnParticles(level, new ShockwaveParticleOptions(SchoolRegistry.HOLY.get().getTargetingColor(), radius * 2), smiteLocation.x, smiteLocation.y + .15f, smiteLocation.z, 1, 0, 0, 0, 0, true); MagicManager.spawnParticles(level, ParticleTypes.ELECTRIC_SPARK, smiteLocation.x, smiteLocation.y + .15f, smiteLocation.z, 50, 0, 0, 0, 1, false); CameraShakeManager.addCameraShake(new CameraShakeData(10, smiteLocation, 10)); var entities = level.getEntities(entity, AABB.ofSize(smiteLocation, radius * 2, radius * 4, radius * 2)); diff --git a/src/main/java/io/redspace/ironsspellbooks/spells/ice/ColdwaveSpell.java b/src/main/java/io/redspace/ironsspellbooks/spells/ice/ColdwaveSpell.java index 920c26a47..3d92ba5ff 100644 --- a/src/main/java/io/redspace/ironsspellbooks/spells/ice/ColdwaveSpell.java +++ b/src/main/java/io/redspace/ironsspellbooks/spells/ice/ColdwaveSpell.java @@ -81,9 +81,9 @@ public void onCast(Level level, int spellLevel, LivingEntity entity, MagicData p float radius = getRadius(spellLevel, entity); MagicManager.spawnParticles(level, new ShockwaveParticleOptions(SchoolRegistry.ICE.get().getTargetingColor(), radius), entity.getX(), entity.getY() + .15f, entity.getZ(), 1, 0, 0, 0, 0, true); level.getEntities(entity, entity.getBoundingBox().inflate(radius, 4, radius), (target) -> DamageSources.isFriendlyFireBetween(target, entity)).forEach(target -> { - if (target instanceof LivingEntity livingEntity && livingEntity.distanceToSqr(entity) < radius * radius) { - livingEntity.addEffect(new MobEffectInstance(MobEffectRegistry.CHILLED.get(), getDuration(spellLevel, entity))); - } +// if (target instanceof LivingEntity livingEntity && livingEntity.distanceToSqr(entity) < radius * radius) { +// livingEntity.addEffect(new MobEffectInstance(MobEffectRegistry.CHILLED.get(), getDuration(spellLevel, entity))); +// } }); super.onCast(level, spellLevel, entity, playerMagicData); }