Skip to content

Commit

Permalink
Spawn jitter
Browse files Browse the repository at this point in the history
  • Loading branch information
Restioson committed Aug 10, 2020
1 parent ae87e10 commit b59020a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,6 @@ private void failHoop(ServerPlayerEntity player, LoopDeLoopPlayer state, long ti
LoopDeLoopHoop lastHoop = this.map.hoops.get(state.lastHoop);
Vec3d centre = Vec3d.ofCenter(lastHoop.centre);
float radius = 2;

double x = centre.x + MathHelper.nextDouble(player.getRandom(), -radius, radius);
double y = centre.y + MathHelper.nextFloat(player.getRandom(), -radius, radius);
double z = centre.z + 2;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import net.minecraft.server.network.ServerPlayerEntity;
import net.minecraft.server.world.ServerWorld;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;
import net.minecraft.world.GameMode;

public final class LoopDeLoopSpawnLogic {
Expand Down Expand Up @@ -46,6 +47,10 @@ public void spawnPlayer(ServerPlayerEntity player) {
return;
}

player.teleport(world, pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, 0.0F, 0.0F);
float radius = 4.5f;
double x = pos.getX() + MathHelper.nextDouble(player.getRandom(), -radius, radius);
double z = pos.getZ() + MathHelper.nextFloat(player.getRandom(), -radius, radius);

player.teleport(world, x, pos.getY() + 0.5, z, 0.0F, 0.0F);
}
}

0 comments on commit b59020a

Please sign in to comment.