Fix lobby signs. Resolves #398

This commit is contained in:
Daniel Saukel 2018-05-13 22:43:19 +02:00
parent 3829e33e40
commit e04ad0949f
4 changed files with 11 additions and 5 deletions

View File

@ -58,7 +58,7 @@ Maven automatically fetches all dependencies and builds DungeonsXL; just run _bu
[DRECommons](https://github.com/DRE2N/DRECommons) is a util library for common tasks. DungeonsXL contains DRECommons 4.1. [DRECommons](https://github.com/DRE2N/DRECommons) is a util library for common tasks. DungeonsXL contains DRECommons 4.1.
#### Caliburn API #### Caliburn API
[Caliburn](https://github.com/DRE2N/CaliburnAPI) is an API to read custom items and mobs from config files. DungeonsXL contains Caliburn Beta 0.3. [Caliburn](https://github.com/DRE2N/CaliburnAPI) is an API to read custom items and mobs from config files. DungeonsXL contains Caliburn Beta 0.4.
### Java ### Java
Make sure that your server uses Java 8 or higher. Make sure that your server uses Java 8 or higher.

View File

@ -232,6 +232,7 @@ public abstract class DSign {
if (!(type instanceof DSignTypeDefault)) { if (!(type instanceof DSignTypeDefault)) {
MessageUtil.log("Please note that this sign is an unsupported feature added by an addon!"); MessageUtil.log("Please note that this sign is an unsupported feature added by an addon!");
} }
exception.printStackTrace();
} }
} }

View File

@ -29,12 +29,16 @@ public abstract class LocationSign extends DSign {
public LocationSign(Sign sign, String[] lines, DGameWorld gameWorld) { public LocationSign(Sign sign, String[] lines, DGameWorld gameWorld) {
super(sign, lines, gameWorld); super(sign, lines, gameWorld);
double x = sign.getX() + 0.5; }
double y = sign.getY();
double z = sign.getZ() + 0.5; @Override
public void onInit() {
double x = getSign().getX() + 0.5;
double y = getSign().getY();
double z = getSign().getZ() + 0.5;
float yaw = letterToYaw(((org.bukkit.material.Sign) getSign().getData()).getFacing().getOppositeFace().name().charAt(0)); float yaw = letterToYaw(((org.bukkit.material.Sign) getSign().getData()).getFacing().getOppositeFace().name().charAt(0));
float pitch = 0; float pitch = 0;
location = new Location(gameWorld.getWorld(), x, y, z, yaw, pitch); location = new Location(getGameWorld().getWorld(), x, y, z, yaw, pitch);
} }
/** /**

View File

@ -41,6 +41,7 @@ public class LobbySign extends LocationSign {
@Override @Override
public void onInit() { public void onInit() {
super.onInit();
getGameWorld().setLobbyLocation(getLocation()); getGameWorld().setLobbyLocation(getLocation());
getSign().getBlock().setType(VanillaItem.AIR.getMaterial()); getSign().getBlock().setType(VanillaItem.AIR.getMaterial());
} }