DungeonsXL/core/src/main/java/de/erethon/dungeonsxl/sign/LocationSign.java

44 lines
1.4 KiB
Java
Raw Normal View History

/*
2022-01-08 23:02:57 +01:00
* Copyright (C) 2012-2022 Frank Baumann
*
* 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-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;
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;
float yaw = BlockUtil.blockFaceToYaw(DungeonsXL.BLOCK_ADAPTER.getFacing(getSign().getBlock()).getOppositeFace());
float pitch = 0;
2020-03-13 23:48:49 +01:00
setLocation(new Location(getGameWorld().getWorld(), x, y, z, yaw, pitch));
}
2020-03-13 23:48:49 +01:00
Location getLocation();
void setLocation(Location location);
}