Skip to content

Commit

Permalink
removed constructer, spawn works
Browse files Browse the repository at this point in the history
  • Loading branch information
Bryson Steck committed Jul 22, 2021
1 parent 4f0ac64 commit 783273f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 18 deletions.
Binary file modified out/artifacts/Resurrection_jar/Resurrection.jar
Binary file not shown.
19 changes: 1 addition & 18 deletions src/net/brysonsteck/Resurrection/player/PlayerListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,6 @@ public class PlayerListener implements Listener {
Location spawn = world.getSpawnLocation();
Hashtable<String, Location> playerSpawns = new Hashtable<>();

public PlayerListener() {
double newY = 46;
while(true) {
Location testLocation = new Location (world, 0, newY, 0);
Block block = testLocation.getBlock();
if (block.getType() == Material.AIR) {
newY++;
System.out.println("The spawn block at X0 Z0 is Y" + newY);
// spawn = testLocation;
break;
} else {
newY++;
}
}
}

@EventHandler
public void onJoin(PlayerJoinEvent e) {
Player p = e.getPlayer();
Expand Down Expand Up @@ -90,7 +74,7 @@ public void run() {
PotionEffect slowness = new PotionEffect(PotionEffectType.SLOW, 999999999, 10, false);
blindness.apply(p);
slowness.apply(p);
// convert to seconds and to ticks
p.teleport(spawn);
}
}.runTaskLater(JavaPlugin.getProvidingPlugin(Resurrection.class), 1);
resurrectTime = resurrectTime - System.currentTimeMillis();
Expand Down Expand Up @@ -211,7 +195,6 @@ public void run() {
// invisibility.apply(p);
blindness.apply(p);
slowness.apply(p);
p.teleport(spawn);
}
}.runTaskLater(JavaPlugin.getProvidingPlugin(Resurrection.class), 1);
}
Expand Down

0 comments on commit 783273f

Please sign in to comment.