ZetaMap / moreCommands

This mindustry plugin add more commands (+40) for players, admins, and server.
MIT License
26 stars 5 forks source link

more commands V11 fails to load after server crashes #11

Closed VaporSpace2 closed 2 years ago

VaporSpace2 commented 2 years ago

hi, i love this plugin as i have found no other like it. however a couple months ago one of my friends spawned in 9999999 daggers and crashed the server.

and now, even if i completely reinstall the server and redownload the plugin and put the .jar into the mods category it presents me with this error:

[05-20-2022 23:44:36] [I] |-> MoreCommands Plugin is loading .... [05-20-2022 23:44:36] [E] Failed to load mod file config/mods/moreCommands.jar. Skipping. [05-20-2022 23:44:36] [E] java.lang.reflect.InvocationTargetException at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:78) at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499) at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480) at mindustry.mod.Mods.loadMod(Mods.java:940) at mindustry.mod.Mods.loadMod(Mods.java:848) at mindustry.mod.Mods.load(Mods.java:415) at mindustry.Vars.init(Vars.java:332) at mindustry.server.ServerLauncher.init(ServerLauncher.java:47) at arc.backend.headless.HeadlessApplication.mainLoop(HeadlessApplication.java:64) at arc.backend.headless.HeadlessApplication$1.run(HeadlessApplication.java:52) Caused by: java.lang.ClassCastException: class arc.math.Rand cannot be cast to class mindustry.entities.Effect (arc.math.Rand and mindustry.entities.Effect are in unnamed module of loader 'app') at data.Effects.init(Effects.java:59) at moreCommandsPlugin.(moreCommandsPlugin.java:45) ... 12 more

    i have tried so many times to make this plugin work and i need help getting it to work if you could please!

    do note that i have no experience coding so it will be like telling an 80 year old how to plug in the TV.

    also edit: I don't know how to add labels to my opened issue.
ZetaMap commented 2 years ago

@VaporSpace2 what is your server version ?

VaporSpace2 commented 2 years ago

@ZetaMap v6 release, v126.3

ZetaMap commented 2 years ago

ok and your java version ?

ZetaMap commented 2 years ago

@VaporSpace2

VaporSpace2 commented 2 years ago

@ZetaMap on my computer i have JDK 17.

Version: Mindustry 6-release official / build 126.2

Java Version: 16.0.2

edit: it seems our time zones are off, my time zone is UTC- 7

ZetaMap commented 2 years ago

ow ok, mine is UTC+0

ZetaMap commented 2 years ago

and what's the version of the plugin ?

VaporSpace2 commented 2 years ago

@ZetaMap the plugin is v11 on the releases page.

I have tried compiling it myself through the actual repository instead of the src code from the releases page and it always presents errors even though I have JDK 17 and gradle installed properly.....

V11 on releases page

ZetaMap commented 2 years ago

mmm sorry, actualy i don't work on my plugin, I'm waiting for the end of my studies to work on it. So i don't have a solution except delete all settings files of the server.

VaporSpace2 commented 2 years ago

@ZetaMap well thanks for trying to help. If I am unable to fix the problem with the steps you gave me I might try to delete the server and re-host it

Miniontoby commented 1 year ago

Hi,

I am having this issue now.

[01-22-2023 14:22:31] ESC[94mESC[1m[I]ESC[0m |-> MoreCommands Plugin is loading ....ESC[0m
[01-22-2023 14:22:31] ESC[91mESC[1m[E] Failed to load mod file config/mods/moreCommands.jar. Skipping.ESC[0m
[01-22-2023 14:22:31] ESC[91mESC[1m[E] java.lang.reflect.InvocationTargetException
        at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:78)
        at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
        at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)
        at mindustry.mod.Mods.loadMod(Mods.java:954)
        at mindustry.mod.Mods.loadMod(Mods.java:862)
        at mindustry.mod.Mods.load(Mods.java:429)
        at mindustry.Vars.init(Vars.java:335)
        at mindustry.server.ServerLauncher.init(ServerLauncher.java:47)
        at arc.backend.headless.HeadlessApplication.mainLoop(HeadlessApplication.java:64)
        at arc.backend.headless.HeadlessApplication$1.run(HeadlessApplication.java:52)
Caused by: java.lang.ClassCastException: class arc.math.Rand cannot be cast to class mindustry.entities.Effect (arc.math.Rand and mindustry.entities.Effect a
re in unnamed module of loader 'app')
        at data.Effects.init(Effects.java:59)
        at moreCommandsPlugin.<init>(moreCommandsPlugin.java:45)
        ... 12 more
ESC[0m

I am using Mindustry Server Version 1.141 (latest atm)

I did not have a server crash that caused this.

You may ask more details if you need.

ZetaMap commented 1 year ago

mmmm problem is on a cast of effect field

I d'ont know to repair this. But a think you can test if you don't use /effect : change 'IllegalAccesException' by 'Exception' on file src/main/java/data/Effects.java at line 60, this (normally) catch every error can thrown the register system. And run the build.bat to build the modified version of plugin

Miniontoby commented 1 year ago

I made the change in the file and had to rewrite the build.bat into build.sh cause I am not on windows.

This now says:

java.lang.ClassCastException: class arc.math.Rand cannot be cast to class mindustry.entities.Effect (arc.math.Rand and mindustry.entities.Effect are in unnamed module of loader 'app')
        at data.Effects.init(Effects.java:59)
        at moreCommandsPlugin.<init>(moreCommandsPlugin.java:45)
        at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:78)
        at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
        at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)
        at mindustry.mod.Mods.loadMod(Mods.java:954)
        at mindustry.mod.Mods.loadMod(Mods.java:862)
        at mindustry.mod.Mods.load(Mods.java:429)
        at mindustry.Vars.init(Vars.java:335)
        at mindustry.server.ServerLauncher.init(ServerLauncher.java:47)
        at arc.backend.headless.HeadlessApplication.mainLoop(HeadlessApplication.java:64)
        at arc.backend.headless.HeadlessApplication$1.run(HeadlessApplication.java:52)
java.lang.ClassCastException: class arc.math.geom.Vec2 cannot be cast to class mindustry.entities.Effect (arc.math.geom.Vec2 and mindustry.entities.Effect are in unnamed module of loader 'app')
        at data.Effects.init(Effects.java:59)
        at moreCommandsPlugin.<init>(moreCommandsPlugin.java:45)
        at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:78)
        at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
        at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)
        at mindustry.mod.Mods.loadMod(Mods.java:954)
        at mindustry.mod.Mods.loadMod(Mods.java:862)
        at mindustry.mod.Mods.load(Mods.java:429)
        at mindustry.Vars.init(Vars.java:335)
        at mindustry.server.ServerLauncher.init(ServerLauncher.java:47)
        at arc.backend.headless.HeadlessApplication.mainLoop(HeadlessApplication.java:64)
        at arc.backend.headless.HeadlessApplication$1.run(HeadlessApplication.java:52)
ZetaMap commented 1 year ago

Don't worry, i'm working on New version of morecommands for V7, and it fixe this bug and other features 😉

Miniontoby commented 1 year ago

Don't worry, i'm working on New version of morecommands for V7, and it fixe this bug and other features 😉

Thx