Clean up a bunch

Mostly checked with IntelliJ, but manually performed. The only issue I possibly anticipate is item name/lore issues, but the new method should be technically better.
This commit is contained in:
Camotoy 2021-06-20 21:42:22 -04:00
parent 683ac1c763
commit 3a2cff7864
No known key found for this signature in database
GPG key ID: 7EEFB66FE798081F
43 changed files with 125 additions and 190 deletions

View file

@ -37,13 +37,13 @@ import java.util.List;
@Getter
public class GeyserSpigotDumpInfo extends BootstrapDumpInfo {
private String platformName;
private String platformVersion;
private String platformAPIVersion;
private boolean onlineMode;
private String serverIP;
private int serverPort;
private List<PluginInfo> plugins;
private final String platformName;
private final String platformVersion;
private final String platformAPIVersion;
private final boolean onlineMode;
private final String serverIP;
private final int serverPort;
private final List<PluginInfo> plugins;
GeyserSpigotDumpInfo() {
super();

View file

@ -34,6 +34,7 @@ import org.bukkit.util.CachedServerIcon;
import org.geysermc.connector.common.ping.GeyserPingInfo;
import org.geysermc.connector.ping.IGeyserPingPassthrough;
import javax.annotation.Nonnull;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.util.Collections;
@ -72,9 +73,10 @@ public class GeyserSpigotPingPassthrough implements IGeyserPingPassthrough {
public void setServerIcon(CachedServerIcon icon) throws IllegalArgumentException, UnsupportedOperationException {
}
@Nonnull
@Override
public Iterator<Player> iterator() throws UnsupportedOperationException {
return Collections.EMPTY_LIST.iterator();
return Collections.emptyIterator();
}
}

View file

@ -150,7 +150,7 @@ public class GeyserSpigotPlugin extends JavaPlugin implements GeyserBootstrap {
this.geyserSpigotPingPassthrough = new GeyserSpigotPingPassthrough(geyserLogger);
}
this.geyserCommandManager = new GeyserSpigotCommandManager(this, connector);
this.geyserCommandManager = new GeyserSpigotCommandManager(connector);
boolean isViaVersion = Bukkit.getPluginManager().getPlugin("ViaVersion") != null;
if (isViaVersion) {

View file

@ -30,7 +30,6 @@ import org.bukkit.command.Command;
import org.bukkit.command.CommandMap;
import org.geysermc.connector.GeyserConnector;
import org.geysermc.connector.command.CommandManager;
import org.geysermc.platform.spigot.GeyserSpigotPlugin;
import java.lang.reflect.Field;
@ -48,12 +47,8 @@ public class GeyserSpigotCommandManager extends CommandManager {
}
}
private GeyserSpigotPlugin plugin;
public GeyserSpigotCommandManager(GeyserSpigotPlugin plugin, GeyserConnector connector) {
public GeyserSpigotCommandManager(GeyserConnector connector) {
super(connector);
this.plugin = plugin;
}
@Override

View file

@ -93,7 +93,6 @@ public class GeyserSpigot1_12WorldManager extends GeyserSpigotWorldManager {
* @param z Z coordinate of block
* @return the block state updated to the latest Minecraft version
*/
@SuppressWarnings("deprecation")
public int getLegacyBlock(BlockStorage storage, int blockId, int x, int y, int z) {
// Convert block state from old version (1.12.2) -> 1.13 -> 1.13.1 -> 1.14 -> 1.15 -> 1.16 -> 1.16.2
blockId = mappingData1_12to1_13.getNewBlockId(blockId);