Skip to content

Commit

Permalink
more fixes, remove gson, other fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
onebeastchris committed Jan 16, 2025
1 parent 510b462 commit 17a4656
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 12 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ jobs:
arguments: build
cache-read-only: ${{ github.ref_name != 'master' && github.ref_name != 'development' }}

- name: Archive Artifacts
uses: GeyserMC/actions/upload-multi-artifact@master
if: success()
with:
artifacts: |
GlobalLinkPlugin:build/libs/GlobalLinkPlugin.jar
- name: Notify Discord
if: ${{ (success() || failure()) && github.repository == 'GeyserMC/GlobalLinkServer' }}
uses: Tim203/actions-git-discord-webhook@main
Expand Down
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,25 @@
# GlobalLinkServer Plugin

> **Warning**
This repo contains the code for the Geyser Global Linking Server plugin.
If you want to just link your account, join link.geysermc.org on Minecraft Java or Bedrock.

### `server.properties`
```properties
allow-nether=false
generate-structures=false
generator-settings={"biome"\:"minecraft\:the_void","layers"\:[{"block"\:"minecraft\:air","height"\:1}]}
level-type=minecraft\:flat
motd=§aGeyserMC §bLinking §fServer
spawn-protection=200
```

### `spigot.yml`
```yaml
commands:
send-namespaced: false
```
### `bukkit.yml`
```yaml
settings:
Expand Down
3 changes: 1 addition & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ group = "org.geysermc.globallinkserver"
dependencies {
paperweight.paperDevBundle("1.21.4-R0.1-SNAPSHOT")

implementation(libs.gson) // newer version required for record support
implementation(libs.bundles.fastutil)
compileOnly(libs.floodgate.api)
implementation(libs.mariadb.client)
Expand Down Expand Up @@ -59,7 +58,7 @@ tasks.jar {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
from(configurations.runtimeClasspath.get().map { if (it.isDirectory) it else zipTree(it) })

archiveBaseName = "GlobalLinkServer"
archiveBaseName = "GlobalLinkPlugin"
archiveVersion = ""
archiveClassifier = ""
}
3 changes: 0 additions & 3 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
[versions]
gson = "2.10.1"
fastutil = "8.5.2"
mariadb-client = "2.7.3"
checker-qual = "3.21.1"
Expand All @@ -10,8 +9,6 @@ runpaper = "2.3.1"
[libraries]
floodgate-api = { group = "org.geysermc.floodgate", name = "api", version = "2.2.3-SNAPSHOT" }

gson = { module = "com.google.code.gson:gson", version.ref = "gson" }

fastutil-int-int-maps = { group = "com.nukkitx.fastutil", name = "fastutil-int-int-maps", version.ref = "fastutil" }
fastutil-int-object-maps = { group = "com.nukkitx.fastutil", name = "fastutil-int-object-maps", version.ref = "fastutil" }
fastutil-object-int-maps = { group = "com.nukkitx.fastutil", name = "fastutil-object-int-maps", version.ref = "fastutil" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,7 @@
import org.bukkit.event.entity.EntityDamageEvent;
import org.bukkit.event.entity.FoodLevelChangeEvent;
import org.bukkit.event.entity.PlayerDeathEvent;
import org.bukkit.event.player.PlayerCommandSendEvent;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.event.player.PlayerRecipeDiscoverEvent;
import org.bukkit.event.player.*;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.java.JavaPlugin;
import org.checkerframework.checker.nullness.qual.NonNull;
Expand Down Expand Up @@ -122,14 +119,19 @@ public void onEnable() {
world.setGameRule(GameRule.RANDOM_TICK_SPEED, 0);
world.setGameRule(GameRule.SHOW_DEATH_MESSAGES, false);

// Other changes
getServer().motd(Component.text("Global Link Server").color(NamedTextColor.AQUA));
getServer().clearRecipes();

// Make nighttime
world.setTime(18000);

getServer().setDefaultGameMode(GameMode.ADVENTURE);

LOGGER.info("Started Global Linking Server plugin!");
LOGGER.info("Started Global Linking plugin!");
}

// TODO does not remove commands
@EventHandler
public void onCommands(PlayerCommandSendEvent event) {
Collection<String> toRemove = new ArrayList<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ public CompletableFuture<Optional<Link>> attemptFindJavaLink(Player player) {
() -> {
try (Connection connection = dataSource.getConnection()) {
try (PreparedStatement query = connection.prepareStatement(
"SELECT `bedrock_id` FROM `links` WHERE `java_id` = ? LIMIT 1")) {
"SELECT `bedrock_id` FROM `links` WHERE `java_id` = ?")) {
query.setString(1, player.getUniqueId().toString());

try (ResultSet resultSet = query.executeQuery()) {
Expand Down

0 comments on commit 17a4656

Please sign in to comment.