mirror of
https://github.com/Minestom/Minestom.git
synced 2025-03-02 11:21:15 +01:00
Changed BlockPosition arg to CustomBlock#createData
This commit is contained in:
parent
f8f649852b
commit
8050708ecf
@ -74,7 +74,7 @@ public class InstanceContainer extends Instance {
|
||||
|
||||
// Set the block
|
||||
if (isCustomBlock) {
|
||||
data = BLOCK_MANAGER.getCustomBlock(customBlockId).createData(x, y, z, data);
|
||||
data = BLOCK_MANAGER.getCustomBlock(customBlockId).createData(blockPosition, data);
|
||||
chunk.UNSAFE_setCustomBlock(x, y, z, customBlockId, data);
|
||||
} else {
|
||||
chunk.UNSAFE_setBlock(x, y, z, blockId, data);
|
||||
|
@ -68,13 +68,12 @@ public abstract class CustomBlock {
|
||||
|
||||
/**
|
||||
* Initialises data for this block
|
||||
* @param x X position of the block
|
||||
* @param y Y position of the block
|
||||
* @param z Z position of the block
|
||||
* @param data data given to 'setBlock', can be null
|
||||
*
|
||||
* @param blockPosition the position of the targeted block
|
||||
* @param data data given to 'setBlock', can be null
|
||||
* @return Data for this block. Can be null, 'data', or a new object
|
||||
*/
|
||||
public Data createData(int x, int y, int z, Data data) {
|
||||
public Data createData(BlockPosition blockPosition, Data data) {
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
@ -78,7 +78,7 @@ public class BlockPlacementListener {
|
||||
}
|
||||
|
||||
if (!intersect) {
|
||||
PlayerBlockPlaceEvent playerBlockPlaceEvent = new PlayerBlockPlaceEvent(material.getBlock().getBlockId(), (short)0, blockPosition, packet.hand);
|
||||
PlayerBlockPlaceEvent playerBlockPlaceEvent = new PlayerBlockPlaceEvent(block.getBlockId(), (short) 0, blockPosition, packet.hand);
|
||||
playerBlockPlaceEvent.consumeBlock(player.getGameMode() != GameMode.CREATIVE);
|
||||
|
||||
// BlockPlacementRule check
|
||||
|
Loading…
Reference in New Issue
Block a user