save entry location in database
This commit is contained in:
@@ -16,19 +16,19 @@ import java.util.*;
|
||||
import static eu.mhsl.minecraft.pixelblocks.PixelBlocks.plugin;
|
||||
|
||||
public class PlayerInteractListener implements Listener {
|
||||
@EventHandler
|
||||
static void onPlayerInteract(PlayerInteractEvent event) {
|
||||
if(event.getAction() == Action.RIGHT_CLICK_BLOCK && event.getClickedBlock() != null) {
|
||||
if(event.getClickedBlock().getType() == Material.GLASS) {
|
||||
// final WorldCreator worldCreator = new WorldCreator(plugin.getDataFolder().getPath()+"/"+event.getPlayer().getUniqueId());
|
||||
// worldCreator.type(WorldType.FLAT);
|
||||
//
|
||||
// World newWorld = Bukkit.createWorld(worldCreator);
|
||||
//
|
||||
// event.getPlayer().teleport(newWorld.getSpawnLocation());
|
||||
}
|
||||
}
|
||||
}
|
||||
// @EventHandler
|
||||
// static void onPlayerInteract(PlayerInteractEvent event) {
|
||||
// if(event.getAction() == Action.RIGHT_CLICK_BLOCK && event.getClickedBlock() != null) {
|
||||
// if(event.getClickedBlock().getType() == Material.GLASS) {
|
||||
//// final WorldCreator worldCreator = new WorldCreator(plugin.getDataFolder().getPath()+"/"+event.getPlayer().getUniqueId());
|
||||
//// worldCreator.type(WorldType.FLAT);
|
||||
////
|
||||
//// World newWorld = Bukkit.createWorld(worldCreator);
|
||||
////
|
||||
//// event.getPlayer().teleport(newWorld.getSpawnLocation());
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
@EventHandler
|
||||
static void onPlayerInteractEntity(PlayerInteractEntityEvent event) {
|
||||
@@ -47,6 +47,7 @@ public class PlayerInteractListener implements Listener {
|
||||
if(playerUID.equals(blockOwner)) {
|
||||
pixelBlock.lastEntryLocation = event.getPlayer().getLocation();
|
||||
pixelBlock.lastEntryTime = System.currentTimeMillis();
|
||||
pixelBlock.saveToDB();
|
||||
|
||||
World blockWorld = Bukkit.getWorld(plugin.getDataFolder().getPath()+ "/" +pixelBlock.uuid);
|
||||
assert blockWorld != null;
|
||||
|
||||
Reference in New Issue
Block a user