mirror of
https://github.com/Xiao-MoMi/craft-engine.git
synced 2025-12-20 15:39:22 +00:00
纠正一些错误
This commit is contained in:
@@ -51,10 +51,10 @@ public final class BukkitCustomBlock extends AbstractCustomBlock {
|
||||
|
||||
@Override
|
||||
protected BlockBehavior setupBehavior(List<Map<String, Object>> behaviorConfig) {
|
||||
if (behaviorConfig.isEmpty()) {
|
||||
if (behaviorConfig == null || behaviorConfig.isEmpty()) {
|
||||
return new EmptyBlockBehavior();
|
||||
} else if (behaviorConfig.size() == 1) {
|
||||
return BlockBehaviors.fromMap(this, behaviorConfig.get(0));
|
||||
return BlockBehaviors.fromMap(this, behaviorConfig.getFirst());
|
||||
} else {
|
||||
List<AbstractBlockBehavior> behaviors = new ArrayList<>();
|
||||
for (Map<String, Object> config : behaviorConfig) {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package net.momirealms.craftengine.bukkit.plugin.injector;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import com.mojang.serialization.MapCodec;
|
||||
import it.unimi.dsi.fastutil.objects.Reference2ObjectArrayMap;
|
||||
import net.bytebuddy.ByteBuddy;
|
||||
@@ -29,6 +30,7 @@ import net.momirealms.craftengine.core.item.Item;
|
||||
import net.momirealms.craftengine.core.plugin.context.ContextHolder;
|
||||
import net.momirealms.craftengine.core.plugin.context.parameter.DirectContextParameters;
|
||||
import net.momirealms.craftengine.core.util.ReflectionUtils;
|
||||
import net.momirealms.craftengine.core.util.VersionHelper;
|
||||
import net.momirealms.craftengine.core.world.World;
|
||||
import net.momirealms.craftengine.core.world.WorldPosition;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
@@ -64,9 +66,13 @@ public final class BlockStateGenerator {
|
||||
.method(ElementMatchers.is(CoreReflections.method$StateHolder$setValue))
|
||||
.intercept(MethodDelegation.to(SetPropertyValueInterceptor.INSTANCE));
|
||||
Class<?> clazz$CraftEngineBlock = stateBuilder.make().load(BlockStateGenerator.class.getClassLoader()).getLoaded();
|
||||
constructor$CraftEngineBlockState = MethodHandles.publicLookup().in(clazz$CraftEngineBlock)
|
||||
constructor$CraftEngineBlockState = VersionHelper.isOrAbove1_20_5() ?
|
||||
MethodHandles.publicLookup().in(clazz$CraftEngineBlock)
|
||||
.findConstructor(clazz$CraftEngineBlock, MethodType.methodType(void.class, CoreReflections.clazz$Block, Reference2ObjectArrayMap.class, MapCodec.class))
|
||||
.asType(MethodType.methodType(CoreReflections.clazz$BlockState, CoreReflections.clazz$Block, Reference2ObjectArrayMap.class, MapCodec.class));
|
||||
.asType(MethodType.methodType(CoreReflections.clazz$BlockState, CoreReflections.clazz$Block, Reference2ObjectArrayMap.class, MapCodec.class)) :
|
||||
MethodHandles.publicLookup().in(clazz$CraftEngineBlock)
|
||||
.findConstructor(clazz$CraftEngineBlock, MethodType.methodType(void.class, CoreReflections.clazz$Block, ImmutableMap.class, MapCodec.class))
|
||||
.asType(MethodType.methodType(CoreReflections.clazz$BlockState, CoreReflections.clazz$Block, ImmutableMap.class, MapCodec.class));
|
||||
|
||||
String generatedFactoryClassName = packageWithName.substring(0, packageWithName.lastIndexOf('.')) + ".CraftEngineStateFactory";
|
||||
DynamicType.Builder<?> factoryBuilder = byteBuddy
|
||||
|
||||
@@ -1732,7 +1732,7 @@ public final class CoreReflections {
|
||||
);
|
||||
|
||||
public static final Method method$StateHolder$setValue = requireNonNull(
|
||||
ReflectionUtils.getMethod(clazz$StateHolder, Object.class, new String[] {"setValue", "b"}, clazz$Property, Comparable.class)
|
||||
ReflectionUtils.getMethod(clazz$StateHolder, Object.class, new String[] {"setValue", VersionHelper.isOrAbove1_21_2() ? "b" : "a"}, clazz$Property, Comparable.class)
|
||||
);
|
||||
|
||||
public static final Method method$Block$updateFromNeighbourShapes = requireNonNull(
|
||||
|
||||
@@ -3932,8 +3932,6 @@ minecraft:petrified_oak_slab[type=double,waterlogged=false]: minecraft:oak_slab[
|
||||
minecraft:petrified_oak_slab[type=bottom,waterlogged=true]: minecraft:oak_slab[type=bottom,waterlogged=true]
|
||||
minecraft:petrified_oak_slab[type=top,waterlogged=true]: minecraft:oak_slab[type=top,waterlogged=true]
|
||||
minecraft:petrified_oak_slab[type=double,waterlogged=true]: minecraft:oak_slab[type=double,waterlogged=true]
|
||||
|
||||
$$>=1.20.3#slab:
|
||||
minecraft:cut_copper_slab[type=bottom,waterlogged=false]: minecraft:waxed_cut_copper_slab[type=bottom,waterlogged=false]
|
||||
minecraft:cut_copper_slab[type=top,waterlogged=false]: minecraft:waxed_cut_copper_slab[type=top,waterlogged=false]
|
||||
minecraft:cut_copper_slab[type=double,waterlogged=false]: minecraft:waxed_cut_copper_slab[type=double,waterlogged=false]
|
||||
@@ -3960,7 +3958,6 @@ $$>=1.20.3#slab:
|
||||
minecraft:oxidized_cut_copper_slab[type=double,waterlogged=true]: minecraft:waxed_oxidized_cut_copper_slab[type=double,waterlogged=true]
|
||||
|
||||
#### Stairs ####
|
||||
$$>=1.20.3#stairs:
|
||||
minecraft:cut_copper_stairs[facing=east,half=bottom,shape=straight,waterlogged=false]: minecraft:waxed_cut_copper_stairs[facing=east,half=bottom,shape=straight,waterlogged=false]
|
||||
minecraft:cut_copper_stairs[facing=east,half=bottom,shape=straight,waterlogged=true]: minecraft:waxed_cut_copper_stairs[facing=east,half=bottom,shape=straight,waterlogged=true]
|
||||
minecraft:cut_copper_stairs[facing=east,half=bottom,shape=inner_left,waterlogged=false]: minecraft:waxed_cut_copper_stairs[facing=east,half=bottom,shape=inner_left,waterlogged=false]
|
||||
|
||||
@@ -515,7 +515,6 @@ items:
|
||||
parent: minecraft:block/slab_top
|
||||
textures: *textures
|
||||
model_double_path: minecraft:block/custom/palm_planks
|
||||
$$>=1.20.3#palm_stairs:
|
||||
default:palm_stairs:
|
||||
material: nether_brick
|
||||
custom-model-data: 1013
|
||||
|
||||
@@ -41,7 +41,7 @@ public abstract class AbstractCustomBlock implements CustomBlock {
|
||||
@NotNull Map<String, BlockStateVariant> variantMapper,
|
||||
@NotNull BlockSettings settings,
|
||||
@NotNull Map<EventTrigger, List<Function<PlayerOptionalContext>>> events,
|
||||
@NotNull List<Map<String, Object>> behaviorConfig,
|
||||
@Nullable List<Map<String, Object>> behaviorConfig,
|
||||
@Nullable LootTable<?> lootTable
|
||||
) {
|
||||
holder.bindValue(this);
|
||||
|
||||
@@ -20,7 +20,7 @@ gson_version=2.11.0
|
||||
asm_version=9.8
|
||||
asm_commons_version=9.8
|
||||
jar_relocator_version=1.7
|
||||
adventure_bundle_version=4.21.0
|
||||
adventure_bundle_version=4.23.0
|
||||
cloud_core_version=2.0.0
|
||||
cloud_services_version=2.0.0
|
||||
cloud_brigadier_version=2.0.0-beta.10
|
||||
|
||||
Reference in New Issue
Block a user