mirror of
https://github.com/Xiao-MoMi/craft-engine.git
synced 2025-12-30 04:19:27 +00:00
fix: interceptor never work
This commit is contained in:
@@ -189,7 +189,7 @@ public class PressurePlateBlockBehavior extends BukkitBlockBehavior {
|
||||
Object pos = args[2];
|
||||
Object newState = args[3];
|
||||
boolean movedByPiston = (boolean) args[4];
|
||||
if (!movedByPiston && !FastNMS.INSTANCE.method$BlockStateBase$is(state, FastNMS.INSTANCE.method$BlockState$getBlock(newState))) {
|
||||
if (!movedByPiston && !FastNMS.INSTANCE.method$BlockStateBase$isBlock(state, FastNMS.INSTANCE.method$BlockState$getBlock(newState))) {
|
||||
if (this.getSignalForState(state) > 0) {
|
||||
this.updateNeighbours(level, pos, thisBlock);
|
||||
}
|
||||
|
||||
@@ -185,11 +185,11 @@ public final class BlockGenerator {
|
||||
.method(ElementMatchers.is(CoreReflections.method$BlockBehaviour$spawnAfterBreak))
|
||||
.intercept(MethodDelegation.to(SpawnAfterBreakInterceptor.INSTANCE));
|
||||
if (CoreReflections.method$BlockBehaviour$affectNeighborsAfterRemoval != null) {
|
||||
builder.method(ElementMatchers.is(CoreReflections.method$BlockBehaviour$affectNeighborsAfterRemoval))
|
||||
builder = builder.method(ElementMatchers.is(CoreReflections.method$BlockBehaviour$affectNeighborsAfterRemoval))
|
||||
.intercept(MethodDelegation.to(AffectNeighborsAfterRemovalInterceptor.INSTANCE));
|
||||
}
|
||||
if (CoreReflections.method$BlockBehaviour$onRemove != null) {
|
||||
builder.method(ElementMatchers.is(CoreReflections.method$BlockBehaviour$onRemove))
|
||||
builder = builder.method(ElementMatchers.is(CoreReflections.method$BlockBehaviour$onRemove))
|
||||
.intercept(MethodDelegation.to(OnRemoveInterceptor.INSTANCE));
|
||||
}
|
||||
|
||||
|
||||
@@ -4011,12 +4011,11 @@ public final class CoreReflections {
|
||||
);
|
||||
|
||||
// 1.20~1.21.4
|
||||
public static final Method method$BlockBehaviour$onRemove = MiscUtils.requireNonNullIf(
|
||||
public static final Method method$BlockBehaviour$onRemove = VersionHelper.isOrAbove1_21_5() ? null :
|
||||
ReflectionUtils.getDeclaredMethod(
|
||||
clazz$BlockBehaviour, void.class, clazz$BlockState, clazz$Level, clazz$BlockPos, clazz$BlockState, boolean.class
|
||||
),
|
||||
!VersionHelper.isOrAbove1_21_5()
|
||||
);
|
||||
|
||||
public static final Object instance$CollisionContext$empty;
|
||||
|
||||
static {
|
||||
|
||||
Reference in New Issue
Block a user