Skip to content

Commit

Permalink
Updated to latest version of MCShared
Browse files Browse the repository at this point in the history
  • Loading branch information
PyvesB committed Feb 15, 2018
1 parent 1114c0c commit c898a67
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 14 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
<dependency>
<groupId>com.hm.mcshared</groupId>
<artifactId>MCShared</artifactId>
<version>1.0.6</version>
<version>1.0.8</version>
<scope>compile</scope>
</dependency>
</dependencies>
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/com/hm/petmaster/PetMaster.java
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,7 @@ public void onEnable() {
// Check for available plugin update.
if (config.getBoolean("checkForUpdate", true)) {
updateChecker = new UpdateChecker(this, "https://raw.githubusercontent.com/PyvesB/PetMaster/master/pom.xml",
"petmaster.admin", chatHeader, "spigotmc.org/resources/pet-master.15904",
"dev.bukkit.org/bukkit-plugins/pet-master/files");
"petmaster.admin", chatHeader, "spigotmc.org/resources/pet-master.15904");
pm.registerEvents(updateChecker, this);
updateChecker.launchUpdateCheckerTask();
}
Expand Down
8 changes: 2 additions & 6 deletions src/main/java/com/hm/petmaster/command/HelpCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;

import com.hm.mcshared.particle.PacketSender;
import com.hm.mcshared.particle.FancyMessageSender;
import com.hm.petmaster.PetMaster;

/**
Expand Down Expand Up @@ -92,12 +92,8 @@ public void getHelp(CommandSender sender) {
public void sendJsonClickableHoverableMessage(CommandSender sender, String message, String command, String hover) {
// Send clickable and hoverable message if sender is a player and if no exception is caught.
if (sender instanceof Player) {
// Build the json format string.
String json = "{\"text\":\"" + message + "\",\"clickEvent\":{\"action\":\"suggest_command\",\"value\":\""
+ command + "\"},\"hoverEvent\":{\"action\":\"show_text\",\"value\":[{\"text\":\"" + hover
+ "\",\"color\":\"gold\"}]}}";
try {
PacketSender.sendChatMessagePacket((Player) sender, json);
FancyMessageSender.sendHoverableCommandMessage((Player) sender, message, command, hover, "gold");
} catch (Exception ex) {
plugin.getLogger()
.severe("Errors while trying to display clickable and hoverable message in /petm help command. "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import com.gmail.filoghost.holographicdisplays.api.Hologram;
import com.gmail.filoghost.holographicdisplays.api.HologramsAPI;
import com.hm.mcshared.event.PlayerChangeAnimalOwnershipEvent;
import com.hm.mcshared.particle.PacketSender;
import com.hm.mcshared.particle.FancyMessageSender;
import com.hm.mcshared.particle.ReflectionUtils.PackageType;
import com.hm.petmaster.PetMaster;

Expand Down Expand Up @@ -269,11 +269,10 @@ public void run() {
}

if (actionBarMessage) {
String actionBarJsonMessage = "{\"text\":\"&o" + ChatColor.GRAY
+ plugin.getPluginLang().getString("petmaster-action-bar", "Pet owned by ") + ChatColor.GOLD
+ owner.getName() + healthInfo + "\"}";
try {
PacketSender.sendActionBarPacket(event.getPlayer(), actionBarJsonMessage);
FancyMessageSender.sendActionBarMessage(event.getPlayer(), "&o" + ChatColor.GRAY
+ plugin.getPluginLang().getString("petmaster-action-bar", "Pet owned by ") + ChatColor.GOLD
+ owner.getName() + healthInfo);
} catch (Exception e) {
plugin.getLogger().warning("Errors while trying to display action bar message for pet ownership.");
}
Expand Down

0 comments on commit c898a67

Please sign in to comment.