From 94c0781340f320211f64e3d2ffa569f01c789b50 Mon Sep 17 00:00:00 2001
From: ClayCoffee <1020757140@qq.com>
Date: Mon, 20 Jul 2020 13:00:27 +0800
Subject: [PATCH] [U] 1.2.1
---
...CS_CoreLib_master_v1_6_1_g9dd4a1c_118.xml} | 8 +-
...t_Slimefun4_master_RC_7_g7d82bfe_1249.xml} | 8 +-
...n__net_md_5_bungeecord_chat_1_16_R0_3.xml} | 8 +-
...igotmc_spigot_api_1_16_1_R0_1_SNAPSHOT.xml | 6 +-
ClayTech.iml | 6 +-
pom.xml | 2 +-
.../club/claycoffee/ClayTech/ClayTech.java | 119 ++--------------
.../claycoffee/ClayTech/ClayTechItems.java | 17 ++-
.../ClayTech/ClayTechMachineRecipes.java | 7 +-
.../claycoffee/ClayTech/ClayTechUpdater.java | 49 +++++--
.../ClayTech/api/ClayTechBranch.java | 2 +-
.../items/MachineMakingBasic.java | 12 ++
.../implementation/items/Machines.java | 129 +++++++++++++++++
.../machines/ClayElectricCopier.java | 132 ++++++++++++++++++
.../machines/CraftingTable.java | 5 +
.../claycoffee/ClayTech/utils/ClayItem.java | 2 +-
src/main/resources/config.yml | 2 +
src/main/resources/en-GB.yml | 16 +++
src/main/resources/en-US.yml | 16 +++
src/main/resources/plugin.yml | 2 +-
src/main/resources/zh-CN.yml | 16 +++
src/main/resources/zh-TW.yml | 16 +++
22 files changed, 435 insertions(+), 145 deletions(-)
rename .idea/libraries/{Maven__com_github_TheBusyBiscuit_CS_CoreLib_master_v1_6_1_g6a39a9e_114.xml => Maven__com_github_TheBusyBiscuit_CS_CoreLib_master_v1_6_1_g9dd4a1c_118.xml} (56%)
rename .idea/libraries/{Maven__com_github_TheBusyBiscuit_Slimefun4_master_RC_7_gc2b0121_1223.xml => Maven__com_github_TheBusyBiscuit_Slimefun4_master_RC_7_g7d82bfe_1249.xml} (57%)
rename .idea/libraries/{Maven__net_md_5_bungeecord_chat_1_16_R0_1.xml => Maven__net_md_5_bungeecord_chat_1_16_R0_3.xml} (60%)
create mode 100644 src/main/java/club/claycoffee/ClayTech/implementation/items/Machines.java
create mode 100644 src/main/java/club/claycoffee/ClayTech/implementation/machines/ClayElectricCopier.java
diff --git a/.idea/libraries/Maven__com_github_TheBusyBiscuit_CS_CoreLib_master_v1_6_1_g6a39a9e_114.xml b/.idea/libraries/Maven__com_github_TheBusyBiscuit_CS_CoreLib_master_v1_6_1_g9dd4a1c_118.xml
similarity index 56%
rename from .idea/libraries/Maven__com_github_TheBusyBiscuit_CS_CoreLib_master_v1_6_1_g6a39a9e_114.xml
rename to .idea/libraries/Maven__com_github_TheBusyBiscuit_CS_CoreLib_master_v1_6_1_g9dd4a1c_118.xml
index ca71609..7963a0d 100644
--- a/.idea/libraries/Maven__com_github_TheBusyBiscuit_CS_CoreLib_master_v1_6_1_g6a39a9e_114.xml
+++ b/.idea/libraries/Maven__com_github_TheBusyBiscuit_CS_CoreLib_master_v1_6_1_g9dd4a1c_118.xml
@@ -1,13 +1,13 @@
-
+
-
+
-
+
-
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__com_github_TheBusyBiscuit_Slimefun4_master_RC_7_gc2b0121_1223.xml b/.idea/libraries/Maven__com_github_TheBusyBiscuit_Slimefun4_master_RC_7_g7d82bfe_1249.xml
similarity index 57%
rename from .idea/libraries/Maven__com_github_TheBusyBiscuit_Slimefun4_master_RC_7_gc2b0121_1223.xml
rename to .idea/libraries/Maven__com_github_TheBusyBiscuit_Slimefun4_master_RC_7_g7d82bfe_1249.xml
index 8029995..0522d28 100644
--- a/.idea/libraries/Maven__com_github_TheBusyBiscuit_Slimefun4_master_RC_7_gc2b0121_1223.xml
+++ b/.idea/libraries/Maven__com_github_TheBusyBiscuit_Slimefun4_master_RC_7_g7d82bfe_1249.xml
@@ -1,13 +1,13 @@
-
+
-
+
-
+
-
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__net_md_5_bungeecord_chat_1_16_R0_1.xml b/.idea/libraries/Maven__net_md_5_bungeecord_chat_1_16_R0_3.xml
similarity index 60%
rename from .idea/libraries/Maven__net_md_5_bungeecord_chat_1_16_R0_1.xml
rename to .idea/libraries/Maven__net_md_5_bungeecord_chat_1_16_R0_3.xml
index c1d2861..2019f9a 100644
--- a/.idea/libraries/Maven__net_md_5_bungeecord_chat_1_16_R0_1.xml
+++ b/.idea/libraries/Maven__net_md_5_bungeecord_chat_1_16_R0_3.xml
@@ -1,13 +1,13 @@
-
+
-
+
-
+
-
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__org_spigotmc_spigot_api_1_16_1_R0_1_SNAPSHOT.xml b/.idea/libraries/Maven__org_spigotmc_spigot_api_1_16_1_R0_1_SNAPSHOT.xml
index f4a4948..c861fce 100644
--- a/.idea/libraries/Maven__org_spigotmc_spigot_api_1_16_1_R0_1_SNAPSHOT.xml
+++ b/.idea/libraries/Maven__org_spigotmc_spigot_api_1_16_1_R0_1_SNAPSHOT.xml
@@ -1,13 +1,13 @@
-
+
-
+
-
+
\ No newline at end of file
diff --git a/ClayTech.iml b/ClayTech.iml
index 4181b65..fdd1392 100644
--- a/ClayTech.iml
+++ b/ClayTech.iml
@@ -16,11 +16,11 @@
-
+
-
+
-
+
diff --git a/pom.xml b/pom.xml
index 931bad0..9ffcea3 100644
--- a/pom.xml
+++ b/pom.xml
@@ -3,7 +3,7 @@
4.0.0
club.claycoffee
ClayTech
- 1.2.0-dev17
+ 1.2.1
diff --git a/src/main/java/club/claycoffee/ClayTech/ClayTech.java b/src/main/java/club/claycoffee/ClayTech/ClayTech.java
index c7975e2..1c64ea7 100644
--- a/src/main/java/club/claycoffee/ClayTech/ClayTech.java
+++ b/src/main/java/club/claycoffee/ClayTech/ClayTech.java
@@ -6,26 +6,20 @@
import club.claycoffee.ClayTech.implementation.Planets.Mars;
import club.claycoffee.ClayTech.implementation.Planets.Moon;
import club.claycoffee.ClayTech.implementation.items.*;
-import club.claycoffee.ClayTech.implementation.machines.*;
import club.claycoffee.ClayTech.implementation.resources.ClayFuel;
import club.claycoffee.ClayTech.listeners.*;
import club.claycoffee.ClayTech.utils.*;
import io.github.thebusybiscuit.slimefun4.api.MinecraftVersion;
import io.github.thebusybiscuit.slimefun4.api.SlimefunAddon;
-import io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems;
import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin;
import me.mrCookieSlime.CSCoreLibPlugin.Configuration.Config;
-import me.mrCookieSlime.Slimefun.Lists.RecipeType;
-import me.mrCookieSlime.Slimefun.api.SlimefunItemStack;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
-import org.bukkit.Material;
import org.bukkit.World;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.entity.Player;
import org.bukkit.generator.ChunkGenerator;
-import org.bukkit.inventory.ItemStack;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.scheduler.BukkitRunnable;
@@ -49,6 +43,8 @@ public class ClayTech extends JavaPlugin implements SlimefunAddon {
private static DataYML planetDataYML;
private static ClayTechUpdater updater;
private static boolean spacetravelneedperm;
+ private static String updateBranch;
+ private static FileConfiguration config;
public static ClayTech getInstance() {
return plugin;
@@ -94,13 +90,17 @@ public static DataYML getPlanetDataYML() {
return planetDataYML;
}
+ public static String getUpdateBranch() {
+ return updateBranch;
+ }
+
@SuppressWarnings({"unused", "static-access"})
@Override
public void onEnable() {
plugin = this;
- // 当前研究ID: 9933
+ // 当前研究ID: 9934
this.saveDefaultConfig();
- FileConfiguration config = this.getConfig();
+ config = this.getConfig();
locale = config.getString("Locale");
if (locale == null)
locale = "en-US";
@@ -261,6 +261,7 @@ public void onEnable() {
@Override
public void run() {
// Updater
+ updateBranch = config.getString("update-branch");
updater = new ClayTechUpdater();
if (!getConfig().getBoolean("disable-auto-updater")) {
updater.tryUpdate();
@@ -367,7 +368,7 @@ private String languageCodeToLanguage(String code) {
}
private void registerSlimefun() {
- registerMachines();
+ new Machines();
new Clay_basic();
new PotionAffect_Weapons();
@@ -389,106 +390,6 @@ private void registerSlimefun() {
new Rockets();
}
- public void registerMachines() {
- ItemStack[] ClayCrafingTable = {SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.ELECTRO_MAGNET,
- SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.BATTERY, new ItemStack(Material.CRAFTING_TABLE),
- SlimefunItems.BATTERY, ClayTechItems.MAGIC_CLAY, SlimefunItems.SMALL_CAPACITOR,
- ClayTechItems.MAGIC_CLAY};
- ItemStack[] ClayStoneCrusher = {SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.ELECTRO_MAGNET,
- SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.BATTERY, SlimefunItems.ADVANCED_CIRCUIT_BOARD,
- SlimefunItems.BATTERY, ClayTechItems.MAGIC_CLAY, SlimefunItems.SMALL_CAPACITOR,
- new ItemStack(Material.DISPENSER)};
- ItemStack[] ClayFoodCauldron = {SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.ELECTRO_MAGNET,
- SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.BATTERY, ClayTechItems.CLAY_CRAFTING_TABLE,
- SlimefunItems.BATTERY, ClayTechItems.MAGIC_CLAY, SlimefunItems.MEDIUM_CAPACITOR,
- ClayTechItems.MAGIC_CLAY};
- ItemStack[] ClayChalkingMachine = {SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.ELECTRO_MAGNET,
- SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.BATTERY, ClayTechItems.CLAY_CRAFTING_TABLE,
- SlimefunItems.BATTERY, ClayTechItems.CLAY_STICK, SlimefunItems.MEDIUM_CAPACITOR,
- ClayTechItems.MAGIC_CLAY};
- ItemStack[] ClayElementExtracter = {ClayTechItems.BLISTERING_CORE, ClayTechItems.BLISTERING_CORE,
- ClayTechItems.BLISTERING_CORE, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.ADVANCED_CIRCUIT_BOARD,
- SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.WITHER_PROOF_OBSIDIAN, SlimefunItems.PROGRAMMABLE_ANDROID,
- SlimefunItems.WITHER_PROOF_OBSIDIAN};
- ItemStack[] ClayExperimentTableBasic = {ClayTechItems.CLAY_ALLOY_INGOT, SlimefunItems.ELECTRIC_MOTOR,
- ClayTechItems.CLAY_ALLOY_INGOT, SlimefunItems.ADVANCED_CIRCUIT_BOARD, ClayTechItems.CLAY_FOOD_CAULDRON,
- ClayTechItems.BLISTERING_CORE, ClayTechItems.CLAY_ALLOY_INGOT, ClayTechItems.ELEMENT_UNIT,
- ClayTechItems.CLAY_ALLOY_INGOT};
- ItemStack[] ClayRocketAssemblingMachine = {SlimefunItems.ELECTRIC_MOTOR, ClayTechItems.BLISTERING_CORE,
- SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.ADVANCED_CIRCUIT_BOARD, SlimefunItems.WITHER_PROOF_OBSIDIAN,
- SlimefunItems.ADVANCED_CIRCUIT_BOARD, SlimefunItems.MEDIUM_CAPACITOR,
- SlimefunItems.PROGRAMMABLE_ANDROID, SlimefunItems.MEDIUM_CAPACITOR};
- ItemStack[] ClayRocketFuelGenerator = {SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.ELECTRIC_MOTOR,
- SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.ADVANCED_CIRCUIT_BOARD, SlimefunItems.WITHER_PROOF_OBSIDIAN,
- SlimefunItems.ADVANCED_CIRCUIT_BOARD, SlimefunItems.SMALL_CAPACITOR, ClayTechItems.CLAY_FUSION_INGOT,
- SlimefunItems.SMALL_CAPACITOR};
- ItemStack[] ClayRocketFuelInjector = {SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.ELECTRIC_MOTOR,
- SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.ADVANCED_CIRCUIT_BOARD, SlimefunItems.WITHER_PROOF_OBSIDIAN,
- SlimefunItems.ADVANCED_CIRCUIT_BOARD, SlimefunItems.SMALL_CAPACITOR, ClayTechItems.BLISTERING_CORE,
- SlimefunItems.SMALL_CAPACITOR};
- ItemStack[] ClaySpaceSuitOxygenInjector = {SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.ELECTRIC_MOTOR,
- SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.ADVANCED_CIRCUIT_BOARD,
- ClayTechItems.CLAY_ROCKET_FUEL_INJECTOR, SlimefunItems.ADVANCED_CIRCUIT_BOARD,
- SlimefunItems.SMALL_CAPACITOR, ClayTechItems.OXYGEN_TANK, SlimefunItems.SMALL_CAPACITOR};
- ItemStack[] ClayCobbleStoneGenerator = {SlimefunItems.ELECTRIC_MOTOR, new ItemStack(Material.WATER_BUCKET),
- SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.ADVANCED_CIRCUIT_BOARD,
- SlimefunItems.PROGRAMMABLE_ANDROID_MINER, SlimefunItems.ADVANCED_CIRCUIT_BOARD,
- SlimefunItems.SMALL_CAPACITOR, new ItemStack(Material.LAVA_BUCKET), SlimefunItems.SMALL_CAPACITOR};
- ItemStack[] ClayElectricWaterPump = {SlimefunItems.ELECTRIC_MOTOR, new ItemStack(Material.DISPENSER),
- SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.ADVANCED_CIRCUIT_BOARD,
- SlimefunItems.PROGRAMMABLE_ANDROID_MINER, SlimefunItems.ADVANCED_CIRCUIT_BOARD,
- SlimefunItems.SMALL_CAPACITOR, new ItemStack(Material.DISPENSER), SlimefunItems.SMALL_CAPACITOR};
-
- // 机器
- SlimefunItemStack craftingtable = new SlimefunItemStack("CLAY_CRAFTING_TABLE",
- ClayTechItems.CLAY_CRAFTING_TABLE);
- SlimefunItemStack foodcauldron = new SlimefunItemStack("CLAY_FOOD_CAULDRON", ClayTechItems.CLAY_FOOD_CAULDRON);
- SlimefunItemStack chalkingmachine = new SlimefunItemStack("CLAY_FOOD_CHALKING_MACHINE",
- ClayTechItems.CLAY_FOOD_CHALKING_MACHINE);
- SlimefunItemStack elementextracter = new SlimefunItemStack("CLAY_ELEMENT_EXTRACTER",
- ClayTechItems.CLAY_ELEMENT_EXTRACTER);
- SlimefunItemStack electricstonecrusher = new SlimefunItemStack("CLAY_ELECTRIC_STONE_CRUSHER",
- ClayTechItems.CLAY_ELECTRIC_STONE_CRUSHER);
- SlimefunItemStack experimenttablebasic = new SlimefunItemStack("CLAY_EXPERIMENT_TABLE_BASIC",
- ClayTechItems.CLAY_EXPERIMENT_TABLE_NORMAL);
- SlimefunItemStack rocketassemblingmachine = new SlimefunItemStack("CLAY_ROCKET_ASSEMBLING_MACHINE",
- ClayTechItems.CLAY_ROCKET_ASSEMBLING_MACHINE);
- SlimefunItemStack rocketfuelgenerator = new SlimefunItemStack("CLAY_ROCKET_FUEL_GENERATOR",
- ClayTechItems.CLAY_ROCKET_FUEL_GENERATOR);
- SlimefunItemStack rocketfuelinjector = new SlimefunItemStack("CLAY_ROCKET_FUEL_INJECTOR",
- ClayTechItems.CLAY_ROCKET_FUEL_INJECTOR);
- SlimefunItemStack spacesuitoxygeninjector = new SlimefunItemStack("CLAY_SPACESUIT_OXYGEN_INJECTOR",
- ClayTechItems.CLAY_SPACESUIT_OXYGEN_INJECTOR);
- SlimefunItemStack cobblestonegenerator = new SlimefunItemStack("CLAY_COBBLESTONE_GENERATOR",
- ClayTechItems.CLAY_COBBLESTONE_GENERATOR);
- SlimefunItemStack electricwaterpump = new SlimefunItemStack("CLAY_ELECTRIC_WATER_PUMP",
- ClayTechItems.CLAY_ELECTRIC_WATER_PUMP);
-
- new CraftingTable(ClayTechItems.C_MACHINES, craftingtable, "CLAY_CRAFTING_TABLE",
- RecipeType.ENHANCED_CRAFTING_TABLE, ClayCrafingTable).register(this);
- new ElectricStoneCrusher(ClayTechItems.C_MACHINES, electricstonecrusher, "CLAY_ELECTRIC_STONE_CRUSHER",
- RecipeType.ENHANCED_CRAFTING_TABLE, ClayStoneCrusher).register(this);
- new FoodCauldron(ClayTechItems.C_MACHINES, foodcauldron, "CLAY_FOOD_CAULDRON",
- RecipeType.ENHANCED_CRAFTING_TABLE, ClayFoodCauldron).register(this);
- new FoodChalkingMachine(ClayTechItems.C_MACHINES, chalkingmachine, "CLAY_FOOD_CHALKING_MACHINE",
- RecipeType.ENHANCED_CRAFTING_TABLE, ClayChalkingMachine).register(this);
- new ElementExtracter(ClayTechItems.C_MACHINES, elementextracter, "CLAY_ELEMENT_EXTRACTER",
- RecipeType.ENHANCED_CRAFTING_TABLE, ClayElementExtracter).register(this);
- new ExperimentTableNormal(ClayTechItems.C_MACHINES, experimenttablebasic, "CLAY_EXPERIMENT_TABLE_BASIC",
- RecipeType.ENHANCED_CRAFTING_TABLE, ClayExperimentTableBasic).register(this);
- new RocketAssemblingMachine(ClayTechItems.C_MACHINES, rocketassemblingmachine, "CLAY_ROCKET_ASSEMBLING_MACHINE",
- RecipeType.ENHANCED_CRAFTING_TABLE, ClayRocketAssemblingMachine).register(this);
- new RocketFuelGenerator(ClayTechItems.C_MACHINES, rocketfuelgenerator, "CLAY_ROCKET_FUEL_GENERATOR",
- RecipeType.ENHANCED_CRAFTING_TABLE, ClayRocketFuelGenerator).register(this);
- new RocketFuelInjector(ClayTechItems.C_MACHINES, rocketfuelinjector, "CLAY_ROCKET_FUEL_INJECTOR",
- RecipeType.ENHANCED_CRAFTING_TABLE, ClayRocketFuelInjector).register(this);
- new SpaceSuitOxygenInjector(ClayTechItems.C_MACHINES, spacesuitoxygeninjector, "CLAY_SPACESUIT_OXYGEN_INJECTOR",
- RecipeType.ENHANCED_CRAFTING_TABLE, ClaySpaceSuitOxygenInjector).register(this);
- new CobbleStoneGenerator(ClayTechItems.C_MACHINES, cobblestonegenerator, "CLAY_COBBLESTONE_GENERATOR",
- RecipeType.ENHANCED_CRAFTING_TABLE, ClayCobbleStoneGenerator).register(this);
- new ElectricWaterPump(ClayTechItems.C_MACHINES, electricwaterpump, "CLAY_ELECTRIC_WATER_PUMP",
- RecipeType.ENHANCED_CRAFTING_TABLE, ClayElectricWaterPump).register(this);
- }
@Override
public JavaPlugin getJavaPlugin() {
diff --git a/src/main/java/club/claycoffee/ClayTech/ClayTechItems.java b/src/main/java/club/claycoffee/ClayTech/ClayTechItems.java
index 50fc91c..f9aa56d 100644
--- a/src/main/java/club/claycoffee/ClayTech/ClayTechItems.java
+++ b/src/main/java/club/claycoffee/ClayTech/ClayTechItems.java
@@ -37,8 +37,7 @@ public class ClayTechItems {
public static final ItemStack ARTIFICIAL_ENCHANTED_GOLDEN_APPLE = Utils.newItemD(Material.ENCHANTED_GOLDEN_APPLE,
Lang.readItemText("ARTIFICIAL_ENCHANTED_GOLDEN_APPLE"));
public static final ItemStack BLIND_CORE = Utils.newItemD(Material.COAL, Lang.readItemText("BLIND_CORE"));
- public static final ItemStack BLIND_SWORD = Utils.setLore(
- Utils.newItemD(Material.DIAMOND_SWORD, Lang.readItemText("BLIND_SWORD")), Lang.readItemLore("BLIND_SWORD"));
+ public static final ItemStack BLIND_SWORD = SlimefunPlugin.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_16) ? Utils.setLore(Utils.newItemD(Material.NETHERITE_SWORD, Lang.readItemText("BLIND_SWORD")), Lang.readItemLore("BLIND_SWORD")) : Utils.setLore(Utils.newItemD(Material.DIAMOND_SWORD, Lang.readItemText("BLIND_SWORD")), Lang.readItemLore("BLIND_SWORD"));
public static final ItemStack CONFUSION_CORE = Utils.newItemD(Material.WITHER_SKELETON_SKULL,
Lang.readItemText("CONFUSION_CORE"));
public static final ItemStack BLACK_ROCK_BLOCK = Utils.newItemD(Material.OBSIDIAN,
@@ -217,6 +216,11 @@ public class ClayTechItems {
Utils.newItemD(Material.TROPICAL_FISH, Lang.readItemText("TUNA_FISH")), Lang.readItemLore("TUNA_FISH"));
public static final ItemStack GREEN_GRASS = Utils.setLore(
Utils.newItemD(Material.GRASS, Lang.readItemText("GREEN_GRASS")), Lang.readItemLore("GREEN_GRASS"));
+ public static final ItemStack INK_MODULE = Utils.setLore(
+ Utils.newItemD(Material.INK_SAC, Lang.readItemText("INK_MODULE")), Lang.readItemLore("INK_MODULE"));
+ public static final ItemStack COPYING_MODULE = Utils.setLore(
+ Utils.newItemD(Material.DIAMOND, Lang.readItemText("COPYING_MODULE")), Lang.readItemLore("COPYING_MODULE"));
+ // 头颅
public static final ItemStack CLAY_FUEL = Utils.setDisplayName(
SkullItem.fromHash("3ce2dad9baf7eaba7e80d4d0f9fac0aab01a76b12fb71c3d2af2a16fdd4c7383"),
Lang.readItemText("CLAY_FUEL"));
@@ -224,7 +228,6 @@ public class ClayTechItems {
Utils.setDisplayName(SkullItem.fromHash("3ce2dad9baf7eaba7e80d4d0f9fac0aab01a76b12fb71c3d2af2a16fdd4c7383"),
Lang.readItemText("MIXED_ROCKET_FUEL")),
Lang.readItemLore("MIXED_ROCKET_FUEL"));
- // 头颅
public static final ItemStack CLAYCOFFEE_HEAD = Utils.setDisplayName(SkullItem.fromURL(
"http://textures.minecraft.net/texture/58c55ba01ccc7e79b5495e5c4e00080ff6c92a832b2905fed724f2f68a3bb94c"),
Lang.readItemText("AUTHOR_HEAD"));
@@ -387,6 +390,14 @@ public class ClayTechItems {
LoreBuilder.machine(MachineTier.ADVANCED, MachineType.MACHINE)
.replaceAll("&", "§")),
"%POWER%", LoreBuilder.powerBuffer(256).replaceAll("&", "§")));
+ public static final ItemStack CLAY_ELECTRIC_COPIER = Utils
+ .setLore(
+ Utils.newItemD(Material.IRON_BLOCK, Lang.readItemText("CLAY_ELECTRIC_COPIER")), Utils
+ .replaceList(
+ Utils.replaceList(Lang.readItemLore("CLAY_ELECTRIC_COPIER"), "%TIER%",
+ LoreBuilder.machine(MachineTier.ADVANCED, MachineType.MACHINE)
+ .replaceAll("&", "§")),
+ "%POWER%", LoreBuilder.powerBuffer(256).replaceAll("&", "§")));
private static final NamespacedKey N_BASIC = new NamespacedKey(ClayTech.plugin, "claycategory");
// 分类
public static final LockedCategory C_BASICS = new LockedCategory(N_BASIC,
diff --git a/src/main/java/club/claycoffee/ClayTech/ClayTechMachineRecipes.java b/src/main/java/club/claycoffee/ClayTech/ClayTechMachineRecipes.java
index 0249bc1..8006213 100644
--- a/src/main/java/club/claycoffee/ClayTech/ClayTechMachineRecipes.java
+++ b/src/main/java/club/claycoffee/ClayTech/ClayTechMachineRecipes.java
@@ -12,7 +12,9 @@ public class ClayTechMachineRecipes {
new ItemStack(Material.INK_SAC), new ItemStack(Material.INK_SAC), ClayTechItems.MAGIC_CLAY,
new ItemStack(Material.INK_SAC), new ItemStack(Material.INK_SAC), new ItemStack(Material.END_CRYSTAL),
new ItemStack(Material.INK_SAC)};
- public final static ItemStack[] BLIND_SWORD = {ClayTechItems.BLIND_CORE, ClayTechItems.BLIND_CORE,
+ public final static ItemStack[] BLIND_SWORD = SlimefunPlugin.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_16) ? new ItemStack[]{ClayTechItems.BLIND_CORE, ClayTechItems.BLIND_CORE,
+ ClayTechItems.BLIND_CORE, ClayTechItems.BLIND_CORE, new ItemStack(Material.NETHERITE_SWORD),
+ ClayTechItems.BLIND_CORE, ClayTechItems.BLIND_CORE, ClayTechItems.BLIND_CORE, ClayTechItems.BLIND_CORE} : new ItemStack[]{ClayTechItems.BLIND_CORE, ClayTechItems.BLIND_CORE,
ClayTechItems.BLIND_CORE, ClayTechItems.BLIND_CORE, new ItemStack(Material.DIAMOND_SWORD),
ClayTechItems.BLIND_CORE, ClayTechItems.BLIND_CORE, ClayTechItems.BLIND_CORE, ClayTechItems.BLIND_CORE};
public final static ItemStack[] POISON_EYE = {new ItemStack(Material.SPIDER_EYE),
@@ -218,6 +220,9 @@ ClayTechItems.CLAY_FUEL, new ItemStack(Material.COAL_BLOCK), new ItemStack(Mater
SlimefunItems.REINFORCED_ALLOY_INGOT, ClayTechItems.SPACESUIT_OXYGEN_TANK,
ClayTechItems.SPACESUIT_OXYGEN_TANK, ClayTechItems.SPACESUIT_OXYGEN_TANK, ClayTechItems.KREEP_INGOT,
ClayTechItems.SPACESUIT_OXYGEN_TANK, ClayTechItems.KREEP_INGOT};
+ public final static ItemStack[] INK_MODULE = {new ItemStack(Material.INK_SAC), new ItemStack(Material.INK_SAC), new ItemStack(Material.INK_SAC), new ItemStack(Material.INK_SAC), SlimefunItems.ELECTRIC_MOTOR, new ItemStack(Material.INK_SAC), new ItemStack(Material.INK_SAC), new ItemStack(Material.WRITABLE_BOOK), new ItemStack(Material.INK_SAC)};
+ public final static ItemStack[] COPYING_MODULE = {new ItemStack(Material.REDSTONE_BLOCK), new ItemStack(Material.REDSTONE_BLOCK), new ItemStack(Material.REDSTONE_BLOCK), SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.BLISTERING_INGOT_3, SlimefunItems.ELECTRIC_MOTOR, ClayTechItems.BLISTERING_CORE, SlimefunItems.ALUMINUM_BRONZE_INGOT, ClayTechItems.BLISTERING_CORE};
+
public final static ItemStack[] COPPER_DUST_O = {null, null, null, null, ClayTechItems.COPPER_ORE, null, null,
null, null};
;
diff --git a/src/main/java/club/claycoffee/ClayTech/ClayTechUpdater.java b/src/main/java/club/claycoffee/ClayTech/ClayTechUpdater.java
index 01ea26f..9206278 100644
--- a/src/main/java/club/claycoffee/ClayTech/ClayTechUpdater.java
+++ b/src/main/java/club/claycoffee/ClayTech/ClayTechUpdater.java
@@ -16,14 +16,10 @@ public class ClayTechUpdater {
private ClayTechBranch branch;
public ClayTechUpdater() {
- if (plugin.getDescription().getVersion().toUpperCase().contains("DEV")
- || plugin.getDescription().getVersion().toUpperCase().contains("PRE")) {
- branch = ClayTechBranch.DEVELOPMENT;
- Bukkit.getServer().getLogger().info("§e" + Lang.readGeneralText("Info_1"));
- Bukkit.getServer().getLogger().info(Lang.readGeneralText("DEV_VERSION"));
- Bukkit.getServer().getLogger().info("§e" + Lang.readGeneralText("Info_6"));
- } else {
- branch = ClayTechBranch.STABLE;
+ try {
+ branch = ClayTechBranch.valueOf(ClayTech.getUpdateBranch());
+ } catch (Exception e) {
+ Bukkit.getLogger().info("§cInvalid Update Branch.");
}
}
@@ -68,10 +64,12 @@ public void run() {
.getAsString();
return;
}
+ } else {
+ Bukkit.getServer().getLogger().info(Lang.readGeneralText("LatestVersion"));
+ return;
}
}
- Bukkit.getServer().getLogger().info(Lang.readGeneralText("LatestVersion"));
- } else {
+ } else if (branch == ClayTechBranch.DEVELOPMENT) {
if (ja.get(0).getAsJsonObject().get("prerelease").getAsBoolean()) {
if (!ja.get(0).getAsJsonObject().get("tag_name").getAsString()
.equalsIgnoreCase(ClayTechData.currentVersion)) {
@@ -105,6 +103,37 @@ public void run() {
}
} else
return;
+ } else if (branch == ClayTechBranch.ALL) {
+ if (!ja.get(0).getAsJsonObject().get("tag_name").getAsString()
+ .equalsIgnoreCase(ClayTechData.currentVersion)) {
+ if (new File(plugin.getServer().getUpdateFolder().replaceAll("update", "plugins"),
+ ja.get(0).getAsJsonObject().get("assets").getAsJsonArray().get(0)
+ .getAsJsonObject().get("name").getAsString()).exists())
+ return;
+ downloadURL = ja.get(0).getAsJsonObject().get("assets").getAsJsonArray().get(0)
+ .getAsJsonObject().get("browser_download_url").getAsString();
+ // 开始下载
+ if (!FileDownloader.updateFunc(downloadURL,
+ ja.get(0).getAsJsonObject().get("assets").getAsJsonArray().get(0)
+ .getAsJsonObject().get("name").getAsString(),
+ plugin.getServer().getUpdateFolder().replaceAll("update", "plugins"), ja)
+ .equalsIgnoreCase("")) {
+ Bukkit.getServer().getLogger().info("§a" + Lang.readGeneralText("Info_1"));
+ Bukkit.getServer().getLogger()
+ .info(Lang.readGeneralText("update_done")
+ .replaceAll("\\{new_version\\}",
+ ja.get(0).getAsJsonObject().get("tag_name").getAsString())
+ .replaceAll("\\{old_version\\}",
+ ClayTech.getInstance().getPluginVersion()));
+ Bukkit.getServer().getLogger().info("§a" + Lang.readGeneralText("Info_6"));
+ ClayTechData.currentVersion = ja.get(0).getAsJsonObject().get("tag_name")
+ .getAsString();
+ return;
+ }
+ } else {
+ Bukkit.getServer().getLogger().info(Lang.readGeneralText("LatestVersion"));
+ return;
+ }
}
} catch (IOException e) {
diff --git a/src/main/java/club/claycoffee/ClayTech/api/ClayTechBranch.java b/src/main/java/club/claycoffee/ClayTech/api/ClayTechBranch.java
index 6dfc054..21fe2c3 100644
--- a/src/main/java/club/claycoffee/ClayTech/api/ClayTechBranch.java
+++ b/src/main/java/club/claycoffee/ClayTech/api/ClayTechBranch.java
@@ -2,7 +2,7 @@
public enum ClayTechBranch {
- DEVELOPMENT("dev"), STABLE("stable");
+ DEVELOPMENT("dev"), STABLE("stable"), ALL("all");
public final String name;
diff --git a/src/main/java/club/claycoffee/ClayTech/implementation/items/MachineMakingBasic.java b/src/main/java/club/claycoffee/ClayTech/implementation/items/MachineMakingBasic.java
index fcd6fa4..b60d8ba 100644
--- a/src/main/java/club/claycoffee/ClayTech/implementation/items/MachineMakingBasic.java
+++ b/src/main/java/club/claycoffee/ClayTech/implementation/items/MachineMakingBasic.java
@@ -22,6 +22,18 @@ public MachineMakingBasic() {
before_element.addItems(new SlimefunItem[]{SlimefunItem.getByItem(ClayTechItems.BLISTERING_CORE)});
before_element.register();
+
+ Slimefunutils.registerItem(ClayTechItems.C_MATERIALS, "INK_MODULE", ClayTechItems.INK_MODULE,
+ "notresearch", 10, ClayTechRecipeType.CLAY_CRAFTING_TABLE, ClayTechMachineRecipes.INK_MODULE,
+ false);
+ Slimefunutils.registerItem(ClayTechItems.C_MATERIALS, "COPYING_MODULE", ClayTechItems.COPYING_MODULE,
+ "notresearch", 10, ClayTechRecipeType.CLAY_CRAFTING_TABLE, ClayTechMachineRecipes.COPYING_MODULE,
+ false);
+ Research copier = new Research(new NamespacedKey(ClayTech.getInstance(), "CLAYTECH_COPIER"),
+ 9934, Lang.readResearchesText("CLAYTECH_COPIER"), 50);
+
+ copier.addItems(new SlimefunItem[]{SlimefunItem.getByItem(ClayTechItems.COPYING_MODULE), SlimefunItem.getByItem(ClayTechItems.INK_MODULE), SlimefunItem.getByItem(ClayTechItems.CLAY_ELECTRIC_COPIER)});
+ copier.register();
}
}
diff --git a/src/main/java/club/claycoffee/ClayTech/implementation/items/Machines.java b/src/main/java/club/claycoffee/ClayTech/implementation/items/Machines.java
new file mode 100644
index 0000000..3068fb4
--- /dev/null
+++ b/src/main/java/club/claycoffee/ClayTech/implementation/items/Machines.java
@@ -0,0 +1,129 @@
+package club.claycoffee.ClayTech.implementation.items;
+
+import club.claycoffee.ClayTech.ClayTech;
+import club.claycoffee.ClayTech.ClayTechItems;
+import club.claycoffee.ClayTech.implementation.machines.*;
+import io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems;
+import me.mrCookieSlime.Slimefun.Lists.RecipeType;
+import me.mrCookieSlime.Slimefun.api.SlimefunItemStack;
+import org.bukkit.Material;
+import org.bukkit.inventory.ItemStack;
+
+/**
+ * @Project: ClayTech
+ * @Author: ClayCoffee
+ * @Date: 2020/7/20 11:33
+ * @Email: 1020757140@qq.com
+ * AGPL 3.0
+ */
+
+public class Machines {
+ public Machines() {
+ ItemStack[] ClayCrafingTable = {SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.ELECTRO_MAGNET,
+ SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.BATTERY, new ItemStack(Material.CRAFTING_TABLE),
+ SlimefunItems.BATTERY, ClayTechItems.MAGIC_CLAY, SlimefunItems.SMALL_CAPACITOR,
+ ClayTechItems.MAGIC_CLAY};
+ ItemStack[] ClayStoneCrusher = {SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.ELECTRO_MAGNET,
+ SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.BATTERY, SlimefunItems.ADVANCED_CIRCUIT_BOARD,
+ SlimefunItems.BATTERY, ClayTechItems.MAGIC_CLAY, SlimefunItems.SMALL_CAPACITOR,
+ new ItemStack(Material.DISPENSER)};
+ ItemStack[] ClayFoodCauldron = {SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.ELECTRO_MAGNET,
+ SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.BATTERY, ClayTechItems.CLAY_CRAFTING_TABLE,
+ SlimefunItems.BATTERY, ClayTechItems.MAGIC_CLAY, SlimefunItems.MEDIUM_CAPACITOR,
+ ClayTechItems.MAGIC_CLAY};
+ ItemStack[] ClayChalkingMachine = {SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.ELECTRO_MAGNET,
+ SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.BATTERY, ClayTechItems.CLAY_CRAFTING_TABLE,
+ SlimefunItems.BATTERY, ClayTechItems.CLAY_STICK, SlimefunItems.MEDIUM_CAPACITOR,
+ ClayTechItems.MAGIC_CLAY};
+ ItemStack[] ClayElementExtracter = {ClayTechItems.BLISTERING_CORE, ClayTechItems.BLISTERING_CORE,
+ ClayTechItems.BLISTERING_CORE, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.ADVANCED_CIRCUIT_BOARD,
+ SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.WITHER_PROOF_OBSIDIAN, SlimefunItems.PROGRAMMABLE_ANDROID,
+ SlimefunItems.WITHER_PROOF_OBSIDIAN};
+ ItemStack[] ClayExperimentTableBasic = {ClayTechItems.CLAY_ALLOY_INGOT, SlimefunItems.ELECTRIC_MOTOR,
+ ClayTechItems.CLAY_ALLOY_INGOT, SlimefunItems.ADVANCED_CIRCUIT_BOARD, ClayTechItems.CLAY_FOOD_CAULDRON,
+ ClayTechItems.BLISTERING_CORE, ClayTechItems.CLAY_ALLOY_INGOT, ClayTechItems.ELEMENT_UNIT,
+ ClayTechItems.CLAY_ALLOY_INGOT};
+ ItemStack[] ClayRocketAssemblingMachine = {SlimefunItems.ELECTRIC_MOTOR, ClayTechItems.BLISTERING_CORE,
+ SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.ADVANCED_CIRCUIT_BOARD, SlimefunItems.WITHER_PROOF_OBSIDIAN,
+ SlimefunItems.ADVANCED_CIRCUIT_BOARD, SlimefunItems.MEDIUM_CAPACITOR,
+ SlimefunItems.PROGRAMMABLE_ANDROID, SlimefunItems.MEDIUM_CAPACITOR};
+ ItemStack[] ClayRocketFuelGenerator = {SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.ELECTRIC_MOTOR,
+ SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.ADVANCED_CIRCUIT_BOARD, SlimefunItems.WITHER_PROOF_OBSIDIAN,
+ SlimefunItems.ADVANCED_CIRCUIT_BOARD, SlimefunItems.SMALL_CAPACITOR, ClayTechItems.CLAY_FUSION_INGOT,
+ SlimefunItems.SMALL_CAPACITOR};
+ ItemStack[] ClayRocketFuelInjector = {SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.ELECTRIC_MOTOR,
+ SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.ADVANCED_CIRCUIT_BOARD, SlimefunItems.WITHER_PROOF_OBSIDIAN,
+ SlimefunItems.ADVANCED_CIRCUIT_BOARD, SlimefunItems.SMALL_CAPACITOR, ClayTechItems.BLISTERING_CORE,
+ SlimefunItems.SMALL_CAPACITOR};
+ ItemStack[] ClaySpaceSuitOxygenInjector = {SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.ELECTRIC_MOTOR,
+ SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.ADVANCED_CIRCUIT_BOARD,
+ ClayTechItems.CLAY_ROCKET_FUEL_INJECTOR, SlimefunItems.ADVANCED_CIRCUIT_BOARD,
+ SlimefunItems.SMALL_CAPACITOR, ClayTechItems.OXYGEN_TANK, SlimefunItems.SMALL_CAPACITOR};
+ ItemStack[] ClayCobbleStoneGenerator = {SlimefunItems.ELECTRIC_MOTOR, new ItemStack(Material.WATER_BUCKET),
+ SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.ADVANCED_CIRCUIT_BOARD,
+ SlimefunItems.PROGRAMMABLE_ANDROID_MINER, SlimefunItems.ADVANCED_CIRCUIT_BOARD,
+ SlimefunItems.SMALL_CAPACITOR, new ItemStack(Material.LAVA_BUCKET), SlimefunItems.SMALL_CAPACITOR};
+ ItemStack[] ClayElectricWaterPump = {SlimefunItems.ELECTRIC_MOTOR, new ItemStack(Material.DISPENSER),
+ SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.ADVANCED_CIRCUIT_BOARD,
+ SlimefunItems.PROGRAMMABLE_ANDROID_MINER, SlimefunItems.ADVANCED_CIRCUIT_BOARD,
+ SlimefunItems.SMALL_CAPACITOR, new ItemStack(Material.DISPENSER), SlimefunItems.SMALL_CAPACITOR};
+ ItemStack[] ClayElectricCopier = {SlimefunItems.ELECTRIC_MOTOR, ClayTechItems.COPYING_MODULE,
+ SlimefunItems.ELECTRIC_MOTOR, ClayTechItems.INK_MODULE,
+ SlimefunItems.PROGRAMMABLE_ANDROID_MINER, ClayTechItems.INK_MODULE,
+ SlimefunItems.SMALL_CAPACITOR, SlimefunItems.ADVANCED_CIRCUIT_BOARD, SlimefunItems.SMALL_CAPACITOR};
+
+ // 机器
+ SlimefunItemStack craftingtable = new SlimefunItemStack("CLAY_CRAFTING_TABLE",
+ ClayTechItems.CLAY_CRAFTING_TABLE);
+ SlimefunItemStack foodcauldron = new SlimefunItemStack("CLAY_FOOD_CAULDRON", ClayTechItems.CLAY_FOOD_CAULDRON);
+ SlimefunItemStack chalkingmachine = new SlimefunItemStack("CLAY_FOOD_CHALKING_MACHINE",
+ ClayTechItems.CLAY_FOOD_CHALKING_MACHINE);
+ SlimefunItemStack elementextracter = new SlimefunItemStack("CLAY_ELEMENT_EXTRACTER",
+ ClayTechItems.CLAY_ELEMENT_EXTRACTER);
+ SlimefunItemStack electricstonecrusher = new SlimefunItemStack("CLAY_ELECTRIC_STONE_CRUSHER",
+ ClayTechItems.CLAY_ELECTRIC_STONE_CRUSHER);
+ SlimefunItemStack experimenttablebasic = new SlimefunItemStack("CLAY_EXPERIMENT_TABLE_BASIC",
+ ClayTechItems.CLAY_EXPERIMENT_TABLE_NORMAL);
+ SlimefunItemStack rocketassemblingmachine = new SlimefunItemStack("CLAY_ROCKET_ASSEMBLING_MACHINE",
+ ClayTechItems.CLAY_ROCKET_ASSEMBLING_MACHINE);
+ SlimefunItemStack rocketfuelgenerator = new SlimefunItemStack("CLAY_ROCKET_FUEL_GENERATOR",
+ ClayTechItems.CLAY_ROCKET_FUEL_GENERATOR);
+ SlimefunItemStack rocketfuelinjector = new SlimefunItemStack("CLAY_ROCKET_FUEL_INJECTOR",
+ ClayTechItems.CLAY_ROCKET_FUEL_INJECTOR);
+ SlimefunItemStack spacesuitoxygeninjector = new SlimefunItemStack("CLAY_SPACESUIT_OXYGEN_INJECTOR",
+ ClayTechItems.CLAY_SPACESUIT_OXYGEN_INJECTOR);
+ SlimefunItemStack cobblestonegenerator = new SlimefunItemStack("CLAY_COBBLESTONE_GENERATOR",
+ ClayTechItems.CLAY_COBBLESTONE_GENERATOR);
+ SlimefunItemStack electricwaterpump = new SlimefunItemStack("CLAY_ELECTRIC_WATER_PUMP",
+ ClayTechItems.CLAY_ELECTRIC_WATER_PUMP);
+ SlimefunItemStack electriccopier = new SlimefunItemStack("CLAY_ELECTRIC_COPIER",
+ ClayTechItems.CLAY_ELECTRIC_COPIER);
+
+ new CraftingTable(ClayTechItems.C_MACHINES, craftingtable, "CLAY_CRAFTING_TABLE",
+ RecipeType.ENHANCED_CRAFTING_TABLE, ClayCrafingTable).register(ClayTech.getInstance());
+ new ElectricStoneCrusher(ClayTechItems.C_MACHINES, electricstonecrusher, "CLAY_ELECTRIC_STONE_CRUSHER",
+ RecipeType.ENHANCED_CRAFTING_TABLE, ClayStoneCrusher).register(ClayTech.getInstance());
+ new FoodCauldron(ClayTechItems.C_MACHINES, foodcauldron, "CLAY_FOOD_CAULDRON",
+ RecipeType.ENHANCED_CRAFTING_TABLE, ClayFoodCauldron).register(ClayTech.getInstance());
+ new FoodChalkingMachine(ClayTechItems.C_MACHINES, chalkingmachine, "CLAY_FOOD_CHALKING_MACHINE",
+ RecipeType.ENHANCED_CRAFTING_TABLE, ClayChalkingMachine).register(ClayTech.getInstance());
+ new ElementExtracter(ClayTechItems.C_MACHINES, elementextracter, "CLAY_ELEMENT_EXTRACTER",
+ RecipeType.ENHANCED_CRAFTING_TABLE, ClayElementExtracter).register(ClayTech.getInstance());
+ new ExperimentTableNormal(ClayTechItems.C_MACHINES, experimenttablebasic, "CLAY_EXPERIMENT_TABLE_BASIC",
+ RecipeType.ENHANCED_CRAFTING_TABLE, ClayExperimentTableBasic).register(ClayTech.getInstance());
+ new RocketAssemblingMachine(ClayTechItems.C_MACHINES, rocketassemblingmachine, "CLAY_ROCKET_ASSEMBLING_MACHINE",
+ RecipeType.ENHANCED_CRAFTING_TABLE, ClayRocketAssemblingMachine).register(ClayTech.getInstance());
+ new RocketFuelGenerator(ClayTechItems.C_MACHINES, rocketfuelgenerator, "CLAY_ROCKET_FUEL_GENERATOR",
+ RecipeType.ENHANCED_CRAFTING_TABLE, ClayRocketFuelGenerator).register(ClayTech.getInstance());
+ new RocketFuelInjector(ClayTechItems.C_MACHINES, rocketfuelinjector, "CLAY_ROCKET_FUEL_INJECTOR",
+ RecipeType.ENHANCED_CRAFTING_TABLE, ClayRocketFuelInjector).register(ClayTech.getInstance());
+ new SpaceSuitOxygenInjector(ClayTechItems.C_MACHINES, spacesuitoxygeninjector, "CLAY_SPACESUIT_OXYGEN_INJECTOR",
+ RecipeType.ENHANCED_CRAFTING_TABLE, ClaySpaceSuitOxygenInjector).register(ClayTech.getInstance());
+ new CobbleStoneGenerator(ClayTechItems.C_MACHINES, cobblestonegenerator, "CLAY_COBBLESTONE_GENERATOR",
+ RecipeType.ENHANCED_CRAFTING_TABLE, ClayCobbleStoneGenerator).register(ClayTech.getInstance());
+ new ElectricWaterPump(ClayTechItems.C_MACHINES, electricwaterpump, "CLAY_ELECTRIC_WATER_PUMP",
+ RecipeType.ENHANCED_CRAFTING_TABLE, ClayElectricWaterPump).register(ClayTech.getInstance());
+ new ClayElectricCopier(ClayTechItems.C_MACHINES, electriccopier, "CLAY_ELECTRIC_COPIER",
+ RecipeType.ENHANCED_CRAFTING_TABLE, ClayElectricCopier).register(ClayTech.getInstance());
+ }
+}
diff --git a/src/main/java/club/claycoffee/ClayTech/implementation/machines/ClayElectricCopier.java b/src/main/java/club/claycoffee/ClayTech/implementation/machines/ClayElectricCopier.java
new file mode 100644
index 0000000..1ccd2a0
--- /dev/null
+++ b/src/main/java/club/claycoffee/ClayTech/implementation/machines/ClayElectricCopier.java
@@ -0,0 +1,132 @@
+package club.claycoffee.ClayTech.implementation.machines;
+
+import club.claycoffee.ClayTech.implementation.abstractMachines.ANewContainer;
+import club.claycoffee.ClayTech.utils.Lang;
+import io.github.thebusybiscuit.slimefun4.utils.ChestMenuUtils;
+import me.mrCookieSlime.Slimefun.Lists.RecipeType;
+import me.mrCookieSlime.Slimefun.Objects.Category;
+import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.abstractItems.MachineRecipe;
+import me.mrCookieSlime.Slimefun.api.BlockStorage;
+import me.mrCookieSlime.Slimefun.api.SlimefunItemStack;
+import me.mrCookieSlime.Slimefun.api.energy.ChargableBlock;
+import me.mrCookieSlime.Slimefun.api.inventory.BlockMenu;
+import me.mrCookieSlime.Slimefun.cscorelib2.item.CustomItem;
+import org.bukkit.Material;
+import org.bukkit.block.Block;
+import org.bukkit.inventory.ItemStack;
+import org.bukkit.inventory.meta.BookMeta;
+
+/**
+ * @Project: ClayTech
+ * @Author: ClayCoffee
+ * @Date: 2020/7/20 11:35
+ * @Email: 1020757140@qq.com
+ * AGPL 3.0
+ */
+
+public class ClayElectricCopier extends ANewContainer {
+ private int mode;
+ private ItemStack source;
+ private ItemStack copy;
+
+ public ClayElectricCopier(Category category, SlimefunItemStack item, String id, RecipeType recipeType,
+ ItemStack[] recipe) {
+ super(category, item, id, recipeType, recipe);
+ }
+
+ @Override
+ public String getInventoryTitle() {
+ return Lang.readMachinesText("CLAY_ELECTRIC_COPIER");
+ }
+
+ @Override
+ public ItemStack getProgressBar() {
+ return new ItemStack(Material.BOOK);
+ }
+
+ @Override
+ public int getEnergyConsumption() {
+ return 40;
+ }
+
+ @Override
+ public int getSpeed() {
+ return 1;
+ }
+
+ @Override
+ public String getMachineIdentifier() {
+ return "CLAY_ELECTRIC_COPIER";
+ }
+
+ @Override
+ public int getCapacity() {
+ return 256;
+ }
+
+ protected void tick(Block b) {
+ BlockMenu inv = BlockStorage.getInventory(b);
+ if (progress.keySet().size() > 0) {
+ int timeleft = progress.get(b);
+
+ if (timeleft > 0) {
+ ChestMenuUtils.updateProgressbar(inv, 22, timeleft, processing.get(b).getTicks(), getProgressBar());
+
+ if (ChargableBlock.isChargable(b)) {
+ if (ChargableBlock.getCharge(b) < getEnergyConsumption())
+ return;
+ ChargableBlock.addCharge(b, -getEnergyConsumption());
+ progress.put(b, timeleft - 1);
+ } else
+ progress.put(b, timeleft - 1);
+ } else {
+ if (inv.getItemInSlot(getOutputSlots()[0]) != null || inv.getItemInSlot(getOutputSlots()[1]) != null)
+ return;
+
+ inv.replaceExistingItem(22, new CustomItem(Material.BLACK_STAINED_GLASS_PANE, " "));
+
+ if (mode == 1) {
+ inv.pushItem(source, getOutputSlots());
+ inv.pushItem(source, getOutputSlots());
+ } else if (mode == 2) {
+ BookMeta sourceMeta = (BookMeta) source.getItemMeta();
+ BookMeta copyMeta = (BookMeta) copy.getItemMeta();
+ copyMeta.setPages(sourceMeta.getPages());
+ copyMeta.setGeneration(BookMeta.Generation.COPY_OF_ORIGINAL);
+ copy.setItemMeta(copyMeta);
+ inv.pushItem(source, getOutputSlots());
+ inv.pushItem(copy, getOutputSlots());
+ }
+ progress.remove(b);
+ processing.remove(b);
+ }
+ } else {
+ if (inv.getItemInSlot(19) == null || inv.getItemInSlot(20) == null) return;
+ if (inv.getItemInSlot(19).getType() == Material.WRITABLE_BOOK && inv.getItemInSlot(20).getType() == Material.WRITABLE_BOOK) {
+ // Mode I
+ mode = 1;
+ source = inv.getItemInSlot(19).clone();
+ copy = inv.getItemInSlot(20).clone();
+ } else if (inv.getItemInSlot(19).getType() == Material.WRITTEN_BOOK && inv.getItemInSlot(20).getType() == Material.WRITABLE_BOOK) {
+ // Mode II
+ mode = 2;
+ source = inv.getItemInSlot(19).clone();
+ copy = inv.getItemInSlot(20).clone();
+ } else if (inv.getItemInSlot(19).getType() == Material.WRITABLE_BOOK && inv.getItemInSlot(20).getType() == Material.WRITTEN_BOOK) {
+ // Mode II
+ mode = 2;
+ source = inv.getItemInSlot(20).clone();
+ copy = inv.getItemInSlot(19).clone();
+ } else mode = 0;
+ if (mode > 0) {
+ BookMeta sourceMeta = (BookMeta) source.getItemMeta();
+ MachineRecipe r = new MachineRecipe(sourceMeta.getPages().size() * 4, null, null);
+ progress.put(b, r.getTicks());
+ processing.put(b, r);
+ inv.consumeItem(19);
+ inv.consumeItem(20);
+ return;
+ }
+ }
+ }
+}
diff --git a/src/main/java/club/claycoffee/ClayTech/implementation/machines/CraftingTable.java b/src/main/java/club/claycoffee/ClayTech/implementation/machines/CraftingTable.java
index d303382..a4fa6ef 100644
--- a/src/main/java/club/claycoffee/ClayTech/implementation/machines/CraftingTable.java
+++ b/src/main/java/club/claycoffee/ClayTech/implementation/machines/CraftingTable.java
@@ -157,6 +157,11 @@ public void registerDefaultRecipes() {
this.registerRecipe(2, ClayTechMachineRecipes.COPPER_DUST_O, new ItemStack[]{SlimefunItems.COPPER_DUST});
this.registerRecipe(2, ClayTechMachineRecipes.CLAY_FUSION_INGOT_O,
new ItemStack[]{ClayTechItems.CLAY_FUSION_INGOT});
+
+ this.registerRecipe(30, ClayTechMachineRecipes.INK_MODULE,
+ new ItemStack[]{ClayTechItems.INK_MODULE});
+ this.registerRecipe(60, ClayTechMachineRecipes.COPYING_MODULE,
+ new ItemStack[]{ClayTechItems.COPYING_MODULE});
}
@Override
diff --git a/src/main/java/club/claycoffee/ClayTech/utils/ClayItem.java b/src/main/java/club/claycoffee/ClayTech/utils/ClayItem.java
index 21e2cd6..dd2a2d9 100644
--- a/src/main/java/club/claycoffee/ClayTech/utils/ClayItem.java
+++ b/src/main/java/club/claycoffee/ClayTech/utils/ClayItem.java
@@ -40,7 +40,7 @@ public static boolean setDurability(ItemStack item, int durability) {
int i = 0;
for (String each : Lore) {
if (each.startsWith(Lang.readGeneralText("Durability"))) {
- each = each.replace("" + getDurability(item), "" + durability);
+ each = Lang.readGeneralText("Durability") + ": §6" + durability;
Lore.set(i, each);
break;
}
diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml
index 8471514..353e848 100644
--- a/src/main/resources/config.yml
+++ b/src/main/resources/config.yml
@@ -2,4 +2,6 @@ Locale: "en-US"
highrailspeed: "3"
overworld: "world"
disable-auto-updater: false
+update-branch: ALL
+#Valid: ALL, STABLE, DEVELOPMENT
space-travel-need-perm: false
\ No newline at end of file
diff --git a/src/main/resources/en-GB.yml b/src/main/resources/en-GB.yml
index 20be0b6..c89a6f0 100644
--- a/src/main/resources/en-GB.yml
+++ b/src/main/resources/en-GB.yml
@@ -343,6 +343,20 @@ Items:
- "%TIER%"
- "%POWER%"
- "&8\u21E8 &e\u26A1 &716 J/s"
+ CLAY_ELECTRIC_COPIER: "&eClay Electric Copier"
+ CLAY_ELECTRIC_COPIER_LORE:
+ - ""
+ - "&fCan copy books"
+ - ""
+ - "%TIER%"
+ - "%POWER%"
+ - "&8\u21E8 &e\u26A1 &740 J/s"
+ COPYING_MODULE: "&bCopying Module"
+ COPYING_MODULE_LORE:
+ - "&6The module to copy books."
+ INK_MODULE: "&bInk Module"
+ INK_MODULE_LORE:
+ - "&6There is a lot of ink in it."
HIGHSPEED_RAILWAY: "&bHigh Speed Rail"
HIGHSPEED_RAILWAY_LORE:
- "&6The minecart which is running on this kind of rail"
@@ -576,6 +590,7 @@ Researches:
CLAYTECH_FISH_I: "Fish"
CLAYTECH_COBBLESTONE_GENERATOR: "Cobblestone Generator"
CLAYTECH_ELECTRIC_WATER_PUMP: "Electric Water Pump"
+ CLAYTECH_COPIER: "Electric Copier"
MachineRecipes:
CLAY_FUSION_MACHINE: "&a&oCraft this in Clay Fusing Machine"
CLAY_ELETRIC_CAULDRON: "&a&oCraft this in Electric Cauldron"
@@ -604,6 +619,7 @@ Machines:
CLAY_SPACESUIT_OXYGEN_INJECTOR: "&bSpacesuit Oxygen Injector"
CLAY_COBBLESTONE_GENERATOR: "&bCobblestone Generator"
CLAY_ELECTRIC_WATER_PUMP: "&bElectric Water Pump"
+ CLAY_ELECTRIC_COPIER: "&eClay Electric Copier"
ROCKET_LAUNCHER: "&9Rocket Launcher"
DISTANCE_TO_PLANET: "&6%ly% &9light years to the planet you on"
FUEL_TO_PLANET: "&9Require &6%fuel% &9points of fuel to reach"
diff --git a/src/main/resources/en-US.yml b/src/main/resources/en-US.yml
index 20be0b6..c89a6f0 100644
--- a/src/main/resources/en-US.yml
+++ b/src/main/resources/en-US.yml
@@ -343,6 +343,20 @@ Items:
- "%TIER%"
- "%POWER%"
- "&8\u21E8 &e\u26A1 &716 J/s"
+ CLAY_ELECTRIC_COPIER: "&eClay Electric Copier"
+ CLAY_ELECTRIC_COPIER_LORE:
+ - ""
+ - "&fCan copy books"
+ - ""
+ - "%TIER%"
+ - "%POWER%"
+ - "&8\u21E8 &e\u26A1 &740 J/s"
+ COPYING_MODULE: "&bCopying Module"
+ COPYING_MODULE_LORE:
+ - "&6The module to copy books."
+ INK_MODULE: "&bInk Module"
+ INK_MODULE_LORE:
+ - "&6There is a lot of ink in it."
HIGHSPEED_RAILWAY: "&bHigh Speed Rail"
HIGHSPEED_RAILWAY_LORE:
- "&6The minecart which is running on this kind of rail"
@@ -576,6 +590,7 @@ Researches:
CLAYTECH_FISH_I: "Fish"
CLAYTECH_COBBLESTONE_GENERATOR: "Cobblestone Generator"
CLAYTECH_ELECTRIC_WATER_PUMP: "Electric Water Pump"
+ CLAYTECH_COPIER: "Electric Copier"
MachineRecipes:
CLAY_FUSION_MACHINE: "&a&oCraft this in Clay Fusing Machine"
CLAY_ELETRIC_CAULDRON: "&a&oCraft this in Electric Cauldron"
@@ -604,6 +619,7 @@ Machines:
CLAY_SPACESUIT_OXYGEN_INJECTOR: "&bSpacesuit Oxygen Injector"
CLAY_COBBLESTONE_GENERATOR: "&bCobblestone Generator"
CLAY_ELECTRIC_WATER_PUMP: "&bElectric Water Pump"
+ CLAY_ELECTRIC_COPIER: "&eClay Electric Copier"
ROCKET_LAUNCHER: "&9Rocket Launcher"
DISTANCE_TO_PLANET: "&6%ly% &9light years to the planet you on"
FUEL_TO_PLANET: "&9Require &6%fuel% &9points of fuel to reach"
diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml
index 62ff8e3..b370172 100644
--- a/src/main/resources/plugin.yml
+++ b/src/main/resources/plugin.yml
@@ -1,6 +1,6 @@
name: ClayTech
main: club.claycoffee.ClayTech.ClayTech
-version: 1.2.0-dev17
+version: 1.2.1
api-version: 1.13
author: ClayCoffee
loadbefore: [Multiverse-Core]
diff --git a/src/main/resources/zh-CN.yml b/src/main/resources/zh-CN.yml
index cc29a9a..e75c348 100644
--- a/src/main/resources/zh-CN.yml
+++ b/src/main/resources/zh-CN.yml
@@ -342,6 +342,20 @@ Items:
- "%TIER%"
- "%POWER%"
- "&8\u21E8 &e\u26A1 &716 J/s"
+ CLAY_ELECTRIC_COPIER: "&e电力复印机"
+ CLAY_ELECTRIC_COPIER_LORE:
+ - ""
+ - "&f能够复印书本"
+ - ""
+ - "%TIER%"
+ - "%POWER%"
+ - "&8\u21E8 &e\u26A1 &740 J/s"
+ COPYING_MODULE: "&b复印模块"
+ COPYING_MODULE_LORE:
+ - "&6用来复印书本的模块."
+ INK_MODULE: "&b墨水模块"
+ INK_MODULE_LORE:
+ - "&6储存着墨水."
HIGHSPEED_RAILWAY: "&b高速铁路"
HIGHSPEED_RAILWAY_LORE:
- "&6在这种铁路上行驶的矿车"
@@ -586,6 +600,7 @@ Researches:
CLAYTECH_FISH_I: "鱼类"
CLAYTECH_COBBLESTONE_GENERATOR: "圆石制造机"
CLAYTECH_ELECTRIC_WATER_PUMP: "电动水泵"
+ CLAYTECH_COPIER: "复印机"
MachineRecipes:
CLAY_FUSION_MACHINE: "&a&o在粘土融合器内合成"
CLAY_ELETRIC_CAULDRON: "&a&o在电锅内合成"
@@ -614,6 +629,7 @@ Machines:
CLAY_SPACESUIT_OXYGEN_INJECTOR: "&b宇航服氧气注入器"
CLAY_COBBLESTONE_GENERATOR: "&b圆石制造机"
CLAY_ELECTRIC_WATER_PUMP: "&b电动水泵"
+ CLAY_ELECTRIC_COPIER: "&e电力复印机"
ROCKET_LAUNCHER: "&9火箭发射器"
DISTANCE_TO_PLANET: "&9距离当前星球 &6%ly% &9光年"
FUEL_TO_PLANET: "&9到达需要燃料 &6%fuel% &9点"
diff --git a/src/main/resources/zh-TW.yml b/src/main/resources/zh-TW.yml
index 3d8ae6a..da07f23 100644
--- a/src/main/resources/zh-TW.yml
+++ b/src/main/resources/zh-TW.yml
@@ -342,6 +342,20 @@ Items:
- "%TIER%"
- "%POWER%"
- "&8\u21E8 &e\u26A1 &716 J/s"
+ CLAY_ELECTRIC_COPIER: "&e電力復印機"
+ CLAY_ELECTRIC_COPIER_LORE:
+ - ""
+ - "&f能夠復印書本"
+ - ""
+ - "%TIER%"
+ - "%POWER%"
+ - "&8\u21E8 &e\u26A1 &740 J/s"
+ COPYING_MODULE: "&b復印模塊"
+ COPYING_MODULE_LORE:
+ - "&6用來復印書本的模塊."
+ INK_MODULE: "&b墨水模塊"
+ INK_MODULE_LORE:
+ - "&6儲存著墨水."
HIGHSPEED_RAILWAY: "&b高速鐵路"
HIGHSPEED_RAILWAY_LORE:
- "&6在這種鐵路上行駛的礦車"
@@ -586,6 +600,7 @@ Researches:
CLAYTECH_FISH_I: "魚類"
CLAYTECH_COBBLESTONE_GENERATOR: "圓石制造機"
CLAYTECH_ELECTRIC_WATER_PUMP: "電動水泵"
+ CLAYTECH_COPIER: "復印機"
MachineRecipes:
CLAY_FUSION_MACHINE: "&a&o在粘土融合器內合成"
CLAY_ELETRIC_CAULDRON: "&a&o在電鍋內合成"
@@ -614,6 +629,7 @@ Machines:
CLAY_SPACESUIT_OXYGEN_INJECTOR: "&b宇航服氧氣註入器"
CLAY_COBBLESTONE_GENERATOR: "&b圓石制造機"
CLAY_ELECTRIC_WATER_PUMP: "&b電動水泵"
+ CLAY_ELECTRIC_COPIER: "&e電力復印機"
ROCKET_LAUNCHER: "&9火箭發射器"
DISTANCE_TO_PLANET: "&9距離當前星球 &6%ly% &9光年"
FUEL_TO_PLANET: "&9到達需要燃料 &6%fuel% &9點"