mirror of
https://github.com/GeyserMC/Geyser.git
synced 2024-08-14 23:57:35 +00:00
Merge branch 'master' of https://github.com/GeyserMC/Geyser into feature/protocol-3.0
This commit is contained in:
commit
4fe9aeca40
142 changed files with 2276 additions and 11909 deletions
|
@ -41,6 +41,8 @@ public class GeyserSpigotDumpInfo extends BootstrapDumpInfo {
|
|||
private final String platformVersion;
|
||||
private final String platformAPIVersion;
|
||||
private final boolean onlineMode;
|
||||
|
||||
@AsteriskSerializer.Asterisk(isIp = true)
|
||||
private final String serverIP;
|
||||
private final int serverPort;
|
||||
private final List<PluginInfo> plugins;
|
||||
|
@ -51,12 +53,7 @@ public class GeyserSpigotDumpInfo extends BootstrapDumpInfo {
|
|||
this.platformVersion = Bukkit.getVersion();
|
||||
this.platformAPIVersion = Bukkit.getBukkitVersion();
|
||||
this.onlineMode = Bukkit.getOnlineMode();
|
||||
String ip = Bukkit.getIp();
|
||||
if (AsteriskSerializer.showSensitive || (ip.equals("") || ip.equals("0.0.0.0"))) {
|
||||
this.serverIP = ip;
|
||||
} else {
|
||||
this.serverIP = "***";
|
||||
}
|
||||
this.serverIP = Bukkit.getIp();
|
||||
this.serverPort = Bukkit.getPort();
|
||||
this.plugins = new ArrayList<>();
|
||||
|
||||
|
|
|
@ -32,6 +32,7 @@ import org.geysermc.geyser.adapters.spigot.SpigotAdapters;
|
|||
import org.geysermc.geyser.adapters.spigot.SpigotWorldAdapter;
|
||||
import org.geysermc.geyser.level.block.BlockStateValues;
|
||||
import org.geysermc.geyser.session.GeyserSession;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public class GeyserSpigotNativeWorldManager extends GeyserSpigotWorldManager {
|
||||
protected final SpigotWorldAdapter adapter;
|
||||
|
@ -49,4 +50,12 @@ public class GeyserSpigotNativeWorldManager extends GeyserSpigotWorldManager {
|
|||
}
|
||||
return adapter.getBlockAt(player.getWorld(), x, y, z);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public String[] getBiomeIdentifiers(boolean withTags) {
|
||||
// Biome identifiers will basically always be the same for one server, since you have to re-send the
|
||||
// ClientboundLoginPacket to change the registry. Therefore, don't bother caching for each player.
|
||||
return adapter.getBiomeSuggestions(withTags);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,9 +26,9 @@
|
|||
package org.geysermc.geyser.platform.spigot.world.manager;
|
||||
|
||||
import org.cloudburstmc.math.vector.Vector3i;
|
||||
import com.nukkitx.nbt.NbtMap;
|
||||
import com.nukkitx.nbt.NbtMapBuilder;
|
||||
import com.nukkitx.nbt.NbtType;
|
||||
import org.cloudburstmc.nbt.NbtMap;
|
||||
import org.cloudburstmc.nbt.NbtMapBuilder;
|
||||
import org.cloudburstmc.nbt.NbtType;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.block.Block;
|
||||
|
@ -38,7 +38,7 @@ import org.bukkit.inventory.ItemStack;
|
|||
import org.bukkit.inventory.meta.BookMeta;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.geysermc.geyser.level.GameRule;
|
||||
import org.geysermc.geyser.level.GeyserWorldManager;
|
||||
import org.geysermc.geyser.level.WorldManager;
|
||||
import org.geysermc.geyser.level.block.BlockStateValues;
|
||||
import org.geysermc.geyser.registry.BlockRegistries;
|
||||
import org.geysermc.geyser.session.GeyserSession;
|
||||
|
@ -51,7 +51,7 @@ import java.util.List;
|
|||
/**
|
||||
* The base world manager to use when there is no supported NMS revision
|
||||
*/
|
||||
public class GeyserSpigotWorldManager extends GeyserWorldManager {
|
||||
public class GeyserSpigotWorldManager extends WorldManager {
|
||||
private final Plugin plugin;
|
||||
|
||||
public GeyserSpigotWorldManager(Plugin plugin) {
|
||||
|
@ -151,12 +151,12 @@ public class GeyserSpigotWorldManager extends GeyserWorldManager {
|
|||
return true;
|
||||
}
|
||||
|
||||
public Boolean getGameRuleBool(GeyserSession session, GameRule gameRule) {
|
||||
public boolean getGameRuleBool(GeyserSession session, GameRule gameRule) {
|
||||
String value = Bukkit.getPlayer(session.getPlayerEntity().getUsername()).getWorld().getGameRuleValue(gameRule.getJavaID());
|
||||
if (!value.isEmpty()) {
|
||||
return Boolean.parseBoolean(value);
|
||||
}
|
||||
return (Boolean) gameRule.getDefaultValue();
|
||||
return gameRule.getDefaultBooleanValue();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -165,7 +165,7 @@ public class GeyserSpigotWorldManager extends GeyserWorldManager {
|
|||
if (!value.isEmpty()) {
|
||||
return Integer.parseInt(value);
|
||||
}
|
||||
return (int) gameRule.getDefaultValue();
|
||||
return gameRule.getDefaultIntValue();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue