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

@ -168,7 +168,7 @@ public class CraftHologram implements Hologram, com.gmail.filoghost.holograms.ap
} }
lines.clear(); lines.clear();
} }
@Override @Override
public int size() { public int size() {
@ -297,7 +297,7 @@ public class CraftHologram implements Hologram, com.gmail.filoghost.holograms.ap
@Override @Override
public void teleport(World world, double x, double y, double z) { public void teleport(World world, double x, double y, double z) {
Validator.isTrue(!deleted, "hologram already deleted"); Validator.isTrue(!deleted, "hologram already deleted");
Validator.notNull(world, "world"); Validator.notNull(world, "world");
if (this.world != world) { if (this.world != world) {
updateLocation(world, x, y, z); updateLocation(world, x, y, z);
@ -338,47 +338,56 @@ public class CraftHologram implements Hologram, com.gmail.filoghost.holograms.ap
*/ */
@Override @Override
@Deprecated
public boolean update() { public boolean update() {
return true; return true;
} }
@Override @Override
@Deprecated
public void hide() { public void hide() {
} }
@Override @Override
@Deprecated
public void addLine(String text) { public void addLine(String text) {
appendTextLine(text); appendTextLine(text);
} }
@Override @Override
@Deprecated
public void setLine(int index, String text) { public void setLine(int index, String text) {
lines.get(index).despawn(); lines.get(index).despawn();
lines.set(index, new CraftTextLine(this, text)); lines.set(index, new CraftTextLine(this, text));
} }
@Override @Override
@Deprecated
public void insertLine(int index, String text) { public void insertLine(int index, String text) {
insertLine(index, text); insertLine(index, text);
} }
@Override @Override
@Deprecated
public String[] getLines() { public String[] getLines() {
return null; return null;
} }
@Override @Override
@Deprecated
public int getLinesLength() { public int getLinesLength() {
return size(); return size();
} }
@Override @Override
@Deprecated
public void setLocation(Location location) { public void setLocation(Location location) {
teleport(location); teleport(location);
} }
@Override @Override
@Deprecated
public void setTouchHandler(TouchHandler handler) { public void setTouchHandler(TouchHandler handler) {
if (size() > 0) { if (size() > 0) {
TouchableLine line0 = ((TouchableLine) getLine(0)); TouchableLine line0 = ((TouchableLine) getLine(0));
@ -392,11 +401,13 @@ public class CraftHologram implements Hologram, com.gmail.filoghost.holograms.ap
} }
@Override @Override
@Deprecated
public TouchHandler getTouchHandler() { public TouchHandler getTouchHandler() {
return null; return null;
} }
@Override @Override
@Deprecated
public boolean hasTouchHandler() { public boolean hasTouchHandler() {
return false; return false;
} }