mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-08-27 12:41:43 +00:00
Fix Iris entity spawn delegation
This commit is contained in:
@@ -971,7 +971,7 @@ public class Iris extends VolmitPlugin implements Listener, ReloadAware {
|
||||
final Location spawn = w.getSpawnLocation();
|
||||
for (Player i : getServer().getOnlinePlayers()) {
|
||||
final Runnable playerTask = () -> {
|
||||
i.setGameMode(GameMode.SPECTATOR);
|
||||
i.setGameMode(GameMode.CREATIVE);
|
||||
BukkitPlatform.teleportAsync(i, spawn);
|
||||
};
|
||||
if (!J.runEntity(i, playerTask)) {
|
||||
|
||||
+1
-1
@@ -657,7 +657,7 @@ public class CommandStudio implements DirectorExecutor {
|
||||
.getTarget()
|
||||
.getWorld();
|
||||
BukkitPlatform.teleportAsync(player, BukkitWorldBinding.spawnLocation(studioWorld))
|
||||
.thenRun(() -> player.setGameMode(GameMode.SPECTATOR));
|
||||
.thenRun(() -> player.setGameMode(GameMode.CREATIVE));
|
||||
}
|
||||
|
||||
@Director(description = "Update your dimension projects VSCode workspace", descriptionKey = "iris.director.commandstudio.director.update_your_dimension_projects_vscode_workspace")
|
||||
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
package art.arcane.iris.core.runtime;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
public class StudioPlayerModeContractTest {
|
||||
@Test
|
||||
public void studioEntryKeepsPlayersEligibleForNaturalSpawning() throws IOException {
|
||||
String plugin = Files.readString(Path.of("src/main/java/art/arcane/iris/Iris.java"));
|
||||
String commands = Files.readString(Path.of(
|
||||
"src/main/java/art/arcane/iris/core/commands/CommandStudio.java"));
|
||||
|
||||
assertFalse(plugin.contains("GameMode.SPECTATOR"));
|
||||
assertFalse(commands.contains("GameMode.SPECTATOR"));
|
||||
assertTrue(plugin.contains("GameMode.CREATIVE"));
|
||||
assertTrue(commands.contains("GameMode.CREATIVE"));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user