Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IllegalStateException when trying to create a blockState from a Material #11887

Open
T14D3 opened this issue Jan 2, 2025 · 1 comment
Open
Labels
status: accepted Disputed bug is accepted as valid or Feature accepted as desired to be added. version: 1.21.4

Comments

@T14D3
Copy link

T14D3 commented Jan 2, 2025

Stack trace

Error occurred while enabling Zones v1.0-SNAPSHOT (Is it up to date?)
java.lang.IllegalStateException: The blockState must be placed to call this method
	at com.google.common.base.Preconditions.checkState(Preconditions.java:513) ~[guava-33.3.1-jre.jar:?]
	at org.bukkit.craftbukkit.block.CraftBlockState.requirePlaced(CraftBlockState.java:332) ~[paper-1.21.4.jar:1.21.4-72-daddcf6]
	at org.bukkit.craftbukkit.block.CraftBlockState.getWorld(CraftBlockState.java:101) ~[paper-1.21.4.jar:1.21.4-72-daddcf6]
	at org.bukkit.craftbukkit.block.CraftBlockEntityState.<init>(CraftBlockEntityState.java:53) ~[paper-1.21.4.jar:1.21.4-72-daddcf6]
	at org.bukkit.craftbukkit.block.CraftMovingPiston.<init>(CraftMovingPiston.java:10) ~[paper-1.21.4.jar:1.21.4-72-daddcf6]
	at org.bukkit.craftbukkit.block.CraftBlockStates$BlockEntityStateFactory.createBlockState(CraftBlockStates.java:115) ~[paper-1.21.4.jar:1.21.4-72-daddcf6]
	at org.bukkit.craftbukkit.block.CraftBlockStates$BlockEntityStateFactory.createBlockState(CraftBlockStates.java:107) ~[paper-1.21.4.jar:1.21.4-72-daddcf6]
	at org.bukkit.craftbukkit.block.CraftBlockStates$BlockEntityStateFactory.createBlockState(CraftBlockStates.java:89) ~[paper-1.21.4.jar:1.21.4-72-daddcf6]
	at org.bukkit.craftbukkit.block.CraftBlockStates.getBlockState(CraftBlockStates.java:308) ~[paper-1.21.4.jar:1.21.4-72-daddcf6]
	at org.bukkit.craftbukkit.block.CraftBlockStates.getBlockState(CraftBlockStates.java:294) ~[paper-1.21.4.jar:1.21.4-72-daddcf6]
	at org.bukkit.craftbukkit.block.CraftBlockStates.getBlockState(CraftBlockStates.java:283) ~[paper-1.21.4.jar:1.21.4-72-daddcf6]
	at org.bukkit.craftbukkit.block.data.CraftBlockData.createBlockState(CraftBlockData.java:745) ~[paper-1.21.4.jar:1.21.4-72-daddcf6]
	at zones-1.0-dev.jar/de.t14d3.zones.utils.Types.populateTypes(Types.java:60) ~[zones-1.0-dev.jar:?]
	at zones-1.0-dev.jar/de.t14d3.zones.Zones.onEnable(Zones.java:79) ~[zones-1.0-dev.jar:?]
	at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:288) ~[paper-api-1.21.4-R0.1-SNAPSHOT.jar:?]
	at io.papermc.paper.plugin.manager.PaperPluginInstanceManager.enablePlugin(PaperPluginInstanceManager.java:202) ~[paper-1.21.4.jar:1.21.4-72-daddcf6]
	at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.enablePlugin(PaperPluginManagerImpl.java:109) ~[paper-1.21.4.jar:1.21.4-72-daddcf6]
	at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:520) ~[paper-api-1.21.4-R0.1-SNAPSHOT.jar:?]
	at org.bukkit.craftbukkit.CraftServer.enablePlugin(CraftServer.java:655) ~[paper-1.21.4.jar:1.21.4-72-daddcf6]
	at org.bukkit.craftbukkit.CraftServer.enablePlugins(CraftServer.java:604) ~[paper-1.21.4.jar:1.21.4-72-daddcf6]
	at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:743) ~[paper-1.21.4.jar:1.21.4-72-daddcf6]
	at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:488) ~[paper-1.21.4.jar:1.21.4-72-daddcf6]
	at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:322) ~[paper-1.21.4.jar:1.21.4-72-daddcf6]
	at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1163) ~[paper-1.21.4.jar:1.21.4-72-daddcf6]
	at net.minecraft.server.MinecraftServer.lambda$spin$2(MinecraftServer.java:310) ~[paper-1.21.4.jar:1.21.4-72-daddcf6]

Plugin and Datapack List

Zones

Actions to reproduce (if known)

Try to create a blockState from Material in onEnable of a plugin Edit: Anywhere

Edit2: Caused by trying to create a blockState for a MOVING_PISTON

Paper version

This server is running Paper version 1.21.4-72-main@daddcf6 (2025-01-02T08:17:56Z) (Implementing API version 1.21.4-R0.1-SNAPSHOT)

Other

No response

@T14D3
Copy link
Author

T14D3 commented Jan 2, 2025

Also see #11888

@Warriorrrr Warriorrrr added status: accepted Disputed bug is accepted as valid or Feature accepted as desired to be added. and removed status: needs triage labels Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: accepted Disputed bug is accepted as valid or Feature accepted as desired to be added. version: 1.21.4
Projects
None yet
Development

No branches or pull requests

2 participants