Fix a fatal crash due to class not found

This commit is contained in:
Zontreck 2022-10-08 19:30:20 -07:00
parent 7d80cf6a87
commit 9153f2a853
7 changed files with 23 additions and 32 deletions

View file

@ -3,7 +3,7 @@
org.gradle.jvmargs=-Xmx8G
org.gradle.daemon=false
my_version=1.3.3.4
my_version=1.3.3.5
mc_version=1.19.2
forge_version=43.1.32

View file

@ -1,48 +1,31 @@
package dev.zontreck.otemod.commands.homes;
import java.sql.Array;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.List;
import com.ibm.icu.impl.InvalidFormatException;
import com.mojang.brigadier.CommandDispatcher;
import com.mojang.brigadier.arguments.StringArgumentType;
import com.mojang.brigadier.context.CommandContext;
import com.mojang.brigadier.exceptions.CommandSyntaxException;
import com.mojang.math.Vector3d;
import dev.zontreck.otemod.OTEMod;
import dev.zontreck.otemod.chat.ChatColor;
import dev.zontreck.otemod.chat.ChatServerOverride;
import dev.zontreck.otemod.commands.teleport.TeleportActioner;
import dev.zontreck.otemod.commands.teleport.TeleportContainer;
import dev.zontreck.otemod.configs.PlayerFlyCache;
import dev.zontreck.otemod.database.TeleportDestination;
import dev.zontreck.otemod.exceptions.InvalidDeserialization;
import net.minecraft.commands.CommandSourceStack;
import net.minecraft.commands.Commands;
import net.minecraft.nbt.NbtUtils;
import net.minecraft.network.chat.contents.TranslatableContents;
import net.minecraft.resources.ResourceKey;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.TickTask;
import net.minecraft.server.commands.BossBarCommands;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.world.BossEvent.BossBarColor;
import net.minecraft.world.effect.MobEffectInstance;
import net.minecraft.world.effect.MobEffectUtil;
import net.minecraft.world.effect.MobEffects;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.level.Level;
import net.minecraft.world.phys.Vec2;
import net.minecraft.world.phys.Vec3;
import net.minecraftforge.server.command.TextComponentHelper;
import net.minecraft.network.chat.Component;
import net.minecraft.network.chat.MutableComponent;
@ -148,7 +131,7 @@ public class HomeCommand {
ctx.sendFailure(Component.translatable("dev.zontreck.otemod.msgs.homes.goto.fail"));
else
ctx.sendFailure(Component.literal("FAILED SQL: "+ ChatColor.GOLD+ SQL));
} catch (InvalidFormatException e) {
} catch (InvalidDeserialization e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (CommandSyntaxException e) {

View file

@ -1,7 +1,6 @@
package dev.zontreck.otemod.containers;
import com.ibm.icu.impl.InvalidFormatException;
import dev.zontreck.otemod.exceptions.InvalidDeserialization;
import net.minecraft.world.phys.Vec2;
import net.minecraft.world.phys.Vec3;
@ -31,7 +30,7 @@ public class Vector2
y=pos.y;
}
public Vector2(String pos) throws InvalidFormatException
public Vector2(String pos) throws InvalidDeserialization
{
// This will be serialized most likely from the ToString method
// Parse
@ -46,7 +45,7 @@ public class Vector2
if(positions.length!=2)
{
throw new InvalidFormatException("Positions must be in the same format provided by ToString() (ex. <1,1> or <1, 1>");
throw new InvalidDeserialization("Positions must be in the same format provided by ToString() (ex. <1,1> or <1, 1>");
}
this.x = Float.parseFloat(positions[0]);

View file

@ -1,7 +1,6 @@
package dev.zontreck.otemod.containers;
import com.ibm.icu.impl.InvalidFormatException;
import dev.zontreck.otemod.exceptions.InvalidDeserialization;
import net.minecraft.world.phys.Vec3;
public class Vector3
@ -33,7 +32,7 @@ public class Vector3
z=pos.z;
}
public Vector3(String pos) throws InvalidFormatException
public Vector3(String pos) throws InvalidDeserialization
{
// This will be serialized most likely from the ToString method
// Parse
@ -48,7 +47,7 @@ public class Vector3
if(positions.length!=3)
{
throw new InvalidFormatException("Positions must be in the same format provided by ToString() (ex. <1,1,1> or <1, 1, 1>");
throw new InvalidDeserialization("Positions must be in the same format provided by ToString() (ex. <1,1,1> or <1, 1, 1>");
}
this.x = Double.parseDouble(positions[0]);

View file

@ -1,9 +1,8 @@
package dev.zontreck.otemod.database;
import com.ibm.icu.impl.InvalidFormatException;
import dev.zontreck.otemod.containers.Vector2;
import dev.zontreck.otemod.containers.Vector3;
import dev.zontreck.otemod.exceptions.InvalidDeserialization;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.nbt.NbtUtils;
@ -15,7 +14,7 @@ public class TeleportDestination {
public Vector2 Rotation;
public String Dimension;
public TeleportDestination(CompoundTag tag) throws InvalidFormatException
public TeleportDestination(CompoundTag tag) throws InvalidDeserialization
{
Position = new Vector3(tag.getString("Position"));
Rotation = new Vector2(tag.getString("Rotation"));

View file

@ -0,0 +1,11 @@
package dev.zontreck.otemod.exceptions;
public class InvalidDeserialization extends Exception
{
public InvalidDeserialization(String error){
super(error);
}
public InvalidDeserialization(){
super("Incorrect information was provided to the deserializer");
}
}

View file

@ -19,7 +19,7 @@ modId="otemod" #mandatory
# The version number of the mod - there's a few well known ${} variables useable here or just hardcode it
# ${file.jarVersion} will substitute the value of the Implementation-Version as read from the mod's JAR file metadata
# see the associated build.gradle script for how to populate this completely automatically during a build
version="1.3.3.4" #mandatory
version="1.3.3.5" #mandatory
# A display name for the mod
displayName="OTEMod Resources" #mandatory
# A URL to query for updates for this mod. See the JSON update specification https://mcforge.readthedocs.io/en/latest/gettingstarted/autoupdate/