Skip to content

Commit

Permalink
Minor overhauls and version change to 2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
notdevcody committed Apr 11, 2024
1 parent 4cb9752 commit e70c4d8
Show file tree
Hide file tree
Showing 7 changed files with 98 additions and 30 deletions.
33 changes: 16 additions & 17 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.bukkit</groupId>
<artifactId>project-poseidon</artifactId>
<artifactId>uberbukkit</artifactId>
<packaging>jar</packaging>
<version>1.1.8</version>
<name>Project-Poseidon</name>
<version>2.0.0</version>
<name>UberBukkit</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<api.version>unknown</api.version>
Expand Down Expand Up @@ -73,7 +73,6 @@
<systemPath>${project.basedir}/libs/ModLoaderMP.jar</systemPath>
</dependency>


<dependency>
<groupId>org.avaje</groupId>
<artifactId>ebean</artifactId>
Expand Down Expand Up @@ -120,20 +119,20 @@
<artifactId>gson</artifactId>
<version>2.9.0</version>
</dependency>

</dependencies>

<!-- This builds a completely 'ready to start' jar with all dependencies inside -->
<build>
<defaultGoal>clean install</defaultGoal>
<!-- <sourceDirectory>src</sourceDirectory>-->
<!-- <resources>-->
<!-- <resource>-->
<!-- <directory>src</directory>-->
<!-- <excludes>-->
<!-- <exclude>**/*.java</exclude>-->
<!-- </excludes>-->
<!-- </resource>-->
<!-- </resources>-->
<!-- <sourceDirectory>src</sourceDirectory>-->
<!-- <resources>-->
<!-- <resource>-->
<!-- <directory>src</directory>-->
<!-- <excludes>-->
<!-- <exclude>**/*.java</exclude>-->
<!-- </excludes>-->
<!-- </resource>-->
<!-- </resources>-->
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand All @@ -143,8 +142,8 @@
<archive>
<manifestEntries>
<Main-Class>org.bukkit.craftbukkit.Main</Main-Class>
<Implementation-Title>Project-Posiden</Implementation-Title>
<Implementation-Vendor>RhysB</Implementation-Vendor>
<Implementation-Title>UberBukkit</Implementation-Title>
<Implementation-Vendor>Moresteck</Implementation-Vendor>
<Specification-Title>Bukkit</Specification-Title>
<Specification-Version>${api.version}</Specification-Version>
<Specification-Vendor>Bukkit Team</Specification-Vendor>
Expand Down
12 changes: 7 additions & 5 deletions src/main/java/org/bukkit/command/SimpleCommandMap.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,17 @@

import org.bukkit.Server;
import org.bukkit.command.defaults.*;
import uk.betacraft.uberbukkit.command.*;

import java.util.*;

import static org.bukkit.util.Java15Compat.Arrays_copyOfRange;

public class SimpleCommandMap implements CommandMap {
protected final Map<String, Command> knownCommands = new HashMap<String, Command>();
protected final Set<String> aliases = new HashSet<String>();
protected final Map<String, Command> knownCommands = new HashMap<>();
protected final Set<String> aliases = new HashSet<>();
private final Server server;
protected static final Set<VanillaCommand> fallbackCommands = new HashSet<VanillaCommand>();
protected static final Set<VanillaCommand> fallbackCommands = new HashSet<>();

static {
fallbackCommands.add(new ListCommand());
Expand Down Expand Up @@ -43,9 +44,10 @@ public SimpleCommandMap(final Server server) {
}

private void setDefaultCommands(final Server server) {
register("poseidon", new PoseidonCommand("poseidon"));
register("uberbukkit", new CrackedAllowlistCommand());
register("uberbukkit", new UberBukkitCommand());
register("uberbukkit", new FlushInvCommand());
register("uberbukkit", new UuidLookupCommand());
register("uberbukkit", new CrackedAllowlistCommand());
register("bukkit", new VersionCommand("version"));
register("bukkit", new ReloadCommand("reload"));
register("bukkit", new PluginsCommand("plugins"));
Expand Down
16 changes: 10 additions & 6 deletions src/main/java/uk/betacraft/uberbukkit/Uberbukkit.java
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
package uk.betacraft.uberbukkit;

import java.util.LinkedList;
import java.util.List;

import org.bukkit.Bukkit;

import com.legacyminecraft.poseidon.PoseidonConfig;

import net.minecraft.server.MinecraftServer;
import org.bukkit.Bukkit;
import uk.betacraft.uberbukkit.protocol.Protocol;

import java.util.LinkedList;
import java.util.List;

public class Uberbukkit {
// TODO: Change this automatically migration to Gradle
private static final String version = "2.0.0";
private static Integer pvn = null;
private static List<Integer> pvns = null;

Expand Down Expand Up @@ -59,4 +59,8 @@ public static List<Integer> getAllowedPVNs() {
public static Protocol getProtocolHandler() {
return Protocol.getProtocolClass(getTargetPVN());
}

public static String getVersion() {
return version;
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.bukkit.command.defaults;
package uk.betacraft.uberbukkit.command;

import org.bukkit.ChatColor;
import org.bukkit.command.Command;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.bukkit.command.defaults;
package uk.betacraft.uberbukkit.command;

import java.util.ArrayList;
import java.util.HashMap;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package uk.betacraft.uberbukkit.command;

import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import uk.betacraft.uberbukkit.Uberbukkit;

public class UberBukkitCommand extends Command {
public UberBukkitCommand() {
super("uberbukkit");
this.description = "Shows information about the UberBukkit version ran on the server";
this.usageMessage = "/uberbukkit";
}

@Override
public boolean execute(CommandSender sender, String commandLabel, String[] args) {
sender.sendMessage(ChatColor.GRAY + "This server is running " + ChatColor.RED + "UberBukkit " + ChatColor.GOLD + Uberbukkit.getVersion());
sender.sendMessage(ChatColor.GRAY + "Based on Project Poseidon " + ChatColor.AQUA + Bukkit.getServer().getPoseidonVersion());

return true;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package uk.betacraft.uberbukkit.command;

import com.projectposeidon.api.PoseidonUUID;
import com.projectposeidon.api.UUIDType;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;

import java.util.UUID;

public class UuidLookupCommand extends Command {
public UuidLookupCommand() {
super("uuidlookup");
this.usageMessage = "/uuidlookup <username>";
}

@Override
public boolean execute(CommandSender sender, String commandLabel, String[] args) {
if (args.length != 1) {
sender.sendMessage(ChatColor.GRAY + "Usage: " + ChatColor.WHITE + "/uuidlookup " + ChatColor.AQUA + "<username>");
return true;
}

UUID uuid = PoseidonUUID.getPlayerUUIDFromCache(args[0], true);
if (uuid == null) {
uuid = PoseidonUUID.getPlayerUUIDFromCache(args[0], false);
}

if (uuid == null) {
sender.sendMessage(ChatColor.GRAY + "Unable to locate the UUID of the player called " + ChatColor.AQUA + args[0] + ChatColor.GRAY + "! Please remember usernames are cap sensitive");
return true;
}

UUIDType uuidType = PoseidonUUID.getPlayerUUIDCacheStatus(args[0]);
sender.sendMessage(ChatColor.GRAY + "uuidlookup > " + ChatColor.AQUA + args[0] + ChatColor.GRAY + " - " + ChatColor.GOLD + "UUID Type: " + ChatColor.YELLOW + uuidType.toString());
sender.sendMessage(ChatColor.GRAY + "uuidlookup > " + ChatColor.YELLOW + "UUID: " + ChatColor.WHITE + uuid);

return true;
}
}

0 comments on commit e70c4d8

Please sign in to comment.