CraftBook 3

CraftBook 3

139k Downloads

BlockBreak Event / Custom Block Drop %

LadyCailinBot opened this issue ยท 3 comments

commented

CRAFTBOOK-2395 - Reported by jamesneu

Bukkit Build 1.4.7
Craftbook: Build 1680 (3.5)

When using percentages in custom block drops:
18->280x0-1%25,260x0-0%0,18x0-1%25,6x0-1%25

Error on block break; breaking block however does prove to follow percent and custom rules, technically not broken but getting spammed this error:

[SEVERE] Could not pass event BlockBreakEvent to CraftBook v1680-f5e7902
org.bukkit.event.EventException
at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:427)
at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62)
at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:477)
at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:462)
at net.minecraft.server.v1_4_6.PlayerInteractManager.breakBlock(PlayerInteractManager.java:282)
at net.minecraft.server.v1_4_6.PlayerInteractManager.a(PlayerInteractManager.java:209)
at net.minecraft.server.v1_4_6.PlayerConnection.a(PlayerConnection.java:566)
at net.minecraft.server.v1_4_6.Packet14BlockDig.handle(SourceFile:46)
at net.minecraft.server.v1_4_6.Packet14BlockDig$$EnhancerByCGLIB$$aee0c6e2.CGLIB$handle$0()
at net.minecraft.server.v1_4_6.Packet14BlockDig$$EnhancerByCGLIB$$aee0c6e2$$FastClassByCGLIB$$95daa687.invoke()
at com.comphenix.net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)
at com.comphenix.protocol.injector.ReadPacketModifier.intercept(ReadPacketModifier.java:109)
at net.minecraft.server.v1_4_6.Packet14BlockDig$$EnhancerByCGLIB$$aee0c6e2.handle()
at net.minecraft.server.v1_4_6.NetworkManager.b(NetworkManager.java:290)
at net.minecraft.server.v1_4_6.PlayerConnection.d(PlayerConnection.java:112)
at net.minecraft.server.v1_4_6.ServerConnection.b(SourceFile:39)
at net.minecraft.server.v1_4_6.DedicatedServerConnection.b(SourceFile:30)
at net.minecraft.server.v1_4_6.MinecraftServer.r(MinecraftServer.java:598)
at net.minecraft.server.v1_4_6.DedicatedServer.r(DedicatedServer.java:224)
at net.minecraft.server.v1_4_6.MinecraftServer.q(MinecraftServer.java:494)
at net.minecraft.server.v1_4_6.MinecraftServer.run(MinecraftServer.java:427)
at net.minecraft.server.v1_4_6.ThreadServerApplication.run(SourceFile:849)
Caused by: java.lang.IllegalArgumentException: Cannot drop a Null item.
at org.apache.commons.lang.Validate.notNull(Validate.java:203)
at org.bukkit.craftbukkit.v1_4_6.CraftWorld.dropItem(CraftWorld.java:292)
at org.bukkit.craftbukkit.v1_4_6.CraftWorld.dropItemNaturally(CraftWorld.java:310)
at com.sk89q.craftbook.mech.CustomDrops.handleCustomBlockDrops(CustomDrops.java:42)
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.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:425)
... 21 more

commented

Comment by me4502

I believe that is due to the possiblity of it being 0.

commented

Comment by jamesneu

I actually have tried that and changed all the 0 to at least 1, I still get the same error. I thought it was possibly data value, so I removed those too, and still get the same error.

The only time it actually stops producing the error is when I do not use the percent function. The problem with that is the custom blocks will drop -many- (like 3-5x what is configured) ghost items which causes a deal of item entities in certain areas; in my case and tree leaves being broken.

I've been experimenting with it for some time and it seems to only occur with the percent sign.

Thank you for the response and for fixing the category this was in, it wouldn't let me assign it to craftbook for some reason.

commented

Comment by me4502

Okay, fixed. the issue was that the code was checking if the stack was valid, but due to the chances.. it was remaking the stack when it actually dropped it, so the check was useless.