Rearrange API classes

This commit is contained in:
filoghost 2021-07-08 08:48:27 +02:00
parent 1871fbc8b7
commit 41e54d801e
30 changed files with 41 additions and 45 deletions

View File

@ -5,6 +5,7 @@
*/
package me.filoghost.holographicdisplays.api;
import me.filoghost.holographicdisplays.api.hologram.Hologram;
import me.filoghost.holographicdisplays.api.internal.HolographicDisplaysAPIProvider;
import me.filoghost.holographicdisplays.api.placeholder.PlaceholderReplacer;
import org.bukkit.Location;

View File

@ -3,9 +3,8 @@
*
* SPDX-License-Identifier: GPL-3.0-or-later
*/
package me.filoghost.holographicdisplays.api.line;
package me.filoghost.holographicdisplays.api.hologram;
import me.filoghost.holographicdisplays.api.handler.PickupHandler;
import org.jetbrains.annotations.Nullable;
/**

View File

@ -3,11 +3,9 @@
*
* SPDX-License-Identifier: GPL-3.0-or-later
*/
package me.filoghost.holographicdisplays.api;
package me.filoghost.holographicdisplays.api.hologram;
import me.filoghost.holographicdisplays.api.line.HologramLine;
import me.filoghost.holographicdisplays.api.line.ItemLine;
import me.filoghost.holographicdisplays.api.line.TextLine;
import me.filoghost.holographicdisplays.api.HolographicDisplaysAPI;
import org.bukkit.Location;
import org.bukkit.World;
import org.bukkit.inventory.ItemStack;

View File

@ -3,9 +3,8 @@
*
* SPDX-License-Identifier: GPL-3.0-or-later
*/
package me.filoghost.holographicdisplays.api.line;
package me.filoghost.holographicdisplays.api.hologram;
import me.filoghost.holographicdisplays.api.Hologram;
import org.jetbrains.annotations.NotNull;
/**

View File

@ -3,7 +3,7 @@
*
* SPDX-License-Identifier: GPL-3.0-or-later
*/
package me.filoghost.holographicdisplays.api.line;
package me.filoghost.holographicdisplays.api.hologram;
import org.bukkit.inventory.ItemStack;
import org.jetbrains.annotations.Nullable;

View File

@ -3,7 +3,7 @@
*
* SPDX-License-Identifier: GPL-3.0-or-later
*/
package me.filoghost.holographicdisplays.api.handler;
package me.filoghost.holographicdisplays.api.hologram;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;

View File

@ -3,7 +3,7 @@
*
* SPDX-License-Identifier: GPL-3.0-or-later
*/
package me.filoghost.holographicdisplays.api.line;
package me.filoghost.holographicdisplays.api.hologram;
import org.jetbrains.annotations.Nullable;

View File

@ -3,7 +3,7 @@
*
* SPDX-License-Identifier: GPL-3.0-or-later
*/
package me.filoghost.holographicdisplays.api.handler;
package me.filoghost.holographicdisplays.api.hologram;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;

View File

@ -3,9 +3,8 @@
*
* SPDX-License-Identifier: GPL-3.0-or-later
*/
package me.filoghost.holographicdisplays.api.line;
package me.filoghost.holographicdisplays.api.hologram;
import me.filoghost.holographicdisplays.api.handler.TouchHandler;
import org.jetbrains.annotations.Nullable;
/**

View File

@ -3,7 +3,7 @@
*
* SPDX-License-Identifier: GPL-3.0-or-later
*/
package me.filoghost.holographicdisplays.api;
package me.filoghost.holographicdisplays.api.hologram;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;

View File

@ -5,8 +5,8 @@
*/
package me.filoghost.example.deathholograms;
import me.filoghost.holographicdisplays.api.Hologram;
import me.filoghost.holographicdisplays.api.HolographicDisplaysAPI;
import me.filoghost.holographicdisplays.api.hologram.Hologram;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.event.EventHandler;

View File

@ -5,9 +5,9 @@
*/
package me.filoghost.example.powerups;
import me.filoghost.holographicdisplays.api.Hologram;
import me.filoghost.holographicdisplays.api.HolographicDisplaysAPI;
import me.filoghost.holographicdisplays.api.line.ItemLine;
import me.filoghost.holographicdisplays.api.hologram.Hologram;
import me.filoghost.holographicdisplays.api.hologram.ItemLine;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Effect;

View File

@ -6,8 +6,8 @@
package me.filoghost.holographicdisplays.plugin.api.current;
import me.filoghost.fcommons.Preconditions;
import me.filoghost.holographicdisplays.api.Hologram;
import me.filoghost.holographicdisplays.api.HolographicDisplaysAPI;
import me.filoghost.holographicdisplays.api.hologram.Hologram;
import me.filoghost.holographicdisplays.api.placeholder.PlaceholderReplacer;
import me.filoghost.holographicdisplays.plugin.hologram.api.APIHologramManager;
import me.filoghost.holographicdisplays.plugin.placeholder.registry.PlaceholderRegistry;

View File

@ -10,7 +10,7 @@ import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
@SuppressWarnings("deprecation")
public class NewPickupHandlerAdapter implements me.filoghost.holographicdisplays.api.handler.PickupHandler {
public class NewPickupHandlerAdapter implements me.filoghost.holographicdisplays.api.hologram.PickupHandler {
private final PickupHandler v2PickupHandler;

View File

@ -10,7 +10,7 @@ import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
@SuppressWarnings("deprecation")
public class NewTouchHandlerAdapter implements me.filoghost.holographicdisplays.api.handler.TouchHandler {
public class NewTouchHandlerAdapter implements me.filoghost.holographicdisplays.api.hologram.TouchHandler {
private final TouchHandler v2TouchHandler;

View File

@ -22,8 +22,8 @@ public class V2ItemLineAdapter extends V2TouchableLineAdapter implements ItemLin
}
public void onNewPickupHandlerChange(
me.filoghost.holographicdisplays.api.handler.PickupHandler previous,
me.filoghost.holographicdisplays.api.handler.PickupHandler current) {
me.filoghost.holographicdisplays.api.hologram.PickupHandler previous,
me.filoghost.holographicdisplays.api.hologram.PickupHandler current) {
if (previous != current) {
v2PickupHandler = null; // Clear the field to force a new lazy initialization
}
@ -37,7 +37,7 @@ public class V2ItemLineAdapter extends V2TouchableLineAdapter implements ItemLin
// Adapter created from the getPickupHandler() method, simply unwrap it
newItemLine.setPickupHandler(((V2PickupHandlerAdapter) v2PickupHandler).getNewPickupHandler());
} else {
me.filoghost.holographicdisplays.api.handler.PickupHandler newPickupHandler = newItemLine.getPickupHandler();
me.filoghost.holographicdisplays.api.hologram.PickupHandler newPickupHandler = newItemLine.getPickupHandler();
// Adapt the old v2 handler to the new API, creating a new instance only if the wrapped handler changed
if (!(newPickupHandler instanceof NewPickupHandlerAdapter)
@ -52,7 +52,7 @@ public class V2ItemLineAdapter extends V2TouchableLineAdapter implements ItemLin
public PickupHandler getPickupHandler() {
// Lazy initialization
if (v2PickupHandler == null) {
me.filoghost.holographicdisplays.api.handler.PickupHandler newPickupHandler = newItemLine.getPickupHandler();
me.filoghost.holographicdisplays.api.hologram.PickupHandler newPickupHandler = newItemLine.getPickupHandler();
if (newPickupHandler == null) {
// Keep it null

View File

@ -5,7 +5,7 @@
*/
package me.filoghost.holographicdisplays.plugin.api.v2;
import me.filoghost.holographicdisplays.api.handler.PickupHandler;
import me.filoghost.holographicdisplays.api.hologram.PickupHandler;
import org.bukkit.entity.Player;
@SuppressWarnings("deprecation")

View File

@ -5,7 +5,7 @@
*/
package me.filoghost.holographicdisplays.plugin.api.v2;
import me.filoghost.holographicdisplays.api.handler.TouchHandler;
import me.filoghost.holographicdisplays.api.hologram.TouchHandler;
import org.bukkit.entity.Player;
@SuppressWarnings("deprecation")

View File

@ -21,8 +21,8 @@ abstract class V2TouchableLineAdapter extends V2HologramLineAdapter implements T
}
public void onNewTouchHandlerChange(
me.filoghost.holographicdisplays.api.handler.TouchHandler previous,
me.filoghost.holographicdisplays.api.handler.TouchHandler current) {
me.filoghost.holographicdisplays.api.hologram.TouchHandler previous,
me.filoghost.holographicdisplays.api.hologram.TouchHandler current) {
if (previous != current) {
v2TouchHandler = null; // Clear the field to force a new lazy initialization
}
@ -36,7 +36,7 @@ abstract class V2TouchableLineAdapter extends V2HologramLineAdapter implements T
// Adapter created from the getTouchHandler() method, simply unwrap it
newTouchableLine.setTouchHandler(((V2TouchHandlerAdapter) v2TouchHandler).getNewTouchHandler());
} else {
me.filoghost.holographicdisplays.api.handler.TouchHandler newTouchHandler = newTouchableLine.getTouchHandler();
me.filoghost.holographicdisplays.api.hologram.TouchHandler newTouchHandler = newTouchableLine.getTouchHandler();
// Adapt the old v2 handler to the new API, creating a new instance only if the wrapped handler changed
if (!(newTouchHandler instanceof NewTouchHandlerAdapter)
@ -51,7 +51,7 @@ abstract class V2TouchableLineAdapter extends V2HologramLineAdapter implements T
public TouchHandler getTouchHandler() {
// Lazy initialization
if (v2TouchHandler == null) {
me.filoghost.holographicdisplays.api.handler.TouchHandler newTouchHandler = newTouchableLine.getTouchHandler();
me.filoghost.holographicdisplays.api.hologram.TouchHandler newTouchHandler = newTouchableLine.getTouchHandler();
if (newTouchHandler == null) {
// Keep it null

View File

@ -6,7 +6,7 @@
package me.filoghost.holographicdisplays.plugin.api.v2;
import com.gmail.filoghost.holographicdisplays.api.VisibilityManager;
import me.filoghost.holographicdisplays.api.VisibilitySettings.Visibility;
import me.filoghost.holographicdisplays.api.hologram.VisibilitySettings.Visibility;
import me.filoghost.holographicdisplays.plugin.hologram.api.DefaultVisibilitySettings;
import org.bukkit.entity.Player;

View File

@ -6,7 +6,7 @@
package me.filoghost.holographicdisplays.plugin.hologram.api;
import me.filoghost.fcommons.Preconditions;
import me.filoghost.holographicdisplays.api.Hologram;
import me.filoghost.holographicdisplays.api.hologram.Hologram;
import me.filoghost.holographicdisplays.common.nms.NMSManager;
import me.filoghost.holographicdisplays.plugin.api.v2.V2HologramAdapter;
import me.filoghost.holographicdisplays.plugin.disk.Settings;

View File

@ -5,7 +5,7 @@
*/
package me.filoghost.holographicdisplays.plugin.hologram.api;
import me.filoghost.holographicdisplays.api.line.HologramLine;
import me.filoghost.holographicdisplays.api.hologram.HologramLine;
import me.filoghost.holographicdisplays.common.hologram.StandardHologramLine;
import me.filoghost.holographicdisplays.plugin.api.v2.V2HologramLineAdapter;
import org.jetbrains.annotations.NotNull;

View File

@ -5,7 +5,7 @@
*/
package me.filoghost.holographicdisplays.plugin.hologram.api;
import me.filoghost.holographicdisplays.api.Hologram;
import me.filoghost.holographicdisplays.api.hologram.Hologram;
import me.filoghost.holographicdisplays.common.nms.NMSManager;
import me.filoghost.holographicdisplays.plugin.hologram.base.BaseHologramManager;
import me.filoghost.holographicdisplays.plugin.placeholder.tracking.PlaceholderLineTracker;

View File

@ -5,9 +5,9 @@
*/
package me.filoghost.holographicdisplays.plugin.hologram.api;
import me.filoghost.holographicdisplays.api.handler.PickupHandler;
import me.filoghost.holographicdisplays.api.handler.TouchHandler;
import me.filoghost.holographicdisplays.api.line.ItemLine;
import me.filoghost.holographicdisplays.api.hologram.PickupHandler;
import me.filoghost.holographicdisplays.api.hologram.TouchHandler;
import me.filoghost.holographicdisplays.api.hologram.ItemLine;
import me.filoghost.holographicdisplays.plugin.api.v2.V2ItemLineAdapter;
import me.filoghost.holographicdisplays.plugin.hologram.base.BaseItemLine;
import org.bukkit.inventory.ItemStack;

View File

@ -5,8 +5,8 @@
*/
package me.filoghost.holographicdisplays.plugin.hologram.api;
import me.filoghost.holographicdisplays.api.handler.TouchHandler;
import me.filoghost.holographicdisplays.api.line.TextLine;
import me.filoghost.holographicdisplays.api.hologram.TouchHandler;
import me.filoghost.holographicdisplays.api.hologram.TextLine;
import me.filoghost.holographicdisplays.plugin.api.v2.V2TextLineAdapter;
import me.filoghost.holographicdisplays.plugin.hologram.base.BaseTextLine;
import org.jetbrains.annotations.NotNull;

View File

@ -5,7 +5,7 @@
*/
package me.filoghost.holographicdisplays.plugin.hologram.api;
import me.filoghost.holographicdisplays.api.line.TouchableLine;
import me.filoghost.holographicdisplays.api.hologram.TouchableLine;
public interface APITouchableLine extends TouchableLine, APIHologramLine {

View File

@ -6,7 +6,7 @@
package me.filoghost.holographicdisplays.plugin.hologram.api;
import me.filoghost.fcommons.Preconditions;
import me.filoghost.holographicdisplays.api.VisibilitySettings;
import me.filoghost.holographicdisplays.api.hologram.VisibilitySettings;
import me.filoghost.holographicdisplays.common.hologram.StandardHologram;
import me.filoghost.holographicdisplays.plugin.api.v2.V2VisibilityManagerAdapter;
import me.filoghost.holographicdisplays.plugin.bridge.protocollib.ProtocolLibHook;

View File

@ -7,7 +7,7 @@ package me.filoghost.holographicdisplays.plugin.hologram.base;
import me.filoghost.fcommons.Preconditions;
import me.filoghost.fcommons.logging.Log;
import me.filoghost.holographicdisplays.api.handler.PickupHandler;
import me.filoghost.holographicdisplays.api.hologram.PickupHandler;
import me.filoghost.holographicdisplays.common.DebugLogger;
import me.filoghost.holographicdisplays.common.hologram.StandardItemLine;
import me.filoghost.holographicdisplays.common.nms.SpawnFailedException;

View File

@ -6,7 +6,7 @@
package me.filoghost.holographicdisplays.plugin.hologram.base;
import me.filoghost.fcommons.logging.Log;
import me.filoghost.holographicdisplays.api.handler.TouchHandler;
import me.filoghost.holographicdisplays.api.hologram.TouchHandler;
import me.filoghost.holographicdisplays.common.DebugLogger;
import me.filoghost.holographicdisplays.common.hologram.StandardTouchableLine;
import me.filoghost.holographicdisplays.common.nms.SpawnFailedException;

View File

@ -6,7 +6,7 @@
package me.filoghost.holographicdisplays.plugin.api.v2;
import com.gmail.filoghost.holographicdisplays.api.line.TextLine;
import me.filoghost.holographicdisplays.api.handler.TouchHandler;
import me.filoghost.holographicdisplays.api.hologram.TouchHandler;
import me.filoghost.holographicdisplays.plugin.hologram.api.APIHologram;
import me.filoghost.holographicdisplays.plugin.hologram.api.APITextLine;
import org.bukkit.entity.Player;