mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-11 10:12:06 -07:00
Half-step placement bug fix, all credits to Brettflan
This commit is contained in:
@@ -68,7 +68,12 @@ public class ItemBlock extends Item {
|
|||||||
/* We store the old data so we can undo it. Snow(78) and half-steps(44) are special in that they replace the block itself,
|
/* We store the old data so we can undo it. Snow(78) and half-steps(44) are special in that they replace the block itself,
|
||||||
* rather than the block touching the face we clicked on.
|
* rather than the block touching the face we clicked on.
|
||||||
*/
|
*/
|
||||||
org.bukkit.block.Block replacedBlock = ( blockClicked.getTypeId() == Block.SNOW.id || (blockClicked.getTypeId() == Block.STEP.id && itemstack.id == Block.STEP.id && faceClicked == BlockFace.UP) ) ? blockClicked : blockClicked.getFace(faceClicked);
|
int typeId = blockClicked.getTypeId();
|
||||||
|
org.bukkit.block.Block replacedBlock = blockClicked.getFace(faceClicked);
|
||||||
|
|
||||||
|
if (typeId == Block.SNOW.id || (typeId == Block.STEP.id && itemstack.id == Block.STEP.id && faceClicked == BlockFace.UP))
|
||||||
|
replacedBlock = blockClicked;
|
||||||
|
|
||||||
final BlockState replacedBlockState = new CraftBlockState(replacedBlock);
|
final BlockState replacedBlockState = new CraftBlockState(replacedBlock);
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user