Deprecate methods, add support for Touchscreen Holograms.

This commit is contained in:
filoghost 2014-12-22 14:30:09 +01:00
parent bba0f135c5
commit 295e6a675b
3 changed files with 61 additions and 2 deletions

View File

@ -0,0 +1,30 @@
package com.gmail.filoghost.holographicdisplays.event;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
import com.gmail.filoghost.holographicdisplays.object.NamedHologram;
public class HolographicDisplaysReloadEvent extends Event {
private static final HandlerList handlers = new HandlerList();
private NamedHologram namedHologram;
public HolographicDisplaysReloadEvent(NamedHologram namedHologram) {
this.namedHologram = namedHologram;
}
public NamedHologram getNamedHologram() {
return namedHologram;
}
@Override
public HandlerList getHandlers() {
return handlers;
}
public static HandlerList getHandlerList() {
return handlers;
}
}

View File

@ -0,0 +1,18 @@
package com.gmail.filoghost.holographicdisplays.event;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
public class NamedHologramEditedEvent extends Event {
private static final HandlerList handlers = new HandlerList();
@Override
public HandlerList getHandlers() {
return handlers;
}
public static HandlerList getHandlerList() {
return handlers;
}
}

View File

@ -338,47 +338,56 @@ public class CraftHologram implements Hologram, com.gmail.filoghost.holograms.ap
*/
@Override
@Deprecated
public boolean update() {
return true;
}
@Override
@Deprecated
public void hide() {
}
@Override
@Deprecated
public void addLine(String text) {
appendTextLine(text);
}
@Override
@Deprecated
public void setLine(int index, String text) {
lines.get(index).despawn();
lines.set(index, new CraftTextLine(this, text));
}
@Override
@Deprecated
public void insertLine(int index, String text) {
insertLine(index, text);
}
@Override
@Deprecated
public String[] getLines() {
return null;
}
@Override
@Deprecated
public int getLinesLength() {
return size();
}
@Override
@Deprecated
public void setLocation(Location location) {
teleport(location);
}
@Override
@Deprecated
public void setTouchHandler(TouchHandler handler) {
if (size() > 0) {
TouchableLine line0 = ((TouchableLine) getLine(0));
@ -392,11 +401,13 @@ public class CraftHologram implements Hologram, com.gmail.filoghost.holograms.ap
}
@Override
@Deprecated
public TouchHandler getTouchHandler() {
return null;
}
@Override
@Deprecated
public boolean hasTouchHandler() {
return false;
}