Skip to content

Commit dee8d56

Browse files
Merge pull request #254 from FTBTeam/1.19/dev
1.19/dev
2 parents 32bea7d + 97b47db commit dee8d56

23 files changed

+398
-225
lines changed

CHANGELOG.md

+16
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,22 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [1902.3.22]
8+
9+
### Added
10+
* The claim manager screen can now be opened without first opening the large map screen
11+
* Added a new sidebar button "FTB Chunks: Claim Manager" to open the claim manager screen
12+
* Also added a new key binding to open the claim manager, not bound to any key by default
13+
* Added Luckperms support, as an alternative to FTB Ranks
14+
* Same permission node names: "ftbchunks.max_claimed", "ftbchunks.max_force_loaded", "ftbchunks.chunk_load_offline", "ftbchunks.no_wilderness"
15+
* The minimap is now sized as a proportional of the current screen width
16+
* Base size is 10% of the screen width, although this is modifiable with the existing "Scale" client setting
17+
* Added new "Proportional Sizing" client setting, true by default. Set this to false if you prefer the old behaviour (fixed-size minimap regardless of screen resolution)
18+
19+
### Fixed
20+
* Fixed occasional (non-fatal) NPE which could be thrown in the client block scanning thread
21+
* Made chunks owned by server teams exempt from claim and forceload auto-expiry (server teams are admin-level)
22+
723
## [1902.3.21]
824

925
### Added

common/build.gradle

+2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ dependencies {
77
modImplementation("dev.ftb.mods:ftb-ranks:${rootProject.ftb_ranks_version}") { transitive = false }
88
modImplementation("dev.latvian.mods:rhino:${rootProject.rhino_version}") { transitive = false }
99
modImplementation("dev.latvian.mods:kubejs:${rootProject.kubejs_version}") { transitive = false }
10+
11+
compileOnly 'net.luckperms:api:5.4'
1012
}
1113

1214
def ENV = System.getenv()

common/src/main/java/dev/ftb/mods/ftbchunks/FTBChunks.java

+2-5
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import dev.architectury.utils.value.IntValue;
1414
import dev.ftb.mods.ftbchunks.client.FTBChunksClient;
1515
import dev.ftb.mods.ftbchunks.data.*;
16+
import dev.ftb.mods.ftbchunks.integration.ftbranks.FTBRanksIntegration;
1617
import dev.ftb.mods.ftbchunks.integration.stages.StageHelper;
1718
import dev.ftb.mods.ftbchunks.integration.waystones.WaystonesCommon;
1819
import dev.ftb.mods.ftbchunks.net.*;
@@ -80,12 +81,8 @@ public class FTBChunks {
8081

8182
public static final Registrar<Block> BLOCK_REGISTRY = Registries.get(MOD_ID).get(Registry.BLOCK_REGISTRY);
8283

83-
public static boolean ranksMod = false;
84-
8584
public FTBChunks() {
8685
PROXY = EnvExecutor.getEnvSpecific(() -> FTBChunksClient::new, () -> FTBChunksCommon::new);
87-
// FTBChunksWorldConfig.init();
88-
ranksMod = Platform.isModLoaded("ftbranks");
8986
FTBChunksNet.init();
9087

9188
for (int i = 0; i < RELATIVE_SPIRAL_POSITIONS.length; i++) {
@@ -135,7 +132,7 @@ public FTBChunks() {
135132
TickEvent.SERVER_POST.register(this::serverTickPost);
136133
TickEvent.PLAYER_POST.register(this::playerTickPost);
137134

138-
if (ranksMod) {
135+
if (Platform.isModLoaded("ftbranks")) {
139136
FTBRanksIntegration.registerEvents();
140137
}
141138
if (Platform.isModLoaded("waystones")) {

common/src/main/java/dev/ftb/mods/ftbchunks/FTBChunksWorldConfig.java

+8-7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package dev.ftb.mods.ftbchunks;
22

33
import dev.ftb.mods.ftbchunks.data.*;
4+
import dev.ftb.mods.ftbchunks.integration.PermissionsHelper;
45
import dev.ftb.mods.ftbchunks.integration.stages.StageHelper;
56
import dev.ftb.mods.ftblibrary.config.NameMap;
67
import dev.ftb.mods.ftblibrary.snbt.config.*;
@@ -37,29 +38,29 @@ public interface FTBChunksWorldConfig {
3738
BooleanValue LOCATION_MODE_OVERRIDE = CONFIG.getBoolean("location_mode_override", false).comment("If true, \"Location Visibility\" team settings are ignored, and all players can see each other anywhere on the map.");
3839

3940
static int getMaxClaimedChunks(FTBChunksTeamData playerData, ServerPlayer player) {
40-
if (FTBChunks.ranksMod && player != null) {
41-
return FTBRanksIntegration.getMaxClaimedChunks(player, MAX_CLAIMED_CHUNKS.get()) + playerData.getExtraClaimChunks();
41+
if (player != null) {
42+
return PermissionsHelper.getInstance().getMaxClaimedChunks(player, MAX_CLAIMED_CHUNKS.get()) + playerData.getExtraClaimChunks();
4243
}
4344

4445
return MAX_CLAIMED_CHUNKS.get() + playerData.getExtraClaimChunks();
4546
}
4647

4748
static int getMaxForceLoadedChunks(FTBChunksTeamData playerData, ServerPlayer player) {
48-
if (FTBChunks.ranksMod && player != null) {
49-
return FTBRanksIntegration.getMaxForceLoadedChunks(player, MAX_FORCE_LOADED_CHUNKS.get()) + playerData.getExtraForceLoadChunks();
49+
if (player != null) {
50+
return PermissionsHelper.getInstance().getMaxForceLoadedChunks(player, MAX_FORCE_LOADED_CHUNKS.get()) + playerData.getExtraForceLoadChunks();
5051
}
5152

5253
return MAX_FORCE_LOADED_CHUNKS.get() + playerData.getExtraForceLoadChunks();
5354
}
5455

5556
static boolean canPlayerOfflineForceload(ServerPlayer player) {
5657
// note: purely checking the player's own permission here; not interested in server defaults or party data
57-
return FTBChunks.ranksMod && player != null && FTBRanksIntegration.getChunkLoadOffline(player, false);
58+
return player != null && PermissionsHelper.getInstance().getChunkLoadOffline(player, false);
5859
}
5960

6061
static boolean noWilderness(ServerPlayer player) {
61-
if (FTBChunks.ranksMod && player != null) {
62-
return FTBRanksIntegration.getNoWilderness(player, NO_WILDERNESS.get());
62+
if (player != null) {
63+
return PermissionsHelper.getInstance().getNoWilderness(player, NO_WILDERNESS.get());
6364
}
6465

6566
return NO_WILDERNESS.get();

common/src/main/java/dev/ftb/mods/ftbchunks/client/ChunkScreen.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import com.mojang.blaze3d.vertex.*;
66
import com.mojang.math.Matrix4f;
77
import dev.ftb.mods.ftbchunks.FTBChunks;
8+
import dev.ftb.mods.ftbchunks.FTBChunksWorldConfig;
89
import dev.ftb.mods.ftbchunks.client.map.MapChunk;
910
import dev.ftb.mods.ftbchunks.client.map.MapDimension;
1011
import dev.ftb.mods.ftbchunks.client.map.MapManager;
@@ -241,7 +242,7 @@ public void mouseReleased(MouseButton button) {
241242

242243
@Override
243244
public boolean keyPressed(Key key) {
244-
if (key.is(GLFW.GLFW_KEY_M) || key.is(GLFW.GLFW_KEY_C)) {
245+
if (FTBChunksWorldConfig.playerHasMapStage(Minecraft.getInstance().player) && (key.is(GLFW.GLFW_KEY_M) || key.is(GLFW.GLFW_KEY_C))) {
245246
new LargeMapScreen().openGui();
246247
return true;
247248
}

0 commit comments

Comments
 (0)