2018-04-27 18:06:12 +02:00
|
|
|
/*
|
2022-01-08 23:02:57 +01:00
|
|
|
* Copyright (C) 2012-2022 Frank Baumann
|
2018-04-27 18:06:12 +02:00
|
|
|
*
|
|
|
|
* 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 <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
2018-05-03 21:54:25 +02:00
|
|
|
package de.erethon.dungeonsxl.sign;
|
2018-04-27 18:06:12 +02:00
|
|
|
|
2018-08-18 16:52:51 +02:00
|
|
|
import de.erethon.dungeonsxl.DungeonsXL;
|
2020-03-13 23:48:49 +01:00
|
|
|
import de.erethon.dungeonsxl.api.sign.DungeonSign;
|
2022-04-03 18:09:12 +02:00
|
|
|
import de.erethon.bedrock.misc.BlockUtil;
|
2018-04-27 18:06:12 +02:00
|
|
|
import org.bukkit.Location;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @author Daniel Saukel
|
|
|
|
*/
|
2020-03-13 23:48:49 +01:00
|
|
|
public interface LocationSign extends DungeonSign {
|
2018-05-13 22:43:19 +02:00
|
|
|
|
|
|
|
@Override
|
2020-03-13 23:48:49 +01:00
|
|
|
default void initialize() {
|
2018-05-13 22:43:19 +02:00
|
|
|
double x = getSign().getX() + 0.5;
|
|
|
|
double y = getSign().getY();
|
|
|
|
double z = getSign().getZ() + 0.5;
|
2019-06-13 02:01:56 +02:00
|
|
|
float yaw = BlockUtil.blockFaceToYaw(DungeonsXL.BLOCK_ADAPTER.getFacing(getSign().getBlock()).getOppositeFace());
|
2018-04-27 18:06:12 +02:00
|
|
|
float pitch = 0;
|
2020-03-13 23:48:49 +01:00
|
|
|
setLocation(new Location(getGameWorld().getWorld(), x, y, z, yaw, pitch));
|
2018-04-27 18:06:12 +02:00
|
|
|
}
|
|
|
|
|
2020-03-13 23:48:49 +01:00
|
|
|
Location getLocation();
|
|
|
|
|
|
|
|
void setLocation(Location location);
|
2018-04-27 18:06:12 +02:00
|
|
|
|
|
|
|
}
|