Skip to content

Commit

Permalink
Fix scoreboardsuffix crash on initial launch
Browse files Browse the repository at this point in the history
Bump dependencies
Cleanup
  • Loading branch information
kyrptonaught committed May 8, 2024
1 parent 4014362 commit 92fe5d9
Show file tree
Hide file tree
Showing 13 changed files with 26 additions and 38 deletions.
11 changes: 4 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import net.fabricmc.loom.task.RemapJarTask
plugins {
id 'fabric-loom' version '1.6-SNAPSHOT'
id 'maven-publish'
id 'com.github.johnrengelman.shadow' version '8.1.1'
id 'io.github.goooler.shadow' version "8.1.7"
}

version = project.mod_version
Expand Down Expand Up @@ -36,7 +36,7 @@ dependencies {

//Luck Perms
modImplementation('maven.modrinth:luckperms:v5.4.113-fabric') { exclude group: "net.fabricmc.fabric-api" }
modImplementation('me.lucko:fabric-permissions-api:0.3-SNAPSHOT') { exclude group: "net.fabricmc.fabric-api" }
modImplementation('me.lucko:fabric-permissions-api:0.3.1') { exclude group: "net.fabricmc.fabric-api" }
compileOnly 'net.luckperms:api:5.4'
modImplementation "com.moandjiezana.toml:toml4j:0.7.2"

Expand All @@ -62,12 +62,9 @@ dependencies {
modImplementation include("ru.pinkgoosik:nota:0.2.0-lem-v2-1.20.4")

//Discord Bridge
shadow implementation("net.dv8tion:JDA:5.0.0-beta.20") { exclude module: 'opus-java' }
shadow implementation("net.dv8tion:JDA:5.0.0-beta.23") { exclude module: 'opus-java' }

shadow implementation("io.javalin:javalin:6.0.1")

//Apache Compress
shadow implementation("org.apache.commons:commons-compress:1.25.0")
shadow implementation("io.javalin:javalin:6.1.4")
}

loom {
Expand Down
8 changes: 4 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ org.gradle.jvmargs=-Xmx2G
# Fabric Properties
minecraft_version=1.20.4
yarn_mappings=1.20.4+build.3
loader_version=0.15.6
loader_version=0.15.11

#Fabric api
fabric_version=0.95.4+1.20.4
# Fabric API
fabric_version=0.97.0+1.20.4

# Mod Properties
mod_version=1.0.8b11-1.20.4
mod_version=1.0.8b12-1.20.4
maven_group=net.kyrptonaught
archives_base_name=ServerUtils

10 changes: 0 additions & 10 deletions src/main/java/net/kyrptonaught/serverutils/FileHelper.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package net.kyrptonaught.serverutils;

import org.apache.commons.compress.archivers.zip.ZipArchiveEntry;
import org.apache.commons.compress.archivers.zip.ZipFile;
import org.apache.commons.io.FileUtils;

import java.io.IOException;
Expand Down Expand Up @@ -59,14 +57,6 @@ public FileVisitResult visitFile(Path file, BasicFileAttributes attrs)
}

public static String readFileFromZip(Path zipFile, String fileName) {
try (ZipFile zip = new ZipFile(zipFile)) {
ZipArchiveEntry entry = zip.getEntry(fileName);

return new String(zip.getInputStream(entry).readAllBytes());
} catch (Exception e) {
e.printStackTrace();
}

return null;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import net.minecraft.network.PacketByteBuf;
import net.minecraft.network.packet.s2c.common.DisconnectS2CPacket;
import net.minecraft.server.network.ServerCommonNetworkHandler;
import net.minecraft.server.network.ServerPlayNetworkHandler;
import net.minecraft.server.network.ServerPlayerEntity;
import net.minecraft.text.Text;
import net.minecraft.util.Identifier;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package net.kyrptonaught.serverutils.customMapLoader;

import com.mojang.brigadier.CommandDispatcher;
import net.fabricmc.fabric.api.event.lifecycle.v1.ServerLifecycleEvents;
import net.kyrptonaught.serverutils.Module;
import net.kyrptonaught.serverutils.ServerUtilsMod;
import net.kyrptonaught.serverutils.chestTracker.ChestTrackerMod;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public void registerCommands(CommandDispatcher<ServerCommandSource> dispatcher)
DimensionLoaderCommand.registerCommands(dispatcher);
}

public static void loadDimension(Identifier id, Identifier dimID, Consumer<MinecraftServer> onComplete ) {
public static void loadDimension(Identifier id, Identifier dimID, Consumer<MinecraftServer> onComplete) {
loadedWorlds.put(id, new CustomDimHolder(id, dimID, onComplete));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,17 @@
import net.minecraft.network.packet.BrandCustomPayload;
import net.minecraft.network.packet.c2s.common.CustomPayloadC2SPacket;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.network.*;
import net.minecraft.server.network.ConnectedClientData;
import net.minecraft.server.network.ServerCommonNetworkHandler;
import net.minecraft.server.network.ServerConfigurationNetworkHandler;
import net.minecraft.text.Text;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;


@Mixin(ServerConfigurationNetworkHandler.class)
public abstract class ServerConfigNetworkHandlerMixin extends ServerCommonNetworkHandler {
public abstract class ServerConfigNetworkHandlerMixin extends ServerCommonNetworkHandler {


@Shadow
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package net.kyrptonaught.serverutils.mixin.healthSpoofer;

import com.mojang.authlib.GameProfile;
import net.minecraft.block.BlockState;
import net.minecraft.entity.attribute.EntityAttributeInstance;
import net.minecraft.entity.attribute.EntityAttributes;
import net.minecraft.entity.player.PlayerEntity;
Expand All @@ -10,7 +9,6 @@
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;

import java.util.Collections;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.scoreboard.ScoreHolder;
import net.minecraft.scoreboard.Scoreboard;
import net.minecraft.scoreboard.ScoreboardObjective;
import net.minecraft.scoreboard.Team;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.network.ServerPlayerEntity;
Expand Down Expand Up @@ -45,8 +46,11 @@ private void updatePlayerNameWithScore(CallbackInfoReturnable<Text> cir) {
ScoreboardSuffixMod.playerSuffixStorage.suffixFormat.scoreboardSuffixes.forEach(newSuffix -> {
if (newSuffix instanceof SuffixFormat.ScoreboardSuffix) {
String scoreboardName = newSuffix.suffix;
int score = scoreboard.getOrCreateScore(ScoreHolder.fromName(player), scoreboard.getNullableObjective(scoreboardName)).getScore();
((SuffixFormat.ScoreboardSuffix) newSuffix).updateText(score);
ScoreboardObjective obj = scoreboard.getNullableObjective(scoreboardName);
if (obj != null) {
int score = scoreboard.getOrCreateScore(ScoreHolder.fromName(player), obj).getScore();
((SuffixFormat.ScoreboardSuffix) newSuffix).updateText(score);
}
}

Style style = newSuffix.displayText.getStyle();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@
import net.fabricmc.fabric.api.event.lifecycle.v1.ServerTickEvents;
import net.fabricmc.fabric.api.networking.v1.ServerPlayConnectionEvents;
import net.kyrptonaught.serverutils.Module;
import net.minecraft.command.argument.BlockPosArgumentType;
import net.minecraft.command.argument.EntityArgumentType;
import net.minecraft.command.argument.PosArgument;
import net.minecraft.command.argument.Vec3ArgumentType;
import net.minecraft.entity.attribute.EntityAttributes;
import net.minecraft.entity.effect.StatusEffectInstance;
Expand All @@ -19,10 +17,12 @@
import net.minecraft.server.command.CommandManager;
import net.minecraft.server.command.ServerCommandSource;
import net.minecraft.server.network.ServerPlayerEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3d;

import java.util.*;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;

public class PlayerLockdownMod extends Module {
public static boolean GLOBAL_LOCKDOWN = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public static void onPlayerConnect(ServerPlayNetworkHandler handler, PacketSende
}

public static void checkBrand(ServerPlayerEntity player, String brand) {
if(brand == null) return;
if (brand == null) return;

if (brand.contains("forge"))
setForgeClient(player, true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import net.kyrptonaught.serverutils.ServerUtilsMod;
import net.minecraft.advancement.criterion.Criteria;
import net.minecraft.command.argument.EntityArgumentType;
import net.minecraft.entity.attribute.EntityAttributes;
import net.minecraft.network.packet.s2c.common.ResourcePackRemoveS2CPacket;
import net.minecraft.network.packet.s2c.common.ResourcePackSendS2CPacket;
import net.minecraft.server.command.CommandManager;
Expand All @@ -26,7 +25,7 @@ public class SwitchableResourcepacksMod extends ModuleWConfig<ResourcePackConfig
public static final HashMap<String, ResourcePackConfig.RPOption> rpOptionHashMap = new HashMap<>();
public static CustomCriterion STARTED, FINISHED, FAILED;

public static final HashMap<UUID,String> playerLoaded = new HashMap<>();
public static final HashMap<UUID, String> playerLoaded = new HashMap<>();

public void onConfigLoad(ResourcePackConfig config) {
rpOptionHashMap.clear();
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"schemaVersion": 1,
"id": "serverutils",
"version": "1.0.8b11-1.20.4",
"version": "1.0.8b12-1.20.4",
"name": "Server Utils",
"description": "A group of utilities for servers",
"authors": [
Expand Down

0 comments on commit 92fe5d9

Please sign in to comment.