diff --git a/src/main/java/com/wenxin2/marioverse/event_handlers/MarioverseEventHandlers.java b/src/main/java/com/wenxin2/marioverse/event_handlers/MarioverseEventHandlers.java index 1395049f..a4c161ce 100644 --- a/src/main/java/com/wenxin2/marioverse/event_handlers/MarioverseEventHandlers.java +++ b/src/main/java/com/wenxin2/marioverse/event_handlers/MarioverseEventHandlers.java @@ -49,7 +49,6 @@ import net.neoforged.neoforge.event.entity.living.LivingIncomingDamageEvent; import net.neoforged.neoforge.event.entity.player.PlayerEvent; import net.neoforged.neoforge.event.entity.player.PlayerInteractEvent; -import virtuoel.pehkui.api.ScaleTypes; @EventBusSubscriber(modid = Marioverse.MOD_ID) public class MarioverseEventHandlers { @@ -140,10 +139,10 @@ public static void onEntityDamaged(LivingIncomingDamageEvent event) { if (!tag.getBoolean("marioverse:has_mushroom") && ConfigRegistry.DAMAGE_SHRINKS_PLAYERS.get() && !player.getType().is(TagRegistry.CANNOT_LOSE_POWER_UP) && !player.getType().is(TagRegistry.DAMAGE_CANNOT_SHRINK) - && (ScaleTypes.HEIGHT.getScaleData(event.getEntity()).getTargetScale() > 0.5F - || ScaleTypes.WIDTH.getScaleData(event.getEntity()).getTargetScale() > 0.75F)) { - ScaleTypes.HEIGHT.getScaleData(event.getEntity()).setTargetScale(0.5F); - ScaleTypes.WIDTH.getScaleData(event.getEntity()).setTargetScale(0.75F); + /*&& (ScaleTypes.HEIGHT.getScaleData(event.getEntity()).getTargetScale() > 0.5F + || ScaleTypes.WIDTH.getScaleData(event.getEntity()).getTargetScale() > 0.75F)*/) { +// ScaleTypes.HEIGHT.getScaleData(event.getEntity()).setTargetScale(0.5F); +// ScaleTypes.WIDTH.getScaleData(event.getEntity()).setTargetScale(0.75F); world.playSound(null, player.blockPosition(), SoundRegistry.DAMAGE_TAKEN.get(), SoundSource.PLAYERS, 1.0F, 1.0F); } @@ -201,10 +200,10 @@ public static void onEntityDamaged(LivingIncomingDamageEvent event) { if (!tag.getBoolean("marioverse:has_mushroom") && ConfigRegistry.DAMAGE_SHRINKS_ALL_MOBS.get() && !entity.getType().is(TagRegistry.DAMAGE_CANNOT_SHRINK) - && (ScaleTypes.HEIGHT.getScaleData(event.getEntity()).getTargetScale() > 0.5F - || ScaleTypes.WIDTH.getScaleData(event.getEntity()).getTargetScale() > 0.75F)) { - ScaleTypes.HEIGHT.getScaleData(event.getEntity()).setTargetScale(0.5F); - ScaleTypes.WIDTH.getScaleData(event.getEntity()).setTargetScale(0.75F); + /*&& (ScaleTypes.HEIGHT.getScaleData(event.getEntity()).getTargetScale() > 0.5F + || ScaleTypes.WIDTH.getScaleData(event.getEntity()).getTargetScale() > 0.75F)*/) { +// ScaleTypes.HEIGHT.getScaleData(event.getEntity()).setTargetScale(0.5F); +// ScaleTypes.WIDTH.getScaleData(event.getEntity()).setTargetScale(0.75F); world.playSound(null, entity.blockPosition(), SoundRegistry.DAMAGE_TAKEN.get(), SoundSource.HOSTILE, 1.0F, 1.0F); } @@ -266,31 +265,31 @@ public static void onEntityHeal(LivingHealEvent event) { if (player.getHealth() > ConfigRegistry.HEALTH_SHRINK_PLAYERS.get()) { tag.putBoolean("marioverse:has_mushroom", true); if (tag.getBoolean("marioverse:has_mushroom") && ConfigRegistry.DAMAGE_SHRINKS_PLAYERS.get() - && (ScaleTypes.HEIGHT.getScaleData(entity).getTargetScale() < 1.0F - || ScaleTypes.WIDTH.getScaleData(entity).getTargetScale() < 1.0F)) { - ScaleTypes.HEIGHT.getScaleData(entity).setTargetScale(1.0F); - ScaleTypes.WIDTH.getScaleData(entity).setTargetScale(1.0F); + /*&& (ScaleTypes.HEIGHT.getScaleData(entity).getTargetScale() < 1.0F + || ScaleTypes.WIDTH.getScaleData(entity).getTargetScale() < 1.0F)*/) { +// ScaleTypes.HEIGHT.getScaleData(entity).setTargetScale(1.0F); +// ScaleTypes.WIDTH.getScaleData(entity).setTargetScale(1.0F); } } else if (tag.getBoolean("marioverse:has_mushroom") && ConfigRegistry.DAMAGE_SHRINKS_PLAYERS.get() - && (ScaleTypes.HEIGHT.getScaleData(entity).getTargetScale() < 1.0F - || ScaleTypes.WIDTH.getScaleData(entity).getTargetScale() < 1.0F)) { - ScaleTypes.HEIGHT.getScaleData(entity).setTargetScale(1.0F); - ScaleTypes.WIDTH.getScaleData(entity).setTargetScale(1.0F); + /*&& (ScaleTypes.HEIGHT.getScaleData(entity).getTargetScale() < 1.0F + || ScaleTypes.WIDTH.getScaleData(entity).getTargetScale() < 1.0F)*/) { +// ScaleTypes.HEIGHT.getScaleData(entity).setTargetScale(1.0F); +// ScaleTypes.WIDTH.getScaleData(entity).setTargetScale(1.0F); } } else if (entity instanceof LivingEntity livingEntity) { if (livingEntity.getHealth() > livingEntity.getMaxHealth() * ConfigRegistry.HEALTH_SHRINK_MOBS.get()) { tag.putBoolean("marioverse:has_mushroom", true); if (tag.getBoolean("marioverse:has_mushroom") && ConfigRegistry.DAMAGE_SHRINKS_PLAYERS.get() - && (ScaleTypes.HEIGHT.getScaleData(entity).getTargetScale() < 1.0F - || ScaleTypes.WIDTH.getScaleData(entity).getTargetScale() < 1.0F)) { - ScaleTypes.HEIGHT.getScaleData(entity).setTargetScale(1.0F); - ScaleTypes.WIDTH.getScaleData(entity).setTargetScale(1.0F); + /*&& (ScaleTypes.HEIGHT.getScaleData(entity).getTargetScale() < 1.0F + || ScaleTypes.WIDTH.getScaleData(entity).getTargetScale() < 1.0F)*/) { +// ScaleTypes.HEIGHT.getScaleData(entity).setTargetScale(1.0F); +// ScaleTypes.WIDTH.getScaleData(entity).setTargetScale(1.0F); } } else if (tag.getBoolean("marioverse:has_mushroom") && ConfigRegistry.DAMAGE_SHRINKS_PLAYERS.get() - && (ScaleTypes.HEIGHT.getScaleData(entity).getTargetScale() < 1.0F - || ScaleTypes.WIDTH.getScaleData(entity).getTargetScale() < 1.0F)) { - ScaleTypes.HEIGHT.getScaleData(entity).setTargetScale(1.0F); - ScaleTypes.WIDTH.getScaleData(entity).setTargetScale(1.0F); + /*&& (ScaleTypes.HEIGHT.getScaleData(entity).getTargetScale() < 1.0F + || ScaleTypes.WIDTH.getScaleData(entity).getTargetScale() < 1.0F)*/) { +// ScaleTypes.HEIGHT.getScaleData(entity).setTargetScale(1.0F); +// ScaleTypes.WIDTH.getScaleData(entity).setTargetScale(1.0F); } } } diff --git a/src/main/java/com/wenxin2/marioverse/init/compat/ScaleRegistry.java b/src/main/java/com/wenxin2/marioverse/init/compat/ScaleRegistry.java deleted file mode 100644 index ecc97f42..00000000 --- a/src/main/java/com/wenxin2/marioverse/init/compat/ScaleRegistry.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.wenxin2.marioverse.init.compat; - -import com.wenxin2.marioverse.Marioverse; -import net.minecraft.resources.ResourceLocation; -import virtuoel.pehkui.api.ScaleModifier; -import virtuoel.pehkui.api.ScaleModifiers; -import virtuoel.pehkui.api.ScaleRegistries; -import virtuoel.pehkui.api.ScaleType; - -public class ScaleRegistry { - public static final ScaleType MUSHROOM_SCALE; - - static { - MUSHROOM_SCALE = registerDimensionScale("mushroom_scale", null, ScaleModifiers.HEIGHT_MULTIPLIER, ScaleModifiers.WIDTH_MULTIPLIER); - } - - private static ScaleType register(ResourceLocation id, ScaleType.Builder builder) { - return ScaleRegistries.register(ScaleRegistries.SCALE_TYPES, id, builder.build()); - } - - private static ScaleType registerDimensionScale(String path, ScaleModifier valueModifier, ScaleModifier... dependentModifiers) { - ScaleType.Builder builder = ScaleType.Builder.create().affectsDimensions(); - if (valueModifier != null) { - builder.addBaseValueModifier(valueModifier); - } - - ScaleModifier[] var4 = dependentModifiers; - int var5 = dependentModifiers.length; - - for(int var6 = 0; var6 < var5; ++var6) { - ScaleModifier scaleModifier = var4[var6]; - builder.addDependentModifier(scaleModifier); - } - - return register(ResourceLocation.parse(Marioverse.MOD_ID), builder); - } -} diff --git a/src/main/resources/META-INF/neoforge.mods.toml b/src/main/resources/META-INF/neoforge.mods.toml index 14eb4eb6..7474f703 100644 --- a/src/main/resources/META-INF/neoforge.mods.toml +++ b/src/main/resources/META-INF/neoforge.mods.toml @@ -70,13 +70,6 @@ versionRange="[4.6,)" ordering="NONE" side="CLIENT" -[[dependencies.marioverse]] -modId="pehkui" -type="required" -versionRange="[3.8.3+1.21-neoforge,)" -ordering="NONE" -side="BOTH" - [[dependencies.marioverse]] modId="ctm" type="optional"