Skip to content

Commit

Permalink
v1.1.6 Update
Browse files Browse the repository at this point in the history
- Major ConfigManager.java fixes
- Minor bug fixes
  • Loading branch information
AlbeMiglio committed Nov 8, 2020
1 parent 489b515 commit fc84b1d
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 17 deletions.
4 changes: 2 additions & 2 deletions Example/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>PowerLibAPI</artifactId>
<groupId>it.mycraft</groupId>
<version>1.1.5</version>
<version>1.1.6</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>PowerLibExample</artifactId>
Expand Down Expand Up @@ -59,7 +59,7 @@
<dependency>
<groupId>it.mycraft</groupId>
<artifactId>PowerLib</artifactId>
<version>1.1.5</version>
<version>1.1.6</version>
<scope>provided</scope>
</dependency>
</dependencies>
Expand Down
2 changes: 1 addition & 1 deletion Java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>PowerLibAPI</artifactId>
<groupId>it.mycraft</groupId>
<version>1.1.5</version>
<version>1.1.6</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
10 changes: 5 additions & 5 deletions Java/src/main/java/it/mycraft/powerlib/PowerLib.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ public class PowerLib extends JavaPlugin implements Listener {
@Getter
private static PowerLib instance;

private PluginUpdater pluginUpdater;
private PluginUpdater updater;

public void onEnable() {
instance = this;
this.pluginUpdater = new PluginUpdater(this).setSpigotURL(83274);
this.updater = new PluginUpdater(this).setSpigotURL(83274);
Bukkit.getPluginManager().registerEvents(this, this);
}

Expand All @@ -37,13 +37,13 @@ public void onJoin(PlayerJoinEvent event) {
if (!player.isOp() && !player.hasPermission("powerlib.update")) {
return;
}
if (this.pluginUpdater.needsUpdate()) {
if (this.updater.needsUpdate()) {
Message m = new Message("&c&lYour version of PowerLib is outdated!");
Message m1 = new Message("&a&nClick here to update to v{version}!")
.addPlaceHolder("{version}", this.pluginUpdater.getLatestVersion());
.addPlaceHolder("{version}", this.updater.getLatestVersion());
TextComponent update = new TextComponent((m1.getText()));
update.setClickEvent(new ClickEvent(ClickEvent.Action.OPEN_URL,
"https://spigotmc.org/resources/83274/download?version=" + this.pluginUpdater.getSpigotVersionId()));
"https://spigotmc.org/resources/83274/download?version=" + this.updater.getSpigotVersionId()));
m.send(player);
player.spigot().sendMessage(update);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ public FileConfiguration create(String file, String source) {
if (!resourcePath.exists()) {
createYAML(resourcePath.getName(), source, false);
}
else this.reload(file);
return this.configs.get(file);
}

Expand Down Expand Up @@ -110,7 +111,6 @@ public void reload(String file) {
} else {
yamlConfig = YamlConfiguration.loadConfiguration(new InputStreamReader(defStream, Charsets.UTF_8));
}

conf.setDefaults(yamlConfig);
this.put(file, conf);
}
Expand Down Expand Up @@ -185,8 +185,7 @@ private void createYAML(String resourcePath, String source, boolean replace) {
}

}
FileConfiguration conf = this.load(resourcePath);
this.put(resourcePath, conf);
this.reload(resourcePath);
} else {
throw new IllegalArgumentException("ResourcePath cannot be null or empty");
}
Expand Down
7 changes: 4 additions & 3 deletions Java/src/main/java/it/mycraft/powerlib/item/ItemBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -333,9 +333,10 @@ private ItemStack setPlayerSkin(ItemBuilder itemBuilder, String playerName) {
private ItemStack setColorToArmor(int red, int green, int blue, ItemBuilder itemBuilder) {
ItemStack leatherArmor = itemBuilder.setMaterial(material).setName(name).setLore(lore).build();
LeatherArmorMeta leatherArmorMeta = (LeatherArmorMeta) leatherArmor.getItemMeta();
Color color = Color.fromRGB(red, green, blue);

leatherArmorMeta.setColor(color);
try {
Color color = Color.fromRGB(red, green, blue);
leatherArmorMeta.setColor(color);
} catch(Exception ignored) { }
leatherArmor.setItemMeta(leatherArmorMeta);
return leatherArmor;
}
Expand Down
2 changes: 1 addition & 1 deletion Java/src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: PowerLib
authors: [AlbeMiglio, pompiere1]
main: it.mycraft.powerlib.PowerLib
version: 1.1.5
version: 1.1.6
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<dependency>
<groupId>it.albemiglio.PowerLib</groupId>
<artifactId>PowerLib</artifactId>
<version>1.1.5</version>
<version>1.1.6</version>
</dependency>
</dependencies>
```
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<groupId>it.mycraft</groupId>
<artifactId>PowerLibAPI</artifactId>
<packaging>pom</packaging>
<version>1.1.5</version>
<version>1.1.6</version>
<modules>
<module>Example</module>
<module>Java</module>
Expand Down

0 comments on commit fc84b1d

Please sign in to comment.