From df093b44e06eab3594de9fea93b6d459c9640a6b Mon Sep 17 00:00:00 2001 From: Raycoms Date: Mon, 27 Jan 2025 14:23:52 +0100 Subject: [PATCH] Some fixes (#10617) Fix Quarry Issue Fix coffee research desc Fix wrong damage source key Fix an issue with patreon rewards unlocking --- .../assets/minecolonies/lang/default.json | 2 +- ...barbarian.json => campchiefbarbarian.json} | 0 .../api/util/DamageSourceKeys.java | 2 +- .../client/gui/townhall/WindowMainPage.java | 19 +++++++++++++------ .../workers/production/EntityAIQuarrier.java | 2 +- .../defaults/DefaultResearchProvider.java | 2 +- 6 files changed, 17 insertions(+), 10 deletions(-) rename src/datagen/generated/minecolonies/data/minecolonies/damage_type/{ccamphiefbarbarian.json => campchiefbarbarian.json} (100%) diff --git a/src/datagen/generated/minecolonies/assets/minecolonies/lang/default.json b/src/datagen/generated/minecolonies/assets/minecolonies/lang/default.json index f0354b70913..b0e39b6cc4c 100644 --- a/src/datagen/generated/minecolonies/assets/minecolonies/lang/default.json +++ b/src/datagen/generated/minecolonies/assets/minecolonies/lang/default.json @@ -267,7 +267,7 @@ "com.minecolonies.research.effects.sifterflintunlock.description": "Stonemason Learns How to Make Flint Meshes for the Sifter", "com.minecolonies.research.effects.sifterironunlock.description": "Blacksmith Learns How to Make Iron Meshes for the Sifter", "com.minecolonies.research.effects.sifterstringunlock.description": "Fletcher Learns How to Make String Meshes for the Sifter", - "com.minecolonies.research.effects.sleeplessmultiplier.description": "Guards Need %3$s%% Less Sleep", + "com.minecolonies.research.effects.sleeplessmultiplier.description": "Guards Need Less Sleep", "com.minecolonies.research.effects.softshoesunlock.description": "Farmers will no longer trample crops", "com.minecolonies.research.effects.standard.description": "Place Rallying Banner at location", "com.minecolonies.research.effects.teachingmultiplier.description": "XP Gain When Studying +%3$s%%", diff --git a/src/datagen/generated/minecolonies/data/minecolonies/damage_type/ccamphiefbarbarian.json b/src/datagen/generated/minecolonies/data/minecolonies/damage_type/campchiefbarbarian.json similarity index 100% rename from src/datagen/generated/minecolonies/data/minecolonies/damage_type/ccamphiefbarbarian.json rename to src/datagen/generated/minecolonies/data/minecolonies/damage_type/campchiefbarbarian.json diff --git a/src/main/java/com/minecolonies/api/util/DamageSourceKeys.java b/src/main/java/com/minecolonies/api/util/DamageSourceKeys.java index 18390707d33..cd00cf17352 100644 --- a/src/main/java/com/minecolonies/api/util/DamageSourceKeys.java +++ b/src/main/java/com/minecolonies/api/util/DamageSourceKeys.java @@ -50,7 +50,7 @@ public class DamageSourceKeys public static ResourceKey CAMP_NORSEMENARCHER = ResourceKey.create(Registries.DAMAGE_TYPE, new ResourceLocation(Constants.MOD_ID, "campnorsemenarcher")); public static ResourceKey CAMP_SHIELDMAIDEN = ResourceKey.create(Registries.DAMAGE_TYPE, new ResourceLocation(Constants.MOD_ID, "campshieldmaiden")); public static ResourceKey CAMP_BARBARIAN = ResourceKey.create(Registries.DAMAGE_TYPE, new ResourceLocation(Constants.MOD_ID, "campbarbarian")); - public static ResourceKey CAMP_CHIEFBARBARIAN = ResourceKey.create(Registries.DAMAGE_TYPE, new ResourceLocation(Constants.MOD_ID, "ccamphiefbarbarian")); + public static ResourceKey CAMP_CHIEFBARBARIAN = ResourceKey.create(Registries.DAMAGE_TYPE, new ResourceLocation(Constants.MOD_ID, "campchiefbarbarian")); public static ResourceKey CAMP_ARCHERBARBARIAN = ResourceKey.create(Registries.DAMAGE_TYPE, new ResourceLocation(Constants.MOD_ID, "camparcherbarbarian")); public static ResourceKey CAMP_PIRATE = ResourceKey.create(Registries.DAMAGE_TYPE, new ResourceLocation(Constants.MOD_ID, "camppirate")); public static ResourceKey CAMP_CHIEFPIRATE = ResourceKey.create(Registries.DAMAGE_TYPE, new ResourceLocation(Constants.MOD_ID, "campchiefpirate")); diff --git a/src/main/java/com/minecolonies/core/client/gui/townhall/WindowMainPage.java b/src/main/java/com/minecolonies/core/client/gui/townhall/WindowMainPage.java index f78b891ed44..3427aa51736 100644 --- a/src/main/java/com/minecolonies/core/client/gui/townhall/WindowMainPage.java +++ b/src/main/java/com/minecolonies/core/client/gui/townhall/WindowMainPage.java @@ -45,7 +45,6 @@ */ public class WindowMainPage extends AbstractWindowTownHall { - /** * Is the special feature unlocked. */ @@ -76,8 +75,6 @@ public class WindowMainPage extends AbstractWindowTownHall */ private int initialNamePackIndex; - - /** * Label for the colony name. */ @@ -260,8 +257,8 @@ public void onUpdate() final Pane textPane = findPaneByID(DROPDOWN_TEXT_ID); final Pane namePane = findPaneByID(DROPDOWN_NAME_ID); final Pane resetButton = findPaneByID(BUTTON_RESET_TEXTURE); - - if (isFeatureUnlocked.get()) + final boolean isOwner = building.getColony().getPermissions().getOwner().equals(Minecraft.getInstance().player.getUUID()); + if (isFeatureUnlocked.get() && isOwner) { findPaneByID(BUTTON_PATREON).hide(); textPane.enable(); @@ -297,6 +294,16 @@ public void onUpdate() .appendNL(Component.empty()) .appendNL(Component.translatableEscape("com.minecolonies.core.townhall.patreon")).paragraphBreak() .build(); + + if (isFeatureUnlocked.get() && !isOwner) + { + textPaneToolTipBuilder.appendNL(Component.empty()); + namePaneToolTipBuilder.appendNL(Component.empty()); + textPaneToolTipBuilder.appendNL(Component.translatable("com.minecolonies.core.townhall.patreon.needs_owner")); + namePaneToolTipBuilder.appendNL(Component.translatable("com.minecolonies.core.townhall.patreon.needs_owner")); + } + textPaneToolTipBuilder.build(); + namePaneToolTipBuilder.build(); } } @@ -305,7 +312,7 @@ public void onUpdate() */ public void checkFeatureUnlock() { - if (isFeatureUnlocked.get() || !building.getColony().getPermissions().getOwner().equals(Minecraft.getInstance().player.getUUID())) + if (isFeatureUnlocked.get()) { return; } diff --git a/src/main/java/com/minecolonies/core/entity/ai/workers/production/EntityAIQuarrier.java b/src/main/java/com/minecolonies/core/entity/ai/workers/production/EntityAIQuarrier.java index d617352732f..1f71fb28a79 100644 --- a/src/main/java/com/minecolonies/core/entity/ai/workers/production/EntityAIQuarrier.java +++ b/src/main/java/com/minecolonies/core/entity/ai/workers/production/EntityAIQuarrier.java @@ -293,7 +293,7 @@ else if (!progressPos.equals(NULL_POS)) protected BlockPos getPosToWorkAt() { final BlockPos progressPos = getProgressPos() == null ? NULL_POS : getProgressPos().getA(); - if (progressPos == NULL_POS) + if (progressPos.equals(NULL_POS)) { return null; } diff --git a/src/main/java/com/minecolonies/core/generation/defaults/DefaultResearchProvider.java b/src/main/java/com/minecolonies/core/generation/defaults/DefaultResearchProvider.java index ce66355189d..088e91f9790 100644 --- a/src/main/java/com/minecolonies/core/generation/defaults/DefaultResearchProvider.java +++ b/src/main/java/com/minecolonies/core/generation/defaults/DefaultResearchProvider.java @@ -129,7 +129,7 @@ public Collection getResearchEffectCollection() effects.add(new ResearchEffect(VINES).setTranslatedName("Citizens can climb Vines")); effects.add(new ResearchEffect(RETREAT).setTranslatedName("Guards Flee Under 20% HP")); effects.add(new ResearchEffect(SHIELD_USAGE).setTranslatedName("Knights Unlock Shield Use")); - effects.add(new ResearchEffect(SLEEP_LESS).setTranslatedName("Guards Need %3$s%% Less Sleep")); + effects.add(new ResearchEffect(SLEEP_LESS).setTranslatedName("Guards Need Less Sleep")); effects.add(new ResearchEffect(GUARD_CRIT).setTranslatedName("Guards have a chance to score critical hits").setLevels(new double[] {0.2, 0.3, 0.4, 0.5})); effects.add(new ResearchEffect(KNIGHT_WHIRLWIND).setTranslatedName("Knights Learn Special Attack That Damages and Knocks Back Nearby Enemies")); effects.add(new ResearchEffect(WORKING_IN_RAIN).setTranslatedName("Citizens Work in Rain"));