mirror of
https://github.com/songoda/UltimateRepairing.git
synced 2024-11-25 20:16:14 +01:00
Updates SongodaCore to v2.6.11 (+ updated to new hologram methods)
This commit is contained in:
parent
a2a132509c
commit
67a4d3d61d
2
pom.xml
2
pom.xml
@ -120,7 +120,7 @@
|
||||
<dependency>
|
||||
<groupId>com.songoda</groupId>
|
||||
<artifactId>SongodaCore</artifactId>
|
||||
<version>2.6.8</version>
|
||||
<version>2.6.11</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
@ -11,6 +11,8 @@ import java.util.ArrayList;
|
||||
import java.util.Objects;
|
||||
|
||||
public class UAnvil {
|
||||
private static int nextHologramId = 0;
|
||||
private final String hologramId = "UltimateRepairing-Anvil#" + (++nextHologramId);
|
||||
|
||||
private final Location location;
|
||||
|
||||
@ -30,26 +32,28 @@ public class UAnvil {
|
||||
public void setHologram(boolean hologram) {
|
||||
this.hologram = hologram;
|
||||
if (HologramManager.getManager().isEnabled()) {
|
||||
|
||||
ArrayList<String> lines = new ArrayList<>();
|
||||
|
||||
if (!Settings.ENABLE_ANVIL_DEFAULT_FUNCTION.getBoolean()) {
|
||||
lines.add(UltimateRepairing.getInstance().getLocale().getMessage("general.hologram.oneclick").getMessage());
|
||||
} else if (Settings.SWAP_LEFT_RIGHT.getBoolean()) {
|
||||
lines.add(UltimateRepairing.getInstance().getLocale().getMessage("general.hologram.swapclick").getMessage());
|
||||
} else {
|
||||
lines.add(UltimateRepairing.getInstance().getLocale().getMessage("general.hologram.click").getMessage());
|
||||
}
|
||||
|
||||
lines.add(UltimateRepairing.getInstance().getLocale().getMessage("general.hologram.torepair").getMessage());
|
||||
|
||||
Location location = getLocation().add(0, .1, 0);
|
||||
|
||||
Bukkit.getScheduler().runTaskLater(UltimateRepairing.getInstance(), () -> {
|
||||
if (!hologram) {
|
||||
HologramManager.removeHologram(location);
|
||||
HologramManager.removeHologram(hologramId);
|
||||
} else {
|
||||
HologramManager.updateHologram(location, lines);
|
||||
ArrayList<String> lines = new ArrayList<>();
|
||||
|
||||
if (!Settings.ENABLE_ANVIL_DEFAULT_FUNCTION.getBoolean()) {
|
||||
lines.add(UltimateRepairing.getInstance().getLocale().getMessage("general.hologram.oneclick").getMessage());
|
||||
} else if (Settings.SWAP_LEFT_RIGHT.getBoolean()) {
|
||||
lines.add(UltimateRepairing.getInstance().getLocale().getMessage("general.hologram.swapclick").getMessage());
|
||||
} else {
|
||||
lines.add(UltimateRepairing.getInstance().getLocale().getMessage("general.hologram.click").getMessage());
|
||||
}
|
||||
|
||||
lines.add(UltimateRepairing.getInstance().getLocale().getMessage("general.hologram.torepair").getMessage());
|
||||
|
||||
if (!HologramManager.isHologramLoaded(hologramId)) {
|
||||
HologramManager.createHologram(hologramId, getLocation().add(0, .1, 0), lines);
|
||||
return;
|
||||
}
|
||||
|
||||
HologramManager.updateHologram(hologramId, lines);
|
||||
}
|
||||
}, 1L);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user