ramou / ChessMod

Adding Pippin Barr's Chesses to minecraft.
MIT License
3 stars 3 forks source link

Quantum board creation #162

Closed riri404 closed 5 months ago

riri404 commented 11 months ago

Now that the board is registered in 1.20, I've started the implementation of the quantum board. I am using events for the mechanism, instead of creating a recipe of two quantum boards and an enderpearl. So far, the event is set up, but I have to start the linking process. I brainstormed a little yesterday and will start probably later this week.

riri404 commented 11 months ago

Creating the following TODO

I will change some of these mechanism as I go. I will probably need to handle situations such as one board getting destroyed

riri404 commented 11 months ago

After using synchronized block + nonce + debounce logic( stolen from hardware debounce logic), the event no longer fire twice.

riri404 commented 5 months ago

Some issues when extending the GoldenChessBoardEntity:

  1. The super() takes fewer arguments when using the GoldenChessBoardEntity than if we extend ChessBoardEntity
  2. There is still some mirroring issues in chessPlay (the getLinkedBoards() needs to fetch the boards directly)
  3. The chess pieces do not render

Attempted solutions:

  1. Removed the blockEntityType argument to fit the GoldenChessBoardEntity constructor
  2. Will try fetching from the linkedChessboards hashMap in order for getLinkedBoards() to actually mirror
  3. I have not looked more into the rendering issue

Next steps:

ramou commented 5 months ago

For rendering, the trick is to not subclass the GoldenChessBoardEntity. We just subclass ChessBoardBlockEntity and do it the old way. We may want to introduce an interface on entities for type-management in the events, but that's a relatively benign thing to do. The blockEntityType argument is needed to have things tie together behind the scenes, I believe.