WorldGuard

WorldGuard

8M Downloads

BlockFertilizeEvent handler throws IAE when block list is empty

ItsFlare opened this issue ยท 0 comments

commented

Versions

WorldEdit version:
FAWE version: - Date Jan 28, 2021, 12:00:00 AM - Commit f7e758a5 - Build 585 - Platform Bukkit

WorldGuard version:
7.0.4

Platform version:
Bukkit-Official (7.0.4+f7ff984)

Describe the bug

[11:54:23] [Server thread/ERROR]: Could not pass event BlockFertilizeEvent to WorldGuard v7.0.4+f7ff984
java.lang.IllegalArgumentException: null
	at com.google.common.base.Preconditions.checkArgument(Preconditions.java:108) ~[patched_1.16.5.jar:git-Paper-457]
	at com.sk89q.worldguard.bukkit.event.block.AbstractBlockEvent.<init>(AbstractBlockEvent.java:70) ~[?:?]
	at com.sk89q.worldguard.bukkit.event.block.PlaceBlockEvent.<init>(PlaceBlockEvent.java:45) ~[?:?]
	at com.sk89q.worldguard.bukkit.listener.EventAbstractionListener.onBlockFertilize(EventAbstractionListener.java:564) ~[?:?]
	at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor247.execute(Unknown Source) ~[?:?]
	at org.bukkit.plugin.EventExecutor.lambda$create$1(EventExecutor.java:69) ~[patched_1.16.5.jar:git-Paper-457]
	at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:80) ~[patched_1.16.5.jar:git-Paper-457]
	at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[patched_1.16.5.jar:git-Paper-457]
	at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:607) ~[patched_1.16.5.jar:git-Paper-457]
	at net.minecraft.server.v1_16_R3.ItemStack.placeItem(ItemStack.java:256) ~[patched_1.16.5.jar:git-Paper-457]

To Reproduce

  1. Trigger a StructureGrowEvent with bone meal
  2. Clear the StructureGrowEvent block list

Expected behavior

WG should handle the event gracefully when no blocks are affected