ContentTweaker

ContentTweaker

27M Downloads

Tile Entity crash on block load

Hallowizer opened this issue ยท 2 comments

commented

Hi! I had the following tile entity code in my ZenScript:

monoEmptyTE.serverUpdate = function(world as World, pos as BlockPos, data) {
	var monoliths = [<block:contenttweaker:monolith_cthulhu>, <block:contenttweaker:monolith_hastur>, <block:contenttweaker:monolith_jzahar>, <block:contenttweaker:monolith_azathoth>, <block:contenttweaker:monolith_nyarlathotep>, <block:contenttweaker:monolith_yogsothoth>, <block:contenttweaker:monolith_shubnigurath>];
	var currentPos = pos;
	
	while (currentPos.y <= 255) {
		print("currentPos ok");
		
		if (world.getBlockState(currentPos) == <block:abyssalcraft:statue>) {
			world.setBlockState(monoliths[world.getBlockState(currentPos).meta] as BlockState, pos);
			break;
		}
		
		if ((world.getBlockState(currentPos) != <block:abyssalcraft:stone>) | (world.getBlockState(currentPos).meta != 7)) {
			return;
		}
		
		currentPos = currentPos.getOffset("up", 1);
	}
};

Every time I place this block, or load a world with this block loaded, the game crashes with a truncated class file exception:

net.minecraft.util.ReportedException: Ticking block entity
	at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:773) ~[MinecraftServer.class:?]
	at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:668) ~[MinecraftServer.class:?]
	at net.minecraft.server.integrated.IntegratedServer.func_71217_p(IntegratedServer.java:185) ~[chd.class:?]
	at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:526) [MinecraftServer.class:?]
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_201]
Caused by: java.lang.ClassFormatError: Truncated class file
	at java.lang.ClassLoader.defineClass1(Native Method) ~[?:1.8.0_201]
	at java.lang.ClassLoader.defineClass(ClassLoader.java:763) ~[?:1.8.0_201]
	at java.lang.ClassLoader.defineClass(ClassLoader.java:642) ~[?:1.8.0_201]
	at stanhebben.zenscript.ZenModule$MyClassLoader.loadClass(ZenModule.java:419) ~[ZenModule$MyClassLoader.class:?]
	at ZenClassContenttweakerMonoliths4.onUpdate(Unknown Source) ~[?:?]
	at com.teamacronymcoders.contenttweaker.modules.vanilla.tileentity.TileEntityContent.func_73660_a(TileEntityContent.java:57) ~[TileEntityContent.class:?]
	at net.minecraft.world.World.func_72939_s(World.java:1838) ~[amu.class:?]
	at net.minecraft.world.WorldServer.func_72939_s(WorldServer.java:613) ~[oo.class:?]
	at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:767) ~[MinecraftServer.class:?]
	... 4 more

I am not sure why this is happening, and I believe this is related to one of the ContentTweaker API classes, because the custom TE class is in the stack trace, and that is loading a truncated class. Can this be resolved?

commented

TileEntity code was never finished, and shouldn't be useable.

commented

Well, we need the crafttweaker log file as well.