From d56c7d31cccf76f423c44571f5311f818f4c9224 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Monica=20M=C4=85ka?= <117939274+monkakokosowa@users.noreply.github.com> Date: Mon, 13 Jan 2025 17:23:45 +0100 Subject: [PATCH 1/7] MidnightConfig replaced with owo-lib --- build.gradle | 8 ++ gradle.properties | 5 +- .../java/dev/symphony/harmony/Harmony.java | 7 +- .../harmony/config/HarmonyConfig.java | 62 ----------- .../config/HarmonyConfigCondition.java | 30 +++--- .../harmony/config/HarmonyConfigModel.java | 70 ++++++++++++ .../symphony/harmony/item/ModifyItems.java | 12 +-- .../mixin/building/ArmorStandStickArms.java | 10 +- .../harmony/mixin/combat/ItemEntityMixin.java | 10 +- .../TridentEntityMixin.java | 4 +- .../harmony/mixin/food/GlowBerryMixin.java | 6 +- .../harmony/mixin/mobs/HuskEntityMixin.java | 4 +- .../mismatched_mob_armor/MobEntityMixin.java | 4 +- .../PlayerEntityMixin.java | 4 +- .../SitOnOwnerShoulderGoalMixin.java | 4 +- .../WolfEntityMixin.java | 4 +- .../mixin/potions/BeaconBlockEntityMixin.java | 4 +- .../redstone/OneTickCopperBulbDelay.java | 4 +- .../redstone/RemoveRedstoneLampDelay.java | 4 +- .../EnderPearlsDontDismount.java | 8 +- .../transportation/ExitVehicleOnDamage.java | 4 +- .../HorseArmorPreventsBucking.java | 4 +- .../elytra/LivingEntityMixin.java | 4 +- .../riptide/LivingEntityMixin.java | 8 +- .../riptide/TridentItemMixin.java | 19 ++-- .../resources/assets/harmony/lang/en_us.json | 100 +++++++++--------- 26 files changed, 208 insertions(+), 195 deletions(-) delete mode 100644 src/main/java/dev/symphony/harmony/config/HarmonyConfig.java create mode 100644 src/main/java/dev/symphony/harmony/config/HarmonyConfigModel.java diff --git a/build.gradle b/build.gradle index 6103a41..debe901 100644 --- a/build.gradle +++ b/build.gradle @@ -15,6 +15,8 @@ repositories { maven { url = "https://api.modrinth.com/maven" } + maven { url 'https://maven.wispforest.io/releases/' } + } dependencies { @@ -30,8 +32,14 @@ dependencies { modImplementation "com.ptsmods:devlogin:3.5" modImplementation include ("maven.modrinth:midnightlib:${project.midnightlib_version}") + + annotationProcessor modImplementation("io.wispforest:owo-lib:${project.owo_version}") + modImplementation "io.wispforest:owo-lib:${project.owo_version}" + include "io.wispforest:owo-sentinel:${project.owo_version}" } + + processResources { inputs.property "version", project.version diff --git a/gradle.properties b/gradle.properties index a32bba1..900e9b7 100644 --- a/gradle.properties +++ b/gradle.properties @@ -16,4 +16,7 @@ archives_base_name=harmony # Dependencies fabric_version=0.110.5+1.21.4 -midnightlib_version = 1.6.6-fabric \ No newline at end of file +midnightlib_version = 1.6.6-fabric + +# https://maven.wispforest.io/io/wispforest/owo-lib/ +owo_version = 0.12.20+1.21.4 \ No newline at end of file diff --git a/src/main/java/dev/symphony/harmony/Harmony.java b/src/main/java/dev/symphony/harmony/Harmony.java index 1575803..eadf4c9 100644 --- a/src/main/java/dev/symphony/harmony/Harmony.java +++ b/src/main/java/dev/symphony/harmony/Harmony.java @@ -5,7 +5,6 @@ import dev.symphony.harmony.item.ModifyItems; import dev.symphony.harmony.loot.HarmonyLootContextTypes; import dev.symphony.harmony.loot.HarmonyLootTables; -import eu.midnightdust.lib.config.MidnightConfig; import net.fabricmc.api.ModInitializer; import net.fabricmc.fabric.api.resource.conditions.v1.ResourceConditionType; @@ -22,11 +21,13 @@ public static Identifier id (String path) { return Identifier.of(Harmony.MOD_ID, path); } + public static final HarmonyConfig CONFIG = HarmonyConfig.createAndLoad(); + + @Override public void onInitialize() { // Config - MidnightConfig.init(MOD_ID, HarmonyConfig.class); - HarmonyConfigCondition.init(); + HarmonyConfigCondition.init(CONFIG); ResourceConditionType conditionType = ResourceConditionType.create(Identifier.of(Harmony.MOD_ID, "config"), HarmonyConfigCondition.CODEC); ResourceConditions.register(conditionType); diff --git a/src/main/java/dev/symphony/harmony/config/HarmonyConfig.java b/src/main/java/dev/symphony/harmony/config/HarmonyConfig.java deleted file mode 100644 index eeccda6..0000000 --- a/src/main/java/dev/symphony/harmony/config/HarmonyConfig.java +++ /dev/null @@ -1,62 +0,0 @@ -package dev.symphony.harmony.config; - -import eu.midnightdust.lib.config.MidnightConfig; - -import java.util.concurrent.TimeUnit; - - -public class HarmonyConfig extends MidnightConfig { - @Comment(category = "harmony", centered = true) public static Comment reloadWarning; - - // Transportation 🏳️‍⚧️ - public static final String TRANS = "transportation"; - @Entry(category = TRANS) public static boolean liquidsDeactivateElytra = true; - @Entry(category = TRANS) public static boolean exitVehicleOnDamage = true; - @HarmonyConfigCondition.ResourceConfigName(config_name = "recipe/saddle") @Entry(category = TRANS) public static boolean saddleRecipe = true; - @Entry(category = TRANS) public static boolean horseArmorPreventsBucking = true; - @Entry(category = TRANS) public static boolean enderPearlsTeleportVehicles = true; - @Entry(category = TRANS) public static boolean enderPearlsDamageVehicles = true; - @Entry(category = TRANS, isSlider = true, min = 0f, max = 1f) public static float riptideAccelerationOnWater = 0.1f; - @Entry(category = TRANS) public static boolean riptideCooldown = true; - @Entry(category = TRANS) public static int riptideTimeMultiplier = 5; - @Entry(category = TRANS) public static boolean reduceRiptideWaterDrag = true; - - // Food - public static final String FOOD = "food"; - @Entry(category = FOOD) public static int stewStackSize = 16; - @Entry(category = FOOD) public static int glowBerryEffect = 10; - - // Building - public static final String BUILD = "building"; - @Entry(category = BUILD) public static boolean armorStandStickArms = true; - @Entry(category = BUILD) public static int armorStandSticks = 1; - - // Redstone - public static final String REDSTONE = "redstone"; - @Entry(category = REDSTONE) public static boolean oneTickCopperBulbDelay = true; - @Entry(category = REDSTONE) public static boolean removeRedstoneLampDelay = true; - - // Potions - public static final String POTIONS = "potions"; - @Entry(category = POTIONS) public static boolean beaconsAffectTamedMobs = true; - - // Combat - public static final String COMBAT = "combat"; - - @Entry(category = COMBAT) public static boolean tridentsReturnFromVoid = true; - @Entry(category = COMBAT) public static boolean changeItemDespawnTime = true; - - private static final int ONE_HOUR = 60 * 60; - - @Entry(category = COMBAT, isSlider = true, min = 0, max = ONE_HOUR) public static int - itemDespawnTimeEasy = (int) TimeUnit.MINUTES.toSeconds(20), - itemDespawnTimeNormal = (int) TimeUnit.MINUTES.toSeconds(10), - itemDespawnTimeHard = (int) TimeUnit.MINUTES.toSeconds(5); - - // Mobs - public static final String MOBS = "mobs"; - @Entry(category = MOBS) public static boolean wolvesGrowlAtMonsters = true; - @Entry(category = MOBS) public static boolean mismatchedMobArmor = true; - @Entry(category = MOBS) public static boolean permissiveParrotPerching = true; - @Entry(category = MOBS) public static boolean husksDropSandOnConvert = true; -} diff --git a/src/main/java/dev/symphony/harmony/config/HarmonyConfigCondition.java b/src/main/java/dev/symphony/harmony/config/HarmonyConfigCondition.java index 0a156c2..e8f457c 100644 --- a/src/main/java/dev/symphony/harmony/config/HarmonyConfigCondition.java +++ b/src/main/java/dev/symphony/harmony/config/HarmonyConfigCondition.java @@ -28,36 +28,30 @@ public record HarmonyConfigCondition(String config_name) implements ResourceCond String config_name(); } - public static void init() { - Field[] fields = HarmonyConfig.class.getDeclaredFields(); - HashMap map = new HashMap<>(); + public static void init(dev.symphony.harmony.config.HarmonyConfig config) { + Field[] fields = HarmonyConfigModel.class.getDeclaredFields(); for (Field field : fields) { - if (java.lang.reflect.Modifier.isStatic(field.getModifiers())) { - if (field.isAnnotationPresent(ResourceConfigName.class)) { - - ResourceConfigName configName = field.getAnnotation(ResourceConfigName.class); - - try { - map.put(configName.config_name(), (Boolean) field.get(null)); - } catch (IllegalAccessException e) { - Harmony.LOGGER.error("Failed to get resource config condition value for field {}", field.getName()); - Harmony.LOGGER.error(Arrays.toString(e.getStackTrace())); - } + if (field.isAnnotationPresent(ResourceConfigName.class)) { + ResourceConfigName configName = field.getAnnotation(ResourceConfigName.class); + try { + // Because of owo lib config model, we use reflection to call the method of the same name as the field from model + // as owo lib doesn't copy annotations to the generated class + resourceMap.put(configName.config_name(), (Boolean) config.getClass().getDeclaredMethod(field.getName()).invoke(config)); + } catch (Exception e) { + Harmony.LOGGER.error("Failed to get resource config condition value for field {}", field.getName()); + Harmony.LOGGER.error(Arrays.toString(e.getStackTrace())); } } } - resourceMap = map; } - public static HashMap resourceMap = null; + public static HashMap resourceMap = new HashMap<>(); public static final MapCodec CODEC = RecordCodecBuilder.mapCodec(instance -> instance.group( Codec.STRING.fieldOf("config_name").forGetter(condition -> condition.config_name) ).apply(instance, HarmonyConfigCondition::new)); - - @Override public ResourceConditionType getType() { return ResourceConditionType.create(Identifier.of(Harmony.MOD_ID, "config"), CODEC); diff --git a/src/main/java/dev/symphony/harmony/config/HarmonyConfigModel.java b/src/main/java/dev/symphony/harmony/config/HarmonyConfigModel.java new file mode 100644 index 0000000..3f66dfc --- /dev/null +++ b/src/main/java/dev/symphony/harmony/config/HarmonyConfigModel.java @@ -0,0 +1,70 @@ +package dev.symphony.harmony.config; + +import dev.symphony.harmony.Harmony; +import io.wispforest.owo.config.annotation.Config; +import io.wispforest.owo.config.annotation.Modmenu; +import io.wispforest.owo.config.annotation.RangeConstraint; +import io.wispforest.owo.config.annotation.SectionHeader; + + +import java.util.concurrent.TimeUnit; + + +@Modmenu(modId = Harmony.MOD_ID) +@Config(name = "harmony", wrapperName = "HarmonyConfig") +public class HarmonyConfigModel { + + // Transportation 🏳️‍⚧️ + @SectionHeader("Transportation") + public boolean liquidsDeactivateElytra = true; + public boolean exitVehicleOnDamage = true; + @HarmonyConfigCondition.ResourceConfigName(config_name = "recipe/saddle") public boolean saddleRecipe = true; + public boolean horseArmorPreventsBucking = true; + public boolean enderPearlsTeleportVehicles = true; + public boolean enderPearlsDamageVehicles = true; + @RangeConstraint(min = 0f, max = 1f) + public float riptideAccelerationOnWater = 0.1f; + public boolean riptideCooldown = true; + public int riptideTimeMultiplier = 5; + public boolean reduceRiptideWaterDrag = true; + + // Food + @SectionHeader("Food") + public int stewStackSize = 16; + public int glowBerryEffect = 10; + + // Building + @SectionHeader("Building") + public boolean armorStandStickArms = true; + public int armorStandSticks = 1; + + // Redstone + @SectionHeader("Redstone") + public boolean oneTickCopperBulbDelay = true; + public boolean removeRedstoneLampDelay = true; + + // Potions + @SectionHeader("Potions") + public boolean beaconsAffectTamedMobs = true; + + // Combat + @SectionHeader("Combat") + public boolean tridentsReturnFromVoid = true; + public boolean changeItemDespawnTime = true; + private static final int ONE_HOUR = 60 * 60; + + @RangeConstraint(min = 0, max = ONE_HOUR) + public int + itemDespawnTimeEasy = (int) TimeUnit.MINUTES.toSeconds(20), + itemDespawnTimeNormal = (int) TimeUnit.MINUTES.toSeconds(10), + itemDespawnTimeHard = (int) TimeUnit.MINUTES.toSeconds(5); + + + // Mobs + @SectionHeader("Mobs") + public boolean wolvesGrowlAtMonsters = true; + public boolean mismatchedMobArmor = true; + public boolean permissiveParrotPerching = true; + public boolean husksDropSandOnConvert = true; +} + diff --git a/src/main/java/dev/symphony/harmony/item/ModifyItems.java b/src/main/java/dev/symphony/harmony/item/ModifyItems.java index 77ae716..897a82a 100644 --- a/src/main/java/dev/symphony/harmony/item/ModifyItems.java +++ b/src/main/java/dev/symphony/harmony/item/ModifyItems.java @@ -1,6 +1,6 @@ package dev.symphony.harmony.item; -import dev.symphony.harmony.config.HarmonyConfig; +import dev.symphony.harmony.Harmony; import net.fabricmc.fabric.api.item.v1.DefaultItemComponentEvents; import net.minecraft.component.DataComponentTypes; import net.minecraft.item.Items; @@ -10,21 +10,21 @@ public class ModifyItems { public static void init() { // FEATURE: Change stew/soup stack sizes // AUTHORS: Flatkat, Trigam - if (HarmonyConfig.stewStackSize != 1) { + if (Harmony.CONFIG.stewStackSize() != 1) { DefaultItemComponentEvents.MODIFY.register(context -> { // Ok so, can't use an item tag since tags only exist // on world load, while this is run on mod init context.modify(Items.MUSHROOM_STEW, builder -> - builder.add(DataComponentTypes.MAX_STACK_SIZE, HarmonyConfig.stewStackSize) + builder.add(DataComponentTypes.MAX_STACK_SIZE, Harmony.CONFIG.stewStackSize()) ); context.modify(Items.RABBIT_STEW, builder -> - builder.add(DataComponentTypes.MAX_STACK_SIZE, HarmonyConfig.stewStackSize) + builder.add(DataComponentTypes.MAX_STACK_SIZE, Harmony.CONFIG.stewStackSize()) ); context.modify(Items.BEETROOT_SOUP, builder -> - builder.add(DataComponentTypes.MAX_STACK_SIZE, HarmonyConfig.stewStackSize) + builder.add(DataComponentTypes.MAX_STACK_SIZE, Harmony.CONFIG.stewStackSize()) ); context.modify(Items.SUSPICIOUS_STEW, builder -> - builder.add(DataComponentTypes.MAX_STACK_SIZE, HarmonyConfig.stewStackSize) + builder.add(DataComponentTypes.MAX_STACK_SIZE, Harmony.CONFIG.stewStackSize()) ); }); } diff --git a/src/main/java/dev/symphony/harmony/mixin/building/ArmorStandStickArms.java b/src/main/java/dev/symphony/harmony/mixin/building/ArmorStandStickArms.java index a02917b..9fc3e04 100644 --- a/src/main/java/dev/symphony/harmony/mixin/building/ArmorStandStickArms.java +++ b/src/main/java/dev/symphony/harmony/mixin/building/ArmorStandStickArms.java @@ -1,7 +1,7 @@ package dev.symphony.harmony.mixin.building; -import dev.symphony.harmony.config.HarmonyConfig; +import dev.symphony.harmony.Harmony; import net.minecraft.block.Block; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityType; @@ -41,12 +41,12 @@ public ArmorStandStickArms(EntityType type, World world) { @Inject(method = "interactAt", at = @At( value = "HEAD" ), cancellable = true) public void stickArms(PlayerEntity player, Vec3d hitPos, Hand hand, CallbackInfoReturnable callback) { - if (isMarker() || !HarmonyConfig.armorStandStickArms) return; + if (isMarker() || !Harmony.CONFIG.armorStandStickArms()) return; if (player.isSneaking()) return; ItemStack heldItem = player.getStackInHand(hand); // Add arms - if (heldItem.getItem().equals(Items.STICK) && heldItem.getCount() >= HarmonyConfig.armorStandSticks && !shouldShowArms()) { + if (heldItem.getItem().equals(Items.STICK) && heldItem.getCount() >= Harmony.CONFIG.armorStandSticks() && !shouldShowArms()) { equipArms(player, heldItem); callback.setReturnValue(ActionResult.SUCCESS); @@ -61,7 +61,7 @@ public void stickArms(PlayerEntity player, Vec3d hitPos, Hand hand, CallbackInfo @Unique public void equipArms(PlayerEntity player, ItemStack stickStack) { setShowArms(true); - stickStack.decrementUnlessCreative(HarmonyConfig.armorStandSticks, player); + stickStack.decrementUnlessCreative(Harmony.CONFIG.armorStandSticks(), player); player.playSound(SoundEvents.ITEM_ARMOR_EQUIP_GENERIC.value(), 1F, 1F); } @@ -72,7 +72,7 @@ public void shearArms(PlayerEntity player, ItemStack shearStack, Hand hand) { shearStack.damage(1, player, LivingEntity.getSlotForHand(hand)); ItemStack sticksDrop = Items.STICK.getDefaultStack(); - sticksDrop.setCount(HarmonyConfig.armorStandSticks); + sticksDrop.setCount(Harmony.CONFIG.armorStandSticks()); World world = this.getWorld(); BlockPos blockPos = this.getBlockPos().up(); diff --git a/src/main/java/dev/symphony/harmony/mixin/combat/ItemEntityMixin.java b/src/main/java/dev/symphony/harmony/mixin/combat/ItemEntityMixin.java index 843f285..b61631a 100644 --- a/src/main/java/dev/symphony/harmony/mixin/combat/ItemEntityMixin.java +++ b/src/main/java/dev/symphony/harmony/mixin/combat/ItemEntityMixin.java @@ -1,6 +1,6 @@ package dev.symphony.harmony.mixin.combat; -import dev.symphony.harmony.config.HarmonyConfig; +import dev.symphony.harmony.Harmony; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityType; import net.minecraft.entity.ItemEntity; @@ -24,15 +24,15 @@ public ItemEntityMixin(EntityType type, World world) { @ModifyConstant(method = "tick", constant = @Constant(intValue = 6000)) private int modifyDespawnTime(int constant) { - if(!HarmonyConfig.changeItemDespawnTime){ + if(!Harmony.CONFIG.changeItemDespawnTime()){ return constant; } int time = 20 * switch (this.getWorld().getDifficulty()) { - case PEACEFUL, EASY -> HarmonyConfig.itemDespawnTimeEasy; - case NORMAL -> HarmonyConfig.itemDespawnTimeNormal; - case HARD -> HarmonyConfig.itemDespawnTimeHard; + case PEACEFUL, EASY -> Harmony.CONFIG.itemDespawnTimeEasy(); + case NORMAL -> Harmony.CONFIG.itemDespawnTimeNormal(); + case HARD -> Harmony.CONFIG.itemDespawnTimeHard(); }; return time == 0 ? NEVER_DESPAWN_AGE : time; diff --git a/src/main/java/dev/symphony/harmony/mixin/combat/tridents_return_from_void/TridentEntityMixin.java b/src/main/java/dev/symphony/harmony/mixin/combat/tridents_return_from_void/TridentEntityMixin.java index 1b05c8c..ff53bdd 100644 --- a/src/main/java/dev/symphony/harmony/mixin/combat/tridents_return_from_void/TridentEntityMixin.java +++ b/src/main/java/dev/symphony/harmony/mixin/combat/tridents_return_from_void/TridentEntityMixin.java @@ -1,6 +1,6 @@ package dev.symphony.harmony.mixin.combat.tridents_return_from_void; -import dev.symphony.harmony.config.HarmonyConfig; +import dev.symphony.harmony.Harmony; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityType; import net.minecraft.entity.projectile.ProjectileEntity; @@ -23,7 +23,7 @@ protected TridentEntityMixin(EntityType entityType, @Inject(method = "tick", at = @At("HEAD")) private void tickMixin(CallbackInfo ci) { - if(HarmonyConfig.tridentsReturnFromVoid){ + if(Harmony.CONFIG.tridentsReturnFromVoid()){ if (!this.getWorld().isClient) { if (!this.dealtDamage && this.getBlockPos().getY() < 1) { this.dealtDamage = true; diff --git a/src/main/java/dev/symphony/harmony/mixin/food/GlowBerryMixin.java b/src/main/java/dev/symphony/harmony/mixin/food/GlowBerryMixin.java index 2890251..792d243 100644 --- a/src/main/java/dev/symphony/harmony/mixin/food/GlowBerryMixin.java +++ b/src/main/java/dev/symphony/harmony/mixin/food/GlowBerryMixin.java @@ -1,6 +1,6 @@ package dev.symphony.harmony.mixin.food; -import dev.symphony.harmony.config.HarmonyConfig; +import dev.symphony.harmony.Harmony; import net.minecraft.entity.LivingEntity; import net.minecraft.entity.effect.StatusEffectInstance; import net.minecraft.entity.effect.StatusEffects; @@ -23,11 +23,11 @@ public class GlowBerryMixin { private void glowBerryGlowEffect(ItemStack stack, World world, LivingEntity user, CallbackInfoReturnable cir) { // Checks if its not done on the client and if the glowberry effect isnt 0, if its zero it wont do anything - if(!world.isClient && HarmonyConfig.glowBerryEffect != 0) { + if(!world.isClient && Harmony.CONFIG.glowBerryEffect() != 0) { // Checks if the item the person is holding is a glowberry if (stack.getItem() == Items.GLOW_BERRIES) { // Convert the input from ticks to seconds as 20 ticks is 1 second - int glowduration = HarmonyConfig.glowBerryEffect * 20; + int glowduration = Harmony.CONFIG.glowBerryEffect() * 20; // Apply the effect using the glowduration above user.addStatusEffect(new StatusEffectInstance(StatusEffects.GLOWING, glowduration, 0, true, true)); } diff --git a/src/main/java/dev/symphony/harmony/mixin/mobs/HuskEntityMixin.java b/src/main/java/dev/symphony/harmony/mixin/mobs/HuskEntityMixin.java index 357b90c..2eac027 100644 --- a/src/main/java/dev/symphony/harmony/mixin/mobs/HuskEntityMixin.java +++ b/src/main/java/dev/symphony/harmony/mixin/mobs/HuskEntityMixin.java @@ -1,6 +1,6 @@ package dev.symphony.harmony.mixin.mobs; -import dev.symphony.harmony.config.HarmonyConfig; +import dev.symphony.harmony.Harmony; import dev.symphony.harmony.loot.HarmonyLootContextTypes; import dev.symphony.harmony.loot.HarmonyLootTables; import net.minecraft.entity.mob.HuskEntity; @@ -35,7 +35,7 @@ public HuskEntityMixin(World world) { @Inject(method = "convertInWater", at = @At("HEAD")) private void dropLootOnConvert(CallbackInfo info) { - if (!HarmonyConfig.husksDropSandOnConvert || !(this.getWorld() instanceof ServerWorld serverWorld)) + if (!Harmony.CONFIG.husksDropSandOnConvert() || !(this.getWorld() instanceof ServerWorld serverWorld)) return; GameRules gameRules = serverWorld.getGameRules(); diff --git a/src/main/java/dev/symphony/harmony/mixin/mobs/mismatched_mob_armor/MobEntityMixin.java b/src/main/java/dev/symphony/harmony/mixin/mobs/mismatched_mob_armor/MobEntityMixin.java index 3df6031..a157432 100644 --- a/src/main/java/dev/symphony/harmony/mixin/mobs/mismatched_mob_armor/MobEntityMixin.java +++ b/src/main/java/dev/symphony/harmony/mixin/mobs/mismatched_mob_armor/MobEntityMixin.java @@ -3,7 +3,7 @@ import com.llamalad7.mixinextras.injector.wrapoperation.Operation; import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation; import com.llamalad7.mixinextras.sugar.Local; -import dev.symphony.harmony.config.HarmonyConfig; +import dev.symphony.harmony.Harmony; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityType; import net.minecraft.entity.EquipmentSlot; @@ -23,7 +23,7 @@ public MobEntityMixin(EntityType type, World world) { @WrapOperation(method = "initEquipment", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/mob/MobEntity;getEquipmentForSlot(Lnet/minecraft/entity/EquipmentSlot;I)Lnet/minecraft/item/Item;")) private Item repeatRandomForEachSlot(EquipmentSlot equipmentSlot, int equipmentLevel, Operation original, @Local(argsOnly = true) Random random) { - if (!HarmonyConfig.mismatchedMobArmor) + if (!Harmony.CONFIG.mismatchedMobArmor()) return original.call(equipmentSlot, equipmentLevel); int level = random.nextInt(2); diff --git a/src/main/java/dev/symphony/harmony/mixin/mobs/permissive_parrot_perching/PlayerEntityMixin.java b/src/main/java/dev/symphony/harmony/mixin/mobs/permissive_parrot_perching/PlayerEntityMixin.java index c30ea24..5736daf 100644 --- a/src/main/java/dev/symphony/harmony/mixin/mobs/permissive_parrot_perching/PlayerEntityMixin.java +++ b/src/main/java/dev/symphony/harmony/mixin/mobs/permissive_parrot_perching/PlayerEntityMixin.java @@ -2,7 +2,7 @@ import com.llamalad7.mixinextras.injector.ModifyExpressionValue; import com.llamalad7.mixinextras.injector.wrapoperation.Operation; -import dev.symphony.harmony.config.HarmonyConfig; +import dev.symphony.harmony.Harmony; import net.minecraft.entity.LivingEntity; import net.minecraft.entity.player.PlayerAbilities; import net.minecraft.entity.player.PlayerEntity; @@ -29,7 +29,7 @@ public abstract class PlayerEntityMixin extends EntityImplMixin { @ModifyExpressionValue(method = "tickMovement", slice = @Slice(from = @At(value = "INVOKE", target = "Lnet/minecraft/entity/player/PlayerEntity;updateShoulderEntity(Lnet/minecraft/nbt/NbtCompound;)V", ordinal = 0)), at = @At(value = "FIELD", target = "Lnet/minecraft/entity/player/PlayerEntity;fallDistance:F")) private float removeFallCheck(float original) { - if (!HarmonyConfig.permissiveParrotPerching) + if (!Harmony.CONFIG.permissiveParrotPerching()) return original; return Integer.MIN_VALUE; diff --git a/src/main/java/dev/symphony/harmony/mixin/mobs/permissive_parrot_perching/SitOnOwnerShoulderGoalMixin.java b/src/main/java/dev/symphony/harmony/mixin/mobs/permissive_parrot_perching/SitOnOwnerShoulderGoalMixin.java index 6487443..677be22 100644 --- a/src/main/java/dev/symphony/harmony/mixin/mobs/permissive_parrot_perching/SitOnOwnerShoulderGoalMixin.java +++ b/src/main/java/dev/symphony/harmony/mixin/mobs/permissive_parrot_perching/SitOnOwnerShoulderGoalMixin.java @@ -2,7 +2,7 @@ import com.llamalad7.mixinextras.injector.ModifyExpressionValue; import com.llamalad7.mixinextras.sugar.Local; -import dev.symphony.harmony.config.HarmonyConfig; +import dev.symphony.harmony.Harmony; import net.minecraft.entity.ai.goal.SitOnOwnerShoulderGoal; import net.minecraft.server.network.ServerPlayerEntity; import org.spongepowered.asm.mixin.Mixin; @@ -13,7 +13,7 @@ public class SitOnOwnerShoulderGoalMixin { @ModifyExpressionValue(method = "canStart", at = @At(value = "FIELD", target = "Lnet/minecraft/entity/player/PlayerAbilities;flying:Z")) private boolean modifyIsFlying(boolean original, @Local ServerPlayerEntity serverPlayerEntity) { - if (!HarmonyConfig.permissiveParrotPerching) + if (!Harmony.CONFIG.permissiveParrotPerching()) return original; return serverPlayerEntity.isGliding(); diff --git a/src/main/java/dev/symphony/harmony/mixin/mobs/wolves_growl_at_monsters/WolfEntityMixin.java b/src/main/java/dev/symphony/harmony/mixin/mobs/wolves_growl_at_monsters/WolfEntityMixin.java index 205a3cf..264687e 100644 --- a/src/main/java/dev/symphony/harmony/mixin/mobs/wolves_growl_at_monsters/WolfEntityMixin.java +++ b/src/main/java/dev/symphony/harmony/mixin/mobs/wolves_growl_at_monsters/WolfEntityMixin.java @@ -1,7 +1,7 @@ package dev.symphony.harmony.mixin.mobs.wolves_growl_at_monsters; import com.llamalad7.mixinextras.injector.ModifyExpressionValue; -import dev.symphony.harmony.config.HarmonyConfig; +import dev.symphony.harmony.Harmony; import net.minecraft.entity.EntityType; import net.minecraft.entity.attribute.EntityAttributes; import net.minecraft.entity.mob.HostileEntity; @@ -23,7 +23,7 @@ protected WolfEntityMixin(EntityType entityType, World @ModifyExpressionValue(method = "getAmbientSound", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/passive/WolfEntity;hasAngerTime()Z")) private boolean shouldGrowl(boolean original) { - return original || (HarmonyConfig.wolvesGrowlAtMonsters && this.isTamed() && !this.getNearbyMonsters().isEmpty()); + return original || (Harmony.CONFIG.wolvesGrowlAtMonsters() && this.isTamed() && !this.getNearbyMonsters().isEmpty()); } @Unique diff --git a/src/main/java/dev/symphony/harmony/mixin/potions/BeaconBlockEntityMixin.java b/src/main/java/dev/symphony/harmony/mixin/potions/BeaconBlockEntityMixin.java index c9434b8..eb4eabf 100644 --- a/src/main/java/dev/symphony/harmony/mixin/potions/BeaconBlockEntityMixin.java +++ b/src/main/java/dev/symphony/harmony/mixin/potions/BeaconBlockEntityMixin.java @@ -1,7 +1,7 @@ package dev.symphony.harmony.mixin.potions; import com.llamalad7.mixinextras.sugar.Local; -import dev.symphony.harmony.config.HarmonyConfig; +import dev.symphony.harmony.Harmony; import net.minecraft.block.entity.BeaconBlockEntity; import net.minecraft.entity.effect.StatusEffect; import net.minecraft.entity.effect.StatusEffectInstance; @@ -28,7 +28,7 @@ public class BeaconBlockEntityMixin { private static void applyTamedEntityEffects(World world, BlockPos pos, int beaconLevel, @Nullable RegistryEntry primaryEffect, @Nullable RegistryEntry secondaryEffect, CallbackInfo ci, @Local Box box, @Local(ordinal = 1) int amplifier, @Local(ordinal = 2) int duration ) { - if (!HarmonyConfig.beaconsAffectTamedMobs) + if (!Harmony.CONFIG.beaconsAffectTamedMobs()) return; List tameableEntities = world.getEntitiesByClass(TameableEntity.class, box, TameableEntity::isTamed); diff --git a/src/main/java/dev/symphony/harmony/mixin/redstone/OneTickCopperBulbDelay.java b/src/main/java/dev/symphony/harmony/mixin/redstone/OneTickCopperBulbDelay.java index d763793..6546d74 100644 --- a/src/main/java/dev/symphony/harmony/mixin/redstone/OneTickCopperBulbDelay.java +++ b/src/main/java/dev/symphony/harmony/mixin/redstone/OneTickCopperBulbDelay.java @@ -2,7 +2,7 @@ import com.llamalad7.mixinextras.injector.wrapoperation.Operation; import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation; -import dev.symphony.harmony.config.HarmonyConfig; +import dev.symphony.harmony.Harmony; import net.minecraft.block.BlockState; import net.minecraft.block.BulbBlock; import net.minecraft.server.world.ServerWorld; @@ -22,7 +22,7 @@ public class OneTickCopperBulbDelay extends AbstractBlockImplMixin { //Replaced calling update with calling scheduleBlockTick @WrapOperation(method = "neighborUpdate",at = @At(value = "INVOKE", target = "Lnet/minecraft/block/BulbBlock;update(Lnet/minecraft/block/BlockState;Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/util/math/BlockPos;)V")) protected void addDelay(BulbBlock instance, BlockState state, ServerWorld world, BlockPos pos, Operation original) { - if(!HarmonyConfig.oneTickCopperBulbDelay) { + if(!Harmony.CONFIG.oneTickCopperBulbDelay()) { original.call(instance, state, world, pos); return; } diff --git a/src/main/java/dev/symphony/harmony/mixin/redstone/RemoveRedstoneLampDelay.java b/src/main/java/dev/symphony/harmony/mixin/redstone/RemoveRedstoneLampDelay.java index c0f68a1..42224e6 100644 --- a/src/main/java/dev/symphony/harmony/mixin/redstone/RemoveRedstoneLampDelay.java +++ b/src/main/java/dev/symphony/harmony/mixin/redstone/RemoveRedstoneLampDelay.java @@ -2,7 +2,7 @@ import com.llamalad7.mixinextras.injector.wrapoperation.Operation; import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation; -import dev.symphony.harmony.config.HarmonyConfig; +import dev.symphony.harmony.Harmony; import net.minecraft.block.Block; import net.minecraft.block.RedstoneLampBlock; import net.minecraft.server.world.ServerWorld; @@ -22,7 +22,7 @@ public class RemoveRedstoneLampDelay extends Block { //Replaced calling scheduleBlockTick with calling scheduledTick @WrapOperation(method = "neighborUpdate",at = @At(value = "INVOKE", target = "Lnet/minecraft/world/World;scheduleBlockTick(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/Block;I)V")) protected void addDelay(World instance, BlockPos blockPos, Block block, int i, Operation original) { - if(!HarmonyConfig.removeRedstoneLampDelay) { + if(!Harmony.CONFIG.removeRedstoneLampDelay()) { original.call(instance, blockPos, block, i); return; } diff --git a/src/main/java/dev/symphony/harmony/mixin/transportation/EnderPearlsDontDismount.java b/src/main/java/dev/symphony/harmony/mixin/transportation/EnderPearlsDontDismount.java index a8c4bf9..662e411 100644 --- a/src/main/java/dev/symphony/harmony/mixin/transportation/EnderPearlsDontDismount.java +++ b/src/main/java/dev/symphony/harmony/mixin/transportation/EnderPearlsDontDismount.java @@ -2,7 +2,7 @@ import com.llamalad7.mixinextras.injector.wrapoperation.Operation; import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation; -import dev.symphony.harmony.config.HarmonyConfig; +import dev.symphony.harmony.Harmony; import net.minecraft.entity.Entity; import net.minecraft.entity.damage.DamageSource; import net.minecraft.entity.projectile.thrown.EnderPearlEntity; @@ -21,7 +21,7 @@ public class EnderPearlsDontDismount { @WrapOperation(method = "onCollision",at= @At(value = "INVOKE", target = "Lnet/minecraft/server/network/ServerPlayerEntity;teleportTo(Lnet/minecraft/world/TeleportTarget;)Lnet/minecraft/server/network/ServerPlayerEntity;")) ServerPlayerEntity TeleportMount(ServerPlayerEntity instance, TeleportTarget teleportTarget, Operation original){ - if(instance.hasVehicle() && HarmonyConfig.enderPearlsTeleportVehicles){ + if(instance.hasVehicle() && Harmony.CONFIG.enderPearlsTeleportVehicles()){ //Find the mount that isnt riding any other mount and teleport it instead of the player Entity vehicle = instance.getVehicle(); while(vehicle.hasVehicle()) { @@ -35,7 +35,7 @@ ServerPlayerEntity TeleportMount(ServerPlayerEntity instance, TeleportTarget tel @WrapOperation(method = "onCollision",at= @At(value = "INVOKE", target = "Lnet/minecraft/server/network/ServerPlayerEntity;damage(Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/entity/damage/DamageSource;F)Z")) boolean DamageAfterTeleportation(ServerPlayerEntity instance, ServerWorld world, DamageSource source, float amount, Operation original){ - if(instance.hasVehicle() && HarmonyConfig.enderPearlsDamageVehicles && HarmonyConfig.enderPearlsTeleportVehicles) { + if(instance.hasVehicle() && Harmony.CONFIG.enderPearlsDamageVehicles() && Harmony.CONFIG.enderPearlsTeleportVehicles()) { //The damage each entity takes from teleporting is halved to be consistent with horses taking fall damage amount /= 2; //Find the mount that isnt riding any other mount @@ -56,6 +56,6 @@ boolean DamageAfterTeleportation(ServerPlayerEntity instance, ServerWorld world, //Stop the player from leaving their vehicle when using an Ender Pearl @WrapOperation(method = "onCollision",at= @At(value = "INVOKE", target = "Lnet/minecraft/entity/Entity;detach()V")) - void StopDetaching(Entity instance, Operation original){if(!HarmonyConfig.enderPearlsTeleportVehicles) {original.call(instance);}} + void StopDetaching(Entity instance, Operation original){if(!Harmony.CONFIG.enderPearlsTeleportVehicles()) {original.call(instance);}} } diff --git a/src/main/java/dev/symphony/harmony/mixin/transportation/ExitVehicleOnDamage.java b/src/main/java/dev/symphony/harmony/mixin/transportation/ExitVehicleOnDamage.java index a24319f..b6196bb 100644 --- a/src/main/java/dev/symphony/harmony/mixin/transportation/ExitVehicleOnDamage.java +++ b/src/main/java/dev/symphony/harmony/mixin/transportation/ExitVehicleOnDamage.java @@ -1,6 +1,6 @@ package dev.symphony.harmony.mixin.transportation; -import dev.symphony.harmony.config.HarmonyConfig; +import dev.symphony.harmony.Harmony; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityType; import net.minecraft.entity.LivingEntity; @@ -29,7 +29,7 @@ public ExitVehicleOnDamage(EntityType type, World world) { at = @At( value = "TAIL" ) ) private void exitVehicleOnDamage(ServerWorld world, DamageSource source, float amount, CallbackInfoReturnable cir) { - if(HarmonyConfig.exitVehicleOnDamage) { + if(Harmony.CONFIG.exitVehicleOnDamage()) { if (amount <= 0) return; if (this.isPlayer()) return; if (source == getDamageSources().enderPearl()) return; diff --git a/src/main/java/dev/symphony/harmony/mixin/transportation/HorseArmorPreventsBucking.java b/src/main/java/dev/symphony/harmony/mixin/transportation/HorseArmorPreventsBucking.java index 6af39da..f430243 100644 --- a/src/main/java/dev/symphony/harmony/mixin/transportation/HorseArmorPreventsBucking.java +++ b/src/main/java/dev/symphony/harmony/mixin/transportation/HorseArmorPreventsBucking.java @@ -1,7 +1,7 @@ package dev.symphony.harmony.mixin.transportation; import com.llamalad7.mixinextras.injector.ModifyExpressionValue; -import dev.symphony.harmony.config.HarmonyConfig; +import dev.symphony.harmony.Harmony; import it.unimi.dsi.fastutil.objects.Object2FloatArrayMap; import net.fabricmc.loader.api.FabricLoader; import net.minecraft.entity.passive.AbstractHorseEntity; @@ -40,7 +40,7 @@ public HorseArmorPreventsBucking(Inventory armorinventory) { @ModifyExpressionValue(method = "updateAnger", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/passive/AbstractHorseEntity;shouldAmbientStand()Z")) private boolean rejectAngryWhenDrip(boolean original) { - if(HarmonyConfig.horseArmorPreventsBucking){ + if(Harmony.CONFIG.horseArmorPreventsBucking()){ if(FabricLoader.getInstance().isModLoaded("melody") && preventBuckingChance.get(Registries.ITEM.get(Identifier.of("melody:netherite_horse_armor"))) == null) { // Temporary solution until we move this to a better, configurable system // This is inside rejectAngryWhenDrip because if not it gets called too early, so it cant detect Melody nor is the armor item registered yet, so it doesnt work. diff --git a/src/main/java/dev/symphony/harmony/mixin/transportation/elytra/LivingEntityMixin.java b/src/main/java/dev/symphony/harmony/mixin/transportation/elytra/LivingEntityMixin.java index 8197442..afa0bc5 100644 --- a/src/main/java/dev/symphony/harmony/mixin/transportation/elytra/LivingEntityMixin.java +++ b/src/main/java/dev/symphony/harmony/mixin/transportation/elytra/LivingEntityMixin.java @@ -1,7 +1,7 @@ package dev.symphony.harmony.mixin.transportation.elytra; import com.llamalad7.mixinextras.injector.ModifyExpressionValue; -import dev.symphony.harmony.config.HarmonyConfig; +import dev.symphony.harmony.Harmony; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityType; import net.minecraft.entity.LivingEntity; @@ -22,7 +22,7 @@ public LivingEntityMixin(EntityType type, World world) { */ @ModifyExpressionValue(method = "canGlide", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/LivingEntity;hasStatusEffect(Lnet/minecraft/registry/entry/RegistryEntry;)Z")) private boolean cancelElytraInLiquid(boolean original) { - if(HarmonyConfig.liquidsDeactivateElytra){ + if(Harmony.CONFIG.liquidsDeactivateElytra()){ if (original || this.isSubmergedInWater() || this.isInLava()) { setSprinting(true); return true; diff --git a/src/main/java/dev/symphony/harmony/mixin/transportation/riptide/LivingEntityMixin.java b/src/main/java/dev/symphony/harmony/mixin/transportation/riptide/LivingEntityMixin.java index 8fc8895..7f4446c 100644 --- a/src/main/java/dev/symphony/harmony/mixin/transportation/riptide/LivingEntityMixin.java +++ b/src/main/java/dev/symphony/harmony/mixin/transportation/riptide/LivingEntityMixin.java @@ -1,7 +1,7 @@ package dev.symphony.harmony.mixin.transportation.riptide; import com.llamalad7.mixinextras.injector.ModifyExpressionValue; -import dev.symphony.harmony.config.HarmonyConfig; +import dev.symphony.harmony.Harmony; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityType; import net.minecraft.entity.LivingEntity; @@ -23,7 +23,7 @@ public abstract class LivingEntityMixin extends Entity { */ @SuppressWarnings("JavadocDeclaration") @Unique - private static final float MODIFIER = HarmonyConfig.riptideAccelerationOnWater; + private static final float MODIFIER = Harmony.CONFIG.riptideAccelerationOnWater(); @Unique private static final float DEG = (float) (Math.PI / 180F); @@ -44,7 +44,7 @@ public LivingEntityMixin(EntityType type, World world) { ) ) private void accelerateWhenRiptide(CallbackInfo ci) { - if(HarmonyConfig.riptideAccelerationOnWater != 0){ + if(Harmony.CONFIG.riptideAccelerationOnWater() != 0){ if (!this.isTouchingWater()) return; float f = getYaw(); float g = getPitch(); @@ -72,7 +72,7 @@ private void accelerateWhenRiptide(CallbackInfo ci) { ) ) private boolean boostWhenRiptide(boolean original) { - if(HarmonyConfig.reduceRiptideWaterDrag){ + if(Harmony.CONFIG.reduceRiptideWaterDrag()){ return original || this.riptideTicks>0; } return original; diff --git a/src/main/java/dev/symphony/harmony/mixin/transportation/riptide/TridentItemMixin.java b/src/main/java/dev/symphony/harmony/mixin/transportation/riptide/TridentItemMixin.java index a92e7ed..2c5c771 100644 --- a/src/main/java/dev/symphony/harmony/mixin/transportation/riptide/TridentItemMixin.java +++ b/src/main/java/dev/symphony/harmony/mixin/transportation/riptide/TridentItemMixin.java @@ -1,7 +1,7 @@ package dev.symphony.harmony.mixin.transportation.riptide; import com.llamalad7.mixinextras.sugar.Local; -import dev.symphony.harmony.config.HarmonyConfig; +import dev.symphony.harmony.Harmony; import net.minecraft.enchantment.Enchantment; import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.entity.LivingEntity; @@ -11,7 +11,6 @@ import net.minecraft.item.TridentItem; import net.minecraft.item.consume.UseAction; import net.minecraft.registry.entry.RegistryEntry; -import net.minecraft.util.Hand; import net.minecraft.util.Identifier; import net.minecraft.world.World; import org.spongepowered.asm.mixin.Mixin; @@ -40,13 +39,13 @@ public TridentItemMixin(net.minecraft.item.Item.Settings settings) { @ModifyArg(method = "onStoppedUsing", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/player/PlayerEntity;useRiptide(IFLnet/minecraft/item/ItemStack;)V"), index = 0) private int modifyRiptideTicks(int riptideTicks, @Local(argsOnly = true) ItemStack stack) { - if(HarmonyConfig.riptideTimeMultiplier!=0){ + if(Harmony.CONFIG.riptideTimeMultiplier()!=0){ RegistryEntry entry = stack.getEnchantments().getEnchantments().stream() .filter(act -> act.matchesId(Identifier.ofVanilla("riptide"))) .findFirst() .orElse(null); int level = EnchantmentHelper.getLevel(entry, stack); - return 15 + level*HarmonyConfig.riptideTimeMultiplier; + return 15 + level* Harmony.CONFIG.riptideTimeMultiplier(); } return riptideTicks; } @@ -60,7 +59,7 @@ private int modifyRiptideTicks(int riptideTicks, @Local(argsOnly = true) ItemSta // Adds a cooldown to tridents with riptide of the length of the riptide effect, to avoid acceleration stacking @Inject(method = "onStoppedUsing", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/player/PlayerEntity;useRiptide(IFLnet/minecraft/item/ItemStack;)V")) public void addCooldown(ItemStack stack, World world, LivingEntity user, int remainingUseTicks, CallbackInfoReturnable cir) { - if(HarmonyConfig.riptideCooldown){ + if(Harmony.CONFIG.riptideCooldown()){ RegistryEntry entry = stack.getEnchantments().getEnchantments().stream() .filter(act -> act.matchesId(Identifier.ofVanilla("riptide"))) .findFirst() @@ -68,14 +67,14 @@ public void addCooldown(ItemStack stack, World world, LivingEntity user, int rem int level = EnchantmentHelper.getLevel(entry, stack); if(user instanceof PlayerEntity && level > 0){ - ((PlayerEntity) user).getItemCooldownManager().set(this.getDefaultStack(), 15+level*HarmonyConfig.riptideTimeMultiplier); + ((PlayerEntity) user).getItemCooldownManager().set(this.getDefaultStack(), 15+level* Harmony.CONFIG.riptideTimeMultiplier()); } } } - @Override - public boolean allowComponentsUpdateAnimation(PlayerEntity player, Hand hand, ItemStack oldStack, ItemStack newStack) { - return super.allowComponentsUpdateAnimation(player, hand, oldStack, newStack); - } +// @Override +// public boolean allowComponentsUpdateAnimation(PlayerEntity player, Hand hand, ItemStack oldStack, ItemStack newStack) { +// return super.allowComponentsUpdateAnimation(player, hand, oldStack, newStack); +// } } diff --git a/src/main/resources/assets/harmony/lang/en_us.json b/src/main/resources/assets/harmony/lang/en_us.json index 106810b..8a961ab 100644 --- a/src/main/resources/assets/harmony/lang/en_us.json +++ b/src/main/resources/assets/harmony/lang/en_us.json @@ -1,55 +1,55 @@ { "symphony.feature_tracker": "Feature Tracker", - "harmony.midnightconfig.title": "Harmony Config", - "harmony.midnightconfig.reloadWarning": "Some config options will require a game restart to take affect!", - "harmony.midnightconfig.category.harmony": "Harmony", - - "harmony.midnightconfig.category.transportation": "Transportation", - "harmony.midnightconfig.liquidsDeactivateElytra": "Flying through liquids deactivates the Elytra", - "harmony.midnightconfig.liquidsDeactivateElytra.tooltip": "(Isn't affected by rain) \nWhen getting into the water, you will automatically get in swim mode", - "harmony.midnightconfig.exitVehicleOnDamage": "Mobs exit vehicles when taking damage", - "harmony.midnightconfig.saddleRecipe": "Craftable Saddle", - "harmony.midnightconfig.horseArmorPreventsBucking": "Horse armor decreases bucking chance on damage", - "harmony.midnightconfig.horseArmorPreventsBucking.tooltip": "Horse armor has a chance from preventing the horse from bucking, depending of material: \n \n-Leather: 45% \n-Gold: 60% \n-Iron: 75% \n-Diamond: 90% \n-Netherite (Melody Integration): 100% ", - "harmony.midnightconfig.enderPearlsTeleportVehicles": "Ender Pearls teleport the entity the player is riding", - "harmony.midnightconfig.enderPearlsDamageVehicles": "Ender Pearls damage mounts when teleporting", - "harmony.midnightconfig.enderPearlsDamageVehicles.tooltip": "All entities teleported(passengers and mounts) using an Ender Pearl receive half of the damage the player normally would", - "harmony.midnightconfig.riptideAccelerationOnWater": "Riptide acceleration on water", - "harmony.midnightconfig.riptideCooldown": "Tridents with riptide have cooldown", - "harmony.midnightconfig.riptideCooldown.tooltip": "Tridents with riptide cant be used until riptide animation has finished. \nThis prevents the player from accumulating acceleration when using the \"Riptide Acceleration on Water\" feature.", - "harmony.midnightconfig.riptideTimeMultiplier": "Riptide effect time multiplier", - "harmony.midnightconfig.riptideTimeMultiplier.tooltip": "Increases the time for the riptide animation, during which you will gain acceleration as long as the \"Riptide Acceleration on water\" feature is enabled. \n\nThe time is calculated the following way: 15+level*multiplier \n\nSet it to 0 to disable the feature.", - "harmony.midnightconfig.reduceRiptideWaterDrag": "Reduce water drag while using a Trident with Riptide", - - "harmony.midnightconfig.category.food": "Food", - "harmony.midnightconfig.stewStackSize": "Stew/soup stack size", - "harmony.midnightconfig.glowBerryEffect":"Glowberry effect", - "harmony.midnightconfig.glowBerryEffect.tooltip":"How long the effect should last in seconds, 0 disables it", - - "harmony.midnightconfig.category.building": "Building", - "harmony.midnightconfig.armorStandStickArms": "Armor Stands can be equipped with arms using a Stick", - "harmony.midnightconfig.armorStandStickArms.tooltip": "Arms can be removed with shears", - "harmony.midnightconfig.armorStandSticks": "Number of sticks required to equip Armor Stands with arms", - - "harmony.midnightconfig.category.redstone": "Redstone", - "harmony.midnightconfig.oneTickCopperBulbDelay": "Copper Bulbs have a 1 tick delay", - "harmony.midnightconfig.removeRedstoneLampDelay": "Removes the 4 tick delay for redstone lamps to turn off", + "text.config.harmony.title": "Harmony Config", + + "text.config.harmony.section.Transportation": "Transportation", + "text.config.harmony.option.liquidsDeactivateElytra": "Flying through liquids deactivates the Elytra", + "text.config.harmony.option.liquidsDeactivateElytra.tooltip": "(Isn't affected by rain) \nWhen getting into the water, you will automatically get in swim mode", + "text.config.harmony.option.exitVehicleOnDamage": "Mobs exit vehicles when taking damage", + "text.config.harmony.option.saddleRecipe": "Craftable Saddle", + "text.config.harmony.option.horseArmorPreventsBucking": "Horse armor decreases bucking chance on damage", + "text.config.harmony.option.horseArmorPreventsBucking.tooltip": "Horse armor has a chance from preventing the horse from bucking, depending of material: \n \n-Leather: 45% \n-Gold: 60% \n-Iron: 75% \n-Diamond: 90% \n-Netherite (Melody Integration): 100% ", + "text.config.harmony.option.enderPearlsTeleportVehicles": "Ender Pearls teleport the entity the player is riding", + "text.config.harmony.option.enderPearlsDamageVehicles": "Ender Pearls damage mounts when teleporting", + "text.config.harmony.option.enderPearlsDamageVehicles.tooltip": "All entities teleported(passengers and mounts) using an Ender Pearl receive half of the damage the player normally would", + "text.config.harmony.option.riptideAccelerationOnWater": "Riptide acceleration on water", + "text.config.harmony.option.riptideCooldown": "Tridents with riptide have cooldown", + "text.config.harmony.option.riptideCooldown.tooltip": "Tridents with riptide cant be used until riptide animation has finished. \nThis prevents the player from accumulating acceleration when using the \"Riptide Acceleration on Water\" feature.", + "text.config.harmony.option.riptideTimeMultiplier": "Riptide effect time multiplier", + "text.config.harmony.option.riptideTimeMultiplier.tooltip": "Increases the time for the riptide animation, during which you will gain acceleration as long as the \"Riptide Acceleration on water\" feature is enabled. \n\nThe time is calculated the following way: 15+level*multiplier \n\nSet it to 0 to disable the feature.", + "text.config.harmony.option.reduceRiptideWaterDrag": "Reduce water drag while using a Trident with Riptide", + + "text.config.harmony.section.Food": "Food", + "text.config.harmony.option.stewStackSize": "Stew/soup stack size", + "text.config.harmony.option.glowBerryEffect":"Glowberry effect", + "text.config.harmony.option.glowBerryEffect.tooltip":"How long the effect should last in seconds, 0 disables it", + + "text.config.harmony.section.Building": "Building", + "text.config.harmony.option.armorStandStickArms": "Armor Stands can be equipped with arms using a Stick", + "text.config.harmony.option.armorStandStickArms.tooltip": "Arms can be removed with shears", + "text.config.harmony.option.armorStandSticks": "Number of sticks required to equip Armor Stands with arms", + + "text.config.harmony.section.Redstone": "Redstone", + "text.config.harmony.option.oneTickCopperBulbDelay": "Copper Bulbs have a 1 tick delay", + "text.config.harmony.option.removeRedstoneLampDelay": "Removes the 4 tick delay for redstone lamps to turn off", - "harmony.midnightconfig.category.potions": "Potions", - "harmony.midnightconfig.beaconsAffectTamedMobs": "Beacon effects apply to tamed animals as well as players.", - - "harmony.midnightconfig.category.combat": "Combat", - "harmony.midnightconfig.tridentsReturnFromVoid": "Tridents with Loyalty return from the void", - "harmony.midnightconfig.changeItemDespawnTime": "Change items despawn time depending on difficulty", - "harmony.midnightconfig.itemDespawnTimeEasy": "Time for dropped items to despawn in easy/peaceful.", - "harmony.midnightconfig.itemDespawnTimeNormal": "Time for dropped items to despawn in normal.", - "harmony.midnightconfig.itemDespawnTimeHard": "Time for dropped items to despawn in hard.", - - "harmony.midnightconfig.category.mobs": "Mobs", - "harmony.midnightconfig.wolvesGrowlAtMonsters": "Tamed wolves growl at nearby monsters.", - "harmony.midnightconfig.permissiveParrotPerching": "Parrots dismount under fewer restrictions.", - "harmony.midnightconfig.permissiveParrotPerching.tooltip": "Sneak and unsneak quickly for your parrot to fly off of you.", - "harmony.midnightconfig.mismatchedMobArmor": "Mobs can spawn with mismatched armor materials.", - "harmony.midnightconfig.husksDropSandOnConvert": "Husks drop sand when converting into zombies." + "text.config.harmony.section.Potions": "Potions", + "text.config.harmony.option.beaconsAffectTamedMobs": "Beacon effects apply to tamed animals as well as players.", + + "text.config.harmony.section.Combat": "Combat", + "text.config.harmony.option.tridentsReturnFromVoid": "Tridents with Loyalty return from the void", + "text.config.harmony.option.changeItemDespawnTime": "Change items despawn time depending on difficulty", + "text.config.harmony.option.itemDespawnTimeEasy": "Time for dropped items to despawn in easy/peaceful.", + "text.config.harmony.option.itemDespawnTimeNormal": "Time for dropped items to despawn in normal.", + "text.config.harmony.option.itemDespawnTimeHard": "Time for dropped items to despawn in hard.", + + "text.config.harmony.section.Mobs": "Mobs", + "text.config.harmony.option.wolvesGrowlAtMonsters": "Tamed wolves growl at nearby monsters.", + "text.config.harmony.option.permissiveParrotPerching": "Parrots dismount under fewer restrictions.", + "text.config.harmony.option.permissiveParrotPerching.tooltip": "Sneak and unsneak quickly for your parrot to fly off of you.", + "text.config.harmony.option.mismatchedMobArmor": "Mobs can spawn with mismatched armor materials.", + "text.config.harmony.option.husksDropSandOnConvert": "Husks drop sand when converting into zombies." + + } From e55149aad73b451553950f325149d2e7b29e770a Mon Sep 17 00:00:00 2001 From: Flatkat <87091676+Flatkat@users.noreply.github.com> Date: Wed, 22 Jan 2025 22:36:21 +0100 Subject: [PATCH 2/7] Resolving more merging conflicts Between owo-lib branch and main after having javadoc credits merged --- .../dev/symphony/harmony/config/HarmonyConfigModel.java | 2 ++ src/main/java/dev/symphony/harmony/item/ModifyItems.java | 2 +- .../copper_bulb_delay/OneTickCopperBulbDelay.java | 4 ++-- .../FurnaceMinecartEntityMixin.java | 6 +++--- .../EnderPearlsDontDismount.java | 8 ++++---- .../riptide_accceleration/RiptideAcceleration.java | 6 +++--- .../trident/riptide_cooldown/RiptideCooldown.java | 6 +++--- .../trident/riptide_reduced_drag/RiptideReducedDrag.java | 4 ++-- .../VariableRiptideDuration.java | 6 +++--- src/main/resources/harmony.mixins.json | 9 +++++---- 10 files changed, 28 insertions(+), 25 deletions(-) diff --git a/src/main/java/dev/symphony/harmony/config/HarmonyConfigModel.java b/src/main/java/dev/symphony/harmony/config/HarmonyConfigModel.java index 3f66dfc..7d60c08 100644 --- a/src/main/java/dev/symphony/harmony/config/HarmonyConfigModel.java +++ b/src/main/java/dev/symphony/harmony/config/HarmonyConfigModel.java @@ -22,6 +22,8 @@ public class HarmonyConfigModel { public boolean horseArmorPreventsBucking = true; public boolean enderPearlsTeleportVehicles = true; public boolean enderPearlsDamageVehicles = true; + public float furnaceMinecartSpeed = 1f; + public float furnaceMinecartSpeedInWater = 1f; @RangeConstraint(min = 0f, max = 1f) public float riptideAccelerationOnWater = 0.1f; public boolean riptideCooldown = true; diff --git a/src/main/java/dev/symphony/harmony/item/ModifyItems.java b/src/main/java/dev/symphony/harmony/item/ModifyItems.java index 6d059b0..76bf893 100644 --- a/src/main/java/dev/symphony/harmony/item/ModifyItems.java +++ b/src/main/java/dev/symphony/harmony/item/ModifyItems.java @@ -14,7 +14,7 @@ public static void init() { * @author Trigam */ - if (HarmonyConfig.stewStackSize != 1) { + if (Harmony.CONFIG.stewStackSize() != 1) { DefaultItemComponentEvents.MODIFY.register(context -> { // Ok so, can't use an item tag since tags only exist // on world load, while this is run on mod init diff --git a/src/main/java/dev/symphony/harmony/mixin/redstone/copper_bulb_delay/OneTickCopperBulbDelay.java b/src/main/java/dev/symphony/harmony/mixin/redstone/copper_bulb_delay/OneTickCopperBulbDelay.java index ffc1d3d..0cfcfe7 100644 --- a/src/main/java/dev/symphony/harmony/mixin/redstone/copper_bulb_delay/OneTickCopperBulbDelay.java +++ b/src/main/java/dev/symphony/harmony/mixin/redstone/copper_bulb_delay/OneTickCopperBulbDelay.java @@ -2,7 +2,7 @@ import com.llamalad7.mixinextras.injector.wrapoperation.Operation; import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation; -import dev.symphony.harmony.config.HarmonyConfig; +import dev.symphony.harmony.Harmony; import dev.symphony.harmony.mixin.redstone.AbstractBlockImplMixin; import net.minecraft.block.BlockState; import net.minecraft.block.BulbBlock; @@ -21,7 +21,7 @@ public class OneTickCopperBulbDelay extends AbstractBlockImplMixin { //Replaced calling update with calling scheduleBlockTick @WrapOperation(method = "neighborUpdate",at = @At(value = "INVOKE", target = "Lnet/minecraft/block/BulbBlock;update(Lnet/minecraft/block/BlockState;Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/util/math/BlockPos;)V")) protected void addDelay(BulbBlock instance, BlockState state, ServerWorld world, BlockPos pos, Operation original) { - if(!HarmonyConfig.oneTickCopperBulbDelay) { + if(!Harmony.CONFIG.oneTickCopperBulbDelay()) { original.call(instance, state, world, pos); return; } diff --git a/src/main/java/dev/symphony/harmony/mixin/transportation/minecart/customizable_furnace_minecart_speed/FurnaceMinecartEntityMixin.java b/src/main/java/dev/symphony/harmony/mixin/transportation/minecart/customizable_furnace_minecart_speed/FurnaceMinecartEntityMixin.java index 7032826..1972ba5 100644 --- a/src/main/java/dev/symphony/harmony/mixin/transportation/minecart/customizable_furnace_minecart_speed/FurnaceMinecartEntityMixin.java +++ b/src/main/java/dev/symphony/harmony/mixin/transportation/minecart/customizable_furnace_minecart_speed/FurnaceMinecartEntityMixin.java @@ -1,6 +1,6 @@ package dev.symphony.harmony.mixin.transportation.minecart.customizable_furnace_minecart_speed; -import dev.symphony.harmony.config.HarmonyConfig; +import dev.symphony.harmony.Harmony; import net.minecraft.entity.EntityType; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.vehicle.AbstractMinecartEntity; @@ -30,9 +30,9 @@ public class FurnaceMinecartEntityMixin extends AbstractMinecartEntity { @Inject(method = "getMaxSpeed",at= @At("RETURN"), cancellable = true) void ChangeFurnaceMinecartSpeed(ServerWorld world, CallbackInfoReturnable cir){ if(super.isTouchingWater()) - cir.setReturnValue(super.getMaxSpeed(world) * HarmonyConfig.furnaceMinecartSpeedInWater); + cir.setReturnValue(super.getMaxSpeed(world) * Harmony.CONFIG.furnaceMinecartSpeedInWater()); else - cir.setReturnValue(super.getMaxSpeed(world) * HarmonyConfig.furnaceMinecartSpeed); + cir.setReturnValue(super.getMaxSpeed(world) * Harmony.CONFIG.furnaceMinecartSpeed()); } @Inject(method = "interact",at= @At(value = "HEAD"), cancellable = true) diff --git a/src/main/java/dev/symphony/harmony/mixin/transportation/teleport/ender_pearls_dont_dismount/EnderPearlsDontDismount.java b/src/main/java/dev/symphony/harmony/mixin/transportation/teleport/ender_pearls_dont_dismount/EnderPearlsDontDismount.java index 7115974..06799a7 100644 --- a/src/main/java/dev/symphony/harmony/mixin/transportation/teleport/ender_pearls_dont_dismount/EnderPearlsDontDismount.java +++ b/src/main/java/dev/symphony/harmony/mixin/transportation/teleport/ender_pearls_dont_dismount/EnderPearlsDontDismount.java @@ -2,7 +2,7 @@ import com.llamalad7.mixinextras.injector.wrapoperation.Operation; import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation; -import dev.symphony.harmony.config.HarmonyConfig; +import dev.symphony.harmony.Harmony; import net.minecraft.entity.Entity; import net.minecraft.entity.damage.DamageSource; import net.minecraft.entity.projectile.thrown.EnderPearlEntity; @@ -17,7 +17,7 @@ public class EnderPearlsDontDismount { @WrapOperation(method = "onCollision",at= @At(value = "INVOKE", target = "Lnet/minecraft/server/network/ServerPlayerEntity;teleportTo(Lnet/minecraft/world/TeleportTarget;)Lnet/minecraft/server/network/ServerPlayerEntity;")) ServerPlayerEntity TeleportMount(ServerPlayerEntity instance, TeleportTarget teleportTarget, Operation original){ - if(instance.hasVehicle() && HarmonyConfig.enderPearlsTeleportVehicles){ + if(instance.hasVehicle() && Harmony.CONFIG.enderPearlsTeleportVehicles()){ // Find the mount that isn't riding any other mount and teleport it instead of the player Entity vehicle = instance.getVehicle(); while(vehicle.hasVehicle()) { @@ -31,7 +31,7 @@ ServerPlayerEntity TeleportMount(ServerPlayerEntity instance, TeleportTarget tel @WrapOperation(method = "onCollision",at= @At(value = "INVOKE", target = "Lnet/minecraft/server/network/ServerPlayerEntity;damage(Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/entity/damage/DamageSource;F)Z")) boolean DamageAfterTeleportation(ServerPlayerEntity instance, ServerWorld world, DamageSource source, float amount, Operation original){ - if(instance.hasVehicle() && HarmonyConfig.enderPearlsDamageVehicles && HarmonyConfig.enderPearlsTeleportVehicles) { + if(instance.hasVehicle() && Harmony.CONFIG.enderPearlsDamageVehicles() && Harmony.CONFIG.enderPearlsTeleportVehicles()) { //The damage each entity takes from teleporting is halved to be consistent with horses taking fall damage amount /= 2; //Find the mount that isn't riding any other mount @@ -52,6 +52,6 @@ boolean DamageAfterTeleportation(ServerPlayerEntity instance, ServerWorld world, //Stop the player from leaving their vehicle when using an Ender Pearl @WrapOperation(method = "onCollision",at= @At(value = "INVOKE", target = "Lnet/minecraft/entity/Entity;detach()V")) - void StopDetaching(Entity instance, Operation original){if(!HarmonyConfig.enderPearlsTeleportVehicles) {original.call(instance);}} + void StopDetaching(Entity instance, Operation original){if(!Harmony.CONFIG.enderPearlsTeleportVehicles()) {original.call(instance);}} } diff --git a/src/main/java/dev/symphony/harmony/mixin/transportation/trident/riptide_accceleration/RiptideAcceleration.java b/src/main/java/dev/symphony/harmony/mixin/transportation/trident/riptide_accceleration/RiptideAcceleration.java index 0070f9d..d2e43fd 100644 --- a/src/main/java/dev/symphony/harmony/mixin/transportation/trident/riptide_accceleration/RiptideAcceleration.java +++ b/src/main/java/dev/symphony/harmony/mixin/transportation/trident/riptide_accceleration/RiptideAcceleration.java @@ -1,6 +1,6 @@ package dev.symphony.harmony.mixin.transportation.trident.riptide_accceleration; -import dev.symphony.harmony.config.HarmonyConfig; +import dev.symphony.harmony.Harmony; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityType; import net.minecraft.entity.LivingEntity; @@ -16,7 +16,7 @@ @Mixin(LivingEntity.class) public abstract class RiptideAcceleration extends Entity { - @Unique private static final float MODIFIER = HarmonyConfig.riptideAccelerationOnWater; + @Unique private static final float MODIFIER = Harmony.CONFIG.riptideAccelerationOnWater(); @Unique private static final float DEG = (float) (Math.PI / 180F); @Shadow public abstract void setSprinting(boolean sprinting); @@ -34,7 +34,7 @@ public RiptideAcceleration(EntityType type, World world) { ) ) private void accelerateWhenRiptide(CallbackInfo ci) { - if (HarmonyConfig.riptideAccelerationOnWater != 0) { + if (Harmony.CONFIG.riptideAccelerationOnWater() != 0) { if (!this.isTouchingWater()) return; float f = getYaw(); float g = getPitch(); diff --git a/src/main/java/dev/symphony/harmony/mixin/transportation/trident/riptide_cooldown/RiptideCooldown.java b/src/main/java/dev/symphony/harmony/mixin/transportation/trident/riptide_cooldown/RiptideCooldown.java index 5e9b4b3..8ee3ca1 100644 --- a/src/main/java/dev/symphony/harmony/mixin/transportation/trident/riptide_cooldown/RiptideCooldown.java +++ b/src/main/java/dev/symphony/harmony/mixin/transportation/trident/riptide_cooldown/RiptideCooldown.java @@ -1,6 +1,6 @@ package dev.symphony.harmony.mixin.transportation.trident.riptide_cooldown; -import dev.symphony.harmony.config.HarmonyConfig; +import dev.symphony.harmony.Harmony; import net.minecraft.enchantment.Enchantment; import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.entity.LivingEntity; @@ -25,7 +25,7 @@ public RiptideCooldown(Settings settings) { @Inject(method = "onStoppedUsing", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/player/PlayerEntity;useRiptide(IFLnet/minecraft/item/ItemStack;)V")) public void addCooldown(ItemStack stack, World world, LivingEntity user, int remainingUseTicks, CallbackInfoReturnable cir) { - if(HarmonyConfig.riptideCooldown){ + if(Harmony.CONFIG.riptideCooldown()){ RegistryEntry entry = stack.getEnchantments().getEnchantments().stream() .filter(act -> act.matchesId(Identifier.ofVanilla("riptide"))) .findFirst() @@ -33,7 +33,7 @@ public void addCooldown(ItemStack stack, World world, LivingEntity user, int rem int level = EnchantmentHelper.getLevel(entry, stack); if(user instanceof PlayerEntity && level > 0){ - ((PlayerEntity) user).getItemCooldownManager().set(this.getDefaultStack(), 15+level*HarmonyConfig.riptideTimeMultiplier); + ((PlayerEntity) user).getItemCooldownManager().set(this.getDefaultStack(), 15+level*Harmony.CONFIG.riptideTimeMultiplier()); } } } diff --git a/src/main/java/dev/symphony/harmony/mixin/transportation/trident/riptide_reduced_drag/RiptideReducedDrag.java b/src/main/java/dev/symphony/harmony/mixin/transportation/trident/riptide_reduced_drag/RiptideReducedDrag.java index 14522f3..d8b88a7 100644 --- a/src/main/java/dev/symphony/harmony/mixin/transportation/trident/riptide_reduced_drag/RiptideReducedDrag.java +++ b/src/main/java/dev/symphony/harmony/mixin/transportation/trident/riptide_reduced_drag/RiptideReducedDrag.java @@ -1,7 +1,7 @@ package dev.symphony.harmony.mixin.transportation.trident.riptide_reduced_drag; import com.llamalad7.mixinextras.injector.ModifyExpressionValue; -import dev.symphony.harmony.config.HarmonyConfig; +import dev.symphony.harmony.Harmony; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityType; import net.minecraft.entity.LivingEntity; @@ -27,7 +27,7 @@ public RiptideReducedDrag(EntityType type, World world) { ) ) private boolean boostWhenRiptide(boolean original) { - if (HarmonyConfig.reduceRiptideWaterDrag) { + if (Harmony.CONFIG.reduceRiptideWaterDrag()) { return original || this.riptideTicks > 0; } return original; diff --git a/src/main/java/dev/symphony/harmony/mixin/transportation/trident/variable_riptide_duration/VariableRiptideDuration.java b/src/main/java/dev/symphony/harmony/mixin/transportation/trident/variable_riptide_duration/VariableRiptideDuration.java index 004a277..1d9fcfc 100644 --- a/src/main/java/dev/symphony/harmony/mixin/transportation/trident/variable_riptide_duration/VariableRiptideDuration.java +++ b/src/main/java/dev/symphony/harmony/mixin/transportation/trident/variable_riptide_duration/VariableRiptideDuration.java @@ -1,7 +1,7 @@ package dev.symphony.harmony.mixin.transportation.trident.variable_riptide_duration; import com.llamalad7.mixinextras.sugar.Local; -import dev.symphony.harmony.config.HarmonyConfig; +import dev.symphony.harmony.Harmony; import net.minecraft.enchantment.Enchantment; import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.entity.player.PlayerEntity; @@ -31,13 +31,13 @@ public VariableRiptideDuration(net.minecraft.item.Item.Settings settings) { @ModifyArg(method = "onStoppedUsing", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/player/PlayerEntity;useRiptide(IFLnet/minecraft/item/ItemStack;)V"), index = 0) private int modifyRiptideTicks(int riptideTicks, @Local(argsOnly = true) ItemStack stack) { - if(HarmonyConfig.riptideTimeMultiplier!=0){ + if(Harmony.CONFIG.riptideTimeMultiplier()!=0){ RegistryEntry entry = stack.getEnchantments().getEnchantments().stream() .filter(act -> act.matchesId(Identifier.ofVanilla("riptide"))) .findFirst() .orElse(null); int level = EnchantmentHelper.getLevel(entry, stack); - return 15 + level*HarmonyConfig.riptideTimeMultiplier; + return 15 + level*Harmony.CONFIG.riptideTimeMultiplier(); } return riptideTicks; } diff --git a/src/main/resources/harmony.mixins.json b/src/main/resources/harmony.mixins.json index 75ee2f6..c685cc7 100644 --- a/src/main/resources/harmony.mixins.json +++ b/src/main/resources/harmony.mixins.json @@ -19,14 +19,15 @@ "redstone.AbstractBlockImplMixin", "redstone.copper_bulb_delay.OneTickCopperBulbDelay", "redstone.restone_lamp_delay.RemoveRedstoneLampDelay", - "transportation.teleport.ender_pearls_dont_dismount.EnderPearlsDontDismount", - "transportation.vehicle.exit_vehicle_on_damage.ExitVehicleOnDamage", - "transportation.horse.amor_prevents_bucking.HorseArmorPreventsBucking", "transportation.elytra.liquids_deactivate_elytra.LiquidsDeactivateElytra", + "transportation.horse.amor_prevents_bucking.HorseArmorPreventsBucking", "transportation.minecart.customizable_furnace_minecart_speed.FurnaceMinecartEntityMixin", + "transportation.teleport.ender_pearls_dont_dismount.EnderPearlsDontDismount", "transportation.trident.riptide_accceleration.RiptideAcceleration", + "transportation.trident.riptide_cooldown.RiptideCooldown", "transportation.trident.riptide_reduced_drag.RiptideReducedDrag", - "transportation.trident.variable_riptide_duration.VariableRiptideDuration" + "transportation.trident.variable_riptide_duration.VariableRiptideDuration", + "transportation.vehicle.exit_vehicle_on_damage.ExitVehicleOnDamage" ], "injectors": { "defaultRequire": 1 From 850491b2019599fab49bca5b254745258959f675 Mon Sep 17 00:00:00 2001 From: Flatkat <87091676+Flatkat@users.noreply.github.com> Date: Thu, 23 Jan 2025 16:45:25 +0100 Subject: [PATCH 3/7] Resolving more conflicts --- .../glow_berries_apply_glowing/GlowBerriesApplyGlowing.java | 6 +++--- .../vehicle/exit_vehicle_on_damage/ExitVehicleOnDamage.java | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/dev/symphony/harmony/mixin/food/glow_berries_apply_glowing/GlowBerriesApplyGlowing.java b/src/main/java/dev/symphony/harmony/mixin/food/glow_berries_apply_glowing/GlowBerriesApplyGlowing.java index abb2280..1889be1 100644 --- a/src/main/java/dev/symphony/harmony/mixin/food/glow_berries_apply_glowing/GlowBerriesApplyGlowing.java +++ b/src/main/java/dev/symphony/harmony/mixin/food/glow_berries_apply_glowing/GlowBerriesApplyGlowing.java @@ -1,6 +1,6 @@ package dev.symphony.harmony.mixin.food.glow_berries_apply_glowing; -import dev.symphony.harmony.config.HarmonyConfig; +import dev.symphony.harmony.Harmony; import net.minecraft.entity.LivingEntity; import net.minecraft.entity.effect.StatusEffectInstance; import net.minecraft.entity.effect.StatusEffects; @@ -19,10 +19,10 @@ public class GlowBerriesApplyGlowing { @Inject(method = "finishUsing", at = @At("HEAD")) private void glowBerryGlowEffect(ItemStack stack, World world, LivingEntity user, CallbackInfoReturnable cir) { - if(!world.isClient && HarmonyConfig.glowBerryEffect != 0) { + if(!world.isClient && Harmony.CONFIG.glowBerryEffect() != 0) { // If eating Glow Berry, apply glowing if (stack.getItem() == Items.GLOW_BERRIES) { - int glowDuration = HarmonyConfig.glowBerryEffect * 20; + int glowDuration = Harmony.CONFIG.glowBerryEffect() * 20; user.addStatusEffect(new StatusEffectInstance(StatusEffects.GLOWING, glowDuration, 0, true, true)); } } diff --git a/src/main/java/dev/symphony/harmony/mixin/transportation/vehicle/exit_vehicle_on_damage/ExitVehicleOnDamage.java b/src/main/java/dev/symphony/harmony/mixin/transportation/vehicle/exit_vehicle_on_damage/ExitVehicleOnDamage.java index ff79d95..7447a15 100644 --- a/src/main/java/dev/symphony/harmony/mixin/transportation/vehicle/exit_vehicle_on_damage/ExitVehicleOnDamage.java +++ b/src/main/java/dev/symphony/harmony/mixin/transportation/vehicle/exit_vehicle_on_damage/ExitVehicleOnDamage.java @@ -1,6 +1,6 @@ package dev.symphony.harmony.mixin.transportation.vehicle.exit_vehicle_on_damage; -import dev.symphony.harmony.config.HarmonyConfig; +import dev.symphony.harmony.Harmony; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityType; import net.minecraft.entity.LivingEntity; @@ -27,7 +27,7 @@ public ExitVehicleOnDamage(EntityType type, World world) { at = @At( value = "TAIL" ) ) private void exitVehicleOnDamage(ServerWorld world, DamageSource source, float amount, CallbackInfoReturnable cir) { - if (HarmonyConfig.exitVehicleOnDamage) { + if (Harmony.CONFIG.exitVehicleOnDamage()) { if (amount <= 0) return; if (this.isPlayer()) return; if (source == getDamageSources().enderPearl()) return; From b51d975455c87f7183f5a0fda34588f7909453c1 Mon Sep 17 00:00:00 2001 From: Flatkat <87091676+Flatkat@users.noreply.github.com> Date: Fri, 24 Jan 2025 18:43:10 +0100 Subject: [PATCH 4/7] Re-added missing lang entries on en_us and updated to owo other langfiles --- .../resources/assets/harmony/lang/en_us.json | 4 + .../resources/assets/harmony/lang/pt_br.json | 80 +++++++------ .../resources/assets/harmony/lang/ro_ro.json | 108 +++++++++--------- 3 files changed, 96 insertions(+), 96 deletions(-) diff --git a/src/main/resources/assets/harmony/lang/en_us.json b/src/main/resources/assets/harmony/lang/en_us.json index 8a961ab..e5d80a9 100644 --- a/src/main/resources/assets/harmony/lang/en_us.json +++ b/src/main/resources/assets/harmony/lang/en_us.json @@ -13,6 +13,10 @@ "text.config.harmony.option.enderPearlsTeleportVehicles": "Ender Pearls teleport the entity the player is riding", "text.config.harmony.option.enderPearlsDamageVehicles": "Ender Pearls damage mounts when teleporting", "text.config.harmony.option.enderPearlsDamageVehicles.tooltip": "All entities teleported(passengers and mounts) using an Ender Pearl receive half of the damage the player normally would", + "text.config.harmony.option.furnaceMinecartSpeed": "Minecart with Furnace speed", + "text.config.harmony.option.furnaceMinecartSpeed.tooltip": "The speed is relative to the max Minecart speed(2 being 200%, 0.5 being 50% etc.)\nThe vanilla value is 0.75", + "text.config.harmony.option.furnaceMinecartSpeedInWater": "Minecart with Furnace speed in water", + "text.config.harmony.option.furnaceMinecartSpeedInWater.tooltip": "The speed is relative to the max Minecart speed(2 being 200%, 0.5 being 50% etc.)\nThe vanilla value is 0.5", "text.config.harmony.option.riptideAccelerationOnWater": "Riptide acceleration on water", "text.config.harmony.option.riptideCooldown": "Tridents with riptide have cooldown", "text.config.harmony.option.riptideCooldown.tooltip": "Tridents with riptide cant be used until riptide animation has finished. \nThis prevents the player from accumulating acceleration when using the \"Riptide Acceleration on Water\" feature.", diff --git a/src/main/resources/assets/harmony/lang/pt_br.json b/src/main/resources/assets/harmony/lang/pt_br.json index f049926..f5d67ae 100644 --- a/src/main/resources/assets/harmony/lang/pt_br.json +++ b/src/main/resources/assets/harmony/lang/pt_br.json @@ -1,52 +1,50 @@ { "symphony.feature_tracker": "Rastreador de Recursos", - "harmony.midnightconfig.title": "Configurações do Harmony", - "harmony.midnightconfig.reloadWarning": "Algumas configurações precisam que o jogo seja reiniciado para serem aplicadas!", - "harmony.midnightconfig.category.harmony": "Harmony", + "text.config.harmony.title": "Configurações do Harmony", - "harmony.midnightconfig.category.transportation": "Transporte", - "harmony.midnightconfig.liquidsDeactivateElytra": "Voar através de líquidos desativa os Élitros", - "harmony.midnightconfig.liquidsDeactivateElytra.tooltip": "(Não é afetado pela chuva) \nQuando entrar na água, você vai automáticamente entrar no modo de nado.", - "harmony.midnightconfig.exitVehicleOnDamage": "Mobs vão sair de veículos quando receberem dano", - "harmony.midnightconfig.saddleRecipe": "Sela Fabricável", - "harmony.midnightconfig.horseArmorPreventsBucking": "Armadura de cavalo diminui a chance dos cavalos empinarem", - "harmony.midnightconfig.horseArmorPreventsBucking.tooltip": "Armadura de Cavalo tem a capacidade de diminuir a chance dos cavalos empinarem, dependendo do material: \n \n-Couro: 45% \n-Ouro: 60% \n-Ferrp: 75% \n-Diamante: 90% \n-Netherita (Integração com o Melody): 100% ", - "harmony.midnightconfig.riptideAccelerationOnWater": "Aceleração de Correnteza na Água", - "harmony.midnightconfig.riptideCooldown": "Tridentes com Correnteza têm um atraso de ativação", - "harmony.midnightconfig.riptideCooldown.tooltip": "Tridentes encantados com Correnteza não podem ser utilizados novamente até que sua animação termine.\nIsso evita que o jogador acumule aceleração quando estiver usando a função de \"Aceleração de Correnteza na Água\"", - "harmony.midnightconfig.riptideTimeMultiplier": "Multiplicador de tempo do efeito de Correnteza", - "harmony.midnightconfig.riptideTimeMultiplier.tooltip": "Aumenta o tempo de de animação do efeito de Correnteza, o que te faz ganhar aceleração caso a função \"Aceleração de Correnteza na Água\" esteja ativada. \n\nThe time is calculated the following way: 15+level*multiplier \n\nSet it to 0 to disable the feature.", - "harmony.midnightconfig.reduceRiptideWaterDrag": "Reduz o atrito da Água quando estiver usando um Tridente encantado com Correnteza", + "text.config.harmony.section.Transportation": "Transporte", + "text.config.harmony.option.liquidsDeactivateElytra": "Voar através de líquidos desativa os Élitros", + "text.config.harmony.option.liquidsDeactivateElytra.tooltip": "(Não é afetado pela chuva) \nQuando entrar na água, você vai automáticamente entrar no modo de nado.", + "text.config.harmony.option.exitVehicleOnDamage": "Mobs vão sair de veículos quando receberem dano", + "text.config.harmony.option.saddleRecipe": "Sela Fabricável", + "text.config.harmony.option.horseArmorPreventsBucking": "Armadura de cavalo diminui a chance dos cavalos empinarem", + "text.config.harmony.option.horseArmorPreventsBucking.tooltip": "Armadura de Cavalo tem a capacidade de diminuir a chance dos cavalos empinarem, dependendo do material: \n \n-Couro: 45% \n-Ouro: 60% \n-Ferrp: 75% \n-Diamante: 90% \n-Netherita (Integração com o Melody): 100% ", + "text.config.harmony.option.riptideAccelerationOnWater": "Aceleração de Correnteza na Água", + "text.config.harmony.option.riptideCooldown": "Tridentes com Correnteza têm um atraso de ativação", + "text.config.harmony.option.riptideCooldown.tooltip": "Tridentes encantados com Correnteza não podem ser utilizados novamente até que sua animação termine.\nIsso evita que o jogador acumule aceleração quando estiver usando a função de \"Aceleração de Correnteza na Água\"", + "text.config.harmony.option.riptideTimeMultiplier": "Multiplicador de tempo do efeito de Correnteza", + "text.config.harmony.option.riptideTimeMultiplier.tooltip": "Aumenta o tempo de de animação do efeito de Correnteza, o que te faz ganhar aceleração caso a função \"Aceleração de Correnteza na Água\" esteja ativada. \n\nThe time is calculated the following way: 15+level*multiplier \n\nSet it to 0 to disable the feature.", + "text.config.harmony.option.reduceRiptideWaterDrag": "Reduz o atrito da Água quando estiver usando um Tridente encantado com Correnteza", - "harmony.midnightconfig.category.food": "Comida", - "harmony.midnightconfig.stewStackSize": "Tamanho de stack de sopas/ensopados", - "harmony.midnightconfig.glowBerryEffect":"Efeito das Bagas brilhantes", - "harmony.midnightconfig.glowBerryEffect.tooltip":"Quanto tempo o efeito deve durar, 0 desativa a função", + "text.config.harmony.section.Food": "Comida", + "text.config.harmony.option.stewStackSize": "Tamanho de stack de sopas/ensopados", + "text.config.harmony.option.glowBerryEffect":"Efeito das Bagas brilhantes", + "text.config.harmony.option.glowBerryEffect.tooltip":"Quanto tempo o efeito deve durar, 0 desativa a função", - "harmony.midnightconfig.category.building": "Construção", - "harmony.midnightconfig.armorStandStickArms": "Suportes de Armaduras podem ser equipados com braços usando Gravetos", - "harmony.midnightconfig.armorStandStickArms.tooltip": "Braços podem ser removidos com Tesouras", - "harmony.midnightconfig.armorStandSticks": "Número de Gravetos necessários para equipar Suportes de Armaduras com braços", + "text.config.harmony.section.Building": "Construção", + "text.config.harmony.option.armorStandStickArms": "Suportes de Armaduras podem ser equipados com braços usando Gravetos", + "text.config.harmony.option.armorStandStickArms.tooltip": "Braços podem ser removidos com Tesouras", + "text.config.harmony.option.armorStandSticks": "Número de Gravetos necessários para equipar Suportes de Armaduras com braços", - "harmony.midnightconfig.category.redstone": "Redstone", - "harmony.midnightconfig.oneTickCopperBulbDelay": "Lâmpadas de Cobre tem um atraso de 1 tick", - "harmony.midnightconfig.removeRedstoneLampDelay": "Remove o atraso de 4 ticks para desligar as Lâmpadas de Cobre", + "text.config.harmony.section.Redstone": "Redstone", + "text.config.harmony.option.oneTickCopperBulbDelay": "Lâmpadas de Cobre tem um atraso de 1 tick", + "text.config.harmony.option.removeRedstoneLampDelay": "Remove o atraso de 4 ticks para desligar as Lâmpadas de Cobre", - "harmony.midnightconfig.category.potions": "Poções", - "harmony.midnightconfig.beaconsAffectTamedMobs": "Poderes do sinalizador afetam animais domados assim como jogadores.", + "text.config.harmony.section.Potions": "Poções", + "text.config.harmony.option.beaconsAffectTamedMobs": "Poderes do sinalizador afetam animais domados assim como jogadores.", - "harmony.midnightconfig.category.combat": "Combate", - "harmony.midnightconfig.tridentsReturnFromVoid": "Tridentes encantados com Lealdade voltam do Vazio.", - "harmony.midnightconfig.changeItemDespawnTime": "Mudar o tempo de desaparecimento dos itens dependendo da dificuldade", - "harmony.midnightconfig.itemDespawnTimeEasy": "Tempo para desaparecimento dos itens no modo pacífico/fácil.", - "harmony.midnightconfig.itemDespawnTimeNormal": "Tempo para desaparecimento dos itens no modo normal.", - "harmony.midnightconfig.itemDespawnTimeHard": "Tempo para desaparecimento dos itens no modo difícil.", + "text.config.harmony.section.Combat": "Combate", + "text.config.harmony.option.tridentsReturnFromVoid": "Tridentes encantados com Lealdade voltam do Vazio.", + "text.config.harmony.option.changeItemDespawnTime": "Mudar o tempo de desaparecimento dos itens dependendo da dificuldade", + "text.config.harmony.option.itemDespawnTimeEasy": "Tempo para desaparecimento dos itens no modo pacífico/fácil.", + "text.config.harmony.option.itemDespawnTimeNormal": "Tempo para desaparecimento dos itens no modo normal.", + "text.config.harmony.option.itemDespawnTimeHard": "Tempo para desaparecimento dos itens no modo difícil.", - "harmony.midnightconfig.category.mobs": "Mobs", - "harmony.midnightconfig.wolvesGrowlAtMonsters": "Lobos domados irão rosnar para monstros por perto", - "harmony.midnightconfig.permissiveParrotPerching": "Papagaios irão sair de seu ombro com menos restrições", - "harmony.midnightconfig.permissiveParrotPerching.tooltip": "Se agache e desagache rápidamente para que seu papagaio voe de seu obro.", - "harmony.midnightconfig.mismatchedMobArmor": "Mobs podem aparecer com materiais de armadura mistos.", - "harmony.midnightconfig.husksDropSandOnConvert": "Zumbis-múmia largam areia quando convertidos em Zumbis." + "text.config.harmony.section.Mobs": "Mobs", + "text.config.harmony.option.wolvesGrowlAtMonsters": "Lobos domados irão rosnar para monstros por perto", + "text.config.harmony.option.permissiveParrotPerching": "Papagaios irão sair de seu ombro com menos restrições", + "text.config.harmony.option.permissiveParrotPerching.tooltip": "Se agache e desagache rápidamente para que seu papagaio voe de seu obro.", + "text.config.harmony.option.mismatchedMobArmor": "Mobs podem aparecer com materiais de armadura mistos.", + "text.config.harmony.option.husksDropSandOnConvert": "Zumbis-múmia largam areia quando convertidos em Zumbis." } diff --git a/src/main/resources/assets/harmony/lang/ro_ro.json b/src/main/resources/assets/harmony/lang/ro_ro.json index 562976b..4993b92 100644 --- a/src/main/resources/assets/harmony/lang/ro_ro.json +++ b/src/main/resources/assets/harmony/lang/ro_ro.json @@ -1,59 +1,57 @@ { "symphony.feature_tracker": "Lista Modificărilor", - "harmony.midnightconfig.title": "Configurările pentru Harmony", - "harmony.midnightconfig.reloadWarning": "Unele opțiuni vor necesita o repornire a jocului pentru a avea efect!", - "harmony.midnightconfig.category.harmony": "Harmony", - - "harmony.midnightconfig.category.transportation": "Transportare", - "harmony.midnightconfig.liquidsDeactivateElytra": "Zborul prin lichide dezactivează Elitre", - "harmony.midnightconfig.liquidsDeactivateElytra.tooltip": "(Nu este afectat de ploaie) \nCând intrați în apă, veți intra automat în modul de înot", - "harmony.midnightconfig.exitVehicleOnDamage": "Creaturile ies din vehicule când sunt rănite", - "harmony.midnightconfig.saddleRecipe": "Șa fabricabilă", - "harmony.midnightconfig.horseArmorPreventsBucking": "Armura calului scade șansele de zdruncinare când este rănit", - "harmony.midnightconfig.horseArmorPreventsBucking.tooltip": "Armura calului are șansa de a împiedica calul din zdruncinare, în funcție de material: \n \n-Piele: 45% \n-Aur: 60% \n-Fier: 75% \n-Diamant: 90% \n-Netherit (Integrare cu Melody): 100%", - "harmony.midnightconfig.enderPearlsTeleportVehicles": "Perlele de Ender teleportează entitatea călărită de jucător", - "harmony.midnightconfig.enderPearlsDamageVehicles": "Perlele de Ender rănește entitatea călărită după teleportare", - "harmony.midnightconfig.enderPearlsDamageVehicles.tooltip": "Toate entitățile teleportate (pasageri și vehicule) folosind o Perlă de Ender primesc jumătate din rănile pe care le-ar primi în mod normal jucătorul", - "harmony.midnightconfig.furnaceMinecartSpeed": "Viteza cuptorului în vagonet", - "harmony.midnightconfig.furnaceMinecartSpeed.tooltip": "Viteza este proporțională cu viteza maximă a vagonetului(2 fiind 200%, 0.5 fiind 50% etc.)\nValoarea obișnuită este 0.75", - "harmony.midnightconfig.furnaceMinecartSpeedInWater": "Viteza cuptorului în vagonet în apă", - "harmony.midnightconfig.furnaceMinecartSpeedInWater.tooltip": "Viteza este proporțională cu viteza maximă a vagonetului(2 fiind 200%, 0.5 fiind 50% etc.)\nValoarea obișnuită este 0.5", - "harmony.midnightconfig.riptideAccelerationOnWater": "Accelerația Contracurentului pe apă", - "harmony.midnightconfig.riptideCooldown": "Tridentele cu farmecul Contracurent au o durată de așteptare", - "harmony.midnightconfig.riptideCooldown.tooltip": "Tridentele cu farmecul Contracurent nu pot fi utilizate înainte de terminarea animației. \nAcest lucru împiedică jucătorul să acumuleze accelerație când folosește opțiunea \"Accelerația Contracurentului pe apă\"", - "harmony.midnightconfig.riptideTimeMultiplier": "Multiplicator de timp al efectului Contracurentului", - "harmony.midnightconfig.riptideTimeMultiplier.tooltip": "Crește timpul pentru animația Contracurentului, în timpul căreia veți obține accelerație cât timp opțiunea \"Accelerația Contracurentului pe apă\" este activată. \n\nTimpul este calculat în felul următor: 15+nivel*multiplicator \n\n\nSetați-l la 0 pentru a dezactiva opțiunea.", - "harmony.midnightconfig.reduceRiptideWaterDrag": "Reduceți rezistența la apă în timp ce utilizați un Trident cu farmecul Contracurent", - - "harmony.midnightconfig.category.food": "Mâncare", - "harmony.midnightconfig.stewStackSize": "Dimensiunea grămezii de tocană/supă", - "harmony.midnightconfig.glowBerryEffect":"Efectul fructelor de pădure strălucitoare", - "harmony.midnightconfig.glowBerryEffect.tooltip":"Cât timp ar trebui să dureze efectul în secunde, 0 îl dezactivează", - - "harmony.midnightconfig.category.building": "Construcție", - "harmony.midnightconfig.armorStandStickArms": "Suporturile de armură pot fi echipate cu brațe folosind un băț", - "harmony.midnightconfig.armorStandStickArms.tooltip": "Brațele pot fi îndepărtate cu foarfece", - "harmony.midnightconfig.armorStandSticks": "Numărul de bețe necesare pentru echiparea suporturilor de armură cu arme", - - "harmony.midnightconfig.category.redstone": "Redstone", - "harmony.midnightconfig.oneTickCopperBulbDelay": "Becurile de Cupru au o întârziere de 1 tic", - "harmony.midnightconfig.removeRedstoneLampDelay": "Eliminați întârzierea de 4 ticuri pentru stingerea Lămpilor de Redstone", - - "harmony.midnightconfig.category.potions": "Poțiuni", - "harmony.midnightconfig.beaconsAffectTamedMobs": "Efectele Farului se aplică și animalelor îmblânzite, cât și jucătorilor.", - - "harmony.midnightconfig.category.combat": "Luptă", - "harmony.midnightconfig.tridentsReturnFromVoid": "Tridentele cu loialitate revin din vid", - "harmony.midnightconfig.changeItemDespawnTime": "Modificați timpul de dispariție a obiectelor aruncate în funcție de dificultate", - "harmony.midnightconfig.itemDespawnTimeEasy": "Timpul de dispariție a obiectelor aruncate în dificultatea Ușoară/Pașnică.", - "harmony.midnightconfig.itemDespawnTimeNormal": "Timpul de dispariție a obiectelor aruncate în dificultatea Normală.", - "harmony.midnightconfig.itemDespawnTimeHard": "Timpul de dispariție a obiectelor aruncate în dificultatea Grea.", - - "harmony.midnightconfig.category.mobs": "Creaturi", - "harmony.midnightconfig.wolvesGrowlAtMonsters": "Lupii îmblânziți mârâie la monștrii din jur.", - "harmony.midnightconfig.permissiveParrotPerching": "Papagalii zboară de pe jucător cu mai puține restricții.", - "harmony.midnightconfig.permissiveParrotPerching.tooltip": "Furișează-te și ieși din furiș rapid pentru ca papagalul tău să zboare de pe tine.", - "harmony.midnightconfig.mismatchedMobArmor": "Monștrii se pot genera cu materiale de armură necorespunzătoare.", - "harmony.midnightconfig.husksDropSandOnConvert": "Momâile aruncă nisip atunci când se transformă în zombi." + "text.config.harmony.title": "Configurările pentru Harmony", + + "text.config.harmony.section.Transportation": "Transportare", + "text.config.harmony.option.liquidsDeactivateElytra": "Zborul prin lichide dezactivează Elitre", + "text.config.harmony.option.liquidsDeactivateElytra.tooltip": "(Nu este afectat de ploaie) \nCând intrați în apă, veți intra automat în modul de înot", + "text.config.harmony.option.exitVehicleOnDamage": "Creaturile ies din vehicule când sunt rănite", + "text.config.harmony.option.saddleRecipe": "Șa fabricabilă", + "text.config.harmony.option.horseArmorPreventsBucking": "Armura calului scade șansele de zdruncinare când este rănit", + "text.config.harmony.option.horseArmorPreventsBucking.tooltip": "Armura calului are șansa de a împiedica calul din zdruncinare, în funcție de material: \n \n-Piele: 45% \n-Aur: 60% \n-Fier: 75% \n-Diamant: 90% \n-Netherit (Integrare cu Melody): 100%", + "text.config.harmony.option.enderPearlsTeleportVehicles": "Perlele de Ender teleportează entitatea călărită de jucător", + "text.config.harmony.option.enderPearlsDamageVehicles": "Perlele de Ender rănește entitatea călărită după teleportare", + "text.config.harmony.option.enderPearlsDamageVehicles.tooltip": "Toate entitățile teleportate (pasageri și vehicule) folosind o Perlă de Ender primesc jumătate din rănile pe care le-ar primi în mod normal jucătorul", + "text.config.harmony.option.furnaceMinecartSpeed": "Viteza cuptorului în vagonet", + "text.config.harmony.option.furnaceMinecartSpeed.tooltip": "Viteza este proporțională cu viteza maximă a vagonetului(2 fiind 200%, 0.5 fiind 50% etc.)\nValoarea obișnuită este 0.75", + "text.config.harmony.option.furnaceMinecartSpeedInWater": "Viteza cuptorului în vagonet în apă", + "text.config.harmony.option.furnaceMinecartSpeedInWater.tooltip": "Viteza este proporțională cu viteza maximă a vagonetului(2 fiind 200%, 0.5 fiind 50% etc.)\nValoarea obișnuită este 0.5", + "text.config.harmony.option.riptideAccelerationOnWater": "Accelerația Contracurentului pe apă", + "text.config.harmony.option.riptideCooldown": "Tridentele cu farmecul Contracurent au o durată de așteptare", + "text.config.harmony.option.riptideCooldown.tooltip": "Tridentele cu farmecul Contracurent nu pot fi utilizate înainte de terminarea animației. \nAcest lucru împiedică jucătorul să acumuleze accelerație când folosește opțiunea \"Accelerația Contracurentului pe apă\"", + "text.config.harmony.option.riptideTimeMultiplier": "Multiplicator de timp al efectului Contracurentului", + "text.config.harmony.option.riptideTimeMultiplier.tooltip": "Crește timpul pentru animația Contracurentului, în timpul căreia veți obține accelerație cât timp opțiunea \"Accelerația Contracurentului pe apă\" este activată. \n\nTimpul este calculat în felul următor: 15+nivel*multiplicator \n\n\nSetați-l la 0 pentru a dezactiva opțiunea.", + "text.config.harmony.option.reduceRiptideWaterDrag": "Reduceți rezistența la apă în timp ce utilizați un Trident cu farmecul Contracurent", + + "text.config.harmony.section.Food": "Mâncare", + "text.config.harmony.option.stewStackSize": "Dimensiunea grămezii de tocană/supă", + "text.config.harmony.option.glowBerryEffect":"Efectul fructelor de pădure strălucitoare", + "text.config.harmony.option.glowBerryEffect.tooltip":"Cât timp ar trebui să dureze efectul în secunde, 0 îl dezactivează", + + "text.config.harmony.section.Building": "Construcție", + "text.config.harmony.option.armorStandStickArms": "Suporturile de armură pot fi echipate cu brațe folosind un băț", + "text.config.harmony.option.armorStandStickArms.tooltip": "Brațele pot fi îndepărtate cu foarfece", + "text.config.harmony.option.armorStandSticks": "Numărul de bețe necesare pentru echiparea suporturilor de armură cu arme", + + "text.config.harmony.section.Redstone": "Redstone", + "text.config.harmony.option.oneTickCopperBulbDelay": "Becurile de Cupru au o întârziere de 1 tic", + "text.config.harmony.option.removeRedstoneLampDelay": "Eliminați întârzierea de 4 ticuri pentru stingerea Lămpilor de Redstone", + + "text.config.harmony.section.Potions": "Poțiuni", + "text.config.harmony.option.beaconsAffectTamedMobs": "Efectele Farului se aplică și animalelor îmblânzite, cât și jucătorilor.", + + "text.config.harmony.section.Combat": "Luptă", + "text.config.harmony.option.tridentsReturnFromVoid": "Tridentele cu loialitate revin din vid", + "text.config.harmony.option.changeItemDespawnTime": "Modificați timpul de dispariție a obiectelor aruncate în funcție de dificultate", + "text.config.harmony.option.itemDespawnTimeEasy": "Timpul de dispariție a obiectelor aruncate în dificultatea Ușoară/Pașnică.", + "text.config.harmony.option.itemDespawnTimeNormal": "Timpul de dispariție a obiectelor aruncate în dificultatea Normală.", + "text.config.harmony.option.itemDespawnTimeHard": "Timpul de dispariție a obiectelor aruncate în dificultatea Grea.", + + "text.config.harmony.section.Mobs": "Creaturi", + "text.config.harmony.option.wolvesGrowlAtMonsters": "Lupii îmblânziți mârâie la monștrii din jur.", + "text.config.harmony.option.permissiveParrotPerching": "Papagalii zboară de pe jucător cu mai puține restricții.", + "text.config.harmony.option.permissiveParrotPerching.tooltip": "Furișează-te și ieși din furiș rapid pentru ca papagalul tău să zboare de pe tine.", + "text.config.harmony.option.mismatchedMobArmor": "Monștrii se pot genera cu materiale de armură necorespunzătoare.", + "text.config.harmony.option.husksDropSandOnConvert": "Momâile aruncă nisip atunci când se transformă în zombi." } \ No newline at end of file From b913623fd8a6b223e7fa64cec43371f2174a3c83 Mon Sep 17 00:00:00 2001 From: Flatkat <87091676+Flatkat@users.noreply.github.com> Date: Sat, 25 Jan 2025 01:23:08 +0100 Subject: [PATCH 5/7] Broken code? Just remove it lol (Code did nothing apparently) --- .../variable_riptide_duration/VariableRiptideDuration.java | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/main/java/dev/symphony/harmony/mixin/transportation/trident/variable_riptide_duration/VariableRiptideDuration.java b/src/main/java/dev/symphony/harmony/mixin/transportation/trident/variable_riptide_duration/VariableRiptideDuration.java index 1d9fcfc..732e4c4 100644 --- a/src/main/java/dev/symphony/harmony/mixin/transportation/trident/variable_riptide_duration/VariableRiptideDuration.java +++ b/src/main/java/dev/symphony/harmony/mixin/transportation/trident/variable_riptide_duration/VariableRiptideDuration.java @@ -4,13 +4,11 @@ import dev.symphony.harmony.Harmony; import net.minecraft.enchantment.Enchantment; import net.minecraft.enchantment.EnchantmentHelper; -import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.item.TridentItem; import net.minecraft.item.consume.UseAction; import net.minecraft.registry.entry.RegistryEntry; -import net.minecraft.util.Hand; import net.minecraft.util.Identifier; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; @@ -41,9 +39,4 @@ private int modifyRiptideTicks(int riptideTicks, @Local(argsOnly = true) ItemSta } return riptideTicks; } - - @Override - public boolean allowComponentsUpdateAnimation(PlayerEntity player, Hand hand, ItemStack oldStack, ItemStack newStack) { - return super.allowComponentsUpdateAnimation(player, hand, oldStack, newStack); - } } From 7739a814aa6eaf528957a41db48fda94d6410ea6 Mon Sep 17 00:00:00 2001 From: Flatkat <87091676+Flatkat@users.noreply.github.com> Date: Sun, 26 Jan 2025 18:41:54 +0100 Subject: [PATCH 6/7] Added dropdown subcategories to configscreen and reorganized en_us langfile --- .../harmony/config/HarmonyConfigModel.java | 87 +++++++++----- .../ModifyItemDespawnTimes.java | 6 +- .../mismatched_mob_armor/MobEntityMixin.java | 2 +- .../PlayerEntityMixin.java | 2 +- .../SitOnOwnerShoulderGoalMixin.java | 2 +- .../WolfEntityMixin.java | 2 +- .../LiquidsDeactivateElytra.java | 2 +- .../HorseArmorPreventsBucking.java | 2 +- .../FurnaceMinecartEntityMixin.java | 4 +- .../EnderPearlsDontDismount.java | 6 +- .../RiptideAcceleration.java | 4 +- .../riptide_cooldown/RiptideCooldown.java | 4 +- .../RiptideReducedDrag.java | 2 +- .../VariableRiptideDuration.java | 4 +- .../resources/assets/harmony/lang/en_us.json | 109 +++++++++++------- 15 files changed, 151 insertions(+), 87 deletions(-) diff --git a/src/main/java/dev/symphony/harmony/config/HarmonyConfigModel.java b/src/main/java/dev/symphony/harmony/config/HarmonyConfigModel.java index 7d60c08..6504aa0 100644 --- a/src/main/java/dev/symphony/harmony/config/HarmonyConfigModel.java +++ b/src/main/java/dev/symphony/harmony/config/HarmonyConfigModel.java @@ -1,10 +1,7 @@ package dev.symphony.harmony.config; import dev.symphony.harmony.Harmony; -import io.wispforest.owo.config.annotation.Config; -import io.wispforest.owo.config.annotation.Modmenu; -import io.wispforest.owo.config.annotation.RangeConstraint; -import io.wispforest.owo.config.annotation.SectionHeader; +import io.wispforest.owo.config.annotation.*; import java.util.concurrent.TimeUnit; @@ -15,58 +12,96 @@ public class HarmonyConfigModel { // Transportation 🏳️‍⚧️ - @SectionHeader("Transportation") - public boolean liquidsDeactivateElytra = true; + @SectionHeader("Trans") public boolean exitVehicleOnDamage = true; - @HarmonyConfigCondition.ResourceConfigName(config_name = "recipe/saddle") public boolean saddleRecipe = true; - public boolean horseArmorPreventsBucking = true; - public boolean enderPearlsTeleportVehicles = true; - public boolean enderPearlsDamageVehicles = true; - public float furnaceMinecartSpeed = 1f; - public float furnaceMinecartSpeedInWater = 1f; - @RangeConstraint(min = 0f, max = 1f) - public float riptideAccelerationOnWater = 0.1f; - public boolean riptideCooldown = true; - public int riptideTimeMultiplier = 5; - public boolean reduceRiptideWaterDrag = true; + + @Nest @Expanded public TransElytraCat transElytraCat = new TransElytraCat(); + public static class TransElytraCat { + public boolean liquidsDeactivateElytra = true; + } + + @Nest @Expanded public TransMinecartCat transMinecartCat = new TransMinecartCat(); + public static class TransMinecartCat { + public float furnaceMinecartSpeed = 1f; + public float furnaceMinecartSpeedInWater = 1f; + } + + @Nest @Expanded public TransSaddledCat transSaddledCat = new TransSaddledCat(); + public static class TransSaddledCat { + @HarmonyConfigCondition.ResourceConfigName(config_name = "recipe/saddle") public boolean saddleRecipe = true; + public boolean horseArmorPreventsBucking = true; + public boolean enderPearlsTeleportVehicles = true; + public boolean enderPearlsDamageVehicles = true; + } + + @Nest @Expanded public TransRiptideCat transRiptideCat = new TransRiptideCat(); + public static class TransRiptideCat { + @RangeConstraint(min = 0f, max = 1f) public float riptideAccelerationOnWater = 0.1f; + public boolean riptideCooldown = true; + public int riptideTimeMultiplier = 5; + public boolean reduceRiptideWaterDrag = true; + } + + + // Food @SectionHeader("Food") public int stewStackSize = 16; public int glowBerryEffect = 10; + + // Building @SectionHeader("Building") public boolean armorStandStickArms = true; public int armorStandSticks = 1; + + // Redstone @SectionHeader("Redstone") public boolean oneTickCopperBulbDelay = true; public boolean removeRedstoneLampDelay = true; + + // Potions @SectionHeader("Potions") public boolean beaconsAffectTamedMobs = true; + + // Combat @SectionHeader("Combat") public boolean tridentsReturnFromVoid = true; public boolean changeItemDespawnTime = true; - private static final int ONE_HOUR = 60 * 60; - @RangeConstraint(min = 0, max = ONE_HOUR) - public int - itemDespawnTimeEasy = (int) TimeUnit.MINUTES.toSeconds(20), - itemDespawnTimeNormal = (int) TimeUnit.MINUTES.toSeconds(10), - itemDespawnTimeHard = (int) TimeUnit.MINUTES.toSeconds(5); + @Nest public ItemDespawnTimeCat itemDespawnTimeCat = new ItemDespawnTimeCat(); + public static class ItemDespawnTimeCat { + private static final int ONE_HOUR = 60 * 60; + @RangeConstraint(min = 0, max = ONE_HOUR) public int + itemDespawnTimeEasy = (int) TimeUnit.MINUTES.toSeconds(20), + itemDespawnTimeNormal = (int) TimeUnit.MINUTES.toSeconds(10), + itemDespawnTimeHard = (int) TimeUnit.MINUTES.toSeconds(5); + } + + // Mobs @SectionHeader("Mobs") - public boolean wolvesGrowlAtMonsters = true; - public boolean mismatchedMobArmor = true; - public boolean permissiveParrotPerching = true; public boolean husksDropSandOnConvert = true; + + @Nest @Expanded public MobsHostileCat mobsHostileCat = new MobsHostileCat(); + public static class MobsHostileCat { + public boolean mismatchedMobArmor = true; + } + + @Nest @Expanded public MobsPetsCat mobsPetsCat = new MobsPetsCat(); + public static class MobsPetsCat { + public boolean permissiveParrotPerching = true; + public boolean wolvesGrowlAtMonsters = true; + } } diff --git a/src/main/java/dev/symphony/harmony/mixin/combat/slower_item_despawn/ModifyItemDespawnTimes.java b/src/main/java/dev/symphony/harmony/mixin/combat/slower_item_despawn/ModifyItemDespawnTimes.java index ad11db4..de76e38 100644 --- a/src/main/java/dev/symphony/harmony/mixin/combat/slower_item_despawn/ModifyItemDespawnTimes.java +++ b/src/main/java/dev/symphony/harmony/mixin/combat/slower_item_despawn/ModifyItemDespawnTimes.java @@ -28,9 +28,9 @@ private int modifyDespawnTime(int constant) { int time = 20 * switch (this.getWorld().getDifficulty()) { - case PEACEFUL, EASY -> Harmony.CONFIG.itemDespawnTimeEasy(); - case NORMAL -> Harmony.CONFIG.itemDespawnTimeNormal(); - case HARD -> Harmony.CONFIG.itemDespawnTimeHard(); + case PEACEFUL, EASY -> Harmony.CONFIG.itemDespawnTimeCat.itemDespawnTimeEasy(); + case NORMAL -> Harmony.CONFIG.itemDespawnTimeCat.itemDespawnTimeNormal(); + case HARD -> Harmony.CONFIG.itemDespawnTimeCat.itemDespawnTimeHard(); }; return time == 0 ? NEVER_DESPAWN_AGE : time; diff --git a/src/main/java/dev/symphony/harmony/mixin/mobs/mismatched_mob_armor/MobEntityMixin.java b/src/main/java/dev/symphony/harmony/mixin/mobs/mismatched_mob_armor/MobEntityMixin.java index a157432..69dbb2b 100644 --- a/src/main/java/dev/symphony/harmony/mixin/mobs/mismatched_mob_armor/MobEntityMixin.java +++ b/src/main/java/dev/symphony/harmony/mixin/mobs/mismatched_mob_armor/MobEntityMixin.java @@ -23,7 +23,7 @@ public MobEntityMixin(EntityType type, World world) { @WrapOperation(method = "initEquipment", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/mob/MobEntity;getEquipmentForSlot(Lnet/minecraft/entity/EquipmentSlot;I)Lnet/minecraft/item/Item;")) private Item repeatRandomForEachSlot(EquipmentSlot equipmentSlot, int equipmentLevel, Operation original, @Local(argsOnly = true) Random random) { - if (!Harmony.CONFIG.mismatchedMobArmor()) + if (!Harmony.CONFIG.mobsHostileCat.mismatchedMobArmor()) return original.call(equipmentSlot, equipmentLevel); int level = random.nextInt(2); diff --git a/src/main/java/dev/symphony/harmony/mixin/mobs/permissive_parrot_perching/PlayerEntityMixin.java b/src/main/java/dev/symphony/harmony/mixin/mobs/permissive_parrot_perching/PlayerEntityMixin.java index 5736daf..c67f684 100644 --- a/src/main/java/dev/symphony/harmony/mixin/mobs/permissive_parrot_perching/PlayerEntityMixin.java +++ b/src/main/java/dev/symphony/harmony/mixin/mobs/permissive_parrot_perching/PlayerEntityMixin.java @@ -29,7 +29,7 @@ public abstract class PlayerEntityMixin extends EntityImplMixin { @ModifyExpressionValue(method = "tickMovement", slice = @Slice(from = @At(value = "INVOKE", target = "Lnet/minecraft/entity/player/PlayerEntity;updateShoulderEntity(Lnet/minecraft/nbt/NbtCompound;)V", ordinal = 0)), at = @At(value = "FIELD", target = "Lnet/minecraft/entity/player/PlayerEntity;fallDistance:F")) private float removeFallCheck(float original) { - if (!Harmony.CONFIG.permissiveParrotPerching()) + if (!Harmony.CONFIG.mobsPetsCat.permissiveParrotPerching()) return original; return Integer.MIN_VALUE; diff --git a/src/main/java/dev/symphony/harmony/mixin/mobs/permissive_parrot_perching/SitOnOwnerShoulderGoalMixin.java b/src/main/java/dev/symphony/harmony/mixin/mobs/permissive_parrot_perching/SitOnOwnerShoulderGoalMixin.java index 677be22..878260d 100644 --- a/src/main/java/dev/symphony/harmony/mixin/mobs/permissive_parrot_perching/SitOnOwnerShoulderGoalMixin.java +++ b/src/main/java/dev/symphony/harmony/mixin/mobs/permissive_parrot_perching/SitOnOwnerShoulderGoalMixin.java @@ -13,7 +13,7 @@ public class SitOnOwnerShoulderGoalMixin { @ModifyExpressionValue(method = "canStart", at = @At(value = "FIELD", target = "Lnet/minecraft/entity/player/PlayerAbilities;flying:Z")) private boolean modifyIsFlying(boolean original, @Local ServerPlayerEntity serverPlayerEntity) { - if (!Harmony.CONFIG.permissiveParrotPerching()) + if (!Harmony.CONFIG.mobsPetsCat.permissiveParrotPerching()) return original; return serverPlayerEntity.isGliding(); diff --git a/src/main/java/dev/symphony/harmony/mixin/mobs/wolves_growl_at_monsters/WolfEntityMixin.java b/src/main/java/dev/symphony/harmony/mixin/mobs/wolves_growl_at_monsters/WolfEntityMixin.java index 264687e..e7b9cc0 100644 --- a/src/main/java/dev/symphony/harmony/mixin/mobs/wolves_growl_at_monsters/WolfEntityMixin.java +++ b/src/main/java/dev/symphony/harmony/mixin/mobs/wolves_growl_at_monsters/WolfEntityMixin.java @@ -23,7 +23,7 @@ protected WolfEntityMixin(EntityType entityType, World @ModifyExpressionValue(method = "getAmbientSound", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/passive/WolfEntity;hasAngerTime()Z")) private boolean shouldGrowl(boolean original) { - return original || (Harmony.CONFIG.wolvesGrowlAtMonsters() && this.isTamed() && !this.getNearbyMonsters().isEmpty()); + return original || (Harmony.CONFIG.mobsPetsCat.wolvesGrowlAtMonsters() && this.isTamed() && !this.getNearbyMonsters().isEmpty()); } @Unique diff --git a/src/main/java/dev/symphony/harmony/mixin/transportation/elytra/liquids_deactivate_elytra/LiquidsDeactivateElytra.java b/src/main/java/dev/symphony/harmony/mixin/transportation/elytra/liquids_deactivate_elytra/LiquidsDeactivateElytra.java index 23a2f48..0c9b5a7 100644 --- a/src/main/java/dev/symphony/harmony/mixin/transportation/elytra/liquids_deactivate_elytra/LiquidsDeactivateElytra.java +++ b/src/main/java/dev/symphony/harmony/mixin/transportation/elytra/liquids_deactivate_elytra/LiquidsDeactivateElytra.java @@ -18,7 +18,7 @@ public LiquidsDeactivateElytra(EntityType type, World world) { @ModifyExpressionValue(method = "canGlide", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/LivingEntity;hasStatusEffect(Lnet/minecraft/registry/entry/RegistryEntry;)Z")) private boolean cancelElytraInLiquid(boolean original) { - if(Harmony.CONFIG.liquidsDeactivateElytra()){ + if(Harmony.CONFIG.transElytraCat.liquidsDeactivateElytra()){ if (original || this.isSubmergedInWater() || this.isInLava()) { setSprinting(true); return true; diff --git a/src/main/java/dev/symphony/harmony/mixin/transportation/horse/amor_prevents_bucking/HorseArmorPreventsBucking.java b/src/main/java/dev/symphony/harmony/mixin/transportation/horse/amor_prevents_bucking/HorseArmorPreventsBucking.java index f2d8536..fc74b1c 100644 --- a/src/main/java/dev/symphony/harmony/mixin/transportation/horse/amor_prevents_bucking/HorseArmorPreventsBucking.java +++ b/src/main/java/dev/symphony/harmony/mixin/transportation/horse/amor_prevents_bucking/HorseArmorPreventsBucking.java @@ -38,7 +38,7 @@ public HorseArmorPreventsBucking(Inventory armorinventory) { @ModifyExpressionValue(method = "updateAnger", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/passive/AbstractHorseEntity;shouldAmbientStand()Z")) private boolean rejectAngryWhenDrip(boolean original) { - if(Harmony.CONFIG.horseArmorPreventsBucking()){ + if(Harmony.CONFIG.transSaddledCat.horseArmorPreventsBucking()){ if(FabricLoader.getInstance().isModLoaded("melody") && preventBuckingChance.get(Registries.ITEM.get(Identifier.of("melody:netherite_horse_armor"))) == null) { // Temporary solution until we move this to a better, configurable system // This is inside rejectAngryWhenDrip because if not it gets called too early, so it cant detect Melody nor is the armor item registered yet, so it doesnt work. diff --git a/src/main/java/dev/symphony/harmony/mixin/transportation/minecart/customizable_furnace_minecart_speed/FurnaceMinecartEntityMixin.java b/src/main/java/dev/symphony/harmony/mixin/transportation/minecart/customizable_furnace_minecart_speed/FurnaceMinecartEntityMixin.java index 1972ba5..a7102ed 100644 --- a/src/main/java/dev/symphony/harmony/mixin/transportation/minecart/customizable_furnace_minecart_speed/FurnaceMinecartEntityMixin.java +++ b/src/main/java/dev/symphony/harmony/mixin/transportation/minecart/customizable_furnace_minecart_speed/FurnaceMinecartEntityMixin.java @@ -30,9 +30,9 @@ public class FurnaceMinecartEntityMixin extends AbstractMinecartEntity { @Inject(method = "getMaxSpeed",at= @At("RETURN"), cancellable = true) void ChangeFurnaceMinecartSpeed(ServerWorld world, CallbackInfoReturnable cir){ if(super.isTouchingWater()) - cir.setReturnValue(super.getMaxSpeed(world) * Harmony.CONFIG.furnaceMinecartSpeedInWater()); + cir.setReturnValue(super.getMaxSpeed(world) * Harmony.CONFIG.transMinecartCat.furnaceMinecartSpeedInWater()); else - cir.setReturnValue(super.getMaxSpeed(world) * Harmony.CONFIG.furnaceMinecartSpeed()); + cir.setReturnValue(super.getMaxSpeed(world) * Harmony.CONFIG.transMinecartCat.furnaceMinecartSpeed()); } @Inject(method = "interact",at= @At(value = "HEAD"), cancellable = true) diff --git a/src/main/java/dev/symphony/harmony/mixin/transportation/teleport/ender_pearls_dont_dismount/EnderPearlsDontDismount.java b/src/main/java/dev/symphony/harmony/mixin/transportation/teleport/ender_pearls_dont_dismount/EnderPearlsDontDismount.java index 06799a7..54a2dc0 100644 --- a/src/main/java/dev/symphony/harmony/mixin/transportation/teleport/ender_pearls_dont_dismount/EnderPearlsDontDismount.java +++ b/src/main/java/dev/symphony/harmony/mixin/transportation/teleport/ender_pearls_dont_dismount/EnderPearlsDontDismount.java @@ -17,7 +17,7 @@ public class EnderPearlsDontDismount { @WrapOperation(method = "onCollision",at= @At(value = "INVOKE", target = "Lnet/minecraft/server/network/ServerPlayerEntity;teleportTo(Lnet/minecraft/world/TeleportTarget;)Lnet/minecraft/server/network/ServerPlayerEntity;")) ServerPlayerEntity TeleportMount(ServerPlayerEntity instance, TeleportTarget teleportTarget, Operation original){ - if(instance.hasVehicle() && Harmony.CONFIG.enderPearlsTeleportVehicles()){ + if(instance.hasVehicle() && Harmony.CONFIG.transSaddledCat.enderPearlsTeleportVehicles()){ // Find the mount that isn't riding any other mount and teleport it instead of the player Entity vehicle = instance.getVehicle(); while(vehicle.hasVehicle()) { @@ -31,7 +31,7 @@ ServerPlayerEntity TeleportMount(ServerPlayerEntity instance, TeleportTarget tel @WrapOperation(method = "onCollision",at= @At(value = "INVOKE", target = "Lnet/minecraft/server/network/ServerPlayerEntity;damage(Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/entity/damage/DamageSource;F)Z")) boolean DamageAfterTeleportation(ServerPlayerEntity instance, ServerWorld world, DamageSource source, float amount, Operation original){ - if(instance.hasVehicle() && Harmony.CONFIG.enderPearlsDamageVehicles() && Harmony.CONFIG.enderPearlsTeleportVehicles()) { + if(instance.hasVehicle() && Harmony.CONFIG.transSaddledCat.enderPearlsDamageVehicles() && Harmony.CONFIG.transSaddledCat.enderPearlsTeleportVehicles()) { //The damage each entity takes from teleporting is halved to be consistent with horses taking fall damage amount /= 2; //Find the mount that isn't riding any other mount @@ -52,6 +52,6 @@ boolean DamageAfterTeleportation(ServerPlayerEntity instance, ServerWorld world, //Stop the player from leaving their vehicle when using an Ender Pearl @WrapOperation(method = "onCollision",at= @At(value = "INVOKE", target = "Lnet/minecraft/entity/Entity;detach()V")) - void StopDetaching(Entity instance, Operation original){if(!Harmony.CONFIG.enderPearlsTeleportVehicles()) {original.call(instance);}} + void StopDetaching(Entity instance, Operation original){if(!Harmony.CONFIG.transSaddledCat.enderPearlsTeleportVehicles()) {original.call(instance);}} } diff --git a/src/main/java/dev/symphony/harmony/mixin/transportation/trident/riptide_accceleration/RiptideAcceleration.java b/src/main/java/dev/symphony/harmony/mixin/transportation/trident/riptide_accceleration/RiptideAcceleration.java index d2e43fd..1a7d27f 100644 --- a/src/main/java/dev/symphony/harmony/mixin/transportation/trident/riptide_accceleration/RiptideAcceleration.java +++ b/src/main/java/dev/symphony/harmony/mixin/transportation/trident/riptide_accceleration/RiptideAcceleration.java @@ -16,7 +16,7 @@ @Mixin(LivingEntity.class) public abstract class RiptideAcceleration extends Entity { - @Unique private static final float MODIFIER = Harmony.CONFIG.riptideAccelerationOnWater(); + @Unique private static final float MODIFIER = Harmony.CONFIG.transRiptideCat.riptideAccelerationOnWater(); @Unique private static final float DEG = (float) (Math.PI / 180F); @Shadow public abstract void setSprinting(boolean sprinting); @@ -34,7 +34,7 @@ public RiptideAcceleration(EntityType type, World world) { ) ) private void accelerateWhenRiptide(CallbackInfo ci) { - if (Harmony.CONFIG.riptideAccelerationOnWater() != 0) { + if (Harmony.CONFIG.transRiptideCat.riptideAccelerationOnWater() != 0) { if (!this.isTouchingWater()) return; float f = getYaw(); float g = getPitch(); diff --git a/src/main/java/dev/symphony/harmony/mixin/transportation/trident/riptide_cooldown/RiptideCooldown.java b/src/main/java/dev/symphony/harmony/mixin/transportation/trident/riptide_cooldown/RiptideCooldown.java index 8ee3ca1..0e85b0e 100644 --- a/src/main/java/dev/symphony/harmony/mixin/transportation/trident/riptide_cooldown/RiptideCooldown.java +++ b/src/main/java/dev/symphony/harmony/mixin/transportation/trident/riptide_cooldown/RiptideCooldown.java @@ -25,7 +25,7 @@ public RiptideCooldown(Settings settings) { @Inject(method = "onStoppedUsing", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/player/PlayerEntity;useRiptide(IFLnet/minecraft/item/ItemStack;)V")) public void addCooldown(ItemStack stack, World world, LivingEntity user, int remainingUseTicks, CallbackInfoReturnable cir) { - if(Harmony.CONFIG.riptideCooldown()){ + if(Harmony.CONFIG.transRiptideCat.riptideCooldown()){ RegistryEntry entry = stack.getEnchantments().getEnchantments().stream() .filter(act -> act.matchesId(Identifier.ofVanilla("riptide"))) .findFirst() @@ -33,7 +33,7 @@ public void addCooldown(ItemStack stack, World world, LivingEntity user, int rem int level = EnchantmentHelper.getLevel(entry, stack); if(user instanceof PlayerEntity && level > 0){ - ((PlayerEntity) user).getItemCooldownManager().set(this.getDefaultStack(), 15+level*Harmony.CONFIG.riptideTimeMultiplier()); + ((PlayerEntity) user).getItemCooldownManager().set(this.getDefaultStack(), 15+level*Harmony.CONFIG.transRiptideCat.riptideTimeMultiplier()); } } } diff --git a/src/main/java/dev/symphony/harmony/mixin/transportation/trident/riptide_reduced_drag/RiptideReducedDrag.java b/src/main/java/dev/symphony/harmony/mixin/transportation/trident/riptide_reduced_drag/RiptideReducedDrag.java index d8b88a7..3aa7812 100644 --- a/src/main/java/dev/symphony/harmony/mixin/transportation/trident/riptide_reduced_drag/RiptideReducedDrag.java +++ b/src/main/java/dev/symphony/harmony/mixin/transportation/trident/riptide_reduced_drag/RiptideReducedDrag.java @@ -27,7 +27,7 @@ public RiptideReducedDrag(EntityType type, World world) { ) ) private boolean boostWhenRiptide(boolean original) { - if (Harmony.CONFIG.reduceRiptideWaterDrag()) { + if (Harmony.CONFIG.transRiptideCat.reduceRiptideWaterDrag()) { return original || this.riptideTicks > 0; } return original; diff --git a/src/main/java/dev/symphony/harmony/mixin/transportation/trident/variable_riptide_duration/VariableRiptideDuration.java b/src/main/java/dev/symphony/harmony/mixin/transportation/trident/variable_riptide_duration/VariableRiptideDuration.java index 732e4c4..6b0887c 100644 --- a/src/main/java/dev/symphony/harmony/mixin/transportation/trident/variable_riptide_duration/VariableRiptideDuration.java +++ b/src/main/java/dev/symphony/harmony/mixin/transportation/trident/variable_riptide_duration/VariableRiptideDuration.java @@ -29,13 +29,13 @@ public VariableRiptideDuration(net.minecraft.item.Item.Settings settings) { @ModifyArg(method = "onStoppedUsing", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/player/PlayerEntity;useRiptide(IFLnet/minecraft/item/ItemStack;)V"), index = 0) private int modifyRiptideTicks(int riptideTicks, @Local(argsOnly = true) ItemStack stack) { - if(Harmony.CONFIG.riptideTimeMultiplier()!=0){ + if(Harmony.CONFIG.transRiptideCat.riptideTimeMultiplier()!=0){ RegistryEntry entry = stack.getEnchantments().getEnchantments().stream() .filter(act -> act.matchesId(Identifier.ofVanilla("riptide"))) .findFirst() .orElse(null); int level = EnchantmentHelper.getLevel(entry, stack); - return 15 + level*Harmony.CONFIG.riptideTimeMultiplier(); + return 15 + level*Harmony.CONFIG.transRiptideCat.riptideTimeMultiplier(); } return riptideTicks; } diff --git a/src/main/resources/assets/harmony/lang/en_us.json b/src/main/resources/assets/harmony/lang/en_us.json index e5d80a9..ebbe2e5 100644 --- a/src/main/resources/assets/harmony/lang/en_us.json +++ b/src/main/resources/assets/harmony/lang/en_us.json @@ -3,57 +3,86 @@ "text.config.harmony.title": "Harmony Config", - "text.config.harmony.section.Transportation": "Transportation", - "text.config.harmony.option.liquidsDeactivateElytra": "Flying through liquids deactivates the Elytra", - "text.config.harmony.option.liquidsDeactivateElytra.tooltip": "(Isn't affected by rain) \nWhen getting into the water, you will automatically get in swim mode", - "text.config.harmony.option.exitVehicleOnDamage": "Mobs exit vehicles when taking damage", - "text.config.harmony.option.saddleRecipe": "Craftable Saddle", - "text.config.harmony.option.horseArmorPreventsBucking": "Horse armor decreases bucking chance on damage", - "text.config.harmony.option.horseArmorPreventsBucking.tooltip": "Horse armor has a chance from preventing the horse from bucking, depending of material: \n \n-Leather: 45% \n-Gold: 60% \n-Iron: 75% \n-Diamond: 90% \n-Netherite (Melody Integration): 100% ", - "text.config.harmony.option.enderPearlsTeleportVehicles": "Ender Pearls teleport the entity the player is riding", - "text.config.harmony.option.enderPearlsDamageVehicles": "Ender Pearls damage mounts when teleporting", - "text.config.harmony.option.enderPearlsDamageVehicles.tooltip": "All entities teleported(passengers and mounts) using an Ender Pearl receive half of the damage the player normally would", - "text.config.harmony.option.furnaceMinecartSpeed": "Minecart with Furnace speed", - "text.config.harmony.option.furnaceMinecartSpeed.tooltip": "The speed is relative to the max Minecart speed(2 being 200%, 0.5 being 50% etc.)\nThe vanilla value is 0.75", - "text.config.harmony.option.furnaceMinecartSpeedInWater": "Minecart with Furnace speed in water", - "text.config.harmony.option.furnaceMinecartSpeedInWater.tooltip": "The speed is relative to the max Minecart speed(2 being 200%, 0.5 being 50% etc.)\nThe vanilla value is 0.5", - "text.config.harmony.option.riptideAccelerationOnWater": "Riptide acceleration on water", - "text.config.harmony.option.riptideCooldown": "Tridents with riptide have cooldown", - "text.config.harmony.option.riptideCooldown.tooltip": "Tridents with riptide cant be used until riptide animation has finished. \nThis prevents the player from accumulating acceleration when using the \"Riptide Acceleration on Water\" feature.", - "text.config.harmony.option.riptideTimeMultiplier": "Riptide effect time multiplier", - "text.config.harmony.option.riptideTimeMultiplier.tooltip": "Increases the time for the riptide animation, during which you will gain acceleration as long as the \"Riptide Acceleration on water\" feature is enabled. \n\nThe time is calculated the following way: 15+level*multiplier \n\nSet it to 0 to disable the feature.", - "text.config.harmony.option.reduceRiptideWaterDrag": "Reduce water drag while using a Trident with Riptide", + + "text.config.harmony.section.Trans": "Transportation", + + "text.config.harmony.option.exitVehicleOnDamage": "Mobs exit vehicles when taking damage", + + "text.config.harmony.category.transElytraCat": "Elytra", + "text.config.harmony.option.transElytraCat.liquidsDeactivateElytra": "Flying through liquids deactivates the Elytra", + "text.config.harmony.option.transElytraCat.liquidsDeactivateElytra.tooltip": "(Isn't affected by rain) \nWhen getting into the water, you will automatically get in swim mode", + + "text.config.harmony.category.transMinecartCat": "Minecart", + "text.config.harmony.option.transMinecartCat.furnaceMinecartSpeed": "Minecart with Furnace speed", + "text.config.harmony.option.transMinecartCat.furnaceMinecartSpeed.tooltip": "The speed is relative to the max Minecart speed(2 being 200%, 0.5 being 50% etc.)\nThe vanilla value is 0.75", + "text.config.harmony.option.transMinecartCat.furnaceMinecartSpeedInWater": "Minecart with Furnace speed in water", + "text.config.harmony.option.transMinecartCat.furnaceMinecartSpeedInWater.tooltip": "The speed is relative to the max Minecart speed(2 being 200%, 0.5 being 50% etc.)\nThe vanilla value is 0.5", + + "text.config.harmony.category.transSaddledCat": "Saddled Mobs", + "text.config.harmony.option.transSaddledCat.saddleRecipe": "Craftable Saddle", + "text.config.harmony.option.transSaddledCat.horseArmorPreventsBucking": "Horse armor decreases bucking chance on damage", + "text.config.harmony.option.transSaddledCat.horseArmorPreventsBucking.tooltip": "Horse armor has a chance from preventing the horse from bucking, depending of material: \n \n-Leather: 45% \n-Gold: 60% \n-Iron: 75% \n-Diamond: 90% \n-Netherite (Melody Integration): 100% ", + "text.config.harmony.option.transSaddledCat.enderPearlsTeleportVehicles": "Ender Pearls teleport the entity the player is riding", + "text.config.harmony.option.transSaddledCat.enderPearlsDamageVehicles": "Ender Pearls damage mounts when teleporting", + "text.config.harmony.option.transSaddledCat.enderPearlsDamageVehicles.tooltip": "All entities teleported(passengers and mounts) using an Ender Pearl receive half of the damage the player normally would", + + "text.config.harmony.category.transRiptideCat": "Riptide Enchantment (Tridents)", + "text.config.harmony.option.transRiptideCat.riptideAccelerationOnWater": "Riptide acceleration on water", + "text.config.harmony.option.transRiptideCat.riptideCooldown": "Tridents with riptide have cooldown", + "text.config.harmony.option.transRiptideCat.riptideCooldown.tooltip": "Tridents with riptide cant be used until riptide animation has finished. \nThis prevents the player from accumulating acceleration when using the \"Riptide Acceleration on Water\" feature.", + "text.config.harmony.option.transRiptideCat.riptideTimeMultiplier": "Riptide effect time multiplier", + "text.config.harmony.option.transRiptideCat.riptideTimeMultiplier.tooltip": "Increases the time for the riptide animation, during which you will gain acceleration as long as the \"Riptide Acceleration on water\" feature is enabled. \n\nThe time is calculated the following way: 15+level*multiplier \n\nSet it to 0 to disable the feature.", + "text.config.harmony.option.transRiptideCat.reduceRiptideWaterDrag": "Reduce water drag while using a Trident with Riptide", + "text.config.harmony.section.Food": "Food", - "text.config.harmony.option.stewStackSize": "Stew/soup stack size", - "text.config.harmony.option.glowBerryEffect":"Glowberry effect", - "text.config.harmony.option.glowBerryEffect.tooltip":"How long the effect should last in seconds, 0 disables it", + + "text.config.harmony.option.stewStackSize": "Stew/soup stack size", + "text.config.harmony.option.glowBerryEffect":"Glowberry effect", + "text.config.harmony.option.glowBerryEffect.tooltip":"How long the effect should last in seconds, 0 disables it", + "text.config.harmony.section.Building": "Building", - "text.config.harmony.option.armorStandStickArms": "Armor Stands can be equipped with arms using a Stick", - "text.config.harmony.option.armorStandStickArms.tooltip": "Arms can be removed with shears", - "text.config.harmony.option.armorStandSticks": "Number of sticks required to equip Armor Stands with arms", + + "text.config.harmony.option.armorStandStickArms": "Armor Stands can be equipped with arms using a Stick", + "text.config.harmony.option.armorStandStickArms.tooltip": "Arms can be removed with shears", + "text.config.harmony.option.armorStandSticks": "Number of sticks required to equip Armor Stands with arms", + "text.config.harmony.section.Redstone": "Redstone", - "text.config.harmony.option.oneTickCopperBulbDelay": "Copper Bulbs have a 1 tick delay", - "text.config.harmony.option.removeRedstoneLampDelay": "Removes the 4 tick delay for redstone lamps to turn off", - + + "text.config.harmony.option.oneTickCopperBulbDelay": "Copper Bulbs have a 1 tick delay", + "text.config.harmony.option.removeRedstoneLampDelay": "Removes the 4 tick delay for redstone lamps to turn off", + + "text.config.harmony.section.Potions": "Potions", - "text.config.harmony.option.beaconsAffectTamedMobs": "Beacon effects apply to tamed animals as well as players.", + + "text.config.harmony.option.beaconsAffectTamedMobs": "Beacon effects apply to tamed animals as well as players.", + "text.config.harmony.section.Combat": "Combat", - "text.config.harmony.option.tridentsReturnFromVoid": "Tridents with Loyalty return from the void", - "text.config.harmony.option.changeItemDespawnTime": "Change items despawn time depending on difficulty", - "text.config.harmony.option.itemDespawnTimeEasy": "Time for dropped items to despawn in easy/peaceful.", - "text.config.harmony.option.itemDespawnTimeNormal": "Time for dropped items to despawn in normal.", - "text.config.harmony.option.itemDespawnTimeHard": "Time for dropped items to despawn in hard.", + + "text.config.harmony.option.tridentsReturnFromVoid": "Tridents with Loyalty return from the void", + "text.config.harmony.option.changeItemDespawnTime": "Change items despawn time depending on difficulty", + "text.config.harmony.option.changeItemDespawnTime.tooltip": "Change the time per difficulty with the options on the dropdown below", + "text.config.harmony.category.itemDespawnTimeCat": "Item despawn time per difficulty", + "text.config.harmony.option.itemDespawnTimeCat.itemDespawnTimeEasy": "Easy/Peaceful", + "text.config.harmony.option.itemDespawnTimeCat.itemDespawnTimeEasy.tooltip": "In seconds", + "text.config.harmony.option.itemDespawnTimeCat.itemDespawnTimeNormal": "Normal", + "text.config.harmony.option.itemDespawnTimeCat.itemDespawnTimeNormal.tooltip": "In seconds", + "text.config.harmony.option.itemDespawnTimeCat.itemDespawnTimeHard": "Hard", + "text.config.harmony.option.itemDespawnTimeCat.itemDespawnTimeHard.tooltip": "In seconds", + "text.config.harmony.section.Mobs": "Mobs", - "text.config.harmony.option.wolvesGrowlAtMonsters": "Tamed wolves growl at nearby monsters.", - "text.config.harmony.option.permissiveParrotPerching": "Parrots dismount under fewer restrictions.", - "text.config.harmony.option.permissiveParrotPerching.tooltip": "Sneak and unsneak quickly for your parrot to fly off of you.", - "text.config.harmony.option.mismatchedMobArmor": "Mobs can spawn with mismatched armor materials.", - "text.config.harmony.option.husksDropSandOnConvert": "Husks drop sand when converting into zombies." + "text.config.harmony.option.husksDropSandOnConvert": "Husks drop sand when converting into zombies.", + + "text.config.harmony.category.mobsHostileCat": "Hostile Mobs", + "text.config.harmony.option.mobsHostileCat.mismatchedMobArmor": "Mobs can spawn with mismatched armor materials.", + "text.config.harmony.category.mobsPetsCat": "Pets", + "text.config.harmony.option.mobsPetsCat.wolvesGrowlAtMonsters": "Tamed wolves growl at nearby monsters.", + "text.config.harmony.option.mobsPetsCat.permissiveParrotPerching": "Parrots dismount under fewer restrictions.", + "text.config.harmony.option.mobsPetsCat.permissiveParrotPerching.tooltip": "Sneak and unsneak quickly for your parrot to fly off of you." } From 2f568185c2ae15f5cf01e58ccdb241c9b65cd5d5 Mon Sep 17 00:00:00 2001 From: Flatkat <87091676+Flatkat@users.noreply.github.com> Date: Sun, 26 Jan 2025 19:50:21 +0100 Subject: [PATCH 7/7] Removed MidnightLib --- build.gradle | 6 ------ gradle.properties | 2 -- 2 files changed, 8 deletions(-) diff --git a/build.gradle b/build.gradle index debe901..2a9cb20 100644 --- a/build.gradle +++ b/build.gradle @@ -12,11 +12,7 @@ base { repositories { mavenCentral() - maven { - url = "https://api.modrinth.com/maven" - } maven { url 'https://maven.wispforest.io/releases/' } - } dependencies { @@ -31,8 +27,6 @@ dependencies { // Dependencies modImplementation "com.ptsmods:devlogin:3.5" - modImplementation include ("maven.modrinth:midnightlib:${project.midnightlib_version}") - annotationProcessor modImplementation("io.wispforest:owo-lib:${project.owo_version}") modImplementation "io.wispforest:owo-lib:${project.owo_version}" include "io.wispforest:owo-sentinel:${project.owo_version}" diff --git a/gradle.properties b/gradle.properties index 900e9b7..e45f206 100644 --- a/gradle.properties +++ b/gradle.properties @@ -16,7 +16,5 @@ archives_base_name=harmony # Dependencies fabric_version=0.110.5+1.21.4 -midnightlib_version = 1.6.6-fabric - # https://maven.wispforest.io/io/wispforest/owo-lib/ owo_version = 0.12.20+1.21.4 \ No newline at end of file