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

添加红石源API

This commit is contained in:
XiaoMoMi
2025-06-22 01:21:11 +08:00
parent 06d576b009
commit e5b959957c
18 changed files with 717 additions and 256 deletions

View File

@@ -5,7 +5,7 @@ import net.momirealms.craftengine.bukkit.item.BukkitItemManager;
import net.momirealms.craftengine.bukkit.nms.FastNMS;
import net.momirealms.craftengine.bukkit.plugin.reflection.minecraft.CoreReflections;
import net.momirealms.craftengine.bukkit.plugin.reflection.minecraft.MBlocks;
import net.momirealms.craftengine.bukkit.plugin.reflection.minecraft.MTagKey;
import net.momirealms.craftengine.bukkit.plugin.reflection.minecraft.MTagKeys;
import net.momirealms.craftengine.bukkit.util.BlockStateUtils;
import net.momirealms.craftengine.bukkit.util.DirectionUtils;
import net.momirealms.craftengine.bukkit.util.InteractUtils;
@@ -83,7 +83,7 @@ public class FenceGateBlockBehavior extends BukkitBlockBehavior {
public boolean isWall(Object state) {
if (state == null) return false;
return FastNMS.INSTANCE.method$BlockStateBase$isTagKeyBlock(state, MTagKey.Block$WALLS);
return FastNMS.INSTANCE.method$BlockStateBase$isTagKeyBlock(state, MTagKeys.Block$WALLS);
}
private Object getBlockState(Object level, BlockPos blockPos) {

View File

@@ -210,4 +210,50 @@ public class UnsafeCompositeBlockBehavior extends BukkitBlockBehavior {
}
return super.canBeReplaced(context, state);
}
@Override
public void entityInside(Object thisBlock, Object[] args, Callable<Object> superMethod) throws Exception {
for (AbstractBlockBehavior behavior : this.behaviors) {
behavior.entityInside(thisBlock, args, superMethod);
}
}
@Override
public void affectNeighborsAfterRemoval(Object thisBlock, Object[] args, Callable<Object> superMethod) throws Exception {
for (AbstractBlockBehavior behavior : this.behaviors) {
behavior.affectNeighborsAfterRemoval(thisBlock, args, superMethod);
}
}
@Override
public int getSignal(Object thisBlock, Object[] args, Callable<Object> superMethod) {
for (AbstractBlockBehavior behavior : this.behaviors) {
int signal = behavior.getSignal(thisBlock, args, superMethod);
if (signal != 0) {
return signal;
}
}
return 0;
}
@Override
public int getDirectSignal(Object thisBlock, Object[] args, Callable<Object> superMethod) {
for (AbstractBlockBehavior behavior : this.behaviors) {
int signal = behavior.getDirectSignal(thisBlock, args, superMethod);
if (signal != 0) {
return signal;
}
}
return 0;
}
@Override
public boolean isSignalSource(Object thisBlock, Object[] args, Callable<Object> superMethod) {
for (AbstractBlockBehavior behavior : this.behaviors) {
if (behavior.isSignalSource(thisBlock, args, superMethod)) {
return true;
}
}
return false;
}
}

View File

@@ -161,7 +161,24 @@ public final class BlockGenerator {
.intercept(MethodDelegation.to(PlaceLiquidInterceptor.INSTANCE))
// canPlaceLiquid
.method(ElementMatchers.is(CoreReflections.method$SimpleWaterloggedBlock$canPlaceLiquid))
.intercept(MethodDelegation.to(CanPlaceLiquidInterceptor.INSTANCE));
.intercept(MethodDelegation.to(CanPlaceLiquidInterceptor.INSTANCE))
// entityInside
.method(ElementMatchers.is(CoreReflections.method$BlockBehaviour$entityInside))
.intercept(MethodDelegation.to(EntityInsideInterceptor.INSTANCE))
// getSignal
.method(ElementMatchers.is(CoreReflections.method$BlockBehaviour$getSignal))
.intercept(MethodDelegation.to(GetSignalInterceptor.INSTANCE))
// getDirectSignal
.method(ElementMatchers.is(CoreReflections.method$BlockBehaviour$getDirectSignal))
.intercept(MethodDelegation.to(GetDirectSignalInterceptor.INSTANCE))
// isSignalSource
.method(ElementMatchers.is(CoreReflections.method$BlockBehaviour$isSignalSource))
.intercept(MethodDelegation.to(IsSignalSourceInterceptor.INSTANCE));
if (CoreReflections.method$BlockBehaviour$affectNeighborsAfterRemoval != null) {
builder.method(ElementMatchers.is(CoreReflections.method$BlockBehaviour$affectNeighborsAfterRemoval))
.intercept(MethodDelegation.to(AffectNeighborsAfterRemovalInterceptor.INSTANCE));
}
Class<?> clazz$CraftEngineBlock = builder.make().load(BlockGenerator.class.getClassLoader()).getLoaded();
constructor$CraftEngineBlock = MethodHandles.publicLookup().in(clazz$CraftEngineBlock)
.findConstructor(clazz$CraftEngineBlock, MethodType.methodType(void.class, CoreReflections.clazz$BlockBehaviour$Properties))
@@ -523,4 +540,77 @@ public final class BlockGenerator {
}
}
}
public static class GetDirectSignalInterceptor {
public static final GetDirectSignalInterceptor INSTANCE = new GetDirectSignalInterceptor();
@RuntimeType
public int intercept(@This Object thisObj, @AllArguments Object[] args, @SuperCall Callable<Object> superMethod) {
ObjectHolder<BlockBehavior> holder = ((BehaviorHolder) thisObj).getBehaviorHolder();
try {
return holder.value().getDirectSignal(thisObj, args, superMethod);
} catch (Exception e) {
CraftEngine.instance().logger().severe("Failed to run getDirectSignal", e);
return 0;
}
}
}
public static class GetSignalInterceptor {
public static final GetSignalInterceptor INSTANCE = new GetSignalInterceptor();
@RuntimeType
public int intercept(@This Object thisObj, @AllArguments Object[] args, @SuperCall Callable<Object> superMethod) {
ObjectHolder<BlockBehavior> holder = ((BehaviorHolder) thisObj).getBehaviorHolder();
try {
return holder.value().getSignal(thisObj, args, superMethod);
} catch (Exception e) {
CraftEngine.instance().logger().severe("Failed to run getSignal", e);
return 0;
}
}
}
public static class IsSignalSourceInterceptor {
public static final IsSignalSourceInterceptor INSTANCE = new IsSignalSourceInterceptor();
@RuntimeType
public boolean intercept(@This Object thisObj, @AllArguments Object[] args, @SuperCall Callable<Object> superMethod) {
ObjectHolder<BlockBehavior> holder = ((BehaviorHolder) thisObj).getBehaviorHolder();
try {
return holder.value().isSignalSource(thisObj, args, superMethod);
} catch (Exception e) {
CraftEngine.instance().logger().severe("Failed to run isSignalSource", e);
return false;
}
}
}
public static class AffectNeighborsAfterRemovalInterceptor {
public static final AffectNeighborsAfterRemovalInterceptor INSTANCE = new AffectNeighborsAfterRemovalInterceptor();
@RuntimeType
public void intercept(@This Object thisObj, @AllArguments Object[] args, @SuperCall Callable<Object> superMethod) {
ObjectHolder<BlockBehavior> holder = ((BehaviorHolder) thisObj).getBehaviorHolder();
try {
holder.value().affectNeighborsAfterRemoval(thisObj, args, superMethod);
} catch (Exception e) {
CraftEngine.instance().logger().severe("Failed to run affectNeighborsAfterRemoval", e);
}
}
}
public static class EntityInsideInterceptor {
public static final EntityInsideInterceptor INSTANCE = new EntityInsideInterceptor();
@RuntimeType
public void intercept(@This Object thisObj, @AllArguments Object[] args, @SuperCall Callable<Object> superMethod) {
ObjectHolder<BlockBehavior> holder = ((BehaviorHolder) thisObj).getBehaviorHolder();
try {
holder.value().entityInside(thisObj, args, superMethod);
} catch (Exception e) {
CraftEngine.instance().logger().severe("Failed to run entityInside", e);
}
}
}
}

View File

@@ -7,6 +7,7 @@ import com.mojang.serialization.DynamicOps;
import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelFuture;
import it.unimi.dsi.fastutil.objects.Object2IntMap;
import net.momirealms.craftengine.bukkit.block.behavior.BukkitBlockBehavior;
import net.momirealms.craftengine.bukkit.plugin.reflection.ReflectionInitException;
import net.momirealms.craftengine.bukkit.util.BukkitReflectionUtils;
import net.momirealms.craftengine.core.util.ReflectionUtils;
@@ -898,11 +899,11 @@ public final class CoreReflections {
);
public static final Field field$BLOCK_STATE_REGISTRY = requireNonNull(
ReflectionUtils.getDeclaredField(clazz$Block, CoreReflections.clazz$IdMapper, 0)
ReflectionUtils.getDeclaredField(clazz$Block, clazz$IdMapper, 0)
);
public static final Method method$IdMapper$add = requireNonNull(
ReflectionUtils.getMethod(CoreReflections.clazz$IdMapper, void.class, Object.class)
ReflectionUtils.getMethod(clazz$IdMapper, void.class, Object.class)
);
public static final Object instance$Block$BLOCK_STATE_REGISTRY;
@@ -1392,15 +1393,15 @@ public final class CoreReflections {
);
public static final Method method$BlockBehaviour$getShape = requireNonNull(
ReflectionUtils.getDeclaredMethod(clazz$BlockBehaviour, clazz$VoxelShape, new String[]{"getShape", "a"}, clazz$BlockState, clazz$BlockGetter, CoreReflections.clazz$BlockPos, clazz$CollisionContext)
ReflectionUtils.getDeclaredMethod(clazz$BlockBehaviour, clazz$VoxelShape, new String[]{"getShape", "a"}, clazz$BlockState, clazz$BlockGetter, clazz$BlockPos, clazz$CollisionContext)
);
public static final Method method$BlockBehaviour$getCollisionShape = requireNonNull(
ReflectionUtils.getDeclaredMethod(clazz$BlockBehaviour, clazz$VoxelShape, new String[]{"getCollisionShape", VersionHelper.isOrAbove1_20_3() ? "b" : "c"}, clazz$BlockState, clazz$BlockGetter, CoreReflections.clazz$BlockPos, clazz$CollisionContext)
ReflectionUtils.getDeclaredMethod(clazz$BlockBehaviour, clazz$VoxelShape, new String[]{"getCollisionShape", VersionHelper.isOrAbove1_20_3() ? "b" : "c"}, clazz$BlockState, clazz$BlockGetter, clazz$BlockPos, clazz$CollisionContext)
);
public static final Method method$BlockBehaviour$getBlockSupportShape = requireNonNull(
ReflectionUtils.getDeclaredMethod(clazz$BlockBehaviour, clazz$VoxelShape, new String[]{"getBlockSupportShape", "b_"}, clazz$BlockState, clazz$BlockGetter, CoreReflections.clazz$BlockPos)
ReflectionUtils.getDeclaredMethod(clazz$BlockBehaviour, clazz$VoxelShape, new String[]{"getBlockSupportShape", "b_"}, clazz$BlockState, clazz$BlockGetter, clazz$BlockPos)
);
public static final Field field$BlockBehaviour$properties = requireNonNull(
@@ -1577,7 +1578,7 @@ public final class CoreReflections {
);
public static final Method method$Entity$getOnPos = requireNonNull(
ReflectionUtils.getDeclaredMethod(clazz$Entity, CoreReflections.clazz$BlockPos, float.class)
ReflectionUtils.getDeclaredMethod(clazz$Entity, clazz$BlockPos, float.class)
);
public static final Class<?> clazz$ItemStack = requireNonNull(
@@ -1607,8 +1608,8 @@ public final class CoreReflections {
public static final Method method$BlockBehaviour$updateShape = requireNonNull(
VersionHelper.isOrAbove1_21_2() ?
ReflectionUtils.getDeclaredMethod(clazz$BlockBehaviour, clazz$BlockState, clazz$BlockState, clazz$LevelReader, clazz$ScheduledTickAccess, CoreReflections.clazz$BlockPos, CoreReflections.clazz$Direction, CoreReflections.clazz$BlockPos, clazz$BlockState, clazz$RandomSource) :
ReflectionUtils.getDeclaredMethod(clazz$BlockBehaviour, clazz$BlockState, clazz$BlockState, CoreReflections.clazz$Direction, clazz$BlockState, clazz$LevelAccessor, CoreReflections.clazz$BlockPos, CoreReflections.clazz$BlockPos)
ReflectionUtils.getDeclaredMethod(clazz$BlockBehaviour, clazz$BlockState, clazz$BlockState, clazz$LevelReader, clazz$ScheduledTickAccess, clazz$BlockPos, clazz$Direction, clazz$BlockPos, clazz$BlockState, clazz$RandomSource) :
ReflectionUtils.getDeclaredMethod(clazz$BlockBehaviour, clazz$BlockState, clazz$BlockState, clazz$Direction, clazz$BlockState, clazz$LevelAccessor, clazz$BlockPos, clazz$BlockPos)
);
public static final Class<?> clazz$Fallable = requireNonNull(
@@ -1634,7 +1635,7 @@ public final class CoreReflections {
);
public static final Method method$FallingBlockEntity$fall = requireNonNull(
ReflectionUtils.getStaticMethod(clazz$FallingBlockEntity, clazz$FallingBlockEntity, clazz$Level, CoreReflections.clazz$BlockPos, clazz$BlockState)
ReflectionUtils.getStaticMethod(clazz$FallingBlockEntity, clazz$FallingBlockEntity, clazz$Level, clazz$BlockPos, clazz$BlockState)
);
public static final Method method$FallingBlockEntity$setHurtsEntities = requireNonNull(
@@ -1662,11 +1663,11 @@ public final class CoreReflections {
);
public static final Method method$BlockStateBase$hasTag = requireNonNull(
ReflectionUtils.getMethod(clazz$BlockStateBase, boolean.class, CoreReflections.clazz$TagKey)
ReflectionUtils.getMethod(clazz$BlockStateBase, boolean.class, clazz$TagKey)
);
public static final Method method$Level$removeBlock = requireNonNull(
ReflectionUtils.getMethod(clazz$Level, boolean.class, CoreReflections.clazz$BlockPos, boolean.class)
ReflectionUtils.getMethod(clazz$Level, boolean.class, clazz$BlockPos, boolean.class)
);
public static final Class<?> clazz$LeavesBlock = requireNonNull(
@@ -1704,18 +1705,18 @@ public final class CoreReflections {
public static final Method method$Block$updateFromNeighbourShapes = requireNonNull(
ReflectionUtils.getStaticMethod(clazz$Block, clazz$BlockState, clazz$BlockState, clazz$LevelAccessor, CoreReflections.clazz$BlockPos)
ReflectionUtils.getStaticMethod(clazz$Block, clazz$BlockState, clazz$BlockState, clazz$LevelAccessor, clazz$BlockPos)
);
public static final Method method$BlockStateBase$updateNeighbourShapes = requireNonNull(
ReflectionUtils.getMethod(
// flags // depth
clazz$BlockStateBase, void.class, clazz$LevelAccessor, CoreReflections.clazz$BlockPos, int.class, int.class
clazz$BlockStateBase, void.class, clazz$LevelAccessor, clazz$BlockPos, int.class, int.class
)
);
public static final Method method$BlockState$getShape = requireNonNull(
ReflectionUtils.getMethod(clazz$BlockStateBase, clazz$VoxelShape, new String[]{"getShape", "a"}, clazz$BlockGetter, CoreReflections.clazz$BlockPos, clazz$CollisionContext)
ReflectionUtils.getMethod(clazz$BlockStateBase, clazz$VoxelShape, new String[]{"getShape", "a"}, clazz$BlockGetter, clazz$BlockPos, clazz$CollisionContext)
);
public static final Method method$VoxelShape$isEmpty = requireNonNull(
@@ -1727,7 +1728,7 @@ public final class CoreReflections {
);
public static final Method method$LevelWriter$setBlock = requireNonNull(
ReflectionUtils.getMethod(clazz$LevelWriter, boolean.class, CoreReflections.clazz$BlockPos, clazz$BlockState, int.class)
ReflectionUtils.getMethod(clazz$LevelWriter, boolean.class, clazz$BlockPos, clazz$BlockState, int.class)
);
public static final Method method$CollisionContext$of = requireNonNull(
@@ -1739,15 +1740,15 @@ public final class CoreReflections {
);
public static final Method method$BlockStateBase$canSurvive = requireNonNull(
ReflectionUtils.getMethod(clazz$BlockStateBase, boolean.class, clazz$LevelReader, CoreReflections.clazz$BlockPos)
ReflectionUtils.getMethod(clazz$BlockStateBase, boolean.class, clazz$LevelReader, clazz$BlockPos)
);
public static final Method method$BlockStateBase$onPlace = requireNonNull(
ReflectionUtils.getMethod(clazz$BlockStateBase, void.class, clazz$Level, CoreReflections.clazz$BlockPos, clazz$BlockState, boolean.class)
ReflectionUtils.getMethod(clazz$BlockStateBase, void.class, clazz$Level, clazz$BlockPos, clazz$BlockState, boolean.class)
);
public static final Method method$ItemStack$isTag = requireNonNull(
ReflectionUtils.getMethod(clazz$ItemStack, boolean.class, CoreReflections.clazz$TagKey)
ReflectionUtils.getMethod(clazz$ItemStack, boolean.class, clazz$TagKey)
);
public static final Class<?> clazz$FireBlock = requireNonNull(
@@ -1867,7 +1868,7 @@ public final class CoreReflections {
);
public static final Field field$Inventory$items = requireNonNull(
ReflectionUtils.getInstanceDeclaredField(clazz$Inventory, CoreReflections.clazz$NonNullList, 0)
ReflectionUtils.getInstanceDeclaredField(clazz$Inventory, clazz$NonNullList, 0)
);
public static final Class<?> clazz$Ingredient = requireNonNull(
@@ -1906,7 +1907,7 @@ public final class CoreReflections {
// 1.20.1-1.20.2
public static final Field field$1_20_1$ShapedRecipe$recipeItems=
ReflectionUtils.getDeclaredField(clazz$ShapedRecipe, CoreReflections.clazz$NonNullList, 0);
ReflectionUtils.getDeclaredField(clazz$ShapedRecipe, clazz$NonNullList, 0);
// 1.20.3+
public static final Field field$1_20_3$ShapedRecipe$pattern=
@@ -1914,7 +1915,7 @@ public final class CoreReflections {
// 1.20.3-1.21.1
public static final Field field$ShapedRecipePattern$ingredients1_20_3 = Optional.ofNullable(clazz$ShapedRecipePattern)
.map(it -> ReflectionUtils.getDeclaredField(it, CoreReflections.clazz$NonNullList, 0))
.map(it -> ReflectionUtils.getDeclaredField(it, clazz$NonNullList, 0))
.orElse(null);
// 1.21.2+
@@ -1967,7 +1968,7 @@ public final class CoreReflections {
public static final Field field$ShapelessRecipe$ingredients =
Optional.ofNullable(ReflectionUtils.getDeclaredField(clazz$ShapelessRecipe, List.class, 0))
.orElse(ReflectionUtils.getDeclaredField(clazz$ShapelessRecipe, CoreReflections.clazz$NonNullList, 0));
.orElse(ReflectionUtils.getDeclaredField(clazz$ShapelessRecipe, clazz$NonNullList, 0));
// require ResourceLocation for 1.20.1-1.21.1
// require ResourceKey for 1.21.2+
@@ -2095,7 +2096,7 @@ public final class CoreReflections {
.orElse(null);
public static final Field field$AbstractFurnaceBlockEntity$items = requireNonNull(
ReflectionUtils.getDeclaredField(clazz$AbstractFurnaceBlockEntity, CoreReflections.clazz$NonNullList, 0)
ReflectionUtils.getDeclaredField(clazz$AbstractFurnaceBlockEntity, clazz$NonNullList, 0)
);
public static final Class<?> clazz$SimpleContainer = requireNonNull(
@@ -2106,15 +2107,15 @@ public final class CoreReflections {
);
public static final Field field$SimpleContainer$items = requireNonNull(
ReflectionUtils.getDeclaredField(clazz$SimpleContainer, CoreReflections.clazz$NonNullList, 0)
ReflectionUtils.getDeclaredField(clazz$SimpleContainer, clazz$NonNullList, 0)
);
public static final Method method$LevelReader$getMaxLocalRawBrightness = requireNonNull(
ReflectionUtils.getMethod(clazz$LevelReader, int.class, CoreReflections.clazz$BlockPos)
ReflectionUtils.getMethod(clazz$LevelReader, int.class, clazz$BlockPos)
);
public static final Method method$ConfiguredFeature$place = requireNonNull(
ReflectionUtils.getMethod(clazz$ConfiguredFeature, boolean.class, clazz$WorldGenLevel, clazz$ChunkGenerator, clazz$RandomSource, CoreReflections.clazz$BlockPos)
ReflectionUtils.getMethod(clazz$ConfiguredFeature, boolean.class, clazz$WorldGenLevel, clazz$ChunkGenerator, clazz$RandomSource, clazz$BlockPos)
);
public static final Class<?> clazz$BonemealableBlock = requireNonNull(
@@ -2126,12 +2127,12 @@ public final class CoreReflections {
public static final Method method$BonemealableBlock$isValidBonemealTarget = requireNonNull(
VersionHelper.isOrAbove1_20_2() ?
ReflectionUtils.getInstanceMethod(clazz$BonemealableBlock, boolean.class, clazz$LevelReader, CoreReflections.clazz$BlockPos, clazz$BlockState) :
ReflectionUtils.getInstanceMethod(clazz$BonemealableBlock, boolean.class, clazz$LevelReader, CoreReflections.clazz$BlockPos, clazz$BlockState, boolean.class)
ReflectionUtils.getInstanceMethod(clazz$BonemealableBlock, boolean.class, clazz$LevelReader, clazz$BlockPos, clazz$BlockState) :
ReflectionUtils.getInstanceMethod(clazz$BonemealableBlock, boolean.class, clazz$LevelReader, clazz$BlockPos, clazz$BlockState, boolean.class)
);
public static final Method method$BonemealableBlock$isBonemealSuccess = requireNonNull(
ReflectionUtils.getMethod(clazz$BonemealableBlock, boolean.class, clazz$Level, clazz$RandomSource, CoreReflections.clazz$BlockPos, clazz$BlockState)
ReflectionUtils.getMethod(clazz$BonemealableBlock, boolean.class, clazz$Level, clazz$RandomSource, clazz$BlockPos, clazz$BlockState)
);
public static final Method method$PalettedContainer$getAndSet = Objects.requireNonNull(
@@ -2181,11 +2182,11 @@ public final class CoreReflections {
);
public static final Constructor<?> constructor$JukeboxSong = Optional.ofNullable(clazz$JukeboxSong)
.map(it -> ReflectionUtils.getConstructor(it, CoreReflections.clazz$Holder, clazz$Component, float.class, int.class))
.map(it -> ReflectionUtils.getConstructor(it, clazz$Holder, clazz$Component, float.class, int.class))
.orElse(null);
public static final Field field$JukeboxSong$soundEvent = Optional.ofNullable(clazz$JukeboxSong)
.map(it -> ReflectionUtils.getDeclaredField(it, CoreReflections.clazz$Holder, 0))
.map(it -> ReflectionUtils.getDeclaredField(it, clazz$Holder, 0))
.orElse(null);
public static final Field field$JukeboxSong$description = Optional.ofNullable(clazz$JukeboxSong)
@@ -2298,15 +2299,15 @@ public final class CoreReflections {
);
public static final Method method$BlockHitResult$withPosition = requireNonNull(
ReflectionUtils.getMethod(clazz$BlockHitResult, clazz$BlockHitResult, CoreReflections.clazz$BlockPos)
ReflectionUtils.getMethod(clazz$BlockHitResult, clazz$BlockHitResult, clazz$BlockPos)
);
public static final Field field$BlockHitResul$blockPos = requireNonNull(
ReflectionUtils.getDeclaredField(clazz$BlockHitResult, CoreReflections.clazz$BlockPos, 0)
ReflectionUtils.getDeclaredField(clazz$BlockHitResult, clazz$BlockPos, 0)
);
public static final Field field$BlockHitResul$direction = requireNonNull(
ReflectionUtils.getDeclaredField(clazz$BlockHitResult, CoreReflections.clazz$Direction, 0)
ReflectionUtils.getDeclaredField(clazz$BlockHitResult, clazz$Direction, 0)
);
public static final Field field$BlockHitResul$miss = requireNonNull(
@@ -2337,22 +2338,22 @@ public final class CoreReflections {
public static final Method method$SimpleWaterloggedBlock$canPlaceLiquid = requireNonNull(
VersionHelper.isOrAbove1_21_5()
? ReflectionUtils.getMethod(clazz$SimpleWaterloggedBlock, boolean.class, clazz$LivingEntity, clazz$BlockGetter, CoreReflections.clazz$BlockPos, clazz$BlockState, clazz$Fluid)
? ReflectionUtils.getMethod(clazz$SimpleWaterloggedBlock, boolean.class, clazz$LivingEntity, clazz$BlockGetter, clazz$BlockPos, clazz$BlockState, clazz$Fluid)
: VersionHelper.isOrAbove1_20_2()
? ReflectionUtils.getMethod(clazz$SimpleWaterloggedBlock, boolean.class, clazz$Player, clazz$BlockGetter, CoreReflections.clazz$BlockPos, clazz$BlockState, clazz$Fluid)
: ReflectionUtils.getMethod(clazz$SimpleWaterloggedBlock, boolean.class, clazz$BlockGetter, CoreReflections.clazz$BlockPos, clazz$BlockState, clazz$Fluid)
? ReflectionUtils.getMethod(clazz$SimpleWaterloggedBlock, boolean.class, clazz$Player, clazz$BlockGetter, clazz$BlockPos, clazz$BlockState, clazz$Fluid)
: ReflectionUtils.getMethod(clazz$SimpleWaterloggedBlock, boolean.class, clazz$BlockGetter, clazz$BlockPos, clazz$BlockState, clazz$Fluid)
);
public static final Method method$SimpleWaterloggedBlock$placeLiquid = requireNonNull(
ReflectionUtils.getMethod(clazz$SimpleWaterloggedBlock, boolean.class, clazz$LevelAccessor, CoreReflections.clazz$BlockPos, clazz$BlockState, clazz$FluidState)
ReflectionUtils.getMethod(clazz$SimpleWaterloggedBlock, boolean.class, clazz$LevelAccessor, clazz$BlockPos, clazz$BlockState, clazz$FluidState)
);
public static final Method method$SimpleWaterloggedBlock$pickupBlock = requireNonNull(
VersionHelper.isOrAbove1_21_5()
? ReflectionUtils.getMethod(clazz$SimpleWaterloggedBlock, clazz$ItemStack, clazz$LivingEntity, clazz$LevelAccessor, CoreReflections.clazz$BlockPos, clazz$BlockState)
? ReflectionUtils.getMethod(clazz$SimpleWaterloggedBlock, clazz$ItemStack, clazz$LivingEntity, clazz$LevelAccessor, clazz$BlockPos, clazz$BlockState)
: VersionHelper.isOrAbove1_20_2()
? ReflectionUtils.getMethod(clazz$SimpleWaterloggedBlock, clazz$ItemStack, clazz$Player, clazz$LevelAccessor, CoreReflections.clazz$BlockPos, clazz$BlockState)
: ReflectionUtils.getMethod(clazz$SimpleWaterloggedBlock, clazz$ItemStack, clazz$LevelAccessor, CoreReflections.clazz$BlockPos, clazz$BlockState)
? ReflectionUtils.getMethod(clazz$SimpleWaterloggedBlock, clazz$ItemStack, clazz$Player, clazz$LevelAccessor, clazz$BlockPos, clazz$BlockState)
: ReflectionUtils.getMethod(clazz$SimpleWaterloggedBlock, clazz$ItemStack, clazz$LevelAccessor, clazz$BlockPos, clazz$BlockState)
);
public static final Method method$Fluid$getTickDelay = requireNonNull(
@@ -2448,7 +2449,7 @@ public final class CoreReflections {
}
public static final Method method$BlockStateBase$isFaceSturdy = requireNonNull(
ReflectionUtils.getMethod(clazz$BlockStateBase, boolean.class, clazz$BlockGetter, CoreReflections.clazz$BlockPos, CoreReflections.clazz$Direction, clazz$SupportType)
ReflectionUtils.getMethod(clazz$BlockStateBase, boolean.class, clazz$BlockGetter, clazz$BlockPos, clazz$Direction, clazz$SupportType)
);
public static final Class<?> clazz$BlockInWorld = requireNonNull(
@@ -2480,7 +2481,7 @@ public final class CoreReflections {
);
public static final Method method$BlockAndTintGetter$getRawBrightness = requireNonNull(
ReflectionUtils.getMethod(clazz$BlockAndTintGetter, int.class, CoreReflections.clazz$BlockPos, int.class)
ReflectionUtils.getMethod(clazz$BlockAndTintGetter, int.class, clazz$BlockPos, int.class)
);
public static final Field field$Entity$boundingBox = requireNonNull(
@@ -2566,7 +2567,7 @@ public final class CoreReflections {
// 1.20.5+
public static final Constructor<?> constructor$AttributeInstance =
ReflectionUtils.getConstructor(clazz$AttributeInstance, CoreReflections.clazz$Holder, Consumer.class);
ReflectionUtils.getConstructor(clazz$AttributeInstance, clazz$Holder, Consumer.class);
public static final Method method$AttributeInstance$setBaseValue = requireNonNull(
ReflectionUtils.getMethod(clazz$AttributeInstance, void.class, double.class)
@@ -2730,9 +2731,9 @@ public final class CoreReflections {
public static final Method method$BlockBehaviour$neighborChanged = requireNonNull(
VersionHelper.isOrAbove1_21_2() ?
ReflectionUtils.getDeclaredMethod(clazz$BlockBehaviour, void.class, clazz$BlockState, clazz$Level, CoreReflections.clazz$BlockPos, clazz$Block, clazz$Orientation, boolean.class) :
Optional.ofNullable(ReflectionUtils.getDeclaredMethod(clazz$BlockBehaviour, void.class, clazz$BlockState, clazz$Level, CoreReflections.clazz$BlockPos, clazz$Block, CoreReflections.clazz$BlockPos, boolean.class))
.orElse(ReflectionUtils.getMethod(clazz$BlockBehaviour, void.class, clazz$BlockState, clazz$Level, CoreReflections.clazz$BlockPos, clazz$Block, CoreReflections.clazz$BlockPos, boolean.class))
ReflectionUtils.getDeclaredMethod(clazz$BlockBehaviour, void.class, clazz$BlockState, clazz$Level, clazz$BlockPos, clazz$Block, clazz$Orientation, boolean.class) :
Optional.ofNullable(ReflectionUtils.getDeclaredMethod(clazz$BlockBehaviour, void.class, clazz$BlockState, clazz$Level, clazz$BlockPos, clazz$Block, clazz$BlockPos, boolean.class))
.orElse(ReflectionUtils.getMethod(clazz$BlockBehaviour, void.class, clazz$BlockState, clazz$Level, clazz$BlockPos, clazz$Block, clazz$BlockPos, boolean.class))
);
public static final Class<?> clazz$InventoryMenu = requireNonNull(
@@ -2784,7 +2785,7 @@ public final class CoreReflections {
);
public static final Method method$ServerLevel$getNoiseBiome = requireNonNull(
ReflectionUtils.getMethod(clazz$ServerLevel, CoreReflections.clazz$Holder, int.class, int.class, int.class)
ReflectionUtils.getMethod(clazz$ServerLevel, clazz$Holder, int.class, int.class, int.class)
);
public static final Class<?> clazz$MinecraftServer = requireNonNull(
@@ -2796,7 +2797,7 @@ public final class CoreReflections {
);
public static final Field field$MinecraftServer$registries = requireNonNull(
ReflectionUtils.getDeclaredField(clazz$MinecraftServer, CoreReflections.clazz$LayeredRegistryAccess, 0)
ReflectionUtils.getDeclaredField(clazz$MinecraftServer, clazz$LayeredRegistryAccess, 0)
);
public static final Class<?> clazz$ServerConnectionListener = requireNonNull(
@@ -2930,13 +2931,13 @@ public final class CoreReflections {
);
public static final Method method$ServerPlayerGameMode$destroyBlock = requireNonNull(
ReflectionUtils.getMethod(clazz$ServerPlayerGameMode, boolean.class, CoreReflections.clazz$BlockPos)
ReflectionUtils.getMethod(clazz$ServerPlayerGameMode, boolean.class, clazz$BlockPos)
);
public static final Method method$ServerPlayer$getEffect = requireNonNull(
!VersionHelper.isOrAbove1_20_5() ?
ReflectionUtils.getMethod(clazz$ServerPlayer, clazz$MobEffectInstance, clazz$MobEffect) :
ReflectionUtils.getMethod(clazz$ServerPlayer, clazz$MobEffectInstance, CoreReflections.clazz$Holder)
ReflectionUtils.getMethod(clazz$ServerPlayer, clazz$MobEffectInstance, clazz$Holder)
);
public static final Field field$ServerLevel$uuid = requireNonNull(
@@ -2944,7 +2945,7 @@ public final class CoreReflections {
);
public static final Method method$ServerLevel$checkEntityCollision = requireNonNull(
ReflectionUtils.getMethod(clazz$ServerLevel, boolean.class, clazz$BlockState, clazz$Entity, clazz$CollisionContext, CoreReflections.clazz$BlockPos, boolean.class)
ReflectionUtils.getMethod(clazz$ServerLevel, boolean.class, clazz$BlockState, clazz$Entity, clazz$CollisionContext, clazz$BlockPos, boolean.class)
);
public static final Class<?> clazz$ResourceManager = requireNonNull(
@@ -3061,19 +3062,19 @@ public final class CoreReflections {
public static final Method method$ServerLevel$sendBlockUpdated = requireNonNull(
ReflectionUtils.getMethod(
clazz$ServerLevel, void.class, CoreReflections.clazz$BlockPos, clazz$BlockState, clazz$BlockState, int.class
clazz$ServerLevel, void.class, clazz$BlockPos, clazz$BlockState, clazz$BlockState, int.class
)
);
public static final Method method$ServerLevel$levelEvent = requireNonNull(
VersionHelper.isOrAbove1_21_5()
? ReflectionUtils.getMethod(clazz$ServerLevel, void.class, clazz$Entity, int.class, CoreReflections.clazz$BlockPos, int.class)
: ReflectionUtils.getMethod(clazz$ServerLevel, void.class, clazz$Player, int.class, CoreReflections.clazz$BlockPos, int.class)
? ReflectionUtils.getMethod(clazz$ServerLevel, void.class, clazz$Entity, int.class, clazz$BlockPos, int.class)
: ReflectionUtils.getMethod(clazz$ServerLevel, void.class, clazz$Player, int.class, clazz$BlockPos, int.class)
);
public static final Method method$ServerGamePacketListenerImpl$tryPickItem =
VersionHelper.isOrAbove1_21_5() ?
ReflectionUtils.getDeclaredMethod(clazz$ServerGamePacketListenerImpl, void.class, clazz$ItemStack, CoreReflections.clazz$BlockPos, clazz$Entity, boolean.class) :
ReflectionUtils.getDeclaredMethod(clazz$ServerGamePacketListenerImpl, void.class, clazz$ItemStack, clazz$BlockPos, clazz$Entity, boolean.class) :
ReflectionUtils.getDeclaredMethod(clazz$ServerGamePacketListenerImpl, void.class, clazz$ItemStack);
public static final Method method$ServerPlayer$nextContainerCounter = requireNonNull(
@@ -3216,15 +3217,45 @@ public final class CoreReflections {
);
public static final Method method$BonemealableBlock$performBonemeal = requireNonNull(
ReflectionUtils.getMethod(clazz$BonemealableBlock, void.class, clazz$ServerLevel, clazz$RandomSource, CoreReflections.clazz$BlockPos, clazz$BlockState)
ReflectionUtils.getMethod(clazz$BonemealableBlock, void.class, clazz$ServerLevel, clazz$RandomSource, clazz$BlockPos, clazz$BlockState)
);
public static final Method method$BlockBehaviour$tick = requireNonNull(
ReflectionUtils.getDeclaredMethod(clazz$BlockBehaviour, void.class, new String[]{"tick", "a"}, clazz$BlockState, clazz$ServerLevel, CoreReflections.clazz$BlockPos, clazz$RandomSource)
ReflectionUtils.getDeclaredMethod(clazz$BlockBehaviour, void.class, new String[]{"tick", "a"}, clazz$BlockState, clazz$ServerLevel, clazz$BlockPos, clazz$RandomSource)
);
public static final Method method$BlockBehaviour$randomTick = requireNonNull(
ReflectionUtils.getDeclaredMethod(clazz$BlockBehaviour, void.class, new String[]{"randomTick", "b"}, clazz$BlockState, clazz$ServerLevel, CoreReflections.clazz$BlockPos, clazz$RandomSource)
ReflectionUtils.getDeclaredMethod(clazz$BlockBehaviour, void.class, new String[]{"randomTick", "b"}, clazz$BlockState, clazz$ServerLevel, clazz$BlockPos, clazz$RandomSource)
);
public static final Class<?> clazz$InsideBlockEffectApplier = BukkitReflectionUtils.findReobfOrMojmapClass(
"world.entity.InsideBlockEffectApplier",
"world.entity.InsideBlockEffectApplier"
);
public static final Method method$BlockBehaviour$entityInside = requireNonNull(
VersionHelper.isOrAbove1_21_5() ?
ReflectionUtils.getDeclaredMethod(clazz$BlockBehaviour, void.class, new String[]{"entityInside", "a"}, clazz$BlockState, clazz$Level, clazz$BlockPos, clazz$Entity, clazz$InsideBlockEffectApplier) :
ReflectionUtils.getDeclaredMethod(clazz$BlockBehaviour, void.class, new String[]{"entityInside", "a"}, clazz$BlockState, clazz$Level, clazz$BlockPos, clazz$Entity)
);
// 1.21.5+
public static final Method method$BlockBehaviour$affectNeighborsAfterRemoval = ReflectionUtils.getDeclaredMethod(clazz$BlockBehaviour, void.class, new String[]{"affectNeighborsAfterRemoval", "a"}, clazz$BlockState, clazz$ServerLevel, clazz$BlockPos, boolean.class);
public static final Method method$BlockBehaviour$getSignal = requireNonNull(
ReflectionUtils.getDeclaredMethod(clazz$BlockBehaviour, int.class, new String[]{"getSignal", "a"}, clazz$BlockState, clazz$BlockGetter, clazz$BlockPos, clazz$Direction)
);
public static final Method method$BlockBehaviour$getDirectSignal = requireNonNull(
ReflectionUtils.getDeclaredMethod(clazz$BlockBehaviour, int.class, new String[]{"getDirectSignal", "b"}, clazz$BlockState, clazz$BlockGetter, clazz$BlockPos, clazz$Direction)
);
public static final Method method$BlockBehaviour$isSignalSource = requireNonNull(
ReflectionUtils.getDeclaredMethod(clazz$BlockBehaviour, boolean.class, new String[]{
"isSignalSource",
!VersionHelper.isOrAbove1_20_5() ? "f_" : // 1.20.1-1.20.4
!VersionHelper.isOrAbove1_21_2() ? "e_" /* 1.20.5-1.21.1 */ : "f_" // 1.21.2+
}, clazz$BlockState)
);
public static final Method method$FileToIdConverter$listMatchingResources = requireNonNull(
@@ -3232,7 +3263,7 @@ public final class CoreReflections {
);
public static final Method method$RegistryOps$create = requireNonNull(
ReflectionUtils.getStaticMethod(clazz$RegistryOps, clazz$RegistryOps, DynamicOps.class, CoreReflections.clazz$HolderLookup$Provider)
ReflectionUtils.getStaticMethod(clazz$RegistryOps, clazz$RegistryOps, DynamicOps.class, clazz$HolderLookup$Provider)
);
public static final Method method$DefaultedRegistry$get = requireNonNull(

View File

@@ -16,7 +16,7 @@ import net.momirealms.sparrow.nbt.codec.NBTOps;
import static java.util.Objects.requireNonNull;
@SuppressWarnings("unchecked")
public class MRegistryOps {
public final class MRegistryOps {
public static final DynamicOps<Object> NBT;
public static final DynamicOps<Tag> SPARROW_NBT;
public static final DynamicOps<Object> JAVA;

View File

@@ -4,8 +4,8 @@ import net.momirealms.craftengine.bukkit.nms.FastNMS;
import java.util.Objects;
public class MTagKey {
private MTagKey() {}
public final class MTagKeys {
private MTagKeys() {}
public static final Object Item$WOOL = create(MRegistries.ITEM, "wool");
public static final Object Block$WALLS = create(MRegistries.BLOCK, "walls");

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1844,7 +1844,7 @@
"block/bamboo_wood_trapdoor/toggle3",
"block/bamboo_wood_trapdoor/toggle4"
],
"subtitle": "subtitles.block.trapdoor.toggle"
"subtitle": "subtitles.block.trapdoor.close"
},
"block.bamboo_wood_trapdoor.open": {
"sounds": [
@@ -1853,7 +1853,7 @@
"block/bamboo_wood_trapdoor/toggle3",
"block/bamboo_wood_trapdoor/toggle4"
],
"subtitle": "subtitles.block.trapdoor.toggle"
"subtitle": "subtitles.block.trapdoor.open"
},
"block.barrel.close": {
"sounds": [
@@ -3268,7 +3268,7 @@
"block/cherrywood_trapdoor/toggle2",
"block/cherrywood_trapdoor/toggle3"
],
"subtitle": "subtitles.block.trapdoor.toggle"
"subtitle": "subtitles.block.trapdoor.close"
},
"block.cherry_wood_trapdoor.open": {
"sounds": [
@@ -3276,7 +3276,7 @@
"block/cherrywood_trapdoor/toggle2",
"block/cherrywood_trapdoor/toggle3"
],
"subtitle": "subtitles.block.trapdoor.toggle"
"subtitle": "subtitles.block.trapdoor.open"
},
"block.chest.close": {
"sounds": [
@@ -3978,7 +3978,7 @@
"block/copper_trapdoor/toggle3",
"block/copper_trapdoor/toggle4"
],
"subtitle": "subtitles.block.copper_trapdoor.close"
"subtitle": "subtitles.block.trapdoor.close"
},
"block.copper_trapdoor.open": {
"sounds": [
@@ -3987,7 +3987,7 @@
"block/copper_trapdoor/toggle3",
"block/copper_trapdoor/toggle4"
],
"subtitle": "subtitles.block.copper_trapdoor.open"
"subtitle": "subtitles.block.trapdoor.open"
},
"block.coral_block.break": {
"sounds": [
@@ -4655,6 +4655,73 @@
],
"subtitle": "subtitles.block.dispenser.dispense"
},
"block.dried_ghast.ambient": {
"sounds": [
"block/dried_ghast/ambient1",
"block/dried_ghast/ambient2",
"block/dried_ghast/ambient3",
"block/dried_ghast/ambient4"
],
"subtitle": "subtitles.block.dried_ghast.ambient"
},
"block.dried_ghast.ambient_water": {
"sounds": [
"block/dried_ghast/ambient_water1",
"block/dried_ghast/ambient_water2"
],
"subtitle": "subtitles.block.dried_ghast.ambient_water"
},
"block.dried_ghast.break": {
"sounds": [
"block/dried_ghast/break"
],
"subtitle": "subtitles.block.generic.break"
},
"block.dried_ghast.fall": {
"sounds": [
"block/dried_ghast/step1",
"block/dried_ghast/step2",
"block/dried_ghast/step3",
"block/dried_ghast/step4",
"block/dried_ghast/step5",
"block/dried_ghast/step6"
],
"subtitle": "subtitles.block.generic.fall"
},
"block.dried_ghast.place": {
"sounds": [
"block/dried_ghast/place1",
"block/dried_ghast/place2",
"block/dried_ghast/place3",
"block/dried_ghast/place4",
"block/dried_ghast/place5",
"block/dried_ghast/place6"
],
"subtitle": "subtitles.block.generic.place"
},
"block.dried_ghast.place_in_water": {
"sounds": [
"block/dried_ghast/placeinwater"
],
"subtitle": "subtitles.block.dried_ghast.place_in_water"
},
"block.dried_ghast.step": {
"sounds": [
"block/dried_ghast/step1",
"block/dried_ghast/step2",
"block/dried_ghast/step3",
"block/dried_ghast/step4",
"block/dried_ghast/step5",
"block/dried_ghast/step6"
],
"subtitle": "subtitles.block.generic.footsteps"
},
"block.dried_ghast.transition": {
"sounds": [
"block/dried_ghast/transition"
],
"subtitle": "subtitles.block.dried_ghast.transition"
},
"block.dripstone_block.break": {
"sounds": [
"block/dripstone/break1",
@@ -4708,6 +4775,23 @@
],
"subtitle": "subtitles.block.generic.footsteps"
},
"block.dry_grass.ambient": {
"sounds": [
"block/dry_grass/wind1",
"block/dry_grass/wind2",
"block/dry_grass/wind3",
"block/dry_grass/wind4",
"block/dry_grass/wind5",
"block/dry_grass/wind6",
"block/dry_grass/wind7",
"block/dry_grass/wind8",
"block/dry_grass/wind9",
"block/dry_grass/wind10",
"block/dry_grass/wind11",
"block/dry_grass/wind12"
],
"subtitle": "subtitles.block.dry_grass.ambient"
},
"block.enchantment_table.use": {
"sounds": [
"block/enchantment_table/enchant1",
@@ -5886,7 +5970,7 @@
"volume": 0.9
}
],
"subtitle": "subtitles.block.iron_trapdoor.close"
"subtitle": "subtitles.block.trapdoor.close"
},
"block.iron_trapdoor.open": {
"sounds": [
@@ -5907,7 +5991,7 @@
"volume": 0.9
}
],
"subtitle": "subtitles.block.iron_trapdoor.open"
"subtitle": "subtitles.block.trapdoor.open"
},
"block.ladder.break": {
"sounds": [
@@ -7670,7 +7754,7 @@
"block/nether_wood_trapdoor/toggle3",
"block/nether_wood_trapdoor/toggle4"
],
"subtitle": "subtitles.block.trapdoor.toggle"
"subtitle": "subtitles.block.trapdoor.close"
},
"block.nether_wood_trapdoor.open": {
"sounds": [
@@ -7679,7 +7763,7 @@
"block/nether_wood_trapdoor/toggle3",
"block/nether_wood_trapdoor/toggle4"
],
"subtitle": "subtitles.block.trapdoor.toggle"
"subtitle": "subtitles.block.trapdoor.open"
},
"block.netherite_block.break": {
"sounds": [
@@ -9287,23 +9371,6 @@
],
"subtitle": "subtitles.block.generic.footsteps"
},
"block.sand.wind": {
"sounds": [
"block/sand/wind1",
"block/sand/wind2",
"block/sand/wind3",
"block/sand/wind4",
"block/sand/wind5",
"block/sand/wind6",
"block/sand/wind7",
"block/sand/wind8",
"block/sand/wind9",
"block/sand/wind10",
"block/sand/wind11",
"block/sand/wind12"
],
"subtitle": "subtitles.block.sand.wind"
},
"block.scaffolding.break": {
"sounds": [
{
@@ -12044,7 +12111,7 @@
"volume": 0.9
}
],
"subtitle": "subtitles.block.trapdoor.toggle"
"subtitle": "subtitles.block.trapdoor.close"
},
"block.wooden_trapdoor.open": {
"sounds": [
@@ -12069,7 +12136,7 @@
"volume": 0.9
}
],
"subtitle": "subtitles.block.trapdoor.toggle"
"subtitle": "subtitles.block.trapdoor.open"
},
"block.wool.break": {
"sounds": [
@@ -13689,11 +13756,11 @@
},
"entity.donkey.eat": {
"sounds": [
"entity/horse/eat1",
"entity/horse/eat2",
"entity/horse/eat3",
"entity/horse/eat4",
"entity/horse/eat5"
"mob/horse/eat1",
"mob/horse/eat2",
"mob/horse/eat3",
"mob/horse/eat4",
"mob/horse/eat5"
],
"subtitle": "subtitles.entity.donkey.eat"
},
@@ -14760,6 +14827,40 @@
],
"subtitle": "subtitles.entity.ghast.shoot"
},
"entity.ghastling.ambient": {
"sounds": [
"mob/ghastling/ghastling1",
"mob/ghastling/ghastling2",
"mob/ghastling/ghastling3",
"mob/ghastling/ghastling4",
"mob/ghastling/ghastling5",
"mob/ghastling/ghastling6",
"mob/ghastling/ghastling7"
],
"subtitle": "subtitles.entity.ghastling.ambient"
},
"entity.ghastling.death": {
"sounds": [
"mob/ghastling/death"
],
"subtitle": "subtitles.entity.ghastling.death"
},
"entity.ghastling.hurt": {
"sounds": [
"mob/ghastling/hurt1",
"mob/ghastling/hurt2",
"mob/ghastling/hurt3",
"mob/ghastling/hurt4",
"mob/ghastling/hurt5"
],
"subtitle": "subtitles.entity.ghastling.hurt"
},
"entity.ghastling.spawn": {
"sounds": [
"mob/ghastling/spawn"
],
"subtitle": "subtitles.entity.ghastling.spawn"
},
"entity.glow_item_frame.add_item": {
"sounds": [
"entity/itemframe/add_item1",
@@ -14806,36 +14907,36 @@
},
"entity.glow_squid.ambient": {
"sounds": [
"entity/glow_squid/ambient1",
"entity/glow_squid/ambient2",
"entity/glow_squid/ambient3",
"entity/glow_squid/ambient4",
"entity/glow_squid/ambient5"
"mob/glow_squid/ambient1",
"mob/glow_squid/ambient2",
"mob/glow_squid/ambient3",
"mob/glow_squid/ambient4",
"mob/glow_squid/ambient5"
],
"subtitle": "subtitles.entity.glow_squid.ambient"
},
"entity.glow_squid.death": {
"sounds": [
"entity/glow_squid/death1",
"entity/glow_squid/death2",
"entity/glow_squid/death3"
"mob/glow_squid/death1",
"mob/glow_squid/death2",
"mob/glow_squid/death3"
],
"subtitle": "subtitles.entity.glow_squid.death"
},
"entity.glow_squid.hurt": {
"sounds": [
"entity/glow_squid/hurt1",
"entity/glow_squid/hurt2",
"entity/glow_squid/hurt3",
"entity/glow_squid/hurt4"
"mob/glow_squid/hurt1",
"mob/glow_squid/hurt2",
"mob/glow_squid/hurt3",
"mob/glow_squid/hurt4"
],
"subtitle": "subtitles.entity.glow_squid.hurt"
},
"entity.glow_squid.squirt": {
"sounds": [
"entity/glow_squid/squirt1",
"entity/glow_squid/squirt2",
"entity/glow_squid/squirt3"
"mob/glow_squid/squirt1",
"mob/glow_squid/squirt2",
"mob/glow_squid/squirt3"
],
"subtitle": "subtitles.entity.glow_squid.squirt"
},
@@ -15223,22 +15324,10 @@
},
"entity.guardian.ambient": {
"sounds": [
{
"name": "entity/guardian/ambient1",
"volume": 0.1
},
{
"name": "entity/guardian/ambient2",
"volume": 0.1
},
{
"name": "entity/guardian/ambient3",
"volume": 0.1
},
{
"name": "entity/guardian/ambient4",
"volume": 0.1
}
"mob/guardian/guardian_idle1",
"mob/guardian/guardian_idle2",
"mob/guardian/guardian_idle3",
"mob/guardian/guardian_idle4"
],
"subtitle": "subtitles.entity.guardian.ambient"
},
@@ -15296,6 +15385,89 @@
],
"subtitle": "subtitles.entity.guardian.hurt"
},
"entity.happy_ghast.ambient": {
"sounds": [
"mob/happy_ghast/ambient1",
{
"name": "mob/happy_ghast/ambient2",
"weight": 3
},
{
"name": "mob/happy_ghast/ambient3",
"weight": 2
},
"mob/happy_ghast/ambient4",
{
"name": "mob/happy_ghast/ambient5",
"weight": 2
},
"mob/happy_ghast/ambient6",
{
"name": "mob/happy_ghast/ambient7",
"weight": 2
},
"mob/happy_ghast/ambient8",
"mob/happy_ghast/ambient9",
"mob/happy_ghast/ambient10",
"mob/happy_ghast/ambient11",
{
"name": "mob/happy_ghast/ambient12",
"weight": 2
},
{
"name": "mob/happy_ghast/ambient13",
"weight": 2
},
"mob/happy_ghast/ambient14"
],
"subtitle": "subtitles.entity.happy_ghast.ambient"
},
"entity.happy_ghast.death": {
"sounds": [
"mob/happy_ghast/death"
],
"subtitle": "subtitles.entity.happy_ghast.death"
},
"entity.happy_ghast.equip": {
"sounds": [
"mob/happy_ghast/harness_equip"
],
"subtitle": "subtitles.entity.happy_ghast.equip"
},
"entity.happy_ghast.harness_goggles_down": {
"sounds": [
"mob/happy_ghast/goggles_down"
],
"subtitle": "subtitles.entity.happy_ghast.harness_goggles_down"
},
"entity.happy_ghast.harness_goggles_up": {
"sounds": [
"mob/happy_ghast/goggles_up"
],
"subtitle": "subtitles.entity.happy_ghast.harness_goggles_up"
},
"entity.happy_ghast.hurt": {
"sounds": [
"mob/happy_ghast/hurt1",
"mob/happy_ghast/hurt2",
"mob/happy_ghast/hurt3",
"mob/happy_ghast/hurt4",
"mob/happy_ghast/hurt5",
"mob/happy_ghast/hurt6"
],
"subtitle": "subtitles.entity.happy_ghast.hurt"
},
"entity.happy_ghast.riding": {
"sounds": [
"mob/happy_ghast/ghast_ride"
]
},
"entity.happy_ghast.unequip": {
"sounds": [
"mob/happy_ghast/harness_unequip"
],
"subtitle": "subtitles.entity.happy_ghast.unequip"
},
"entity.hoglin.ambient": {
"sounds": [
{
@@ -15501,11 +15673,11 @@
},
"entity.horse.eat": {
"sounds": [
"entity/horse/eat1",
"entity/horse/eat2",
"entity/horse/eat3",
"entity/horse/eat4",
"entity/horse/eat5"
"mob/horse/eat1",
"mob/horse/eat2",
"mob/horse/eat3",
"mob/horse/eat4",
"mob/horse/eat5"
],
"subtitle": "subtitles.entity.horse.eat"
},
@@ -15824,22 +15996,6 @@
],
"subtitle": "subtitles.entity.item_frame.rotate_item"
},
"entity.leash_knot.break": {
"sounds": [
"entity/leashknot/break1",
"entity/leashknot/break2",
"entity/leashknot/break3"
],
"subtitle": "subtitles.entity.leash_knot.break"
},
"entity.leash_knot.place": {
"sounds": [
"entity/leashknot/place1",
"entity/leashknot/place2",
"entity/leashknot/place3"
],
"subtitle": "subtitles.entity.leash_knot.place"
},
"entity.lightning_bolt.impact": {
"sounds": [
"random/explode1",
@@ -16168,11 +16324,11 @@
},
"entity.mule.eat": {
"sounds": [
"entity/horse/eat1",
"entity/horse/eat2",
"entity/horse/eat3",
"entity/horse/eat4",
"entity/horse/eat5"
"mob/horse/eat1",
"mob/horse/eat2",
"mob/horse/eat3",
"mob/horse/eat4",
"mob/horse/eat5"
],
"subtitle": "subtitles.entity.mule.eat"
},
@@ -17745,17 +17901,14 @@
],
"subtitle": "subtitles.entity.polar_bear.warning"
},
"entity.puffer_fish.ambient": {
"sounds": []
},
"entity.puffer_fish.blow_out": {
"sounds": [
{
"name": "entity/pufferfish/blow_out1",
"name": "mob/pufferfish/blow_out1",
"volume": 0.7
},
{
"name": "entity/pufferfish/blow_out2",
"name": "mob/pufferfish/blow_out2",
"volume": 0.7
}
],
@@ -17764,11 +17917,11 @@
"entity.puffer_fish.blow_up": {
"sounds": [
{
"name": "entity/pufferfish/blow_up1",
"name": "mob/pufferfish/blow_up1",
"volume": 0.45
},
{
"name": "entity/pufferfish/blow_up2",
"name": "mob/pufferfish/blow_up2",
"volume": 0.45
}
],
@@ -17776,27 +17929,27 @@
},
"entity.puffer_fish.death": {
"sounds": [
"entity/pufferfish/death1",
"entity/pufferfish/death2"
"mob/pufferfish/death1",
"mob/pufferfish/death2"
],
"subtitle": "subtitles.entity.puffer_fish.death"
},
"entity.puffer_fish.flop": {
"sounds": [
{
"name": "entity/pufferfish/flop1",
"name": "mob/pufferfish/flop1",
"volume": 0.3
},
{
"name": "entity/pufferfish/flop2",
"name": "mob/pufferfish/flop2",
"volume": 0.3
},
{
"name": "entity/pufferfish/flop3",
"name": "mob/pufferfish/flop3",
"volume": 0.3
},
{
"name": "entity/pufferfish/flop4",
"name": "mob/pufferfish/flop4",
"volume": 0.3
}
],
@@ -17804,15 +17957,15 @@
},
"entity.puffer_fish.hurt": {
"sounds": [
"entity/pufferfish/hurt1",
"entity/pufferfish/hurt2"
"mob/pufferfish/hurt1",
"mob/pufferfish/hurt2"
],
"subtitle": "subtitles.entity.puffer_fish.hurt"
},
"entity.puffer_fish.sting": {
"sounds": [
"entity/pufferfish/sting1",
"entity/pufferfish/sting2"
"mob/pufferfish/sting1",
"mob/pufferfish/sting2"
],
"subtitle": "subtitles.entity.puffer_fish.sting"
},
@@ -17839,10 +17992,10 @@
},
"entity.rabbit.attack": {
"sounds": [
"entity/rabbit/attack1",
"entity/rabbit/attack2",
"entity/rabbit/attack3",
"entity/rabbit/attack4"
"mob/rabbit/attack1",
"mob/rabbit/attack2",
"mob/rabbit/attack3",
"mob/rabbit/attack4"
],
"subtitle": "subtitles.entity.rabbit.attack"
},
@@ -18715,36 +18868,36 @@
},
"entity.squid.ambient": {
"sounds": [
"entity/squid/ambient1",
"entity/squid/ambient2",
"entity/squid/ambient3",
"entity/squid/ambient4",
"entity/squid/ambient5"
"mob/squid/ambient1",
"mob/squid/ambient2",
"mob/squid/ambient3",
"mob/squid/ambient4",
"mob/squid/ambient5"
],
"subtitle": "subtitles.entity.squid.ambient"
},
"entity.squid.death": {
"sounds": [
"entity/squid/death1",
"entity/squid/death2",
"entity/squid/death3"
"mob/squid/death1",
"mob/squid/death2",
"mob/squid/death3"
],
"subtitle": "subtitles.entity.squid.death"
},
"entity.squid.hurt": {
"sounds": [
"entity/squid/hurt1",
"entity/squid/hurt2",
"entity/squid/hurt3",
"entity/squid/hurt4"
"mob/squid/hurt1",
"mob/squid/hurt2",
"mob/squid/hurt3",
"mob/squid/hurt4"
],
"subtitle": "subtitles.entity.squid.hurt"
},
"entity.squid.squirt": {
"sounds": [
"entity/squid/squirt1",
"entity/squid/squirt2",
"entity/squid/squirt3"
"mob/squid/squirt1",
"mob/squid/squirt2",
"mob/squid/squirt3"
],
"subtitle": "subtitles.entity.squid.squirt"
},
@@ -20210,12 +20363,6 @@
],
"subtitle": "subtitles.entity.wolf.whine"
},
"entity.wolf_whine.whine": {
"sounds": [
"mob/wolf/puglin/whine"
],
"subtitle": "subtitles.entity.wolf.whine"
},
"entity.zoglin.ambient": {
"sounds": [
{
@@ -21712,6 +21859,12 @@
],
"subtitle": "subtitles.item.honeycomb.wax_on"
},
"item.horse_armor.unequip": {
"sounds": [
"mob/horse/armor_unequip"
],
"subtitle": "subtitles.item.horse_armor.unequip"
},
"item.ink_sac.use": {
"sounds": [
{
@@ -21753,6 +21906,34 @@
],
"subtitle": "subtitles.item.ink_sac.use"
},
"item.lead.break": {
"sounds": [
"entity/leashknot/break"
],
"subtitle": "subtitles.item.lead.break"
},
"item.lead.tied": {
"sounds": [
"entity/leashknot/leash1",
"entity/leashknot/leash2",
"entity/leashknot/leash3"
],
"subtitle": "subtitles.item.lead.tied"
},
"item.lead.untied": {
"sounds": [
"entity/leashknot/unleash1",
"entity/leashknot/unleash2",
"entity/leashknot/unleash3"
],
"subtitle": "subtitles.item.lead.untied"
},
"item.llama_carpet.unequip": {
"sounds": [
"mob/llama/unequip"
],
"subtitle": "subtitles.item.llama_carpet.unequip"
},
"item.lodestone_compass.lock": {
"sounds": [
{
@@ -21862,6 +22043,18 @@
],
"subtitle": "subtitles.item.ominous_bottle.dispose"
},
"item.saddle.unequip": {
"sounds": [
"mob/horse/saddle_unequip"
],
"subtitle": "subtitles.item.saddle.unequip"
},
"item.shears.snip": {
"sounds": [
"mob/sheep/shear"
],
"subtitle": "subtitles.item.shears.snip"
},
"item.shield.block": {
"sounds": [
"item/shield/block1",
@@ -22141,6 +22334,16 @@
"stream": true,
"volume": 0.4
},
{
"name": "music/game/below_and_above",
"stream": true,
"volume": 0.4
},
{
"name": "music/game/broken_clocks",
"stream": true,
"volume": 0.4
},
{
"name": "music/game/clark",
"stream": true
@@ -22163,6 +22366,11 @@
"stream": true,
"volume": 0.4
},
{
"name": "music/game/fireflies",
"stream": true,
"volume": 0.4
},
{
"name": "music/game/floating_dream",
"stream": true,
@@ -22186,6 +22394,11 @@
"stream": true,
"volume": 0.4
},
{
"name": "music/game/lilypad",
"stream": true,
"volume": 0.4
},
{
"name": "music/game/living_mice",
"stream": true
@@ -22203,6 +22416,11 @@
"stream": true,
"volume": 0.4
},
{
"name": "music/game/os_piano",
"stream": true,
"volume": 0.4
},
{
"name": "music/game/oxygene",
"stream": true
@@ -22239,50 +22457,30 @@
"music.menu": {
"sounds": [
{
"name": "music/game/deeper",
"name": "music/game/below_and_above",
"stream": true,
"volume": 0.4
},
{
"name": "music/game/eld_unknown",
"name": "music/game/broken_clocks",
"stream": true,
"volume": 0.4
},
{
"name": "music/game/endless",
"name": "music/game/fireflies",
"stream": true,
"volume": 0.4
},
{
"name": "music/game/featherfall",
"name": "music/game/lilypad",
"stream": true,
"volume": 0.4
},
{
"name": "music/game/komorebi",
"stream": true,
"volume": 0.8
},
{
"name": "music/game/pokopoko",
"stream": true,
"volume": 0.8
},
{
"name": "music/game/puzzlebox",
"name": "music/game/os_piano",
"stream": true,
"volume": 0.4
},
{
"name": "music/game/watcher",
"stream": true,
"volume": 0.4
},
{
"name": "music/game/yakusoku",
"stream": true,
"volume": 0.8
},
{
"name": "music/menu/beginning_2",
"stream": true
@@ -22523,10 +22721,15 @@
"music.overworld.cherry_grove": {
"sounds": [
{
"name": "music/game/bromeliad",
"name": "music/game/below_and_above",
"stream": true,
"volume": 0.4,
"weight": 3
"weight": 2
},
{
"name": "music/game/bromeliad",
"stream": true,
"volume": 0.4
},
{
"name": "music/game/clark",
@@ -22535,14 +22738,12 @@
{
"name": "music/game/echo_in_the_wind",
"stream": true,
"volume": 0.4,
"weight": 3
"volume": 0.4
},
{
"name": "music/game/featherfall",
"stream": true,
"volume": 0.4,
"weight": 3
"volume": 0.4
},
{
"name": "music/game/left_to_bloom",
@@ -22577,13 +22778,18 @@
{
"name": "music/game/crescent_dunes",
"stream": true,
"volume": 0.4,
"weight": 3
"volume": 0.4
},
{
"name": "music/game/danny",
"stream": true
},
{
"name": "music/game/fireflies",
"stream": true,
"volume": 0.4,
"weight": 2
},
{
"name": "music/game/haggstrom",
"stream": true
@@ -22720,6 +22926,12 @@
},
"music.overworld.forest": {
"sounds": [
{
"name": "music/game/broken_clocks",
"stream": true,
"volume": 0.4,
"weight": 2
},
{
"name": "music/game/bromeliad",
"stream": true,
@@ -22824,6 +23036,11 @@
"name": "music/game/haggstrom",
"stream": true
},
{
"name": "music/game/lilypad",
"stream": true,
"volume": 0.4
},
{
"name": "music/game/living_mice",
"stream": true
@@ -22878,6 +23095,12 @@
"name": "music/game/key",
"stream": true
},
{
"name": "music/game/lilypad",
"stream": true,
"volume": 0.4,
"weight": 2
},
{
"name": "music/game/mice_on_venus",
"stream": true
@@ -23023,49 +23246,48 @@
{
"name": "music/game/an_ordinary_day",
"stream": true,
"weight": 2
"volume": 0.8
},
{
"name": "music/game/clark",
"stream": true,
"weight": 2
"stream": true
},
{
"name": "music/game/echo_in_the_wind",
"stream": true,
"volume": 0.4,
"weight": 2
"volume": 0.4
},
{
"name": "music/game/featherfall",
"stream": true,
"volume": 0.4,
"weight": 2
"volume": 0.4
},
{
"name": "music/game/floating_dream",
"stream": true,
"weight": 2
"volume": 0.5
},
{
"name": "music/game/left_to_bloom",
"stream": true,
"volume": 0.4,
"weight": 4
"volume": 0.4
},
{
"name": "music/game/mice_on_venus",
"stream": true,
"weight": 2
"stream": true
},
{
"name": "music/game/minecraft",
"stream": true,
"weight": 2
"stream": true
},
{
"name": "music/game/one_more_day",
"stream": true,
"volume": 0.4
},
{
"name": "music/game/os_piano",
"stream": true,
"volume": 0.4,
"weight": 2
},
@@ -23086,8 +23308,7 @@
},
{
"name": "music/game/sweden",
"stream": true,
"weight": 2
"stream": true
}
]
},
@@ -23539,6 +23760,14 @@
}
]
},
"music_disc.tears": {
"sounds": [
{
"name": "records/tears",
"stream": true
}
]
},
"music_disc.wait": {
"sounds": [
{

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -4293,6 +4293,36 @@ $$>=1.20.3#grate:
minecraft:oxidized_copper_grate[waterlogged=false]: minecraft:waxed_oxidized_copper_grate[waterlogged=false]
minecraft:oxidized_copper_grate[waterlogged=true]: minecraft:waxed_oxidized_copper_grate[waterlogged=true]
#### Pressure Plate ####
minecraft:light_weighted_pressure_plate[power=2]: minecraft:light_weighted_pressure_plate[power=1]
minecraft:light_weighted_pressure_plate[power=3]: minecraft:light_weighted_pressure_plate[power=1]
minecraft:light_weighted_pressure_plate[power=4]: minecraft:light_weighted_pressure_plate[power=1]
minecraft:light_weighted_pressure_plate[power=5]: minecraft:light_weighted_pressure_plate[power=1]
minecraft:light_weighted_pressure_plate[power=6]: minecraft:light_weighted_pressure_plate[power=1]
minecraft:light_weighted_pressure_plate[power=7]: minecraft:light_weighted_pressure_plate[power=1]
minecraft:light_weighted_pressure_plate[power=8]: minecraft:light_weighted_pressure_plate[power=1]
minecraft:light_weighted_pressure_plate[power=9]: minecraft:light_weighted_pressure_plate[power=1]
minecraft:light_weighted_pressure_plate[power=10]: minecraft:light_weighted_pressure_plate[power=1]
minecraft:light_weighted_pressure_plate[power=11]: minecraft:light_weighted_pressure_plate[power=1]
minecraft:light_weighted_pressure_plate[power=12]: minecraft:light_weighted_pressure_plate[power=1]
minecraft:light_weighted_pressure_plate[power=13]: minecraft:light_weighted_pressure_plate[power=1]
minecraft:light_weighted_pressure_plate[power=14]: minecraft:light_weighted_pressure_plate[power=1]
minecraft:light_weighted_pressure_plate[power=15]: minecraft:light_weighted_pressure_plate[power=1]
minecraft:heavy_weighted_pressure_plate[power=2]: minecraft:heavy_weighted_pressure_plate[power=1]
minecraft:heavy_weighted_pressure_plate[power=3]: minecraft:heavy_weighted_pressure_plate[power=1]
minecraft:heavy_weighted_pressure_plate[power=4]: minecraft:heavy_weighted_pressure_plate[power=1]
minecraft:heavy_weighted_pressure_plate[power=5]: minecraft:heavy_weighted_pressure_plate[power=1]
minecraft:heavy_weighted_pressure_plate[power=6]: minecraft:heavy_weighted_pressure_plate[power=1]
minecraft:heavy_weighted_pressure_plate[power=7]: minecraft:heavy_weighted_pressure_plate[power=1]
minecraft:heavy_weighted_pressure_plate[power=8]: minecraft:heavy_weighted_pressure_plate[power=1]
minecraft:heavy_weighted_pressure_plate[power=9]: minecraft:heavy_weighted_pressure_plate[power=1]
minecraft:heavy_weighted_pressure_plate[power=10]: minecraft:heavy_weighted_pressure_plate[power=1]
minecraft:heavy_weighted_pressure_plate[power=11]: minecraft:heavy_weighted_pressure_plate[power=1]
minecraft:heavy_weighted_pressure_plate[power=12]: minecraft:heavy_weighted_pressure_plate[power=1]
minecraft:heavy_weighted_pressure_plate[power=13]: minecraft:heavy_weighted_pressure_plate[power=1]
minecraft:heavy_weighted_pressure_plate[power=14]: minecraft:heavy_weighted_pressure_plate[power=1]
minecraft:heavy_weighted_pressure_plate[power=15]: minecraft:heavy_weighted_pressure_plate[power=1]
#### Chorus Plant ####
# Chorus Plant does support transparent textures, but man... its hitbox is super weird. You're probably better off using leaves.
# minecraft:chorus_plant[down=false,east=false,north=false,south=false,up=false,west=false]: minecraft:chorus_plant[down=true,east=true,north=true,south=true,up=true,west=true]

View File

@@ -566,6 +566,8 @@ items:
model_stairs_generation:
parent: minecraft:block/stairs
textures: *textures
default:palm_pressure_plate:
recipes:
default:palm_planks:
template: default:recipe/planks
@@ -609,6 +611,15 @@ recipes:
result:
id: default:palm_slab
count: 6
default:palm_pressure_plate:
type: shaped
pattern:
- AA
ingredients:
A: default:palm_planks
result:
id: default:palm_pressure_plate
count: 1
$$>=1.20.3#palm_stairs:
default:palm_stairs:
type: shaped

View File

@@ -114,6 +114,30 @@ public abstract class BlockBehavior {
return superMethod.call();
}
// 1.20-1.21.4 BlockState state, Level level, BlockPos pos, Entity entity
// 1.21.5+ BlockState state, Level level, BlockPos pos, Entity entity, InsideBlockEffectApplier effectApplier
public void entityInside(Object thisBlock, Object[] args, Callable<Object> superMethod) throws Exception {
}
// 1.21.5+ BlockState state, ServerLevel level, BlockPos pos, boolean movedByPiston
public void affectNeighborsAfterRemoval(Object thisBlock, Object[] args, Callable<Object> superMethod) throws Exception {
}
// BlockState blockState, BlockGetter blockAccess, BlockPos pos, Direction side
public int getSignal(Object thisBlock, Object[] args, Callable<Object> superMethod) {
return 0;
}
// BlockState blockState, BlockGetter blockAccess, BlockPos pos, Direction side
public int getDirectSignal(Object thisBlock, Object[] args, Callable<Object> superMethod) {
return 0;
}
// BlockState blockState
public boolean isSignalSource(Object thisBlock, Object[] args, Callable<Object> superMethod) {
return false;
}
public ImmutableBlockState updateStateForPlacement(BlockPlaceContext context, ImmutableBlockState state) {
return state;
}