MineColonies

MineColonies

53M Downloads

[Feature] Make scarecrow blocks/hitbox reflect it's model

kreezxil opened this issue ยท 8 comments

commented

Minecolonies version

1.12.2-0.8.5989

Expected behavior

  • right click anywhere on the scarecrow to open the gui

Actual behaviour

  • the gui only opens if you click on the pants of scarecrow

Steps to reproduce the problem

  1. place scarecrow
  2. click on any part that is not the pants
  3. notice the gui doesn't open
  4. then click on the pants and notice the gui does open
  5. wonder why you can't open the gui by clicking anywhere on the scarecrow

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

commented

Yeah atm the scarecrow is actually only 1 block high, we have to make 2 blocks out of it to make it clickable on the top as well.

commented

Doesn't the same thing apply to the builders hut?

commented

Alright, I'm going to try and tackle this - as good a place to start as any. So if you could assign this issue to me that would be great.

As far as I can tell, the most non-hacky way to do this is to use an Entity (like an Armor Stand). This comes with several advantages, but means there will be a deprecation with the current field block. Is that alright, or should I find an alternative?

commented

[Extra suggestion]
Also I had a suggestions for if I was refactoring to an Entity - what if the scarecrow behaves like an item frame? Instead of opening a GUI with a single box, you just right click and your seed appears on the scarecrow's torso. (I like UI/UX design and to me this is cleaner, also one less GUI to handle or overwrite with a resource pack)

commented

I believe the best way is to handle it like doors or double chests with an invisible upper block.
This way it would be backwards compatible too.

We need the GUI because we want to add in the future some ways to define the size of the field etc.

commented

That's the hacky way. doors and chests operate using a blockstate with two textures. I haven't dug too deep, but as far as I can tell when you place one door, you are actually placing two that refer to each other. Doing this with the field may result in some strange behavior. Do you know of a way to expand the interact collision box to skip the second block all together?

Considering the scarecrow already uses a TileEntity, and is very similar to a BipedModel, may I still suggest an entity? There may be little choice.

commented

As far as I know there is no way to expand the interaction collision box.

I wouldn't want it to be an entity because that is not backwards compatible. So we'd have to rescan all schematics etc.
Meanwhile doing it the same way doors do it. Is an easy way to handle it.

commented

Closed in favor of joint issue.