Added message to sign creation/removal
Fixed name errors
This commit is contained in:
parent
f8a6df8479
commit
06b579ee27
35 changed files with 107 additions and 63 deletions
|
@ -5,7 +5,22 @@
|
|||
<artifactId>themepark</artifactId>
|
||||
<version>3.1.0</version>
|
||||
<build>
|
||||
<defaultGoal>clean package</defaultGoal>
|
||||
<resources>
|
||||
<resource>
|
||||
<filtering>true</filtering>
|
||||
<directory>src/main/resources</directory>
|
||||
</resource>
|
||||
</resources>
|
||||
<finalName>ThemePark v${project.version}</finalName>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.8.1</version>
|
||||
<configuration>
|
||||
<release>11</release>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-shade-plugin</artifactId>
|
||||
<version>3.2.0</version>
|
||||
|
|
16
pom.xml
16
pom.xml
|
@ -113,7 +113,23 @@
|
|||
</dependencies>
|
||||
|
||||
<build>
|
||||
<defaultGoal>clean package</defaultGoal>
|
||||
<finalName>ThemePark v${project.version}</finalName>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/resources</directory>
|
||||
<filtering>true</filtering>
|
||||
</resource>
|
||||
</resources>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.8.1</version>
|
||||
<configuration>
|
||||
<release>11</release>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-shade-plugin</artifactId>
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package nl.iobyte.themepark.api.menu.objects;
|
||||
|
||||
import com.cryptomorin.xseries.XMaterial;
|
||||
import nl.iobyte.menuapi.MenuAPI;
|
||||
import nl.iobyte.menuapi.action.HandlerAction;
|
||||
import nl.iobyte.menuapi.basic.Menu;
|
||||
|
@ -59,10 +60,14 @@ public class MainMenu {
|
|||
if(name == null || name.equals(""))
|
||||
name = " ";
|
||||
|
||||
Material material = Material.getMaterial(manager.getString(StorageLocation.MENU, path+".material"));
|
||||
XMaterial material = XMaterial.matchXMaterial(manager.getString(StorageLocation.MENU, path+".material")).orElse(null);
|
||||
if(material == null)
|
||||
continue;
|
||||
|
||||
Material m = material.parseMaterial();
|
||||
if(m == null)
|
||||
continue;
|
||||
|
||||
int amount = manager.getInt(StorageLocation.MENU, path+".amount");
|
||||
if(amount < 1)
|
||||
amount = 1;
|
||||
|
@ -71,7 +76,7 @@ public class MainMenu {
|
|||
if(data < 0)
|
||||
continue;
|
||||
|
||||
builder = new ItemBuilder(material, amount, data);
|
||||
builder = new ItemBuilder(m, amount, data);
|
||||
builder.setName(name);
|
||||
|
||||
String lore = manager.getString(StorageLocation.MENU, path+".lore");
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
package nl.iobyte.themepark.api.menu.objects.actions;
|
||||
|
||||
import nl.iobyte.menuapi.action.MenuAction;
|
||||
import nl.iobyte.themepark.ThemePark;
|
||||
import nl.iobyte.themepark.api.attraction.objects.Attraction;
|
||||
import nl.iobyte.themepark.api.config.enums.StorageKey;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
|
@ -14,7 +16,7 @@ public class TPAction extends MenuAction {
|
|||
}
|
||||
|
||||
public void execute(Player player) {
|
||||
Bukkit.dispatchCommand(player, "themepark attraction warp "+attraction.getID());
|
||||
Bukkit.dispatchCommand(player, ThemePark.getInstance().getAPI().getConfigurationManager().getString(StorageKey.CMD)+" attraction warp "+attraction.getID());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -19,21 +19,22 @@ public class SignManager {
|
|||
return signs;
|
||||
}
|
||||
|
||||
public void addSign(StatusSign sign) {
|
||||
public boolean addSign(StatusSign sign) {
|
||||
if(sign == null || sign.getLocation() == null)
|
||||
return;
|
||||
return false;
|
||||
|
||||
if(!(sign.getLocation().getBlock().getState() instanceof Sign))
|
||||
return;
|
||||
return false;
|
||||
|
||||
if(signs.containsKey(sign.getAttraction())) {
|
||||
signs.get(sign.getAttraction()).add(sign);
|
||||
return;
|
||||
return true;
|
||||
}
|
||||
|
||||
ArrayList<StatusSign> array = new ArrayList<>();
|
||||
array.add(sign);
|
||||
signs.put(sign.getAttraction(), array);
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean hasSigns(Attraction attraction) {
|
||||
|
@ -84,36 +85,40 @@ public class SignManager {
|
|||
ThemePark.getInstance().getAPI().getConfigurationManager().set(StorageLocation.SIGN_DATA, "signs."+attraction.getID(), null);
|
||||
}
|
||||
|
||||
public void removeSign(StatusSign sign) {
|
||||
public boolean removeSign(StatusSign sign) {
|
||||
if(sign == null || sign.getLocation() == null || sign.getAttraction() == null)
|
||||
return;
|
||||
return false;
|
||||
|
||||
if(!hasSigns(sign.getAttraction()))
|
||||
return;
|
||||
return false;
|
||||
|
||||
String str2;
|
||||
Location loc1 = sign.getLocation();
|
||||
String str1 = LocationUtil.toString(loc1);
|
||||
ArrayList<StatusSign> array = signs.get(sign.getAttraction());
|
||||
boolean b = false;
|
||||
for(StatusSign s : new ArrayList<>(array)) {
|
||||
Location loc2 = s.getLocation();
|
||||
if(loc1 == null || loc2 == null)
|
||||
return;
|
||||
|
||||
String str2 = LocationUtil.toString(loc2);
|
||||
continue;
|
||||
|
||||
str2 = LocationUtil.toString(loc2);
|
||||
if(!str1.equals(str2))
|
||||
return;
|
||||
continue;
|
||||
|
||||
array.remove(s);
|
||||
b = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if(array.isEmpty()) {
|
||||
signs.remove(sign.getAttraction());
|
||||
ThemePark.getInstance().getAPI().getConfigurationManager().set(StorageLocation.SIGN_DATA, "signs."+sign.getAttraction().getID(), null);
|
||||
return;
|
||||
return b;
|
||||
}
|
||||
|
||||
signs.put(sign.getAttraction(), array);
|
||||
return b;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -35,7 +35,7 @@ public class ItemCommand extends SubCommand {
|
|||
Player player = (Player) sender.getOriginal();
|
||||
player.getInventory().addItem(builder.getItem());
|
||||
player.updateInventory();
|
||||
player.sendMessage(Text.color("&6&lThemeParkMC &f➢ Added item to your inventory"));
|
||||
player.sendMessage(Text.color("&6&lThemePark &f➢ Added item to your inventory"));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -22,6 +22,6 @@ public class AttractionCoverCommand extends SubCommand {
|
|||
Attraction attraction = (Attraction) list.get(0);
|
||||
String url = (String) list.get(1);
|
||||
attraction.setCover(url);
|
||||
sender.sendMessage(Text.color("&6&lThemeParkMC &f➢ &aSuccessfully changed the cover of attraction &f"+attraction.getID()));
|
||||
sender.sendMessage(Text.color("&6&lThemePark &f➢ &aSuccessfully changed the cover of attraction &f"+attraction.getID()));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -64,7 +64,7 @@ public class AttractionCreateCommand extends SubCommand {
|
|||
status,
|
||||
location
|
||||
));
|
||||
sender.sendMessage(Text.color("&6&lThemeParkMC &f➢ &aSuccessfully created attraction &f"+id));
|
||||
sender.sendMessage(Text.color("&6&lThemePark &f➢ &aSuccessfully created attraction &f"+id));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -75,7 +75,7 @@ public class AttractionListCommand extends SubCommand {
|
|||
private void sendMultiPage(ICommandExecutor sender, int page, String title, Collection<Attraction> attractions) {
|
||||
int pages = (int) Math.ceil(((double) attractions.size()) / 5);
|
||||
if(page < 1 || page > pages) {
|
||||
sender.sendMessage(Text.color("&6&lThemeParkMC &f➢ Page &6"+page+" &fdoesn't exist"));
|
||||
sender.sendMessage(Text.color("&6&lThemePark &f➢ Page &6"+page+" &fdoesn't exist"));
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ public class AttractionLocationCommand extends SubCommand {
|
|||
Attraction attraction = (Attraction) list.get(0);
|
||||
Player player = (Player) sender.getOriginal();
|
||||
attraction.setLocation(player.getLocation());
|
||||
player.sendMessage(Text.color("&6&lThemeParkMC &f➢ &aSuccessfully changed the location of attraction &f"+attraction.getID()));
|
||||
player.sendMessage(Text.color("&6&lThemePark &f➢ &aSuccessfully changed the location of attraction &f"+attraction.getID()));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@ public class AttractionNameCommand extends SubCommand {
|
|||
Attraction attraction = (Attraction) list.get(0);
|
||||
String name = (String) list.get(1);
|
||||
attraction.setName(name);
|
||||
sender.sendMessage(Text.color("&6&lThemeParkMC &f➢ &aSuccessfully changed the name of attraction &f"+attraction.getID()));
|
||||
sender.sendMessage(Text.color("&6&lThemePark &f➢ &aSuccessfully changed the name of attraction &f"+attraction.getID()));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -23,7 +23,7 @@ public class AttractionRegionCommand extends SubCommand {
|
|||
Attraction attraction = (Attraction) list.get(0);
|
||||
Region region = (Region) list.get(1);
|
||||
attraction.setRegionID(region.getID());
|
||||
sender.sendMessage(Text.color("&6&lThemeParkMC &f➢ &aSuccessfully changed the region of attraction &f"+attraction.getID()));
|
||||
sender.sendMessage(Text.color("&6&lThemePark &f➢ &aSuccessfully changed the region of attraction &f"+attraction.getID()));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@ public class AttractionRemoveCommand extends SubCommand {
|
|||
public void onCommand(ICommandExecutor sender, List<Object> list, int i) {
|
||||
Attraction attraction = (Attraction) list.get(0);
|
||||
ThemePark.getInstance().getAPI().getAttractionService().removeAttraction(attraction.getID());
|
||||
sender.sendMessage(Text.color("&6&lThemeParkMC &f➢ &aSuccessfully removed attraction &f"+attraction.getID()));
|
||||
sender.sendMessage(Text.color("&6&lThemePark &f➢ &aSuccessfully removed attraction &f"+attraction.getID()));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -37,7 +37,7 @@ public class AttractionStatusCommand extends SubCommand {
|
|||
return;
|
||||
|
||||
attraction.setStatus(status);
|
||||
sender.sendMessage(Text.color("&6&lThemeParkMC &f➢ &aSuccessfully changed the status of attraction &f"+attraction.getID()));
|
||||
sender.sendMessage(Text.color("&6&lThemePark &f➢ &aSuccessfully changed the status of attraction &f"+attraction.getID()));
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@ public class AttractionWarpCommand extends SubCommand {
|
|||
}
|
||||
|
||||
if(attraction.getLocation() == null) {
|
||||
player.sendMessage(Text.color("&6&lThemeParkMC &f➢ &4No location available for this attraction"));
|
||||
player.sendMessage(Text.color("&6&lThemePark &f➢ &4No location available for this attraction"));
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ public class RegionCreateCommand extends SubCommand {
|
|||
id,
|
||||
name
|
||||
));
|
||||
sender.sendMessage(Text.color("&6&lThemeParkMC &f➢ &aSuccessfully created region &f"+id));
|
||||
sender.sendMessage(Text.color("&6&lThemePark &f➢ &aSuccessfully created region &f"+id));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -49,7 +49,7 @@ public class RegionListCommand extends SubCommand {
|
|||
page = (Integer) list.get(0);
|
||||
|
||||
if(page < 1 || page > pages) {
|
||||
sender.sendMessage(Text.color("&6&lThemeParkMC &f➢ Page &6"+page+" &fdoesn't exist"));
|
||||
sender.sendMessage(Text.color("&6&lThemePark &f➢ Page &6"+page+" &fdoesn't exist"));
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ public class RegionNameCommand extends SubCommand {
|
|||
Region region = (Region) list.get(0);
|
||||
String name = (String) list.get(1);
|
||||
region.setName(name);
|
||||
sender.sendMessage(Text.color("&6&lThemeParkMC &f➢ &aSuccessfully changed the name of region &f"+region.getID()));
|
||||
sender.sendMessage(Text.color("&6&lThemePark &f➢ &aSuccessfully changed the name of region &f"+region.getID()));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@ public class RegionRemoveCommand extends SubCommand {
|
|||
public void onCommand(ICommandExecutor sender, List<Object> list, int i) {
|
||||
Region region = (Region) list.get(0);
|
||||
ThemePark.getInstance().getAPI().getAttractionService().removeRegion(region.getID());
|
||||
sender.sendMessage(Text.color("&6&lThemeParkMC &f➢ &aSuccessfully removed region &f"+region.getID()));
|
||||
sender.sendMessage(Text.color("&6&lThemePark &f➢ &aSuccessfully removed region &f"+region.getID()));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -36,7 +36,7 @@ public class RideCountAddCommand extends SubCommand {
|
|||
);
|
||||
|
||||
sender.sendMessage(Text.color(
|
||||
"&6&lThemeParkMC &f➢ &aSuccessfully added count of: &6"+amount+"x &ato attraction: &f"+attraction.getID()+" &afor &6"+players.size()+" &aplayers"
|
||||
"&6&lThemePark &f➢ &aSuccessfully added count of: &6"+amount+"x &ato attraction: &f"+attraction.getID()+" &afor &6"+players.size()+" &aplayers"
|
||||
));
|
||||
}
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ public class RideCountChangeTotalTypeCommand extends SubCommand {
|
|||
TotalType type = (TotalType) list.get(0);
|
||||
|
||||
ThemePark.getInstance().getAPI().getRideCountService().setType(type);
|
||||
sender.sendMessage(Text.color("&6&lThemeParkMC &f➢ Changed total type for ridecount to: &f"+type.toString()));
|
||||
sender.sendMessage(Text.color("&6&lThemePark &f➢ Changed total type for ridecount to: &f"+type.toString()));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@ public class RideCountGetCommand extends SubCommand {
|
|||
);
|
||||
|
||||
sender.sendMessage(Text.color(
|
||||
"&6&lThemeParkMC &f➢ You have ridden attraction: &f"+attraction.getID()+" &ffor &6"+(count == null ? 0 : count.getCount())+"x"
|
||||
"&6&lThemePark &f➢ You have ridden attraction: &f"+attraction.getID()+" &ffor &6"+(count == null ? 0 : count.getCount())+"x"
|
||||
));
|
||||
}
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ public class StatusColorCommand extends SubCommand {
|
|||
Status status = (Status) list.get(0);
|
||||
String color = (String) list.get(1);
|
||||
status.setColor(color);
|
||||
sender.sendMessage(Text.color("&6&lThemeParkMC &f➢ &aSuccessfully changed the color of status &f"+status.toString()));
|
||||
sender.sendMessage(Text.color("&6&lThemePark &f➢ &aSuccessfully changed the color of status &f"+status.toString()));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ public class StatusHexColorCommand extends SubCommand {
|
|||
Status status = (Status) list.get(0);
|
||||
String hex_color = (String) list.get(1);
|
||||
status.setHexColor(hex_color);
|
||||
sender.sendMessage(Text.color("&6&lThemeParkMC &f➢ &aSuccessfully changed the hex color of status &f"+status.toString()));
|
||||
sender.sendMessage(Text.color("&6&lThemePark &f➢ &aSuccessfully changed the hex color of status &f"+status.toString()));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ public class StatusMaterialCommand extends SubCommand {
|
|||
XMaterial material = (XMaterial) list.get(1);
|
||||
|
||||
status.setMaterial(material);
|
||||
sender.sendMessage(Text.color("&6&lThemeParkMC &f➢ &aSuccessfully changed the material of status &f"+ status));
|
||||
sender.sendMessage(Text.color("&6&lThemePark &f➢ &aSuccessfully changed the material of status &f"+ status));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -23,7 +23,7 @@ public class StatusNameCommand extends SubCommand {
|
|||
Status status = (Status) list.get(0);
|
||||
String name = (String) list.get(1);
|
||||
status.setName(name);
|
||||
sender.sendMessage(Text.color("&6&lThemeParkMC &f➢ &aSuccessfully changed the name of status &f"+ status));
|
||||
sender.sendMessage(Text.color("&6&lThemePark &f➢ &aSuccessfully changed the name of status &f"+ status));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@ public class StatusTeleportCommand extends SubCommand {
|
|||
Status status = (Status) list.get(0);
|
||||
boolean b = (boolean) list.get(1);
|
||||
status.setCanTeleport(b);
|
||||
sender.sendMessage(Text.color("&6&lThemeParkMC &f➢ &aSuccessfully changed if status &f"+status.toString()+" &acan teleport"));
|
||||
sender.sendMessage(Text.color("&6&lThemePark &f➢ &aSuccessfully changed if status &f"+status.toString()+" &acan teleport"));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -38,7 +38,7 @@ public class AttractionListener implements Listener {
|
|||
ThemePark.getInstance().getAPI().getDatabaseService().executeAsync(
|
||||
"remote",
|
||||
"INSERT IGNORE INTO attractions(id, region_id, name, cover, status_id) VALUES (?,?,?,?,?)",
|
||||
new HashMap<Integer, Object>() {{
|
||||
new HashMap<>() {{
|
||||
put(1, attraction.getID());
|
||||
put(2, attraction.getRegionID());
|
||||
put(3, attraction.getName());
|
||||
|
|
|
@ -138,7 +138,7 @@ public class PlayerListener implements Listener {
|
|||
|
||||
e.setCancelled(true);
|
||||
Player player = e.getPlayer();
|
||||
Bukkit.dispatchCommand(player, "themepark menu");
|
||||
Bukkit.dispatchCommand(player, manager.getString(StorageKey.CMD)+" menu");
|
||||
}
|
||||
|
||||
//Handle Menu item drop
|
||||
|
|
|
@ -42,7 +42,8 @@ public class StatusSignListener implements Listener {
|
|||
|
||||
Location location = e.getBlock().getLocation();
|
||||
StatusSign statusSign = new StatusSign(attraction, location);
|
||||
manager.addSign(statusSign);
|
||||
if(manager.addSign(statusSign))
|
||||
e.getPlayer().sendMessage(Text.color("&6&lThemePark &f➢ &aSuccessfully created a status sign"));
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
|
@ -62,7 +63,9 @@ public class StatusSignListener implements Listener {
|
|||
Location location = e.getBlock().getLocation();
|
||||
|
||||
StatusSign s = new StatusSign(attraction, location);
|
||||
manager.removeSign(s);
|
||||
if(manager.removeSign(s))
|
||||
e.getPlayer().sendMessage(Text.color("&6&lThemePark &f➢ &aSuccessfully removed a status sign"));
|
||||
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
|
|
|
@ -6,6 +6,7 @@ import net.md_5.bungee.api.chat.HoverEvent;
|
|||
import net.md_5.bungee.api.chat.TextComponent;
|
||||
import nl.iobyte.themepark.ThemePark;
|
||||
import nl.iobyte.themepark.api.attraction.objects.Attraction;
|
||||
import nl.iobyte.themepark.api.config.enums.StorageKey;
|
||||
import nl.iobyte.themepark.api.config.enums.StorageLocation;
|
||||
import nl.iobyte.themepark.api.message.MessageKey;
|
||||
import nl.iobyte.themepark.api.message.Text;
|
||||
|
@ -21,7 +22,7 @@ public class StatusMessage {
|
|||
public static void broadcast(Attraction attraction) {
|
||||
HashMap<String, String> change = new HashMap<>();
|
||||
change.put("{name}", attraction.getName());
|
||||
ClickEvent click = new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/themepark attraction warp "+attraction.getID());
|
||||
ClickEvent click = new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/"+ThemePark.getInstance().getAPI().getConfigurationManager().getString(StorageKey.CMD)+" attraction warp "+attraction.getID());
|
||||
HoverEvent hover = new HoverEvent(HoverEvent.Action.SHOW_TEXT, TextComponent.fromLegacyText(Text.color(ThemePark.getInstance().getAPI().getConfigurationManager().getString(StorageLocation.MESSAGE, "attraction.changed.hover"))));
|
||||
if(hover.getValue()[0].toPlainText().isEmpty())
|
||||
hover = null;
|
||||
|
|
|
@ -95,34 +95,31 @@ public class UpdateManager {
|
|||
public void check() {
|
||||
Bukkit.getScheduler().runTaskAsynchronously(this.plugin, () -> {
|
||||
try {
|
||||
BufferedReader in = null;
|
||||
HttpsURLConnection con;
|
||||
if (type == CheckType.SPIGOT) {
|
||||
HttpsURLConnection con = (HttpsURLConnection) new URL(String.format(SPIGOT_API, this.resourceID)).openConnection();
|
||||
con.setRequestMethod("GET");
|
||||
con.setRequestProperty("User-Agent", "Mozilla/5.0");
|
||||
con = (HttpsURLConnection) new URL(String.format(SPIGOT_API, this.resourceID)).openConnection();
|
||||
|
||||
in = new BufferedReader(new InputStreamReader(con.getInputStream()));
|
||||
} else if (type == CheckType.SBDPLUGINS) {
|
||||
HttpsURLConnection con = (HttpsURLConnection) new URL(String.format(SBDPLUGINS_API, this.resourceID)).openConnection();
|
||||
con = (HttpsURLConnection) new URL(String.format(SBDPLUGINS_API, this.resourceID)).openConnection();
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
con.setRequestMethod("GET");
|
||||
con.setRequestProperty("User-Agent", "Mozilla/5.0");
|
||||
|
||||
in = new BufferedReader(new InputStreamReader(con.getInputStream()));
|
||||
}
|
||||
|
||||
if (in == null) return;
|
||||
BufferedReader in = new BufferedReader(
|
||||
new InputStreamReader(con.getInputStream())
|
||||
);
|
||||
|
||||
String version;
|
||||
|
||||
String inputLine;
|
||||
StringBuilder response = new StringBuilder();
|
||||
while ((inputLine = in.readLine()) != null) {
|
||||
while ((inputLine = in.readLine()) != null)
|
||||
response.append(inputLine);
|
||||
}
|
||||
|
||||
in.close();
|
||||
|
||||
JsonParser parser = new JsonParser();
|
||||
|
||||
if (type == CheckType.SPIGOT) {
|
||||
JsonArray array = parser.parse(response.toString()).getAsJsonArray();
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
version: 1.1
|
||||
version: 1.2
|
||||
|
||||
prefix: '&6&lThemeParkMC &r&f➢'
|
||||
prefix: '&6&lThemePark &f➢&r'
|
||||
|
||||
menu:
|
||||
previous: "&6&L\u23F4 Previous"
|
||||
|
@ -13,7 +13,7 @@ ridecount:
|
|||
attraction:
|
||||
changed:
|
||||
hover: "&6Click to Warp"
|
||||
CONSTRUCTION: "{prefix} &fAttraction: {name} &fis now &7Under Construction"
|
||||
CONSTRUCTION: "{prefix} &fAttraction: &r{name} &fis now &7Under Construction"
|
||||
OPEN: "{prefix} &fAttraction: [TP]&r{name}[/TP] &fhas been &aOpened"
|
||||
CLOSED: "{prefix} &fAttraction: &r{name} &fhas been &4Closed"
|
||||
MAINTENANCE: "{prefix} &fAttraction: &r{name} &fis now in &6Maintenance"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
name: ThemePark
|
||||
version: 3.1.0
|
||||
version: '${project.version}'
|
||||
author: IOByte
|
||||
website: 'https://www.iobyte.nl'
|
||||
main: nl.iobyte.themepark.ThemePark
|
||||
|
|
|
@ -18,5 +18,5 @@ mysql:
|
|||
|
||||
sign:
|
||||
status:
|
||||
name: '[ThemeParkMC]'
|
||||
title: '&f[&6&lThemeParkMC&f]'
|
||||
name: '[ThemePark]'
|
||||
title: '&f[&6&lThemePark&f]'
|
Reference in a new issue