From 31150686f4534e855dafa6064213696571eefe0f Mon Sep 17 00:00:00 2001 From: ClayCoffee <1020757140@qq.com> Date: Mon, 9 Mar 2020 11:38:08 +0800 Subject: [PATCH] nightly-20200309 --- .../club/claycoffee/ClayTech/ClayTech.java | 32 +++++++++++++++---- .../ClayTech/Machines/ACraftingTable.java | 4 +-- .../ClayTech/Machines/AElementExtracter.java | 2 +- .../ClayTech/Machines/ANewContainer.java | 2 +- .../ClayTech/items/ElectricStoneCrusher.java | 5 +++ .../ClayTech/items/ElementExtracter.java | 3 +- .../ClayTech/listener/ClayTechListener.java | 8 ++--- .../ClayTech/utils/Slimefunutils.java | 3 +- src/main/resources/plugin.yml | 2 +- src/main/resources/zh-CN.yml | 4 +-- src/main/resources/zh-TW.yml | 4 +-- 11 files changed, 46 insertions(+), 23 deletions(-) diff --git a/src/main/java/club/claycoffee/ClayTech/ClayTech.java b/src/main/java/club/claycoffee/ClayTech/ClayTech.java index d7185dd..beb1376 100644 --- a/src/main/java/club/claycoffee/ClayTech/ClayTech.java +++ b/src/main/java/club/claycoffee/ClayTech/ClayTech.java @@ -14,6 +14,7 @@ import club.claycoffee.ClayTech.utils.DataYML; import club.claycoffee.ClayTech.utils.Lang; import club.claycoffee.ClayTech.utils.Utils; +import io.github.thebusybiscuit.slimefun4.api.SlimefunAddon; import club.claycoffee.ClayTech.items.*; import me.mrCookieSlime.CSCoreLibPlugin.Configuration.Config; import me.mrCookieSlime.Slimefun.Lists.RecipeType; @@ -21,7 +22,7 @@ import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; @SuppressWarnings("deprecation") -public class ClayTech extends JavaPlugin { +public class ClayTech extends JavaPlugin implements SlimefunAddon{ public static ClayTech plugin; public static String locale; public static DataYML currentLangYML; @@ -90,6 +91,12 @@ public void onEnable() { currentLangYML.reloadCustomConfig(); Utils.info(Lang.readGeneralText("startTip")); Config cfg = new Config(this); + if(this.getServer().getVersion().equals("1.15")) { + + } + else { + + } Utils.info(Lang.readGeneralText("registeringItems")); try { registerSlimefun(); @@ -104,7 +111,7 @@ public void onEnable() { public void onDisable() { } - public static void registerSlimefun() { + public void registerSlimefun() { ItemStack[] ClayCrafingTable = { SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.ELECTRO_MAGNET, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.BATTERY, new ItemStack(Material.CRAFTING_TABLE), SlimefunItems.BATTERY, Defines.MAGIC_CLAY, SlimefunItems.SMALL_CAPACITOR, Defines.MAGIC_CLAY }; @@ -133,15 +140,15 @@ SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.BATTERY, new ItemStack(Material.CRAF Defines.CLAY_ELECTRIC_STONE_CRUSHER); new CraftingTable(Defines.C_MACHINES, craftingtable, "CLAY_CRAFTING_TABLE", RecipeType.ENHANCED_CRAFTING_TABLE, - ClayCrafingTable).registerChargeableBlock(128); + ClayCrafingTable).register(this); new ElectricStoneCrusher(Defines.C_MACHINES, electricstonecrusher, "CLAY_ELECTRIC_STONE_CRUSHER", RecipeType.ENHANCED_CRAFTING_TABLE, - ClayStoneCrusher).registerChargeableBlock(128); + ClayStoneCrusher).register(this); new FoodCauldron(Defines.C_MACHINES, foodcauldron, "CLAY_FOOD_CAULDRON", RecipeType.ENHANCED_CRAFTING_TABLE, - ClayFoodCauldron).registerChargeableBlock(512); + ClayFoodCauldron).register(this); new FoodChalkingMachine(Defines.C_MACHINES, chalkingmachine, "CLAY_FOOD_CHALKING_MACHINE", - RecipeType.ENHANCED_CRAFTING_TABLE, ClayChalkingMachine).registerChargeableBlock(512); + RecipeType.ENHANCED_CRAFTING_TABLE, ClayChalkingMachine).register(this); new ElementExtracter(Defines.C_MACHINES, elementextracter, "CLAY_ELEMENT_EXTRACTER", - RecipeType.ENHANCED_CRAFTING_TABLE, ClayElementExtracter).registerChargeableBlock(1024); + RecipeType.ENHANCED_CRAFTING_TABLE, ClayElementExtracter).register(this); // 物品 new Clay_basic(); @@ -158,4 +165,15 @@ SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.BATTERY, new ItemStack(Material.CRAF new Railways(); } + + @Override + public JavaPlugin getJavaPlugin() { + return this; + } + + @Override + public String getBugTrackerURL() { + // TODO 自动生成的方法存根 + return null; + } } diff --git a/src/main/java/club/claycoffee/ClayTech/Machines/ACraftingTable.java b/src/main/java/club/claycoffee/ClayTech/Machines/ACraftingTable.java index 67f75c7..c49fd20 100644 --- a/src/main/java/club/claycoffee/ClayTech/Machines/ACraftingTable.java +++ b/src/main/java/club/claycoffee/ClayTech/Machines/ACraftingTable.java @@ -26,7 +26,7 @@ import me.mrCookieSlime.Slimefun.api.BlockStorage; import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; import me.mrCookieSlime.Slimefun.api.energy.ChargableBlock; -import me.mrCookieSlime.Slimefun.api.energy.EnergyNetComponentType; +import io.github.thebusybiscuit.slimefun4.core.networks.energy.EnergyNetComponentType; import me.mrCookieSlime.Slimefun.api.inventory.BlockMenu; import me.mrCookieSlime.Slimefun.api.inventory.BlockMenuPreset; import me.mrCookieSlime.CSCoreLibPlugin.Configuration.Config; @@ -127,7 +127,7 @@ public void registerDefaultRecipes() { } @Override - public EnergyNetComponentType getEnergyComponentType() { + public io.github.thebusybiscuit.slimefun4.core.networks.energy.EnergyNetComponentType getEnergyComponentType() { return EnergyNetComponentType.CONSUMER; } @Override diff --git a/src/main/java/club/claycoffee/ClayTech/Machines/AElementExtracter.java b/src/main/java/club/claycoffee/ClayTech/Machines/AElementExtracter.java index 5997ccf..3789bd8 100644 --- a/src/main/java/club/claycoffee/ClayTech/Machines/AElementExtracter.java +++ b/src/main/java/club/claycoffee/ClayTech/Machines/AElementExtracter.java @@ -27,7 +27,7 @@ import me.mrCookieSlime.Slimefun.api.BlockStorage; import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; import me.mrCookieSlime.Slimefun.api.energy.ChargableBlock; -import me.mrCookieSlime.Slimefun.api.energy.EnergyNetComponentType; +import io.github.thebusybiscuit.slimefun4.core.networks.energy.EnergyNetComponentType; import me.mrCookieSlime.Slimefun.api.inventory.BlockMenu; import me.mrCookieSlime.Slimefun.api.inventory.BlockMenuPreset; import me.mrCookieSlime.CSCoreLibPlugin.Configuration.Config; diff --git a/src/main/java/club/claycoffee/ClayTech/Machines/ANewContainer.java b/src/main/java/club/claycoffee/ClayTech/Machines/ANewContainer.java index 81df998..a977e11 100644 --- a/src/main/java/club/claycoffee/ClayTech/Machines/ANewContainer.java +++ b/src/main/java/club/claycoffee/ClayTech/Machines/ANewContainer.java @@ -30,7 +30,7 @@ import me.mrCookieSlime.Slimefun.api.BlockStorage; import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; import me.mrCookieSlime.Slimefun.api.energy.ChargableBlock; -import me.mrCookieSlime.Slimefun.api.energy.EnergyNetComponentType; +import io.github.thebusybiscuit.slimefun4.core.networks.energy.EnergyNetComponentType; import me.mrCookieSlime.Slimefun.api.inventory.BlockMenu; import me.mrCookieSlime.Slimefun.api.inventory.BlockMenuPreset; diff --git a/src/main/java/club/claycoffee/ClayTech/items/ElectricStoneCrusher.java b/src/main/java/club/claycoffee/ClayTech/items/ElectricStoneCrusher.java index 4498dbb..bd85cd7 100644 --- a/src/main/java/club/claycoffee/ClayTech/items/ElectricStoneCrusher.java +++ b/src/main/java/club/claycoffee/ClayTech/items/ElectricStoneCrusher.java @@ -40,6 +40,11 @@ public void registerDefaultRecipes() { this.registerRecipe(5,new ItemStack[] {new ItemStack(Material.COBBLESTONE)},new ItemStack[] {new ItemStack(Material.GRAVEL)}); } + @Override + public int getCapacity() { + return 128; + } + @Override public String getMachineIdentifier() { return "CLAY_ELECTRIC_STONE_CRUSHER"; diff --git a/src/main/java/club/claycoffee/ClayTech/items/ElementExtracter.java b/src/main/java/club/claycoffee/ClayTech/items/ElementExtracter.java index fd65248..2663617 100644 --- a/src/main/java/club/claycoffee/ClayTech/items/ElementExtracter.java +++ b/src/main/java/club/claycoffee/ClayTech/items/ElementExtracter.java @@ -30,7 +30,8 @@ public int getEnergyConsumption() { public int getSpeed() { return 1; } - + + @Override public int getCapacity() { return 1024; } diff --git a/src/main/java/club/claycoffee/ClayTech/listener/ClayTechListener.java b/src/main/java/club/claycoffee/ClayTech/listener/ClayTechListener.java index 7901248..d06760a 100644 --- a/src/main/java/club/claycoffee/ClayTech/listener/ClayTechListener.java +++ b/src/main/java/club/claycoffee/ClayTech/listener/ClayTechListener.java @@ -164,15 +164,15 @@ public void VehicleMoveEvent(VehicleMoveEvent e) { if (rail.getBlockData().getMaterial() == Material.POWERED_RAIL) { if (BlockStorage.checkID(rail) != null) { if (BlockStorage.checkID(rail).equalsIgnoreCase("CLAY_HIGHSPEED_RAILWAY")) { - ve.setMaxSpeed(0.4d * 3); + ve.setMaxSpeed(1.2d); } else { - ve.setMaxSpeed(0.4); + ve.setMaxSpeed(0.4d); } } else { - ve.setMaxSpeed(0.4); + ve.setMaxSpeed(0.4d); } } else { - ve.setMaxSpeed(0.4); + ve.setMaxSpeed(0.4d); } } } diff --git a/src/main/java/club/claycoffee/ClayTech/utils/Slimefunutils.java b/src/main/java/club/claycoffee/ClayTech/utils/Slimefunutils.java index d7996e8..8c9e103 100644 --- a/src/main/java/club/claycoffee/ClayTech/utils/Slimefunutils.java +++ b/src/main/java/club/claycoffee/ClayTech/utils/Slimefunutils.java @@ -14,12 +14,11 @@ public class Slimefunutils { private static int researchId = 9901; - @SuppressWarnings("deprecation") public static void registerItem(Category category, String name, ItemStack ItemStack, String ResearchName, int cost, RecipeType Recipetype, ItemStack[] RecipeStack, boolean registerResearch) { SlimefunItemStack items = new SlimefunItemStack(name, ItemStack); SlimefunItem item = new SlimefunItem(category, items, Recipetype, RecipeStack); - item.register(); + item.register(ClayTech.plugin); if (registerResearch) { researchId++; Slimefun.registerResearch( diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 5bb1240..271fac3 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -1,5 +1,5 @@ name: ClayTech main: club.claycoffee.ClayTech.ClayTech -version: nightly-20200306 +version: nightly-20200309 api-version: 1.15 depend: [CS-CoreLib, Slimefun] \ No newline at end of file diff --git a/src/main/resources/zh-CN.yml b/src/main/resources/zh-CN.yml index c12108f..997e3d0 100644 --- a/src/main/resources/zh-CN.yml +++ b/src/main/resources/zh-CN.yml @@ -38,7 +38,7 @@ Items: - "&b粘土科技的基础物品,许多粘土科技的合成都需要这个" CLAY_STICK: "§6克莱の木棍" CLAY_STICK_LORE: - - "&b服主克莱咖啡收藏的木棍,可以做某些工具" + - "&b作者克莱咖啡收藏的木棍,可以做某些工具" ARTIFICIAL_GOLD_NUGGET: "&6人造金粒" ARTIFICIAL_GOLD_INGOT_O: "&6人造金锭原矿" ARTIFICIAL_GOLD_INGOT: "&6人造金锭" @@ -192,7 +192,7 @@ Items: BABA_BURGER: "&e老八秘制小憨包" BABA_BURGER_LORE: - "&6老八秘制小憨包" - - "&7吃个试试?(造成的任何后果作者不负责)" + - "&7吃个试试?" - "&e不可放置" LETTUSE: "&e生菜" LETTUSE_LORE: diff --git a/src/main/resources/zh-TW.yml b/src/main/resources/zh-TW.yml index 20ad6ec..4eeb26e 100644 --- a/src/main/resources/zh-TW.yml +++ b/src/main/resources/zh-TW.yml @@ -38,7 +38,7 @@ Items: - "&b粘土科技的基礎物品,許多粘土科技的合成都需要這個" CLAY_STICK: "§6克萊の木棍" CLAY_STICK_LORE: - - "&b服主克萊咖啡收藏的木棍,可以做某些工具" + - "&b作者克萊咖啡收藏的木棍,可以做某些工具" ARTIFICIAL_GOLD_NUGGET: "&6人造金粒" ARTIFICIAL_GOLD_INGOT_O: "&6人造金錠原礦" ARTIFICIAL_GOLD_INGOT: "&6人造金錠" @@ -192,7 +192,7 @@ Items: BABA_BURGER: "&e老八秘制小憨包" BABA_BURGER_LORE: - "&6老八秘制小憨包" - - "&7吃個試試?(造成的任何後果作者不負責)" + - "&7吃個試試?" - "&e不可放置" LETTUSE: "&e生菜" LETTUSE_LORE: