9
0
mirror of https://github.com/Xiao-MoMi/craft-engine.git synced 2025-12-25 09:59:20 +00:00

Merge pull request #345 from iqtesterr/dev

fix: interceptor never work
This commit is contained in:
XiaoMoMi
2025-08-23 17:12:10 +08:00
committed by GitHub
5 changed files with 7 additions and 8 deletions

View File

@@ -47,7 +47,7 @@ bukkit {
name = "CraftEngine"
apiVersion = "1.20"
authors = listOf("XiaoMoMi")
contributors = listOf("jhqwqmc", "iqtesterrr", "WhiteProject1", "Catnies", "xiaozhangup", "TamashiiMon", "Halogly", "ArubikU", "Maxsh001", "Sasha2294", "MrPanda8")
contributors = listOf("jhqwqmc", "iqtesterr", "WhiteProject1", "Catnies", "xiaozhangup", "TamashiiMon", "Halogly", "ArubikU", "Maxsh001", "Sasha2294", "MrPanda8")
softDepend = listOf("PlaceholderAPI", "WorldEdit", "FastAsyncWorldEdit", "Skript")
foliaSupported = true
}

View File

@@ -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);
}

View File

@@ -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));
}

View File

@@ -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 {

View File

@@ -50,7 +50,7 @@ byte_buddy_version=1.17.5
ahocorasick_version=0.6.3
snake_yaml_version=2.4
anti_grief_version=0.19
nms_helper_version=1.0.58
nms_helper_version=1.0.59
evalex_version=3.5.0
reactive_streams_version=1.0.4
amazon_awssdk_version=2.31.23