mirror of
https://github.com/filoghost/HolographicDisplays.git
synced 2024-11-20 01:15:15 +01:00
Rename methods
This commit is contained in:
parent
40d18d1235
commit
a31f29cb32
@ -103,7 +103,7 @@ public interface Hologram {
|
||||
* @return the amount of lines
|
||||
* @since 1
|
||||
*/
|
||||
int size();
|
||||
int getLineCount();
|
||||
|
||||
|
||||
/**
|
||||
|
@ -26,9 +26,9 @@ public interface StandardHologram {
|
||||
|
||||
List<? extends StandardHologramLine> getLines();
|
||||
|
||||
int getLinesAmount();
|
||||
int getLineCount();
|
||||
|
||||
Plugin getOwnerPlugin();
|
||||
Plugin getCreatorPlugin();
|
||||
|
||||
boolean isVisibleTo(Player player);
|
||||
|
||||
|
@ -66,7 +66,7 @@ public class DebugCommand extends HologramSubCommand {
|
||||
for (Entry<StandardHologram, HologramDebugInfo> entry : hologramsDebugInfo.entrySet()) {
|
||||
StandardHologram hologram = entry.getKey();
|
||||
HologramDebugInfo debugInfo = entry.getValue();
|
||||
sender.sendMessage(Colors.PRIMARY_SHADOW + "- '" + hologram.toFormattedString() + "': " + hologram.getLinesAmount() + " lines, "
|
||||
sender.sendMessage(Colors.PRIMARY_SHADOW + "- '" + hologram.toFormattedString() + "': " + hologram.getLineCount() + " lines, "
|
||||
+ debugInfo.getTotalEntities() + " entities (" + debugInfo.aliveEntities + " alive, " + debugInfo.deadEntities + " dead)");
|
||||
}
|
||||
}
|
||||
|
@ -47,9 +47,9 @@ public class InsertlineCommand extends LineEditingCommand implements QuickEditCo
|
||||
int insertAfterIndex = CommandValidate.parseInteger(args[1]);
|
||||
String serializedLine = Strings.joinFrom(" ", args, 2);
|
||||
|
||||
int oldLinesAmount = hologram.getLinesAmount();
|
||||
int oldLinesAmount = hologram.getLineCount();
|
||||
|
||||
CommandValidate.check(insertAfterIndex >= 0 && insertAfterIndex <= oldLinesAmount, "The number must be between 0 and " + hologram.getLinesAmount() + "(amount of lines of the hologram).");
|
||||
CommandValidate.check(insertAfterIndex >= 0 && insertAfterIndex <= oldLinesAmount, "The number must be between 0 and " + hologram.getLineCount() + "(amount of lines of the hologram).");
|
||||
|
||||
InternalHologramLine line = HologramCommandValidate.parseHologramLine(hologram, serializedLine);
|
||||
hologram.insertLine(insertAfterIndex, line);
|
||||
|
@ -58,7 +58,7 @@ public class ListCommand extends HologramSubCommand {
|
||||
+ " " + Colors.SECONDARY_SHADOW + "at x: " + (int) hologram.getX()
|
||||
+ ", y: " + (int) hologram.getY()
|
||||
+ ", z: " + (int) hologram.getZ()
|
||||
+ " (lines: " + hologram.getLinesAmount() + ", world: \"" + hologram.getWorld().getName() + "\")");
|
||||
+ " (lines: " + hologram.getLineCount() + ", world: \"" + hologram.getWorld().getName() + "\")");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -53,7 +53,7 @@ public class NearCommand extends HologramSubCommand {
|
||||
|
||||
Messages.sendTitle(player, "Near holograms");
|
||||
for (InternalHologram nearHologram : nearHolograms) {
|
||||
player.sendMessage(Colors.SECONDARY_SHADOW + "- " + Colors.SECONDARY + Colors.BOLD + nearHologram.getName() + " " + Colors.SECONDARY_SHADOW + "at x: " + (int) nearHologram.getX() + ", y: " + (int) nearHologram.getY() + ", z: " + (int) nearHologram.getZ() + " (lines: " + nearHologram.getLinesAmount() + ")");
|
||||
player.sendMessage(Colors.SECONDARY_SHADOW + "- " + Colors.SECONDARY + Colors.BOLD + nearHologram.getName() + " " + Colors.SECONDARY_SHADOW + "at x: " + (int) nearHologram.getX() + ", y: " + (int) nearHologram.getY() + ", z: " + (int) nearHologram.getZ() + " (lines: " + nearHologram.getLineCount() + ")");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -41,10 +41,10 @@ public class RemovelineCommand extends LineEditingCommand implements QuickEditCo
|
||||
|
||||
int lineNumber = CommandValidate.parseInteger(args[1]);
|
||||
|
||||
CommandValidate.check(lineNumber >= 1 && lineNumber <= hologram.getLinesAmount(), "The line number must be between 1 and " + hologram.getLinesAmount() + ".");
|
||||
CommandValidate.check(lineNumber >= 1 && lineNumber <= hologram.getLineCount(), "The line number must be between 1 and " + hologram.getLineCount() + ".");
|
||||
int index = lineNumber - 1;
|
||||
|
||||
CommandValidate.check(hologram.getLinesAmount() > 1, "The hologram should have at least 1 line. If you want to delete it, use /" + context.getRootLabel() + " delete.");
|
||||
CommandValidate.check(hologram.getLineCount() > 1, "The hologram should have at least 1 line. If you want to delete it, use /" + context.getRootLabel() + " delete.");
|
||||
|
||||
hologram.removeLine(index);
|
||||
|
||||
|
@ -43,7 +43,7 @@ public class SetlineCommand extends LineEditingCommand implements QuickEditComma
|
||||
String serializedLine = Strings.joinFrom(" ", args, 2);
|
||||
|
||||
int lineNumber = CommandValidate.parseInteger(args[1]);
|
||||
CommandValidate.check(lineNumber >= 1 && lineNumber <= hologram.getLinesAmount(), "The line number must be between 1 and " + hologram.getLinesAmount() + ".");
|
||||
CommandValidate.check(lineNumber >= 1 && lineNumber <= hologram.getLineCount(), "The line number must be between 1 and " + hologram.getLineCount() + ".");
|
||||
int index = lineNumber - 1;
|
||||
|
||||
InternalHologramLine line = HologramCommandValidate.parseHologramLine(hologram, serializedLine);
|
||||
|
@ -61,7 +61,7 @@ public class V2HologramAdapter implements Hologram {
|
||||
|
||||
@Override
|
||||
public int size() {
|
||||
return newHologram.size();
|
||||
return newHologram.getLineCount();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -52,7 +52,7 @@ public class V2HologramsAPIProvider extends HologramsAPIProvider {
|
||||
List<Hologram> ownedHolograms = new ArrayList<>();
|
||||
|
||||
for (APIHologram hologram : apiHologramManager.getHolograms()) {
|
||||
if (hologram.getOwnerPlugin().equals(plugin)) {
|
||||
if (hologram.getCreatorPlugin().equals(plugin)) {
|
||||
ownedHolograms.add(hologram.getV2Adapter());
|
||||
}
|
||||
}
|
||||
|
@ -40,7 +40,7 @@ public class APIHologram extends BaseHologram<APIHologramLine> implements Hologr
|
||||
}
|
||||
|
||||
@Override
|
||||
public Plugin getOwnerPlugin() {
|
||||
public Plugin getCreatorPlugin() {
|
||||
return plugin;
|
||||
}
|
||||
|
||||
@ -89,11 +89,6 @@ public class APIHologram extends BaseHologram<APIHologramLine> implements Hologr
|
||||
return getLines().get(index);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int size() {
|
||||
return getLinesAmount();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAllowPlaceholders(boolean allowPlaceholders) {
|
||||
if (this.allowPlaceholders == allowPlaceholders) {
|
||||
|
@ -37,7 +37,7 @@ public class APIHologramManager extends BaseHologramManager<APIHologram> {
|
||||
List<Hologram> ownedHolograms = new ArrayList<>();
|
||||
|
||||
for (APIHologram hologram : getHolograms()) {
|
||||
if (hologram.getOwnerPlugin().equals(plugin)) {
|
||||
if (hologram.getCreatorPlugin().equals(plugin)) {
|
||||
ownedHolograms.add(hologram);
|
||||
}
|
||||
}
|
||||
|
@ -129,7 +129,7 @@ public abstract class BaseHologram<T extends StandardHologramLine> extends BaseH
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getLinesAmount() {
|
||||
public int getLineCount() {
|
||||
return lines.size();
|
||||
}
|
||||
|
||||
|
@ -40,7 +40,7 @@ public abstract class BaseItemLine extends BaseTouchableLine implements Standard
|
||||
try {
|
||||
pickupHandler.onPickup(player);
|
||||
} catch (Throwable t) {
|
||||
Log.warning("The plugin " + getHologram().getOwnerPlugin().getName() + " generated an exception"
|
||||
Log.warning("The plugin " + getHologram().getCreatorPlugin().getName() + " generated an exception"
|
||||
+ " when the player " + player.getName() + " picked up an item from a hologram.", t);
|
||||
}
|
||||
}
|
||||
|
@ -56,7 +56,7 @@ public abstract class BaseTouchableLine extends BaseHologramLine implements Stan
|
||||
try {
|
||||
touchHandler.onTouch(player);
|
||||
} catch (Throwable t) {
|
||||
Log.warning("The plugin " + getHologram().getOwnerPlugin().getName() + " generated an exception"
|
||||
Log.warning("The plugin " + getHologram().getCreatorPlugin().getName() + " generated an exception"
|
||||
+ " when the player " + player.getName() + " touched a hologram.", t);
|
||||
}
|
||||
}
|
||||
|
@ -36,7 +36,7 @@ public class InternalHologram extends BaseHologram<InternalHologramLine> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Plugin getOwnerPlugin() {
|
||||
public Plugin getCreatorPlugin() {
|
||||
return HolographicDisplays.getInstance();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user