Skip to content

Commit 3219de4

Browse files
author
net
committed
Prevent players from getting reset when viewing a map in creative
1 parent ecabc4b commit 3219de4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main/java/org/mctourney/autoreferee/listeners/ZoneListener.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package org.mctourney.autoreferee.listeners;
1+
package org.mctourney.autoreferee.listeners;
22

33
import java.util.Iterator;
44
import java.util.Map;
@@ -87,8 +87,8 @@ public void playerMove(PlayerMoveEvent event)
8787
AutoRefPlayer apl = match.getPlayer(player);
8888
if (apl == null)
8989
{
90-
// if the player is not on a team and has left the start area, teleport back
91-
if (!match.isSpectator(player) && !match.inStartRegion(event.getTo()) && onGround)
90+
// if the player is not on a team and has left the start area and is not in creative, teleport back
91+
if (!match.isSpectator(player) && !match.inStartRegion(event.getTo()) && onGround && player.getGameMode() != GameMode.CREATIVE)
9292
{
9393
player.teleport(match.getWorldSpawn());
9494
player.setFallDistance(0.0f);

0 commit comments

Comments
 (0)