Skip to content
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

1 #106

Closed
wants to merge 10 commits into from
Closed

1 #106

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Build Pull Request

on:
push:

branches: [ master ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: submodules-init
uses: snickerbockers/submodules-init@v4
- name: Build with Maven
run: mvn -B package -T 2C
- name: Archive artifacts (SensibleToolbox)
uses: actions/upload-artifact@v2
if: success()
with:
name: SensibleToolbox-CN
path: target/SensibleToolbox vCN.jar
18 changes: 0 additions & 18 deletions .github/workflows/merge-conflicts.yml

This file was deleted.

2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<groupId>com.github.slimefun</groupId>
<artifactId>SensibleToolbox</artifactId>

<version>UNOFFICIAL</version>
<version>CN</version>
<inceptionYear>2014</inceptionYear>
<packaging>jar</packaging>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,12 @@ public Material getMaterial() {

@Override
public String getItemName() {
return "Auto Builder";
return "建筑魔杖";
}

@Override
public String[] getLore() {
return new String[] { "Can build or clear", "an area. Use Land Markers", "to define the area" };
return new String[] { "可以建造或清理", "右左键分别点击长方形对角线来规划此区域" };
}

@Override
Expand Down Expand Up @@ -181,9 +181,9 @@ public InventoryGUI createGUI() {
}));

ChatColor c = STBUtil.dyeColorToChatColor(status.getColor());
gui.addLabel(ChatColor.WHITE + "Status: " + c + status, STATUS_SLOT, status.makeTexture(), status.getText());
gui.addLabel(ChatColor.WHITE + "类型: " + c + status, STATUS_SLOT, status.makeTexture(), status.getText());

gui.addLabel("Building Inventory", 29, null);
gui.addLabel("方块列表", 29, null);

return gui;
}
Expand All @@ -194,7 +194,7 @@ public AutoBuilderMode getBuildMode() {
}

public void setBuildMode(@Nonnull AutoBuilderMode buildMode) {
Validate.notNull(buildMode, "The Build mode cannot be null");
Validate.notNull(buildMode, "建筑不能为空");
this.buildMode = buildMode;
setStatus(workArea == null ? BuilderStatus.NO_WORKAREA : BuilderStatus.READY);
}
Expand Down Expand Up @@ -244,12 +244,12 @@ public BuilderStatus getStatus() {
}

private void setStatus(@Nonnull BuilderStatus status) {
Validate.notNull(status, "The Status cannot be null");
Validate.notNull(status, "方块不能为空");

if (status != this.status) {
this.status = status;
ChatColor c = STBUtil.dyeColorToChatColor(status.getColor());
getGUI().addLabel(ChatColor.WHITE + "Status: " + c + status, STATUS_SLOT, status.makeTexture(), status.getText());
getGUI().addLabel(ChatColor.WHITE + "类型: " + c + status, STATUS_SLOT, status.makeTexture(), status.getText());
updateAttachedLabelSigns();
}
}
Expand Down Expand Up @@ -457,11 +457,11 @@ private BuilderStatus setupWorkArea() {

private void setupLandMarkerLabel(InventoryGUI gui, Location loc1, Location loc2) {
if (workArea == null) {
gui.addLabel("Land Markers", 11, null, "Place two Land Markers", "in these slots, set", "to two opposite corners", "of the area to work.");
gui.addLabel("标记点一", 11, null, "放置两个标记点", "左键右键分别点击长方形对角线");
} else {
int v = workArea.getVolume();
String s = v == 1 ? "" : "s";
gui.addLabel("Land Markers", 11, null, "Work Area:", MiscUtil.formatLocation(loc1), MiscUtil.formatLocation(loc2), v + " block" + s);
gui.addLabel("标记点二", 11, null, "建造面积:", MiscUtil.formatLocation(loc1), MiscUtil.formatLocation(loc2), v + " block" + s);
}
}

Expand Down Expand Up @@ -508,7 +508,7 @@ public int onShiftClickInsert(HumanEntity player, int slot, ItemStack toInsert)
if (((LandMarker) item).getMarkedLocation() != null) {
insertLandMarker(toInsert);
} else {
STBUtil.complain((Player) player, "Land Marker doesn't have a location set!");
STBUtil.complain((Player) player, "你没有标记标记点!");
}
// we just put a copy of the land marker into the builder
return 0;
Expand Down Expand Up @@ -606,16 +606,16 @@ public int getYDirection() {

private enum BuilderStatus {

READY(DyeColor.LIME, "Ready to Operate!"),
NO_WORKAREA(DyeColor.YELLOW, "No work area has", "been defined yet"),
NO_INVENTORY(DyeColor.RED, "Out of building material!", "Place more blocks in", "the inventory and", "press Start to resume"),
NO_PERMISSION(DyeColor.RED, "Builder doesn't have", "building rights in", "this area"),
TOO_NEAR(DyeColor.RED, "Auto Builder is inside", "the work area!"),
TOO_FAR(DyeColor.RED, "Auto Builder is too far", "away from the work area!", "Place it " + MAX_DISTANCE + " blocks or less from", "the edge of the work area"),
LM_WORLDS_DIFFERENT(DyeColor.RED, "Land Markers are", "from different worlds!"),
RUNNING(DyeColor.LIGHT_BLUE, "Builder is running", "Press Start button to pause"),
PAUSED(DyeColor.ORANGE, "Builder has been paused", "Press Start button to resume"),
FINISHED(DyeColor.WHITE, "Builder has finished!", "Ready for next operation");
READY(DyeColor.LIME, "准备就绪!"),
NO_WORKAREA(DyeColor.YELLOW, "你还没有确定建筑区域"),
NO_INVENTORY(DyeColor.RED, "建筑材料已用完!", "请放入更多的方块", "然后按下开始键"),
NO_PERMISSION(DyeColor.RED, "你没有此区域的建筑权限"),
TOO_NEAR(DyeColor.RED, "建筑魔杖正在工作!"),
TOO_FAR(DyeColor.RED, "建筑魔杖离建筑区域太远了,请走进" + MAX_DISTANCE + "格,到距离建筑区的边缘"),
LM_WORLDS_DIFFERENT(DyeColor.RED, "此标记点来自不同的世界!"),
RUNNING(DyeColor.LIGHT_BLUE, "建筑魔杖正在运行,你可以按下开始按钮暂停"),
PAUSED(DyeColor.ORANGE, "建筑魔杖已暂停,你可以恢复他"),
FINISHED(DyeColor.WHITE, "建筑完成,可以准备下一次建筑");

private final DyeColor color;
private final String[] text;
Expand All @@ -642,7 +642,7 @@ public DyeColor getColor() {

public boolean resetBuildPosition() {
// returning true causes the build position to be reset
// when the Start button is pressed
// when the Start button is pressed.
return this != PAUSED && this != NO_INVENTORY;
}
}
Expand All @@ -651,10 +651,10 @@ private class AutoBuilderGadget extends CyclerGadget<AutoBuilderMode> {

protected AutoBuilderGadget(InventoryGUI gui, int slot) {
super(gui, slot, "Build Mode");
add(AutoBuilderMode.CLEAR, ChatColor.YELLOW, Material.WHITE_STAINED_GLASS, "Clear all blocks", "in the work area");
add(AutoBuilderMode.FILL, ChatColor.YELLOW, Material.BRICK, "Use inventory to replace", "all empty blocks", "in the work area");
add(AutoBuilderMode.WALLS, ChatColor.YELLOW, Material.COBBLESTONE_WALL, "Use inventory to build", "walls around the", "the work area");
add(AutoBuilderMode.FRAME, ChatColor.YELLOW, Material.OAK_FENCE, "Use inventory to build", "a frame around the", "the work area");
add(AutoBuilderMode.CLEAR, ChatColor.YELLOW, Material.WHITE_STAINED_GLASS, "清除区域的所有方块");
add(AutoBuilderMode.FILL, ChatColor.YELLOW, Material.BRICK, "使用清除物来清除区域内所有方块");
add(AutoBuilderMode.WALLS, ChatColor.YELLOW, Material.COBBLESTONE_WALL, "利用库存在建筑区周围筑墙");
add(AutoBuilderMode.FRAME, ChatColor.YELLOW, Material.OAK_FENCE, "利用库存在工作区周围建一个框架");
setInitialValue(((AutoBuilder) gui.getOwningBlock()).getBuildMode());
}

Expand All @@ -675,3 +675,4 @@ public boolean isEnabled() {
}
}
}