From da0c86d09a1108f420e8b55128d69681cef9d185 Mon Sep 17 00:00:00 2001 From: Faboslav Date: Thu, 14 Nov 2024 11:22:36 +0100 Subject: [PATCH 1/7] 3.0.6 --- CHANGELOG.md | 7 +++++++ .../render/entity/renderer/IceologerEntityRenderer.java | 6 +++--- .../common/config/FriendsAndFoesConfig.java | 9 +++++++++ .../common/init/FriendsAndFoesEntityModelLayers.java | 3 +++ .../common/init/FriendsAndFoesPotions.java | 2 +- .../common/mixin/IllusionerEntityMixin.java | 7 ++++--- .../main/resources/assets/friendsandfoes/lang/en_us.json | 2 +- gradle.properties | 2 +- 8 files changed, 29 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dc210c46..8bc69e73 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## 3.0.6 + +- Fixed strong potion of reaching duration +- Fixed iceologer model +- Updated advancements +- Added more config options + ## 3.0.5 - Fixed server crash diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/client/render/entity/renderer/IceologerEntityRenderer.java b/common/src/main/java/com/faboslav/friendsandfoes/common/client/render/entity/renderer/IceologerEntityRenderer.java index 703d61a7..6c956d76 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/client/render/entity/renderer/IceologerEntityRenderer.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/client/render/entity/renderer/IceologerEntityRenderer.java @@ -1,13 +1,13 @@ package com.faboslav.friendsandfoes.common.client.render.entity.renderer; import com.faboslav.friendsandfoes.common.FriendsAndFoes; +import com.faboslav.friendsandfoes.common.init.FriendsAndFoesEntityModelLayers; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; import net.minecraft.client.render.VertexConsumerProvider; import net.minecraft.client.render.entity.EntityRendererFactory.Context; import net.minecraft.client.render.entity.IllagerEntityRenderer; import net.minecraft.client.render.entity.feature.HeldItemFeatureRenderer; -import net.minecraft.client.render.entity.model.EntityModelLayers; import net.minecraft.client.render.entity.model.IllagerEntityModel; import net.minecraft.client.util.math.MatrixStack; import net.minecraft.entity.mob.SpellcastingIllagerEntity; @@ -17,7 +17,7 @@ public final class IceologerEntityRenderer extends IllagerEntityRenderer { public IceologerEntityRenderer(Context context) { - super(context, new IllagerEntityModel<>(context.getPart(EntityModelLayers.EVOKER)), 0.5F); + super(context, new IllagerEntityModel<>(context.getPart(FriendsAndFoesEntityModelLayers.ICEOLOGER_LAYER)), 0.5F); this.addFeature(new HeldItemFeatureRenderer<>(this, context.getHeldItemRenderer()) { @@ -45,6 +45,6 @@ public void render( @Override public Identifier getTexture(T entity) { - return FriendsAndFoes.makeID("textures/entity/illager/iceologer.png"); + return FriendsAndFoes.makeID("textures/entity/illager/iceologer.png"); } } \ No newline at end of file diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/config/FriendsAndFoesConfig.java b/common/src/main/java/com/faboslav/friendsandfoes/common/config/FriendsAndFoesConfig.java index 5b1536c4..45004496 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/config/FriendsAndFoesConfig.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/config/FriendsAndFoesConfig.java @@ -144,6 +144,15 @@ public final class FriendsAndFoesConfig implements Config @Description("Generate illusioner training grounds") public boolean generateIllusionerTrainingGroundsStructure = true; + @Description("Maximum count of illusions") + public int maxIllusionsCount = 9; + + @Description("Number of ticks before illusion will despawn (20 ticks = 1 second)") + public int illusionLifetimeTicks = 600; + + @Description("Number of invisibility ticks (20 ticks = 1 second)") + public int invisibilityTicks = 60; + @Category("Zombie Horse") @Description("Enable trap") public boolean enableZombieHorseTrap = true; diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/init/FriendsAndFoesEntityModelLayers.java b/common/src/main/java/com/faboslav/friendsandfoes/common/init/FriendsAndFoesEntityModelLayers.java index f90675df..158feaa9 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/init/FriendsAndFoesEntityModelLayers.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/init/FriendsAndFoesEntityModelLayers.java @@ -8,6 +8,7 @@ import net.minecraft.client.render.entity.model.CowEntityModel; import net.minecraft.client.render.entity.model.EntityModelLayer; import net.minecraft.client.render.entity.model.EntityModelLayers; +import net.minecraft.client.render.entity.model.IllagerEntityModel; /** * @see EntityModelLayers @@ -18,6 +19,7 @@ public final class FriendsAndFoesEntityModelLayers public static final EntityModelLayer COPPER_GOLEM_LAYER = new EntityModelLayer(FriendsAndFoes.makeID("copper_golem"), "main"); public static final EntityModelLayer CRAB_LAYER = new EntityModelLayer(FriendsAndFoes.makeID("crab"), "main"); public static final EntityModelLayer GLARE_LAYER = new EntityModelLayer(FriendsAndFoes.makeID("glare"), "main"); + public static final EntityModelLayer ICEOLOGER_LAYER = new EntityModelLayer(FriendsAndFoes.makeID("iceologer"), "main"); public static final EntityModelLayer ICEOLOGER_ICE_CHUNK_LAYER = new EntityModelLayer(FriendsAndFoes.makeID("iceologer_ice_chunk"), "main"); public static final EntityModelLayer MAULER_LAYER = new EntityModelLayer(FriendsAndFoes.makeID("mauler"), "main"); public static final EntityModelLayer MOOBLOOM_LAYER = new EntityModelLayer(FriendsAndFoes.makeID("moobloom"), "main"); @@ -29,6 +31,7 @@ public static void registerEntityLayers(RegisterEntityLayersEvent event) { event.register(COPPER_GOLEM_LAYER, CopperGolemEntityModel::getTexturedModelData); event.register(CRAB_LAYER, CrabEntityModel::getTexturedModelData); event.register(GLARE_LAYER, GlareEntityModel::getTexturedModelData); + event.register(ICEOLOGER_LAYER, IllagerEntityModel::getTexturedModelData); event.register(ICEOLOGER_ICE_CHUNK_LAYER, IceologerIceChunkModel::getTexturedModelData); event.register(MAULER_LAYER, MaulerEntityModel::getTexturedModelData); event.register(MOOBLOOM_LAYER, CowEntityModel::getTexturedModelData); diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/init/FriendsAndFoesPotions.java b/common/src/main/java/com/faboslav/friendsandfoes/common/init/FriendsAndFoesPotions.java index a61e5112..ea60dd83 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/init/FriendsAndFoesPotions.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/init/FriendsAndFoesPotions.java @@ -17,5 +17,5 @@ public final class FriendsAndFoesPotions public static final RegistryEntry REACHING = POTIONS.register("reaching", () -> new Potion(new StatusEffectInstance(FriendsAndFoesStatusEffects.REACH.get(), 72000))); public static final RegistryEntry LONG_REACHING = POTIONS.register("long_reaching", () -> new Potion("reaching", new StatusEffectInstance(FriendsAndFoesStatusEffects.REACH.get(), 144000))); - public static final RegistryEntry STRONG_REACHING = POTIONS.register("strong_reaching", () -> new Potion("reaching", new StatusEffectInstance(FriendsAndFoesStatusEffects.REACH.get(), 1800, 1))); + public static final RegistryEntry STRONG_REACHING = POTIONS.register("strong_reaching", () -> new Potion("reaching", new StatusEffectInstance(FriendsAndFoesStatusEffects.REACH.get(), 36000, 1))); } diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/mixin/IllusionerEntityMixin.java b/common/src/main/java/com/faboslav/friendsandfoes/common/mixin/IllusionerEntityMixin.java index d2c6ebc4..5509e44f 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/mixin/IllusionerEntityMixin.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/mixin/IllusionerEntityMixin.java @@ -1,6 +1,7 @@ package com.faboslav.friendsandfoes.common.mixin; import com.faboslav.friendsandfoes.common.FriendsAndFoes; +import com.faboslav.friendsandfoes.common.config.FriendsAndFoesConfig; import com.faboslav.friendsandfoes.common.entity.IllusionerEntityAccess; import com.llamalad7.mixinextras.injector.WrapWithCondition; import net.minecraft.entity.Entity; @@ -41,9 +42,9 @@ @SuppressWarnings({"rawtypes", "unchecked"}) public abstract class IllusionerEntityMixin extends IllusionerSpellcastingIllagerEntityMixin implements RangedAttackMob, IllusionerEntityAccess { - private static final int MAX_ILLUSIONS_COUNT = 9; - private static final int ILLUSION_LIFETIME_TICKS = 600; - private static final int INVISIBILITY_TICKS = 60; + private static final int MAX_ILLUSIONS_COUNT = FriendsAndFoes.getConfig().maxIllusionsCount; + private static final int ILLUSION_LIFETIME_TICKS = FriendsAndFoes.getConfig().illusionLifetimeTicks; + private static final int INVISIBILITY_TICKS = FriendsAndFoes.getConfig().invisibilityTicks; private static final String IS_ILLUSION_NBT_NAME = "IsIllusion"; private static final String WAS_ATTACKED_NBT_NAME = "WasAttacked"; diff --git a/common/src/main/resources/assets/friendsandfoes/lang/en_us.json b/common/src/main/resources/assets/friendsandfoes/lang/en_us.json index ff1d8b98..92db834b 100644 --- a/common/src/main/resources/assets/friendsandfoes/lang/en_us.json +++ b/common/src/main/resources/assets/friendsandfoes/lang/en_us.json @@ -21,7 +21,7 @@ "advancements.nether.find_citadel.description": "Enter a Nether citadel", "advancements.nether.kill_wildfire.title": "Drop it like it's hot", "advancements.nether.kill_wildfire.description": "Kill the wildfire", - "advancements.nether.obtain_wildfire_crown.title": "Who's da New King of Hell?", + "advancements.nether.obtain_wildfire_crown.title": "Who's da New King of Nether?", "advancements.nether.obtain_wildfire_crown.description": "Have a wildfire crown in your inventory", "advancements.adventure.complete_hide_and_seek_game.title": "Hide and Seek", "advancements.adventure.complete_hide_and_seek_game.description": "Find a rascal three times in its little game", diff --git a/gradle.properties b/gradle.properties index a2ba3937..4d05e6e5 100644 --- a/gradle.properties +++ b/gradle.properties @@ -7,7 +7,7 @@ org.gradle.caching=false mod_java_version=17 mod_name=Friends & Foes mod_id=friendsandfoes -mod_version=3.0.5 +mod_version=3.0.6 mod_author=Faboslav mod_description=Adds outvoted and forgotten mobs from the mob vote, expanding on their original concepts and introducing new vanilla-like features. maven_group=com.faboslav.friendsandfoes From fed8a9c173598c66273075c0d6f211747ca6c2dc Mon Sep 17 00:00:00 2001 From: Faboslav Date: Thu, 14 Nov 2024 11:51:20 +0100 Subject: [PATCH 2/7] Updated/added translations --- CHANGELOG.md | 5 +- .../assets/friendsandfoes/lang/en_us.json | 1 + .../assets/friendsandfoes/lang/fr_fr.json | 146 ++++++++++++++++++ .../assets/friendsandfoes/lang/zh_tw.json | 145 +++++++++++++++++ 4 files changed, 296 insertions(+), 1 deletion(-) create mode 100644 common/src/main/resources/assets/friendsandfoes/lang/fr_fr.json create mode 100644 common/src/main/resources/assets/friendsandfoes/lang/zh_tw.json diff --git a/CHANGELOG.md b/CHANGELOG.md index 8bc69e73..181d85ed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,8 +2,11 @@ - Fixed strong potion of reaching duration - Fixed iceologer model -- Updated advancements - Added more config options +- Added zh_tw translations (Thanks to Lobster0228) +- Added fr_fr translations (Thanks to Franco227) +- Updated advancements +- Updated uk_ua translations (Thanks to unroman) ## 3.0.5 diff --git a/common/src/main/resources/assets/friendsandfoes/lang/en_us.json b/common/src/main/resources/assets/friendsandfoes/lang/en_us.json index 92db834b..0a4dec26 100644 --- a/common/src/main/resources/assets/friendsandfoes/lang/en_us.json +++ b/common/src/main/resources/assets/friendsandfoes/lang/en_us.json @@ -65,6 +65,7 @@ "entity.friendsandfoes.mauler": "Mauler", "entity.friendsandfoes.tuff_golem": "Tuff Golem", "entity.friendsandfoes.wildfire": "Wildfire", + "entity.friendsandfoes.player_illusion": "Player Illusion", "effect.friendsandfoes.reach": "Reach", "effect.friendsandfoes.reach.description": "Increases the range of block interaction.", "item.friendsandfoes.buttercup": "Buttercup", diff --git a/common/src/main/resources/assets/friendsandfoes/lang/fr_fr.json b/common/src/main/resources/assets/friendsandfoes/lang/fr_fr.json new file mode 100644 index 00000000..5625dc82 --- /dev/null +++ b/common/src/main/resources/assets/friendsandfoes/lang/fr_fr.json @@ -0,0 +1,146 @@ +{ + "advancements.husbandry.beehive.title": "Gardien des Abeilles", + "advancements.husbandry.beehive.description": "Obtenez tous les types de ruches", + "advancements.adventure.kill_iceologer.title": "J'étais là, j'ai vécu, j'ai...", + "advancements.adventure.kill_iceologer.description": "Tuez le cryologiste", + "advancements.adventure.kill_illusioner.title": "Un Monde d'Illusion", + "advancements.adventure.kill_illusioner.description": "Tuez l'illusionniste... si il est réel", + "advancements.husbandry.shear_a_moobloom.title": "MooBoom!", + "advancements.husbandry.shear_a_moobloom.description": "Tondez une moobloom", + "advancements.adventure.summon_copper_golem.title": "C'est parti!", + "advancements.adventure.summon_copper_golem.description": "Invoquez un golem de cuivre", + "advancements.husbandry.tame_a_glare.title": "Grincheux et Mignon", + "advancements.husbandry.tame_a_glare.description": "Apprivoisez un glare", + "advancements.adventure.the_magicians.title": "Les Magiciens", + "advancements.adventure.the_magicians.description": "Tuez les trois magiciens illageois", + "advancements.adventure.it_bites.title": "Il mord!", + "advancements.adventure.it_bites.description": "Tuez le mauleur", + "advancements.survival.activate_zombie_horse_trap.title": "Cavaliers Orageux", + "advancements.survival.activate_zombie_horse_trap.description": "Activez le piège du cheval zombie", + "advancements.nether.find_citadel.title": "Une forteresse? Non, une citadelle!", + "advancements.nether.find_citadel.description": "Entrez dans une citadelle du Nether", + "advancements.nether.kill_wildfire.title": "Ennemi Brûlant", + "advancements.nether.kill_wildfire.description": "Tuez le wildfire", + "advancements.nether.obtain_wildfire_crown.title": "C'est qui le Nouveau Roi de l'Enfer?", + "advancements.nether.obtain_wildfire_crown.description": "Obtenez la couronne du wildfire", + "advancements.adventure.complete_hide_and_seek_game.title": "Cache-cache", + "advancements.adventure.complete_hide_and_seek_game.description": "Trouvez un rascal trois fois", + "block.friendsandfoes.buttercup": "Bouton d'Or", + "block.minecraft.beehive": "Ruche en Chêne", + "block.friendsandfoes.acacia_beehive": "Ruche d'acacia", + "block.friendsandfoes.bamboo_beehive": "Ruche de bambou", + "block.friendsandfoes.birch_beehive": "Ruche de bouleau", + "block.friendsandfoes.cherry_beehive": "Ruche de cerisier", + "block.friendsandfoes.crimson_beehive": "Ruche carmin", + "block.friendsandfoes.dark_oak_beehive": "Ruche de chêne noir", + "block.friendsandfoes.jungle_beehive": "Ruche d'acajou", + "block.friendsandfoes.mangrove_beehive": "Ruche de palétuvier", + "block.friendsandfoes.spruce_beehive": "Ruche de sapin", + "block.friendsandfoes.warped_beehive": "Ruche biscornue", + "block.friendsandfoes.copper_button": "Bouton de cuivre", + "block.friendsandfoes.exposed_copper_button": "Bouton de cuivre exposé", + "block.friendsandfoes.weathered_copper_button": "Bouton de cuivre érodé", + "block.friendsandfoes.oxidized_copper_button": "Bouton de cuivre oxidé", + "block.friendsandfoes.waxed_copper_button": "Bouton de cuivre ciré", + "block.friendsandfoes.waxed_exposed_copper_button": "Bouton de cuivre exposé ciré", + "block.friendsandfoes.waxed_weathered_copper_button": "Bouton de cuivre érodé ciré", + "block.friendsandfoes.waxed_oxidized_copper_button": "Bouton de cuivre oxidé ciré", + "block.friendsandfoes.exposed_lightning_rod": "Paratonnerre exposé", + "block.friendsandfoes.weathered_lightning_rod": "Paratonnerre érodé", + "block.friendsandfoes.oxidized_lightning_rod": "Paratonnerre oxidé", + "block.friendsandfoes.waxed_lightning_rod": "Paratonnerre ciré", + "block.friendsandfoes.waxed_exposed_lightning_rod": "Paratonnerre exposé ciré", + "block.friendsandfoes.waxed_weathered_lightning_rod": "Paratonnerre érodé ciré", + "block.friendsandfoes.waxed_oxidized_lightning_rod": "Paratonnerre oxidé ciré", + "block.friendsandfoes.potted_buttercup": "Bouton d'Or en pot", + "block.friendsandfoes.crab_egg": "Oeuf de crabe", + "entity.minecraft.villager.beekeeper": "Apiculteur", + "entity.minecraft.villager.friendsandfoes.beekeeper": "Apiculteur", + "entity.friendsandfoes.copper_golem": "Golem de cuivre", + "entity.friendsandfoes.crab": "Crabe", + "entity.friendsandfoes.glare": "Glare", + "entity.friendsandfoes.iceologer": "Cryologiste", + "entity.friendsandfoes.moobloom": "Moobloom", + "entity.friendsandfoes.rascal": "Rascal", + "entity.friendsandfoes.mauler": "Mauler", + "entity.friendsandfoes.tuff_golem": "Golem de Tuf", + "entity.friendsandfoes.wildfire": "Wildfire", + "entity.friendsandfoes.player_illusion": "Illusion de Joueur", + "effect.friendsandfoes.reach": "Portée", + "effect.friendsandfoes.reach.description": "Augmente votre portée.", + "item_group.friendsandfoes.main_tab": "Friends & Foes", + "item.friendsandfoes.buttercup": "Bouton d'Or", + "item.friendsandfoes.glare_spawn_egg": "Oeuf d'apparition de glare", + "item.friendsandfoes.copper_golem_spawn_egg": "Oeuf d'apparition de golem de cuivre", + "item.friendsandfoes.crab_spawn_egg": "Oeuf d'apparition de crabe", + "item.friendsandfoes.iceologer_spawn_egg": "Oeuf d'apparition de cryologiste", + "item.friendsandfoes.illusioner_spawn_egg": "Oeuf d'apparition d'illusionniste", + "item.friendsandfoes.mauler_spawn_egg": "Oeuf d'apparition de mauler", + "item.friendsandfoes.moobloom_spawn_egg": "Oeuf d'apparition de moobloom", + "item.friendsandfoes.rascal_spawn_egg": "Oeuf d'apparition de rascal", + "item.friendsandfoes.tuff_golem_spawn_egg": "Oeuf d'apparition de golem de tuf", + "item.friendsandfoes.wildfire_spawn_egg": "Oeuf d'apparition de Wildfire", + "item.friendsandfoes.crab_claw": "Pince de crabe", + "item.friendsandfoes.totem_of_freezing": "Totem de Gel", + "item.friendsandfoes.totem_of_illusion": "Totem d'Illusion", + "item.friendsandfoes.wildfire_crown": "Couronne du Wildfire", + "item.friendsandfoes.wildfire_crown_fragment": "Fragment de Couronne du Wildfire", + "item.minecraft.potion.effect.reaching": "Potion de Portée", + "item.minecraft.splash_potion.effect.reaching": "Potion de Portée jetable", + "item.minecraft.lingering_potion.effect.reaching": "Potion de Portée persistante", + "item.minecraft.tipped_arrow.effect.reaching": "Flèche de Portée", + "subtitle.entity.friendsandfoes.glare.ambient": "Glare qui vole", + "subtitle.entity.friendsandfoes.glare.death": "Glare qui meurt", + "subtitle.entity.friendsandfoes.glare.eat": "Glare qui mange", + "subtitle.entity.friendsandfoes.glare.grumpiness": "Glare qui grogne", + "subtitle.entity.friendsandfoes.glare.grumpiness_short": "Glare qui grogne", + "subtitle.entity.friendsandfoes.glare.hurt": "Glare blessé", + "subtitle.entity.friendsandfoes.glare.rustle": "Glare qui grogne", + "subtitle.entity.friendsandfoes.glare.shake": "Glare qui se secoue", + "subtitle.entity.friendsandfoes.copper_golem.death": "Golem de Cuivre qui meurt", + "subtitle.entity.friendsandfoes.copper_golem.head_spin": "Golem de Cuivre qui fait tourner sa tête", + "subtitle.entity.friendsandfoes.copper_golem.hurt": "Golem de Cuivre blessé", + "subtitle.entity.friendsandfoes.copper_golem.repair": "Golem de Cuivre réparé", + "subtitle.entity.friendsandfoes.crab.death": "Crabe qui meurt", + "subtitle.entity.friendsandfoes.crab.hurt": "Crabe blessé", + "subtitle.entity.friendsandfoes.iceologer.ambient": "Murmure de Cryologiste", + "subtitle.entity.friendsandfoes.iceologer.cast_spell": "Cryologiste qui lance un sort", + "subtitle.entity.friendsandfoes.iceologer.death": "Cryologiste qui meurt", + "subtitle.entity.friendsandfoes.iceologer.hurt": "Cryologiste blessé", + "subtitle.entity.friendsandfoes.iceologer.prepare_slowness": "Cryologiste qui prépare Lenteur", + "subtitle.entity.friendsandfoes.iceologer.prepare_summon": "Cryologiste qui prépare Invocation", + "subtitle.entity.friendsandfoes.ice_chunk.ambient": "Morceau de glace qui craque", + "subtitle.entity.friendsandfoes.ice_chunk.hit": "Morceau de glace qui tombe", + "subtitle.entity.friendsandfoes.ice_chunk.summon": "Morceau de glace qui craque", + "subtitle.entity.friendsandfoes.mauler.bite": "Mauler qui mord", + "subtitle.entity.friendsandfoes.mauler.death": "Mauler qui meurt", + "subtitle.entity.friendsandfoes.mauler.growl": "Mauler qui grogne", + "subtitle.entity.friendsandfoes.mauler.hurt": "Mauler blessé", + "subtitle.entity.friendsandfoes.moobloom.convert": "Moobloom qui se transforme", + "subtitle.entity.friendsandfoes.player.mirror_move": "Joueur qui change de place", + "subtitle.entity.friendsandfoes.rascal.ambient": "Rascal qui nargue", + "subtitle.entity.friendsandfoes.rascal.disappear": "Rascal qui disparaît", + "subtitle.entity.friendsandfoes.rascal.nod": "Rascal qui hoche la tête", + "subtitle.entity.friendsandfoes.rascal.hurt": "Rascal blessé", + "subtitle.entity.friendsandfoes.rascal.reappear": "Rascal qui apparaît", + "subtitle.entity.friendsandfoes.rascal.reward": "Rascal qui donne une récompense", + "subtitle.entity.friendsandfoes.rascal.reward_bad": "Rascal qui donne une mauvaise récompense", + "subtitle.entity.friendsandfoes.shield_debris.impact": "Bouclier de débris impacté", + "subtitle.entity.friendsandfoes.tuff_golem.glue_on": "Golem de Tuf englué", + "subtitle.entity.friendsandfoes.tuff_golem.glue_off": "Golem de Tuf libéré", + "subtitle.entity.friendsandfoes.tuff_golem.hurt": "Golem de Tuf blessé", + "subtitle.entity.friendsandfoes.tuff_golem.move": "Golem de Tuf qui bouge", + "subtitle.entity.friendsandfoes.tuff_golem.repair": "Golem de Tuf réparé", + "subtitle.entity.friendsandfoes.tuff_golem.wake": "Golem de Tuf qui se réveille", + "subtitle.entity.friendsandfoes.tuff_golem.sleep": "Golem de Tuf qui s'endort", + "subtitle.entity.friendsandfoes.wildfire.ambient": "Souffle de Wildfire", + "subtitle.entity.friendsandfoes.wildfire.death": "Wildfire qui meurt", + "subtitle.entity.friendsandfoes.wildfire.hurt": "Wildfire blessé", + "subtitle.entity.friendsandfoes.wildfire.shield_break": "Bouclier du Wildfire qui se brise", + "subtitle.entity.friendsandfoes.wildfire.shockwave": "Onde de choc du Wildfire", + "subtitle.entity.friendsandfoes.wildfire.shoot": "Wildfire qui tire", + "subtitle.entity.friendsandfoes.wildfire.summon_blaze": "Wildfire qui invoque des blazes", + "trinkets.slot.charm.charm": "Charme", + "text.betterf3.line.glares": "Glares", + "text.betterf3.line.rascals": "Rascals" +} \ No newline at end of file diff --git a/common/src/main/resources/assets/friendsandfoes/lang/zh_tw.json b/common/src/main/resources/assets/friendsandfoes/lang/zh_tw.json new file mode 100644 index 00000000..bec7d603 --- /dev/null +++ b/common/src/main/resources/assets/friendsandfoes/lang/zh_tw.json @@ -0,0 +1,145 @@ +{ + "advancements.husbandry.beehive.title": "蜂流人物", + "advancements.husbandry.beehive.description": "獲得所有木材的蜂箱", + "advancements.adventure.kill_iceologer.title": "我來了!我...", + "advancements.adventure.kill_iceologer.description": "殺死冰術師", + "advancements.adventure.kill_illusioner.title": "打破幻象", + "advancements.adventure.kill_illusioner.description": "殺死幻術師的真身", + "advancements.husbandry.shear_a_moobloom.title": "哞磅!", + "advancements.husbandry.shear_a_moobloom.description": "修剪哞花", + "advancements.adventure.summon_copper_golem.title": "動吧", + "advancements.adventure.summon_copper_golem.description": "召喚銅傀儡", + "advancements.husbandry.tame_a_glare.title": "猛萌的", + "advancements.husbandry.tame_a_glare.description": "馴服逐爍", + "advancements.adventure.the_magicians.title": "術師集結", + "advancements.adventure.the_magicians.description": "殺死三個災厄術師", + "advancements.adventure.it_bites.title": "別咬了", + "advancements.adventure.it_bites.description": "殺死暴吞", + "advancements.survival.activate_zombie_horse_trap.title": "風雨中的騎士", + "advancements.survival.activate_zombie_horse_trap.description": "中了殭屍馬的陷阱", + "advancements.nether.find_citadel.title": "地獄基地", + "advancements.nether.find_citadel.description": "進入地獄基地", + "advancements.nether.kill_wildfire.title": "燙手山芋", + "advancements.nether.kill_wildfire.description": "殺死狂焰", + "advancements.nether.obtain_wildfire_crown.title": "誰才是地獄之王?", + "advancements.nether.obtain_wildfire_crown.description": "獲得狂焰冠冕", + "advancements.adventure.complete_hide_and_seek_game.title": "躲貓貓", + "advancements.adventure.complete_hide_and_seek_game.description": "贏得淘氣遊戲", + "block.friendsandfoes.buttercup": "毛茛", + "block.minecraft.beehive": "橡木蜂箱", + "block.friendsandfoes.acacia_beehive": "相思木蜂箱", + "block.friendsandfoes.bamboo_beehive": "竹木蜂箱", + "block.friendsandfoes.birch_beehive": "樺木蜂箱", + "block.friendsandfoes.cherry_beehive": "櫻花木蜂箱", + "block.friendsandfoes.crimson_beehive": "緋紅蕈木蜂箱", + "block.friendsandfoes.dark_oak_beehive": "黑橡木蜂箱", + "block.friendsandfoes.jungle_beehive": "叢林木蜂箱", + "block.friendsandfoes.mangrove_beehive": "紅樹林木蜂箱", + "block.friendsandfoes.spruce_beehive": "杉木蜂箱", + "block.friendsandfoes.warped_beehive": "扭曲蕈木蜂箱", + "block.friendsandfoes.copper_button": "銅按鈕", + "block.friendsandfoes.exposed_copper_button": "斑駁銅按鈕", + "block.friendsandfoes.weathered_copper_button": "風化的銅按鈕", + "block.friendsandfoes.oxidized_copper_button": "氧化的銅按鈕", + "block.friendsandfoes.waxed_copper_button": "上蠟的銅按鈕", + "block.friendsandfoes.waxed_exposed_copper_button": "上蠟的斑駁銅按鈕", + "block.friendsandfoes.waxed_weathered_copper_button": "上蠟的風化銅按鈕", + "block.friendsandfoes.waxed_oxidized_copper_button": "上蠟的氧化銅按鈕", + "block.friendsandfoes.exposed_lightning_rod": "斑駁避雷針", + "block.friendsandfoes.weathered_lightning_rod": "風化避雷針", + "block.friendsandfoes.oxidized_lightning_rod": "氧化避雷針", + "block.friendsandfoes.waxed_lightning_rod": "上蠟的避雷針", + "block.friendsandfoes.waxed_exposed_lightning_rod": "上蠟的斑駁避雷針", + "block.friendsandfoes.waxed_weathered_lightning_rod": "上蠟的風化避雷針", + "block.friendsandfoes.waxed_oxidized_lightning_rod": "上蠟的氧化避雷針", + "block.friendsandfoes.potted_buttercup": "毛茛盆栽", + "block.friendsandfoes.crab_egg": "螃蟹蛋", + "entity.minecraft.villager.beekeeper": "養蜂人", + "entity.minecraft.villager.friendsandfoes.beekeeper": "養蜂人", + "entity.friendsandfoes.copper_golem": "銅傀儡", + "entity.friendsandfoes.crab": "螃蟹", + "entity.friendsandfoes.glare": "逐爍", + "entity.friendsandfoes.iceologer": "冰術師", + "entity.friendsandfoes.moobloom": "哞花", + "entity.friendsandfoes.rascal": "淘氣", + "entity.friendsandfoes.mauler": "暴吞", + "entity.friendsandfoes.tuff_golem": "凝灰岩傀儡", + "entity.friendsandfoes.wildfire": "狂焰", + "effect.friendsandfoes.reach": "螯手", + "effect.friendsandfoes.reach.description": "增加方塊選取範圍", + "item_group.friendsandfoes.main_tab": "Friends & Foes", + "item.friendsandfoes.buttercup": "毛茛", + "item.friendsandfoes.glare_spawn_egg": "逐爍 生怪蛋", + "item.friendsandfoes.copper_golem_spawn_egg": "銅傀儡 生怪蛋", + "item.friendsandfoes.crab_spawn_egg": "螃蟹 生怪蛋", + "item.friendsandfoes.iceologer_spawn_egg": "冰術師 生怪蛋", + "item.friendsandfoes.illusioner_spawn_egg": "幻術施 生怪蛋", + "item.friendsandfoes.mauler_spawn_egg": "暴吞 生怪蛋", + "item.friendsandfoes.moobloom_spawn_egg": "哞花 生怪蛋", + "item.friendsandfoes.rascal_spawn_egg": "淘氣 生怪蛋", + "item.friendsandfoes.tuff_golem_spawn_egg": "凝灰岩傀儡 生怪蛋", + "item.friendsandfoes.wildfire_spawn_egg": "狂焰 生怪蛋", + "item.friendsandfoes.crab_claw": "螃蟹螯", + "item.friendsandfoes.totem_of_freezing": "結霜圖騰", + "item.friendsandfoes.totem_of_illusion": "幻象圖騰", + "item.friendsandfoes.wildfire_crown": "狂焰冠冕", + "item.friendsandfoes.wildfire_crown_fragment": "狂焰皇冠碎片", + "item.minecraft.potion.effect.reaching": "螯手藥水", + "item.minecraft.splash_potion.effect.reaching": "飛濺螯手藥水", + "item.minecraft.lingering_potion.effect.reaching": "滯留螯手藥水", + "item.minecraft.tipped_arrow.effect.reaching": "螯手之箭", + "subtitle.entity.friendsandfoes.glare.ambient": "逐爍嗡嗡聲", + "subtitle.entity.friendsandfoes.glare.death": "逐爍死亡", + "subtitle.entity.friendsandfoes.glare.eat": "逐爍進食", + "subtitle.entity.friendsandfoes.glare.grumpiness": "逐爍焦慮", + "subtitle.entity.friendsandfoes.glare.grumpiness_short": "逐爍焦慮", + "subtitle.entity.friendsandfoes.glare.hurt": "逐爍受傷", + "subtitle.entity.friendsandfoes.glare.rustle": "逐爍沙沙聲", + "subtitle.entity.friendsandfoes.glare.shake": "逐爍抖落螢光莓", + "subtitle.entity.friendsandfoes.copper_golem.death": "銅傀儡死亡", + "subtitle.entity.friendsandfoes.copper_golem.head_spin": "銅傀儡查看", + "subtitle.entity.friendsandfoes.copper_golem.hurt": "銅傀儡受傷", + "subtitle.entity.friendsandfoes.copper_golem.repair": "銅傀儡恢復", + "subtitle.entity.friendsandfoes.crab.death": "螃蟹死亡", + "subtitle.entity.friendsandfoes.crab.hurt": "螃蟹受傷", + "subtitle.entity.friendsandfoes.iceologer.ambient": "冰術師呢喃", + "subtitle.entity.friendsandfoes.iceologer.cast_spell": "冰術師施咒", + "subtitle.entity.friendsandfoes.iceologer.death": "冰術師死亡", + "subtitle.entity.friendsandfoes.iceologer.hurt": "冰術師受傷", + "subtitle.entity.friendsandfoes.iceologer.prepare_slowness": "冰術師準備", + "subtitle.entity.friendsandfoes.iceologer.prepare_summon": "冰術師召喚", + "subtitle.entity.friendsandfoes.ice_chunk.ambient": "冰狀雲碎裂", + "subtitle.entity.friendsandfoes.ice_chunk.hit": "冰狀雲墜落", + "subtitle.entity.friendsandfoes.ice_chunk.summon": "冰狀雲出現", + "subtitle.entity.friendsandfoes.mauler.bite": "暴吞咬下", + "subtitle.entity.friendsandfoes.mauler.death": "暴吞死亡", + "subtitle.entity.friendsandfoes.mauler.growl": "暴吞咆哮", + "subtitle.entity.friendsandfoes.mauler.hurt": "暴吞受傷", + "subtitle.entity.friendsandfoes.moobloom.convert": "哞花轉變", + "subtitle.entity.friendsandfoes.player.mirror_move": "替換", + "subtitle.entity.friendsandfoes.rascal.ambient": "淘氣偷笑", + "subtitle.entity.friendsandfoes.rascal.disappear": "淘氣消失", + "subtitle.entity.friendsandfoes.rascal.nod": "淘氣點點頭", + "subtitle.entity.friendsandfoes.rascal.hurt": "淘氣受傷", + "subtitle.entity.friendsandfoes.rascal.reappear": "淘氣出現", + "subtitle.entity.friendsandfoes.rascal.reward": "淘氣給予", + "subtitle.entity.friendsandfoes.rascal.reward_bad": "淘氣給予", + "subtitle.entity.friendsandfoes.shield_debris.impact": "盾牌影響", + "subtitle.entity.friendsandfoes.tuff_golem.glue_on": "凝灰岩傀儡上蠟", + "subtitle.entity.friendsandfoes.tuff_golem.glue_off": "凝灰岩傀儡除蠟", + "subtitle.entity.friendsandfoes.tuff_golem.hurt": "凝灰岩傀儡受傷", + "subtitle.entity.friendsandfoes.tuff_golem.move": "凝灰岩傀儡移動", + "subtitle.entity.friendsandfoes.tuff_golem.repair": "凝灰岩傀儡恢復", + "subtitle.entity.friendsandfoes.tuff_golem.wake": "凝灰岩傀儡起床", + "subtitle.entity.friendsandfoes.tuff_golem.sleep": "凝灰岩傀儡入眠", + "subtitle.entity.friendsandfoes.wildfire.ambient": "狂焰呼吸", + "subtitle.entity.friendsandfoes.wildfire.death": "狂焰死亡", + "subtitle.entity.friendsandfoes.wildfire.hurt": "狂焰受傷", + "subtitle.entity.friendsandfoes.wildfire.shield_break": "狂焰盾牌碎裂", + "subtitle.entity.friendsandfoes.wildfire.shockwave": "狂焰衝擊", + "subtitle.entity.friendsandfoes.wildfire.shoot": "狂焰發射", + "subtitle.entity.friendsandfoes.wildfire.summon_blaze": "狂焰召喚", + "trinkets.slot.charm.charm": "Charm", + "text.betterf3.line.glares": "Glares", + "text.betterf3.line.rascals": "Rascals" +} \ No newline at end of file From 2f40d1275e8d44d702320baff2d02adfdd4227ae Mon Sep 17 00:00:00 2001 From: Faboslav Date: Thu, 14 Nov 2024 16:01:55 +0100 Subject: [PATCH 3/7] Fixed carpet incompability --- .../faboslav/friendsandfoes/common/mixin/ServerWorldMixin.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/mixin/ServerWorldMixin.java b/common/src/main/java/com/faboslav/friendsandfoes/common/mixin/ServerWorldMixin.java index f371ab3c..d3df4b95 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/mixin/ServerWorldMixin.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/mixin/ServerWorldMixin.java @@ -60,6 +60,7 @@ public void friendsandfoes_addZombieHorseSpawnEvent( int j = chunkPos.getStartZ(); Profiler profiler = this.getProfiler(); profiler.push("thunder2"); + if ( this.isRaining() && this.isThundering() @@ -83,6 +84,8 @@ public void friendsandfoes_addZombieHorseSpawnEvent( this.spawnEntity(lightningEntity); } + + profiler.pop(); } } From 5a976aefcabacb4f3cb21736d61dbb4edfee59d3 Mon Sep 17 00:00:00 2001 From: Faboslav Date: Thu, 14 Nov 2024 16:02:32 +0100 Subject: [PATCH 4/7] Updated changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 181d85ed..982c5001 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ - Fixed strong potion of reaching duration - Fixed iceologer model +- Fixed carpet profiler incompatibility - Added more config options - Added zh_tw translations (Thanks to Lobster0228) - Added fr_fr translations (Thanks to Franco227) From 23c7371a118ff60ab234d5b4a9243ee7f86c2ce5 Mon Sep 17 00:00:00 2001 From: Faboslav Date: Thu, 14 Nov 2024 16:03:21 +0100 Subject: [PATCH 5/7] Updated pt_br translation --- CHANGELOG.md | 1 + .../assets/friendsandfoes/lang/pt_br.json | 220 +++++++++--------- 2 files changed, 117 insertions(+), 104 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 982c5001..805f20d2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ - Added more config options - Added zh_tw translations (Thanks to Lobster0228) - Added fr_fr translations (Thanks to Franco227) +- Added pt_br translations (Thanks to demorogabrtz) - Updated advancements - Updated uk_ua translations (Thanks to unroman) diff --git a/common/src/main/resources/assets/friendsandfoes/lang/pt_br.json b/common/src/main/resources/assets/friendsandfoes/lang/pt_br.json index c839bd71..0dcddf09 100644 --- a/common/src/main/resources/assets/friendsandfoes/lang/pt_br.json +++ b/common/src/main/resources/assets/friendsandfoes/lang/pt_br.json @@ -1,135 +1,147 @@ { - "advancements.husbandry.beehive.title": "Abelha em Pessoa", + "advancements.husbandry.beehive.title": "Apicultor", "advancements.husbandry.beehive.description": "Obtenha todos os tipos de colmeias", "advancements.adventure.kill_iceologer.title": "Eu estive aqui, eu vivi, eu...", - "advancements.adventure.kill_iceologer.description": "Mate o iceologer", - "advancements.adventure.kill_illusioner.title": "Mundo de ilusão", - "advancements.adventure.kill_illusioner.description": "Mate o Ilusionista... se ele sequer é real", - "advancements.husbandry.shear_a_moobloom.title": "MuuBum!", - "advancements.husbandry.shear_a_moobloom.description": "Tosquie uma vaca florida", - "advancements.adventure.summon_copper_golem.title": "Vai Lá", - "advancements.adventure.summon_copper_golem.description": "Invoque um golem de cobre", + "advancements.adventure.kill_iceologer.description": "Mate o Iceologer", + "advancements.adventure.kill_illusioner.title": "Mundo de Ilusão", + "advancements.adventure.kill_illusioner.description": "Mate o Ilusionista... se ele realmente existir", + "advancements.husbandry.shear_a_moobloom.title": "MooBoom!", + "advancements.husbandry.shear_a_moobloom.description": "Tosquie uma Moobloom", + "advancements.adventure.summon_copper_golem.title": "Lá vai ele", + "advancements.adventure.summon_copper_golem.description": "Invoque um Golem de Cobre", "advancements.husbandry.tame_a_glare.title": "Mal-humorado e Fofo", - "advancements.husbandry.tame_a_glare.description": "Domestique um glare", - "advancements.adventure.the_magicians.title": "Os Mágicos", - "advancements.adventure.the_magicians.description": "Mate todos os três illagers mágicos", - "advancements.adventure.it_bites.title": "Isso Morde", - "advancements.adventure.it_bites.description": "Mate o malhador", - "advancements.survival.activate_zombie_horse_trap.title": "Cavaleiros da Tempestade", + "advancements.husbandry.tame_a_glare.description": "Domestique um Glare", + "advancements.adventure.the_magicians.title": "Os Magos", + "advancements.adventure.the_magicians.description": "Mate todos os três magos Illager", + "advancements.adventure.it_bites.title": "Morde", + "advancements.adventure.it_bites.description": "Mate o Mauler", + "advancements.survival.activate_zombie_horse_trap.title": "Cavaleiros na Tempestade", "advancements.survival.activate_zombie_horse_trap.description": "Ative uma armadilha de cavalo zumbi", "advancements.nether.find_citadel.title": "Uma fortaleza? Não, uma cidadela!", - "advancements.nether.find_citadel.description": "Entre numa Cidadela do nether", - "advancements.nether.kill_wildfire.title": "Solte como se estivesse quente", - "advancements.nether.kill_wildfire.description": "Mate o wildfire", - "advancements.nether.obtain_wildfire_crown.title": "Quem é o Novo Rei do Inferno?", - "advancements.nether.obtain_wildfire_crown.description": "Tenha uma coroa wildfire em seu inventário", - "advancements.adventure.complete_hide_and_seek_game.title": "Esconde Esconde", - "advancements.adventure.complete_hide_and_seek_game.description": "Encontre um malandro três vezes em seu joguinho", - "block.friendsandfoes.buttercup": "Crisântemo", - "block.minecraft.beehive": "Colméia de Carvalho", - "block.friendsandfoes.acacia_beehive": "Colméia de Acácia", - "block.friendsandfoes.bamboo_beehive": "Colméia de Bambu", - "block.friendsandfoes.birch_beehive": "Colméia de Bétula", - "block.friendsandfoes.cherry_beehive": "Colméia de Cerejeira", - "block.friendsandfoes.crimson_beehive": "Colméia de Carmesim", - "block.friendsandfoes.dark_oak_beehive": "Colméia de Carvalho Escuro", - "block.friendsandfoes.jungle_beehive": "Colméia da Selva", - "block.friendsandfoes.mangrove_beehive": "Colméia de Mangue", - "block.friendsandfoes.spruce_beehive": "Colméia de Pinheiro", - "block.friendsandfoes.warped_beehive": "Colméia Distorcida", - "block.friendsandfoes.copper_button": "Botão de Cobre", - "block.friendsandfoes.exposed_copper_button": "Botão de Cobre Exposto", - "block.friendsandfoes.weathered_copper_button": "Botão de Cobre Desgastado", - "block.friendsandfoes.oxidized_copper_button": "Botão de Cobre Oxidado", - "block.friendsandfoes.waxed_copper_button": "Botão de Cobre Encerado", - "block.friendsandfoes.waxed_exposed_copper_button": "Botão de Cobre Exposto Encerado", - "block.friendsandfoes.waxed_weathered_copper_button": "Botão de Cobre Desgastado Encerado", - "block.friendsandfoes.waxed_oxidized_copper_button": "Botão de Cobre Oxidado Encerado", - "block.friendsandfoes.exposed_lightning_rod": "Para-raio Exposto", - "block.friendsandfoes.weathered_lightning_rod": "Para-raio Desgastado", - "block.friendsandfoes.oxidized_lightning_rod": "Para-raio Oxidado", - "block.friendsandfoes.waxed_lightning_rod": "Para-raio Encerado", - "block.friendsandfoes.waxed_exposed_lightning_rod": "Para-raio Exposto Encerado", - "block.friendsandfoes.waxed_weathered_lightning_rod": "Para-raio Desgastado Encerado", - "block.friendsandfoes.waxed_oxidized_lightning_rod": "Para-raio Oxidado Encerado", - "block.friendsandfoes.potted_buttercup": "Crisântemo em Vaso", + "advancements.nether.find_citadel.description": "Entre em uma cidadela do Nether", + "advancements.nether.kill_wildfire.title": "Derrube como se estivesse quente", + "advancements.nether.kill_wildfire.description": "Mate o Wildfire", + "advancements.nether.obtain_wildfire_crown.title": "Quem é o novo rei do inferno?", + "advancements.nether.obtain_wildfire_crown.description": "Tenha uma coroa de Wildfire em seu inventário", + "advancements.adventure.complete_hide_and_seek_game.title": "Esconde-esconde", + "advancements.adventure.complete_hide_and_seek_game.description": "Encontre um Rascal três vezes em seu pequeno jogo", + + "block.friendsandfoes.buttercup": "Flor de botão", + "block.minecraft.beehive": "Colmeia de carvalho", + "block.friendsandfoes.acacia_beehive": "Colmeia de acácia", + "block.friendsandfoes.bamboo_beehive": "Colmeia de bambu", + "block.friendsandfoes.birch_beehive": "Colmeia de bétula", + "block.friendsandfoes.cherry_beehive": "Colmeia de cerejeira", + "block.friendsandfoes.crimson_beehive": "Colmeia carmesim", + "block.friendsandfoes.dark_oak_beehive": "Colmeia de carvalho escuro", + "block.friendsandfoes.jungle_beehive": "Colmeia da selva", + "block.friendsandfoes.mangrove_beehive": "Colmeia de mangue", + "block.friendsandfoes.spruce_beehive": "Colmeia de abeto", + "block.friendsandfoes.warped_beehive": "Colmeia deformada", + "block.friendsandfoes.copper_button": "Botão de cobre", + "block.friendsandfoes.exposed_copper_button": "Botão de cobre exposto", + "block.friendsandfoes.weathered_copper_button": "Botão de cobre envelhecido", + "block.friendsandfoes.oxidized_copper_button": "Botão de cobre oxidado", + "block.friendsandfoes.waxed_copper_button": "Botão de cobre encerado", + "block.friendsandfoes.waxed_exposed_copper_button": "Botão de cobre encerado exposto", + "block.friendsandfoes.waxed_weathered_copper_button": "Botão de cobre encerado envelhecido", + "block.friendsandfoes.waxed_oxidized_copper_button": "Botão de cobre encerado oxidado", + "block.friendsandfoes.exposed_lightning_rod": "Pára-raios exposto", + "block.friendsandfoes.weathered_lightning_rod": "Pára-raios envelhecido", + "block.friendsandfoes.oxidized_lightning_rod": "Pára-raios oxidado", + "block.friendsandfoes.waxed_lightning_rod": "Pára-raios encerado", + "block.friendsandfoes.waxed_exposed_lightning_rod": "Pára-raios encerado exposto", + "block.friendsandfoes.waxed_weathered_lightning_rod": "Pára-raios encerado envelhecido", + "block.friendsandfoes.waxed_oxidized_lightning_rod": "Pára-raios encerado oxidado", + "block.friendsandfoes.potted_buttercup": "Flor de botão em vaso", + "block.friendsandfoes.crab_egg": "Ovo de caranguejo", "entity.minecraft.villager.beekeeper": "Apicultor", "entity.minecraft.villager.friendsandfoes.beekeeper": "Apicultor", - "entity.friendsandfoes.copper_golem": "Golem de Cobre", + "entity.friendsandfoes.copper_golem": "Golem de cobre", + "entity.friendsandfoes.crab": "Caranguejo", "entity.friendsandfoes.glare": "Glare", "entity.friendsandfoes.iceologer": "Iceologer", - "entity.friendsandfoes.moobloom": "Vaca Florida", - "entity.friendsandfoes.rascal": "Malandro", - "entity.friendsandfoes.mauler": "Malhador", - "entity.friendsandfoes.tuff_golem": "Golem de Tufo", - "entity.friendsandfoes.wildfire": "Wildfire", - "item.friendsandfoes.buttercup": "Crisântemo em Vaso", - "item.friendsandfoes.glare_spawn_egg": "Ovo Invocador de Glare", - "item.friendsandfoes.copper_golem_spawn_egg": "Ovo Invocador de Golem de Cobre", - "item.friendsandfoes.iceologer_spawn_egg": "Ovo Invocador de Iceologer", - "item.friendsandfoes.illusioner_spawn_egg": "Ovo Invocador de Ilusionista", - "item.friendsandfoes.mauler_spawn_egg": "Ovo Invocador de Malhador", - "item.friendsandfoes.moobloom_spawn_egg": "Ovo Invocador de Vaca Florida", - "item.friendsandfoes.rascal_spawn_egg": "Ovo Invocador de Malandro", - "item.friendsandfoes.tuff_golem_spawn_egg": "Ovo Invocador de Golem de Tufo", - "item.friendsandfoes.wildfire_spawn_egg": "Ovo Invocador de Wildfire", - "item.friendsandfoes.totem_of_freezing": "Totem de Congelamento", - "item.friendsandfoes.totem_of_illusion": "Totem da Ilusão", - "item.friendsandfoes.wildfire_crown": "Coroa Wildfire", - "item.friendsandfoes.wildfire_crown_fragment": "Fragmento da Coroa Wildfire", + "entity.friendsandfoes.moobloom": "Moobloom", + "entity.friendsandfoes.rascal": "Rascal", + "entity.friendsandfoes.mauler": "Mauler", + "entity.friendsandfoes.tuff_golem": "Golem de tufo", + "entity.friendsandfoes.wildfire": "Incêndio", + "effect.friendsandfoes.reach": "Alcance", + "effect.friendsandfoes.reach.description": "Aumenta o alcance da interação do bloco.", + "item_group.friendsandfoes.main_tab": "Amigos e Inimigos", + "item.friendsandfoes.buttercup": "Flor de botão", + "item.friendsandfoes.glare_spawn_egg": "Ovo gerador de glare", + "item.friendsandfoes.copper_golem_spawn_egg": "Ovo gerador de golem de cobre", + "item.friendsandfoes.crab_spawn_egg": "Ovo gerador de caranguejo", + "item.friendsandfoes.iceologer_spawn_egg": "Ovo gerador de iceologer", + "item.friendsandfoes.illusioner_spawn_egg": "Ovo gerador de ilusionista", + "item.friendsandfoes.mauler_spawn_egg": "Ovo gerador de mauler", + "item.friendsandfoes.moobloom_spawn_egg": "Ovo gerador de moobloom", + "item.friendsandfoes.rascal_spawn_egg": "Ovo gerador de rascal", + "item.friendsandfoes.tuff_golem_spawn_egg": "Ovo gerador de golem de tufo", + "item.friendsandfoes.wildfire_spawn_egg": "Ovo gerador de incêndio", + "item.friendsandfoes.crab_claw": "Garra de caranguejo", + "item.friendsandfoes.totem_of_freezing": "Totem de congelamento", + "item.friendsandfoes.totem_of_illusion": "Totem de ilusão", + "item.friendsandfoes.wildfire_crown": "Coroa de incêndio", + "item.friendsandfoes.wildfire_crown_fragment": "Fragmento de coroa de incêndio", + "item.minecraft.potion.effect.reaching": "Poção de alcance", + "item.minecraft.splash_potion.effect.reaching": "Poção de alcance arremessável", + "item.minecraft.lingering_potion.effect.reaching": "Poção de alcance persistente", + "item.minecraft.tipped_arrow.effect.reaching": "Flecha de alcance", + "subtitle.entity.friendsandfoes.glare.ambient": "Glare voa", "subtitle.entity.friendsandfoes.glare.death": "Glare morre", "subtitle.entity.friendsandfoes.glare.eat": "Glare come", "subtitle.entity.friendsandfoes.glare.grumpiness": "Glare resmunga", "subtitle.entity.friendsandfoes.glare.grumpiness_short": "Glare resmunga", - "subtitle.entity.friendsandfoes.glare.hurt": "Glare é ferido", - "subtitle.entity.friendsandfoes.glare.rustle": "Glare se agita", - "subtitle.entity.friendsandfoes.glare.shake": "Glare sacode as bagas brilhantes", - "subtitle.entity.friendsandfoes.copper_golem.death": "Golem de Cobre morre", - "subtitle.entity.friendsandfoes.copper_golem.head_spin": "Golem de Cobre gira a cabeça", - "subtitle.entity.friendsandfoes.copper_golem.hurt": "Golem de Cobre é ferido", - "subtitle.entity.friendsandfoes.copper_golem.repair": "Golem de Cobre é reparado", - "subtitle.entity.friendsandfoes.copper_golem.step": "Passos", + "subtitle.entity.friendsandfoes.glare.hurt": "Glare se machuca", + "subtitle.entity.friendsandfoes.glare.rustle": "Glare resmunga", + "subtitle.entity.friendsandfoes.glare.shake": "Glare sacode bagas luminosas", + "subtitle.entity.friendsandfoes.copper_golem.death": "Golem de cobre morre", + "subtitle.entity.friendsandfoes.copper_golem.head_spin": "Golem de cobre gira a cabeça", + "subtitle.entity.friendsandfoes.copper_golem.hurt": "Golem de cobre se machuca", + "subtitle.entity.friendsandfoes.copper_golem.repair": "Golem de cobre reparado", + "subtitle.entity.friendsandfoes.crab.death": "Caranguejo morre", + "subtitle.entity.friendsandfoes.crab.hurt": "Caranguejo se machuca", "subtitle.entity.friendsandfoes.iceologer.ambient": "Iceologer murmura", "subtitle.entity.friendsandfoes.iceologer.cast_spell": "Iceologer lança feitiço", "subtitle.entity.friendsandfoes.iceologer.death": "Iceologer morre", - "subtitle.entity.friendsandfoes.iceologer.hurt": "Iceologer é ferido", + "subtitle.entity.friendsandfoes.iceologer.hurt": "Iceologer se machuca", "subtitle.entity.friendsandfoes.iceologer.prepare_slowness": "Iceologer prepara lentidão", - "subtitle.entity.friendsandfoes.iceologer.prepare_summon": "Iceologer prepara convocação", + "subtitle.entity.friendsandfoes.iceologer.prepare_summon": "Iceologer prepara invocação", "subtitle.entity.friendsandfoes.ice_chunk.ambient": "Pedaço de gelo racha", "subtitle.entity.friendsandfoes.ice_chunk.hit": "Pedaço de gelo cai", "subtitle.entity.friendsandfoes.ice_chunk.summon": "Pedaço de gelo racha", - "subtitle.entity.friendsandfoes.mauler.bite": "Malhador morde", - "subtitle.entity.friendsandfoes.mauler.death": "Malhador morre", - "subtitle.entity.friendsandfoes.mauler.growl": "Malhador rosna", - "subtitle.entity.friendsandfoes.mauler.hurt": "Malhador é ferido", - "subtitle.entity.friendsandfoes.moobloom.convert": "Vaca Florida se transforma", + "subtitle.entity.friendsandfoes.mauler.bite": "Mauler morde", + "subtitle.entity.friendsandfoes.mauler.death": "Mauler morre", + "subtitle.entity.friendsandfoes.mauler.growl": "Mauler rosna", + "subtitle.entity.friendsandfoes.mauler.hurt": "Mauler se machuca", + "subtitle.entity.friendsandfoes.moobloom.convert": "Moobloom se transforma", "subtitle.entity.friendsandfoes.player.mirror_move": "Jogador se desloca", "subtitle.entity.friendsandfoes.rascal.ambient": "Rascal provoca", "subtitle.entity.friendsandfoes.rascal.disappear": "Rascal desaparece", - "subtitle.entity.friendsandfoes.rascal.nod": "Rascal acena com a cabeça", - "subtitle.entity.friendsandfoes.rascal.hurt": "Rascal é ferido", + "subtitle.entity.friendsandfoes.rascal.nod": "Rascal acena", + "subtitle.entity.friendsandfoes.rascal.hurt": "Rascal se machuca", "subtitle.entity.friendsandfoes.rascal.reappear": "Rascal aparece", - "subtitle.entity.friendsandfoes.rascal.reward": "Rascal dá recompensa", + "subtitle.entity.friendsandfoes.rascal.reward": "Rascal dá uma recompensa", "subtitle.entity.friendsandfoes.rascal.reward_bad": "Rascal dá uma recompensa ruim", - "subtitle.entity.friendsandfoes.shield_debris.impact": "Detritos do escudo impactam", - "subtitle.entity.friendsandfoes.tuff_golem.glue_on": "Tuff Golem colado", - "subtitle.entity.friendsandfoes.tuff_golem.glue_off": "Tuff Golem descolado", - "subtitle.entity.friendsandfoes.tuff_golem.hurt": "Tuff Golem é ferido", - "subtitle.entity.friendsandfoes.tuff_golem.move": "Tuff Golem se move", - "subtitle.entity.friendsandfoes.tuff_golem.repair": "Tuff Golem reparado", - "subtitle.entity.friendsandfoes.tuff_golem.wake": "Tuff Golem acorda", - "subtitle.entity.friendsandfoes.tuff_golem.sleep": "Tuff Golem vai dormir", - "subtitle.entity.friendsandfoes.tuff_golem.step": "Passos", + "subtitle.entity.friendsandfoes.shield_debris.impact": "Destroços de escudo impactados", + "subtitle.entity.friendsandfoes.tuff_golem.glue_on": "Golem de tufo colado", + "subtitle.entity.friendsandfoes.tuff_golem.glue_off": "Golem de tufo descolado", + "subtitle.entity.friendsandfoes.tuff_golem.hurt": "Golem de tufo se machuca", + "subtitle.entity.friendsandfoes.tuff_golem.move": "Golem de tufo se move", + "subtitle.entity.friendsandfoes.tuff_golem.repair": "Golem de tufo reparado", + "subtitle.entity.friendsandfoes.tuff_golem.wake": "Golem de tufo acorda", + "subtitle.entity.friendsandfoes.tuff_golem.sleep": "Golem de tufo adormece", "subtitle.entity.friendsandfoes.wildfire.ambient": "Wildfire respira", "subtitle.entity.friendsandfoes.wildfire.death": "Wildfire morre", - "subtitle.entity.friendsandfoes.wildfire.hurt": "Wildfire é ferido", - "subtitle.entity.friendsandfoes.wildfire.shield_break": "Escudo do Wildfire quebra", - "subtitle.entity.friendsandfoes.wildfire.shockwave": "Wildfire causa ondas de choque", + "subtitle.entity.friendsandfoes.wildfire.hurt": "Wildfire se machuca", + "subtitle.entity.friendsandfoes.wildfire.shield_break": "Escudo de Wildfire quebra", + "subtitle.entity.friendsandfoes.wildfire.shockwave": "Wildfire gera onda de choque", "subtitle.entity.friendsandfoes.wildfire.shoot": "Wildfire atira", - "subtitle.entity.friendsandfoes.wildfire.step": "Passos", - "subtitle.entity.friendsandfoes.wildfire.summon_blaze": "Wildfire convoca blazes", - "trinkets.slot.charm.charm": "Charm", - "text.betterf3.line.glares": "Glares", - "text.betterf3.line.rascals": "Malandros" + "subtitle.entity.friendsandfoes.wildfire.summon_blaze": "Wildfire invoca blazes", + "trinkets.slot.charm.charm": "Amuleto", + "text.betterf3.line.glares": "Glare", + "text.betterf3.line.rascals": "Rascals" } \ No newline at end of file From 8a0999160c62acbb9442d28f0e5a10bdf754269b Mon Sep 17 00:00:00 2001 From: Faboslav Date: Thu, 14 Nov 2024 16:23:14 +0100 Subject: [PATCH 6/7] Compostable buttercup --- CHANGELOG.md | 1 + .../com/faboslav/friendsandfoes/common/FriendsAndFoes.java | 1 + .../friendsandfoes/common/init/FriendsAndFoesItems.java | 5 +++++ common/src/main/resources/friendsandfoes.accesswidener | 3 ++- 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 805f20d2..e8fb291c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ - Fixed strong potion of reaching duration - Fixed iceologer model - Fixed carpet profiler incompatibility +- Fixed buttercup not being compostable - Added more config options - Added zh_tw translations (Thanks to Lobster0228) - Added fr_fr translations (Thanks to Franco227) diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/FriendsAndFoes.java b/common/src/main/java/com/faboslav/friendsandfoes/common/FriendsAndFoes.java index 52aa7afd..4048a741 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/FriendsAndFoes.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/FriendsAndFoes.java @@ -73,6 +73,7 @@ public static void init() { public static void lateInit() { FriendsAndFoesBlockEntityTypes.lateInit(); + FriendsAndFoesItems.registerCompostableItems(); BiomeModifications.addButtercupFeature(); } diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/init/FriendsAndFoesItems.java b/common/src/main/java/com/faboslav/friendsandfoes/common/init/FriendsAndFoesItems.java index 37d309c6..6c1d3a77 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/init/FriendsAndFoesItems.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/init/FriendsAndFoesItems.java @@ -6,6 +6,7 @@ import com.faboslav.friendsandfoes.common.init.registry.ResourcefulRegistry; import com.faboslav.friendsandfoes.common.item.DispenserAddedSpawnEgg; import com.faboslav.friendsandfoes.common.item.FriendsAndFoesArmorMaterials; +import net.minecraft.block.ComposterBlock; import net.minecraft.entity.EntityType; import net.minecraft.entity.EquipmentSlot; import net.minecraft.item.*; @@ -62,4 +63,8 @@ public final class FriendsAndFoesItems private FriendsAndFoesItems() { } + + public static void registerCompostableItems() { + ComposterBlock.registerCompostableItem(0.65F, FriendsAndFoesItems.BUTTERCUP.get()); + } } diff --git a/common/src/main/resources/friendsandfoes.accesswidener b/common/src/main/resources/friendsandfoes.accesswidener index 13a3b305..b6a7f136 100644 --- a/common/src/main/resources/friendsandfoes.accesswidener +++ b/common/src/main/resources/friendsandfoes.accesswidener @@ -27,4 +27,5 @@ accessible method net/minecraft/entity/ai/brain/Activity (Ljava/lang/Stri accessible method net/minecraft/particle/DefaultParticleType (Z)V accessible method net/minecraft/block/AbstractButtonBlock getClickSound (Z)Lnet/minecraft/sound/SoundEvent; accessible method net/minecraft/entity/ai/brain/sensor/SensorType (Ljava/util/function/Supplier;)V -accessible method net/minecraft/entity/effect/StatusEffect (Lnet/minecraft/entity/effect/StatusEffectCategory;I)V \ No newline at end of file +accessible method net/minecraft/entity/effect/StatusEffect (Lnet/minecraft/entity/effect/StatusEffectCategory;I)V +accessible method net/minecraft/block/ComposterBlock registerCompostableItem (FLnet/minecraft/item/ItemConvertible;)V \ No newline at end of file From 076ec136a8cfc8344ff78fecaf9b2cb99127fb35 Mon Sep 17 00:00:00 2001 From: Faboslav Date: Fri, 15 Nov 2024 09:57:24 +0100 Subject: [PATCH 7/7] Fixed aether incompatibility --- CHANGELOG.md | 1 + .../processor/StructureEntityProcessor.java | 3 +- .../processor/StructureProcessingContext.java | 41 +++ .../mixin/StructureEntityProcessorMixin.java | 234 ++++++++---------- .../IceologerCabinArmorStandProcessor.java | 2 +- .../IllusionerShackItemFrameProcessor.java | 2 +- 6 files changed, 149 insertions(+), 134 deletions(-) rename {fabric/src/main/java/com/yungnickyoung/minecraft/yungsapi => common/src/main/java/com/faboslav/friendsandfoes/common}/world/processor/StructureEntityProcessor.java (85%) create mode 100644 common/src/main/java/com/faboslav/friendsandfoes/common/world/processor/StructureProcessingContext.java diff --git a/CHANGELOG.md b/CHANGELOG.md index e8fb291c..96d53fef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ - Fixed strong potion of reaching duration - Fixed iceologer model - Fixed carpet profiler incompatibility +- Fixed aether dungeons incompatibility - Fixed buttercup not being compostable - Added more config options - Added zh_tw translations (Thanks to Lobster0228) diff --git a/fabric/src/main/java/com/yungnickyoung/minecraft/yungsapi/world/processor/StructureEntityProcessor.java b/common/src/main/java/com/faboslav/friendsandfoes/common/world/processor/StructureEntityProcessor.java similarity index 85% rename from fabric/src/main/java/com/yungnickyoung/minecraft/yungsapi/world/processor/StructureEntityProcessor.java rename to common/src/main/java/com/faboslav/friendsandfoes/common/world/processor/StructureEntityProcessor.java index eef006ea..9d6e213e 100644 --- a/fabric/src/main/java/com/yungnickyoung/minecraft/yungsapi/world/processor/StructureEntityProcessor.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/world/processor/StructureEntityProcessor.java @@ -1,4 +1,4 @@ -package com.yungnickyoung.minecraft.yungsapi.world.processor; +package com.faboslav.friendsandfoes.common.world.processor; import net.minecraft.structure.StructurePlacementData; import net.minecraft.structure.StructureTemplate.StructureEntityInfo; @@ -7,7 +7,6 @@ import net.minecraft.world.ServerWorldAccess; /** - * This is very important placeholder for compatibilitty ( * Originally from YUNG's API by. * YUNGNICKYOUNG (https://github.com/YUNG-GANG/YUNGs-API) */ diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/world/processor/StructureProcessingContext.java b/common/src/main/java/com/faboslav/friendsandfoes/common/world/processor/StructureProcessingContext.java new file mode 100644 index 00000000..155101a1 --- /dev/null +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/world/processor/StructureProcessingContext.java @@ -0,0 +1,41 @@ +package com.faboslav.friendsandfoes.common.world.processor; + +import net.minecraft.structure.StructurePlacementData; +import net.minecraft.structure.StructureTemplate; +import net.minecraft.util.Util; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.ServerWorldAccess; + +import java.util.ArrayList; +import java.util.List; + +/** + * Originally from YUNG's API by. + * YUNGNICKYOUNG (https://github.com/YUNG-GANG/YUNGs-API) + */ +public record StructureProcessingContext( + ServerWorldAccess serverWorldAccess, + StructurePlacementData structurePlacementData, + BlockPos structurePiecePos, + BlockPos structurePiecePivotPos, + List rawEntityInfos) +{ + public StructureProcessingContext( + ServerWorldAccess serverWorldAccess, + StructurePlacementData structurePlacementData, + BlockPos structurePiecePos, + BlockPos structurePiecePivotPos, + List rawEntityInfos + ) { + this.serverWorldAccess = serverWorldAccess; + this.structurePlacementData = structurePlacementData; + this.structurePiecePos = structurePiecePos; + this.structurePiecePivotPos = structurePiecePivotPos; + this.rawEntityInfos = Util.make(() -> { + List list = new ArrayList<>(rawEntityInfos.size()); + rawEntityInfos.forEach((entityInfo) -> + list.add(new StructureTemplate.StructureEntityInfo(entityInfo.pos, entityInfo.blockPos, entityInfo.nbt))); + return list; + }); + } +} \ No newline at end of file diff --git a/fabric/src/main/java/com/faboslav/friendsandfoes/fabric/mixin/StructureEntityProcessorMixin.java b/fabric/src/main/java/com/faboslav/friendsandfoes/fabric/mixin/StructureEntityProcessorMixin.java index 3b2ffaf7..beb231b0 100644 --- a/fabric/src/main/java/com/faboslav/friendsandfoes/fabric/mixin/StructureEntityProcessorMixin.java +++ b/fabric/src/main/java/com/faboslav/friendsandfoes/fabric/mixin/StructureEntityProcessorMixin.java @@ -1,7 +1,7 @@ package com.faboslav.friendsandfoes.fabric.mixin; -import com.yungnickyoung.minecraft.yungsapi.world.processor.StructureEntityProcessor; -import net.fabricmc.loader.api.FabricLoader; +import com.faboslav.friendsandfoes.common.world.processor.StructureEntityProcessor; +import com.faboslav.friendsandfoes.common.world.processor.StructureProcessingContext; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityType; import net.minecraft.entity.SpawnReason; @@ -13,20 +13,16 @@ import net.minecraft.structure.StructureTemplate; import net.minecraft.structure.StructureTemplate.StructureEntityInfo; import net.minecraft.structure.processor.StructureProcessor; -import net.minecraft.util.BlockMirror; -import net.minecraft.util.BlockRotation; -import net.minecraft.util.math.BlockBox; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Vec3d; import net.minecraft.util.math.random.Random; import net.minecraft.world.ServerWorldAccess; -import org.jetbrains.annotations.Nullable; import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.Unique; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; import java.util.ArrayList; @@ -36,7 +32,7 @@ /** * Allows for processing entities in Jigsaw structures. * Originally from YUNG's API by. - * YUNGNICKYOUNG(https://github.com/YUNG-GANG/YUNGs-API) + * YUNGNICKYOUNG (YUNGs-API) */ @Mixin(StructureTemplate.class) public final class StructureEntityProcessorMixin @@ -45,17 +41,56 @@ public final class StructureEntityProcessorMixin @Final private List entities; - /** - * Reimplements vanilla behavior for spawning entities, - * but with additional behavior allowing for the use of entity processing ({@link StructureEntityProcessor}) - */ + @Unique + private static final ThreadLocal friendsandfoes_context = new ThreadLocal<>(); + @Inject( method = "place", at = @At( value = "INVOKE", - target = "net/minecraft/structure/StructureTemplate.spawnEntities (Lnet/minecraft/world/ServerWorldAccess;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/BlockMirror;Lnet/minecraft/util/BlockRotation;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/math/BlockBox;Z)V" + target = "Lnet/minecraft/structure/StructureTemplate;spawnEntities(Lnet/minecraft/world/ServerWorldAccess;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/BlockMirror;Lnet/minecraft/util/BlockRotation;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/math/BlockBox;Z)V" ) ) + private void friendsandfoes_captureContext( + ServerWorldAccess world, + BlockPos pos, + BlockPos pivot, + StructurePlacementData placementData, + Random random, + int flags, + CallbackInfoReturnable cir + ) { + friendsandfoes_context.set(new StructureProcessingContext( + world, + placementData, + pos, + pivot, + entities + )); + } + + + @Inject( + method = "place", + at = @At( + value = "INVOKE", + shift = At.Shift.AFTER, + target = "Lnet/minecraft/structure/StructureTemplate;spawnEntities(Lnet/minecraft/world/ServerWorldAccess;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/BlockMirror;Lnet/minecraft/util/BlockRotation;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/math/BlockBox;Z)V")) + private void friendsandfoes_clearContext( + ServerWorldAccess serverLevelAccessor, BlockPos structurePiecePos, BlockPos structurePiecePivotPos, + StructurePlacementData structurePlaceSettings, Random randomSource, int i, CallbackInfoReturnable cir + ) { + friendsandfoes_context.remove(); + } + + @Inject( + method = "place", + at = @At( + value = "INVOKE", + target = "net/minecraft/structure/StructureTemplate.spawnEntities (Lnet/minecraft/world/ServerWorldAccess;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/BlockMirror;Lnet/minecraft/util/BlockRotation;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/math/BlockBox;Z)V" + ), + cancellable = true + ) private void friendsandfoes_processEntities( ServerWorldAccess serverWorldAccess, BlockPos structurePiecePos, @@ -65,52 +100,36 @@ private void friendsandfoes_processEntities( int flags, CallbackInfoReturnable cir ) { - if (!FabricLoader.getInstance().isModLoaded("yungsapi")) { - for (StructureEntityInfo entityInfo : friendsandfoes_processEntityInfos( - serverWorldAccess, - structurePiecePos, - structurePieceBottomCenterPos, - structurePlacementData, - this.entities - )) { - BlockPos blockPos = entityInfo.blockPos; - - if ( - structurePlacementData.getBoundingBox() != null - && !structurePlacementData.getBoundingBox().contains(blockPos) - ) { - continue; - } + StructureProcessingContext ctx = friendsandfoes_context.get(); + + if (ctx.structurePlacementData().getProcessors().stream().noneMatch(p -> p instanceof StructureEntityProcessor)) { + return; + } - NbtCompound compoundTag = entityInfo.nbt.copy(); - Vec3d vec3d = entityInfo.pos; - - NbtList nbtList = new NbtList(); - nbtList.add(NbtDouble.of(vec3d.getX())); - nbtList.add(NbtDouble.of(vec3d.getY())); - nbtList.add(NbtDouble.of(vec3d.getZ())); - compoundTag.put("Pos", nbtList); - compoundTag.remove("UUID"); - - friendsandfoes_getEntity(serverWorldAccess, compoundTag).ifPresent((entity) -> { - float f = entity.applyMirror(structurePlacementData.getMirror()); - f += entity.getYaw() - entity.applyRotation(structurePlacementData.getRotation()); - entity.refreshPositionAndAngles( - vec3d.getX(), - vec3d.getY(), - vec3d.getZ(), - f, - entity.getPitch() - ); - if (structurePlacementData.shouldInitializeMobs() && entity instanceof MobEntity) { + List processedEntities = friendsandfoes_processEntityInfoList(ctx); + + for (StructureTemplate.StructureEntityInfo entityInfo : processedEntities) { + BlockPos entityBlockPos = entityInfo.blockPos; + if (ctx.structurePlacementData().getBoundingBox() == null || ctx.structurePlacementData().getBoundingBox().contains(entityBlockPos)) { + NbtCompound entityNbt = entityInfo.nbt.copy(); + Vec3d entityPos = entityInfo.pos; + NbtList listTag = new NbtList(); + listTag.add(NbtDouble.of(entityPos.x)); + listTag.add(NbtDouble.of(entityPos.y)); + listTag.add(NbtDouble.of(entityPos.z)); + entityNbt.put("Pos", listTag); + entityNbt.remove("UUID"); + friendsandfoes_tryCreateEntity(serverWorldAccess, entityNbt).ifPresent((entity) -> { + float f = entity.applyMirror(ctx.structurePlacementData().getMirror()); + f += entity.getYaw() - entity.applyRotation(ctx.structurePlacementData().getRotation()); + entity.refreshPositionAndAngles(entityPos.x, entityPos.y, entityPos.z, f, entity.getPitch()); + if (ctx.structurePlacementData().shouldInitializeMobs() && entity instanceof MobEntity) { ((MobEntity) entity).initialize( serverWorldAccess, - serverWorldAccess.getLocalDifficulty( - new BlockPos(vec3d) - ), + serverWorldAccess.getLocalDifficulty(new BlockPos(entityPos)), SpawnReason.STRUCTURE, null, - compoundTag + entityNbt ); } @@ -118,88 +137,42 @@ private void friendsandfoes_processEntities( }); } } - } - /** - * Cancel spawning entities. - * This behavior is recreated in {@link #friendsandfoes_processEntities} - */ - @Inject( - method = "spawnEntities", - at = @At(value = "HEAD"), - cancellable = true - ) - private void friendsandfoes_cancelPlaceEntities( - ServerWorldAccess serverWorldAccess, - BlockPos structurePiecePos, - BlockMirror mirror, - BlockRotation rotation, - BlockPos pivot, - @Nullable BlockBox area, - boolean initializeMobs, - CallbackInfo ci - ) { - if (!FabricLoader.getInstance().isModLoaded("yungsapi")) { - ci.cancel(); - } + cir.cancel(); } - /** - * Applies placement data and {@link StructureEntityProcessor}s to entities in a structure. - */ - private List friendsandfoes_processEntityInfos( - ServerWorldAccess serverWorldAccess, - BlockPos structurePiecePos, - BlockPos structurePieceBottomCenterPos, - StructurePlacementData structurePlacementData, - List rawEntityList - ) { - List processedEntities = new ArrayList<>(); + @Unique + private List friendsandfoes_processEntityInfoList(StructureProcessingContext ctx) { + List processedEntities = new ArrayList<>(); + + ServerWorldAccess serverLevelAccessor = ctx.serverWorldAccess(); + BlockPos structurePiecePos = ctx.structurePiecePos(); + BlockPos structurePiecePivotPos = ctx.structurePiecePivotPos(); + StructurePlacementData structurePlaceSettings = ctx.structurePlacementData(); + List rawEntityInfos = ctx.rawEntityInfos(); - for (StructureEntityInfo rawEntityItem : rawEntityList) { - // Calculate transformed position so processors have access to the actual global world coordinates of the entity + for (StructureTemplate.StructureEntityInfo rawEntityInfo : rawEntityInfos) { Vec3d globalPos = StructureTemplate - .transformAround( - rawEntityItem.pos, - structurePlacementData.getMirror(), - structurePlacementData.getRotation(), - structurePlacementData.getPosition() - ).add(Vec3d.of(structurePiecePos)); + .transformAround(rawEntityInfo.pos, + structurePlaceSettings.getMirror(), + structurePlaceSettings.getRotation(), + structurePlaceSettings.getPosition()) + .add(Vec3d.of(structurePiecePos)); BlockPos globalBlockPos = StructureTemplate - .transformAround( - rawEntityItem.blockPos, - structurePlacementData.getMirror(), - structurePlacementData.getRotation(), - structurePlacementData.getPosition() - ).add(structurePiecePos); - - StructureEntityInfo globalEntityInfo = new StructureEntityInfo( - globalPos, - globalBlockPos, - rawEntityItem.nbt - ); - - // Apply processors - for (StructureProcessor processor : structurePlacementData.getProcessors()) { - if (!(processor instanceof StructureEntityProcessor)) { - continue; - } - - globalEntityInfo = ((StructureEntityProcessor) processor).processEntity( - serverWorldAccess, - structurePiecePos, - structurePieceBottomCenterPos, - rawEntityItem, - globalEntityInfo, - structurePlacementData - ); - - if (globalEntityInfo == null) { - break; + .transformAround(rawEntityInfo.blockPos, + structurePlaceSettings.getMirror(), + structurePlaceSettings.getRotation(), + structurePlaceSettings.getPosition()) + .add(structurePiecePos); + StructureTemplate.StructureEntityInfo globalEntityInfo = new StructureTemplate.StructureEntityInfo(globalPos, globalBlockPos, rawEntityInfo.nbt); + + for (StructureProcessor processor : structurePlaceSettings.getProcessors()) { + if (processor instanceof StructureEntityProcessor) { + globalEntityInfo = ((StructureEntityProcessor) processor).processEntity(serverLevelAccessor, structurePiecePos, structurePiecePivotPos, rawEntityInfo, globalEntityInfo, structurePlaceSettings); + if (globalEntityInfo == null) break; } } - // null value from processor indicates the entity should not be spawned if (globalEntityInfo != null) { processedEntities.add(globalEntityInfo); } @@ -208,12 +181,13 @@ private List friendsandfoes_processEntityInfos( return processedEntities; } - private static Optional friendsandfoes_getEntity( - ServerWorldAccess serverWorldAccess, + @Unique + private static Optional friendsandfoes_tryCreateEntity( + ServerWorldAccess serverLevelAccessor, NbtCompound compoundTag ) { try { - return EntityType.getEntityFromNbt(compoundTag, serverWorldAccess.toServerWorld()); + return EntityType.getEntityFromNbt(compoundTag, serverLevelAccessor.toServerWorld()); } catch (Exception exception) { return Optional.empty(); } diff --git a/fabric/src/main/java/com/faboslav/friendsandfoes/fabric/world/processor/IceologerCabinArmorStandProcessor.java b/fabric/src/main/java/com/faboslav/friendsandfoes/fabric/world/processor/IceologerCabinArmorStandProcessor.java index 2539e447..f2d5ea00 100644 --- a/fabric/src/main/java/com/faboslav/friendsandfoes/fabric/world/processor/IceologerCabinArmorStandProcessor.java +++ b/fabric/src/main/java/com/faboslav/friendsandfoes/fabric/world/processor/IceologerCabinArmorStandProcessor.java @@ -3,7 +3,7 @@ import com.faboslav.friendsandfoes.common.init.fabric.FriendsAndFoesStructureProcessorTypesImpl; import com.faboslav.friendsandfoes.common.util.world.processor.IceologerCabinArmorStandProcessorHelper; import com.mojang.serialization.Codec; -import com.yungnickyoung.minecraft.yungsapi.world.processor.StructureEntityProcessor; +import com.faboslav.friendsandfoes.common.world.processor.StructureEntityProcessor; import net.minecraft.structure.StructurePlacementData; import net.minecraft.structure.StructureTemplate; import net.minecraft.structure.processor.StructureProcessorType; diff --git a/fabric/src/main/java/com/faboslav/friendsandfoes/fabric/world/processor/IllusionerShackItemFrameProcessor.java b/fabric/src/main/java/com/faboslav/friendsandfoes/fabric/world/processor/IllusionerShackItemFrameProcessor.java index f7aedada..4c9f916b 100644 --- a/fabric/src/main/java/com/faboslav/friendsandfoes/fabric/world/processor/IllusionerShackItemFrameProcessor.java +++ b/fabric/src/main/java/com/faboslav/friendsandfoes/fabric/world/processor/IllusionerShackItemFrameProcessor.java @@ -3,7 +3,7 @@ import com.faboslav.friendsandfoes.common.init.fabric.FriendsAndFoesStructureProcessorTypesImpl; import com.faboslav.friendsandfoes.common.util.world.processor.IllusionerShackItemFrameProcessorHelper; import com.mojang.serialization.Codec; -import com.yungnickyoung.minecraft.yungsapi.world.processor.StructureEntityProcessor; +import com.faboslav.friendsandfoes.common.world.processor.StructureEntityProcessor; import net.minecraft.structure.StructurePlacementData; import net.minecraft.structure.StructureTemplate; import net.minecraft.structure.StructureTemplate.StructureEntityInfo;