use of org.bukkit.inventory.meta.CompassMeta in project CompassTracker by hyperdefined.
the class GameManager method setHuntersLodestones.
/**
* This will set all hunters in the game's lodestone. Only used for 1.16 and above.
*/
public void setHuntersLodestones() {
for (Player player : gameHunters) {
for (ItemStack item : player.getInventory().getContents()) {
if (item != null) {
if (item.getType() == Material.COMPASS) {
ItemMeta itemMeta = item.getItemMeta();
if (itemMeta.getDisplayName().equalsIgnoreCase("Tracking Compass")) {
CompassMeta compassMeta = (CompassMeta) itemMeta;
compassMeta.setLodestoneTracked(false);
compassMeta.setLodestone(getSpeedrunnerLocation(player.getWorld()));
item.setItemMeta(compassMeta);
}
}
}
}
}
}
use of org.bukkit.inventory.meta.CompassMeta in project Denizen-For-Bukkit by DenizenScript.
the class ItemLodestoneLocation method adjust.
@Override
public void adjust(Mechanism mechanism) {
// -->
if (mechanism.matches("lodestone_location")) {
CompassMeta meta = (CompassMeta) item.getItemMeta();
if (mechanism.hasValue() && mechanism.requireObject(LocationTag.class)) {
meta.setLodestone(mechanism.valueAsType(LocationTag.class).clone());
} else {
meta.setLodestone(null);
}
item.setItemMeta(meta);
}
}
use of org.bukkit.inventory.meta.CompassMeta in project MagicPlugin by elBukkit.
the class CompatibilityUtils method setCompassTarget.
@Override
public boolean setCompassTarget(ItemMeta meta, Location targetLocation, boolean trackLocation) {
if (meta == null || !(meta instanceof CompassMeta)) {
return false;
}
CompassMeta compassMeta = (CompassMeta) meta;
compassMeta.setLodestoneTracked(trackLocation);
compassMeta.setLodestone(targetLocation);
return true;
}
use of org.bukkit.inventory.meta.CompassMeta in project MagicPlugin by elBukkit.
the class CompatibilityUtils method setCompassTarget.
@Override
public boolean setCompassTarget(ItemMeta meta, Location targetLocation, boolean trackLocation) {
if (meta == null || !(meta instanceof CompassMeta)) {
return false;
}
CompassMeta compassMeta = (CompassMeta) meta;
compassMeta.setLodestoneTracked(trackLocation);
compassMeta.setLodestone(targetLocation);
return true;
}
use of org.bukkit.inventory.meta.CompassMeta in project MagicPlugin by elBukkit.
the class CompatibilityUtils method setCompassTarget.
@Override
public boolean setCompassTarget(ItemMeta meta, Location targetLocation, boolean trackLocation) {
if (meta == null || !(meta instanceof CompassMeta)) {
return false;
}
CompassMeta compassMeta = (CompassMeta) meta;
compassMeta.setLodestoneTracked(trackLocation);
compassMeta.setLodestone(targetLocation);
return true;
}
Aggregations