diff --git a/.github/versions.json b/.github/versions.json index 9674e8aef..d71bcd938 100644 --- a/.github/versions.json +++ b/.github/versions.json @@ -1,8 +1,8 @@ { - "1.19.2": "1.8.0", - "1.19.1": "1.8.0", - "1.19": "1.8.0", - "1.18.2": "1.4.6", + "1.19.2": "1.8.1", + "1.19.1": "1.8.1", + "1.19": "1.8.1", + "1.18.2": "1.4.7", "1.18.1": "1.2.5", "1.18": "1.2.5" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index a9c47713f..a0b1dde48 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## mc1.19.2-1.8.1, April 10, 2023 + +- Tuff Golem can now be unglued with axe +- Fixed iceologer and illusioner spawns in raid based on the config + ## mc1.19.2-1.8.0, March 08, 2023 - Added Tuff Golem @@ -112,6 +117,10 @@ - Fixed bug when copper blocks can not be waxed +## mc1.18.2-1.4.7, April 10, 2023 + +- Fixed iceologer and illusioner spawns in raid based on the config + ## mc1.18.2-1.4.6, December 16, 2022 - Backported important fixes from 1.5.x/1.6.x mod versions diff --git a/common/src/main/java/com/faboslav/friendsandfoes/client/render/entity/animation/animator/context/AnimationContextTracker.java b/common/src/main/java/com/faboslav/friendsandfoes/client/render/entity/animation/animator/context/AnimationContextTracker.java index ae1c750b2..2f7b6716c 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/client/render/entity/animation/animator/context/AnimationContextTracker.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/client/render/entity/animation/animator/context/AnimationContextTracker.java @@ -2,8 +2,6 @@ import com.faboslav.friendsandfoes.client.render.entity.animation.KeyframeAnimation; import com.faboslav.friendsandfoes.client.render.entity.animation.animator.ModelPartAnimationType; -import net.fabricmc.api.EnvType; -import net.fabricmc.api.Environment; import java.util.HashMap; import java.util.Map; diff --git a/common/src/main/java/com/faboslav/friendsandfoes/entity/TuffGolemEntity.java b/common/src/main/java/com/faboslav/friendsandfoes/entity/TuffGolemEntity.java index d45abc77d..f837d248f 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/entity/TuffGolemEntity.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/entity/TuffGolemEntity.java @@ -220,12 +220,20 @@ public void readCustomDataFromNbt(NbtCompound nbt) { } } - private SoundEvent getGlueSound() { - return FriendsAndFoesSoundEvents.ENTITY_TUFF_GOLEM_GLUE.get(); + private SoundEvent getGlueOnSound() { + return FriendsAndFoesSoundEvents.ENTITY_TUFF_GOLEM_GLUE_ON.get(); } - private void playGlueSound() { - this.playSound(this.getGlueSound(), 1.0F, 1.0F); + private void playGlueOnSound() { + this.playSound(this.getGlueOnSound(), 1.0F, 1.0F); + } + + private SoundEvent getGlueOffSound() { + return FriendsAndFoesSoundEvents.ENTITY_TUFF_GOLEM_GLUE_OFF.get(); + } + + private void playGlueOffSound() { + this.playSound(this.getGlueOffSound(), 1.0F, 1.0F); } public SoundEvent getMoveSound() { @@ -303,6 +311,8 @@ public ActionResult interactMob( interactionResult = this.tryToInteractMobWithDye(player, itemStack); } else if (itemInHand instanceof HoneycombItem) { interactionResult = this.tryToInteractMobWithHoneycomb(player, itemStack); + } else if (itemInHand instanceof AxeItem) { + interactionResult = this.tryToInteractMobWithAxe(player, hand, itemStack); } if (interactionResult == false) { @@ -371,12 +381,35 @@ private boolean tryToInteractMobWithHoneycomb( itemStack.decrement(1); } - this.playGlueSound(); + this.playGlueOnSound(); this.spawnParticles(ParticleTypes.WAX_ON, 7); return true; } + private boolean tryToInteractMobWithAxe( + PlayerEntity player, + Hand hand, + ItemStack itemStack + ) { + if (!this.isGlued()) { + return false; + } + + this.setGlued(false); + + this.playGlueOffSound(); + this.spawnParticles(ParticleTypes.WAX_OFF, 7); + + if (this.getWorld().isClient() == false && !player.getAbilities().creativeMode) { + itemStack.damage(1, player, (playerEntity) -> { + player.sendToolBreakStatus(hand); + }); + } + + return true; + } + private boolean tryToInteractMobWithItem( PlayerEntity player, ItemStack itemStack diff --git a/common/src/main/java/com/faboslav/friendsandfoes/init/FriendsAndFoesSoundEvents.java b/common/src/main/java/com/faboslav/friendsandfoes/init/FriendsAndFoesSoundEvents.java index cdf51877e..5069b3c71 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/init/FriendsAndFoesSoundEvents.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/init/FriendsAndFoesSoundEvents.java @@ -38,7 +38,8 @@ public final class FriendsAndFoesSoundEvents public static final Supplier ENTITY_MAULER_GROWL; public static final Supplier ENTITY_MAULER_HURT; public static final Supplier ENTITY_MOOBLOOM_CONVERT; - public static final Supplier ENTITY_TUFF_GOLEM_GLUE; + public static final Supplier ENTITY_TUFF_GOLEM_GLUE_ON; + public static final Supplier ENTITY_TUFF_GOLEM_GLUE_OFF; public static final Supplier ENTITY_TUFF_GOLEM_HURT; public static final Supplier ENTITY_TUFF_GOLEM_MOVE; public static final Supplier ENTITY_TUFF_GOLEM_REPAIR; @@ -82,7 +83,8 @@ public final class FriendsAndFoesSoundEvents ENTITY_MAULER_GROWL = register("entity", "mauler.growl"); ENTITY_MAULER_HURT = register("entity", "mauler.hurt"); ENTITY_MOOBLOOM_CONVERT = register("entity", "moobloom.convert"); - ENTITY_TUFF_GOLEM_GLUE = register("entity", "tuff_golem.glue"); + ENTITY_TUFF_GOLEM_GLUE_ON = register("entity", "tuff_golem.glue_on"); + ENTITY_TUFF_GOLEM_GLUE_OFF = register("entity", "tuff_golem.glue_off"); ENTITY_TUFF_GOLEM_HURT = register("entity", "tuff_golem.hurt"); ENTITY_TUFF_GOLEM_MOVE = register("entity", "tuff_golem.move"); ENTITY_TUFF_GOLEM_REPAIR = register("entity", "tuff_golem.repair"); 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 f9c40229b..a16d59030 100644 --- a/common/src/main/resources/assets/friendsandfoes/lang/en_us.json +++ b/common/src/main/resources/assets/friendsandfoes/lang/en_us.json @@ -96,7 +96,8 @@ "subtitle.entity.friendsandfoes.mauler.hurt": "Mauler hurts", "subtitle.entity.friendsandfoes.moobloom.convert": "Moobloom transforms", "subtitle.entity.friendsandfoes.shield_debris.impact": "Shield debris impacted", - "subtitle.entity.friendsandfoes.tuff_golem.glue": "Tuff Golem glued", + "subtitle.entity.friendsandfoes.tuff_golem.glue_on": "Tuff Golem glued", + "subtitle.entity.friendsandfoes.tuff_golem.glue_off": "Tuff Golem unglued", "subtitle.entity.friendsandfoes.tuff_golem.hurt": "Tuff Golem hurts", "subtitle.entity.friendsandfoes.tuff_golem.move": "Tuff Golem moves", "subtitle.entity.friendsandfoes.tuff_golem.repair": "Tuff Golem repaired", diff --git a/common/src/main/resources/assets/friendsandfoes/sounds.json b/common/src/main/resources/assets/friendsandfoes/sounds.json index 031adaa94..8e906e8c8 100644 --- a/common/src/main/resources/assets/friendsandfoes/sounds.json +++ b/common/src/main/resources/assets/friendsandfoes/sounds.json @@ -176,11 +176,17 @@ ], "subtitle": "subtitle.entity.friendsandfoes.moobloom.convert" }, - "entity.tuff_golem.glue": { + "entity.tuff_golem.glue_on": { "sounds": [ - "friendsandfoes:entity/tuff_golem/glue" + "friendsandfoes:entity/tuff_golem/glue_on" ], - "subtitle": "subtitle.entity.friendsandfoes.tuff_golem.glue" + "subtitle": "subtitle.entity.friendsandfoes.tuff_golem.glue_on" + }, + "entity.tuff_golem.glue_off": { + "sounds": [ + "friendsandfoes:entity/tuff_golem/glue_off" + ], + "subtitle": "subtitle.entity.friendsandfoes.tuff_golem.glue_off" }, "entity.tuff_golem.hurt": { "sounds": [ diff --git a/common/src/main/resources/assets/friendsandfoes/sounds/entity/tuff_golem/glue_off.ogg b/common/src/main/resources/assets/friendsandfoes/sounds/entity/tuff_golem/glue_off.ogg new file mode 100644 index 000000000..818c7302d Binary files /dev/null and b/common/src/main/resources/assets/friendsandfoes/sounds/entity/tuff_golem/glue_off.ogg differ diff --git a/common/src/main/resources/assets/friendsandfoes/sounds/entity/tuff_golem/glue.ogg b/common/src/main/resources/assets/friendsandfoes/sounds/entity/tuff_golem/glue_on.ogg similarity index 100% rename from common/src/main/resources/assets/friendsandfoes/sounds/entity/tuff_golem/glue.ogg rename to common/src/main/resources/assets/friendsandfoes/sounds/entity/tuff_golem/glue_on.ogg diff --git a/fabric/build.gradle b/fabric/build.gradle index 6aa26b687..d2717140c 100644 --- a/fabric/build.gradle +++ b/fabric/build.gradle @@ -42,6 +42,7 @@ dependencies { modRuntimeOnly "curse.maven:lazydfu-433518:3821870" modRuntimeOnly "curse.maven:starlight-521783:3835973" modRuntimeOnly "curse.maven:disablecustomworldsadvice-401978:3827588" + modRuntimeOnly "curse.maven:structureessentialsforgefabric-832882:4429721" common(project(path: ":common", configuration: "namedElements")) { transitive false } shadowCommon(project(path: ":common", configuration: "transformProductionFabric")) { transitive false } diff --git a/fabric/src/main/java/com/faboslav/friendsandfoes/mixin/fabric/AddCustomRaidMemberMixin.java b/fabric/src/main/java/com/faboslav/friendsandfoes/mixin/fabric/AddCustomRaidMemberMixin.java index 241d69c88..e374dde1c 100644 --- a/fabric/src/main/java/com/faboslav/friendsandfoes/mixin/fabric/AddCustomRaidMemberMixin.java +++ b/fabric/src/main/java/com/faboslav/friendsandfoes/mixin/fabric/AddCustomRaidMemberMixin.java @@ -1,5 +1,6 @@ package com.faboslav.friendsandfoes.mixin.fabric; +import com.faboslav.friendsandfoes.FriendsAndFoes; import com.faboslav.friendsandfoes.init.FriendsAndFoesEntityTypes; import com.faboslav.friendsandfoes.util.CustomRaidMember; import net.minecraft.entity.EntityType; @@ -50,23 +51,27 @@ private static void friendsandfoes_addCustomRaidMembers(CallbackInfo ci) { var raidMembers = new ArrayList<>(Arrays.asList(field_16632)); var lastRaidMember = raidMembers.get(raidMembers.size() - 1); - var iceologerRaidMember = newRaidMember( - CustomRaidMember.ICEOLOGER_INTERNAL_NAME, - lastRaidMember.ordinal() + 1, - FriendsAndFoesEntityTypes.ICEOLOGER.get(), - CustomRaidMember.ICEOLOGER_COUNT_IN_WAVE - ); - CustomRaidMember.ICEOLOGER = iceologerRaidMember; - raidMembers.add(iceologerRaidMember); + if(FriendsAndFoes.getConfig().enableIceologerInRaids) { + var iceologerRaidMember = newRaidMember( + CustomRaidMember.ICEOLOGER_INTERNAL_NAME, + lastRaidMember.ordinal() + 1, + FriendsAndFoesEntityTypes.ICEOLOGER.get(), + CustomRaidMember.ICEOLOGER_COUNT_IN_WAVE + ); + CustomRaidMember.ICEOLOGER = iceologerRaidMember; + raidMembers.add(iceologerRaidMember); + } - var illusionerRaidMember = newRaidMember( - CustomRaidMember.ILLUSIONER_INTERNAL_NAME, - lastRaidMember.ordinal() + 2, - EntityType.ILLUSIONER, - CustomRaidMember.ILLUSIONER_COUNT_IN_WAVE - ); - CustomRaidMember.ILLUSIONER = illusionerRaidMember; - raidMembers.add(illusionerRaidMember); + if(FriendsAndFoes.getConfig().enableIllusionerInRaids) { + var illusionerRaidMember = newRaidMember( + CustomRaidMember.ILLUSIONER_INTERNAL_NAME, + lastRaidMember.ordinal() + 2, + EntityType.ILLUSIONER, + CustomRaidMember.ILLUSIONER_COUNT_IN_WAVE + ); + CustomRaidMember.ILLUSIONER = illusionerRaidMember; + raidMembers.add(illusionerRaidMember); + } field_16632 = raidMembers.toArray(new Raid.Member[0]); } diff --git a/gradle.properties b/gradle.properties index 839e49c18..eced863f0 100644 --- a/gradle.properties +++ b/gradle.properties @@ -8,7 +8,7 @@ org.gradle.configureondemand=false # Mod mod_name=Friends&Foes mod_id=friendsandfoes -mod_version=1.8.0 +mod_version=1.8.1 mod_author=Faboslav mod_description=Adds outvoted and forgotten mobs from the mob votes in a believable vanilla plus style. maven_group=com.faboslav.friendsandfoes diff --git a/quilt/src/main/java/com/faboslav/friendsandfoes/mixin/quilt/AddCustomRaidMemberMixin.java b/quilt/src/main/java/com/faboslav/friendsandfoes/mixin/quilt/AddCustomRaidMemberMixin.java index 19ae1f238..7a9995075 100644 --- a/quilt/src/main/java/com/faboslav/friendsandfoes/mixin/quilt/AddCustomRaidMemberMixin.java +++ b/quilt/src/main/java/com/faboslav/friendsandfoes/mixin/quilt/AddCustomRaidMemberMixin.java @@ -1,5 +1,6 @@ package com.faboslav.friendsandfoes.mixin.quilt; +import com.faboslav.friendsandfoes.FriendsAndFoes; import com.faboslav.friendsandfoes.init.FriendsAndFoesEntityTypes; import com.faboslav.friendsandfoes.util.CustomRaidMember; import net.minecraft.entity.EntityType; @@ -50,23 +51,27 @@ private static void friendsandfoes_addCustomRaidMembers(CallbackInfo ci) { var raidMembers = new ArrayList<>(Arrays.asList(field_16632)); var lastRaidMember = raidMembers.get(raidMembers.size() - 1); - var iceologerRaidMember = newRaidMember( - CustomRaidMember.ICEOLOGER_INTERNAL_NAME, - lastRaidMember.ordinal() + 1, - FriendsAndFoesEntityTypes.ICEOLOGER.get(), - CustomRaidMember.ICEOLOGER_COUNT_IN_WAVE - ); - CustomRaidMember.ICEOLOGER = iceologerRaidMember; - raidMembers.add(iceologerRaidMember); + if(FriendsAndFoes.getConfig().enableIceologerInRaids) { + var iceologerRaidMember = newRaidMember( + CustomRaidMember.ICEOLOGER_INTERNAL_NAME, + lastRaidMember.ordinal() + 1, + FriendsAndFoesEntityTypes.ICEOLOGER.get(), + CustomRaidMember.ICEOLOGER_COUNT_IN_WAVE + ); + CustomRaidMember.ICEOLOGER = iceologerRaidMember; + raidMembers.add(iceologerRaidMember); + } - var illusionerRaidMember = newRaidMember( - CustomRaidMember.ILLUSIONER_INTERNAL_NAME, - lastRaidMember.ordinal() + 2, - EntityType.ILLUSIONER, - CustomRaidMember.ILLUSIONER_COUNT_IN_WAVE - ); - CustomRaidMember.ILLUSIONER = illusionerRaidMember; - raidMembers.add(illusionerRaidMember); + if(FriendsAndFoes.getConfig().enableIllusionerInRaids) { + var illusionerRaidMember = newRaidMember( + CustomRaidMember.ILLUSIONER_INTERNAL_NAME, + lastRaidMember.ordinal() + 2, + EntityType.ILLUSIONER, + CustomRaidMember.ILLUSIONER_COUNT_IN_WAVE + ); + CustomRaidMember.ILLUSIONER = illusionerRaidMember; + raidMembers.add(illusionerRaidMember); + } field_16632 = raidMembers.toArray(new Raid.Member[0]); }