forked from PaperMC/paperweight-test-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add class to represent a block location
- Loading branch information
1 parent
1a75088
commit 459174b
Showing
1 changed file
with
28 additions
and
0 deletions.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
src/main/java/net/slqmy/template_paper_plugin/util/types/BlockLocation.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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()); | ||
} | ||
} |