Skip to content

Commit

Permalink
[U] 1.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
ClayCoffee committed Apr 2, 2020
1 parent a2cbf07 commit b5d9818
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 44 deletions.
39 changes: 21 additions & 18 deletions src/main/java/club/claycoffee/ClayTech/ClayTech.java
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ public void onEnable() {
}
Metrics mt = new Metrics(this, 6887);
mt.addCustomChart(new Metrics.SimplePie("language", () -> languageCodeToLanguage(locale)));

planetYML = new DataYML("planets.yml");
planetYML.saveCDefaultConfig();
planetYML.reloadCustomConfig();
Expand Down Expand Up @@ -265,33 +265,36 @@ public void onEnable() {
public void run() {
List<String> Authors = plugin.getDescription().getAuthors();
Bukkit.getLogger().info(ChatColor.GREEN + Lang.readGeneralText("Info_1"));
Bukkit.getLogger().info(ChatColor.GREEN + Lang.readGeneralText("Info_2").replaceAll("\\{version\\}", plugin.getDescription().getVersion()));
Bukkit.getLogger().info(ChatColor.GREEN + Lang.readGeneralText("Info_3").replaceAll("\\{author\\}", Utils.ArrayToString(Authors.toArray(new String[Authors.size()]), "," , ".")));
Bukkit.getLogger().info(ChatColor.GREEN + Lang.readGeneralText("Info_2").replaceAll("\\{version\\}",
plugin.getDescription().getVersion()));
Bukkit.getLogger().info(ChatColor.GREEN + Lang.readGeneralText("Info_3").replaceAll("\\{author\\}",
Utils.ArrayToString(Authors.toArray(new String[Authors.size()]), ",", ".")));
Bukkit.getLogger().info(ChatColor.GREEN + Lang.readGeneralText("Info_4"));
Bukkit.getLogger().info(ChatColor.GREEN + Lang.readGeneralText("Info_5").replaceAll("\\{issue_tracker\\}",plugin.getBugTrackerURL()));
Bukkit.getLogger().info(ChatColor.GREEN
+ Lang.readGeneralText("Info_5").replaceAll("\\{issue_tracker\\}", plugin.getBugTrackerURL()));
Bukkit.getLogger().info(ChatColor.GREEN + Lang.readGeneralText("Info_6"));
}

}.runTaskAsynchronously(this);

}

@Override
public void onDisable() {
}

private String languageCodeToLanguage(String code) {
switch(code.toUpperCase()) {
case "ZH-CN":
return "Simplified Chinese";
case "ZH-TW":
return "Traditional Chinese";
case "EN-US":
return "English(US)";
case "EN-UK":
return "English(UK)";
default:
return code;
switch (code.toUpperCase()) {
case "ZH-CN":
return "Simplified Chinese";
case "ZH-TW":
return "Traditional Chinese";
case "EN-US":
return "English(US)";
case "EN-UK":
return "English(UK)";
default:
return code;
}
}

Expand Down
3 changes: 1 addition & 2 deletions src/main/java/club/claycoffee/ClayTech/ClayTechItems.java
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,7 @@ public class ClayTechItems {
Utils.newItemD(Material.IRON_BLOCK, Lang.readItemText("CLAY_FUSION_ORE")),
Lang.readItemLore("CLAY_FUSION_ORE"));
public static final ItemStack TUNA_FISH = Utils.setLore(
Utils.newItemD(Material.TROPICAL_FISH, Lang.readItemText("TUNA_FISH")),
Lang.readItemLore("TUNA_FISH"));
Utils.newItemD(Material.TROPICAL_FISH, Lang.readItemText("TUNA_FISH")), Lang.readItemLore("TUNA_FISH"));

public static final ItemStack CLAY_FUEL = Utils.setDisplayName(
SkullItem.fromHash("3ce2dad9baf7eaba7e80d4d0f9fac0aab01a76b12fb71c3d2af2a16fdd4c7383"),
Expand Down
24 changes: 12 additions & 12 deletions src/main/java/club/claycoffee/ClayTech/ClayTechRecipeType.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,16 @@ public class ClayTechRecipeType {
public static final RecipeType DIG_IN_NON_EARTH = new RecipeType(
new NamespacedKey(ClayTech.plugin, "DIG_IN_NON_EARTH"), new SlimefunItemStack("DIG_IN_NON_EARTH",
new ItemStack(Material.IRON_PICKAXE), "", Lang.readMachineRecipesText("DIG_IN_NON_EARTH")));
public static final RecipeType FISHING = new RecipeType(
new NamespacedKey(ClayTech.plugin, "FISHING"), new SlimefunItemStack("FISHING",
new ItemStack(Material.TROPICAL_FISH), "", Lang.readMachineRecipesText("FISHING")));
public static final RecipeType HARVEST = new RecipeType(
new NamespacedKey(ClayTech.plugin, "HARVEST"), new SlimefunItemStack("HARVEST",
new ItemStack(Material.DIAMOND_HOE), "", Lang.readMachineRecipesText("HARVEST")));
public static final RecipeType PLUCKING = new RecipeType(
new NamespacedKey(ClayTech.plugin, "PLUCKING"), new SlimefunItemStack("PLUCKING",
new ItemStack(Material.APPLE), "", Lang.readMachineRecipesText("PLUCKING")));
public static final RecipeType CLEANING = new RecipeType(
new NamespacedKey(ClayTech.plugin, "CLEANING"), new SlimefunItemStack("CLEANING",
new ItemStack(Material.WATER_BUCKET), "", Lang.readMachineRecipesText("CLEANING")));
public static final RecipeType FISHING = new RecipeType(new NamespacedKey(ClayTech.plugin, "FISHING"),
new SlimefunItemStack("FISHING", new ItemStack(Material.TROPICAL_FISH), "",
Lang.readMachineRecipesText("FISHING")));
public static final RecipeType HARVEST = new RecipeType(new NamespacedKey(ClayTech.plugin, "HARVEST"),
new SlimefunItemStack("HARVEST", new ItemStack(Material.DIAMOND_HOE), "",
Lang.readMachineRecipesText("HARVEST")));
public static final RecipeType PLUCKING = new RecipeType(new NamespacedKey(ClayTech.plugin, "PLUCKING"),
new SlimefunItemStack("PLUCKING", new ItemStack(Material.APPLE), "",
Lang.readMachineRecipesText("PLUCKING")));
public static final RecipeType CLEANING = new RecipeType(new NamespacedKey(ClayTech.plugin, "CLEANING"),
new SlimefunItemStack("CLEANING", new ItemStack(Material.WATER_BUCKET), "",
Lang.readMachineRecipesText("CLEANING")));
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ public Foods() {
SlimefunItem.getByItem(ClayTechItems.CLAY_SWEET_POTATO),
SlimefunItem.getByItem(ClayTechItems.COOKED_SWEET_POTATO));
foodII.register();



Slimefunutils.registerItem(ClayTechItems.C_FOOD, "TUNA_FISH", ClayTechItems.TUNA_FISH, "notresearch", 10,
ClayTechRecipeType.FISHING, ClayTechItems.NORECIPE, false);
Research foodIII = new Research(new NamespacedKey(ClayTech.getInstance(), "CLAYTECH_FISH1"), 9931,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ protected void tick(Block b) {

@Override
public void run() {
Bukkit.getPluginManager().callEvent(new RocketInjectFuelEvent(b,itemfuel, rocket));
Bukkit.getPluginManager().callEvent(new RocketInjectFuelEvent(b, itemfuel, rocket));
}

}.runTask(ClayTech.getInstance());
Expand Down
17 changes: 8 additions & 9 deletions src/main/java/club/claycoffee/ClayTech/utils/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,23 +40,22 @@ public static ItemStack setLore(ItemStack is, int Line, String content) {
is.setItemMeta(im);
return (is);
}
public static String ArrayToString(String[] Array,String split,String LastSplit) {
String returnMessage="";

public static String ArrayToString(String[] Array, String split, String LastSplit) {
String returnMessage = "";
int i = 0;
for(String each : Array) {
for (String each : Array) {
i = i + 1;
if(i == Array.length) {
if (i == Array.length) {
returnMessage += each + LastSplit;
}
else {
} else {
returnMessage += each;
continue;
}
}
return(returnMessage);
return (returnMessage);
}

public static String readPlayerMetadataString(Player p, String key) {
for (MetadataValue mv : p.getMetadata(key)) {
if (mv.getOwningPlugin().equals(ClayTech.getInstance())) {
Expand Down

0 comments on commit b5d9818

Please sign in to comment.