Skip to content

Update zh_cn.json #219

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 9 commits into
base: dev
Choose a base branch
from
2 changes: 1 addition & 1 deletion 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 "0.11.0-SNAPSHOT" apply false
id "dev.architectury.loom" version "0.12.0-SNAPSHOT" apply false
}

architectury {
Expand Down
7 changes: 5 additions & 2 deletions common/src/main/java/dev/ftb/mods/ftbchunks/FTBChunks.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import dev.ftb.mods.ftblibrary.math.MathUtils;
import dev.ftb.mods.ftblibrary.math.XZ;
import dev.ftb.mods.ftblibrary.snbt.SNBTCompoundTag;
import dev.ftb.mods.ftblibrary.snbt.config.ConfigUtil;
import dev.ftb.mods.ftbteams.FTBTeamsAPI;
import dev.ftb.mods.ftbteams.data.Team;
import dev.ftb.mods.ftbteams.event.PlayerJoinedPartyTeamEvent;
Expand Down Expand Up @@ -147,7 +148,8 @@ public FTBChunks() {
}

private void serverBeforeStart(MinecraftServer server) {
FTBChunksWorldConfig.CONFIG.load(server.getWorldPath(FTBChunksWorldConfig.CONFIG_FILE_PATH));
var configPath = server.getWorldPath(ConfigUtil.SERVER_CONFIG_DIR);
ConfigUtil.loadDefaulted(FTBChunksWorldConfig.CONFIG, configPath, FTBChunks.MOD_ID);

FTBChunksWorldConfig.CLAIM_DIMENSION_BLACKLIST_SET.clear();

Expand Down Expand Up @@ -403,6 +405,7 @@ private void teamConfig(TeamCollectPropertiesEvent event) {
event.add(FTBChunksTeamData.ALLOW_FAKE_PLAYERS);
event.add(FTBChunksTeamData.BLOCK_EDIT_MODE);
event.add(FTBChunksTeamData.BLOCK_INTERACT_MODE);
event.add(FTBChunksTeamData.ALLOW_EXPLOSIONS);
// event.add(FTBChunksTeamData.MINIMAP_MODE);
// event.add(FTBChunksTeamData.LOCATION_MODE);
}
Expand Down Expand Up @@ -459,4 +462,4 @@ private void teamOwnershipTransferred(PlayerTransferredTeamOwnershipEvent event)
FTBChunksTeamData data = FTBChunksAPI.getManager().getData(event.getTeam());
data.updateLimits(event.getTo());
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import net.minecraft.resources.ResourceKey;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.storage.LevelResource;

import java.util.Collections;
import java.util.HashSet;
Expand All @@ -23,7 +22,6 @@
* @author LatvianModder
*/
public interface FTBChunksWorldConfig {
LevelResource CONFIG_FILE_PATH = new LevelResource("serverconfig/ftbchunks.snbt");
SNBTConfig CONFIG = SNBTConfig.create(FTBChunks.MOD_ID + "-world");

EnumValue<ProtectionOverride> FAKE_PLAYERS = CONFIG.getEnum("fake_players", NameMap.of(ProtectionOverride.CHECK, ProtectionOverride.values()).create()).comment("Override to disable/enable fake players like miners and auto-clickers globally. Default will check this setting for each team");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -578,10 +578,24 @@ public void renderHud(PoseStack matrixStack, float tickDelta) {
int s = (int) (64D * scale);
double s2d = s / 2D;
float s2f = s / 2F;
int x = FTBChunksClientConfig.MINIMAP_POSITION.get().getX(ww, s);
int y = FTBChunksClientConfig.MINIMAP_POSITION.get().getY(wh, s);

var minimapPosition = FTBChunksClientConfig.MINIMAP_POSITION.get();

int x = minimapPosition.getX(ww, s);
int y = minimapPosition.getY(wh, s);
int z = 0;

int offsetX = FTBChunksClientConfig.MINIMAP_OFFSET_X.get();
int offsetY = FTBChunksClientConfig.MINIMAP_OFFSET_Y.get();

var offsetConditional = FTBChunksClientConfig.MINIMAP_POSITION_OFFSET_CONDITION.get();

// Apply the offset adjusting for the maps position to ensure all positive numbers offset into the screen
if (offsetConditional.isNone() || offsetConditional.getPosition() == minimapPosition) {
x += minimapPosition.posX == 0 ? offsetX : -offsetX;
y -= minimapPosition.posY > 1 ? offsetY : -offsetY;
}

float border = 0F;
int alpha = FTBChunksClientConfig.MINIMAP_VISIBILITY.get();

Expand All @@ -594,6 +608,9 @@ public void renderHud(PoseStack matrixStack, float tickDelta) {
RenderSystem.enableTexture();
RenderSystem.enableDepthTest();

// matrixStack.pushPose();
// matrixStack.translate(-50, 50, 0);

matrixStack.pushPose();
matrixStack.translate(x + s2d, y + s2d, 490 + z);

Expand Down Expand Up @@ -833,6 +850,8 @@ public void renderHud(PoseStack matrixStack, float tickDelta) {

inWorldMapIcons.clear();
}

// matrixStack.popPose();
}

public void renderWorldLast(PoseStack poseStack, Matrix4f projectionMatrix, Camera camera, float tickDelta) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.screens.Screen;

import static dev.ftb.mods.ftblibrary.snbt.config.ConfigUtil.LOCAL_DIR;
import static dev.ftb.mods.ftblibrary.snbt.config.ConfigUtil.loadDefaulted;

/**
* @author LatvianModder
*/
Expand All @@ -41,6 +44,7 @@ public interface FTBChunksClientConfig {
BooleanValue MINIMAP_ENABLED = MINIMAP.getBoolean("enabled", !hasOtherMinimapMod()).comment("Enable minimap");
EnumValue<MinimapPosition> MINIMAP_POSITION = MINIMAP.getEnum("position", MinimapPosition.NAME_MAP).comment("Enables minimap to show up in corner");
DoubleValue MINIMAP_SCALE = MINIMAP.getDouble("scale", 1D, 0.25D, 4D).comment("Scale of minimap");
DoubleValue MINIMAP_ZOOM = MINIMAP.getDouble("zoom", 1D, 1D, 4D).comment("Zoom distance of the minimap");
BooleanValue MINIMAP_LOCKED_NORTH = MINIMAP.getBoolean("locked_north", true).comment("Minimap will not rotate");
BooleanValue MINIMAP_WAYPOINTS = MINIMAP.getBoolean("waypoints", true).comment("Show waypoints on minimap");
BooleanValue MINIMAP_PLAYER_HEADS = MINIMAP.getBoolean("player_heads", true).comment("Show player heads on minimap");
Expand All @@ -53,7 +57,9 @@ public interface FTBChunksClientConfig {
BooleanValue MINIMAP_COMPASS = MINIMAP.getBoolean("compass", true).comment("Adds NWSE compass inside minimap");
IntValue MINIMAP_VISIBILITY = MINIMAP.getInt("visibility", 255, 0, 255).comment("Minimap visibility");
BooleanValue MINIMAP_ZONE = MINIMAP.getBoolean("zone", true).comment("Show zone (claimed chunk or wilderness) under minimap");
DoubleValue MINIMAP_ZOOM = MINIMAP.getDouble("zoom", 1D, 1D, 4D).comment("Zoom distance of the minimap");
IntValue MINIMAP_OFFSET_X = MINIMAP.getInt("position_offset_x", 0).comment("Changes the maps X offset from it's origin point. When on the Left, the map will be pushed out from the left, then from the right when on the right.");
IntValue MINIMAP_OFFSET_Y = MINIMAP.getInt("position_offset_y", 0).comment("Changes the maps X offset from it's origin point. When on the Left, the map will be pushed out from the left, then from the right when on the right.");
EnumValue<MinimapPosition.MinimapOffsetConditional> MINIMAP_POSITION_OFFSET_CONDITION = MINIMAP.getEnum("position_offset_condition", MinimapPosition.MinimapOffsetConditional.NAME_MAP).comment("Applied a conditional check to the offset. When set to anything other that None, the offset will apply only to the selected minimap position.", "When set to none and the maps offset is greater than 0, the offset will apply to all directions");

BooleanValue DEBUG_INFO = CONFIG.getBoolean("debug_info", false).comment("Enables debug info");
IntValue TASK_QUEUE_TICKS = CONFIG.getInt("task_queue_ticks", 4, 1, 300).excluded().comment("Advanced option. How often queued tasks will run");
Expand All @@ -69,7 +75,7 @@ static boolean hasOtherMinimapMod() {
}

static void init() {
CONFIG.load(Platform.getGameFolder().resolve("local/ftbchunks/client-config.snbt"));
loadDefaulted(CONFIG, LOCAL_DIR.resolve("ftbchunks"), FTBChunks.MOD_ID, "client-config.snbt");
}

static void openSettings(Screen screen) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import dev.ftb.mods.ftblibrary.config.NameMap;

import javax.annotation.Nullable;

/**
* @author LatvianModder
*/
Expand Down Expand Up @@ -40,4 +42,36 @@ public int getY(int h, int s) {

return h - s - 20;
}
}

/**
* Used for applying a conditional check for the minimap offset. When set to none
* the offset will apply in all positions. When set, it will only apply to that position.
*/
public enum MinimapOffsetConditional {
BOTTOM_LEFT(MinimapPosition.BOTTOM_LEFT),
LEFT(MinimapPosition.LEFT),
TOP_LEFT(MinimapPosition.TOP_LEFT),
TOP_RIGHT(MinimapPosition.TOP_RIGHT),
RIGHT(MinimapPosition.RIGHT),
BOTTOM_RIGHT(MinimapPosition.BOTTOM_RIGHT),
NONE(null);

public static final NameMap<MinimapOffsetConditional> NAME_MAP = NameMap.of(NONE, values()).baseNameKey("ftbchunks.minimap.position").create();

@Nullable
private MinimapPosition position;

MinimapOffsetConditional(@Nullable MinimapPosition position) {
this.position = position;
}

public boolean isNone() {
return this == NONE;
}

@Nullable
public MinimapPosition getPosition() {
return position;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,10 @@
import dev.ftb.mods.ftblibrary.math.ChunkDimPos;
import net.minecraft.Util;
import net.minecraft.commands.CommandSourceStack;
import net.minecraft.core.BlockPos;
import net.minecraft.server.commands.ForceLoadCommand;
import net.minecraft.server.level.ServerChunkCache;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.level.ChunkPos;
import net.minecraft.world.level.ForcedChunksSavedData;
import net.minecraft.world.level.Level;

/**
* @author LatvianModder
Expand Down Expand Up @@ -98,7 +94,7 @@ public boolean canEntitySpawn(Entity entity) {
}

public boolean allowExplosions() {
return false;
return teamData.allowExplosions();
}

public void sendUpdateToAll() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ public class FTBChunksTeamData {
public static final PrivacyProperty BLOCK_INTERACT_MODE = new PrivacyProperty(new ResourceLocation(FTBChunks.MOD_ID, "block_interact_mode"), PrivacyMode.ALLIES);
public static final PrivacyProperty MINIMAP_MODE = new PrivacyProperty(new ResourceLocation(FTBChunks.MOD_ID, "minimap_mode"), PrivacyMode.ALLIES);
public static final PrivacyProperty LOCATION_MODE = new PrivacyProperty(new ResourceLocation(FTBChunks.MOD_ID, "location_mode"), PrivacyMode.ALLIES);
public static final BooleanProperty ALLOW_EXPLOSIONS = new BooleanProperty(new ResourceLocation(FTBChunks.MOD_ID, "allow_explosions"), false);

public final ClaimedChunkManager manager;
private final Team team;
Expand Down Expand Up @@ -410,4 +411,8 @@ public static ServerPlayer playerOrNull(CommandSourceStack source) {
Entity entity = source.getEntity();
return entity instanceof ServerPlayer player ? player : null;
}

public boolean allowExplosions() {
return team.getProperty(ALLOW_EXPLOSIONS);
}
}
7 changes: 6 additions & 1 deletion common/src/main/resources/assets/ftbchunks/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,16 @@
"ftbchunks.biome_blend.blend_11x11": "Blend 11x11",
"ftbchunks.biome_blend.blend_13x13": "Blend 13x13",
"ftbchunks.biome_blend.blend_15x15": "Blend 15x15 (Slowest)",
"ftbchunks.water_height_factor": "Water weight factor",
"ftbchunks.water_height_factor": "Water height factor",
"ftbchunks.only_surface_entities": "Only surface entities",
"ftbchunks.experimental_performance_improvement": "Experimental performance improvement",
"ftbchunks.minimap": "Minimap",
"ftbchunks.minimap.enabled": "Enabled",
"ftbchunks.minimap.position": "Position",
"ftbchunks.minimap.position_offset_x": "Position Offset X",
"ftbchunks.minimap.position_offset_y": "Position Offset Y",
"ftbchunks.minimap.position_offset_condition": "Position Offset condition",
"ftbchunks.minimap.position.none": "None",
"ftbchunks.minimap.position.bottom_left": "Bottom Left",
"ftbchunks.minimap.position.left": "Left",
"ftbchunks.minimap.position.top_left": "Top Left",
Expand Down Expand Up @@ -69,6 +73,7 @@
"ftbchunks.gui.settings": "Settings",
"ftbchunks.gui.sync": "Share Map with Allies",
"ftbteamsconfig.ftbchunks.allow_fake_players": "Allow Fake Players",
"ftbteamsconfig.ftbchunks.allow_explosions": "Allow Explosions",
"ftbteamsconfig.ftbchunks.block_edit_mode": "Block Edit Mode",
"ftbteamsconfig.ftbchunks.block_interact_mode": "Block Interact Mode",
"ftbteamsconfig.ftbchunks.minimap_mode": "Minimap Mode",
Expand Down
90 changes: 63 additions & 27 deletions common/src/main/resources/assets/ftbchunks/lang/zh_cn.json
Original file line number Diff line number Diff line change
@@ -1,45 +1,81 @@
{
"ftbchunks": "FTB区块声明",
"ftbchunks": "FTB 区块声明",
"ftbchunks.noise": "噪点",
"ftbchunks.shadows": "阴影",
"ftbchunks.chunk_grid": "区块边界",
"ftbchunks.chunk_grid": "区块网格",
"ftbchunks.reduced_color_palette": "简化色板",
"ftbchunks.saturation": "饱和度",
"ftbchunks.debug_info": "调试信息",
"ftbchunks.claimed_chunks_on_map": "在地图上显示声明的区块",
"ftbchunks.own_claimed_chunks_on_map": "在地图上显示你自己声明的区块",
"ftbchunks.in_world_waypoints": "在世界上显示路径点",
"ftbchunks.death_waypoints": "死亡时创建死亡路径点",
"ftbchunks.in_world_waypoints": "显示世界中的路径点",
"ftbchunks.death_waypoints": "在死亡时创建死亡路径点",
"ftbchunks.map_mode": "地图模式",
"ftbchunks.water_height_factor": "水面权重系数",
"ftbchunks.minimap": "小地图位置",
"ftbchunks.minimap_scale": "小地图比例",
"ftbchunks.minimap_locked_north": "小地图锁定北方",
"ftbchunks.minimap_waypoints": "小地图路径点",
"ftbchunks.minimap_entities": "小地图实体",
"ftbchunks.minimap_entity_heads": "小地图实体图标",
"ftbchunks.minimap_player_heads": "小地图玩家图标",
"ftbchunks.minimap_large_entities": "小地图大型实体",
"ftbchunks.minimap_xyz": "小地图XYZ",
"ftbchunks.minimap_biome": "小地图生物群系",
"ftbchunks.minimap_blur": "小地图锐化",
"ftbchunks.minimap_compass": "小地图指南针",
"ftbchunks.minimap_visibility": "小地图透明度",
"ftbchunks.minimap_zone": "小地图zone",
"sidebar_button.ftbchunks.chunks": "FTB区块声明",
"key.ftbchunks.map": "打开FTB区块声明地图",
"ftbchunks.waypoint_fade_distance": "路径点消失距离",
"ftbchunks.biome_blend": "生物群系混合",
"ftbchunks.biome_blend.none": "无 (最快)",
"ftbchunks.biome_blend.blend_3x3": "混合 3x3",
"ftbchunks.biome_blend.blend_5x5": "混合 5x5",
"ftbchunks.biome_blend.blend_7x7": "混合 7x7",
"ftbchunks.biome_blend.blend_9x9": "混合 9x9",
"ftbchunks.biome_blend.blend_11x11": "混合 11x11",
"ftbchunks.biome_blend.blend_13x13": "混合 13x13",
"ftbchunks.biome_blend.blend_15x15": "混合 15x15 (最慢)",
"ftbchunks.water_height_factor": "水深系数",
"ftbchunks.only_surface_entities": "仅地表实体",
"ftbchunks.experimental_performance_improvement": "实验性能改进",
"ftbchunks.minimap": "小地图",
"ftbchunks.minimap.enabled": "开启",
"ftbchunks.minimap.position": "位置",
"ftbchunks.minimap.position_offset_x": "位置偏移 X轴",
"ftbchunks.minimap.position_offset_y": "位置偏移 Y轴",
"ftbchunks.minimap.position_offset_condition": "位置偏移条件",
"ftbchunks.minimap.position.none": "无",
"ftbchunks.minimap.position.bottom_left": "左下角",
"ftbchunks.minimap.position.left": "左侧",
"ftbchunks.minimap.position.top_left": "左上角",
"ftbchunks.minimap.position.top_right": "右上角",
"ftbchunks.minimap.position.right": "右侧",
"ftbchunks.minimap.position.bottom_right": "右下角",
"ftbchunks.minimap.scale": "比例",
"ftbchunks.minimap.locked_north": "锁定北方",
"ftbchunks.minimap.waypoints": "路径点",
"ftbchunks.minimap.entities": "实体",
"ftbchunks.minimap.entity_heads": "实体图标",
"ftbchunks.minimap.player_heads": "玩家图标",
"ftbchunks.minimap.large_entities": "大型实体",
"ftbchunks.minimap.zoom": "缩放",
"ftbchunks.minimap.xyz": "XYZ",
"ftbchunks.minimap.biome": "生物群系",
"ftbchunks.minimap.blur_mode": "模糊模式",
"ftbchunks.minimap.blur_mode.auto": "自动",
"ftbchunks.minimap.blur_mode.on": "开",
"ftbchunks.minimap.blur_mode.off": "关",
"ftbchunks.minimap.compass": "方位",
"ftbchunks.minimap.visibility": "能见度",
"ftbchunks.minimap.zone": "Zone",
"sidebar_button.ftbchunks.chunks": "FTB 区块声明",
"key.ftbchunks.map": "打开 FTB 区块声明 地图",
"key.ftbchunks.minimap.zoomIn": "FTB 区块声明 小地图放大",
"key.ftbchunks.minimap.zoomOut": "FTB 区块声明 小地图缩小",
"wilderness": "野外",
"ftbchunks.no_server_mod": "服务器需要此Mod!",
"ftbchunks.already_claimed": "此区块已被%s认领",
"ftbchunks.gui.claimed": "已声明区块",
"ftbchunks.no_server_mod": "FTB 区块声明 MOD 需要在服务器安装!",
"ftbchunks.already_claimed": "区块已声明 by %s",
"ftbchunks.gui.claimed": "声明",
"ftbchunks.gui.force_loaded": "强制加载",
"ftbchunks.gui.allies": "盟友",
"ftbchunks.gui.ally_whitelist": "盟友白名单",
"ftbchunks.gui.ally_blacklist": "盟友黑名单",
"ftbchunks.gui.large_map": "大地图",
"ftbchunks.gui.claimed_chunks": "声明区块",
"ftbchunks.gui.claimed_chunks": "声明的区块",
"ftbchunks.gui.waypoints": "路径点",
"ftbchunks.gui.add_waypoint": "添加路径点",
"ftbchunks.gui.settings": "设置",
"ftbchunks.gui.sync": "与盟友共享地图"
}
"ftbchunks.gui.sync": "与盟友共享地图",
"ftbteamsconfig.ftbchunks.allow_fake_players": "允许玩家假人",
"ftbteamsconfig.ftbchunks.allow_explosions": "允许爆炸",
"ftbteamsconfig.ftbchunks.block_edit_mode": "方块编辑模式",
"ftbteamsconfig.ftbchunks.block_interact_mode": "方块交互模式",
"ftbteamsconfig.ftbchunks.minimap_mode": "小地图模式",
"ftbteamsconfig.ftbchunks.location_mode": "位置模式"
}