接口 ScreenHandlerContext
-
public interface ScreenHandlerContextScreen handler contexts allow screen handlers to interact with the logical server's world safely.- Mappings:
Namespace Name official blwintermediary net/minecraft/class_3914named net/minecraft/screen/ScreenHandlerContext
-
-
字段概要
字段 修饰符和类型 字段 说明 static ScreenHandlerContextEMPTYThe dummy screen handler context for clientside screen handlers.
-
方法概要
所有方法 静态方法 实例方法 抽象方法 默认方法 修饰符和类型 方法 说明 static ScreenHandlerContextcreate(World world, BlockPos pos)Returns an active screen handler context.<T> Optional<T>get(BiFunction<World,BlockPos,T> getter)Gets an optional value from this context's world and position with aBiFunctiongetter.default <T> Tget(BiFunction<World,BlockPos,T> getter, T defaultValue)Gets a value from this context's world and position with aBiFunctiongetter.default voidrun(BiConsumer<World,BlockPos> function)Runs aBiConsumerwith this context's world and position if this context is active.
-
-
-
字段详细资料
-
EMPTY
static final ScreenHandlerContext EMPTY
The dummy screen handler context for clientside screen handlers.- Mappings:
Namespace Name Mixin selector official aLblw;a:Lblw;intermediary field_17304Lnet/minecraft/class_3914;field_17304:Lnet/minecraft/class_3914;named EMPTYLnet/minecraft/screen/ScreenHandlerContext;EMPTY:Lnet/minecraft/screen/ScreenHandlerContext;
-
-
方法详细资料
-
create
static ScreenHandlerContext create(World world, BlockPos pos)
Returns an active screen handler context. Used on the logical server.- Mappings:
Namespace Name Mixin selector official aLblw;a(Lbvr;Lgb;)Lblw;intermediary method_17392Lnet/minecraft/class_3914;method_17392(Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;)Lnet/minecraft/class_3914;named createLnet/minecraft/screen/ScreenHandlerContext;create(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;)Lnet/minecraft/screen/ScreenHandlerContext;
-
get
<T> Optional<T> get(BiFunction<World,BlockPos,T> getter)
Gets an optional value from this context's world and position with aBiFunctiongetter.- 参数:
getter- a function that gets a non-null value from this context's world and position- 返回:
- a present
Optionalwith the getter's return value, orOptional.empty()if this context is empty - Mappings:
Namespace Name Mixin selector official aLblw;a(Ljava/util/function/BiFunction;)Ljava/util/Optional;intermediary method_17395Lnet/minecraft/class_3914;method_17395(Ljava/util/function/BiFunction;)Ljava/util/Optional;named getLnet/minecraft/screen/ScreenHandlerContext;get(Ljava/util/function/BiFunction;)Ljava/util/Optional;
-
get
default <T> T get(BiFunction<World,BlockPos,T> getter, T defaultValue)
Gets a value from this context's world and position with aBiFunctiongetter.- 参数:
getter- a function that gets a non-null value from this context's world and positiondefaultValue- a fallback default value, used if this context is empty- 返回:
- the getter's return value if this context is active, the default value otherwise
- Mappings:
Namespace Name Mixin selector official aLblw;a(Ljava/util/function/BiFunction;Ljava/lang/Object;)Ljava/lang/Object;intermediary method_17396Lnet/minecraft/class_3914;method_17396(Ljava/util/function/BiFunction;Ljava/lang/Object;)Ljava/lang/Object;named getLnet/minecraft/screen/ScreenHandlerContext;get(Ljava/util/function/BiFunction;Ljava/lang/Object;)Ljava/lang/Object;
-
run
default void run(BiConsumer<World,BlockPos> function)
Runs aBiConsumerwith this context's world and position if this context is active.- Mappings:
Namespace Name Mixin selector official aLblw;a(Ljava/util/function/BiConsumer;)Vintermediary method_17393Lnet/minecraft/class_3914;method_17393(Ljava/util/function/BiConsumer;)Vnamed runLnet/minecraft/screen/ScreenHandlerContext;run(Ljava/util/function/BiConsumer;)V
-
-