Skip to content

Commit

Permalink
[U] nightly-20200310-2
Browse files Browse the repository at this point in the history
  • Loading branch information
ClayCoffee committed Mar 10, 2020
1 parent 989d133 commit a6fc2c1
Show file tree
Hide file tree
Showing 10 changed files with 49 additions and 10 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,9 @@ This plugin made by me.Please do not claim this plugin as yours, because i put a
* English(UK) en-UK
* English(US) en-US (default)

# Supported Minecraft Server Version
* Spigot / PaperSpigot 1.14.x
* Spigot / PaperSpigot 1.15.x

# Translate
Want to translate this plugin to other languages?Just start an issue and a pull request and I will check and merge it.
Want to translate this plugin to other languages?Just start an issue and a pull request and I will check and merge it.
15 changes: 15 additions & 0 deletions src/main/java/club/claycoffee/ClayTech/ClayTech.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ public class ClayTech extends JavaPlugin implements SlimefunAddon{
public static DataYML currentLangYML;
public static FileConfiguration currentLang;
public static String highrailspeed;
private static String version = Bukkit.getServer().getClass().getPackage().getName().replace(".", ",").split(",")[3];
public static boolean is115 = true;
public static boolean compatible = true;

@SuppressWarnings({ "unused", "static-access" })
@Override
Expand Down Expand Up @@ -93,6 +96,18 @@ public void onEnable() {
}
currentLangYML.saveCustomConfig();
currentLangYML.reloadCustomConfig();
switch(version) {
case "v1_15_R1" : break;
case "v1_14_R1" : is115=false;break;
default: compatible=false;break;
}
if(!compatible) {
Utils.info(Lang.readGeneralText("Not_compatible"));
this.getServer().getPluginManager().disablePlugin(this);
}
if(!is115) {
Utils.info(Lang.readGeneralText("Before_115"));
}
Utils.info(Lang.readGeneralText("startTip"));
Config cfg = new Config(this);
Utils.info(Lang.readGeneralText("registeringItems"));
Expand Down
9 changes: 7 additions & 2 deletions src/main/java/club/claycoffee/ClayTech/Defines.java
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,6 @@ public class Defines {
Lang.readItemLore("SNAIL_HEALTHY"));
public static final ItemStack SNAIL_BAD = Utils.setLore(Utils.newItemD(Material.NAUTILUS_SHELL, Lang.readItemText("SNAIL_BAD")),
Lang.readItemLore("SNAIL_BAD"));
public static final ItemStack HONEY_SWEET = Utils.setLore(Utils.newItemD(Material.HONEYCOMB, Lang.readItemText("HONEY_SWEET")),
Lang.readItemLore("HONEY_SWEET"));
public static final ItemStack HIGHSPEED_RAILWAY = Utils.setLore(Utils.newItemD(Material.POWERED_RAIL, Lang.readItemText("HIGHSPEED_RAILWAY")),
Lang.readItemLore("HIGHSPEED_RAILWAY"));
public static final ItemStack ELECTRIC_MOTOR_8 = Utils.newItemD(Material.FEATHER, Lang.readItemText("ELECTRIC_MOTOR_8"));
Expand Down Expand Up @@ -191,4 +189,11 @@ public class Defines {
"http://textures.minecraft.net/texture/c74170c66bf3140f234b322add724c5df6949a9209f807ebf86d4f9c8c1e178"),
Lang.readItemText("CLAY_ELEMENT_EXTRACTER")),
Utils.replaceList(Utils.replaceList(Lang.readItemLore("CLAY_ELEMENT_EXTRACTER"),"%TIER%",LoreBuilder.machine(MachineTier.ADVANCED, MachineType.MACHINE).replaceAll("&", "§")),"%POWER%",LoreBuilder.powerBuffer(1024).replaceAll("&", "§")));
public static ItemStack HONEY_SWEET;
static {
if(ClayTech.is115) {
HONEY_SWEET = Utils.setLore(Utils.newItemD(Material.HONEYCOMB, Lang.readItemText("HONEY_SWEET")),
Lang.readItemLore("HONEY_SWEET"));
}
}
}
7 changes: 6 additions & 1 deletion src/main/java/club/claycoffee/ClayTech/Recipes.java
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,12 @@ Defines.ADVANCED_POISON_CORE, Defines.ADVANCED_POISON_CORE, new ItemStack(Materi
Defines.TEA_POWDER, Defines.LEMON_POWDER, null, Defines.DRINK_BOTTLE, null };
public final static ItemStack[] TEA_POWDER = {null,null,null,null,Defines.RAW_TEA,null,null,null,null};
public final static ItemStack[] LEMON_POWDER = {null,null,null,null,Defines.LEMON,null,null,null,null};
public final static ItemStack[] HONEY_SWEET = {new ItemStack(Material.SWEET_BERRIES),new ItemStack(Material.SWEET_BERRIES),new ItemStack(Material.SWEET_BERRIES),new ItemStack(Material.SUGAR),new ItemStack(Material.HONEY_BOTTLE),new ItemStack(Material.SUGAR),new ItemStack(Material.SUGAR),new ItemStack(Material.SUGAR),new ItemStack(Material.SUGAR)};
public static ItemStack[] HONEY_SWEET;
static {
if(ClayTech.is115) {
HONEY_SWEET = new ItemStack[]{new ItemStack(Material.SWEET_BERRIES),new ItemStack(Material.SWEET_BERRIES),new ItemStack(Material.SWEET_BERRIES),new ItemStack(Material.SUGAR),new ItemStack(Material.HONEY_BOTTLE),new ItemStack(Material.SUGAR),new ItemStack(Material.SUGAR),new ItemStack(Material.SUGAR),new ItemStack(Material.SUGAR)};
}
}
public final static ItemStack[] ELEMENT_CARBON = {null,null,null,null,new ItemStack(Material.COAL,8),null,null,null,null};
public final static ItemStack[] ELEMENT_OXYGEN = { null, null, null, null, new ItemStack(Material.GRASS_BLOCK,3), null, null, null, null };
public final static ItemStack[] ELEMENT_SILICON = {null,null,null,null,new ItemStack(Material.SAND,10),null,null,null,null};
Expand Down
12 changes: 7 additions & 5 deletions src/main/java/club/claycoffee/ClayTech/items/Foods.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,17 @@ public Foods() {
RecipeType.NULL, Defines.NORECIPE, false);
Slimefunutils.registerItem(Defines.C_FOOD, "SNAIL_FOOD", Defines.SNAIL_FOOD, "notresearch", 10,
TRecipe.CLAY_FOOD_CAULDRON, recipef, false);
Slimefunutils.registerItem(Defines.C_FOOD, "HONEY_SWEET", Defines.HONEY_SWEET, "notresearch", 10,
TRecipe.CLAY_FOOD_CAULDRON, Recipes.HONEY_SWEET, false);
if(ClayTech.is115) {
Slimefunutils.registerItem(Defines.C_FOOD, "HONEY_SWEET", Defines.HONEY_SWEET, "notresearch", 10,
TRecipe.CLAY_FOOD_CAULDRON, Recipes.HONEY_SWEET, false);
Research foodII = new Research(new NamespacedKey(ClayTech.plugin, "CLAYTECH_FOODBASIC2"), 9916, Lang.readResearchesText("CLAYTECH_FOOD_II"), 50);
foodII.addItems(SlimefunItem.getByItem(Defines.HONEY_SWEET));
foodII.register();
}

Research foodI = new Research(new NamespacedKey(ClayTech.plugin, "CLAYTECH_FOODBASIC"), 9911, Lang.readResearchesText("CLAYTECH_FOOD_I"), 50);
foodI.addItems(SlimefunItem.getByItem(Defines.CHICKEN_FOOT),SlimefunItem.getByItem(Defines.SPICY_CHICKEN_BURGER),SlimefunItem.getByItem(Defines.BABA_BURGER),SlimefunItem.getByItem(Defines.CHOCOLATE),SlimefunItem.getByItem(Defines.SNAIL_BAD),SlimefunItem.getByItem(Defines.SNAIL_FOOD));
foodI.register();

Research foodII = new Research(new NamespacedKey(ClayTech.plugin, "CLAYTECH_FOODBASIC2"), 9916, Lang.readResearchesText("CLAYTECH_FOOD_II"), 50);
foodII.addItems(SlimefunItem.getByItem(Defines.HONEY_SWEET));
foodII.register();
}
}
2 changes: 2 additions & 0 deletions src/main/resources/en-UK.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ General:
Cant_Eat_Message: "&cYou're already full!"
Wash_Message: "&6Completed!"
Cant_Wash_Message: "&cYou need a water bucket to do this."
Before_115: "&cYour server api version is before 1.15,the plugin also can run, but might cause some items can't register."
Not_compatible: "&cSorry.The plugin doesn't compatible your server version.Supported Server Version: 1.14.x, 1.15.x.Please upgrade your server!"
Categories:
Basic: "&bClayTech - Basic"
Weapons: "&bClayTech - Weapons"
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/en-US.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ General:
Cant_Eat_Message: "&cYou're already full!"
Wash_Message: "&6Completed!"
Cant_Wash_Message: "&cYou need a water bucket to do this."
Before_115: "&cYour server api version is before 1.15,the plugin also can run, but might cause some items can't register."
Not_compatible: "&cSorry.The plugin doesn't compatible your server version.Supported Server Version: 1.14.x, 1.15.x.Please upgrade your server!"
Categories:
Basic: "&bClayTech - Basic"
Weapons: "&bClayTech - Weapons"
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: ClayTech
main: club.claycoffee.ClayTech.ClayTech
version: nightly-20200310
api-version: 1.15
api-version: 1.14
depend: [CS-CoreLib, Slimefun]
2 changes: 2 additions & 0 deletions src/main/resources/zh-CN.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ General:
Cant_Eat_Message: "&c您已经饱了,不用再吃东西了!"
Wash_Message: "&6清洗完毕!!"
Cant_Wash_Message: "&c无法清洗!你没有水桶!"
Before_115: "&c检测到您的服务器运行在1.15版本以下,可能导致有的物品无法注册,但仍可正常运行本插件."
Not_compatible: "&c对不起,本插件仅限1.14.x,1.15.x的服务器使用!请尽快升级您的服务器.."
Categories:
Basic: "&b粘土科技 - 基础"
Weapons: "&b粘土科技 - 武器"
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/zh-TW.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ General:
Cant_Eat_Message: "&c您已經飽了,不用再吃東西了!"
Wash_Message: "&6清洗完畢!!"
Cant_Wash_Message: "&c無法清洗!妳沒有水桶!"
Before_115: "&c檢測到您的伺服器運行在1.15版本以下,可能導致有的物品無法註冊,但仍可正常運行本插件."
Not_compatible: "&c對不起,本挿件僅限1.14.x,1.15.x的伺服器使用!請儘快陞級您的伺服器.."
Categories:
Basic: "&b粘土科技 - 基礎"
Weapons: "&b粘土科技 - 武器"
Expand Down

0 comments on commit a6fc2c1

Please sign in to comment.