diff --git a/legacy/pom.xml b/legacy-v1/pom.xml similarity index 88% rename from legacy/pom.xml rename to legacy-v1/pom.xml index d4167803..315fe811 100644 --- a/legacy/pom.xml +++ b/legacy-v1/pom.xml @@ -1,39 +1,39 @@ - - - 4.0.0 - - - me.filoghost.holographicdisplays - holographicdisplays-parent - 3.0.0-SNAPSHOT - - - holographicdisplays-legacy - HolographicDisplays Legacy - - - - spigot-repo - https://hub.spigotmc.org/nexus/content/repositories/snapshots/ - - - - - - ${project.groupId} - holographicdisplays-api - - - - ${project.groupId} - holographicdisplays-utils - - - - org.spigotmc - spigot-api - - - - + + + 4.0.0 + + + me.filoghost.holographicdisplays + holographicdisplays-parent + 3.0.0-SNAPSHOT + + + holographicdisplays-legacy-v1 + HolographicDisplays Legacy v1 + + + + spigot-repo + https://hub.spigotmc.org/nexus/content/repositories/snapshots/ + + + + + + ${project.groupId} + holographicdisplays-api + + + + ${project.groupId} + holographicdisplays-utils + + + + org.spigotmc + spigot-api + + + + diff --git a/legacy/src/main/java/com/gmail/filoghost/holograms/api/FloatingItem.java b/legacy-v1/src/main/java/com/gmail/filoghost/holograms/api/FloatingItem.java similarity index 95% rename from legacy/src/main/java/com/gmail/filoghost/holograms/api/FloatingItem.java rename to legacy-v1/src/main/java/com/gmail/filoghost/holograms/api/FloatingItem.java index 4546948e..25b61489 100644 --- a/legacy/src/main/java/com/gmail/filoghost/holograms/api/FloatingItem.java +++ b/legacy-v1/src/main/java/com/gmail/filoghost/holograms/api/FloatingItem.java @@ -1,83 +1,83 @@ -/* - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package com.gmail.filoghost.holograms.api; - -import org.bukkit.Location; -import org.bukkit.World; -import org.bukkit.inventory.ItemStack; - -/** - * @deprecated Please use the new API! - */ -@Deprecated -public interface FloatingItem { - - @Deprecated - public boolean update(); - - @Deprecated - public void hide(); - - @Deprecated - public void setItemStack(ItemStack itemstack); - - @Deprecated - public ItemStack getItemStack(); - - @Deprecated - public Location getLocation(); - - @Deprecated - public double getX(); - - @Deprecated - public double getY(); - - @Deprecated - public double getZ(); - - @Deprecated - public World getWorld(); - - @Deprecated - public void teleport(Location location); - - @Deprecated - public void setTouchHandler(ItemTouchHandler handler); - - @Deprecated - public ItemTouchHandler getTouchHandler(); - - @Deprecated - public boolean hasTouchHandler(); - - @Deprecated - public void setPickupHandler(PickupHandler handler); - - @Deprecated - public PickupHandler getPickupHandler(); - - @Deprecated - public boolean hasPickupHandler(); - - @Deprecated - public long getCreationTimestamp(); - - @Deprecated - public void delete(); - - @Deprecated - public boolean isDeleted(); -} +/* + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package com.gmail.filoghost.holograms.api; + +import org.bukkit.Location; +import org.bukkit.World; +import org.bukkit.inventory.ItemStack; + +/** + * @deprecated Please use the new API! + */ +@Deprecated +public interface FloatingItem { + + @Deprecated + public boolean update(); + + @Deprecated + public void hide(); + + @Deprecated + public void setItemStack(ItemStack itemstack); + + @Deprecated + public ItemStack getItemStack(); + + @Deprecated + public Location getLocation(); + + @Deprecated + public double getX(); + + @Deprecated + public double getY(); + + @Deprecated + public double getZ(); + + @Deprecated + public World getWorld(); + + @Deprecated + public void teleport(Location location); + + @Deprecated + public void setTouchHandler(ItemTouchHandler handler); + + @Deprecated + public ItemTouchHandler getTouchHandler(); + + @Deprecated + public boolean hasTouchHandler(); + + @Deprecated + public void setPickupHandler(PickupHandler handler); + + @Deprecated + public PickupHandler getPickupHandler(); + + @Deprecated + public boolean hasPickupHandler(); + + @Deprecated + public long getCreationTimestamp(); + + @Deprecated + public void delete(); + + @Deprecated + public boolean isDeleted(); +} diff --git a/legacy/src/main/java/com/gmail/filoghost/holograms/api/Hologram.java b/legacy-v1/src/main/java/com/gmail/filoghost/holograms/api/Hologram.java similarity index 95% rename from legacy/src/main/java/com/gmail/filoghost/holograms/api/Hologram.java rename to legacy-v1/src/main/java/com/gmail/filoghost/holograms/api/Hologram.java index c1fca823..c1cddd2d 100644 --- a/legacy/src/main/java/com/gmail/filoghost/holograms/api/Hologram.java +++ b/legacy-v1/src/main/java/com/gmail/filoghost/holograms/api/Hologram.java @@ -1,92 +1,92 @@ -/* - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package com.gmail.filoghost.holograms.api; - -import org.bukkit.Location; -import org.bukkit.World; - -/** - * @deprecated Please use the new API! - */ -@Deprecated -public interface Hologram { - - @Deprecated - public boolean update(); - - @Deprecated - public void hide(); - - @Deprecated - public void addLine(String text); - - @Deprecated - public void removeLine(int index); - - @Deprecated - public void setLine(int index, String text); - - @Deprecated - public void insertLine(int index, String text); - - @Deprecated - public String[] getLines(); - - @Deprecated - public int getLinesLength(); - - @Deprecated - public void clearLines(); - - @Deprecated - public Location getLocation(); - - @Deprecated - public double getX(); - - @Deprecated - public double getY(); - - @Deprecated - public double getZ(); - - @Deprecated - public World getWorld(); - - @Deprecated - public void setLocation(Location location); - - @Deprecated - public void teleport(Location location); - - @Deprecated - public void setTouchHandler(TouchHandler handler); - - @Deprecated - public TouchHandler getTouchHandler(); - - @Deprecated - public boolean hasTouchHandler(); - - @Deprecated - public long getCreationTimestamp(); - - @Deprecated - public void delete(); - - @Deprecated - public boolean isDeleted(); - -} +/* + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package com.gmail.filoghost.holograms.api; + +import org.bukkit.Location; +import org.bukkit.World; + +/** + * @deprecated Please use the new API! + */ +@Deprecated +public interface Hologram { + + @Deprecated + public boolean update(); + + @Deprecated + public void hide(); + + @Deprecated + public void addLine(String text); + + @Deprecated + public void removeLine(int index); + + @Deprecated + public void setLine(int index, String text); + + @Deprecated + public void insertLine(int index, String text); + + @Deprecated + public String[] getLines(); + + @Deprecated + public int getLinesLength(); + + @Deprecated + public void clearLines(); + + @Deprecated + public Location getLocation(); + + @Deprecated + public double getX(); + + @Deprecated + public double getY(); + + @Deprecated + public double getZ(); + + @Deprecated + public World getWorld(); + + @Deprecated + public void setLocation(Location location); + + @Deprecated + public void teleport(Location location); + + @Deprecated + public void setTouchHandler(TouchHandler handler); + + @Deprecated + public TouchHandler getTouchHandler(); + + @Deprecated + public boolean hasTouchHandler(); + + @Deprecated + public long getCreationTimestamp(); + + @Deprecated + public void delete(); + + @Deprecated + public boolean isDeleted(); + +} diff --git a/legacy/src/main/java/com/gmail/filoghost/holograms/api/HolographicDisplaysAPI.java b/legacy-v1/src/main/java/com/gmail/filoghost/holograms/api/HolographicDisplaysAPI.java similarity index 97% rename from legacy/src/main/java/com/gmail/filoghost/holograms/api/HolographicDisplaysAPI.java rename to legacy-v1/src/main/java/com/gmail/filoghost/holograms/api/HolographicDisplaysAPI.java index dda3db79..b2fa535f 100644 --- a/legacy/src/main/java/com/gmail/filoghost/holograms/api/HolographicDisplaysAPI.java +++ b/legacy-v1/src/main/java/com/gmail/filoghost/holograms/api/HolographicDisplaysAPI.java @@ -1,167 +1,167 @@ -/* - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package com.gmail.filoghost.holograms.api; - -import com.gmail.filoghost.holograms.api.adapter.FloatingItemAdapter; -import com.gmail.filoghost.holograms.api.adapter.HologramAdapter; -import me.filoghost.holographicdisplays.api.HologramsAPI; -import me.filoghost.holographicdisplays.api.line.ItemLine; -import me.filoghost.holographicdisplays.util.Validator; -import org.bukkit.Bukkit; -import org.bukkit.ChatColor; -import org.bukkit.Location; -import org.bukkit.Material; -import org.bukkit.entity.Entity; -import org.bukkit.entity.Player; -import org.bukkit.inventory.ItemStack; -import org.bukkit.plugin.Plugin; - -import java.util.Arrays; -import java.util.Collection; -import java.util.Collections; -import java.util.HashSet; -import java.util.List; -import java.util.Set; - -/** - * @deprecated Please use the new API! - */ -@Deprecated -public class HolographicDisplaysAPI { - - private static Set notifiedPlugins = new HashSet<>(); - - private static void notifyOldAPI(Plugin plugin) { - Validator.notNull(plugin, "plugin"); - - if (notifiedPlugins.add(plugin.getName())) { - Bukkit.getConsoleSender().sendMessage(ChatColor.RED + "[Holographic Displays] The plugin \"" + plugin.getName() + "\" is still using the old API of Holographic Displays. " - + "Please notify the author and ask them to update it, the old API will be removed soon."); - } - } - - @Deprecated - public static Hologram createHologram(Plugin plugin, Location source, String... lines) { - notifyOldAPI(plugin); - - validateLocation(source); - - me.filoghost.holographicdisplays.api.Hologram hologram = HologramsAPI.createHologram(plugin, source); - for (String line : lines) { - hologram.appendTextLine(line); - } - return new HologramAdapter(plugin, hologram); - } - - @Deprecated - public static FloatingItem createFloatingItem(Plugin plugin, Location source, ItemStack itemstack) { - notifyOldAPI(plugin); - - validateLocation(source); - validateItem(itemstack); - - me.filoghost.holographicdisplays.api.Hologram hologram = HologramsAPI.createHologram(plugin, source); - ItemLine itemLine = hologram.appendItemLine(itemstack); - return new FloatingItemAdapter(plugin, hologram, itemLine); - } - - @Deprecated - public static Hologram createIndividualHologram(Plugin plugin, Location source, Player whoCanSee, String... lines) { - notifyOldAPI(plugin); - - return createIndividualHologram(plugin, source, Arrays.asList(whoCanSee), lines); - } - - @Deprecated - public static Hologram createIndividualHologram(Plugin plugin, Location source, List whoCanSee, String... lines) { - notifyOldAPI(plugin); - - validateLocation(source); - - me.filoghost.holographicdisplays.api.Hologram hologram = HologramsAPI.createHologram(plugin, source); - - hologram.getVisibilityManager().setVisibleByDefault(false); - if (whoCanSee != null) { - for (Player player : whoCanSee) { - hologram.getVisibilityManager().showTo(player); - } - } - - for (String line : lines) { - hologram.appendTextLine(line); - } - - return new HologramAdapter(plugin, hologram); - } - - @Deprecated - public static FloatingItem createIndividualFloatingItem(Plugin plugin, Location source, Player whoCanSee, ItemStack itemstack) { - notifyOldAPI(plugin); - - return createIndividualFloatingItem(plugin, source, Arrays.asList(whoCanSee), itemstack); - } - - @Deprecated - public static FloatingItem createIndividualFloatingItem(Plugin plugin, Location source, List whoCanSee, ItemStack itemstack) { - notifyOldAPI(plugin); - - validateLocation(source); - validateItem(itemstack); - - me.filoghost.holographicdisplays.api.Hologram hologram = HologramsAPI.createHologram(plugin, source); - ItemLine itemLine = hologram.appendItemLine(itemstack); - - hologram.getVisibilityManager().setVisibleByDefault(false); - if (whoCanSee != null) { - for (Player player : whoCanSee) { - hologram.getVisibilityManager().showTo(player); - } - } - - return new FloatingItemAdapter(plugin, hologram, itemLine); - } - - @Deprecated - public static Hologram[] getHolograms(Plugin plugin) { - notifyOldAPI(plugin); - - Collection pluginHolograms = HologramAdapter.activeHolograms.getOrDefault(plugin, Collections.emptyList()); - return pluginHolograms.toArray(new HologramAdapter[0]); - } - - @Deprecated - public static FloatingItem[] getFloatingItems(Plugin plugin) { - notifyOldAPI(plugin); - - Collection pluginFloatingItems = FloatingItemAdapter.activeFloatingItems.getOrDefault(plugin, Collections.emptyList()); - return pluginFloatingItems.toArray(new FloatingItemAdapter[0]); - } - - @Deprecated - public static boolean isHologramEntity(Entity bukkitEntity) { - return HologramsAPI.isHologramEntity(bukkitEntity); - } - - private static void validateLocation(Location loc) { - Validator.notNull(loc, "location"); - Validator.notNull(loc.getWorld(), "location's world"); - } - - private static void validateItem(ItemStack itemstack) { - Validator.notNull(itemstack, "itemstack"); - Validator.isTrue(itemstack.getType() != Material.AIR, "itemstack cannot be AIR"); - } - -} +/* + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package com.gmail.filoghost.holograms.api; + +import com.gmail.filoghost.holograms.api.adapter.FloatingItemAdapter; +import com.gmail.filoghost.holograms.api.adapter.HologramAdapter; +import me.filoghost.holographicdisplays.api.HologramsAPI; +import me.filoghost.holographicdisplays.api.line.ItemLine; +import me.filoghost.holographicdisplays.util.Validator; +import org.bukkit.Bukkit; +import org.bukkit.ChatColor; +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.entity.Entity; +import org.bukkit.entity.Player; +import org.bukkit.inventory.ItemStack; +import org.bukkit.plugin.Plugin; + +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +/** + * @deprecated Please use the new API! + */ +@Deprecated +public class HolographicDisplaysAPI { + + private static Set notifiedPlugins = new HashSet<>(); + + private static void notifyOldAPI(Plugin plugin) { + Validator.notNull(plugin, "plugin"); + + if (notifiedPlugins.add(plugin.getName())) { + Bukkit.getConsoleSender().sendMessage(ChatColor.RED + "[Holographic Displays] The plugin \"" + plugin.getName() + "\" is still using the old API of Holographic Displays. " + + "Please notify the author and ask them to update it, the old API will be removed soon."); + } + } + + @Deprecated + public static Hologram createHologram(Plugin plugin, Location source, String... lines) { + notifyOldAPI(plugin); + + validateLocation(source); + + me.filoghost.holographicdisplays.api.Hologram hologram = HologramsAPI.createHologram(plugin, source); + for (String line : lines) { + hologram.appendTextLine(line); + } + return new HologramAdapter(plugin, hologram); + } + + @Deprecated + public static FloatingItem createFloatingItem(Plugin plugin, Location source, ItemStack itemstack) { + notifyOldAPI(plugin); + + validateLocation(source); + validateItem(itemstack); + + me.filoghost.holographicdisplays.api.Hologram hologram = HologramsAPI.createHologram(plugin, source); + ItemLine itemLine = hologram.appendItemLine(itemstack); + return new FloatingItemAdapter(plugin, hologram, itemLine); + } + + @Deprecated + public static Hologram createIndividualHologram(Plugin plugin, Location source, Player whoCanSee, String... lines) { + notifyOldAPI(plugin); + + return createIndividualHologram(plugin, source, Arrays.asList(whoCanSee), lines); + } + + @Deprecated + public static Hologram createIndividualHologram(Plugin plugin, Location source, List whoCanSee, String... lines) { + notifyOldAPI(plugin); + + validateLocation(source); + + me.filoghost.holographicdisplays.api.Hologram hologram = HologramsAPI.createHologram(plugin, source); + + hologram.getVisibilityManager().setVisibleByDefault(false); + if (whoCanSee != null) { + for (Player player : whoCanSee) { + hologram.getVisibilityManager().showTo(player); + } + } + + for (String line : lines) { + hologram.appendTextLine(line); + } + + return new HologramAdapter(plugin, hologram); + } + + @Deprecated + public static FloatingItem createIndividualFloatingItem(Plugin plugin, Location source, Player whoCanSee, ItemStack itemstack) { + notifyOldAPI(plugin); + + return createIndividualFloatingItem(plugin, source, Arrays.asList(whoCanSee), itemstack); + } + + @Deprecated + public static FloatingItem createIndividualFloatingItem(Plugin plugin, Location source, List whoCanSee, ItemStack itemstack) { + notifyOldAPI(plugin); + + validateLocation(source); + validateItem(itemstack); + + me.filoghost.holographicdisplays.api.Hologram hologram = HologramsAPI.createHologram(plugin, source); + ItemLine itemLine = hologram.appendItemLine(itemstack); + + hologram.getVisibilityManager().setVisibleByDefault(false); + if (whoCanSee != null) { + for (Player player : whoCanSee) { + hologram.getVisibilityManager().showTo(player); + } + } + + return new FloatingItemAdapter(plugin, hologram, itemLine); + } + + @Deprecated + public static Hologram[] getHolograms(Plugin plugin) { + notifyOldAPI(plugin); + + Collection pluginHolograms = HologramAdapter.activeHolograms.getOrDefault(plugin, Collections.emptyList()); + return pluginHolograms.toArray(new HologramAdapter[0]); + } + + @Deprecated + public static FloatingItem[] getFloatingItems(Plugin plugin) { + notifyOldAPI(plugin); + + Collection pluginFloatingItems = FloatingItemAdapter.activeFloatingItems.getOrDefault(plugin, Collections.emptyList()); + return pluginFloatingItems.toArray(new FloatingItemAdapter[0]); + } + + @Deprecated + public static boolean isHologramEntity(Entity bukkitEntity) { + return HologramsAPI.isHologramEntity(bukkitEntity); + } + + private static void validateLocation(Location loc) { + Validator.notNull(loc, "location"); + Validator.notNull(loc.getWorld(), "location's world"); + } + + private static void validateItem(ItemStack itemstack) { + Validator.notNull(itemstack, "itemstack"); + Validator.isTrue(itemstack.getType() != Material.AIR, "itemstack cannot be AIR"); + } + +} diff --git a/legacy/src/main/java/com/gmail/filoghost/holograms/api/ItemTouchHandler.java b/legacy-v1/src/main/java/com/gmail/filoghost/holograms/api/ItemTouchHandler.java similarity index 97% rename from legacy/src/main/java/com/gmail/filoghost/holograms/api/ItemTouchHandler.java rename to legacy-v1/src/main/java/com/gmail/filoghost/holograms/api/ItemTouchHandler.java index 8597e5e3..a9e4c087 100644 --- a/legacy/src/main/java/com/gmail/filoghost/holograms/api/ItemTouchHandler.java +++ b/legacy-v1/src/main/java/com/gmail/filoghost/holograms/api/ItemTouchHandler.java @@ -1,28 +1,28 @@ -/* - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package com.gmail.filoghost.holograms.api; - -import org.bukkit.entity.Player; - -/** - * @deprecated Please use the new API! - */ -@Deprecated -public interface ItemTouchHandler { - - @Deprecated - public void onTouch(FloatingItem floatingItem, Player player); - -} +/* + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package com.gmail.filoghost.holograms.api; + +import org.bukkit.entity.Player; + +/** + * @deprecated Please use the new API! + */ +@Deprecated +public interface ItemTouchHandler { + + @Deprecated + public void onTouch(FloatingItem floatingItem, Player player); + +} diff --git a/legacy/src/main/java/com/gmail/filoghost/holograms/api/PickupHandler.java b/legacy-v1/src/main/java/com/gmail/filoghost/holograms/api/PickupHandler.java similarity index 97% rename from legacy/src/main/java/com/gmail/filoghost/holograms/api/PickupHandler.java rename to legacy-v1/src/main/java/com/gmail/filoghost/holograms/api/PickupHandler.java index e3029b71..cbb3db51 100644 --- a/legacy/src/main/java/com/gmail/filoghost/holograms/api/PickupHandler.java +++ b/legacy-v1/src/main/java/com/gmail/filoghost/holograms/api/PickupHandler.java @@ -1,28 +1,28 @@ -/* - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package com.gmail.filoghost.holograms.api; - -import org.bukkit.entity.Player; - -/** - * @deprecated Please use the new API! - */ -@Deprecated -public interface PickupHandler { - - @Deprecated - public void onPickup(FloatingItem floatingItem, Player player); - -} +/* + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package com.gmail.filoghost.holograms.api; + +import org.bukkit.entity.Player; + +/** + * @deprecated Please use the new API! + */ +@Deprecated +public interface PickupHandler { + + @Deprecated + public void onPickup(FloatingItem floatingItem, Player player); + +} diff --git a/legacy/src/main/java/com/gmail/filoghost/holograms/api/TouchHandler.java b/legacy-v1/src/main/java/com/gmail/filoghost/holograms/api/TouchHandler.java similarity index 97% rename from legacy/src/main/java/com/gmail/filoghost/holograms/api/TouchHandler.java rename to legacy-v1/src/main/java/com/gmail/filoghost/holograms/api/TouchHandler.java index c39c074e..f7ea94a2 100644 --- a/legacy/src/main/java/com/gmail/filoghost/holograms/api/TouchHandler.java +++ b/legacy-v1/src/main/java/com/gmail/filoghost/holograms/api/TouchHandler.java @@ -1,28 +1,28 @@ -/* - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package com.gmail.filoghost.holograms.api; - -import org.bukkit.entity.Player; - -/** - * @deprecated Please use the new API! - */ -@Deprecated -public interface TouchHandler { - - @Deprecated - public void onTouch(Hologram hologram, Player player); - -} +/* + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package com.gmail.filoghost.holograms.api; + +import org.bukkit.entity.Player; + +/** + * @deprecated Please use the new API! + */ +@Deprecated +public interface TouchHandler { + + @Deprecated + public void onTouch(Hologram hologram, Player player); + +} diff --git a/legacy/src/main/java/com/gmail/filoghost/holograms/api/adapter/FloatingItemAdapter.java b/legacy-v1/src/main/java/com/gmail/filoghost/holograms/api/adapter/FloatingItemAdapter.java similarity index 95% rename from legacy/src/main/java/com/gmail/filoghost/holograms/api/adapter/FloatingItemAdapter.java rename to legacy-v1/src/main/java/com/gmail/filoghost/holograms/api/adapter/FloatingItemAdapter.java index 0622a247..44055567 100644 --- a/legacy/src/main/java/com/gmail/filoghost/holograms/api/adapter/FloatingItemAdapter.java +++ b/legacy-v1/src/main/java/com/gmail/filoghost/holograms/api/adapter/FloatingItemAdapter.java @@ -1,160 +1,160 @@ -/* - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package com.gmail.filoghost.holograms.api.adapter; - -import com.gmail.filoghost.holograms.api.FloatingItem; -import com.gmail.filoghost.holograms.api.ItemTouchHandler; -import com.gmail.filoghost.holograms.api.PickupHandler; -import me.filoghost.holographicdisplays.api.Hologram; -import me.filoghost.holographicdisplays.api.line.ItemLine; -import org.bukkit.Location; -import org.bukkit.World; -import org.bukkit.inventory.ItemStack; -import org.bukkit.plugin.Plugin; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.Map; - -@SuppressWarnings("deprecation") -public class FloatingItemAdapter implements FloatingItem { - - public static Map> activeFloatingItems = new HashMap<>(); - - private Plugin plugin; - public Hologram hologram; - private ItemLine itemLine; - private ItemTouchHandler touchHandler; - private PickupHandler pickupHandler; - - public FloatingItemAdapter(Plugin plugin, Hologram delegateHologram, ItemLine delegateItemLine) { - this.plugin = plugin; - this.hologram = delegateHologram; - this.itemLine = delegateItemLine; - - activeFloatingItems.computeIfAbsent(plugin, __ -> new ArrayList<>()).add(this); - } - - @Override - public boolean update() { - return true; - } - - @Override - public void hide() { - - } - - @Override - public void setItemStack(ItemStack itemstack) { - itemLine.setItemStack(itemstack); - } - - @Override - public ItemStack getItemStack() { - return itemLine.getItemStack(); - } - - @Override - public Location getLocation() { - return hologram.getLocation(); - } - - @Override - public double getX() { - return hologram.getX(); - } - - @Override - public double getY() { - return hologram.getY(); - } - - @Override - public double getZ() { - return hologram.getZ(); - } - - @Override - public World getWorld() { - return hologram.getWorld(); - } - - @Override - public void teleport(Location location) { - hologram.teleport(location); - } - - @Override - public void setTouchHandler(ItemTouchHandler handler) { - this.touchHandler = handler; - - if (handler != null) { - itemLine.setTouchHandler(new ItemTouchHandlerAdapter(this, handler)); - } else { - itemLine.setTouchHandler(null); - } - } - - @Override - public ItemTouchHandler getTouchHandler() { - return touchHandler; - } - - @Override - public boolean hasTouchHandler() { - return touchHandler != null; - } - - @Override - public void setPickupHandler(PickupHandler handler) { - this.pickupHandler = handler; - - if (handler != null) { - itemLine.setPickupHandler(new PickupHandlerAdapter(this, handler)); - } else { - itemLine.setPickupHandler(null); - } - } - - @Override - public PickupHandler getPickupHandler() { - return pickupHandler; - } - - @Override - public boolean hasPickupHandler() { - return pickupHandler != null; - } - - @Override - public long getCreationTimestamp() { - return hologram.getCreationTimestamp(); - } - - @Override - public void delete() { - hologram.delete(); - - activeFloatingItems.get(plugin).remove(this); - } - - @Override - public boolean isDeleted() { - return hologram.isDeleted(); - } - -} +/* + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package com.gmail.filoghost.holograms.api.adapter; + +import com.gmail.filoghost.holograms.api.FloatingItem; +import com.gmail.filoghost.holograms.api.ItemTouchHandler; +import com.gmail.filoghost.holograms.api.PickupHandler; +import me.filoghost.holographicdisplays.api.Hologram; +import me.filoghost.holographicdisplays.api.line.ItemLine; +import org.bukkit.Location; +import org.bukkit.World; +import org.bukkit.inventory.ItemStack; +import org.bukkit.plugin.Plugin; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.Map; + +@SuppressWarnings("deprecation") +public class FloatingItemAdapter implements FloatingItem { + + public static Map> activeFloatingItems = new HashMap<>(); + + private Plugin plugin; + public Hologram hologram; + private ItemLine itemLine; + private ItemTouchHandler touchHandler; + private PickupHandler pickupHandler; + + public FloatingItemAdapter(Plugin plugin, Hologram delegateHologram, ItemLine delegateItemLine) { + this.plugin = plugin; + this.hologram = delegateHologram; + this.itemLine = delegateItemLine; + + activeFloatingItems.computeIfAbsent(plugin, __ -> new ArrayList<>()).add(this); + } + + @Override + public boolean update() { + return true; + } + + @Override + public void hide() { + + } + + @Override + public void setItemStack(ItemStack itemstack) { + itemLine.setItemStack(itemstack); + } + + @Override + public ItemStack getItemStack() { + return itemLine.getItemStack(); + } + + @Override + public Location getLocation() { + return hologram.getLocation(); + } + + @Override + public double getX() { + return hologram.getX(); + } + + @Override + public double getY() { + return hologram.getY(); + } + + @Override + public double getZ() { + return hologram.getZ(); + } + + @Override + public World getWorld() { + return hologram.getWorld(); + } + + @Override + public void teleport(Location location) { + hologram.teleport(location); + } + + @Override + public void setTouchHandler(ItemTouchHandler handler) { + this.touchHandler = handler; + + if (handler != null) { + itemLine.setTouchHandler(new ItemTouchHandlerAdapter(this, handler)); + } else { + itemLine.setTouchHandler(null); + } + } + + @Override + public ItemTouchHandler getTouchHandler() { + return touchHandler; + } + + @Override + public boolean hasTouchHandler() { + return touchHandler != null; + } + + @Override + public void setPickupHandler(PickupHandler handler) { + this.pickupHandler = handler; + + if (handler != null) { + itemLine.setPickupHandler(new PickupHandlerAdapter(this, handler)); + } else { + itemLine.setPickupHandler(null); + } + } + + @Override + public PickupHandler getPickupHandler() { + return pickupHandler; + } + + @Override + public boolean hasPickupHandler() { + return pickupHandler != null; + } + + @Override + public long getCreationTimestamp() { + return hologram.getCreationTimestamp(); + } + + @Override + public void delete() { + hologram.delete(); + + activeFloatingItems.get(plugin).remove(this); + } + + @Override + public boolean isDeleted() { + return hologram.isDeleted(); + } + +} diff --git a/legacy/src/main/java/com/gmail/filoghost/holograms/api/adapter/HologramAdapter.java b/legacy-v1/src/main/java/com/gmail/filoghost/holograms/api/adapter/HologramAdapter.java similarity index 95% rename from legacy/src/main/java/com/gmail/filoghost/holograms/api/adapter/HologramAdapter.java rename to legacy-v1/src/main/java/com/gmail/filoghost/holograms/api/adapter/HologramAdapter.java index 0fb12bd3..65dc21c0 100644 --- a/legacy/src/main/java/com/gmail/filoghost/holograms/api/adapter/HologramAdapter.java +++ b/legacy-v1/src/main/java/com/gmail/filoghost/holograms/api/adapter/HologramAdapter.java @@ -1,201 +1,201 @@ -/* - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package com.gmail.filoghost.holograms.api.adapter; - -import com.gmail.filoghost.holograms.api.Hologram; -import com.gmail.filoghost.holograms.api.TouchHandler; -import me.filoghost.holographicdisplays.api.line.HologramLine; -import me.filoghost.holographicdisplays.api.line.TextLine; -import me.filoghost.holographicdisplays.api.line.TouchableLine; -import org.bukkit.Location; -import org.bukkit.World; -import org.bukkit.plugin.Plugin; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.Map; - -@SuppressWarnings("deprecation") -public class HologramAdapter implements Hologram { - - public static Map> activeHolograms = new HashMap<>(); - - private Plugin plugin; - private me.filoghost.holographicdisplays.api.Hologram hologram; - private TouchHandler touchHandler; - - public HologramAdapter(Plugin plugin, me.filoghost.holographicdisplays.api.Hologram delegate) { - this.plugin = plugin; - this.hologram = delegate; - - activeHolograms.computeIfAbsent(plugin, __ -> new ArrayList<>()).add(this); - } - - @Override - @Deprecated - public boolean update() { - return true; - } - - @Override - @Deprecated - public void hide() { - - } - - @Override - @Deprecated - public void addLine(String text) { - hologram.appendTextLine(text); - updateTouchHandler(); - } - - @Override - @Deprecated - public void setLine(int index, String text) { - hologram.removeLine(index); - hologram.insertTextLine(index, text); - updateTouchHandler(); - } - - @Override - @Deprecated - public void insertLine(int index, String text) { - hologram.insertTextLine(index, text); - updateTouchHandler(); - } - - @Override - @Deprecated - public String[] getLines() { - String[] lines = new String[hologram.size()]; - for (int i = 0; i < lines.length; i++) { - HologramLine lineObject = hologram.getLine(i); - if (lineObject instanceof TextLine) { - lines[i] = ((TextLine) lineObject).getText(); - } else { - lines[i] = ""; - } - } - return lines; - } - - @Override - @Deprecated - public int getLinesLength() { - return hologram.size(); - } - - @Override - @Deprecated - public void setLocation(Location location) { - hologram.teleport(location); - } - - @Override - @Deprecated - public void setTouchHandler(TouchHandler handler) { - this.touchHandler = handler; - updateTouchHandler(); - } - - private void updateTouchHandler() { - for (int i = 0; i < hologram.size(); i++) { - HologramLine line = hologram.getLine(i); - if (!(line instanceof TouchableLine)) { - continue; - } - - TouchableLine touchableLine = (TouchableLine) line; - - if (touchHandler != null) { - touchableLine.setTouchHandler(new HologramTouchHandlerAdapter(this, touchHandler)); - } else { - touchableLine.setTouchHandler(null); - } - } - } - - @Override - @Deprecated - public TouchHandler getTouchHandler() { - return touchHandler; - } - - @Override - @Deprecated - public boolean hasTouchHandler() { - return touchHandler != null; - } - - @Override - public void removeLine(int index) { - hologram.removeLine(index); - } - - @Override - public void clearLines() { - hologram.clearLines(); - } - - @Override - public Location getLocation() { - return hologram.getLocation(); - } - - @Override - public double getX() { - return hologram.getX(); - } - - @Override - public double getY() { - return hologram.getY(); - } - - @Override - public double getZ() { - return hologram.getZ(); - } - - @Override - public World getWorld() { - return hologram.getWorld(); - } - - @Override - public void teleport(Location location) { - hologram.teleport(location); - } - - @Override - public long getCreationTimestamp() { - return hologram.getCreationTimestamp(); - } - - @Override - public void delete() { - hologram.delete(); - - activeHolograms.get(plugin).remove(this); - } - - @Override - public boolean isDeleted() { - return hologram.isDeleted(); - } - -} +/* + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package com.gmail.filoghost.holograms.api.adapter; + +import com.gmail.filoghost.holograms.api.Hologram; +import com.gmail.filoghost.holograms.api.TouchHandler; +import me.filoghost.holographicdisplays.api.line.HologramLine; +import me.filoghost.holographicdisplays.api.line.TextLine; +import me.filoghost.holographicdisplays.api.line.TouchableLine; +import org.bukkit.Location; +import org.bukkit.World; +import org.bukkit.plugin.Plugin; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.Map; + +@SuppressWarnings("deprecation") +public class HologramAdapter implements Hologram { + + public static Map> activeHolograms = new HashMap<>(); + + private Plugin plugin; + private me.filoghost.holographicdisplays.api.Hologram hologram; + private TouchHandler touchHandler; + + public HologramAdapter(Plugin plugin, me.filoghost.holographicdisplays.api.Hologram delegate) { + this.plugin = plugin; + this.hologram = delegate; + + activeHolograms.computeIfAbsent(plugin, __ -> new ArrayList<>()).add(this); + } + + @Override + @Deprecated + public boolean update() { + return true; + } + + @Override + @Deprecated + public void hide() { + + } + + @Override + @Deprecated + public void addLine(String text) { + hologram.appendTextLine(text); + updateTouchHandler(); + } + + @Override + @Deprecated + public void setLine(int index, String text) { + hologram.removeLine(index); + hologram.insertTextLine(index, text); + updateTouchHandler(); + } + + @Override + @Deprecated + public void insertLine(int index, String text) { + hologram.insertTextLine(index, text); + updateTouchHandler(); + } + + @Override + @Deprecated + public String[] getLines() { + String[] lines = new String[hologram.size()]; + for (int i = 0; i < lines.length; i++) { + HologramLine lineObject = hologram.getLine(i); + if (lineObject instanceof TextLine) { + lines[i] = ((TextLine) lineObject).getText(); + } else { + lines[i] = ""; + } + } + return lines; + } + + @Override + @Deprecated + public int getLinesLength() { + return hologram.size(); + } + + @Override + @Deprecated + public void setLocation(Location location) { + hologram.teleport(location); + } + + @Override + @Deprecated + public void setTouchHandler(TouchHandler handler) { + this.touchHandler = handler; + updateTouchHandler(); + } + + private void updateTouchHandler() { + for (int i = 0; i < hologram.size(); i++) { + HologramLine line = hologram.getLine(i); + if (!(line instanceof TouchableLine)) { + continue; + } + + TouchableLine touchableLine = (TouchableLine) line; + + if (touchHandler != null) { + touchableLine.setTouchHandler(new HologramTouchHandlerAdapter(this, touchHandler)); + } else { + touchableLine.setTouchHandler(null); + } + } + } + + @Override + @Deprecated + public TouchHandler getTouchHandler() { + return touchHandler; + } + + @Override + @Deprecated + public boolean hasTouchHandler() { + return touchHandler != null; + } + + @Override + public void removeLine(int index) { + hologram.removeLine(index); + } + + @Override + public void clearLines() { + hologram.clearLines(); + } + + @Override + public Location getLocation() { + return hologram.getLocation(); + } + + @Override + public double getX() { + return hologram.getX(); + } + + @Override + public double getY() { + return hologram.getY(); + } + + @Override + public double getZ() { + return hologram.getZ(); + } + + @Override + public World getWorld() { + return hologram.getWorld(); + } + + @Override + public void teleport(Location location) { + hologram.teleport(location); + } + + @Override + public long getCreationTimestamp() { + return hologram.getCreationTimestamp(); + } + + @Override + public void delete() { + hologram.delete(); + + activeHolograms.get(plugin).remove(this); + } + + @Override + public boolean isDeleted() { + return hologram.isDeleted(); + } + +} diff --git a/legacy/src/main/java/com/gmail/filoghost/holograms/api/adapter/HologramTouchHandlerAdapter.java b/legacy-v1/src/main/java/com/gmail/filoghost/holograms/api/adapter/HologramTouchHandlerAdapter.java similarity index 97% rename from legacy/src/main/java/com/gmail/filoghost/holograms/api/adapter/HologramTouchHandlerAdapter.java rename to legacy-v1/src/main/java/com/gmail/filoghost/holograms/api/adapter/HologramTouchHandlerAdapter.java index 70434dcc..1452b423 100644 --- a/legacy/src/main/java/com/gmail/filoghost/holograms/api/adapter/HologramTouchHandlerAdapter.java +++ b/legacy-v1/src/main/java/com/gmail/filoghost/holograms/api/adapter/HologramTouchHandlerAdapter.java @@ -1,37 +1,37 @@ -/* - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package com.gmail.filoghost.holograms.api.adapter; - -import com.gmail.filoghost.holograms.api.Hologram; -import com.gmail.filoghost.holograms.api.TouchHandler; -import org.bukkit.entity.Player; - -@SuppressWarnings("deprecation") -public class HologramTouchHandlerAdapter implements me.filoghost.holographicdisplays.api.handler.TouchHandler { - - protected TouchHandler oldHandler; - private Hologram hologram; - - public HologramTouchHandlerAdapter(Hologram hologram, TouchHandler oldHandler) { - this.hologram = hologram; - this.oldHandler = oldHandler; - } - - @Override - public void onTouch(Player player) { - oldHandler.onTouch(hologram, player); - } - -} +/* + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package com.gmail.filoghost.holograms.api.adapter; + +import com.gmail.filoghost.holograms.api.Hologram; +import com.gmail.filoghost.holograms.api.TouchHandler; +import org.bukkit.entity.Player; + +@SuppressWarnings("deprecation") +public class HologramTouchHandlerAdapter implements me.filoghost.holographicdisplays.api.handler.TouchHandler { + + protected TouchHandler oldHandler; + private Hologram hologram; + + public HologramTouchHandlerAdapter(Hologram hologram, TouchHandler oldHandler) { + this.hologram = hologram; + this.oldHandler = oldHandler; + } + + @Override + public void onTouch(Player player) { + oldHandler.onTouch(hologram, player); + } + +} diff --git a/legacy/src/main/java/com/gmail/filoghost/holograms/api/adapter/ItemTouchHandlerAdapter.java b/legacy-v1/src/main/java/com/gmail/filoghost/holograms/api/adapter/ItemTouchHandlerAdapter.java similarity index 97% rename from legacy/src/main/java/com/gmail/filoghost/holograms/api/adapter/ItemTouchHandlerAdapter.java rename to legacy-v1/src/main/java/com/gmail/filoghost/holograms/api/adapter/ItemTouchHandlerAdapter.java index 4e1d318b..3d5ea3f3 100644 --- a/legacy/src/main/java/com/gmail/filoghost/holograms/api/adapter/ItemTouchHandlerAdapter.java +++ b/legacy-v1/src/main/java/com/gmail/filoghost/holograms/api/adapter/ItemTouchHandlerAdapter.java @@ -1,38 +1,38 @@ -/* - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package com.gmail.filoghost.holograms.api.adapter; - -import com.gmail.filoghost.holograms.api.FloatingItem; -import com.gmail.filoghost.holograms.api.ItemTouchHandler; -import me.filoghost.holographicdisplays.api.handler.TouchHandler; -import org.bukkit.entity.Player; - -@SuppressWarnings("deprecation") -public class ItemTouchHandlerAdapter implements TouchHandler { - - protected ItemTouchHandler oldHandler; - private FloatingItem item; - - public ItemTouchHandlerAdapter(FloatingItem item, ItemTouchHandler oldHandler) { - this.item = item; - this.oldHandler = oldHandler; - } - - @Override - public void onTouch(Player player) { - oldHandler.onTouch(item, player); - } - -} +/* + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package com.gmail.filoghost.holograms.api.adapter; + +import com.gmail.filoghost.holograms.api.FloatingItem; +import com.gmail.filoghost.holograms.api.ItemTouchHandler; +import me.filoghost.holographicdisplays.api.handler.TouchHandler; +import org.bukkit.entity.Player; + +@SuppressWarnings("deprecation") +public class ItemTouchHandlerAdapter implements TouchHandler { + + protected ItemTouchHandler oldHandler; + private FloatingItem item; + + public ItemTouchHandlerAdapter(FloatingItem item, ItemTouchHandler oldHandler) { + this.item = item; + this.oldHandler = oldHandler; + } + + @Override + public void onTouch(Player player) { + oldHandler.onTouch(item, player); + } + +} diff --git a/legacy/src/main/java/com/gmail/filoghost/holograms/api/adapter/PickupHandlerAdapter.java b/legacy-v1/src/main/java/com/gmail/filoghost/holograms/api/adapter/PickupHandlerAdapter.java similarity index 97% rename from legacy/src/main/java/com/gmail/filoghost/holograms/api/adapter/PickupHandlerAdapter.java rename to legacy-v1/src/main/java/com/gmail/filoghost/holograms/api/adapter/PickupHandlerAdapter.java index c8850694..0b176794 100644 --- a/legacy/src/main/java/com/gmail/filoghost/holograms/api/adapter/PickupHandlerAdapter.java +++ b/legacy-v1/src/main/java/com/gmail/filoghost/holograms/api/adapter/PickupHandlerAdapter.java @@ -1,37 +1,37 @@ -/* - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package com.gmail.filoghost.holograms.api.adapter; - -import com.gmail.filoghost.holograms.api.FloatingItem; -import com.gmail.filoghost.holograms.api.PickupHandler; -import org.bukkit.entity.Player; - -@SuppressWarnings("deprecation") -public class PickupHandlerAdapter implements me.filoghost.holographicdisplays.api.handler.PickupHandler { - - public PickupHandler oldHandler; - private FloatingItem item; - - public PickupHandlerAdapter(FloatingItem item, PickupHandler oldPickupHandler) { - this.item = item; - this.oldHandler = oldPickupHandler; - } - - @Override - public void onPickup(Player player) { - oldHandler.onPickup(item, player); - } - -} +/* + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package com.gmail.filoghost.holograms.api.adapter; + +import com.gmail.filoghost.holograms.api.FloatingItem; +import com.gmail.filoghost.holograms.api.PickupHandler; +import org.bukkit.entity.Player; + +@SuppressWarnings("deprecation") +public class PickupHandlerAdapter implements me.filoghost.holographicdisplays.api.handler.PickupHandler { + + public PickupHandler oldHandler; + private FloatingItem item; + + public PickupHandlerAdapter(FloatingItem item, PickupHandler oldPickupHandler) { + this.item = item; + this.oldHandler = oldPickupHandler; + } + + @Override + public void onPickup(Player player) { + oldHandler.onPickup(item, player); + } + +} diff --git a/plugin/pom.xml b/plugin/pom.xml index f4692d0e..28c7b6da 100644 --- a/plugin/pom.xml +++ b/plugin/pom.xml @@ -42,7 +42,7 @@ ${project.groupId} - holographicdisplays-legacy + holographicdisplays-legacy-v1 diff --git a/pom.xml b/pom.xml index d2c64853..919e5195 100644 --- a/pom.xml +++ b/pom.xml @@ -32,7 +32,7 @@ api utils config - legacy + legacy-v1 nms plugin example @@ -54,7 +54,7 @@ ${project.groupId} - holographicdisplays-legacy + holographicdisplays-legacy-v1 ${project.version}