public abstract class EventWrapper<E> extends java.lang.Object implements CoreStateAccessor
| Modifier and Type | Class and Description |
|---|---|
static class |
EventWrapper.EventType<E extends EventWrapper<?>> |
static class |
EventWrapper.Result |
| Modifier and Type | Field and Description |
|---|---|
protected E |
event |
BOOLEAN_VALUES, FABRIC, FORGE, FORGE_OR_NEOFORGE, GAME_VERSION, JAVA_17, JAVA_21, JAVA_8, JAVA_MODULES, JAVA_VERSION, JAVA_VERSION_ASM, LEGACY, MOD_LOADER, NAMED_ENV, NEOFORGE, SRG_ENV, V12, V16, V16_OR_EARLIER, V16_OR_LATER, V18, V18_OR_EARLIER, V18_OR_LATER, V19, V19_2_OR_EARLIER, V19_4_OR_LATER, V19_OR_EARLIER, V19_OR_LATER, V20, V20_4_OR_EARLIER, V20_6_OR_LATER, V20_OR_EARLIER, V20_OR_LATER, V21, V21_OR_LATER| Modifier | Constructor and Description |
|---|---|
protected |
EventWrapper(EventWrapper.EventType<?> type) |
| Modifier and Type | Method and Description |
|---|---|
protected java.util.function.Function<E,?> |
actionResultGetter(java.lang.String getterMethod) |
protected <T> java.util.function.BiConsumer<E,T> |
actionResultSetter(java.lang.String setterMethod) |
void |
cancel() |
protected <T> T |
cast(java.lang.Object obj) |
protected java.util.function.Function<E,?> |
eventResultGetter(java.lang.String getterMethod) |
protected <T> java.util.function.BiConsumer<E,T> |
eventResultSetter(java.lang.String setterMethod) |
protected <I,O> O |
getter(I input,
java.lang.String method) |
protected <I,O> O |
getter(I input,
java.lang.String method,
@Nullable java.util.function.Function<?,O> transformer) |
protected java.util.function.Function<E,java.lang.Object> |
getter(java.lang.String getterMethod) |
protected java.util.function.Function<E,java.lang.Object> |
getter(java.lang.String getterMethod,
@Nullable java.util.function.Function<?,?> transformer) |
boolean |
hasInvokers() |
boolean |
hasResult() |
<V> V |
initPrimitive(@Nullable java.util.function.Function<E,V> func,
V defVal) |
boolean |
isCancelable() |
abstract boolean |
isClient() |
abstract boolean |
isCommon() |
abstract boolean |
isServer() |
protected java.util.function.Function<E,java.lang.Object> |
nestedGetter(@Nullable java.util.function.Function<?,?> transformer,
java.lang.String... getterMethods) |
protected <I,O> O |
nestedGetter(I input,
@Nullable java.util.function.Function<?,O> transformer,
java.lang.String... methods) |
protected <I,O> O |
nestedGetter(I input,
java.lang.String... methods) |
protected java.util.function.Function<E,java.lang.Object> |
nestedGetter(java.lang.String... getterMethods) |
protected abstract void |
populate() |
void |
setEvent(E event) |
protected <T> void |
setter(E event,
T result,
java.lang.String method) |
protected <T> void |
setter(E event,
T result,
java.lang.String method,
@Nullable java.util.function.Function<?,T> transformer) |
protected <V> java.util.function.BiConsumer<E,V> |
setter(java.lang.String setterMethod) |
protected <V> java.util.function.BiConsumer<E,V> |
setter(java.lang.String setterMethod,
@Nullable java.util.function.Function<?,V> transformer) |
protected EventFieldWrapper<E,ActionResult> |
wrapActionResultBoth(java.lang.String getterMethod,
java.lang.String setterMethod) |
protected @Nullable AdvancementAPI<?> |
wrapAdvancement(@Nullable java.util.function.Function<?,?> getter) |
protected <V,T> EventFieldWrapper<E,AdvancementAPI<?>> |
wrapAdvancementBoth(java.util.function.Function<E,?> getter,
java.util.function.BiConsumer<E,T> setter) |
protected <V> EventFieldWrapper<E,AdvancementAPI<?>> |
wrapAdvancementGetter(java.util.function.Function<E,?> getter) |
protected @Nullable BlockAPI<?> |
wrapBlock(@Nullable java.util.function.Function<?,?> getter) |
protected <V,T> EventFieldWrapper<E,BlockAPI<?>> |
wrapBlockBoth(java.util.function.Function<E,?> getter,
java.util.function.BiConsumer<E,T> setter) |
protected @Nullable BlockEntityAPI<?,?> |
wrapBlockEntity(@Nullable java.util.function.Function<?,?> getter) |
protected <V,T> EventFieldWrapper<E,BlockEntityAPI<?,?>> |
wrapBlockEntityBoth(java.util.function.Function<E,?> getter,
java.util.function.BiConsumer<E,T> setter) |
protected <V> EventFieldWrapper<E,BlockEntityAPI<?,?>> |
wrapBlockEntityGetter(java.util.function.Function<E,?> getter) |
protected <V> EventFieldWrapper<E,BlockAPI<?>> |
wrapBlockGetter(java.util.function.Function<E,?> getter) |
protected <V,T> EventFieldWrapper<E,V> |
wrapBoth(java.lang.String type,
java.util.function.Function<E,?> getter,
java.util.function.BiConsumer<E,T> setter) |
protected <V,T> EventFieldWrapper<E,V> |
wrapBoth(java.lang.String type,
java.util.function.Function<E,?> getter,
java.util.function.BiConsumer<E,T> setter,
V defVal) |
protected @Nullable DamageAPI<?> |
wrapDamage(@Nullable java.util.function.Function<?,?> getter,
float amount) |
protected @Nullable DamageAPI<?> |
wrapDamage(@Nullable java.util.function.Function<?,?> getter,
@Nullable java.util.function.Function<?,java.lang.Float> getAmount) |
protected <V> EventFieldWrapper<E,DamageAPI<?>> |
wrapDamageGetter(java.util.function.Function<E,?> sourceGetter,
float amount) |
protected <V> EventFieldWrapper<E,DamageAPI<?>> |
wrapDamageGetter(java.util.function.Function<E,?> sourceGetter,
java.util.function.Function<E,java.lang.Float> getAmount) |
protected @Nullable EntityAPI<?,?> |
wrapEntity(@Nullable java.util.function.Function<?,?> getter) |
protected <V,T> EventFieldWrapper<E,EntityAPI<?,?>> |
wrapEntityBoth(java.util.function.Function<E,?> getter,
java.util.function.BiConsumer<E,T> setter) |
protected <V> EventFieldWrapper<E,EntityAPI<?,?>> |
wrapEntityGetter(java.util.function.Function<E,?> getter) |
protected EventFieldWrapper<E,EventWrapper.Result> |
wrapEventResultBoth(java.lang.String getterMethod,
java.lang.String setterMethod) |
protected @Nullable ExplosionAPI<?> |
wrapExplosion(@Nullable java.util.function.Function<?,?> getter) |
protected <V,T> EventFieldWrapper<E,ExplosionAPI<?>> |
wrapExplosionBoth(java.util.function.Function<E,?> getter,
java.util.function.BiConsumer<E,T> setter) |
protected <V> EventFieldWrapper<E,ExplosionAPI<?>> |
wrapExplosionGetter(java.util.function.Function<E,?> getter) |
protected <V,T> EventFieldWrapper<E,V> |
wrapGenericBoth(java.util.function.Function<E,?> getter,
java.util.function.BiConsumer<E,T> setter,
V defVal) |
protected <V> EventFieldWrapper<E,V> |
wrapGenericGetter(java.util.function.Function<E,?> getter,
V defVal) |
protected <V> EventFieldWrapper<E,V> |
wrapGetter(java.lang.String type,
java.util.function.Function<E,?> getter) |
protected <V> EventFieldWrapper<E,V> |
wrapGetter(java.lang.String type,
java.util.function.Function<E,?> getter,
V defVal) |
protected @Nullable ItemAPI<?> |
wrapItem(@Nullable java.util.function.Function<?,?> getter) |
protected <V,T> EventFieldWrapper<E,ItemAPI<?>> |
wrapItemBoth(java.util.function.Function<E,?> getter,
java.util.function.BiConsumer<E,T> setter) |
protected <V> EventFieldWrapper<E,ItemAPI<?>> |
wrapItemGetter(java.util.function.Function<E,?> getter) |
protected @Nullable ItemStackAPI<?> |
wrapItemStack(@Nullable java.util.function.Function<?,?> getter) |
protected <V,T> EventFieldWrapper<E,ItemStackAPI<?>> |
wrapItemStackBoth(java.util.function.Function<E,?> getter,
java.util.function.BiConsumer<E,T> setter) |
protected <V> EventFieldWrapper<E,ItemStackAPI<?>> |
wrapItemStackGetter(java.util.function.Function<E,?> getter) |
protected @Nullable LivingEntityAPI<?,?> |
wrapLiving(@Nullable java.util.function.Function<?,?> getter) |
protected <V,T> EventFieldWrapper<E,LivingEntityAPI<?,?>> |
wrapLivingBoth(java.util.function.Function<E,?> getter,
java.util.function.BiConsumer<E,T> setter) |
protected <V> EventFieldWrapper<E,LivingEntityAPI<?,?>> |
wrapLivingGetter(java.util.function.Function<E,?> getter) |
protected @Nullable PlayerAPI<?,?> |
wrapPlayer(@Nullable java.util.function.Function<E,?> getter) |
protected <V,T> EventFieldWrapper<E,PlayerAPI<?,?>> |
wrapPlayerBoth(java.util.function.Function<E,?> getter,
java.util.function.BiConsumer<E,T> setter) |
protected <V> EventFieldWrapper<E,PlayerAPI<?,?>> |
wrapPlayerGetter(java.util.function.Function<E,?> getter) |
protected @Nullable BlockPosAPI<?> |
wrapPos(@Nullable java.util.function.Function<?,?> getter) |
protected <V,T> EventFieldWrapper<E,BlockPosAPI<?>> |
wrapPosBoth(java.util.function.Function<E,?> getter,
java.util.function.BiConsumer<E,T> setter) |
protected <V> EventFieldWrapper<E,BlockPosAPI<?>> |
wrapPosGetter(java.util.function.Function<E,?> getter) |
protected @Nullable BlockSnapshotAPI<?> |
wrapSnapshot(@Nullable java.util.function.Function<?,?> getter) |
protected <V,T> EventFieldWrapper<E,BlockSnapshotAPI<?>> |
wrapSnapshotBoth(java.util.function.Function<E,?> getter,
java.util.function.BiConsumer<E,T> setter) |
protected <V> EventFieldWrapper<E,BlockSnapshotAPI<?>> |
wrapSnapshotGetter(java.util.function.Function<E,?> getter) |
protected @Nullable BlockStateAPI<?> |
wrapState(@Nullable java.util.function.Function<?,?> getter) |
protected <V,T> EventFieldWrapper<E,BlockStateAPI<?>> |
wrapStateBoth(java.util.function.Function<E,?> getter,
java.util.function.BiConsumer<E,T> setter) |
protected <V> EventFieldWrapper<E,BlockStateAPI<?>> |
wrapStateGetter(java.util.function.Function<E,?> getter) |
protected @Nullable WorldAPI<?> |
wrapWorld(@Nullable java.util.function.Function<?,?> getter) |
protected <V,T> EventFieldWrapper<E,WorldAPI<?>> |
wrapWorldBoth(java.util.function.Function<E,?> getter,
java.util.function.BiConsumer<E,T> setter) |
protected <V> EventFieldWrapper<E,WorldAPI<?>> |
wrapWorldGetter(java.util.function.Function<E,?> getter) |
protected E event
protected EventWrapper(EventWrapper.EventType<?> type)
protected java.util.function.Function<E,?> actionResultGetter(java.lang.String getterMethod)
protected <T> java.util.function.BiConsumer<E,T> actionResultSetter(java.lang.String setterMethod)
public void cancel()
protected <T> T cast(java.lang.Object obj)
@Nullable
protected <I,O> O getter(@Nullable
I input,
java.lang.String method)
@Nullable
protected <I,O> O getter(@Nullable
I input,
java.lang.String method,
@Nullable
@Nullable java.util.function.Function<?,O> transformer)
protected java.util.function.Function<E,java.lang.Object> getter(java.lang.String getterMethod)
protected java.util.function.Function<E,java.lang.Object> getter(java.lang.String getterMethod, @Nullable @Nullable java.util.function.Function<?,?> transformer)
protected java.util.function.Function<E,?> eventResultGetter(java.lang.String getterMethod)
protected <T> java.util.function.BiConsumer<E,T> eventResultSetter(java.lang.String setterMethod)
public boolean hasInvokers()
public boolean hasResult()
public <V> V initPrimitive(@Nullable
@Nullable java.util.function.Function<E,V> func,
V defVal)
public boolean isCancelable()
public abstract boolean isClient()
public abstract boolean isCommon()
public abstract boolean isServer()
@Nullable
protected <I,O> O nestedGetter(@Nullable
I input,
java.lang.String... methods)
@Nullable
protected <I,O> O nestedGetter(@Nullable
I input,
@Nullable
@Nullable java.util.function.Function<?,O> transformer,
java.lang.String... methods)
protected java.util.function.Function<E,java.lang.Object> nestedGetter(java.lang.String... getterMethods)
protected java.util.function.Function<E,java.lang.Object> nestedGetter(@Nullable @Nullable java.util.function.Function<?,?> transformer, java.lang.String... getterMethods)
protected abstract void populate()
public void setEvent(E event)
protected <T> void setter(@Nullable
E event,
T result,
java.lang.String method)
protected <T> void setter(@Nullable
E event,
T result,
java.lang.String method,
@Nullable
@Nullable java.util.function.Function<?,T> transformer)
protected <V> java.util.function.BiConsumer<E,V> setter(java.lang.String setterMethod)
protected <V> java.util.function.BiConsumer<E,V> setter(java.lang.String setterMethod, @Nullable @Nullable java.util.function.Function<?,V> transformer)
@Nullable protected @Nullable AdvancementAPI<?> wrapAdvancement(@Nullable @Nullable java.util.function.Function<?,?> getter)
protected <V,T> EventFieldWrapper<E,AdvancementAPI<?>> wrapAdvancementBoth(java.util.function.Function<E,?> getter, java.util.function.BiConsumer<E,T> setter)
protected <V> EventFieldWrapper<E,AdvancementAPI<?>> wrapAdvancementGetter(java.util.function.Function<E,?> getter)
@Nullable protected @Nullable BlockAPI<?> wrapBlock(@Nullable @Nullable java.util.function.Function<?,?> getter)
protected <V,T> EventFieldWrapper<E,BlockAPI<?>> wrapBlockBoth(java.util.function.Function<E,?> getter, java.util.function.BiConsumer<E,T> setter)
protected <V> EventFieldWrapper<E,BlockAPI<?>> wrapBlockGetter(java.util.function.Function<E,?> getter)
@Nullable protected @Nullable BlockEntityAPI<?,?> wrapBlockEntity(@Nullable @Nullable java.util.function.Function<?,?> getter)
protected <V,T> EventFieldWrapper<E,BlockEntityAPI<?,?>> wrapBlockEntityBoth(java.util.function.Function<E,?> getter, java.util.function.BiConsumer<E,T> setter)
protected <V> EventFieldWrapper<E,BlockEntityAPI<?,?>> wrapBlockEntityGetter(java.util.function.Function<E,?> getter)
protected EventFieldWrapper<E,ActionResult> wrapActionResultBoth(java.lang.String getterMethod, java.lang.String setterMethod)
protected <V,T> EventFieldWrapper<E,V> wrapBoth(java.lang.String type, java.util.function.Function<E,?> getter, java.util.function.BiConsumer<E,T> setter)
protected <V,T> EventFieldWrapper<E,V> wrapBoth(java.lang.String type, java.util.function.Function<E,?> getter, java.util.function.BiConsumer<E,T> setter, V defVal)
@Nullable protected @Nullable DamageAPI<?> wrapDamage(@Nullable @Nullable java.util.function.Function<?,?> getter, @Nullable @Nullable java.util.function.Function<?,java.lang.Float> getAmount)
@Nullable protected @Nullable DamageAPI<?> wrapDamage(@Nullable @Nullable java.util.function.Function<?,?> getter, float amount)
protected <V> EventFieldWrapper<E,DamageAPI<?>> wrapDamageGetter(java.util.function.Function<E,?> sourceGetter, java.util.function.Function<E,java.lang.Float> getAmount)
protected <V> EventFieldWrapper<E,DamageAPI<?>> wrapDamageGetter(java.util.function.Function<E,?> sourceGetter, float amount)
@Nullable protected @Nullable EntityAPI<?,?> wrapEntity(@Nullable @Nullable java.util.function.Function<?,?> getter)
protected <V,T> EventFieldWrapper<E,EntityAPI<?,?>> wrapEntityBoth(java.util.function.Function<E,?> getter, java.util.function.BiConsumer<E,T> setter)
protected <V> EventFieldWrapper<E,EntityAPI<?,?>> wrapEntityGetter(java.util.function.Function<E,?> getter)
protected EventFieldWrapper<E,EventWrapper.Result> wrapEventResultBoth(java.lang.String getterMethod, java.lang.String setterMethod)
@Nullable protected @Nullable ExplosionAPI<?> wrapExplosion(@Nullable @Nullable java.util.function.Function<?,?> getter)
protected <V,T> EventFieldWrapper<E,ExplosionAPI<?>> wrapExplosionBoth(java.util.function.Function<E,?> getter, java.util.function.BiConsumer<E,T> setter)
protected <V> EventFieldWrapper<E,ExplosionAPI<?>> wrapExplosionGetter(java.util.function.Function<E,?> getter)
protected <V> EventFieldWrapper<E,V> wrapGetter(java.lang.String type, java.util.function.Function<E,?> getter)
protected <V> EventFieldWrapper<E,V> wrapGetter(java.lang.String type, java.util.function.Function<E,?> getter, V defVal)
@Nullable protected @Nullable ItemAPI<?> wrapItem(@Nullable @Nullable java.util.function.Function<?,?> getter)
protected <V,T> EventFieldWrapper<E,ItemAPI<?>> wrapItemBoth(java.util.function.Function<E,?> getter, java.util.function.BiConsumer<E,T> setter)
protected <V> EventFieldWrapper<E,ItemAPI<?>> wrapItemGetter(java.util.function.Function<E,?> getter)
@Nullable protected @Nullable ItemStackAPI<?> wrapItemStack(@Nullable @Nullable java.util.function.Function<?,?> getter)
protected <V,T> EventFieldWrapper<E,ItemStackAPI<?>> wrapItemStackBoth(java.util.function.Function<E,?> getter, java.util.function.BiConsumer<E,T> setter)
protected <V> EventFieldWrapper<E,ItemStackAPI<?>> wrapItemStackGetter(java.util.function.Function<E,?> getter)
@Nullable protected @Nullable LivingEntityAPI<?,?> wrapLiving(@Nullable @Nullable java.util.function.Function<?,?> getter)
protected <V,T> EventFieldWrapper<E,LivingEntityAPI<?,?>> wrapLivingBoth(java.util.function.Function<E,?> getter, java.util.function.BiConsumer<E,T> setter)
protected <V> EventFieldWrapper<E,LivingEntityAPI<?,?>> wrapLivingGetter(java.util.function.Function<E,?> getter)
@Nullable protected @Nullable PlayerAPI<?,?> wrapPlayer(@Nullable @Nullable java.util.function.Function<E,?> getter)
protected <V,T> EventFieldWrapper<E,PlayerAPI<?,?>> wrapPlayerBoth(java.util.function.Function<E,?> getter, java.util.function.BiConsumer<E,T> setter)
protected <V> EventFieldWrapper<E,PlayerAPI<?,?>> wrapPlayerGetter(java.util.function.Function<E,?> getter)
@Nullable protected @Nullable BlockPosAPI<?> wrapPos(@Nullable @Nullable java.util.function.Function<?,?> getter)
protected <V,T> EventFieldWrapper<E,BlockPosAPI<?>> wrapPosBoth(java.util.function.Function<E,?> getter, java.util.function.BiConsumer<E,T> setter)
protected <V> EventFieldWrapper<E,BlockPosAPI<?>> wrapPosGetter(java.util.function.Function<E,?> getter)
protected <V,T> EventFieldWrapper<E,V> wrapGenericBoth(java.util.function.Function<E,?> getter, java.util.function.BiConsumer<E,T> setter, V defVal)
protected <V> EventFieldWrapper<E,V> wrapGenericGetter(java.util.function.Function<E,?> getter, V defVal)
@Nullable protected @Nullable BlockSnapshotAPI<?> wrapSnapshot(@Nullable @Nullable java.util.function.Function<?,?> getter)
protected <V,T> EventFieldWrapper<E,BlockSnapshotAPI<?>> wrapSnapshotBoth(java.util.function.Function<E,?> getter, java.util.function.BiConsumer<E,T> setter)
protected <V> EventFieldWrapper<E,BlockSnapshotAPI<?>> wrapSnapshotGetter(java.util.function.Function<E,?> getter)
@Nullable protected @Nullable BlockStateAPI<?> wrapState(@Nullable @Nullable java.util.function.Function<?,?> getter)
protected <V,T> EventFieldWrapper<E,BlockStateAPI<?>> wrapStateBoth(java.util.function.Function<E,?> getter, java.util.function.BiConsumer<E,T> setter)
protected <V> EventFieldWrapper<E,BlockStateAPI<?>> wrapStateGetter(java.util.function.Function<E,?> getter)
@Nullable protected @Nullable WorldAPI<?> wrapWorld(@Nullable @Nullable java.util.function.Function<?,?> getter)
protected <V,T> EventFieldWrapper<E,WorldAPI<?>> wrapWorldBoth(java.util.function.Function<E,?> getter, java.util.function.BiConsumer<E,T> setter)
protected <V> EventFieldWrapper<E,WorldAPI<?>> wrapWorldGetter(java.util.function.Function<E,?> getter)