Skip to content

Commit

Permalink
Merge pull request #317 from FTBTeam/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
desht authored Aug 15, 2024
2 parents aebb832 + e7ec25f commit 591811c
Show file tree
Hide file tree
Showing 10 changed files with 63 additions and 37 deletions.
16 changes: 15 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,21 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [2001.1.1]
## [2101.1.0]

### Changed
* Minecraft 1.21.1 is now required; this no longer supports Minecraft 1.21
* Vanilla Cherry Trees now show up pink on the map

### Added
* Sidebar buttons for this and other FTB mods can now be enabled/disabled/rearranged (new functionality in FTB Library 2101.1.0)

### Fixed
* Fixed expand/collapse buttons on waypoint editor screen being flipped
* New minimap info components (TPS/game time/real time) are now hidden by default
* Can be toggled on via info settings on the large map screen

## [2100.1.1]

### Added
* The waypoint manager screen has had a facelift
Expand Down
6 changes: 1 addition & 5 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id "architectury-plugin" version "3.4-SNAPSHOT"
id "dev.architectury.loom" version "1.6-SNAPSHOT" apply false
id "dev.architectury.loom" version "1.7-SNAPSHOT" apply false
id "me.modmuss50.mod-publish-plugin" version "0.5.1"
}

Expand All @@ -19,10 +19,6 @@ subprojects {
minecraft "com.mojang:minecraft:${rootProject.minecraft_version}"
mappings loom.officialMojangMappings()
}

configurations.configureEach {
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
}
}

allprojects {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public interface FTBChunksClientConfig {
BooleanValue SQUARE_MINIMAP = MINIMAP.addBoolean("square", false).comment("Draw a square minimap instead of a circular one");
BooleanValue MINIMAP_PROPORTIONAL = MINIMAP.addBoolean("proportional", true).comment("Size minimap proportional to screen width (and scale)");
StringListValue MINIMAP_INFO_ORDER = MINIMAP.addStringList("info_order", Stream.of(PlayerPosInfoComponent.ID, BiomeComponent.ID, ZoneInfoComponent.ID, FPSComponent.ID, GameTimeComponent.ID, RealTimeComponent.ID, DebugComponent.ID).map(ResourceLocation::toString).toList()).comment("Info displayed under minimap");
StringListValue MINIMAP_INFO_HIDDEN = MINIMAP.addStringList("info_hidden", List.of(DebugComponent.ID.toString())).comment("Info hidden under minimap");
StringListValue MINIMAP_INFO_HIDDEN = MINIMAP.addStringList("info_hidden", Stream.of(FPSComponent.ID, GameTimeComponent.ID, RealTimeComponent.ID, DebugComponent.ID).map(ResourceLocation::toString).toList()).comment("Info hidden under minimap");
StringMapValue MINIMAP_SETTINGS = MINIMAP.add(new StringMapValue(MINIMAP, "info_settings", Collections.emptyMap())).comment("Settings for minimap info components");

SNBTConfig ADVANCED = CONFIG.addGroup("advanced", 3);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package dev.ftb.mods.ftbchunks.client.gui;

import com.mojang.blaze3d.platform.InputConstants;
import dev.architectury.networking.NetworkManager;
import dev.ftb.mods.ftbchunks.client.map.MapManager;
import dev.ftb.mods.ftbchunks.client.map.WaypointImpl;
Expand Down Expand Up @@ -51,12 +52,17 @@ public WaypointEditorScreen() {
}

buttonExpandAll = new SimpleButton(topPanel, List.of(Component.translatable("gui.expand_all"), hotkeyTooltip("="), hotkeyTooltip("+")), Icons.UP,
(widget, button) -> toggleAll(false));
buttonCollapseAll = new SimpleButton(topPanel, List.of(Component.translatable("gui.collapse_all"), hotkeyTooltip("-")), Icons.DOWN,
(widget, button) -> toggleAll(true));
buttonCollapseAll = new SimpleButton(topPanel, List.of(Component.translatable("gui.collapse_all"), hotkeyTooltip("-")), Icons.DOWN,
(widget, button) -> toggleAll(false));
}

private void toggleAll(boolean collapsed) {
boolean allOpen = this.collapsed.values().stream().noneMatch(b -> b);
//Don't try and re-render if everything is already open
if (allOpen && !collapsed) {
return;
}
this.collapsed.keySet().forEach(levelResourceKey -> this.collapsed.put(levelResourceKey, collapsed));
scrollBar.setValue(0);
getGui().refreshWidgets();
Expand All @@ -77,6 +83,19 @@ public boolean onInit() {
return true;
}

@Override
public boolean keyPressed(Key key) {
if (super.keyPressed(key)) {
return true;
} else if (key.is(InputConstants.KEY_ADD) || key.is(InputConstants.KEY_EQUALS)) {
toggleAll(false);
} else if (key.is(InputConstants.KEY_MINUS) || key.is(GLFW.GLFW_KEY_KP_SUBTRACT)) {
toggleAll(true);
}
return false;
}


@Override
protected int getTopPanelHeight() {
return 22;
Expand Down Expand Up @@ -238,7 +257,7 @@ public void setWidth(int newWidth) {
distField.setPos(hideButton.getPosX() - 5 - distField.width, yOff);

nameField.setPos(5, yOff);
nameField.setText(ClientTextComponentUtils.ellipsize(getTheme().getFont(), Component.literal(wp.getName()),distField.getPosX() - 5).getString());
nameField.setText(ClientTextComponentUtils.ellipsize(getTheme().getFont(), Component.literal(wp.getName()), distField.getPosX() - 5).getString());
nameField.setHeight(getTheme().getFontHeight() + 2);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,14 @@
import dev.ftb.mods.ftbchunks.api.client.minimap.TranslatedOption;
import dev.ftb.mods.ftbchunks.api.client.minimap.MinimapContext;
import dev.ftb.mods.ftbchunks.api.client.minimap.MinimapInfoComponent;
import dev.ftb.mods.ftbchunks.client.FTBChunksClientConfig;
import dev.ftb.mods.ftblibrary.config.NameMap;
import net.minecraft.client.gui.Font;
import net.minecraft.client.gui.GuiGraphics;
import net.minecraft.network.chat.Component;
import net.minecraft.resources.ResourceLocation;
import org.jetbrains.annotations.Nullable;

import java.time.LocalDateTime;
import java.time.LocalTime;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;

Expand All @@ -31,7 +27,7 @@ public ResourceLocation id() {
@Override
public void render(MinimapContext context, GuiGraphics graphics, Font font) {
String setting = context.getSetting(this);
LocalDateTime now = LocalDateTime.now();
LocalTime now = LocalTime.now();
int hours = now.getHour();
int minutes = now.getMinute();
drawCenteredText(font, graphics, Component.literal(createTimeString(hours, minutes, setting.equals(TimeMode.TWENTY_FOUR.name()))), 0);
Expand Down
14 changes: 0 additions & 14 deletions common/src/main/resources/assets/ftbchunks/sidebar_buttons.json

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"icon": "ftblibrary:icons/map",
"sort_index": 600,
"click": [
"ftbchunks:open_gui"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"icon": "ftblibrary:icons/map; tint=#FF80FFFF",
"sort_index": 601,
"click": [
"ftbchunks:open_claim_gui"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,6 @@
"iron_bars": "ignored",
"lily_pad": "#208030",
"dead_bush": "#A89061",
"glass": "#CCE5E4"
"glass": "#CCE5E4",
"cherry_leaves": "#b390a4"
}
12 changes: 6 additions & 6 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,21 @@ readable_name=FTB Chunks
maven_group=dev.ftb.mods
mod_author=FTB Team

mod_version=2100.1.1
minecraft_version=1.21
mod_version=2101.1.0
minecraft_version=1.21.1

# Deps
#forge_version=50.0.9
neoforge_version=21.0.157
neoforge_version_range=[21.0.143,)
neoforge_version=21.1.9
neoforge_version_range=[21.1.0,)
neoforge_loader_version=4
fabric_loader_version=0.15.11
fabric_api_version=0.100.8+1.21
fabric_api_version_range=>=0.100.1+1.21
architectury_api_version=13.0.2

ftb_library_version=2100.1.3
ftb_teams_version=2100.1.0
ftb_library_version=2101.1.0
ftb_teams_version=2101.1.0

curseforge_id_forge=314906
curseforge_id_fabric=472657
Expand Down

0 comments on commit 591811c

Please sign in to comment.