Skip to content

Commit

Permalink
Some fixes (#10617)
Browse files Browse the repository at this point in the history
Fix Quarry Issue
Fix coffee research desc
Fix wrong damage source key
Fix an issue with patreon rewards unlocking
  • Loading branch information
Raycoms committed Jan 27, 2025
1 parent e5797ba commit df093b4
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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%%",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public class DamageSourceKeys
public static ResourceKey<DamageType> CAMP_NORSEMENARCHER = ResourceKey.create(Registries.DAMAGE_TYPE, new ResourceLocation(Constants.MOD_ID, "campnorsemenarcher"));
public static ResourceKey<DamageType> CAMP_SHIELDMAIDEN = ResourceKey.create(Registries.DAMAGE_TYPE, new ResourceLocation(Constants.MOD_ID, "campshieldmaiden"));
public static ResourceKey<DamageType> CAMP_BARBARIAN = ResourceKey.create(Registries.DAMAGE_TYPE, new ResourceLocation(Constants.MOD_ID, "campbarbarian"));
public static ResourceKey<DamageType> CAMP_CHIEFBARBARIAN = ResourceKey.create(Registries.DAMAGE_TYPE, new ResourceLocation(Constants.MOD_ID, "ccamphiefbarbarian"));
public static ResourceKey<DamageType> CAMP_CHIEFBARBARIAN = ResourceKey.create(Registries.DAMAGE_TYPE, new ResourceLocation(Constants.MOD_ID, "campchiefbarbarian"));
public static ResourceKey<DamageType> CAMP_ARCHERBARBARIAN = ResourceKey.create(Registries.DAMAGE_TYPE, new ResourceLocation(Constants.MOD_ID, "camparcherbarbarian"));
public static ResourceKey<DamageType> CAMP_PIRATE = ResourceKey.create(Registries.DAMAGE_TYPE, new ResourceLocation(Constants.MOD_ID, "camppirate"));
public static ResourceKey<DamageType> CAMP_CHIEFPIRATE = ResourceKey.create(Registries.DAMAGE_TYPE, new ResourceLocation(Constants.MOD_ID, "campchiefpirate"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
*/
public class WindowMainPage extends AbstractWindowTownHall
{

/**
* Is the special feature unlocked.
*/
Expand Down Expand Up @@ -76,8 +75,6 @@ public class WindowMainPage extends AbstractWindowTownHall
*/
private int initialNamePackIndex;



/**
* Label for the colony name.
*/
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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();
}
}

Expand All @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ public Collection<ResearchEffect> 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"));
Expand Down

0 comments on commit df093b4

Please sign in to comment.