From 97c0d5d9598f05a3d1ce61d8fea55ec272cf2c9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ales=CC=8C=20Fabia=CC=81nek?= Date: Fri, 1 Apr 2022 14:50:13 +0200 Subject: [PATCH] 1.3.2 --- CHANGELOG.md | 7 ++ .../friendsandfoes/mixin/BeeEntityMixin.java | 39 +----- .../world/spawner/IceologerSpawner.java | 7 +- .../world/spawner/IllusionerSpawner.java | 4 +- .../assets/friendsandfoes/lang/en_us.json | 2 +- .../assets/friendsandfoes/lang/zh_cn.json | 1 - .../advancements/husbandry/beehive.json | 112 ++++++++++++++++-- .../powder_snow_walkable_mobs.json | 6 + gradle.properties | 2 +- 9 files changed, 130 insertions(+), 50 deletions(-) create mode 100644 common/src/main/resources/data/minecraft/tags/entity_types/powder_snow_walkable_mobs.json diff --git a/CHANGELOG.md b/CHANGELOG.md index b3ac67ec9..c49e06e60 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## mc1.18.2-1.3.2, April 01, 2022 + +- Fixed crash related to the bees pollinating mooblooms +- Tweaked illusioner and iceologer spawns +- Iceologer can now walk on the powder snow +- Updated "Be Keeper" advancement + ## mc1.18.2-1.3.1, Mar 31, 2022 - Fixed villagers disappearing due to disabled beekeeper villager profession diff --git a/common/src/main/java/com/faboslav/friendsandfoes/mixin/BeeEntityMixin.java b/common/src/main/java/com/faboslav/friendsandfoes/mixin/BeeEntityMixin.java index 3009c9f94..d4b5c4862 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/mixin/BeeEntityMixin.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/mixin/BeeEntityMixin.java @@ -3,29 +3,18 @@ import com.faboslav.friendsandfoes.entity.passive.ai.goal.BeePollinateMoobloomGoal; import net.minecraft.entity.EntityType; import net.minecraft.entity.damage.DamageSource; -import net.minecraft.entity.mob.Angerable; import net.minecraft.entity.passive.AnimalEntity; import net.minecraft.entity.passive.BeeEntity; -import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; -import org.jetbrains.annotations.Nullable; import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Shadow; 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; @Mixin(BeeEntity.class) -public abstract class BeeEntityMixin extends AnimalEntity implements Angerable +public abstract class BeeEntityMixin extends AnimalEntity { - @Shadow - @Nullable - private BlockPos hivePos; - - @Shadow - abstract boolean isHiveValid(); - BeePollinateMoobloomGoal pollinateMoobloomGoal; public BeeEntityMixin( @@ -58,30 +47,12 @@ public void damage( if (this.isInvulnerableTo(source)) { info.setReturnValue(false); } else { - if (!this.world.isClient) { + if ( + this.world.isClient() == false + && this.pollinateMoobloomGoal != null + ) { this.pollinateMoobloomGoal.cancel(); } } } - - - /* - @Inject( - method = "isHiveValid", - at = @At("RETURN"), - cancellable = true - ) - private void isHiveValid( - CallbackInfoReturnable cir - ){ - var isHiveValid = cir.getReturnValueZ(); - if(isHiveValid) { - cir.setReturnValue(isHiveValid); - } - - BlockEntity blockEntity = this.world.getBlockEntity(this.hivePos); - isHiveValid = blockEntity != null && blockEntity.getType() == ModBlockEntityTypes.FRIENDS_AND_FOES_BEEHIVES; - - cir.setReturnValue(isHiveValid); - }*/ } diff --git a/common/src/main/java/com/faboslav/friendsandfoes/world/spawner/IceologerSpawner.java b/common/src/main/java/com/faboslav/friendsandfoes/world/spawner/IceologerSpawner.java index 25f01fe64..63559c9f4 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/world/spawner/IceologerSpawner.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/world/spawner/IceologerSpawner.java @@ -38,7 +38,6 @@ public int spawn(ServerWorld world, boolean spawnMonsters, boolean spawnAnimals) if (this.cooldown > 0) { return 0; - } this.cooldown += 12000 + random.nextInt(1200); @@ -47,7 +46,7 @@ public int spawn(ServerWorld world, boolean spawnMonsters, boolean spawnAnimals) if ( l < 5L || world.isDay() == false - || random.nextInt(5) != 0 + || random.nextInt(5) != 3 ) { return 0; } @@ -84,7 +83,7 @@ public int spawn(ServerWorld world, boolean spawnMonsters, boolean spawnAnimals) var precipitation = registryEntry.value().getPrecipitation(); if ( - category != Biome.Category.TAIGA + category != Category.TAIGA || precipitation != Biome.Precipitation.SNOW ) { return 0; @@ -106,7 +105,7 @@ public int spawn(ServerWorld world, boolean spawnMonsters, boolean spawnAnimals) return 0; } - iceologer.setPatrolLeader(true); + iceologer.setPatrolLeader(false); iceologer.setRandomPatrolTarget(); iceologer.setPosition(mutable.getX(), mutable.getY(), mutable.getZ()); iceologer.initialize(world, world.getLocalDifficulty(mutable), SpawnReason.PATROL, null, null); diff --git a/common/src/main/java/com/faboslav/friendsandfoes/world/spawner/IllusionerSpawner.java b/common/src/main/java/com/faboslav/friendsandfoes/world/spawner/IllusionerSpawner.java index 21fcab200..73be5d45b 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/world/spawner/IllusionerSpawner.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/world/spawner/IllusionerSpawner.java @@ -46,7 +46,7 @@ public int spawn(ServerWorld world, boolean spawnMonsters, boolean spawnAnimals) if ( l < 5L || world.isDay() == false - || random.nextInt(5) != 0 + || random.nextInt(5) != 3 ) { return 0; } @@ -105,7 +105,7 @@ public int spawn(ServerWorld world, boolean spawnMonsters, boolean spawnAnimals) return 0; } - illusioner.setPatrolLeader(true); + illusioner.setPatrolLeader(false); illusioner.setRandomPatrolTarget(); illusioner.setPosition(mutable.getX(), mutable.getY(), mutable.getZ()); illusioner.initialize(world, world.getLocalDifficulty(mutable), SpawnReason.PATROL, null, null); 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 a8cea74be..2805a7646 100644 --- a/common/src/main/resources/assets/friendsandfoes/lang/en_us.json +++ b/common/src/main/resources/assets/friendsandfoes/lang/en_us.json @@ -1,6 +1,6 @@ { "advancements.husbandry.beehive.title": "Be Keeper", - "advancements.husbandry.beehive.description": "Obtain any type of beehive", + "advancements.husbandry.beehive.description": "Obtain all beehive types", "advancements.adventure.kill_iceologer.title": "I was here", "advancements.adventure.kill_iceologer.description": "Kill the iceologer", "advancements.adventure.kill_illusioner.title": "World of illusion", diff --git a/common/src/main/resources/assets/friendsandfoes/lang/zh_cn.json b/common/src/main/resources/assets/friendsandfoes/lang/zh_cn.json index b5ce1e875..35ddb4f5b 100644 --- a/common/src/main/resources/assets/friendsandfoes/lang/zh_cn.json +++ b/common/src/main/resources/assets/friendsandfoes/lang/zh_cn.json @@ -1,6 +1,5 @@ { "advancements.husbandry.beehive.title": "守护者", - "advancements.husbandry.beehive.description": "获得任意类型的蜂箱", "advancements.adventure.kill_illusioner.title": "幻术世界", "advancements.adventure.kill_illusioner.description": "杀死幻术师真身", "advancements.husbandry.shear_a_moobloom.title": "哞哞!", diff --git a/common/src/main/resources/data/friendsandfoes/advancements/husbandry/beehive.json b/common/src/main/resources/data/friendsandfoes/advancements/husbandry/beehive.json index 968041f38..6d6691a41 100644 --- a/common/src/main/resources/data/friendsandfoes/advancements/husbandry/beehive.json +++ b/common/src/main/resources/data/friendsandfoes/advancements/husbandry/beehive.json @@ -22,13 +22,90 @@ "items": [ { "items": [ - "minecraft:beehive", - "friendsandfoes:acacia_beehive", - "friendsandfoes:birch_beehive", - "friendsandfoes:crimson_beehive", - "friendsandfoes:dark_oak_beehive", - "friendsandfoes:jungle_beehive", - "friendsandfoes:spruce_beehive", + "minecraft:beehive" + ] + } + ] + } + }, + "acacia_beehive": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "items": [ + "friendsandfoes:acacia_beehive" + ] + } + ] + } + }, + "birch_beehive": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "items": [ + "friendsandfoes:birch_beehive" + ] + } + ] + } + }, + "crimson_beehive": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "items": [ + "friendsandfoes:crimson_beehive" + ] + } + ] + } + }, + "dark_oak_beehive": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "items": [ + "friendsandfoes:dark_oak_beehive" + ] + } + ] + } + }, + "jungle_beehive": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "items": [ + "friendsandfoes:jungle_beehive" + ] + } + ] + } + }, + "spruce_beehive": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "items": [ + "friendsandfoes:spruce_beehive" + ] + } + ] + } + }, + "warped_beehive": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "items": [ "friendsandfoes:warped_beehive" ] } @@ -39,6 +116,27 @@ "requirements": [ [ "beehive" + ], + [ + "acacia_beehive" + ], + [ + "birch_beehive" + ], + [ + "crimson_beehive" + ], + [ + "dark_oak_beehive" + ], + [ + "jungle_beehive" + ], + [ + "spruce_beehive" + ], + [ + "warped_beehive" ] ] } \ No newline at end of file diff --git a/common/src/main/resources/data/minecraft/tags/entity_types/powder_snow_walkable_mobs.json b/common/src/main/resources/data/minecraft/tags/entity_types/powder_snow_walkable_mobs.json new file mode 100644 index 000000000..fd3675976 --- /dev/null +++ b/common/src/main/resources/data/minecraft/tags/entity_types/powder_snow_walkable_mobs.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "friendsandfoes:iceologer" + ] +} \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index deac0df0e..e925078a5 100644 --- a/gradle.properties +++ b/gradle.properties @@ -7,7 +7,7 @@ org.gradle.configureondemand=false # Mod mod_name=Friends&Foes mod_id=friendsandfoes -mod_version=1.3.1 +mod_version=1.3.2 mod_author=Faboslav mod_description=Adds all eliminated mobs from the minecraft mob votes with rich lore. maven_group=com.faboslav.friendsandfoes