Skip to content

Commit

Permalink
Merge pull request #254 from FTBTeam/1.19/dev
Browse files Browse the repository at this point in the history
1.19/dev
  • Loading branch information
MichaelHillcox authored Jun 13, 2023
2 parents 32bea7d + 97b47db commit dee8d56
Show file tree
Hide file tree
Showing 23 changed files with 398 additions and 225 deletions.
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,22 @@ 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).

## [1902.3.22]

### Added
* The claim manager screen can now be opened without first opening the large map screen
* Added a new sidebar button "FTB Chunks: Claim Manager" to open the claim manager screen
* Also added a new key binding to open the claim manager, not bound to any key by default
* Added Luckperms support, as an alternative to FTB Ranks
* Same permission node names: "ftbchunks.max_claimed", "ftbchunks.max_force_loaded", "ftbchunks.chunk_load_offline", "ftbchunks.no_wilderness"
* The minimap is now sized as a proportional of the current screen width
* Base size is 10% of the screen width, although this is modifiable with the existing "Scale" client setting
* 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)

### Fixed
* Fixed occasional (non-fatal) NPE which could be thrown in the client block scanning thread
* Made chunks owned by server teams exempt from claim and forceload auto-expiry (server teams are admin-level)

## [1902.3.21]

### Added
Expand Down
2 changes: 2 additions & 0 deletions common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ dependencies {
modImplementation("dev.ftb.mods:ftb-ranks:${rootProject.ftb_ranks_version}") { transitive = false }
modImplementation("dev.latvian.mods:rhino:${rootProject.rhino_version}") { transitive = false }
modImplementation("dev.latvian.mods:kubejs:${rootProject.kubejs_version}") { transitive = false }

compileOnly 'net.luckperms:api:5.4'
}

def ENV = System.getenv()
Expand Down
7 changes: 2 additions & 5 deletions common/src/main/java/dev/ftb/mods/ftbchunks/FTBChunks.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import dev.architectury.utils.value.IntValue;
import dev.ftb.mods.ftbchunks.client.FTBChunksClient;
import dev.ftb.mods.ftbchunks.data.*;
import dev.ftb.mods.ftbchunks.integration.ftbranks.FTBRanksIntegration;
import dev.ftb.mods.ftbchunks.integration.stages.StageHelper;
import dev.ftb.mods.ftbchunks.integration.waystones.WaystonesCommon;
import dev.ftb.mods.ftbchunks.net.*;
Expand Down Expand Up @@ -80,12 +81,8 @@ public class FTBChunks {

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

public static boolean ranksMod = false;

public FTBChunks() {
PROXY = EnvExecutor.getEnvSpecific(() -> FTBChunksClient::new, () -> FTBChunksCommon::new);
// FTBChunksWorldConfig.init();
ranksMod = Platform.isModLoaded("ftbranks");
FTBChunksNet.init();

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

if (ranksMod) {
if (Platform.isModLoaded("ftbranks")) {
FTBRanksIntegration.registerEvents();
}
if (Platform.isModLoaded("waystones")) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package dev.ftb.mods.ftbchunks;

import dev.ftb.mods.ftbchunks.data.*;
import dev.ftb.mods.ftbchunks.integration.PermissionsHelper;
import dev.ftb.mods.ftbchunks.integration.stages.StageHelper;
import dev.ftb.mods.ftblibrary.config.NameMap;
import dev.ftb.mods.ftblibrary.snbt.config.*;
Expand Down Expand Up @@ -37,29 +38,29 @@ public interface FTBChunksWorldConfig {
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.");

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

return MAX_CLAIMED_CHUNKS.get() + playerData.getExtraClaimChunks();
}

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

return MAX_FORCE_LOADED_CHUNKS.get() + playerData.getExtraForceLoadChunks();
}

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

static boolean noWilderness(ServerPlayer player) {
if (FTBChunks.ranksMod && player != null) {
return FTBRanksIntegration.getNoWilderness(player, NO_WILDERNESS.get());
if (player != null) {
return PermissionsHelper.getInstance().getNoWilderness(player, NO_WILDERNESS.get());
}

return NO_WILDERNESS.get();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import com.mojang.blaze3d.vertex.*;
import com.mojang.math.Matrix4f;
import dev.ftb.mods.ftbchunks.FTBChunks;
import dev.ftb.mods.ftbchunks.FTBChunksWorldConfig;
import dev.ftb.mods.ftbchunks.client.map.MapChunk;
import dev.ftb.mods.ftbchunks.client.map.MapDimension;
import dev.ftb.mods.ftbchunks.client.map.MapManager;
Expand Down Expand Up @@ -241,7 +242,7 @@ public void mouseReleased(MouseButton button) {

@Override
public boolean keyPressed(Key key) {
if (key.is(GLFW.GLFW_KEY_M) || key.is(GLFW.GLFW_KEY_C)) {
if (FTBChunksWorldConfig.playerHasMapStage(Minecraft.getInstance().player) && (key.is(GLFW.GLFW_KEY_M) || key.is(GLFW.GLFW_KEY_C))) {
new LargeMapScreen().openGui();
return true;
}
Expand Down
Loading

0 comments on commit dee8d56

Please sign in to comment.