Interface CustomBlock
-
Method Summary
Modifier and TypeMethodDescriptiondefault double
获取自定义方块的挖掘时间,它是服务端侧和客户端侧挖掘时间的最小值。该方法设置自定义方块的定义double
覆写该方法设置自定义方块的摩擦因数double
覆写该方法设置自定义方块的硬度,这有助于自定义方块在服务端侧计算挖掘时间(硬度越大服务端侧挖掘时间越长)default int
getId()
该方法必须被覆写为使用接口的定义,请使用int
覆写该方法设置自定义方块的吸收光的等级int
覆写该方法设置自定义方块的发出光的等级default String
getName()
该方法必须被覆写为使用接口的定义,请使用覆写该方法设置自定义方块的命名空间IDdouble
覆写该方法设置自定义方块的爆炸抗性default boolean
default Block
Plugins do not need@Override
default Block
toCustomBlock
(int meta) Plugins do not need@Override
toItem()
一般不需要被覆写,继承父类会提供
-
Method Details
-
getFrictionFactor
double getFrictionFactor()覆写该方法设置自定义方块的摩擦因数@Override
this method to set the friction factor of the custom block -
getResistance
double getResistance()覆写该方法设置自定义方块的爆炸抗性@Override
this method to set the Explosive resistance of the custom block -
getLightFilter
int getLightFilter()覆写该方法设置自定义方块的吸收光的等级@Override
this method to set the level of light absorption of the custom block -
getLightLevel
int getLightLevel()覆写该方法设置自定义方块的发出光的等级@Override
this method to set the level of light emitted by the custom block -
getHardness
double getHardness()覆写该方法设置自定义方块的硬度,这有助于自定义方块在服务端侧计算挖掘时间(硬度越大服务端侧挖掘时间越长)@Override
this method to set the hardness of the custom block, which helps to calculate the break time of the custom block on the server-side (the higher the hardness the longer the break time on the server-side) -
getNamespaceId
覆写该方法设置自定义方块的命名空间ID@Override
this method to set the namespace ID of the custom block -
toItem
Item toItem()一般不需要被覆写,继承父类会提供Generally, it does not need to be
@Override
, extend from the parent class will provide -
getDefinition
CustomBlockDefinition getDefinition()该方法设置自定义方块的定义This method sets the definition of custom block
-
getId
default int getId()该方法必须被覆写为使用接口的定义,请使用The method must be
@Override
to use the definition of the interface, please use the
@Override
public int getId() { return CustomBlock.super.getId(); }
-
getName
该方法必须被覆写为使用接口的定义,请使用The method must be
@Override
to use the definition of the interface, please use the
@Override
public String getName() { return CustomBlock.super.getName(); }
-
toCustomBlock
Plugins do not need@Override
- Returns:
- the block
-
toCustomBlock
Plugins do not need@Override
- Returns:
- the block
-
reverseSending
default boolean reverseSending()- Returns:
- 是否反转自定义方块属性解析的顺序
Whether to reverse the order of properties parsing
-
breakTime
获取自定义方块的挖掘时间,它是服务端侧和客户端侧挖掘时间的最小值。- Parameters:
item
- the itemplayer
- the player- Returns:
- the break time
-