Skip to content

Commit

Permalink
Fix respawn logic for player with spawn point set
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremiahwinsley committed Dec 8, 2021
1 parent 4441345 commit c6c760a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
distribution: 'zulu'
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ org.gradle.daemon=false

group=net.permutated
mod_id=pylons
version=2.0.0
version=2.0.1
10 changes: 5 additions & 5 deletions src/main/java/net/permutated/pylons/tile/ExpulsionPylonTile.java
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,6 @@ private void doRespawn(MinecraftServer server, ServerPlayer player) {
ServerPlayer dummyPlayer = new ServerPlayer(server, actualLevel, player.getGameProfile());

if (optional.isPresent()) {
// player has a spawn position, is this in the same chunk?
if (sameChunk(actualLevel, dummyPlayer.blockPosition())) {
return;
}

BlockState blockstate = actualLevel.getBlockState(respawnPosition);
boolean isAnchor = blockstate.is(Blocks.RESPAWN_ANCHOR);
Vec3 spawnPos = optional.get();
Expand All @@ -151,6 +146,11 @@ private void doRespawn(MinecraftServer server, ServerPlayer player) {
}

dummyPlayer.moveTo(spawnPos.x, spawnPos.y, spawnPos.z, actualAngle, 0.0F);

// player has a spawn position, is this in the same chunk?
if (sameChunk(actualLevel, dummyPlayer.blockPosition())) {
return;
}
} else {
int spawnRadius = server.getSpawnRadius(actualLevel);

Expand Down

0 comments on commit c6c760a

Please sign in to comment.