Skip to content

Commit

Permalink
Add class to represent a block location
Browse files Browse the repository at this point in the history
  • Loading branch information
esotericenderman committed Aug 12, 2024
1 parent 1a75088 commit 459174b
Showing 1 changed file with 28 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package net.slqmy.template_paper_plugin.util.types;

import org.bukkit.Location;
import org.bukkit.block.Block;

public class BlockLocation {

private String worldName;

private int x;
private int y;
private int z;

public BlockLocation(String worldName, int x, int y, int z) {
this.worldName = worldName;
this.x = x;
this.y = y;
this.z = z;
}

public BlockLocation(Location location) {
this(location.getWorld().getName(), (int) location.getX(), (int) location.getY(), (int) location.getZ());
}

public BlockLocation(Block block) {
this(block.getLocation());
}
}

0 comments on commit 459174b

Please sign in to comment.