Need help nerfing wood

Need help with your script? Want to know how to do something? Want to post an example? Post it here!

Need help nerfing wood

Postby ax1m » Thu Feb 04, 2016 7:56 pm

Hi guys

I'm currently working on my private pack, where I'm using minetweaker instead of GregTech to make all the players' lifes a pile of misery. As such, I would like to nerf wood plank output when crafted without a saw. I found an example in the MT wiki that went a long way to helping me understand how to do this, but now it looks like I'm stuck.

Here's my code so far:
: [Select all] [/] [] ()
import minetweaker.item.IIngredient;
import minetweaker.item.IItemStack;

val logs = [<minecraft:log:0>, <minecraft:log:1>, <minecraft:log:2>, <minecraft:log:3>, <minecraft:log2:0>, <minecraft:log2:1>] as IIngredient[];
val planks = [<minecraft:planks:0>, <minecraft:planks:1>, <minecraft:planks:2>, <minecraft:planks:3>, <minecraft:planks:4>, <minecraft:planks:5>] as IItemStack[];
val saws = [<ForgeMicroblock:sawStone>, <ForgeMicroblock:sawIron>, <ForgeMicroblock:sawDiamond>, <RotaryCraft:rotarycraft_item_bedsaw>] as IItemStack[];

for i, log in logs {
   var plank = planks[i];
   recipes.removeShaped(plank, [log]);
   recipes.addShaped(plank * 2, [log]);
   for j, saw in saws {   recipes.addShapeless(plank * 4, [log, saw.anyDamage().transformDamage()]);   }
}
GeSHi © Codebox Plus


Now when I try and load that in Minecraft, I get the following console output:
: [Select all] [/] [] ()
ERROR: Vanilla.zs:10 > Cannot cast minetweaker.item.IIngredient to minetweaker.item.IIngredient[]
ERROR: Vanilla.zs:11 > Cannot cast minetweaker.item.IIngredient to minetweaker.item.IIngredient[]
ERROR: Error executing Vanilla.zs: 1
GeSHi © Codebox Plus


I understand it's trying to cast a single IIngredient to an array, but I don't understand how or why that's happening. I would really appreciate some help on this one, thanks :)


EDIT: Figured out the casting error, I was missing the second layer of brackets around the ingredients. However the last error still persists. Here 's the traceback from the minetweaker.log file:
: [Select all] [/] [] ()
java.lang.ArrayIndexOutOfBoundsException: 1
   at org.objectweb.asm.Frame.a(Unknown Source)
   at org.objectweb.asm.Frame.a(Unknown Source)
   at org.objectweb.asm.MethodWriter.visitMaxs(Unknown Source)
   at org.objectweb.asm.commons.LocalVariablesSorter.visitMaxs(Unknown Source)
   at stanhebben.zenscript.util.MethodOutput.end(MethodOutput.java:59)
   at stanhebben.zenscript.ZenModule.compileScripts(ZenModule.java:127)
   at minetweaker.runtime.MTTweaker.load(MTTweaker.java:159)
   at minetweaker.MineTweakerImplementationAPI.reload(MineTweakerImplementationAPI.java:656)
   at minetweaker.MineTweakerImplementationAPI$1.execute(MineTweakerImplementationAPI.java:83)
   at minetweaker.MineTweakerImplementationAPI$19.execute(MineTweakerImplementationAPI.java:642)
   at minetweaker.mc1710.server.MCServer$MCCommand.func_71515_b(MCServer.java:124)
   at net.minecraft.command.CommandHandler.func_71556_a(CommandHandler.java:94)
   at net.minecraft.network.NetHandlerPlayServer.func_147361_d(NetHandlerPlayServer.java:739)
   at net.minecraft.network.NetHandlerPlayServer.func_147354_a(NetHandlerPlayServer.java:718)
   at net.minecraft.network.play.client.C01PacketChatMessage.func_148833_a(SourceFile:37)
   at net.minecraft.network.play.client.C01PacketChatMessage.func_148833_a(SourceFile:9)
   at net.minecraft.network.NetworkManager.func_74428_b(NetworkManager.java:212)
   at net.minecraft.network.NetworkSystem.func_151269_c(NetworkSystem.java:165)
   at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:659)
   at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:547)
   at net.minecraft.server.integrated.IntegratedServer.func_71217_p(IntegratedServer.java:111)
   at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:427)
   at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:685)
GeSHi © Codebox Plus
ax1m
 
Posts: 1
Joined: Thu Feb 04, 2016 7:41 pm

Re: Need help nerfing wood

Postby Gregory Peeling » Wed Mar 25, 2020 9:02 am

I also need help with nerfing wood. I face very difficult to cut the wood according to desirable sizes. It takes very time to cut the wood by a simple saw that's why I started getting essay writing help from https://bestwritingsclues.com/reviews/papernow-review/ site to get some extra time for this sort of activities.
Gregory Peeling
 
Posts: 1
Joined: Thu Mar 05, 2020 9:04 am

Re: Need help nerfing wood

Postby noahpeterhoff » Fri Apr 03, 2020 4:19 am

You were missing the second layer of brackets around the ingredients.
noahpeterhoff
 
Posts: 1
Joined: Tue Mar 31, 2020 3:10 am


Return to Scripting Help

Who is online

Users browsing this forum: No registered users and 5 guests