Mirror von
https://github.com/GeyserMC/Geyser.git
synchronisiert 2024-09-08 20:43:04 +02:00
Fix several world-related errors on Spigot 1.12 (#1886)
- Fix v1.12R1 not being recognized as a world adapter - Return air if a chunk is not loaded
Dieser Commit ist enthalten in:
Ursprung
27fecd7ff7
Commit
254990148c
@ -30,9 +30,9 @@
|
|||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.geysermc.adapters</groupId>
|
<groupId>org.geysermc.geyser.adapters</groupId>
|
||||||
<artifactId>spigot-all</artifactId>
|
<artifactId>spigot-all</artifactId>
|
||||||
<version>1.0-SNAPSHOT</version>
|
<version>1.1-SNAPSHOT</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
<build>
|
<build>
|
||||||
|
@ -28,7 +28,6 @@ package org.geysermc.platform.spigot;
|
|||||||
import com.github.steveice10.mc.protocol.MinecraftConstants;
|
import com.github.steveice10.mc.protocol.MinecraftConstants;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
import org.geysermc.adapters.spigot.SpigotAdapters;
|
|
||||||
import org.geysermc.common.PlatformType;
|
import org.geysermc.common.PlatformType;
|
||||||
import org.geysermc.connector.GeyserConnector;
|
import org.geysermc.connector.GeyserConnector;
|
||||||
import org.geysermc.connector.bootstrap.GeyserBootstrap;
|
import org.geysermc.connector.bootstrap.GeyserBootstrap;
|
||||||
@ -40,6 +39,7 @@ import org.geysermc.connector.ping.GeyserLegacyPingPassthrough;
|
|||||||
import org.geysermc.connector.ping.IGeyserPingPassthrough;
|
import org.geysermc.connector.ping.IGeyserPingPassthrough;
|
||||||
import org.geysermc.connector.utils.FileUtils;
|
import org.geysermc.connector.utils.FileUtils;
|
||||||
import org.geysermc.connector.utils.LanguageUtils;
|
import org.geysermc.connector.utils.LanguageUtils;
|
||||||
|
import org.geysermc.geyser.adapters.spigot.SpigotAdapters;
|
||||||
import org.geysermc.platform.spigot.command.GeyserSpigotCommandExecutor;
|
import org.geysermc.platform.spigot.command.GeyserSpigotCommandExecutor;
|
||||||
import org.geysermc.platform.spigot.command.GeyserSpigotCommandManager;
|
import org.geysermc.platform.spigot.command.GeyserSpigotCommandManager;
|
||||||
import org.geysermc.platform.spigot.command.SpigotCommandSender;
|
import org.geysermc.platform.spigot.command.SpigotCommandSender;
|
||||||
|
@ -27,10 +27,10 @@ package org.geysermc.platform.spigot.world.manager;
|
|||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.geysermc.adapters.spigot.SpigotAdapters;
|
|
||||||
import org.geysermc.adapters.spigot.SpigotWorldAdapter;
|
|
||||||
import org.geysermc.connector.network.session.GeyserSession;
|
import org.geysermc.connector.network.session.GeyserSession;
|
||||||
import org.geysermc.connector.network.translators.world.block.BlockTranslator;
|
import org.geysermc.connector.network.translators.world.block.BlockTranslator;
|
||||||
|
import org.geysermc.geyser.adapters.spigot.SpigotAdapters;
|
||||||
|
import org.geysermc.geyser.adapters.spigot.SpigotWorldAdapter;
|
||||||
import us.myles.ViaVersion.api.Via;
|
import us.myles.ViaVersion.api.Via;
|
||||||
import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.storage.BlockStorage;
|
import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.storage.BlockStorage;
|
||||||
|
|
||||||
|
@ -75,6 +75,10 @@ public class GeyserSpigot1_12WorldManager extends GeyserSpigotWorldManager {
|
|||||||
if (player == null) {
|
if (player == null) {
|
||||||
return BlockTranslator.JAVA_AIR_ID;
|
return BlockTranslator.JAVA_AIR_ID;
|
||||||
}
|
}
|
||||||
|
if (!player.getWorld().isChunkLoaded(x >> 4, z >> 4)) {
|
||||||
|
// Prevent nasty async errors if a player is loading in
|
||||||
|
return BlockTranslator.JAVA_AIR_ID;
|
||||||
|
}
|
||||||
// Get block entity storage
|
// Get block entity storage
|
||||||
BlockStorage storage = Via.getManager().getConnection(player.getUniqueId()).get(BlockStorage.class);
|
BlockStorage storage = Via.getManager().getConnection(player.getUniqueId()).get(BlockStorage.class);
|
||||||
Block block = player.getWorld().getBlockAt(x, y, z);
|
Block block = player.getWorld().getBlockAt(x, y, z);
|
||||||
|
@ -27,10 +27,10 @@ package org.geysermc.platform.spigot.world.manager;
|
|||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.geysermc.adapters.spigot.SpigotAdapters;
|
|
||||||
import org.geysermc.adapters.spigot.SpigotWorldAdapter;
|
|
||||||
import org.geysermc.connector.network.session.GeyserSession;
|
import org.geysermc.connector.network.session.GeyserSession;
|
||||||
import org.geysermc.connector.network.translators.world.block.BlockTranslator;
|
import org.geysermc.connector.network.translators.world.block.BlockTranslator;
|
||||||
|
import org.geysermc.geyser.adapters.spigot.SpigotAdapters;
|
||||||
|
import org.geysermc.geyser.adapters.spigot.SpigotWorldAdapter;
|
||||||
|
|
||||||
public class GeyserSpigotNativeWorldManager extends GeyserSpigotWorldManager {
|
public class GeyserSpigotNativeWorldManager extends GeyserSpigotWorldManager {
|
||||||
protected final SpigotWorldAdapter adapter;
|
protected final SpigotWorldAdapter adapter;
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren