Added Question: World Generator Attribute "allowedBiomes". Will this support new biomes, such as those from Biomes O Plenty or only Vanilla biomes? Thanks!
It should work with all biomes available in the game.
Selfish, impatient, ungrateful question: Awhile back, a post suggested that items would eventually have their own array/metadata like blocks. Would this be something that might make it to the next patch or would it be further down the road. I was going to start cleaning up my CS2 but then thought that if the item meta-data values are around the bend I could be lazy and postpone it.
I think I'm going to do this in the nearer future since I'm starting with ingame item creation.
@CubeX2: Something I noticed, when I try to load a CustomStuff project from a .zip file, it seems to want to load the textures from a folder with the same name. For example: "/StainedWood/textures/blocks/planksBlack.png" when it should be trying to load "/StainedWood.zip/textures/blocks/planksBlack.png". This is what's causing the missing texture problem.
Is this something that you can fix? Thanks in advance.
You have to change the textures directory in .zip files. For example: "/StainedWood.zip/mods/StainedWood/textures/".
@CubeX2 - What happened to the world.getBlockType() function? I am trying to update my flood detection script a bit and would love to use if(world.getBlockType(position) == "fluid") in my script since several mods add fluids to the game. Also, would it be possible to add a mod.getBlockType(integer id) function? I currently have my script setup so that it grabs the block id before testing testing it later. Either would work great for my purposes though.
I'll add these two functions but it may not work with some blocks from other non-CS2 mods. For those blocks it will return "unknown" or something like that.
Rollback Post to RevisionRollBack
I'm on twitter: @CubeX2_. Follow me for upcoming features and other stuff ;).
OK, I'll try it out and add it to the wiki if it works. Thanks CubeX2!
I agree, the textures directory should be top level in the archive file, not re-nested inside its own mod folder have its own mod folder re-nested inside itself.... Cubex2, please tell me you're only saying that as a workaround and that this is not intended behavior... otherwise why is it creating a texture folder inside the mod's folder and populating it with textures?
OK, before I go totally and completely insane trying to figure this out, is anyone else having a problem with smelting recipes in the latest version? All of my smelting recipes seem to totally disregard block metadata for both input and output. For input, it just takes any metadata value as though I'd used mod.addAlias instead of mod.addAliasWithMetadata. For output, it always just uses the 0 value for that block.
Is anyone else having this problem?
Edit: It appears to be crafting recipes too. And it's not just one, everything in both of my projects seems to be affected. I'm thinking this one isn't my fault.
OK, before I go totally and completely insane trying to figure this out, is anyone else having a problem with smelting recipes in the latest version? All of my smelting recipes seem to totally disregard block metadata for both input and output. For input, it just takes any metadata value as though I'd used mod.addAlias instead of mod.addAliasWithMetadata. For output, it always just uses the 0 value for that block.
Is anyone else having this problem?
Edit: It appears to be crafting recipes too. And it's not just one, everything in both of my projects seems to be affected. I'm thinking this one isn't my fault.
Same trouble here bro...
The solution I found was use simple addAlias, and after put "aliasname:0"...
Rollback Post to RevisionRollBack
If you speak Portuguese and play Minecraft: Java Edition like me, join my rabbit hole on Discord!
Can anyone confirm whether the following is a bug or a "Luthervian is a numbskull" error?
I am trying to use textureFileSides[0] = "fruitLime.png"; to assign a lime texture to my hanging fruit. The fruit block is properly defined as a crossTexture. I get an error, claiming:
ReferenceError: "textureFileSides" is not defined
if I remove the [0], the error goes away and the script works fine.
Can anyone confirm whether the following is a bug or a "Luthervian is a numbskull" error?
I am trying to use textureFileSides[0] = "fruitLime.png"; to assign a lime texture to my hanging fruit. The fruit block is properly defined as a crossTexture. I get an error, claiming:
ReferenceError: "textureFileSides" is not defined
if I remove the [0], the error goes away and the script works fine.
I believe this to be a bug.
If you're using a crosstexture-type block I think you'll want to use textureFuleYN[0] to get textures to show up on it.
I will try this, but I was going by what is in the documentation for crossTexture.
Note specifically that if I use "textureFileSides" it works with no error, but if I use the metadata version (as directed by my documentation) - "textureFileSides[0]" it gives the error.
I agree, the textures directory should be top level in the archive file, not re-nested inside its own mod folder have its own mod folder re-nested inside itself.... Cubex2, please tell me you're only saying that as a workaround and that this is not intended behavior... otherwise why is it creating a texture folder inside the mod's folder and populating it with textures?
It is intentional in the way that there is no other solution for this.
OK, before I go totally and completely insane trying to figure this out, is anyone else having a problem with smelting recipes in the latest version? All of my smelting recipes seem to totally disregard block metadata for both input and output. For input, it just takes any metadata value as though I'd used mod.addAlias instead of mod.addAliasWithMetadata. For output, it always just uses the 0 value for that block.
Is anyone else having this problem?
Edit: It appears to be crafting recipes too. And it's not just one, everything in both of my projects seems to be affected. I'm thinking this one isn't my fault.
I will try this, but I was going by what is in the documentation for crossTexture.
Note specifically that if I use "textureFileSides" it works with no error, but if I use the metadata version (as directed by my documentation) - "textureFileSides[0]" it gives the error.
The textureFileSides is available for crossTexturePost and not for crossTexture
Rollback Post to RevisionRollBack
I'm on twitter: @CubeX2_. Follow me for upcoming features and other stuff ;).
I've just released CS2 0.10.1! I'm starting to add metadata support for items right now. One question: Are 32 metadata values for items enough or should I add more? Theoretically, I could add up to 32k but I'm not going to do that because of memory usage
I've just released CS2 0.10.1! I'm starting to add metadata support for items right now. One question: Are 32 metadata values for items enough or should I add more? Theoretically, I could add up to 32k but I'm not going to do that because of memory usage
I would have been happy with 16, so yea, that'll be fine.
I've just released CS2 0.10.1! I'm starting to add metadata support for items right now. One question: Are 32 metadata values for items enough or should I add more? Theoretically, I could add up to 32k but I'm not going to do that because of memory usage
Unless a person is going to do a mod with an insane number of item subtypes like Redpower's microblocks, I'm sure that's fine.
(then again, 256 KB of RAM should be enough for anybody...)
I'm getting a new error with the new 0.10.1 version:
org.mozilla.javascript.WrappedException: Wrapped java.lang.NumberFormatException: For input string: "" (mod.js#167)
at org.mozilla.javascript.Context.throwAsScriptRuntimeEx(Context.java:1754)
at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:148)
at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:225)
at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1473)
at script(mod.js:167)
at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:815)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:109)
at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:394)
at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3091)
at org.mozilla.javascript.InterpretedFunction.exec(InterpretedFunction.java:120)
at org.mozilla.javascript.Context.evaluateReader(Context.java:1110)
at cubex2.cs2.DefaultMod.init(DefaultMod.java:100)
at cubex2.cs2.ModLoader.initMods(ModLoader.java:45)
at cubex2.cs2core.CustomStuff2Core.postInit(CustomStuff2Core.java:73)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:494)
at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)
at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)
at com.google.common.eventbus.EventBus.post(EventBus.java:267)
at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:165)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)
at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)
at com.google.common.eventbus.EventBus.post(EventBus.java:267)
at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:98)
at cpw.mods.fml.common.Loader.initializeMods(Loader.java:695)
at cpw.mods.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:206)
at net.minecraft.client.Minecraft.func_71384_a(Minecraft.java:448)
at net.minecraft.client.MinecraftAppletImpl.func_71384_a(SourceFile:56)
at net.minecraft.client.Minecraft.run(Minecraft.java:733)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NumberFormatException: For input string: ""
at java.lang.NumberFormatException.forInputString(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at cubex2.cs2core.helper.GeneralHelper.getItemStack(GeneralHelper.java:55)
at cubex2.cs2core.scripting.ScriptableMod.removeRecipe_do(ScriptableMod.java:383)
at cubex2.cs2core.scripting.ScriptableMod.removeRecipe(ScriptableMod.java:337)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:126)
... 41 more
--- END ERROR REPORT 5f734dc0 ----------
I'm getting a new error with the new 0.10.1 version:
org.mozilla.javascript.WrappedException: Wrapped java.lang.NumberFormatException: For input string: "" (mod.js#167)
at org.mozilla.javascript.Context.throwAsScriptRuntimeEx(Context.java:1754)
at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:148)
at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:225)
at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1473)
at script(mod.js:167)
at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:815)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:109)
at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:394)
at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3091)
at org.mozilla.javascript.InterpretedFunction.exec(InterpretedFunction.java:120)
at org.mozilla.javascript.Context.evaluateReader(Context.java:1110)
at cubex2.cs2.DefaultMod.init(DefaultMod.java:100)
at cubex2.cs2.ModLoader.initMods(ModLoader.java:45)
at cubex2.cs2core.CustomStuff2Core.postInit(CustomStuff2Core.java:73)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:494)
at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)
at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)
at com.google.common.eventbus.EventBus.post(EventBus.java:267)
at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:165)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)
at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)
at com.google.common.eventbus.EventBus.post(EventBus.java:267)
at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:98)
at cpw.mods.fml.common.Loader.initializeMods(Loader.java:695)
at cpw.mods.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:206)
at net.minecraft.client.Minecraft.func_71384_a(Minecraft.java:448)
at net.minecraft.client.MinecraftAppletImpl.func_71384_a(SourceFile:56)
at net.minecraft.client.Minecraft.run(Minecraft.java:733)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NumberFormatException: For input string: ""
at java.lang.NumberFormatException.forInputString(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at cubex2.cs2core.helper.GeneralHelper.getItemStack(GeneralHelper.java:55)
at cubex2.cs2core.scripting.ScriptableMod.removeRecipe_do(ScriptableMod.java:383)
at cubex2.cs2core.scripting.ScriptableMod.removeRecipe(ScriptableMod.java:337)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:126)
... 41 more
--- END ERROR REPORT 5f734dc0 ----------
That is the wrong line. The error is caused by a mod.removeRecipe() line. From what I can see, there may be a whitespace at the end of a string in one of the arguments.
Rollback Post to RevisionRollBack
I'm on twitter: @CubeX2_. Follow me for upcoming features and other stuff ;).
That is the wrong line. The error is caused by a mod.removeRecipe() line. From what I can see, there may be a whitespace at the end of a string in one of the arguments.
This error may be due to the use of the beta version, or because I use MCPC (never had problems with CS+MCPC)? only occurs in the server, the client runs normally.
2013-05-23 19:27:51 [SEVERE] Encountered an unexpected exception WrappedException
org.mozilla.javascript.WrappedException: Wrapped java.lang.ArrayIndexOutOfBoundsException: -1 (mod.js#71)
at org.mozilla.javascript.Context.throwAsScriptRuntimeEx(Context.java:1754)
at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:148)
at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:225)
at org.mozilla.javascript.optimizer.OptRuntime.call2(OptRuntime.java:42)
at org.mozilla.javascript.gen.mod2_js_1._c_script_0(mod2.js:44)
at org.mozilla.javascript.gen.mod2_js_1.call(mod2.js)
at org.mozilla.javascript.gen.mod2_js_1.exec(mod2.js)
at cubex2.cs2core.scripting.ScriptableMod.loadScript(ScriptableMod.java:116)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:126)
at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:225)
at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1473)
at script(mod.js:71)
at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:815)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:109)
at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:394)
at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3091)
at org.mozilla.javascript.InterpretedFunction.exec(InterpretedFunction.java:120)
at org.mozilla.javascript.Context.evaluateReader(Context.java:1110)
at cubex2.cs2.DefaultMod.init(DefaultMod.java:100)
at cubex2.cs2.ModLoader.initMods(ModLoader.java:45)
at cubex2.cs2core.CustomStuff2Core.postInit(CustomStuff2Core.java:73)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:494)
at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)
at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)
at com.google.common.eventbus.EventBus.post(EventBus.java:267)
at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:165)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)
at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)
at com.google.common.eventbus.EventBus.post(EventBus.java:267)
at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:98)
at cpw.mods.fml.common.Loader.initializeMods(Loader.java:695)
at cpw.mods.fml.server.FMLServerHandler.finishServerLoading(FMLServerHandler.java:93)
at cpw.mods.fml.common.FMLCommonHandler.onServerStarted(FMLCommonHandler.java:355)
at net.minecraft.server.dedicated.DedicatedServer.func_71197_b(DedicatedServer.java:172)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:619)
at net.minecraft.server.ThreadMinecraftServer.run(SourceFile:573)
Caused by: java.lang.ArrayIndexOutOfBoundsException: -1
at net.minecraft.item.ItemStack.func_77973_b(ItemStack.java:121)
at net.minecraft.item.ItemStack.func_77964_b(ItemStack.java:256)
at net.minecraft.item.ItemStack.<init>(ItemStack.java:80)
at cubex2.cs2core.helper.GeneralHelper.getItemStack(GeneralHelper.java:33)
at cubex2.cs2core.scripting.ScriptableMod.addSmeltingRecipe_do(ScriptableMod.java:499)
at cubex2.cs2core.scripting.ScriptableMod.addSmeltingRecipe(ScriptableMod.java:481)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:126)
... 52 more
OBS 1.: this error is from after i try splitting my mod.js suspecting that the problem might be something related to the size... but all lines in mod.js (original) gives same error;
OBS 2.:I don't detected any syntax erros so far... seems like a mod.js size limit D:
EDIT: Downgrading CustomStuff to stable version allow server to continue running...
New Log:
2013-05-23 19:37:23 [SEVERE] org.mozilla.javascript.WrappedException: Wrapped java.lang.ArrayIndexOutOfBoundsException: -1 (mod.js#82)
at org.mozilla.javascript.Context.throwAsScriptRuntimeEx(Context.java:1754)
at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:148)
at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:225)
at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1473)
at script(mod.js:82)
at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:815)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:109)
at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:394)
at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3091)
at org.mozilla.javascript.InterpretedFunction.exec(InterpretedFunction.java:120)
at org.mozilla.javascript.Context.evaluateReader(Context.java:1110)
at cubex2.cs2.DefaultMod.init(DefaultMod.java:101)
at cubex2.cs2.ModLoader.initMods(ModLoader.java:45)
at cubex2.cs2core.CustomStuff2Core.postInit(CustomStuff2Core.java:75)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:494)
at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)
at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)
at com.google.common.eventbus.EventBus.post(EventBus.java:267)
at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:165)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)
at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)
at com.google.common.eventbus.EventBus.post(EventBus.java:267)
at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:98)
at cpw.mods.fml.common.Loader.initializeMods(Loader.java:695)
at cpw.mods.fml.server.FMLServerHandler.finishServerLoading(FMLServerHandler.java:93)
at cpw.mods.fml.common.FMLCommonHandler.onServerStarted(FMLCommonHandler.java:355)
at net.minecraft.server.dedicated.DedicatedServer.func_71197_b(DedicatedServer.java:172)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:619)
at net.minecraft.server.ThreadMinecraftServer.run(SourceFile:573)
Caused by: java.lang.ArrayIndexOutOfBoundsException: -1
at net.minecraft.item.ItemStack.func_77973_b(ItemStack.java:121)
at net.minecraft.item.ItemStack.func_77964_b(ItemStack.java:256)
at net.minecraft.item.ItemStack.<init>(ItemStack.java:80)
at cubex2.cs2core.helper.GeneralHelper.getItemStack(GeneralHelper.java:33)
at cubex2.cs2core.scripting.ScriptableMod.addRecipe_do(ScriptableMod.java:228)
at cubex2.cs2core.scripting.ScriptableMod.addRecipe(ScriptableMod.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:126)
... 41 more
It should work with all biomes available in the game.
I think I'm going to do this in the nearer future since I'm starting with ingame item creation.
You have to change the textures directory in .zip files. For example: "/StainedWood.zip/mods/StainedWood/textures/".
I'll add these two functions but it may not work with some blocks from other non-CS2 mods. For those blocks it will return "unknown" or something like that.
OK, I'll try it out and add it to the wiki if it works. Thanks CubeX2!
I agree, the textures directory should be top level in the archive file, not
re-nested inside its own mod folderhave its own mod folder re-nested inside itself.... Cubex2, please tell me you're only saying that as a workaround and that this is not intended behavior... otherwise why is it creating a texture folder inside the mod's folder and populating it with textures?Is anyone else having this problem?
Edit: It appears to be crafting recipes too. And it's not just one, everything in both of my projects seems to be affected. I'm thinking this one isn't my fault.
Same trouble here bro...
The solution I found was use simple addAlias, and after put "aliasname:0"...
If you speak Portuguese and play Minecraft: Java Edition like me, join my rabbit hole on Discord!
I am trying to use textureFileSides[0] = "fruitLime.png"; to assign a lime texture to my hanging fruit. The fruit block is properly defined as a crossTexture. I get an error, claiming:
if I remove the [0], the error goes away and the script works fine.
I believe this to be a bug.
Note specifically that if I use "textureFileSides" it works with no error, but if I use the metadata version (as directed by my documentation) - "textureFileSides[0]" it gives the error.
It is intentional in the way that there is no other solution for this.
This will be fixed in the next update.
The textureFileSides is available for crossTexturePost and not for crossTexture
Ah, thank you. So it is a "Luthervian is a numbskull" error, lol. Thank you both for your answers, hehe.
Also, thanks for the update!
Unless a person is going to do a mod with an insane number of item subtypes like Redpower's microblocks, I'm sure that's fine.
(then again, 256 KB of RAM should be enough for anybody...)
Mod: http://www.mediafire.com/download/vowb8h7u1b8q6x3/customStuff2-0.10.2_PR-universal.zip
Docs: http://www.mediafire.com/download/06o73n2rk07r3kb/CS2_0.10.2_PR_Documentation.zip
This didn't happen in 0.10.0b.
In line 168 of my "mod.js" I have this:
I hope someone can help me.
That is the wrong line. The error is caused by a mod.removeRecipe() line. From what I can see, there may be a whitespace at the end of a string in one of the arguments.
In line 167 I have this:
What is wrong with it?
First things I have noticed food-related features have not been included in the meta-data features (i.e., hunger, saturation, etc).
Is it possible to expand the meta-data to cover these as well? Thanks much for all of your hard work!
2013-05-23 19:27:51 [SEVERE] Encountered an unexpected exception WrappedException
org.mozilla.javascript.WrappedException: Wrapped java.lang.ArrayIndexOutOfBoundsException: -1 (mod.js#71)
at org.mozilla.javascript.Context.throwAsScriptRuntimeEx(Context.java:1754)
at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:148)
at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:225)
at org.mozilla.javascript.optimizer.OptRuntime.call2(OptRuntime.java:42)
at org.mozilla.javascript.gen.mod2_js_1._c_script_0(mod2.js:44)
at org.mozilla.javascript.gen.mod2_js_1.call(mod2.js)
at org.mozilla.javascript.gen.mod2_js_1.exec(mod2.js)
at cubex2.cs2core.scripting.ScriptableMod.loadScript(ScriptableMod.java:116)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:126)
at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:225)
at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1473)
at script(mod.js:71)
at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:815)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:109)
at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:394)
at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3091)
at org.mozilla.javascript.InterpretedFunction.exec(InterpretedFunction.java:120)
at org.mozilla.javascript.Context.evaluateReader(Context.java:1110)
at cubex2.cs2.DefaultMod.init(DefaultMod.java:100)
at cubex2.cs2.ModLoader.initMods(ModLoader.java:45)
at cubex2.cs2core.CustomStuff2Core.postInit(CustomStuff2Core.java:73)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:494)
at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)
at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)
at com.google.common.eventbus.EventBus.post(EventBus.java:267)
at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:165)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)
at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)
at com.google.common.eventbus.EventBus.post(EventBus.java:267)
at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:98)
at cpw.mods.fml.common.Loader.initializeMods(Loader.java:695)
at cpw.mods.fml.server.FMLServerHandler.finishServerLoading(FMLServerHandler.java:93)
at cpw.mods.fml.common.FMLCommonHandler.onServerStarted(FMLCommonHandler.java:355)
at net.minecraft.server.dedicated.DedicatedServer.func_71197_b(DedicatedServer.java:172)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:619)
at net.minecraft.server.ThreadMinecraftServer.run(SourceFile:573)
Caused by: java.lang.ArrayIndexOutOfBoundsException: -1
at net.minecraft.item.ItemStack.func_77973_b(ItemStack.java:121)
at net.minecraft.item.ItemStack.func_77964_b(ItemStack.java:256)
at net.minecraft.item.ItemStack.<init>(ItemStack.java:80)
at cubex2.cs2core.helper.GeneralHelper.getItemStack(GeneralHelper.java:33)
at cubex2.cs2core.scripting.ScriptableMod.addSmeltingRecipe_do(ScriptableMod.java:499)
at cubex2.cs2core.scripting.ScriptableMod.addSmeltingRecipe(ScriptableMod.java:481)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:126)
... 52 more
OBS 2.:I don't detected any syntax erros so far... seems like a mod.js size limit D:
EDIT: Downgrading CustomStuff to stable version allow server to continue running...
New Log:
2013-05-23 19:37:23 [SEVERE] org.mozilla.javascript.WrappedException: Wrapped java.lang.ArrayIndexOutOfBoundsException: -1 (mod.js#82)
at org.mozilla.javascript.Context.throwAsScriptRuntimeEx(Context.java:1754)
at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:148)
at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:225)
at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1473)
at script(mod.js:82)
at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:815)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:109)
at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:394)
at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3091)
at org.mozilla.javascript.InterpretedFunction.exec(InterpretedFunction.java:120)
at org.mozilla.javascript.Context.evaluateReader(Context.java:1110)
at cubex2.cs2.DefaultMod.init(DefaultMod.java:101)
at cubex2.cs2.ModLoader.initMods(ModLoader.java:45)
at cubex2.cs2core.CustomStuff2Core.postInit(CustomStuff2Core.java:75)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:494)
at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)
at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)
at com.google.common.eventbus.EventBus.post(EventBus.java:267)
at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:165)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)
at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)
at com.google.common.eventbus.EventBus.post(EventBus.java:267)
at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:98)
at cpw.mods.fml.common.Loader.initializeMods(Loader.java:695)
at cpw.mods.fml.server.FMLServerHandler.finishServerLoading(FMLServerHandler.java:93)
at cpw.mods.fml.common.FMLCommonHandler.onServerStarted(FMLCommonHandler.java:355)
at net.minecraft.server.dedicated.DedicatedServer.func_71197_b(DedicatedServer.java:172)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:619)
at net.minecraft.server.ThreadMinecraftServer.run(SourceFile:573)
Caused by: java.lang.ArrayIndexOutOfBoundsException: -1
at net.minecraft.item.ItemStack.func_77973_b(ItemStack.java:121)
at net.minecraft.item.ItemStack.func_77964_b(ItemStack.java:256)
at net.minecraft.item.ItemStack.<init>(ItemStack.java:80)
at cubex2.cs2core.helper.GeneralHelper.getItemStack(GeneralHelper.java:33)
at cubex2.cs2core.scripting.ScriptableMod.addRecipe_do(ScriptableMod.java:228)
at cubex2.cs2core.scripting.ScriptableMod.addRecipe(ScriptableMod.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:126)
... 41 more
If you speak Portuguese and play Minecraft: Java Edition like me, join my rabbit hole on Discord!