Solved Setting the Up/Down Orientation of a Halfslab

Discussion in 'Plugin Development' started by Fuzzwolf, Mar 16, 2013.

Thread Status:
Not open for further replies.
  1. Offline

    Fuzzwolf

    How does one determine/set whether or not a halfslab inhabits the top or bottom half of a given block? I've created a mockup method below which functions correctly with stairs orientation (north, south, east, west) but causes all halfslabs placed in the top half of a block to be set to the lower half. How might I fix this if I wish to take note of where the halfslabs are located in a given x,y,z location?

    Thanks in advance.

    Code:
    @EventHandler
        public void onBlockPlace(BlockPlaceEvent e){
            ItemStack i = e.getItemInHand();
            Block b = e.getBlockPlaced();
           
            b.setTypeIdAndData(i.getType().getId(), i.getData().getData(), true);
           
        }
     
  2. Offline

    1SmallVille1

    The half slab on the top part is the block's metadeta, you would have to set that
     
  3. Offline

    Scizzr

    Isn't it actually the data that determines that?
    ie:
    • 44:2 is a wood slab(bottom)
    • 44:10 is a wood slab (top)
     
  4. Offline

    Fuzzwolf

    Scizzr

    Awesome, thanks for the tip. I also discovered that the variants in wood steps (birch, pine, etc. ) are under an entirely different ID. Everything is working now, so thanks for the help!
     
Thread Status:
Not open for further replies.

Share This Page