Skip to content

Commit ca4af03

Browse files
authored
Merge pull request #340 from FTBTeam/dev
Dev
2 parents 6ed0496 + b483252 commit ca4af03

23 files changed

+92
-22
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,15 @@ 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+
## [2101.1.6]
8+
9+
### Added
10+
* Added "Minimap Pointer Icon Mode" clientside setting to control whether pointer, player head, or both, are show on the minimap
11+
12+
### Fixed
13+
* Barrier blocks no longer show up on the map/minimap
14+
* Improved integration for map block display with several third party mods
15+
716
## [2101.1.5]
817

918
### Fixed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@
1111
import com.mojang.brigadier.tree.LiteralCommandNode;
1212
import com.mojang.util.UndashedUuid;
1313
import dev.architectury.networking.NetworkManager;
14-
import dev.architectury.platform.Platform;
1514
import dev.ftb.mods.ftbchunks.api.ChunkTeamData;
1615
import dev.ftb.mods.ftbchunks.api.ClaimResult;
1716
import dev.ftb.mods.ftbchunks.api.ClaimedChunk;
1817
import dev.ftb.mods.ftbchunks.api.FTBChunksProperties;
1918
import dev.ftb.mods.ftbchunks.client.gui.EntityIconSettingsScreen;
19+
import dev.ftb.mods.ftbchunks.client.mapicon.EntityIcons;
2020
import dev.ftb.mods.ftbchunks.data.ChunkTeamDataImpl;
2121
import dev.ftb.mods.ftbchunks.data.ClaimedChunkImpl;
2222
import dev.ftb.mods.ftbchunks.data.ClaimedChunkManagerImpl;
@@ -224,7 +224,7 @@ public static void registerCommands(CommandDispatcher<CommandSourceStack> dispat
224224
)
225225
);
226226

227-
if (Platform.isDevelopmentEnvironment()) {
227+
if (EntityIcons.isDevMode()) {
228228
dispatcher.register(Commands.literal("ftbchunks_dev")
229229
.then(Commands.literal("create_gui")
230230
.executes(context -> {

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

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,12 @@
1111
import dev.ftb.mods.ftbchunks.util.DimensionFilter;
1212
import dev.ftb.mods.ftblibrary.config.NameMap;
1313
import dev.ftb.mods.ftblibrary.integration.stages.StageHelper;
14-
import dev.ftb.mods.ftblibrary.snbt.config.*;
14+
import dev.ftb.mods.ftblibrary.snbt.config.BooleanValue;
15+
import dev.ftb.mods.ftblibrary.snbt.config.DoubleValue;
16+
import dev.ftb.mods.ftblibrary.snbt.config.EnumValue;
17+
import dev.ftb.mods.ftblibrary.snbt.config.IntValue;
18+
import dev.ftb.mods.ftblibrary.snbt.config.SNBTConfig;
19+
import dev.ftb.mods.ftblibrary.snbt.config.StringListValue;
1520
import dev.ftb.mods.ftbteams.api.property.PrivacyMode;
1621
import net.minecraft.server.level.ServerPlayer;
1722
import net.minecraft.world.entity.player.Player;
@@ -113,6 +118,11 @@ public interface FTBChunksWorldConfig {
113118
BooleanValue DEF_PVP = TEAM_PROP_DEFAULTS.addBoolean("def_pvp", true)
114119
.comment("Default PvP setting in claimed chunks");
115120

121+
SNBTConfig DEV = CONFIG.addGroup("dev");
122+
BooleanValue DEV_COMMANDS = DEV.addBoolean("commands", false)
123+
.excluded()
124+
.comment("Enable dev commands");
125+
116126
static int getMaxClaimedChunks(ChunkTeamData playerData, ServerPlayer player) {
117127
if (player != null) {
118128
return PermissionsHelper.getMaxClaimedChunks(player, MAX_CLAIMED_CHUNKS.get()) + playerData.getExtraClaimChunks();

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

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -746,13 +746,26 @@ public void renderHud(GuiGraphics graphics, DeltaTracker tickDelta) {
746746
poseStack.scale(size / 16F, size / 16F, 1F);
747747
m = poseStack.last().pose();
748748

749-
RenderSystem.setShader(GameRenderer::getPositionTexColorShader);
750-
buffer = tessellator.begin(VertexFormat.Mode.QUADS, DefaultVertexFormat.POSITION_TEX_COLOR);
751-
buffer.addVertex(m, -1, -1, 0).setColor(255, 255, 255, 200).setUv(0F, 0F);
752-
buffer.addVertex(m, -1, 1, 0).setColor(255, 255, 255, 200).setUv(0F, 1F);
753-
buffer.addVertex(m, 1, 1, 0).setColor(255, 255, 255, 200).setUv(1F, 1F);
754-
buffer.addVertex(m, 1, -1, 0).setColor(255, 255, 255, 200).setUv(1F, 0F);
755-
BufferUploader.drawWithShader(buffer.buildOrThrow());
749+
PointerIconMode mode = FTBChunksClientConfig.POINTER_ICON_MODE_MINIMAP.get();
750+
if (mode.showPointer()) {
751+
RenderSystem.setShader(GameRenderer::getPositionTexColorShader);
752+
buffer = tessellator.begin(VertexFormat.Mode.QUADS, DefaultVertexFormat.POSITION_TEX_COLOR);
753+
buffer.addVertex(m, -1, -1, 0).setColor(255, 255, 255, 200).setUv(0F, 0F);
754+
buffer.addVertex(m, -1, 1, 0).setColor(255, 255, 255, 200).setUv(0F, 1F);
755+
buffer.addVertex(m, 1, 1, 0).setColor(255, 255, 255, 200).setUv(1F, 1F);
756+
buffer.addVertex(m, 1, -1, 0).setColor(255, 255, 255, 200).setUv(1F, 0F);
757+
BufferUploader.drawWithShader(buffer.buildOrThrow());
758+
}
759+
if (mode.showFace()) {
760+
if (mode.showPointer()) {
761+
// scale & shift face size a little to better align with the pointer
762+
poseStack.scale(0.75f, 0.75f, 0.75f);
763+
poseStack.translate(0f, 0.32f, 0f);
764+
}
765+
poseStack.translate(-0.5f, -0.5f, 0f);
766+
new EntityMapIcon(mc.player, FaceIcon.getFace(mc.player.getGameProfile()))
767+
.draw(MapType.MINIMAP, graphics, 0, 0, 1, 1, false, 255);
768+
}
756769

757770
poseStack.popPose();
758771
}
@@ -1120,6 +1133,7 @@ private void mapIcons(MapIconEvent event) {
11201133
event.add(new PointerIcon());
11211134
}
11221135
}
1136+
11231137
}
11241138

11251139
void refreshMinimapIcons() {

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ public interface FTBChunksClientConfig {
9292
StringMapValue MINIMAP_SETTINGS = MINIMAP.add(new MinimapComponentConfig(MINIMAP, "info_settings", Collections.emptyMap())).comment("Settings for minimap info components");
9393
EntityTypeBoolMapValue ENTITY_ICON = MINIMAP.add(new EntityTypeBoolMapValue(MINIMAP, "entity_icon", Collections.emptyMap())).comment("Entity icons on minimap");
9494
EnumValue<PointerIconMode> POINTER_ICON_MODE = MINIMAP.addEnum("pointer_icon_mode", PointerIconMode.NAME_MAP).comment("Mode for the pointer icon to render on full screen minimap");
95+
EnumValue<PointerIconMode> POINTER_ICON_MODE_MINIMAP = MINIMAP.addEnum("pointer_icon_mode_minimap", PointerIconMode.NAME_MAP).comment("Mode for the pointer icon to render on minimap");
9596

9697
SNBTConfig ADVANCED = CONFIG.addGroup("advanced", 3);
9798
BooleanValue DEBUG_INFO = ADVANCED.addBoolean("debug_info", false).comment("Enables debug info");

common/src/main/java/dev/ftb/mods/ftbchunks/client/mapicon/EntityIcons.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import dev.architectury.platform.Platform;
1212
import dev.architectury.registry.registries.RegistrarManager;
1313
import dev.ftb.mods.ftbchunks.FTBChunks;
14+
import dev.ftb.mods.ftbchunks.FTBChunksWorldConfig;
1415
import dev.ftb.mods.ftbchunks.api.FTBChunksAPI;
1516
import dev.ftb.mods.ftbchunks.client.FTBChunksClientConfig;
1617
import dev.ftb.mods.ftblibrary.icon.Icon;
@@ -89,7 +90,7 @@ protected Map<EntityType<?>, EntityIconSettings> prepare(ResourceManager resourc
8990
}
9091

9192
if (entityIconSettings == null) {
92-
if (entityType.getCategory() != MobCategory.MISC && Platform.isDevelopmentEnvironment()) {
93+
if (entityType.getCategory() != MobCategory.MISC && isDevMode()) {
9394
LOGGER.error("Missing entity icon settings for {}", id);
9495
entityIconSettings = EntityIconSettings.OLD_HIDDEN;
9596
} else {
@@ -232,4 +233,8 @@ public static Icon getIcon(EntityType<?> entityType) {
232233
return getIcon(entity);
233234
}
234235
}
236+
237+
public static boolean isDevMode() {
238+
return Platform.isDevelopmentEnvironment() || FTBChunksWorldConfig.DEV_COMMANDS.get();
239+
}
235240
}

common/src/main/java/dev/ftb/mods/ftbchunks/data/ClaimedChunkManagerImpl.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import dev.ftb.mods.ftbchunks.FTBChunks;
66
import dev.ftb.mods.ftbchunks.FTBChunksExpected;
77
import dev.ftb.mods.ftbchunks.FTBChunksWorldConfig;
8+
import dev.ftb.mods.ftbchunks.PlayerNotifier;
89
import dev.ftb.mods.ftbchunks.api.ClaimedChunk;
910
import dev.ftb.mods.ftbchunks.api.ClaimedChunkManager;
1011
import dev.ftb.mods.ftbchunks.api.Protection;
@@ -16,6 +17,7 @@
1617
import it.unimi.dsi.fastutil.longs.Long2ObjectMap;
1718
import it.unimi.dsi.fastutil.longs.Long2ObjectMaps;
1819
import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap;
20+
import net.minecraft.ChatFormatting;
1921
import net.minecraft.core.BlockPos;
2022
import net.minecraft.nbt.CompoundTag;
2123
import net.minecraft.network.chat.Component;
@@ -213,8 +215,11 @@ public boolean shouldPreventInteraction(@Nullable Entity actor, InteractionHand
213215
boolean prevented = policy.isOverride() ?
214216
policy.shouldPreventInteraction() :
215217
!player.isSpectator() && (isFake || !getBypassProtection(player.getUUID()));
216-
if (prevented && isFake) {
217-
chunk.getTeamData().logPreventedAccess(player, System.currentTimeMillis());
218+
if (prevented) {
219+
PlayerNotifier.notifyWithCooldown(player, Component.translatable("ftbchunks.action_prevented").withStyle(ChatFormatting.GOLD), 2000);
220+
if (isFake) {
221+
chunk.getTeamData().logPreventedAccess(player, System.currentTimeMillis());
222+
}
218223
}
219224
return prevented;
220225
} else if (FTBChunksWorldConfig.noWilderness(player)) {
@@ -224,7 +229,7 @@ public boolean shouldPreventInteraction(@Nullable Entity actor, InteractionHand
224229
} else if (!isFake && (getBypassProtection(player.getUUID()) || player.isSpectator())) {
225230
return false;
226231
}
227-
player.displayClientMessage(Component.translatable("ftbchunks.need_to_claim_chunk"), true);
232+
PlayerNotifier.notifyWithCooldown(player, Component.translatable("ftbchunks.need_to_claim_chunk").withStyle(ChatFormatting.GOLD), 2000);
228233
return true;
229234
}
230235

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"sky_stone_block": "#1F2221"
3+
}

common/src/main/resources/assets/ars_nouveau/ftbchunks_block_colors.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@
22
"green_archwood_leaves": "#6DD54A",
33
"red_archwood_leaves": "#C85732",
44
"purple_archwood_leaves": "#8F2FBB",
5-
"blue_archwood_leaves": "#3289C8"
5+
"blue_archwood_leaves": "#3289C8",
6+
"yellow_archwood_leave": "#FFFF00"
67
}

common/src/main/resources/assets/ftbchunks/lang/en_us.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@
7878
"ftbchunks.minimap.font_scale.tooltip": "Recommended to keep this to a multiple of 0.5",
7979
"ftbchunks.minimap.proportional": "Proportional sizing",
8080
"ftbchunks.minimap.proportional.tooltip": "When true, minimap size is proportional to 10%% of the screen width (modifiable by the Scale setting)\nWhen false, it is a fixed size regardless of screen resolution",
81-
"ftbchunks.minimap.pointer_icon_mode": "Pointer Icon Mode",
81+
"ftbchunks.minimap.pointer_icon_mode": "Large Minimap Pointer Icon Mode",
82+
"ftbchunks.minimap.pointer_icon_mode_minimap": "Minimap Pointer Icon Mode",
8283
"ftbchunks.minimap.pointer_icon_mode.both": "Both",
8384
"ftbchunks.minimap.pointer_icon_mode.pointer": "Pointer",
8485
"ftbchunks.minimap.pointer_icon_mode.face": "Face Icon",
@@ -220,6 +221,7 @@
220221
"ftbchunks.claim_result.already_loaded": "Chunk already loaded",
221222
"ftbchunks.claim_result.not_loaded": "Chunk not loaded",
222223
"ftbchunks.need_to_claim_chunk": "You need to claim this chunk to interact with blocks here!",
224+
"ftbchunks.action_prevented": "Interaction prevented here by claim protection!",
223225
"ftbchunks.label.show": "Show",
224226
"ftbchunks.label.hide": "Hide",
225227
"ftbchunks.message.no_pvp": "PvP combat is disabled here",

0 commit comments

Comments
 (0)