Add missing block data API

General purpose patch adding missing getters/setters to BlockData and
its child types.

Co-authored-by: SoSeDiK <mrsosedik@gmail.com>
Co-authored-by: Fabrizio La Rosa <lr.fabrizio@gmail.com>
This commit is contained in:
Jake Potrebic 2021-10-16 22:57:10 -07:00
parent 585c6710fd
commit 64f342f5fb
6 changed files with 65 additions and 0 deletions

View File

@ -36,4 +36,13 @@ public interface Levelled extends BlockData {
* @return the maximum 'level' value
*/
int getMaximumLevel();
// Paper start
/**
* Gets the minimum allowed value of the 'level' property.
*
* @return the minimum 'level' value
*/
int getMinimumLevel();
// Paper end
}

View File

@ -35,6 +35,15 @@ public interface Bed extends Directional {
*/
boolean isOccupied();
// Paper start
/**
* Sets the value of the 'occupied' property.
*
* @param occupied the new 'occupied' value
*/
void setOccupied(boolean occupied);
// Paper end
/**
* Horizontal half of a bed.
*/

View File

@ -28,4 +28,13 @@ public interface Candle extends Lightable, Waterlogged {
* @return the maximum 'candles' value
*/
int getMaximumCandles();
// Paper start
/**
* Gets the minimum allowed value of the 'candles' property.
*
* @return the minimum 'candles' value
*/
int getMinimumCandles();
// Paper end
}

View File

@ -4,4 +4,17 @@ import org.bukkit.block.data.Directional;
import org.bukkit.block.data.Waterlogged;
public interface DecoratedPot extends Directional, Waterlogged {
// Paper start - add missing block data api
/**
* @return whether the pot is cracked
*/
public boolean isCracked();
/**
* Set whether the pot is cracked.
*
* @param cracked whether the pot is cracked
*/
public void setCracked(boolean cracked);
// Paper end - add missing block data api
}

View File

@ -39,4 +39,20 @@ public interface Leaves extends Waterlogged {
* @param distance the new 'distance' value
*/
void setDistance(int distance);
// Paper start
/**
* Gets the maximum allowed value of the 'distance' property.
*
* @return the maximum 'distance' value
*/
int getMaximumDistance();
/**
* Gets the minimum allowed value of the 'distance' property.
*
* @return the minimum 'distance' value
*/
int getMinimumDistance();
// Paper end
}

View File

@ -21,6 +21,15 @@ public interface PinkPetals extends Directional {
*/
void setFlowerAmount(int flower_amount);
// Paper start
/**
* Gets the minimum allowed value of the 'flower_amount' property.
*
* @return the minimum 'flower_amount' value
*/
int getMinimumFlowerAmount();
// Paper end
/**
* Gets the maximum allowed value of the 'flower_amount' property.
*