Problems with double chests.

Discussion in 'Spigot Plugin Development' started by FormerCanuck, Aug 5, 2018.

  1. I am trying to update a death chest I had made in the past but I can't seem to have any luck with placing a double chest... When I place a chest (with code) then place another beside it (also with code) they don't form a double chest but two single chests.

    Any help would be nice, thanks in advance.
     
  2. Check out the new BlockData interface, specifically block.data.Chest. You can set the type of chest via Chest.Type:
    • LEFT
    • RIGHT
    • SINGLE
    I have not tried this, but I think the code would look something like this:
    Code (Text):
    Block leftBlock, rightBlock; // input
    Chest left = (Chest)Material.CHEST.createBlockData();
    Chest right = (Chest)Material.CHEST.createBlockData();
    left.setType(Chest.Type.LEFT);
    right.setType(Chest.Type.RIGHT);
    leftBlock.setBlockData(left, false);
    rightBlock.setBlockData(right, false);
     
    • Informative Informative x 2
  3. So I tried to implement the code you provided but I keep getting the error "Type cannot be resolved or is not a field."
     
  4. Optic_Fusion1

    Resource Staff

    what version are you using?
     
  5. Okay so I figured out what I was doing wrong, I was using the wrong implementation of Chest, but now it is placing two chest next to each other but one is invisible and they are not connected....

    Images of what it is doing:
    https://imgur.com/a/GEFeFsb
    [​IMG]
     
  6. I am using Spigot 1.13
     
  7. I know it has been almost a month but has anyone found a fix for this?
     
  8. If chests are invisible and not connected that means that the chests are not connected properly in terms of rendering.
    Try swapping which chest is the left and right.
    This kind of thing happened to me when I tried out quintuple chests (5 chests connected). Some were invisible and others were connected to the same chest. It was weird.
     
  9. Okay, I will give it a try
     
  10. So I did what you suggested and swapped the left to the right all it did is make the chest appear to be in a different location. They still do not connect and one of them is invisible as before.