Git Product home page Git Product logo

Comments (3)

friendlyhj avatar friendlyhj commented on September 16, 2024

Someone told me the exception stack trace won't be printed after script reloading. But I couldn't reproduce the bug.

// functions.zs
#loader crafttweaker reloadable
#priority 100
import crafttweaker.item.IItemStack;

function throwException() as void {
    val item as IItemStack = null;
    print(item.commandString);
}

// reload.zs
#loader crafttweaker reloadable
import crafttweaker.event.PlayerCraftedEvent;
import crafttweaker.player.IPlayer;

events.onPlayerCrafted(function(event as PlayerCraftedEvent) {
    val player as IPlayer = event.player;
    if (event.player.world.remote) return;
    event.player.world.catenation() // builds a new catenation
        .run(function(world, context) {
            scripts.functions.throwException();
        })
        .start();
});

log:

[SERVER_STARTED][SERVER][INFO] [reloadable | SIDE_CLIENT]: Loading Script: {[0:crafttweaker|reloadable]: reload.zs}
[SERVER_STARTED][SERVER][INFO] [reloadable | SIDE_CLIENT]: Skipping file {[0:crafttweaker]: reuse.zs} as we are currently loading with a different loader
[SERVER_STARTED][SERVER][INFO] [reloadable | SIDE_CLIENT]: Skipping file {[0:crafttweaker]: test.zs} as we are currently loading with a different loader
[SERVER_STARTED][SERVER][INFO] [reloadable | SIDE_CLIENT]: Skipping file {[0:crafttweaker]: testDelay.zs} as we are currently loading with a different loader
[SERVER_STARTED][SERVER][INFO] Completed script loading in: 19ms
[SERVER_STARTED][SERVER][ERROR] Exception occurred in a catenation task, stopping the catenation...
java.lang.NullPointerException
	at Functions.throwException(functions.zs:7)
	at CrafttweakerReloadableReload3.apply(reload.zs:10)
	at youyihj.zenutils.impl.util.catenation.InstantTask.run(InstantTask.java:21)
	at youyihj.zenutils.api.util.catenation.Catenation.tick(Catenation.java:48)
	at youyihj.zenutils.impl.util.catenation.CatenationManager.lambda$onWorldTick$0(CatenationManager.java:31)
	at youyihj.zenutils.impl.util.catenation.CatenationManager$$Lambda$1123.000000001A55B750.test(Unknown Source)
	at java.util.Collection.removeIf(Collection.java:414)
	at youyihj.zenutils.impl.util.catenation.CatenationManager.onWorldTick(CatenationManager.java:31)
	at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_53_CatenationManager_onWorldTick_WorldTickEvent.invoke(.dynamic)
	at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:90)
	at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:182)
	at net.minecraftforge.fml.common.FMLCommonHandler.onPreWorldTick(FMLCommonHandler.java:287)
	at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:752)
	at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:668)
	at net.minecraft.server.integrated.IntegratedServer.func_71217_p(IntegratedServer.java:185)
	at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:526)
	at java.lang.Thread.run(Thread.java:813)

Can you test whether these scripts can dump stack trace, or post your test scripts?

from zenutils.

Krutoy242 avatar Krutoy242 commented on September 16, 2024

Seems like this happen when VanillaFix or LoliAMS recovering from crash.
So, probably, to reproduce i need:

  1. Cause fatal error inside catenation (usually error that cause crash from mod)
  2. Dropped to main menu, enter world again
  3. Spawn same error with catenation again, but this time no stack trace

I will probably try to reproduce this later.

from zenutils.

Krutoy242 avatar Krutoy242 commented on September 16, 2024

Since this issue happens exceptionally rare, i could close issue. Thank you for your utils!

from zenutils.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.