From 571e839cc63e7e51246138b5d9b1c529d80c7e1f Mon Sep 17 00:00:00 2001 From: Kli Kli Date: Fri, 9 Aug 2024 16:50:54 +0200 Subject: [PATCH] fix: add hint if beaver is not upgraded --- src/generated/resources/assets/occultism/lang/en_us.json | 1 + .../common/entity/familiar/BeaverFamiliarEntity.java | 4 +++- .../com/klikli_dev/occultism/datagen/lang/ENUSProvider.java | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/generated/resources/assets/occultism/lang/en_us.json b/src/generated/resources/assets/occultism/lang/en_us.json index 22054442f..c625121df 100644 --- a/src/generated/resources/assets/occultism/lang/en_us.json +++ b/src/generated/resources/assets/occultism/lang/en_us.json @@ -843,6 +843,7 @@ "debug.occultism.debug_wand.printed_glyphs": "Printed glyphs", "debug.occultism.debug_wand.spirit_selected": "Selected spirit with id %s", "debug.occultism.debug_wand.spirit_tamed": "Tamed spirit with id %s", + "dialog.occultism.beaver.no_upgrade": "A Blacksmith Familiar needs to upgrade the Beaver before he dispenses snacks!", "dialog.occultism.beaver.snack_on_cooldown": "Hey now, don't be greedy!", "dialog.occultism.dragon.pet": "purrr", "dialog.occultism.mummy.kapow": "KAPOW!", diff --git a/src/main/java/com/klikli_dev/occultism/common/entity/familiar/BeaverFamiliarEntity.java b/src/main/java/com/klikli_dev/occultism/common/entity/familiar/BeaverFamiliarEntity.java index d6d9d307e..935237b85 100644 --- a/src/main/java/com/klikli_dev/occultism/common/entity/familiar/BeaverFamiliarEntity.java +++ b/src/main/java/com/klikli_dev/occultism/common/entity/familiar/BeaverFamiliarEntity.java @@ -128,7 +128,9 @@ public InteractionResult mobInteract(Player pPlayer, InteractionHand pHand) { if (this.getOwner() == pPlayer) { if (!pPlayer.isShiftKeyDown() && itemstack.isEmpty()) { - if(this.level().getGameTime() > this.lastSnackTime + SNACK_INTERVAL){ + if (!this.hasBlacksmithUpgrade()) { + pPlayer.displayClientMessage(Component.translatable("dialog.occultism.beaver.no_upgrade"), true); + } else if (this.level().getGameTime() > this.lastSnackTime + SNACK_INTERVAL) { this.lastSnackTime = this.level().getGameTime(); ItemHandlerHelper.giveItemToPlayer(pPlayer, new ItemStack(OccultismItems.BEAVER_NUGGET.get())); } else { diff --git a/src/main/java/com/klikli_dev/occultism/datagen/lang/ENUSProvider.java b/src/main/java/com/klikli_dev/occultism/datagen/lang/ENUSProvider.java index c70409bd8..a2ed9431b 100644 --- a/src/main/java/com/klikli_dev/occultism/datagen/lang/ENUSProvider.java +++ b/src/main/java/com/klikli_dev/occultism/datagen/lang/ENUSProvider.java @@ -3191,6 +3191,7 @@ private void addDialogs() { this.add("dialog.occultism.dragon.pet", "purrr"); this.add("dialog.occultism.mummy.kapow", "KAPOW!"); this.add("dialog.occultism.beaver.snack_on_cooldown", "Hey now, don't be greedy!"); + this.add("dialog.occultism.beaver.no_upgrade", "A Blacksmith Familiar needs to upgrade the Beaver before he dispenses snacks!"); } private void addModonomiconIntegration() {