9
0
mirror of https://github.com/Xiao-MoMi/craft-engine.git synced 2025-12-25 01:49:30 +00:00

Merge pull request #365 from jhqwqmc/lamp

feat(bukkit): 实现一些方块行为
This commit is contained in:
XiaoMoMi
2025-09-11 01:36:17 +08:00
committed by GitHub
36 changed files with 993 additions and 24 deletions

View File

@@ -86,6 +86,9 @@ paper {
register("MythicMobs") { required = false }
register("CustomFishing") { required = false }
register("Zaphkiel") { required = false }
register("HeadDatabase") { required = false }
register("SX-Item") { required = false }
register("Slimefun") { required = false }
// leveler
register("AuraSkills") { required = false }

View File

@@ -0,0 +1,68 @@
package net.momirealms.craftengine.bukkit.block.behavior;
import net.momirealms.craftengine.bukkit.nms.FastNMS;
import net.momirealms.craftengine.bukkit.plugin.reflection.minecraft.CoreReflections;
import net.momirealms.craftengine.bukkit.util.LocationUtils;
import net.momirealms.craftengine.core.block.BlockBehavior;
import net.momirealms.craftengine.core.block.CustomBlock;
import net.momirealms.craftengine.core.block.behavior.BlockBehaviorFactory;
import net.momirealms.craftengine.core.util.ResourceConfigUtils;
import net.momirealms.craftengine.core.util.VersionHelper;
import net.momirealms.craftengine.core.world.Vec3d;
import java.util.Map;
import java.util.concurrent.Callable;
public class BouncingBlockBehavior extends BukkitBlockBehavior {
public static final Factory FACTORY = new Factory();
private final double bounceHeight;
private final boolean syncPlayerSelf;
public BouncingBlockBehavior(CustomBlock customBlock, double bounceHeight, boolean syncPlayerSelf) {
super(customBlock);
this.bounceHeight = bounceHeight;
this.syncPlayerSelf = syncPlayerSelf;
}
@Override
public void fallOn(Object thisBlock, Object[] args, Callable<Object> superMethod) {
Object entity = args[3];
Object finalFallDistance = VersionHelper.isOrAbove1_21_5() ? (double) args[4] * 0.5 : (float) args[4] * 0.5F;
FastNMS.INSTANCE.method$Entity$causeFallDamage(
entity, finalFallDistance, 1.0F,
FastNMS.INSTANCE.method$DamageSources$fall(FastNMS.INSTANCE.method$Entity$damageSources(entity))
);
}
@Override
public void updateEntityMovementAfterFallOn(Object thisBlock, Object[] args, Callable<Object> superMethod) throws Exception {
Object entity = args[1];
if (FastNMS.INSTANCE.method$Entity$getSharedFlag(entity, 1)) {
superMethod.call();
} else {
bounceUp(entity);
}
}
private void bounceUp(Object entity) {
Vec3d deltaMovement = LocationUtils.fromVec(FastNMS.INSTANCE.method$Entity$getDeltaMovement(entity));
if (deltaMovement.y < 0.0) {
double d = CoreReflections.clazz$LivingEntity.isInstance(entity) ? 1.0 : 0.8;
double y = -deltaMovement.y * this.bounceHeight * d;
FastNMS.INSTANCE.method$Entity$setDeltaMovement(entity, deltaMovement.x, y, deltaMovement.z);
if (CoreReflections.clazz$Player.isInstance(entity) && this.syncPlayerSelf && y > 0.032) { // 防抖
FastNMS.INSTANCE.field$Entity$hurtMarked(entity, true);
}
}
}
public static class Factory implements BlockBehaviorFactory {
@Override
public BlockBehavior create(CustomBlock block, Map<String, Object> arguments) {
double bounceHeight = ResourceConfigUtils.getAsDouble(arguments.getOrDefault("bounce-height", 0.66), "bounce-height");
boolean syncPlayerSelf = ResourceConfigUtils.getAsBoolean(arguments.getOrDefault("sync-player-self", true), "sync-player-self");
return new BouncingBlockBehavior(block, bounceHeight, syncPlayerSelf);
}
}
}

View File

@@ -29,6 +29,9 @@ public class BukkitBlockBehaviors extends BlockBehaviors {
public static final Key DOUBLE_HIGH_BLOCK = Key.from("craftengine:double_high_block");
public static final Key CHANGE_OVER_TIME_BLOCK = Key.from("craftengine:change_over_time_block");
public static final Key SIMPLE_STORAGE_BLOCK = Key.from("craftengine:simple_storage_block");
public static final Key TOGGLEABLE_LAMP_BLOCK = Key.from("craftengine:toggleable_lamp_block");
public static final Key SOFA_BLOCK = Key.from("craftengine:sofa_block");
public static final Key BOUNCING_BLOCK = Key.from("craftengine:bouncing_block");
public static void init() {
register(EMPTY, (block, args) -> EmptyBlockBehavior.INSTANCE);
@@ -56,5 +59,8 @@ public class BukkitBlockBehaviors extends BlockBehaviors {
register(DOUBLE_HIGH_BLOCK, DoubleHighBlockBehavior.FACTORY);
register(CHANGE_OVER_TIME_BLOCK, ChangeOverTimeBlockBehavior.FACTORY);
register(SIMPLE_STORAGE_BLOCK, SimpleStorageBlockBehavior.FACTORY);
register(TOGGLEABLE_LAMP_BLOCK, ToggleableLampBlockBehavior.FACTORY);
register(SOFA_BLOCK, SofaBlockBehavior.FACTORY);
register(BOUNCING_BLOCK, BouncingBlockBehavior.FACTORY);
}
}

View File

@@ -0,0 +1,112 @@
package net.momirealms.craftengine.bukkit.block.behavior;
import net.momirealms.craftengine.bukkit.nms.FastNMS;
import net.momirealms.craftengine.bukkit.plugin.reflection.minecraft.MFluids;
import net.momirealms.craftengine.bukkit.util.BlockStateUtils;
import net.momirealms.craftengine.bukkit.util.DirectionUtils;
import net.momirealms.craftengine.bukkit.util.LocationUtils;
import net.momirealms.craftengine.core.block.BlockBehavior;
import net.momirealms.craftengine.core.block.CustomBlock;
import net.momirealms.craftengine.core.block.ImmutableBlockState;
import net.momirealms.craftengine.core.block.behavior.BlockBehaviorFactory;
import net.momirealms.craftengine.core.block.properties.Property;
import net.momirealms.craftengine.core.block.state.properties.SofaShape;
import net.momirealms.craftengine.core.item.context.BlockPlaceContext;
import net.momirealms.craftengine.core.util.Direction;
import net.momirealms.craftengine.core.util.HorizontalDirection;
import net.momirealms.craftengine.core.util.ResourceConfigUtils;
import net.momirealms.craftengine.core.util.VersionHelper;
import net.momirealms.craftengine.core.world.BlockPos;
import java.util.Map;
import java.util.Optional;
import java.util.concurrent.Callable;
public class SofaBlockBehavior extends BukkitBlockBehavior {
public static final Factory FACTORY = new Factory();
private final Property<HorizontalDirection> facingProperty;
private final Property<SofaShape> shapeProperty;
public SofaBlockBehavior(CustomBlock block, Property<HorizontalDirection> facing, Property<SofaShape> shape) {
super(block);
this.facingProperty = facing;
this.shapeProperty = shape;
}
@Override
public ImmutableBlockState updateStateForPlacement(BlockPlaceContext context, ImmutableBlockState state) {
BlockPos clickedPos = context.getClickedPos();
ImmutableBlockState blockState = state.owner().value().defaultState()
.with(this.facingProperty, context.getHorizontalDirection().toHorizontalDirection());
if (super.waterloggedProperty != null) {
Object fluidState = FastNMS.INSTANCE.method$BlockGetter$getFluidState(context.getLevel().serverWorld(), LocationUtils.toBlockPos(clickedPos));
blockState = blockState.with(this.waterloggedProperty, FastNMS.INSTANCE.method$FluidState$getType(fluidState) == MFluids.WATER);
}
return blockState.with(this.shapeProperty, getSofaShape(blockState, context.getLevel().serverWorld(), clickedPos));
}
@Override
public Object updateShape(Object thisBlock, Object[] args, Callable<Object> superMethod) throws Exception {
Object level = args[updateShape$level];
Object blockPos = args[updateShape$blockPos];
Object blockState = args[0];
Optional<ImmutableBlockState> optionalCustomState = BlockStateUtils.getOptionalCustomBlockState(blockState);
if (optionalCustomState.isEmpty()) return blockState;
ImmutableBlockState customState = optionalCustomState.get();
if (super.waterloggedProperty != null && customState.get(this.waterloggedProperty)) {
FastNMS.INSTANCE.method$ScheduledTickAccess$scheduleFluidTick(args[updateShape$level], args[updateShape$blockPos], MFluids.WATER, 5);
}
Direction direction = DirectionUtils.fromNMSDirection(VersionHelper.isOrAbove1_21_2() ? args[4] : args[1]);
SofaShape sofaShape = getSofaShape(customState, level, LocationUtils.fromBlockPos(blockPos));
return direction.axis().isHorizontal()
? customState.with(this.shapeProperty, sofaShape).customBlockState().literalObject()
: superMethod.call();
}
private SofaShape getSofaShape(ImmutableBlockState state, Object level, BlockPos pos) {
Direction direction = state.get(this.facingProperty).toDirection();
Object relativeBlockState = FastNMS.INSTANCE.method$BlockGetter$getBlockState(level, LocationUtils.toBlockPos(pos.relative(direction.opposite())));
Optional<ImmutableBlockState> optionalCustomState = BlockStateUtils.getOptionalCustomBlockState(relativeBlockState);
if (optionalCustomState.isPresent()) {
ImmutableBlockState customState = optionalCustomState.get();
Optional<SofaBlockBehavior> optionalStairsBlockBehavior = customState.behavior().getAs(SofaBlockBehavior.class);
if (optionalStairsBlockBehavior.isPresent()) {
SofaBlockBehavior stairsBlockBehavior = optionalStairsBlockBehavior.get();
Direction direction1 = customState.get(stairsBlockBehavior.facingProperty).toDirection();
if (direction1.axis() != state.get(this.facingProperty).toDirection().axis() && canTakeShape(state, level, pos, direction1)) {
if (direction1 == direction.counterClockWise()) {
return SofaShape.INNER_LEFT;
}
return SofaShape.INNER_RIGHT;
}
}
}
return SofaShape.STRAIGHT;
}
private boolean canTakeShape(ImmutableBlockState state, Object level, BlockPos pos, Direction face) {
Object blockState = FastNMS.INSTANCE.method$BlockGetter$getBlockState(level, LocationUtils.toBlockPos(pos.relative(face)));
Optional<ImmutableBlockState> optionalAnotherState = BlockStateUtils.getOptionalCustomBlockState(blockState);
if (optionalAnotherState.isEmpty()) {
return true;
}
ImmutableBlockState anotherState = optionalAnotherState.get();
Optional<SofaBlockBehavior> optionalBehavior = anotherState.behavior().getAs(SofaBlockBehavior.class);
if (optionalBehavior.isEmpty()) {
return true;
}
SofaBlockBehavior anotherBehavior = optionalBehavior.get();
return anotherState.get(anotherBehavior.facingProperty) != state.get(this.facingProperty);
}
public static class Factory implements BlockBehaviorFactory {
@Override
@SuppressWarnings("unchecked")
public BlockBehavior create(CustomBlock block, Map<String, Object> arguments) {
Property<HorizontalDirection> facing = (Property<HorizontalDirection>) ResourceConfigUtils.requireNonNullOrThrow(block.getProperty("facing"), "warning.config.block.behavior.sofa.missing_facing");
Property<SofaShape> shape = (Property<SofaShape>) ResourceConfigUtils.requireNonNullOrThrow(block.getProperty("shape"), "warning.config.block.behavior.sofa.missing_shape");
return new SofaBlockBehavior(block, facing, shape);
}
}
}

View File

@@ -0,0 +1,100 @@
package net.momirealms.craftengine.bukkit.block.behavior;
import net.momirealms.craftengine.bukkit.nms.FastNMS;
import net.momirealms.craftengine.bukkit.plugin.reflection.minecraft.CoreReflections;
import net.momirealms.craftengine.bukkit.util.BlockStateUtils;
import net.momirealms.craftengine.bukkit.util.LocationUtils;
import net.momirealms.craftengine.core.block.BlockBehavior;
import net.momirealms.craftengine.core.block.CustomBlock;
import net.momirealms.craftengine.core.block.ImmutableBlockState;
import net.momirealms.craftengine.core.block.behavior.BlockBehaviorFactory;
import net.momirealms.craftengine.core.block.properties.Property;
import net.momirealms.craftengine.core.entity.player.InteractionResult;
import net.momirealms.craftengine.core.item.context.UseOnContext;
import net.momirealms.craftengine.core.util.ResourceConfigUtils;
import java.util.Map;
import java.util.Optional;
import java.util.concurrent.Callable;
public class ToggleableLampBlockBehavior extends BukkitBlockBehavior {
public static final Factory FACTORY = new Factory();
private final Property<Boolean> litProperty;
private final Property<Boolean> poweredProperty;
private final boolean canOpenWithHand;
public ToggleableLampBlockBehavior(CustomBlock block, Property<Boolean> litProperty, Property<Boolean> poweredProperty, boolean canOpenWithHand) {
super(block);
this.litProperty = litProperty;
this.poweredProperty = poweredProperty;
this.canOpenWithHand = canOpenWithHand;
}
@Override
public InteractionResult useWithoutItem(UseOnContext context, ImmutableBlockState state) {
if (!this.canOpenWithHand) {
return InteractionResult.PASS;
}
ToggleableLampBlockBehavior behavior = state.behavior().getAs(ToggleableLampBlockBehavior.class).orElse(null);
if (behavior == null) return InteractionResult.PASS;
FastNMS.INSTANCE.method$LevelWriter$setBlock(
context.getLevel().serverWorld(),
LocationUtils.toBlockPos(context.getClickedPos()),
state.cycle(behavior.litProperty).customBlockState().literalObject(),
2
);
Optional.ofNullable(context.getPlayer()).ifPresent(p -> p.swingHand(context.getHand()));
return InteractionResult.SUCCESS_AND_CANCEL;
}
@Override
public void onPlace(Object thisBlock, Object[] args, Callable<Object> superMethod) {
if (this.poweredProperty == null) return;
Object state = args[0];
Object level = args[1];
Object pos = args[2];
Object oldState = args[3];
if (FastNMS.INSTANCE.method$BlockState$getBlock(oldState) != FastNMS.INSTANCE.method$BlockState$getBlock(state) && CoreReflections.clazz$ServerLevel.isInstance(level)) {
Optional<ImmutableBlockState> optionalCustomState = BlockStateUtils.getOptionalCustomBlockState(state);
if (optionalCustomState.isEmpty()) return;
checkAndFlip(optionalCustomState.get(), level, pos);
}
}
@Override
public void neighborChanged(Object thisBlock, Object[] args, Callable<Object> superMethod) {
if (this.poweredProperty == null) return;
Object blockState = args[0];
Object world = args[1];
if (!CoreReflections.clazz$ServerLevel.isInstance(world)) return;
Optional<ImmutableBlockState> optionalCustomState = BlockStateUtils.getOptionalCustomBlockState(blockState);
if (optionalCustomState.isEmpty()) return;
Object blockPos = args[2];
ImmutableBlockState customState = optionalCustomState.get();
checkAndFlip(customState, world, blockPos);
}
private void checkAndFlip(ImmutableBlockState customState, Object level, Object pos) {
boolean hasNeighborSignal = FastNMS.INSTANCE.method$SignalGetter$hasNeighborSignal(level, pos);
boolean isPowered = customState.get(this.poweredProperty);
if (hasNeighborSignal != isPowered) {
ImmutableBlockState blockState = customState;
if (!isPowered) {
blockState = blockState.cycle(this.litProperty);
}
FastNMS.INSTANCE.method$LevelWriter$setBlock(level, pos, blockState.with(this.poweredProperty, hasNeighborSignal).customBlockState().literalObject(), 3);
}
}
@SuppressWarnings("unchecked")
public static class Factory implements BlockBehaviorFactory {
@Override
public BlockBehavior create(CustomBlock block, Map<String, Object> arguments) {
boolean canOpenWithHand = ResourceConfigUtils.getAsBoolean(arguments.getOrDefault("can-open-with-hand", false), "can-open-with-hand");
Property<Boolean> lit = (Property<Boolean>) ResourceConfigUtils.requireNonNullOrThrow(block.getProperty("lit"), "warning.config.block.behavior.toggleable_lamp.missing_lit");
Property<Boolean> powered = (Property<Boolean>) (canOpenWithHand ? block.getProperty("powered") : ResourceConfigUtils.requireNonNullOrThrow(block.getProperty("powered"), "warning.config.block.behavior.toggleable_lamp.missing_powered"));
return new ToggleableLampBlockBehavior(block, lit, powered, canOpenWithHand);
}
}
}

View File

@@ -336,4 +336,22 @@ public class UnsafeCompositeBlockBehavior extends BukkitBlockBehavior {
behavior.spawnAfterBreak(thisBlock, args, superMethod);
}
}
@Override
public void fallOn(Object thisBlock, Object[] args, Callable<Object> superMethod) throws Exception {
for (AbstractBlockBehavior behavior : this.behaviors) {
behavior.fallOn(thisBlock, args, superMethod);
}
}
@Override
public void updateEntityMovementAfterFallOn(Object thisBlock, Object[] args, Callable<Object> superMethod) throws Exception {
for (AbstractBlockBehavior behavior : this.behaviors) {
if (behavior instanceof BouncingBlockBehavior bouncingBlockBehavior) {
bouncingBlockBehavior.updateEntityMovementAfterFallOn(thisBlock, args, superMethod);
return;
}
}
super.updateEntityMovementAfterFallOn(thisBlock, args, superMethod);
}
}

View File

@@ -83,7 +83,7 @@ public class VerticalCropBlockBehavior extends BukkitBlockBehavior {
@SuppressWarnings("unchecked")
@Override
public BlockBehavior create(CustomBlock block, Map<String, Object> arguments) {
Property<Integer> ageProperty = (Property<Integer>) ResourceConfigUtils.requireNonNullOrThrow(block.getProperty("age"), "warning.config.block.behavior.sugar_cane.missing_age");
Property<Integer> ageProperty = (Property<Integer>) ResourceConfigUtils.requireNonNullOrThrow(block.getProperty("age"), "warning.config.block.behavior.vertical_crop.missing_age");
int maxHeight = ResourceConfigUtils.getAsInt(arguments.getOrDefault("max-height", 3), "max-height");
boolean direction = arguments.getOrDefault("direction", "up").toString().equalsIgnoreCase("up");
return new VerticalCropBlockBehavior(block, ageProperty, maxHeight,

View File

@@ -159,7 +159,14 @@ public final class BlockGenerator {
.intercept(MethodDelegation.to(PlayerWillDestroyInterceptor.INSTANCE))
// spawnAfterBreak
.method(ElementMatchers.is(CoreReflections.method$BlockBehaviour$spawnAfterBreak))
.intercept(MethodDelegation.to(SpawnAfterBreakInterceptor.INSTANCE));
.intercept(MethodDelegation.to(SpawnAfterBreakInterceptor.INSTANCE))
// fallOn
.method(ElementMatchers.is(CoreReflections.method$Block$fallOn))
.intercept(MethodDelegation.to(FallOnInterceptor.INSTANCE))
// updateEntityMovementAfterFallOn
.method(ElementMatchers.is(CoreReflections.method$Block$updateEntityMovementAfterFallOn))
.intercept(MethodDelegation.to(UpdateEntityMovementAfterFallOnInterceptor.INSTANCE))
;
// 1.21.5+
if (CoreReflections.method$BlockBehaviour$affectNeighborsAfterRemoval != null) {
builder = builder.method(ElementMatchers.is(CoreReflections.method$BlockBehaviour$affectNeighborsAfterRemoval))
@@ -699,4 +706,32 @@ public final class BlockGenerator {
}
}
}
public static class FallOnInterceptor {
public static final FallOnInterceptor INSTANCE = new FallOnInterceptor();
@RuntimeType
public void intercept(@This Object thisObj, @AllArguments Object[] args, @SuperCall Callable<Object> superMethod) {
ObjectHolder<BlockBehavior> holder = ((DelegatingBlock) thisObj).behaviorDelegate();
try {
holder.value().fallOn(thisObj, args, superMethod);
} catch (Exception e) {
CraftEngine.instance().logger().severe("Failed to run fallOn", e);
}
}
}
public static class UpdateEntityMovementAfterFallOnInterceptor {
public static final UpdateEntityMovementAfterFallOnInterceptor INSTANCE = new UpdateEntityMovementAfterFallOnInterceptor();
@RuntimeType
public void intercept(@This Object thisObj, @AllArguments Object[] args, @SuperCall Callable<Object> superMethod) {
ObjectHolder<BlockBehavior> holder = ((DelegatingBlock) thisObj).behaviorDelegate();
try {
holder.value().updateEntityMovementAfterFallOn(thisObj, args, superMethod);
} catch (Exception e) {
CraftEngine.instance().logger().severe("Failed to run updateEntityMovementAfterFallOn", e);
}
}
}
}

View File

@@ -4209,4 +4209,12 @@ public final class CoreReflections {
public static final Method method$BlockAndTintGetter$getLightEngine = requireNonNull(
ReflectionUtils.getDeclaredMethod(clazz$BlockAndTintGetter, clazz$LevelLightEngine)
);
public static final Method method$Block$fallOn = requireNonNull(
ReflectionUtils.getDeclaredMethod(clazz$Block, void.class, clazz$Level, clazz$BlockState, clazz$BlockPos, clazz$Entity, VersionHelper.isOrAbove1_21_5() ? double.class : float.class)
);
public static final Method method$Block$updateEntityMovementAfterFallOn = requireNonNull(
ReflectionUtils.getDeclaredMethod(clazz$Block, void.class, clazz$BlockGetter, clazz$Entity)
);
}

View File

@@ -29,7 +29,7 @@ public final class LocationUtils {
return new Vec3d(
FastNMS.INSTANCE.field$Vec3$x(vec),
FastNMS.INSTANCE.field$Vec3$y(vec),
FastNMS.INSTANCE.field$Vec3$y(vec)
FastNMS.INSTANCE.field$Vec3$z(vec)
);
}

View File

@@ -80,4 +80,6 @@ minecraft:mangrove_fence_gate: 16
minecraft:cherry_fence_gate: 16
minecraft:bamboo_fence_gate: 16
minecraft:crimson_fence_gate: 16
minecraft:warped_fence_gate: 16
minecraft:warped_fence_gate: 16
minecraft:barrier: 128
minecraft:white_bed: 1

View File

@@ -28,6 +28,8 @@ lang:
block_name:default:copper_coil: Copper Coil
block_name:default:chessboard_block: Chessboard Block
block_name:default:safe_block: Safe Block
block_name:default:sofa: Sofa
block_name:default:connectable_sofa: Sofa
zh_cn:
block_name:default:chinese_lantern: 灯笼
block_name:default:netherite_anvil: 下界合金砧
@@ -53,4 +55,6 @@ lang:
block_name:default:solid_gunpowder_block: 凝固火药块
block_name:default:copper_coil: 铜线圈
block_name:default:chessboard_block: 棋盘方块
block_name:default:safe_block: 保险柜
block_name:default:safe_block: 保险柜
block_name:default:sofa: 沙发
block_name:default:connectable_sofa: 沙发

View File

@@ -555,6 +555,200 @@ items#misc:
facing=west,open=true:
appearance: west_open
id: 29
default:sofa:
material: nether_brick
custom-model-data: 3008
data:
item-name: <!i><i18n:item.sofa>
model:
type: minecraft:model
path: minecraft:item/custom/sofa
behavior:
type: block_item
block:
loot:
template: default:loot_table/self
settings:
hardness: 2
resistance: 3
map-color: 56
burn-chance: 5
fire-spread-chance: 20
burnable: true
is-suffocating: false
is-redstone-conductor: false
push-reaction: BLOCK
instrument: BASS
sounds:
break: minecraft:block.wood.break
fall: minecraft:block.wood.fall
hit: minecraft:block.wood.hit
place: minecraft:block.wood.place
step: minecraft:block.wood.step
tags:
- minecraft:mineable/axe
behavior:
type: bouncing_block
bounce-height: 0.66
sync-player-self: false
state:
id: 0
state: white_bed[facing=west,occupied=false,part=foot]
entity-renderer:
item: default:sofa
default:connectable_sofa_straight:
material: nether_brick
custom-model-data: 3009
data:
item-name: <!i><i18n:item.sofa>
model:
type: minecraft:model
path: minecraft:item/custom/sofa_straight
default:connectable_sofa_inner:
material: nether_brick
custom-model-data: 3010
data:
item-name: <!i><i18n:item.sofa>
model:
type: minecraft:model
path: minecraft:item/custom/sofa_inner
default:connectable_sofa:
material: nether_brick
custom-model-data: 3011
data:
item-name: <!i><i18n:item.sofa>
model:
type: minecraft:model
path: minecraft:item/custom/sofa_straight
behavior:
type: block_item
block:
loot:
template: default:loot_table/self
settings:
hardness: 2
resistance: 3
map-color: 56
burn-chance: 5
fire-spread-chance: 20
burnable: true
is-suffocating: false
is-redstone-conductor: false
push-reaction: BLOCK
instrument: BASS
sounds:
break: minecraft:block.wood.break
fall: minecraft:block.wood.fall
hit: minecraft:block.wood.hit
place: minecraft:block.wood.place
step: minecraft:block.wood.step
tags:
- minecraft:mineable/axe
behaviors:
- type: sofa_block
- type: bouncing_block
bounce-height: 0.66
states:
properties:
facing:
type: horizontal_direction
shape:
type: sofa_shape
appearances:
facing=east,shape=straight:
state: barrier[waterlogged=false]
entity-renderer:
item: default:connectable_sofa_straight
yaw: 90
facing=north,shape=straight:
state: barrier[waterlogged=false]
entity-renderer:
item: default:connectable_sofa_straight
facing=south,shape=straight:
state: barrier[waterlogged=false]
entity-renderer:
item: default:connectable_sofa_straight
yaw: 180
facing=west,shape=straight:
state: barrier[waterlogged=false]
entity-renderer:
item: default:connectable_sofa_straight
yaw: 270
facing=east,shape=inner_left:
state: barrier[waterlogged=false]
entity-renderer:
item: default:connectable_sofa_inner
facing=north,shape=inner_left:
state: barrier[waterlogged=false]
entity-renderer:
item: default:connectable_sofa_inner
yaw: 270
facing=south,shape=inner_left:
state: barrier[waterlogged=false]
entity-renderer:
item: default:connectable_sofa_inner
yaw: 90
facing=west,shape=inner_left:
state: barrier[waterlogged=false]
entity-renderer:
item: default:connectable_sofa_inner
yaw: 180
facing=east,shape=inner_right:
state: barrier[waterlogged=false]
entity-renderer:
item: default:connectable_sofa_inner
yaw: 90
facing=north,shape=inner_right:
state: barrier[waterlogged=false]
entity-renderer:
item: default:connectable_sofa_inner
facing=south,shape=inner_right:
state: barrier[waterlogged=false]
entity-renderer:
item: default:connectable_sofa_inner
yaw: 180
facing=west,shape=inner_right:
state: barrier[waterlogged=false]
entity-renderer:
item: default:connectable_sofa_inner
yaw: 270
variants:
facing=east,shape=inner_left:
appearance: facing=east,shape=inner_left
id: 0
facing=east,shape=inner_right:
appearance: facing=east,shape=inner_right
id: 1
facing=east,shape=straight:
appearance: facing=east,shape=straight
id: 2
facing=north,shape=inner_left:
appearance: facing=north,shape=inner_left
id: 3
facing=north,shape=inner_right:
appearance: facing=north,shape=inner_right
id: 4
facing=north,shape=straight:
appearance: facing=north,shape=straight
id: 5
facing=south,shape=inner_left:
appearance: facing=south,shape=inner_left
id: 6
facing=south,shape=inner_right:
appearance: facing=south,shape=inner_right
id: 7
facing=south,shape=straight:
appearance: facing=south,shape=straight
id: 8
facing=west,shape=inner_left:
appearance: facing=west,shape=inner_left
id: 9
facing=west,shape=inner_right:
appearance: facing=west,shape=inner_right
id: 10
facing=west,shape=straight:
appearance: facing=west,shape=straight
id: 11
recipes#misc:
default:chinese_lantern:
type: shaped

View File

@@ -72,11 +72,12 @@ categories:
- default:solid_gunpowder_block
- default:ender_pearl_flower_seeds
- default:gui_head_size_1
- default:gui_head_size_4
- minecraft:air
- default:copper_coil
- default:flame_elytra
- default:cap
- default:pebble
- default:chessboard_block
- default:safe_block
- default:safe_block
- default:sofa
- default:connectable_sofa
- default:gui_head_size_4

View File

@@ -47,6 +47,7 @@ i18n:
item.flower_basket: Flower Basket
item.chessboard_block: Chessboard Block
item.safe_block: Safe Block
item.sofa: Sofa
category.default.name: Default Assets
category.default.lore: Contains the default configuration of CraftEngine
category.palm_tree: Palm Tree
@@ -104,6 +105,7 @@ i18n:
item.flower_basket: 花篮
item.chessboard_block: 棋盘方块
item.safe_block: 保险柜
item.sofa: 沙发
category.default.name: 默认资产
category.default.lore: 包含了CraftEngine的默认配置
category.palm_tree: 棕榈树

View File

@@ -1,6 +1,4 @@
{
"format_version": "1.21.6",
"credit": "Made with Blockbench",
"texture_size": [32, 32],
"textures": {
"0": "item/custom/cap",

View File

@@ -1,5 +1,4 @@
{
"credit": "Made with Blockbench",
"textures": {
"1": "item/custom/flower_basket",
"particle": "item/custom/flower_basket"

View File

@@ -1,5 +1,4 @@
{
"credit": "Made with Blockbench",
"textures": {
"0": "item/custom/flower_basket"
},

View File

@@ -1,6 +1,4 @@
{
"format_version": "1.21.6",
"credit": "Made with Blockbench",
"textures": {
"0": "item/custom/flower_basket"
},

View File

@@ -0,0 +1,117 @@
{
"textures": {
"0": "item/custom/sofa",
"particle": "item/custom/sofa"
},
"elements": [
{
"from": [-0.07, -0.035, -0.07],
"to": [2.95, 2.495, 2.95],
"rotation": {"angle": 0, "axis": "y", "origin": [-0.07, -0.035, -0.07]},
"faces": {
"north": {"uv": [14.5, 15.25, 15, 16], "texture": "#0"},
"east": {"uv": [15, 15.25, 15.5, 16], "texture": "#0"},
"south": {"uv": [15, 15.25, 15.5, 16], "texture": "#0"},
"west": {"uv": [15, 15.25, 14.5, 16], "texture": "#0"},
"up": {"uv": [16, 15.5, 15.5, 15], "texture": "#0"},
"down": {"uv": [16, 15.5, 15.5, 16], "texture": "#0"}
}
},
{
"from": [13.05, -0.035, -0.07],
"to": [16.07, 2.495, 2.95],
"rotation": {"angle": 0, "axis": "y", "origin": [16.07, -0.035, -0.07]},
"faces": {
"north": {"uv": [15, 15.25, 14.5, 16], "texture": "#0"},
"east": {"uv": [14.5, 15.25, 15, 16], "texture": "#0"},
"south": {"uv": [15.5, 15.25, 15, 16], "texture": "#0"},
"west": {"uv": [15.5, 15.25, 15, 16], "texture": "#0"},
"up": {"uv": [15.5, 15.5, 16, 15], "texture": "#0"},
"down": {"uv": [15.5, 15.5, 16, 16], "texture": "#0"}
}
},
{
"from": [13.05, -0.035, 13.05],
"to": [16.07, 2.495, 16.07],
"rotation": {"angle": 0, "axis": "y", "origin": [16.07, -0.035, 16.07]},
"faces": {
"north": {"uv": [15, 15.25, 15.5, 16], "texture": "#0"},
"east": {"uv": [15, 15.25, 14.5, 16], "texture": "#0"},
"south": {"uv": [14.5, 15.25, 15, 16], "texture": "#0"},
"west": {"uv": [15, 15.25, 15.5, 16], "texture": "#0"},
"up": {"uv": [15.5, 15, 16, 15.5], "texture": "#0"},
"down": {"uv": [15.5, 16, 16, 15.5], "texture": "#0"}
}
},
{
"from": [-0.07, -0.035, 13.05],
"to": [2.95, 2.495, 16.07],
"rotation": {"angle": 0, "axis": "y", "origin": [-0.07, -0.035, 16.07]},
"faces": {
"north": {"uv": [15.5, 15.25, 15, 16], "texture": "#0"},
"east": {"uv": [15.5, 15.25, 15, 16], "texture": "#0"},
"south": {"uv": [15, 15.25, 14.5, 16], "texture": "#0"},
"west": {"uv": [14.5, 15.25, 15, 16], "texture": "#0"},
"up": {"uv": [16, 15, 15.5, 15.5], "texture": "#0"},
"down": {"uv": [16, 16, 15.5, 15.5], "texture": "#0"}
}
},
{
"from": [-0.0699, 2.5001, -0.0699],
"to": [16.0699, 9.0399, 16.0699],
"rotation": {"angle": 0, "axis": "y", "origin": [-0.08, 1.985, -0.08]},
"faces": {
"north": {"uv": [4, 11.5, 8, 13], "texture": "#0"},
"east": {"uv": [8, 11.5, 4, 13], "texture": "#0"},
"south": {"uv": [4, 11.5, 8, 13], "texture": "#0"},
"west": {"uv": [4, 11.5, 8, 13], "texture": "#0"},
"up": {"uv": [4, 4, 0, 0], "texture": "#0"},
"down": {"uv": [4, 12, 0, 16], "texture": "#0"}
}
}
],
"display": {
"thirdperson_righthand": {
"rotation": [60, -34, 0],
"translation": [-0.5, 3, 0.25],
"scale": [0.25, 0.25, 0.25]
},
"thirdperson_lefthand": {
"rotation": [60, -34, 0],
"translation": [-0.5, 3, 0.25],
"scale": [0.25, 0.25, 0.25]
},
"firstperson_righthand": {
"rotation": [0, -180, 0],
"translation": [0.5, 0.5, 0],
"scale": [0.5, 0.5, 0.5]
},
"firstperson_lefthand": {
"rotation": [0, -180, 0],
"translation": [0.5, 0.5, 0],
"scale": [0.5, 0.5, 0.5]
},
"ground": {
"translation": [0, 2.75, 0],
"scale": [0.35, 0.35, 0.35]
},
"gui": {
"rotation": [25, -135, 0],
"translation": [0.25, -1, 0],
"scale": [0.5, 0.5, 0.5]
},
"fixed": {
"rotation": [-90, 0, 0],
"translation": [0, 0, -16],
"scale": [2, 2, 2]
}
},
"groups": [
{
"name": "group",
"origin": [0, 0, 0],
"color": 0,
"children": [0, 1, 2, 3, 4]
}
]
}

View File

@@ -0,0 +1,143 @@
{
"textures": {
"0": "item/custom/sofa",
"particle": "item/custom/sofa"
},
"elements": [
{
"from": [1, 0, 1],
"to": [3, 3, 3],
"rotation": {"angle": 0, "axis": "y", "origin": [1, 0, 1]},
"faces": {
"north": {"uv": [14.5, 15.25, 15, 16], "texture": "#0"},
"east": {"uv": [15, 15.25, 15.5, 16], "texture": "#0"},
"south": {"uv": [15, 15.25, 15.5, 16], "texture": "#0"},
"west": {"uv": [15, 15.25, 14.5, 16], "texture": "#0"},
"up": {"uv": [16, 15.5, 15.5, 15], "texture": "#0"},
"down": {"uv": [16, 15.5, 15.5, 16], "texture": "#0"}
}
},
{
"from": [13, 0, 1],
"to": [15, 3, 3],
"rotation": {"angle": 0, "axis": "y", "origin": [15, 0, 1]},
"faces": {
"north": {"uv": [15, 15.25, 14.5, 16], "texture": "#0"},
"east": {"uv": [14.5, 15.25, 15, 16], "texture": "#0"},
"south": {"uv": [15.5, 15.25, 15, 16], "texture": "#0"},
"west": {"uv": [15.5, 15.25, 15, 16], "texture": "#0"},
"up": {"uv": [15.5, 15.5, 16, 15], "texture": "#0"},
"down": {"uv": [15.5, 15.5, 16, 16], "texture": "#0"}
}
},
{
"from": [13, 0, 13],
"to": [15, 3, 15],
"rotation": {"angle": 0, "axis": "y", "origin": [15, 0, 15]},
"faces": {
"north": {"uv": [15, 15.25, 15.5, 16], "texture": "#0"},
"east": {"uv": [15, 15.25, 14.5, 16], "texture": "#0"},
"south": {"uv": [14.5, 15.25, 15, 16], "texture": "#0"},
"west": {"uv": [15, 15.25, 15.5, 16], "texture": "#0"},
"up": {"uv": [15.5, 15, 16, 15.5], "texture": "#0"},
"down": {"uv": [15.5, 16, 16, 15.5], "texture": "#0"}
}
},
{
"from": [1, 0, 13],
"to": [3, 3, 15],
"rotation": {"angle": 0, "axis": "y", "origin": [1, 0, 15]},
"faces": {
"north": {"uv": [15.5, 15.25, 15, 16], "texture": "#0"},
"east": {"uv": [15.5, 15.25, 15, 16], "texture": "#0"},
"south": {"uv": [15, 15.25, 14.5, 16], "texture": "#0"},
"west": {"uv": [14.5, 15.25, 15, 16], "texture": "#0"},
"up": {"uv": [16, 15, 15.5, 15.5], "texture": "#0"},
"down": {"uv": [16, 16, 15.5, 15.5], "texture": "#0"}
}
},
{
"from": [0.01, 2.51, 0.01],
"to": [15.99, 8.49, 15.99],
"rotation": {"angle": 0, "axis": "y", "origin": [0, 2, 0]},
"faces": {
"north": {"uv": [4, 11.5, 8, 13], "texture": "#0"},
"east": {"uv": [8, 14.5, 4, 16], "texture": "#0"},
"south": {"uv": [4, 13, 8, 14.5], "texture": "#0"},
"west": {"uv": [4, 14.5, 8, 16], "texture": "#0"},
"up": {"uv": [4, 8, 0, 4], "texture": "#0"},
"down": {"uv": [4, 12, 0, 16], "texture": "#0"}
}
},
{
"from": [0.02, 6.02, 12.02],
"to": [15.98, 19.98, 15.98],
"rotation": {"angle": 22.5, "axis": "x", "origin": [7, 8, 14]},
"faces": {
"north": {"uv": [13, 8.5, 9, 12], "texture": "#0"},
"east": {"uv": [8, 12.5, 9, 16], "texture": "#0"},
"south": {"uv": [9, 12.5, 13, 16], "texture": "#0"},
"west": {"uv": [9, 12.5, 8, 16], "texture": "#0"},
"up": {"uv": [9, 12, 8, 8.5], "rotation": 90, "texture": "#0"},
"down": {"uv": [7.75, 10.5, 4.25, 11.5], "texture": "#0"}
}
},
{
"from": [0.02, 6.02, 0.02],
"to": [3.98, 19.98, 15.98],
"rotation": {"angle": 22.5, "axis": "z", "origin": [2, 8, 8]},
"faces": {
"north": {"uv": [9, 8.5, 8, 12], "texture": "#0"},
"east": {"uv": [9, 8.5, 13, 12], "texture": "#0"},
"south": {"uv": [8, 12.5, 9, 16], "texture": "#0"},
"west": {"uv": [13, 12.5, 9, 16], "texture": "#0"},
"up": {"uv": [8, 12, 9, 8.5], "texture": "#0"},
"down": {"uv": [4.25, 11.5, 7.75, 10.5], "rotation": 90, "texture": "#0"}
}
}
],
"display": {
"thirdperson_righthand": {
"rotation": [60, 180, 0],
"translation": [-0.5, 3, 0.25],
"scale": [0.25, 0.25, 0.25]
},
"thirdperson_lefthand": {
"rotation": [60, 0, 0],
"translation": [-0.5, 3, 0.25],
"scale": [0.25, 0.25, 0.25]
},
"firstperson_righthand": {
"rotation": [0, 180, 0],
"translation": [0.5, 0.5, 0],
"scale": [0.5, 0.5, 0.5]
},
"firstperson_lefthand": {
"rotation": [0, 90, 0],
"translation": [0.5, 0.5, 0],
"scale": [0.5, 0.5, 0.5]
},
"ground": {
"translation": [0, 2.75, 0],
"scale": [0.35, 0.35, 0.35]
},
"gui": {
"rotation": [25, -135, 0],
"translation": [0.25, -1, 0],
"scale": [0.5, 0.5, 0.5]
},
"fixed": {
"rotation": [-90, 0, 0],
"translation": [0, 0, -16],
"scale": [2, 2, 2]
}
},
"groups": [
{
"name": "group",
"origin": [0, 0, 0],
"color": 0,
"children": [0, 1, 2, 3, 4, 5, 6]
}
]
}

View File

@@ -0,0 +1,131 @@
{
"texture_size": [64, 64],
"textures": {
"0": "item/custom/sofa",
"particle": "item/custom/sofa"
},
"elements": [
{
"from": [1, 0, 1],
"to": [3, 3, 3],
"rotation": {"angle": 0, "axis": "y", "origin": [1, 0, 1]},
"faces": {
"north": {"uv": [14.5, 15.25, 15, 16], "texture": "#0"},
"east": {"uv": [15, 15.25, 15.5, 16], "texture": "#0"},
"south": {"uv": [15, 15.25, 15.5, 16], "texture": "#0"},
"west": {"uv": [15, 15.25, 14.5, 16], "texture": "#0"},
"up": {"uv": [16, 15.5, 15.5, 15], "texture": "#0"},
"down": {"uv": [16, 15.5, 15.5, 16], "texture": "#0"}
}
},
{
"from": [13, 0, 1],
"to": [15, 3, 3],
"rotation": {"angle": 0, "axis": "y", "origin": [15, 0, 1]},
"faces": {
"north": {"uv": [15, 15.25, 14.5, 16], "texture": "#0"},
"east": {"uv": [14.5, 15.25, 15, 16], "texture": "#0"},
"south": {"uv": [15.5, 15.25, 15, 16], "texture": "#0"},
"west": {"uv": [15.5, 15.25, 15, 16], "texture": "#0"},
"up": {"uv": [15.5, 15.5, 16, 15], "texture": "#0"},
"down": {"uv": [15.5, 15.5, 16, 16], "texture": "#0"}
}
},
{
"from": [13, 0, 13],
"to": [15, 3, 15],
"rotation": {"angle": 0, "axis": "y", "origin": [15, 0, 15]},
"faces": {
"north": {"uv": [15, 15.25, 15.5, 16], "texture": "#0"},
"east": {"uv": [15, 15.25, 14.5, 16], "texture": "#0"},
"south": {"uv": [14.5, 15.25, 15, 16], "texture": "#0"},
"west": {"uv": [15, 15.25, 15.5, 16], "texture": "#0"},
"up": {"uv": [15.5, 15, 16, 15.5], "texture": "#0"},
"down": {"uv": [15.5, 16, 16, 15.5], "texture": "#0"}
}
},
{
"from": [1, 0, 13],
"to": [3, 3, 15],
"rotation": {"angle": 0, "axis": "y", "origin": [1, 0, 15]},
"faces": {
"north": {"uv": [15.5, 15.25, 15, 16], "texture": "#0"},
"east": {"uv": [15.5, 15.25, 15, 16], "texture": "#0"},
"south": {"uv": [15, 15.25, 14.5, 16], "texture": "#0"},
"west": {"uv": [14.5, 15.25, 15, 16], "texture": "#0"},
"up": {"uv": [16, 15, 15.5, 15.5], "texture": "#0"},
"down": {"uv": [16, 16, 15.5, 15.5], "texture": "#0"}
}
},
{
"from": [0.01, 2.51, 0.01],
"to": [15.99, 8.49, 15.99],
"rotation": {"angle": 0, "axis": "y", "origin": [0, 2, 0]},
"faces": {
"north": {"uv": [4, 11.5, 8, 13], "texture": "#0"},
"east": {"uv": [8, 14.5, 4, 16], "texture": "#0"},
"south": {"uv": [4, 13, 8, 14.5], "texture": "#0"},
"west": {"uv": [4, 14.5, 8, 16], "texture": "#0"},
"up": {"uv": [4, 12, 0, 8], "texture": "#0"},
"down": {"uv": [4, 12, 0, 16], "texture": "#0"}
}
},
{
"from": [0.02, 6.02, 12.02],
"to": [15.98, 19.98, 15.98],
"rotation": {"angle": 22.5, "axis": "x", "origin": [7, 8, 14]},
"faces": {
"north": {"uv": [9, 8.5, 13, 12], "texture": "#0"},
"east": {"uv": [8, 12.5, 9, 16], "texture": "#0"},
"south": {"uv": [9, 12.5, 13, 16], "texture": "#0"},
"west": {"uv": [9, 12.5, 8, 16], "texture": "#0"},
"up": {"uv": [9, 12, 8, 8.5], "rotation": 90, "texture": "#0"},
"down": {"uv": [7.75, 10.5, 4.25, 11.5], "texture": "#0"}
}
}
],
"display": {
"thirdperson_righthand": {
"rotation": [60, -34, 0],
"translation": [-0.5, 3, 0.25],
"scale": [0.25, 0.25, 0.25]
},
"thirdperson_lefthand": {
"rotation": [60, -34, 0],
"translation": [-0.5, 3, 0.25],
"scale": [0.25, 0.25, 0.25]
},
"firstperson_righthand": {
"rotation": [0, 180, 0],
"translation": [0.5, 0.5, 0],
"scale": [0.5, 0.5, 0.5]
},
"firstperson_lefthand": {
"rotation": [0, 180, 0],
"translation": [0.5, 0.5, 0],
"scale": [0.5, 0.5, 0.5]
},
"ground": {
"translation": [0, 2.75, 0],
"scale": [0.35, 0.35, 0.35]
},
"gui": {
"rotation": [25, -135, 0],
"translation": [0.5, -1, 0],
"scale": [0.5, 0.5, 0.5]
},
"fixed": {
"rotation": [-90, 0, 0],
"translation": [0, 0, -16],
"scale": [2, 2, 2]
}
},
"groups": [
{
"name": "group",
"origin": [0, 0, 0],
"color": 0,
"children": [0, 1, 2, 3, 4, 5]
}
]
}

View File

@@ -1,5 +1,4 @@
{
"credit": "Made with Blockbench",
"textures": {
"0": "item/custom/topaz_trident_3d",
"particle": "item/custom/topaz_trident_3d"

View File

@@ -1,5 +1,4 @@
{
"credit": "Made with Blockbench",
"textures": {
"0": "item/custom/topaz_trident_3d",
"particle": "item/custom/topaz_trident_3d"

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@@ -273,7 +273,7 @@ warning.config.block.behavior.missing_type: "<yellow>Problem in Datei <arg:0> ge
warning.config.block.behavior.invalid_type: "<yellow>Problem in Datei <arg:0> gefunden - Der Block '<arg:1>' verwendet einen ungültigen Block-Behavior-Typ '<arg:2>'.</yellow>"
warning.config.block.behavior.concrete.missing_solid: "<yellow>Problem in Datei <arg:0> gefunden - Beim Block '<arg:1>' fehlt die erforderliche 'solid-block'-Option für das 'concrete_block'-Behavior.</yellow>"
warning.config.block.behavior.crop.missing_age: "<yellow>Problem in Datei <arg:0> gefunden - Beim Block '<arg:1>' fehlt die erforderliche 'age'-Property für das 'crop_block'-Behavior.</yellow>"
warning.config.block.behavior.sugar_cane.missing_age: "<yellow>Problem in Datei <arg:0> gefunden - Beim Block '<arg:1>' fehlt die erforderliche 'age'-Property für das 'sugar_cane_block'-Behavior.</yellow>"
warning.config.block.behavior.vertical_crop.missing_age: "<yellow>Problem in Datei <arg:0> gefunden - Beim Block '<arg:1>' fehlt die erforderliche 'age'-Property für das 'vertical_crop_block'-Behavior.</yellow>"
warning.config.block.behavior.leaves.missing_persistent: "<yellow>Problem in Datei <arg:0> gefunden - Beim Block '<arg:1>' fehlt die erforderliche 'persistent'-Property für das 'leaves_block'-Behavior.</yellow>"
warning.config.block.behavior.leaves.missing_distance: "<yellow>Problem in Datei <arg:0> gefunden - Beim Block '<arg:1>' fehlt die erforderliche 'distance'-Property für das 'leaves_block'-Behavior.</yellow>"
warning.config.block.behavior.lamp.missing_lit: "<yellow>Problem in Datei <arg:0> gefunden - Beim Block '<arg:1>' fehlt die erforderliche 'lit'-Property für das 'lamp_block'-Behavior.</yellow>"

View File

@@ -277,10 +277,12 @@ warning.config.block.behavior.missing_type: "<yellow>Issue found in file <arg:0>
warning.config.block.behavior.invalid_type: "<yellow>Issue found in file <arg:0> - The block '<arg:1>' is using an invalid block behavior type '<arg:2>'.</yellow>"
warning.config.block.behavior.concrete.missing_solid: "<yellow>Issue found in file <arg:0> - The block '<arg:1>' is missing the required 'solid-block' option for 'concrete_block' behavior.</yellow>"
warning.config.block.behavior.crop.missing_age: "<yellow>Issue found in file <arg:0> - The block '<arg:1>' is missing the required 'age' property for 'crop_block' behavior.</yellow>"
warning.config.block.behavior.sugar_cane.missing_age: "<yellow>Issue found in file <arg:0> - The block '<arg:1>' is missing the required 'age' property for 'sugar_cane_block' behavior.</yellow>"
warning.config.block.behavior.vertical_crop.missing_age: "<yellow>Issue found in file <arg:0> - The block '<arg:1>' is missing the required 'age' property for 'vertical_crop_block' behavior.</yellow>"
warning.config.block.behavior.leaves.missing_persistent: "<yellow>Issue found in file <arg:0> - The block '<arg:1>' is missing the required 'persistent' property for 'leaves_block' behavior.</yellow>"
warning.config.block.behavior.leaves.missing_distance: "<yellow>Issue found in file <arg:0> - The block '<arg:1>' is missing the required 'distance' property for 'leaves_block' behavior.</yellow>"
warning.config.block.behavior.lamp.missing_lit: "<yellow>Issue found in file <arg:0> - The block '<arg:1>' is missing the required 'lit' property for 'lamp_block' behavior.</yellow>"
warning.config.block.behavior.toggleable_lamp.missing_lit: "<yellow>Issue found in file <arg:0> - The block '<arg:1>' is missing the required 'lit' property for 'toggleable_lamp_block' behavior.</yellow>"
warning.config.block.behavior.toggleable_lamp.missing_powered: "<yellow>Issue found in file <arg:0> - The block '<arg:1>' is missing the required 'powered' property for 'toggleable_lamp_block' behavior.</yellow>"
warning.config.block.behavior.sapling.missing_stage: "<yellow>Issue found in file <arg:0> - The block '<arg:1>' is missing the required 'stage' property for 'sapling_block' behavior.</yellow>"
warning.config.block.behavior.sapling.missing_feature: "<yellow>Issue found in file <arg:0> - The block '<arg:1>' is missing the required 'feature' argument for 'sapling_block' behavior.</yellow>"
warning.config.block.behavior.strippable.missing_stripped: "<yellow>Issue found in file <arg:0> - The block '<arg:1>' is missing the required 'stripped' argument for 'strippable_block' behavior.</yellow>"
@@ -303,6 +305,8 @@ warning.config.block.behavior.slab.missing_type: "<yellow>Issue found in file <a
warning.config.block.behavior.stairs.missing_facing: "<yellow>Issue found in file <arg:0> - The block '<arg:1>' is missing the required 'facing' property for 'stairs_block' behavior.</yellow>"
warning.config.block.behavior.stairs.missing_half: "<yellow>Issue found in file <arg:0> - The block '<arg:1>' is missing the required 'half' property for 'stairs_block' behavior.</yellow>"
warning.config.block.behavior.stairs.missing_shape: "<yellow>Issue found in file <arg:0> - The block '<arg:1>' is missing the required 'shape' property for 'stairs_block' behavior.</yellow>"
warning.config.block.behavior.sofa.missing_facing: "<yellow>Issue found in file <arg:0> - The block '<arg:1>' is missing the required 'facing' property for 'sofa_block' behavior.</yellow>"
warning.config.block.behavior.sofa.missing_shape: "<yellow>Issue found in file <arg:0> - The block '<arg:1>' is missing the required 'shape' property for 'sofa_block' behavior.</yellow>"
warning.config.block.behavior.pressure_plate.missing_powered: "<yellow>Issue found in file <arg:0> - The block '<arg:1>' is missing the required 'powered' property for 'pressure_plate_block' behavior.</yellow>"
warning.config.block.behavior.grass.missing_feature: "<yellow>Issue found in file <arg:0> - The block '<arg:1>' is missing the required 'feature' argument for 'grass_block' behavior.</yellow>"
warning.config.block.behavior.double_high.missing_half: "<yellow>Issue found in file <arg:0> - The block '<arg:1>' is missing the required 'half' property for 'double_block' behavior.</yellow>"

View File

@@ -195,7 +195,7 @@ warning.config.block.behavior.missing_type: "<yellow>Problema encontrado en el a
warning.config.block.behavior.invalid_type: "<yellow>Problema encontrado en el archivo <arg:0> - El bloque '<arg:1>' está usando un tipo de comportamiento de bloque inválido '<arg:2>'.</yellow>"
warning.config.block.behavior.concrete.missing_solid: "<yellow>Problema encontrado en el archivo <arg:0> - El bloque '<arg:1>' carece de la opción requerida 'solid-block' para el comportamiento 'concrete_block'.</yellow>"
warning.config.block.behavior.crop.missing_age: "<yellow>Problema encontrado en el archivo <arg:0> - El bloque '<arg:1>' carece de la propiedad requerida 'age' para el comportamiento 'crop_block'.</yellow>"
warning.config.block.behavior.sugar_cane.missing_age: "<yellow>Problema encontrado en el archivo <arg:0> - El bloque '<arg:1>' carece de la propiedad requerida 'age' para el comportamiento 'sugar_cane_block'.</yellow>"
warning.config.block.behavior.vertical_crop.missing_age: "<yellow>Problema encontrado en el archivo <arg:0> - El bloque '<arg:1>' carece de la propiedad requerida 'age' para el comportamiento 'vertical_crop_block'.</yellow>"
warning.config.block.behavior.leaves.missing_persistent: "<yellow>Problema encontrado en el archivo <arg:0> - El bloque '<arg:1>' carece de la propiedad requerida 'persistent' para el comportamiento 'leaves_block'.</yellow>"
warning.config.block.behavior.leaves.missing_distance: "<yellow>Problema encontrado en el archivo <arg:0> - El bloque '<arg:1>' carece de la propiedad requerida 'distance' para el comportamiento 'leaves_block'.</yellow>"
warning.config.block.behavior.sapling.missing_stage: "<yellow>Problema encontrado en el archivo <arg:0> - El bloque '<arg:1>' carece de la propiedad requerida 'stage' para el comportamiento 'sapling_block'.</yellow>"

View File

@@ -245,7 +245,7 @@ warning.config.block.behavior.missing_type: "<yellow>Проблема найде
warning.config.block.behavior.invalid_type: "<yellow>Проблема найдена в файле <arg:0> - Блок '<arg:1>' имеет недействительный блочный behavior тип '<arg:2>'.</yellow>"
warning.config.block.behavior.concrete.missing_solid: "<yellow>Проблема найдена в файле <arg:0> - В блоке '<arg:1>' отсутствует необходимый 'solid-block' вариант для 'concrete_block' behavior.</yellow>"
warning.config.block.behavior.crop.missing_age: "<yellow>Проблема найдена в файле <arg:0> - В блоке '<arg:1>' отсутствует необходимый 'age' свойство для 'crop_block' behavior.</yellow>"
warning.config.block.behavior.sugar_cane.missing_age: "<yellow>Проблема найдена в файле <arg:0> - В блоке '<arg:1>' отсутствует необходимый 'age' свойство для 'sugar_cane_block' behavior.</yellow>"
warning.config.block.behavior.vertical_crop.missing_age: "<yellow>Проблема найдена в файле <arg:0> - В блоке '<arg:1>' отсутствует необходимый 'age' свойство для 'vertical_crop_block' behavior.</yellow>"
warning.config.block.behavior.leaves.missing_persistent: "<yellow>Проблема найдена в файле <arg:0> - В блоке '<arg:1>' отсутствует необходимый 'persistent' свойство для 'leaves_block' behavior.</yellow>"
warning.config.block.behavior.leaves.missing_distance: "<yellow>Проблема найдена в файле <arg:0> - В блоке '<arg:1>' отсутствует необходимый 'distance' свойство для 'leaves_block' behavior.</yellow>"
warning.config.block.behavior.lamp.missing_lit: "<yellow>Проблема найдена в файле <arg:0> - В блоке '<arg:1>' отсутствует необходимый 'lit' свойство для 'lamp_block' behavior.</yellow>"

View File

@@ -193,7 +193,7 @@ warning.config.block.behavior.missing_type: "<yellow><arg:0> dosyasında sorun b
warning.config.block.behavior.invalid_type: "<yellow><arg:0> dosyasında sorun bulundu - '<arg:1>' bloğu geçersiz bir blok davranış türü '<arg:2>' kullanıyor.</yellow>"
warning.config.block.behavior.concrete.missing_solid: "<yellow><arg:0> dosyasında sorun bulundu - '<arg:1>' bloğu, 'concrete_block' davranışı için gerekli 'solid-block' seçeneği eksik.</yellow>"
warning.config.block.behavior.crop.missing_age: "<yellow><arg:0> dosyasında sorun bulundu - '<arg:1>' bloğu, 'crop_block' davranışı için gerekli 'age' özelliği eksik.</yellow>"
warning.config.block.behavior.sugar_cane.missing_age: "<yellow><arg:0> dosyasında sorun bulundu - '<arg:1>' bloğu, 'sugar_cane_block' davranışı için gerekli 'age' özelliği eksik.</yellow>"
warning.config.block.behavior.vertical_crop.missing_age: "<yellow><arg:0> dosyasında sorun bulundu - '<arg:1>' bloğu, 'vertical_crop_block' davranışı için gerekli 'age' özelliği eksik.</yellow>"
warning.config.block.behavior.leaves.missing_persistent: "<yellow><arg:0> dosyasında sorun bulundu - '<arg:1>' bloğu, 'leaves_block' davranışı için gerekli 'persistent' özelliği eksik.</yellow>"
warning.config.block.behavior.leaves.missing_distance: "<yellow><arg:0> dosyasında sorun bulundu - '<arg:1>' bloğu, 'leaves_block' davranışı için gerekli 'distance' özelliği eksik.</yellow>"
warning.config.block.behavior.sapling.missing_stage: "<yellow><arg:0> dosyasında sorun bulundu - '<arg:1>' bloğu, 'sapling_block' davranışı için gerekli 'stage' özelliği eksik.</yellow>"

View File

@@ -277,10 +277,12 @@ warning.config.block.behavior.missing_type: "<yellow>在文件 <arg:0> 发现问
warning.config.block.behavior.invalid_type: "<yellow>在文件 <arg:0> 发现问题 - 方块 '<arg:1>' 使用了无效的行为类型 '<arg:2>'</yellow>"
warning.config.block.behavior.concrete.missing_solid: "<yellow>在文件 <arg:0> 发现问题 - 方块 '<arg:1>' 的 'concrete_block' 行为缺少必需的 'solid-block' 选项</yellow>"
warning.config.block.behavior.crop.missing_age: "<yellow>在文件 <arg:0> 发现问题 - 方块 '<arg:1>' 的 'crop_block' 行为缺少必需的 'age' 属性</yellow>"
warning.config.block.behavior.sugar_cane.missing_age: "<yellow>在文件 <arg:0> 发现问题 - 方块 '<arg:1>' 的 'sugar_cane_block' 行为缺少必需的 'age' 属性</yellow>"
warning.config.block.behavior.vertical_crop.missing_age: "<yellow>在文件 <arg:0> 发现问题 - 方块 '<arg:1>' 的 'vertical_crop_block' 行为缺少必需的 'age' 属性</yellow>"
warning.config.block.behavior.leaves.missing_persistent: "<yellow>在文件 <arg:0> 发现问题 - 方块 '<arg:1>' 的 'leaves_block' 行为缺少必需的 'persistent' 属性</yellow>"
warning.config.block.behavior.leaves.missing_distance: "<yellow>在文件 <arg:0> 发现问题 - 方块 '<arg:1>' 的 'leaves_block' 行为缺少必需的 'distance' 属性</yellow>"
warning.config.block.behavior.lamp.missing_lit: "<yellow>在文件 <arg:0> 发现问题 - 方块 '<arg:1>' 的 'lamp_block' 行为缺少必需的 'lit' 属性</yellow>"
warning.config.block.behavior.toggleable_lamp.missing_lit: "<yellow>在文件 <arg:0> 发现问题 - 方块 '<arg:1>' 的 'toggleable_lamp_block' 行为缺少必需的 'lit' 属性</yellow>"
warning.config.block.behavior.toggleable_lamp.missing_powered: "<yellow>在文件 <arg:0> 发现问题 - 方块 '<arg:1>' 的 'toggleable_lamp_block' 行为缺少必需的 'powered' 属性</yellow>"
warning.config.block.behavior.sapling.missing_stage: "<yellow>在文件 <arg:0> 发现问题 - 方块 '<arg:1>' 的 'sapling_block' 行为缺少必需的 'stage' 属性</yellow>"
warning.config.block.behavior.sapling.missing_feature: "<yellow>在文件 <arg:0> 发现问题 - 方块 '<arg:1>' 的 'sapling_block' 行为缺少必需的 'feature' 参数</yellow>"
warning.config.block.behavior.strippable.missing_stripped: "<yellow>在文件 <arg:0> 发现问题 - 方块 '<arg:1>' 的 'strippable_block' 行为缺少必需的 'stripped' 参数</yellow>"
@@ -303,6 +305,8 @@ warning.config.block.behavior.slab.missing_type: "<yellow>在文件 <arg:0> 发
warning.config.block.behavior.stairs.missing_facing: "<yellow>在文件 <arg:0> 发现问题 - 方块 '<arg:1>' 的 'stairs_block' 行为缺少必需的 'facing' 属性</yellow>"
warning.config.block.behavior.stairs.missing_half: "<yellow>在文件 <arg:0> 发现问题 - 方块 '<arg:1>' 的 'stairs_block' 行为缺少必需的 'half' 属性</yellow>"
warning.config.block.behavior.stairs.missing_shape: "<yellow>在文件 <arg:0> 发现问题 - 方块 '<arg:1>' 的 'stairs_block' 行为缺少必需的 'shape' 属性</yellow>"
warning.config.block.behavior.sofa.missing_facing: "<yellow>在文件 <arg:0> 发现问题 - 方块 '<arg:1>' 的 'sofa_block' 行为缺少必需的 'facing' 属性</yellow>"
warning.config.block.behavior.sofa.missing_shape: "<yellow>在文件 <arg:0> 发现问题 - 方块 '<arg:1>' 的 'sofa_block' 行为缺少必需的 'shape' 属性</yellow>"
warning.config.block.behavior.pressure_plate.missing_powered: "<yellow>在文件 <arg:0> 发现问题 - 方块 '<arg:1>' 的 'pressure_plate_block' 行为缺少必需的 'powered' 属性</yellow>"
warning.config.block.behavior.grass.missing_feature: "<yellow>在文件 <arg:0> 发现问题 - 方块 '<arg:1>' 的 'grass_block' 行为缺少必需的 'feature' 参数</yellow>"
warning.config.block.behavior.double_high.missing_half: "<yellow>在文件 <arg:0> 发现问题 - 方块 '<arg:1>' 的 'double_block' 行为缺少必需的 'half' 属性</yellow>"

View File

@@ -178,6 +178,17 @@ public abstract class BlockBehavior {
public void spawnAfterBreak(Object thisBlock, Object[] args, Callable<Object> superMethod) throws Exception {
}
// 1.20.1~1.21.4 Level world, BlockState state, BlockPos pos, Entity entity, float fallDistance
// 1.21.5+ Level level, BlockState state, BlockPos pos, Entity entity, double fallDistance
public void fallOn(Object thisBlock, Object[] args, Callable<Object> superMethod) throws Exception {
superMethod.call();
}
// BlockGetter level, Entity entity
public void updateEntityMovementAfterFallOn(Object thisBlock, Object[] args, Callable<Object> superMethod) throws Exception {
superMethod.call();
}
public ImmutableBlockState updateStateForPlacement(BlockPlaceContext context, ImmutableBlockState state) {
return state;
}

View File

@@ -21,6 +21,7 @@ public final class Properties {
public static final Key HINGE = Key.of("craftengine:hinge");
public static final Key STAIRS_SHAPE = Key.of("craftengine:stairs_shape");
public static final Key SLAB_TYPE = Key.of("craftengine:slab_type");
public static final Key SOFA_SHAPE = Key.of("craftengine:sofa_shape");
static {
register(BOOLEAN, BooleanProperty.FACTORY);
@@ -36,6 +37,8 @@ public final class Properties {
register(HINGE, new EnumProperty.Factory<>(DoorHinge.class));
register(STAIRS_SHAPE, new EnumProperty.Factory<>(StairsShape.class));
register(SLAB_TYPE, new EnumProperty.Factory<>(SlabType.class));
register(SOFA_SHAPE, new EnumProperty.Factory<>(SofaShape.class));
}
public static void register(Key key, PropertyFactory factory) {

View File

@@ -0,0 +1,7 @@
package net.momirealms.craftengine.core.block.state.properties;
public enum SofaShape {
STRAIGHT,
INNER_LEFT,
INNER_RIGHT,
}

View File

@@ -467,6 +467,10 @@ public abstract class AbstractPackManager implements PackManager {
plugin.saveResource("resources/default/resourcepack/assets/minecraft/models/block/custom/pebble_1.json");
plugin.saveResource("resources/default/resourcepack/assets/minecraft/models/block/custom/pebble_2.json");
plugin.saveResource("resources/default/resourcepack/assets/minecraft/models/block/custom/pebble_3.json");
plugin.saveResource("resources/default/resourcepack/assets/minecraft/models/item/custom/sofa_straight.json");
plugin.saveResource("resources/default/resourcepack/assets/minecraft/models/item/custom/sofa_inner.json");
plugin.saveResource("resources/default/resourcepack/assets/minecraft/models/item/custom/sofa.json");
plugin.saveResource("resources/default/resourcepack/assets/minecraft/textures/item/custom/sofa.png");
// ores
plugin.saveResource("resources/default/configuration/ores.yml");

View File

@@ -4,7 +4,7 @@ org.gradle.jvmargs=-Xmx1G
# Rule: [major update].[feature update].[bug fix]
project_version=0.0.62.17
config_version=45
lang_version=25
lang_version=26
project_group=net.momirealms
latest_supported_version=1.21.8
@@ -50,7 +50,7 @@ byte_buddy_version=1.17.5
ahocorasick_version=0.6.3
snake_yaml_version=2.5
anti_grief_version=0.20
nms_helper_version=1.0.80
nms_helper_version=1.0.82
evalex_version=3.5.0
reactive_streams_version=1.0.4
amazon_awssdk_version=2.33.1