类 SaplingGrowTreeEvent
java.lang.Object
net.minecraftforge.eventbus.api.Event
net.minecraftforge.event.level.LevelEvent
net.minecraftforge.event.level.SaplingGrowTreeEvent
This event is fired whenever a sapling, fungus, mushroom or azalea grows into a tree.
This event is not cancellable but does have a result. ALLOW and DEFAULT will allow the sapling to grow using the features set on the event. DENY will prevent the sapling from growing.
This event is fired on the main Forge event bus only on the logical server.
-
嵌套类概要
从类继承的嵌套类/接口 net.minecraftforge.event.level.LevelEvent
LevelEvent.CreateSpawnPosition, LevelEvent.Load, LevelEvent.PotentialSpawns, LevelEvent.Save, LevelEvent.Unload
从类继承的嵌套类/接口 net.minecraftforge.eventbus.api.Event
net.minecraftforge.eventbus.api.Event.HasResult, net.minecraftforge.eventbus.api.Event.Result
-
字段概要
字段修饰符和类型字段说明private @Nullable Holder<ConfiguredFeature<?,
?>> private final BlockPos
private final RandomSource
-
构造器概要
构造器构造器说明SaplingGrowTreeEvent
(LevelAccessor level, RandomSource randomSource, BlockPos pos, @Nullable Holder<ConfiguredFeature<?, ?>> feature) -
方法概要
修饰符和类型方法说明@Nullable Holder<ConfiguredFeature<?,
?>> 返回 the holder of the feature which will be placed, possibly null。getPos()
返回 the coordinates of the sapling attempting to grow。返回 the random source which initiated the sapling growth。void
setFeature
(@Nullable Holder<ConfiguredFeature<?, ?>> feature) void
setFeature
(ResourceKey<ConfiguredFeature<?, ?>> featureKey) 从类继承的方法 net.minecraftforge.event.level.LevelEvent
getLevel
从类继承的方法 net.minecraftforge.eventbus.api.Event
getListenerList, getPhase, getResult, hasResult, isCancelable, isCanceled, setCanceled, setPhase, setResult
-
字段详细资料
-
randomSource
-
pos
-
feature
-
-
构造器详细资料
-
SaplingGrowTreeEvent
public SaplingGrowTreeEvent(LevelAccessor level, RandomSource randomSource, BlockPos pos, @Nullable @Nullable Holder<ConfiguredFeature<?, ?>> feature)
-
-
方法详细资料
-
getRandomSource
返回 the random source which initiated the sapling growth。- 返回:
- the random source which initiated the sapling growth
-
getPos
返回 the coordinates of the sapling attempting to grow。- 返回:
- the coordinates of the sapling attempting to grow
-
getFeature
返回 the holder of the feature which will be placed, possibly null。- 返回:
- the holder of the feature which will be placed, possibly null
-
setFeature
- 参数:
feature
- a Holder referencing a tree feature to be placed instead of the current feature.
-
setFeature
- 参数:
featureKey
- a ResourceKey referencing a tree feature to be placed instead of the current feature.
-