Constructors do not run custom placement logic
williewillus opened this issue ยท 3 comments
Botania flowers use NBT on the ItemStack to set the flower type on the TE of the resulting block that's placed. However, said logic is not being run when constructors place the block, leading to a Botania flower block without the flower type set in the TE.
Repro:
- Put a botania magic flower (pure daisy, endoflame, etc. not mystical flowers) in a constructor
- Let it try placing
- See checkered-tile flower indicating that flower type was not set properly on the TE
Ref: VazkiiMods/Botania#2178
Addendum: This custom logic is run by overriding ItemBlock.placeBlockAt
here
Not sure if there's a clean solution since ItemBlock's methods generally expect a player to be present. FakePlayer?
@williewillus I think it's fixed now. I couldn't test it, because Botania doesn't like my dev env:
java.lang.NoSuchFieldError: field_185050_h
at vazkii.botania.common.item.equipment.tool.ItemEnderDagger.getItemAttributeModifiers(ItemEnderDagger.java:65)
at net.minecraft.item.Item.getAttributeModifiers(Item.java:574)
at net.minecraft.item.ItemStack.getAttributeModifiers(ItemStack.java:1043)
at net.minecraft.item.ItemStack.getTooltip(ItemStack.java:784)
at net.minecraft.client.gui.inventory.GuiContainerCreative.updateFilteredItems(GuiContainerCreative.java:389)
at net.minecraft.client.gui.inventory.GuiContainerCreative.updateCreativeSearch(GuiContainerCreative.java:367)
at net.minecraft.client.gui.inventory.GuiContainerCreative.setCurrentCreativeTab(GuiContainerCreative.java:560)
at net.minecraft.client.gui.inventory.GuiContainerCreative.mouseReleased(GuiContainerCreative.java:458)
at net.minecraft.client.gui.GuiScreen.handleMouseInput(GuiScreen.java:627)
at net.minecraft.client.gui.inventory.GuiContainerCreative.handleMouseInput(GuiContainerCreative.java:579)
at net.minecraft.client.gui.GuiScreen.handleInput(GuiScreen.java:583)
at net.minecraft.client.Minecraft.runTick(Minecraft.java:1797)
at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1118)
at net.minecraft.client.Minecraft.run(Minecraft.java:406)
at net.minecraft.client.main.Main.main(Main.java:118)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97)
at GradleStart.main(GradleStart.java:26)