本文整理匯總了Java中org.spongepowered.api.world.Location.getBlockZ方法的典型用法代碼示例。如果您正苦於以下問題:Java Location.getBlockZ方法的具體用法?Java Location.getBlockZ怎麽用?Java Location.getBlockZ使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.spongepowered.api.world.Location
的用法示例。
在下文中一共展示了Location.getBlockZ方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: isInside
import org.spongepowered.api.world.Location; //導入方法依賴的package包/類
public boolean isInside(Location<World> loc)
{
Rect extr = extrema.get(loc.getExtent().getUniqueId());
Vector2i p = new Vector2i(loc.getBlockX(), loc.getBlockZ());
if (p.getX() < extr.getMinX() || p.getX() > extr.getMaxX() || p.getY() < extr.getMinY() || p.getY() > extr.getMaxY())
{
return false;
}
for (Rect r : rects)
{
if (r.isInside(p))
{
return true;
}
}
return false;
}
示例2: onOpened
import org.spongepowered.api.world.Location; //導入方法依賴的package包/類
@Listener
public void onOpened(PlayerOpenedCrateEvent event) {
Player player = event.getPlayer();
Manager manager = event.getManager();
Drop drop = event.getDrop();
if (manager.isSendOpenMessage()) {
Optional<String> optional_custom_open_message = manager.getCustomOpenMessage();
if (optional_custom_open_message.isPresent()) {
player.sendMessage(TextSerializers.FORMATTING_CODE.
deserialize(optional_custom_open_message.get().
replace("%MANAGER%", manager.getName())));
} else {
player.sendMessage(LanguageUtils.getText("SUCCESSFULLY_OPENED_MANAGER",
new Pair<String, String>("%MANAGER%", manager.getName())));
}
}
if (GWMCrates.getInstance().isLogOpenedCrates()) {
try {
String time = LocalTime.now().withNano(0).format(DateTimeFormatter.ISO_LOCAL_TIME);
String player_name = player.getName();
String player_uuid = player.getUniqueId().toString();
String manager_name = manager.getName();
String manager_id = manager.getId();
String drop_name = drop == null ? "null" : drop.getId().orElse("Unknown ID");
Location<World> location = player.getLocation();
String player_location = location.getExtent().getName() + ' ' + location.getBlockX() + ' ' + location.getBlockY() + ' ' + location.getBlockZ();
LOG_FILE_WRITER.write(LanguageUtils.getPhrase("CRATE_OPENING_LOG_MESSAGE",
new Pair("%TIME%", time),
new Pair("%PLAYER%", player_name),
new Pair("%PLAYER_UUID%", player_uuid),
new Pair("%MANAGER_NAME%", manager_name),
new Pair("%MANAGER_ID%", manager_id),
new Pair("%DROP%", drop_name),
new Pair("%LOCATION%", player_location)) + '\n');
LOG_FILE_WRITER.flush();
} catch (Exception e) {
GWMCrates.getInstance().getLogger().warn("Exception logging crate opening!", e);
}
}
}
示例3: isLocationChanged
import org.spongepowered.api.world.Location; //導入方法依賴的package包/類
public static boolean isLocationChanged(Transform<World> from, Transform<World> to, boolean y_sensitive) {
Location<World> location_from = from.getLocation();
Location<World> location_to = to.getLocation();
int x_from = location_from.getBlockX();
int y_from = location_from.getBlockY();
int z_from = location_from.getBlockZ();
int x_to = location_to.getBlockX();
int y_to = location_to.getBlockY();
int z_to = location_to.getBlockZ();
return x_from != x_to || z_from != z_to || (y_sensitive && y_from != y_to);
}
示例4: getZone
import org.spongepowered.api.world.Location; //導入方法依賴的package包/類
public Zone getZone(Location<World> loc)
{
Vector2i p = new Vector2i(loc.getBlockX(), loc.getBlockZ());
for (Zone zone : zones.values())
{
if (zone.getRect().isInside(p))
{
return zone;
}
}
return null;
}
示例5: isFor
import org.spongepowered.api.world.Location; //導入方法依賴的package包/類
public boolean isFor(Location<World> location) {
return this.location.getBlockX() == location.getBlockX() && this.location.getBlockY() == location.getBlockY() && this.location.getBlockZ() == location.getBlockZ();
}
示例6: Kit
import org.spongepowered.api.world.Location; //導入方法依賴的package包/類
public Kit(String name, Location<World> block) {
super(name, block.getExtent().getName(), block.getBlockX(), block.getBlockY(), block.getBlockZ(), 0, Collections.emptyList());
}
示例7: setLoc
import org.spongepowered.api.world.Location; //導入方法依賴的package包/類
public void setLoc(Location<World> loc) {
this.loc = new Location<World>(loc.getExtent(), loc.getBlockX()+0.5, loc.getY(), loc.getBlockZ()+0.5);
}
示例8: getLocationString
import org.spongepowered.api.world.Location; //導入方法依賴的package包/類
public static String getLocationString(Location<World> location) {
return "(" + location.getBlockX() + "," + location.getBlockY() + "," + location.getBlockZ() + ")";
}