From 2604ed499c3619e4789ff4fb56f84dd85cd1b124 Mon Sep 17 00:00:00 2001
From: shillingp
Date: Mon, 16 Jun 2014 21:41:06 +0000
Subject: [PATCH] spawn to teleport command, implemented head position
---
misc.py | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/misc.py b/misc.py
index 3f09513..f63c97f 100644
--- a/misc.py
+++ b/misc.py
@@ -32,12 +32,11 @@ def onJoin(event):
msg(player, " &6thank you and happy playing ;)")
msg(player, " \n ")
- loginloc = player.getLocation()
- # headloc = player.getEyeLocation()
- blockmat = loginloc.getBlock().getType()
- if str(blockmat) == "PORTAL":
+ loginloc = player.getLocation().getBlock().getType()
+ headloc = player.getEyeLocation().getBlock().getType()
+ if (str(loginloc) or str(headloc) == "PORTAL"):
msg(player, "Looks like you spawned in a portal... Let me help you out")
- server.dispatchCommand(player, "spawn")
+ player.teleport(player.getWorld().getSpawnLocation())
#