Skip to content

Commit

Permalink
修改翻譯
Browse files Browse the repository at this point in the history
  • Loading branch information
RICE0707 authored Aug 9, 2024
1 parent de4e6c8 commit 1671a0e
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,5 @@ jobs:
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: automated_crafting
name: AutomatedCrafting
path: ${{ github.workspace }}/build/libs
2 changes: 1 addition & 1 deletion src/main/java/com/aeltumn/autocraft/CreationListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ public void run() {
//The block is named autocrafter is it has an item frame AND there's an item in the item frame. If the item frame is empty the name should be reset.
//Rename it to autocrafter to make this clear to the player.
BlockState state = bl.getState();
((Nameable) state).setCustomName("Autocrafter");
((Nameable) state).setCustomName("自動合成器");
state.update();
}
}
Expand Down
12 changes: 8 additions & 4 deletions src/main/java/com/aeltumn/autocraft/RecipeLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,10 @@ public Set<CraftingRecipe> getRecipesFor(final ItemStack item) {
*/
protected void reload(final CommandSender listener) {
if (listener != null)
listener.sendMessage("(Re)loading recipes...");
instance.getLogger().info("(Re)loading recipes...");
// listener.sendMessage("(Re)loading recipes...");
//instance.getLogger().info("(Re)loading recipes...");
listener.sendMessage("§7|§6系統§7|§f飯娘:§7正在重新載入合成配方 ...");
instance.getLogger().info("§7|§6系統§7|§f飯娘:§7正在重新載入合成配方 ...");

long t = System.currentTimeMillis();
recipes.clear();
Expand All @@ -95,8 +97,10 @@ protected void reload(final CommandSender listener) {
long j = recipes.size();
if (j > 0) {
if (listener != null)
listener.sendMessage("(Re)loaded " + j + " recipes, took " + (System.currentTimeMillis() - t) + " ms...");
instance.getLogger().info("(Re)loaded " + j + " recipes, took " + (System.currentTimeMillis() - t) + " ms...");
// listener.sendMessage("(Re)loaded " + j + " recipes, took " + (System.currentTimeMillis() - t) + " ms...");
//instance.getLogger().info("(Re)loaded " + j + " recipes, took " + (System.currentTimeMillis() - t) + " ms...");
listener.sendMessage("§7|§6系統§7|§f飯娘:§7成功載入 " + j + " 個合成配方,耗時 " + (System.currentTimeMillis() - t) + " ms");
instance.getLogger().info("§7|§6系統§7|§f飯娘:§7成功載入 " + j + " 個合成配方,耗時 " + (System.currentTimeMillis() - t) + " ms");
}
}

Expand Down
15 changes: 10 additions & 5 deletions src/main/java/com/aeltumn/autocraft/impl/CrafterRegistryImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -84,25 +84,30 @@ public boolean checkBlock(final Location location, final Player player) {
if (m == null) return false;
if (container.isLocked() || block.getBlockPower() > 0) {
if (container.isLocked())
player.spigot().sendMessage(ChatMessageType.ACTION_BAR, getText("Autocrafter is locked"));
//player.spigot().sendMessage(ChatMessageType.ACTION_BAR, getText("Autocrafter is locked"));
player.spigot().sendMessage(ChatMessageType.ACTION_BAR, getText("§7|§6系統§7|§f飯娘:§c此自動合成器已被鎖定。"));
else
player.spigot().sendMessage(ChatMessageType.ACTION_BAR, getText("Autocrafter has redstone signal blocking it"));
//player.spigot().sendMessage(ChatMessageType.ACTION_BAR, getText("Autocrafter has redstone signal blocking it"));
player.spigot().sendMessage(ChatMessageType.ACTION_BAR, getText("§7|§6系統§7|§f飯娘:§c有一個紅石訊號阻止了該操作,請先取消任何紅石訊號。"));
return true;
}

if (!ConfigFile.isMaterialAllowed(m.getItem().getType())) {
player.spigot().sendMessage(ChatMessageType.ACTION_BAR, getText("Crafting this item is disabled"));
//player.spigot().sendMessage(ChatMessageType.ACTION_BAR, getText("Crafting this item is disabled"));
player.spigot().sendMessage(ChatMessageType.ACTION_BAR, getText("§7|§6系統§7|§f飯娘:§c此合成配方已被停用。"));
return true;
}

final Set<CraftingRecipe> recipes = recipeLoader.getRecipesFor(m.getItem());
if (recipes == null || recipes.size() == 0) {
player.spigot().sendMessage(ChatMessageType.ACTION_BAR, getText("Autocrafter can't craft this item"));
//player.spigot().sendMessage(ChatMessageType.ACTION_BAR, getText("Autocrafter can't craft this item"));
player.spigot().sendMessage(ChatMessageType.ACTION_BAR, getText("§7|§6系統§7|§f飯娘:§c此物品無法被設定為自動合成器配方。"));
return false;
}

//Inform the player how many recipes are being accepted right now
player.spigot().sendMessage(ChatMessageType.ACTION_BAR, getText("Autocrafter is accepting " + recipes.size() + " recipe(s)"));
//player.spigot().sendMessage(ChatMessageType.ACTION_BAR, getText("Autocrafter is accepting " + recipes.size() + " recipe(s)"));
player.spigot().sendMessage(ChatMessageType.ACTION_BAR, getText("§7|§6系統§7|§f飯娘:§7已成功設定自動合成器配方。"));
return true;
}

Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/config.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# Allow alternate blocks to be used as autocrafters
alternate-blocks:
# If true, dispensers can be turned into autocrafters
allowDispensers: false
allowDispensers: true
# If true, chests can be turned into autocrafters. Incompatible with `craft-on-redstone-pulse`!
allowChests: false

# The amount of ticks between activations of all autocrafters (every tick is 1/20th of a second)
ticks-per-craft: 27

# Enables autocrafters activating whenever they are activated by redstone
craft-on-redstone-pulse: false
craft-on-redstone-pulse: true

# A list of all materials that can not be crafted by autocrafters
blocked-materials: []

0 comments on commit 1671a0e

Please sign in to comment.