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

添加小石子配置

This commit is contained in:
XiaoMoMi
2025-06-21 23:27:09 +08:00
parent c45c2f1af6
commit f5953bd491
16 changed files with 233 additions and 221 deletions

View File

@@ -13,6 +13,7 @@ import net.momirealms.craftengine.core.entity.player.InteractionResult;
import net.momirealms.craftengine.core.entity.player.Player;
import net.momirealms.craftengine.core.item.Item;
import net.momirealms.craftengine.core.item.context.UseOnContext;
import net.momirealms.craftengine.core.plugin.locale.LocalizedResourceConfigException;
import net.momirealms.craftengine.core.sound.SoundData;
import net.momirealms.craftengine.core.util.Key;
import net.momirealms.craftengine.core.util.MiscUtils;
@@ -56,18 +57,11 @@ public class StackableBlockBehavior extends BukkitBlockBehavior {
}
BlockPos pos = context.getClickedPos();
World world = context.getLevel();
if (state.get(this.amountProperty) < this.amountProperty.max) {
updateStackableBlock(state, pos, world, item, player, context.getHand());
if (state.get(this.amountProperty) >= this.amountProperty.max) {
return InteractionResult.SUCCESS_AND_CANCEL;
}
BlockPos actualPos = pos.relative(context.getClickedFace());
ImmutableBlockState actualState = world.getBlockAt(actualPos).customBlockState();
boolean isValid = actualState != null && !actualState.isEmpty() && actualState.contains(this.amountProperty);
if (isValid && actualState.get(this.amountProperty) < this.amountProperty.max) {
updateStackableBlock(actualState, actualPos, world, item, player, context.getHand());
return InteractionResult.SUCCESS_AND_CANCEL;
}
return InteractionResult.PASS;
updateStackableBlock(state, pos, world, item, player, context.getHand());
return InteractionResult.SUCCESS_AND_CANCEL;
}
private void updateStackableBlock(ImmutableBlockState state, BlockPos pos, World world, Item<ItemStack> item, Player player, InteractionHand hand) {
@@ -77,7 +71,7 @@ public class StackableBlockBehavior extends BukkitBlockBehavior {
if (this.stackSound != null) {
world.playBlockSound(new Vec3d(location.getX(), location.getY(), location.getZ()), this.stackSound);
}
FastNMS.INSTANCE.method$ItemStack$consume(item.getLiteralObject(), 1, player.serverPlayer());
item.count(item.count() - 1);
player.swingHand(hand);
}
@@ -86,7 +80,10 @@ public class StackableBlockBehavior extends BukkitBlockBehavior {
@Override
@SuppressWarnings("unchecked")
public BlockBehavior create(CustomBlock block, Map<String, Object> arguments) {
IntegerProperty amount = (IntegerProperty) ResourceConfigUtils.requireNonNullOrThrow(block.getProperty("amount"), "warning.config.block.behavior.stackable.missing_amount");
String propertyName = String.valueOf(arguments.getOrDefault("property", "amount"));
IntegerProperty amount = (IntegerProperty) ResourceConfigUtils.requireNonNullOrThrow(block.getProperty(propertyName), () -> {
throw new LocalizedResourceConfigException("warning.config.block.behavior.stackable.missing_property", propertyName);
});
Map<String, Object> sounds = (Map<String, Object>) arguments.get("sounds");
SoundData stackSound = null;
if (sounds != null) {

View File

@@ -35,7 +35,7 @@ public class UnsafeCompositeBlockBehavior extends BukkitBlockBehavior {
public InteractionResult useOnBlock(UseOnContext context, ImmutableBlockState state) {
for (AbstractBlockBehavior behavior : this.behaviors) {
InteractionResult result = behavior.useOnBlock(context, state);
if (result != InteractionResult.PASS) {
if (result != InteractionResult.PASS && result != InteractionResult.TRY_EMPTY_HAND) {
return result;
}
}

View File

@@ -130,6 +130,7 @@ public class ProjectilePacketHandler implements EntityPacketHandler {
it -> ItemDisplayEntityData.DisplayedItem.addEntityDataIfNotDefaultValue(FastNMS.INSTANCE.field$CraftItemStack$handle(it), itemDisplayValues),
() -> ItemDisplayEntityData.DisplayedItem.addEntityDataIfNotDefaultValue(literalItem, itemDisplayValues));
ItemDisplayEntityData.DisplayType.addEntityDataIfNotDefaultValue(meta.displayType().id(), itemDisplayValues);
ItemDisplayEntityData.BillboardConstraints.addEntityDataIfNotDefaultValue(meta.billboard().id(), itemDisplayValues);
return itemDisplayValues;
}

View File

@@ -1274,8 +1274,8 @@ public final class CoreReflections {
ReflectionUtils.getDeclaredField(clazz$BlockStateBase, boolean.class, 11)
);
public static final Field field$BlockStateBase$Cache$propagatesSkylightDown = requireNonNull(
ReflectionUtils.getDeclaredField(clazz$BlockStateBase$Cache, boolean.class, 2)
public static final Field field$BlockStateBase$Cache$propagatesSkylightDown = ReflectionUtils.getDeclaredField(
clazz$BlockStateBase$Cache, boolean.class, 2
);
public static final Field field$BlockStateBase$requiresCorrectToolForDrops = requireNonNull(

View File

@@ -250,6 +250,115 @@ items#misc:
id: 1
settings:
luminance: 8
default:pebble:
material: nether_brick
custom-model-data: 3005
data:
item-name: <!i><i18n:item.pebble>
model:
template: default:model/simplified_generated
arguments:
path: minecraft:item/custom/pebble
behavior:
- type: block_item
block:
settings:
template:
- default:sound/stone
- default:hardness/none
overrides:
map-color: 11
push-reaction: DESTROY
behaviors:
- type: sturdy_base_block
direction: down
- type: stackable_block
property: pebble
items:
- default:pebble
sounds:
stack: minecraft:block.stone.fall
loot:
pools:
- rolls: 1
entries:
- type: item
item: default:pebble
functions:
- type: set_count
count: 3
add: false
conditions:
- type: match_block_property
properties:
pebble: 3
- type: set_count
count: 2
add: false
conditions:
- type: match_block_property
properties:
pebble: 2
- type: explosion_decay
states:
properties:
pebble:
type: int
range: 1~3
default: 1
appearances:
one:
state: tripwire:2
models:
- path: minecraft:block/custom/pebble_1
weight: 1
- path: minecraft:block/custom/pebble_1
weight: 1
y: 90
- path: minecraft:block/custom/pebble_1
weight: 1
y: 180
- path: minecraft:block/custom/pebble_1
weight: 1
y: 270
two:
state: tripwire:3
models:
- path: minecraft:block/custom/pebble_2
weight: 1
- path: minecraft:block/custom/pebble_2
weight: 1
y: 90
- path: minecraft:block/custom/pebble_2
weight: 1
y: 180
- path: minecraft:block/custom/pebble_2
weight: 1
y: 270
three:
state: tripwire:4
models:
- path: minecraft:block/custom/pebble_3
weight: 1
- path: minecraft:block/custom/pebble_3
weight: 1
y: 90
- path: minecraft:block/custom/pebble_3
weight: 1
y: 180
- path: minecraft:block/custom/pebble_3
weight: 1
y: 270
variants:
pebble=1:
appearance: 'one'
id: 2
pebble=2:
appearance: 'two'
id: 3
pebble=3:
appearance: 'three'
id: 4
recipes#misc:
default:chinese_lantern:
type: shaped
@@ -304,4 +413,21 @@ recipes#misc:
A: minecraft:copper_ingot
result:
id: default:copper_coil
count: 1
default:pebble:
type: shapeless
ingredients:
- minecraft:cobblestone
result:
id: default:pebble
count: 4
default:cobblestone_from_pebble:
type: shaped
pattern:
- AA
- AA
ingredients:
A: default:pebble
result:
id: minecraft:cobblestone
count: 1

View File

@@ -27,6 +27,7 @@ categories:
- default:palm_fence_gate
- default:palm_slab
- default:palm_stairs
- default:palm_pressure_plate
default:topaz:
name: <!i><#FF8C00><i18n:category.topaz></#FF8C00>
hidden: true
@@ -74,4 +75,5 @@ categories:
- minecraft:air
- default:copper_coil
- default:flame_elytra
- default:cap
- default:cap
- default:pebble

View File

@@ -36,11 +36,13 @@ i18n:
item.palm_fence_gate: Palm Fence Gate
item.palm_slab: Palm Slab
item.palm_stairs: Palm Stairs
item.palm_pressure_plate: Palm Pressure Plate
item.netherite_anvil: Netherite Anvil
item.gunpowder_block: GunPowder Block
item.solid_gunpowder_block: Solid GunPowder Block
item.copper_coil: Copper Coil
item.flame_elytra: Flame Elytra
item.pebble: Pebble
item.cap: Cap
category.default.name: Default Assets
category.default.lore: Contains the default configuration of CraftEngine
@@ -88,11 +90,13 @@ i18n:
item.palm_fence_gate: 棕榈木栅栏门
item.palm_slab: 棕榈木台阶
item.palm_stairs: 棕榈木楼梯
item.palm_pressure_plate: 棕榈木压力板
item.netherite_anvil: 下界合金砧
item.gunpowder_block: 火药粉末
item.solid_gunpowder_block: 凝固火药块
item.copper_coil: 铜线圈
item.flame_elytra: 烈焰鞘翅
item.pebble: 石子
item.cap: 鸭舌帽
category.default.name: 默认资产
category.default.lore: 包含了CraftEngine的默认配置

View File

@@ -301,8 +301,8 @@ items:
can-open-with-hand: true
can-open-by-wind-charge: true
sounds:
open: block.wooden_trapdoor.open
close: block.wooden_trapdoor.close
open: minecraft:block.wooden_trapdoor.open
close: minecraft:block.wooden_trapdoor.close
loot:
template: default:loot_table/self
settings:
@@ -355,8 +355,8 @@ items:
can-open-with-hand: true
can-open-by-wind-charge: true
sounds:
open: block.wooden_door.open
close: block.wooden_door.close
open: minecraft:block.wooden_door.open
close: minecraft:block.wooden_door.close
loot:
template: default:loot_table/self
settings:
@@ -431,8 +431,8 @@ items:
can-open-with-hand: true
can-open-by-wind-charge: true
sounds:
open: block.fence_gate.open
close: block.fence_gate.close
open: minecraft:block.fence_gate.open
close: minecraft:block.fence_gate.close
loot:
template: default:loot_table/self
settings:

View File

@@ -1,75 +1,34 @@
{
"credit": "Made with Blockbench",
"textures": {
"1": "block/custom/pebble"
"0": "block/custom/pebble",
"particle": "block/custom/pebble"
},
"elements": [
{
"from": [6, -1, 6],
"to": [11, 2, 11],
"rotation": {"angle": 0, "axis": "y", "origin": [6, 0, 6]},
"faces": {
"north": {"uv": [2.5, 0, 5, 1.5], "texture": "#1"},
"east": {"uv": [2.5, 1.5, 5, 3], "texture": "#1"},
"south": {"uv": [2.5, 3, 5, 4.5], "texture": "#1"},
"west": {"uv": [2.5, 4.5, 5, 6], "texture": "#1"},
"up": {"uv": [2.5, 2.5, 0, 0], "texture": "#1"},
"down": {"uv": [2.5, 2.5, 0, 5], "texture": "#1"}
}
},
{
"from": [4, -0.99, 5],
"to": [7, 1.01, 8],
"rotation": {"angle": 0, "axis": "y", "origin": [4, 0, 5]},
"faces": {
"north": {"uv": [5, 1.5, 6.5, 2.5], "texture": "#1"},
"east": {"uv": [5, 2.5, 6.5, 3.5], "texture": "#1"},
"south": {"uv": [5, 3.5, 6.5, 4.5], "texture": "#1"},
"west": {"uv": [5, 4.5, 6.5, 5.5], "texture": "#1"},
"up": {"uv": [1.5, 6.5, 0, 5], "texture": "#1"},
"down": {"uv": [6.5, 0, 5, 1.5], "texture": "#1"}
"north": {"uv": [5, 1.5, 6.5, 2.5], "texture": "#0"},
"east": {"uv": [5, 2.5, 6.5, 3.5], "texture": "#0"},
"south": {"uv": [5, 3.5, 6.5, 4.5], "texture": "#0"},
"west": {"uv": [5, 4.5, 6.5, 5.5], "texture": "#0"},
"up": {"uv": [1.5, 6.5, 0, 5], "texture": "#0"},
"down": {"uv": [6.5, 0, 5, 1.5], "texture": "#0"}
}
}
],
"display": {
"thirdperson_righthand": {
"rotation": [45, 0, 0],
"translation": [0.5, 5, 4.75],
"scale": [0.8, 0.8, 0.8]
},
"thirdperson_lefthand": {
"rotation": [45, 0, 0],
"translation": [0.5, 5, 4.75],
"scale": [0.8, 0.8, 0.8]
},
"firstperson_righthand": {
"rotation": [0, -149, 0],
"translation": [3.25, 4.75, 0]
},
"firstperson_lefthand": {
"rotation": [0, 38, 0],
"translation": [1.75, 7, 0]
},
"ground": {
"translation": [0, 5.75, 0],
"scale": [0.85, 0.85, 0.85]
},
"gui": {
"rotation": [30, -155, 0],
"translation": [-1, 4.25, 0]
},
"fixed": {
"rotation": [-90, 0, 0],
"translation": [0, -1, -11.75],
"scale": [1.5, 1.5, 1.5]
}
},
"groups": [
{
"name": "group",
"origin": [4, 0, 5],
"color": 0,
"children": [0, 1]
"from": [6, -1, 6],
"to": [11, 2, 11],
"rotation": {"angle": 0, "axis": "y", "origin": [6, 0, 6]},
"faces": {
"north": {"uv": [2.5, 0, 5, 1.5], "texture": "#0"},
"east": {"uv": [2.5, 1.5, 5, 3], "texture": "#0"},
"south": {"uv": [2.5, 3, 5, 4.5], "texture": "#0"},
"west": {"uv": [2.5, 4.5, 5, 6], "texture": "#0"},
"up": {"uv": [2.5, 2.5, 0, 0], "texture": "#0"},
"down": {"uv": [2.5, 2.5, 0, 5], "texture": "#0"}
}
}
]
}

View File

@@ -1,22 +1,20 @@
{
"credit": "Made with Blockbench",
"texture_size": [32, 32],
"textures": {
"2": "block/custom/pebble",
"0": "block/custom/pebble",
"particle": "block/custom/pebble"
},
"elements": [
{
"from": [4.99, -0.01, 6.99],
"to": [10.01, 4.01, 12.01],
"rotation": {"angle": 0, "axis": "y", "origin": [5, 0, 6]},
"from": [2.01, -0.99, 8.01],
"to": [4.99, 2.99, 10.99],
"rotation": {"angle": 45, "axis": "z", "origin": [3.5, 1.5, 9.5]},
"faces": {
"north": {"uv": [9.5, 0, 12, 2], "texture": "#2"},
"east": {"uv": [9.5, 2, 12, 4], "texture": "#2"},
"south": {"uv": [9.5, 4, 12, 6], "texture": "#2"},
"west": {"uv": [7, 5, 9.5, 7], "texture": "#2"},
"up": {"uv": [9.5, 2.5, 7, 0], "texture": "#2"},
"down": {"uv": [9.5, 2.5, 7, 5], "texture": "#2"}
"north": {"uv": [12, 4, 13.5, 6], "texture": "#0"},
"east": {"uv": [2.5, 6, 4, 8], "texture": "#0"},
"south": {"uv": [4, 6, 5.5, 8], "texture": "#0"},
"west": {"uv": [5.5, 6, 7, 8], "texture": "#0"},
"up": {"uv": [16, 6, 14.5, 4.5], "texture": "#0"},
"down": {"uv": [16, 6, 14.5, 7.5], "texture": "#0"}
}
},
{
@@ -24,67 +22,26 @@
"to": [12, 3, 9],
"rotation": {"angle": 0, "axis": "y", "origin": [5, 0, 6]},
"faces": {
"north": {"uv": [14, 3, 16, 4.5], "texture": "#2"},
"east": {"uv": [7, 7, 9, 8.5], "texture": "#2"},
"south": {"uv": [14, 0, 16, 1.5], "texture": "#2"},
"west": {"uv": [14, 1.5, 16, 3], "texture": "#2"},
"up": {"uv": [14, 2, 12, 0], "texture": "#2"},
"down": {"uv": [14, 2, 12, 4], "texture": "#2"}
"north": {"uv": [14, 3, 16, 4.5], "texture": "#0"},
"east": {"uv": [7, 7, 9, 8.5], "texture": "#0"},
"south": {"uv": [14, 0, 16, 1.5], "texture": "#0"},
"west": {"uv": [14, 1.5, 16, 3], "texture": "#0"},
"up": {"uv": [14, 2, 12, 0], "texture": "#0"},
"down": {"uv": [14, 2, 12, 4], "texture": "#0"}
}
},
{
"from": [2.01, -0.99, 8.01],
"to": [4.99, 2.99, 10.99],
"rotation": {"angle": 45, "axis": "z", "origin": [3.5, 1.5, 9.5]},
"from": [4.99, -0.01, 6.99],
"to": [10.01, 4.01, 12.01],
"rotation": {"angle": 0, "axis": "y", "origin": [5, 0, 6]},
"faces": {
"north": {"uv": [12, 4, 13.5, 6], "texture": "#2"},
"east": {"uv": [2.5, 6, 4, 8], "texture": "#2"},
"south": {"uv": [4, 6, 5.5, 8], "texture": "#2"},
"west": {"uv": [5.5, 6, 7, 8], "texture": "#2"},
"up": {"uv": [16, 6, 14.5, 4.5], "texture": "#2"},
"down": {"uv": [16, 6, 14.5, 7.5], "texture": "#2"}
"north": {"uv": [9.5, 0, 12, 2], "texture": "#0"},
"east": {"uv": [9.5, 2, 12, 4], "texture": "#0"},
"south": {"uv": [9.5, 4, 12, 6], "texture": "#0"},
"west": {"uv": [7, 5, 9.5, 7], "texture": "#0"},
"up": {"uv": [9.5, 2.5, 7, 0], "texture": "#0"},
"down": {"uv": [9.5, 2.5, 7, 5], "texture": "#0"}
}
}
],
"display": {
"thirdperson_righthand": {
"rotation": [45, 0, 0],
"translation": [0.5, 5, 4.75],
"scale": [0.8, 0.8, 0.8]
},
"thirdperson_lefthand": {
"rotation": [45, 0, 0],
"translation": [0.5, 5, 4.75],
"scale": [0.8, 0.8, 0.8]
},
"firstperson_righthand": {
"rotation": [0, 38, 0],
"translation": [1.75, 7, 0]
},
"firstperson_lefthand": {
"rotation": [0, 38, 0],
"translation": [1.75, 7, 0]
},
"ground": {
"translation": [0, 5.75, 0],
"scale": [0.85, 0.85, 0.85]
},
"gui": {
"rotation": [25, 144, 0],
"translation": [-0.5, 4.75, 0]
},
"fixed": {
"rotation": [-90, 0, 0],
"translation": [0, -1, -11.75],
"scale": [1.5, 1.5, 1.5]
}
},
"groups": [
{
"name": "group",
"origin": [8, 8, 8],
"color": 0,
"children": [0, 1, 2]
}
]
}

View File

@@ -1,22 +1,20 @@
{
"credit": "Made with Blockbench",
"texture_size": [32, 32],
"textures": {
"2": "block/custom/pebble",
"0": "block/custom/pebble",
"particle": "block/custom/pebble"
},
"elements": [
{
"from": [3, 0, 6],
"to": [9, 8, 12],
"rotation": {"angle": 22.5, "axis": "z", "origin": [7, 3.5, 9]},
"from": [6, 0, 9],
"to": [11, 2, 14],
"rotation": {"angle": 0, "axis": "y", "origin": [15, 0, 1]},
"faces": {
"north": {"uv": [0, 8, 3, 12], "texture": "#2"},
"east": {"uv": [3, 8, 6, 12], "texture": "#2"},
"south": {"uv": [0, 12, 3, 16], "texture": "#2"},
"west": {"uv": [3, 12, 6, 16], "texture": "#2"},
"up": {"uv": [9, 13, 6, 10], "texture": "#2"},
"down": {"uv": [9, 13, 6, 16], "texture": "#2"}
"north": {"uv": [15, 13.5, 16, 16], "rotation": 90, "texture": "#0"},
"east": {"uv": [6.5, 9, 9, 10], "texture": "#0"},
"south": {"uv": [11.5, 9, 14, 10], "texture": "#0"},
"west": {"uv": [15, 16, 14, 13.5], "rotation": 90, "texture": "#0"},
"up": {"uv": [12, 9, 9.5, 6.5], "texture": "#0"},
"down": {"uv": [14.5, 6.5, 12, 9], "texture": "#0"}
}
},
{
@@ -24,67 +22,26 @@
"to": [12, 4, 9],
"rotation": {"angle": 0, "axis": "y", "origin": [-1, 0, 1]},
"faces": {
"north": {"uv": [9, 11.5, 11.5, 13.5], "texture": "#2"},
"east": {"uv": [11.5, 10, 14, 12], "texture": "#2"},
"south": {"uv": [11.5, 12, 14, 14], "texture": "#2"},
"west": {"uv": [11.5, 14, 14, 16], "texture": "#2"},
"up": {"uv": [11.5, 16, 9, 13.5], "texture": "#2"},
"down": {"uv": [11.5, 9, 9, 11.5], "texture": "#2"}
"north": {"uv": [9, 11.5, 11.5, 13.5], "texture": "#0"},
"east": {"uv": [11.5, 10, 14, 12], "texture": "#0"},
"south": {"uv": [11.5, 12, 14, 14], "texture": "#0"},
"west": {"uv": [11.5, 14, 14, 16], "texture": "#0"},
"up": {"uv": [11.5, 16, 9, 13.5], "texture": "#0"},
"down": {"uv": [11.5, 9, 9, 11.5], "texture": "#0"}
}
},
{
"from": [6, 0, 9],
"to": [11, 2, 14],
"rotation": {"angle": 0, "axis": "y", "origin": [15, 0, 1]},
"from": [3, 0, 6],
"to": [9, 8, 12],
"rotation": {"angle": 22.5, "axis": "z", "origin": [7, 3.5, 9]},
"faces": {
"north": {"uv": [15, 13.5, 16, 16], "rotation": 90, "texture": "#2"},
"east": {"uv": [6.5, 9, 9, 10], "texture": "#2"},
"south": {"uv": [11.5, 9, 14, 10], "texture": "#2"},
"west": {"uv": [15, 16, 14, 13.5], "rotation": 90, "texture": "#2"},
"up": {"uv": [12, 9, 9.5, 6.5], "texture": "#2"},
"down": {"uv": [14.5, 6.5, 12, 9], "texture": "#2"}
"north": {"uv": [0, 8, 3, 12], "texture": "#0"},
"east": {"uv": [3, 8, 6, 12], "texture": "#0"},
"south": {"uv": [0, 12, 3, 16], "texture": "#0"},
"west": {"uv": [3, 12, 6, 16], "texture": "#0"},
"up": {"uv": [9, 13, 6, 10], "texture": "#0"},
"down": {"uv": [9, 13, 6, 16], "texture": "#0"}
}
}
],
"display": {
"thirdperson_righthand": {
"rotation": [45, 0, 0],
"translation": [0.5, 5, 4.75],
"scale": [0.8, 0.8, 0.8]
},
"thirdperson_lefthand": {
"rotation": [45, 0, 0],
"translation": [0.5, 5, 4.75],
"scale": [0.8, 0.8, 0.8]
},
"firstperson_righthand": {
"rotation": [0, -149, 0],
"translation": [3.25, 4.75, 0]
},
"firstperson_lefthand": {
"rotation": [0, 38, 0],
"translation": [1.75, 7, 0]
},
"ground": {
"translation": [0, 5.75, 0],
"scale": [0.85, 0.85, 0.85]
},
"gui": {
"rotation": [30, -155, 0],
"translation": [-1, 4.25, 0]
},
"fixed": {
"rotation": [-90, 0, 0],
"translation": [0, -1, -11.75],
"scale": [1.5, 1.5, 1.5]
}
},
"groups": [
{
"name": "group",
"origin": [8, 8, 8],
"color": 0,
"children": [0, 1, 2]
}
]
}

View File

@@ -256,7 +256,7 @@ warning.config.block.behavior.trapdoor.missing_half: "<yellow>Issue found in fil
warning.config.block.behavior.trapdoor.missing_facing: "<yellow>Issue found in file <arg:0> - The block '<arg:1>' is missing the required 'facing' property for 'trapdoor_block' behavior.</yellow>"
warning.config.block.behavior.trapdoor.missing_open: "<yellow>Issue found in file <arg:0> - The block '<arg:1>' is missing the required 'open' property for 'trapdoor_block' behavior.</yellow>"
warning.config.block.behavior.trapdoor.missing_powered: "<yellow>Issue found in file <arg:0> - The block '<arg:1>' is missing the required 'powered' property for 'trapdoor_block' behavior.</yellow>"
warning.config.block.behavior.stackable.missing_amount: "<yellow>Issue found in file <arg:0> - The block '<arg:1>' is missing the required 'amount' property for 'stackable_block' behavior.</yellow>"
warning.config.block.behavior.stackable.missing_property: "<yellow>Issue found in file <arg:0> - The block '<arg:1>' is missing the required '<arg:2>' property for 'stackable_block' behavior.</yellow>"
warning.config.block.behavior.stackable.missing_items: "<yellow>Issue found in file <arg:0> - The block '<arg:1>' is missing the required 'items' argument for 'stackable_block' behavior.</yellow>"
warning.config.block.behavior.fence_gate.missing_facing: "<yellow>Issue found in file <arg:0> - The block '<arg:1>' is missing the required 'facing' argument for 'fence_gate_block' behavior.</yellow>"
warning.config.block.behavior.fence_gate.missing_in_wall: "<yellow>Issue found in file <arg:0> - The block '<arg:1>' is missing the required 'in_wall' argument for 'fence_gate_block' behavior.</yellow>"

View File

@@ -256,7 +256,7 @@ warning.config.block.behavior.trapdoor.missing_half: "<yellow>在文件 <arg:0>
warning.config.block.behavior.trapdoor.missing_facing: "<yellow>在文件 <arg:0> 发现问题 - 方块 '<arg:1>' 的 'trapdoor_block' 行为缺少必需的 'facing' 属性</yellow>"
warning.config.block.behavior.trapdoor.missing_open: "<yellow>在文件 <arg:0> 发现问题 - 方块 '<arg:1>' 的 'trapdoor_block' 行为缺少必需的 'open' 属性</yellow>"
warning.config.block.behavior.trapdoor.missing_powered: "<yellow>在文件 <arg:0> 发现问题 - 方块 '<arg:1>' 的 'trapdoor_block' 行为缺少必需的 'powered' 属性</yellow>"
warning.config.block.behavior.stackable.missing_amount: "<yellow>在文件 <arg:0> 发现问题 - 方块 '<arg:1>' 的 'stackable_block' 行为缺少必需的 'amount' 属性</yellow>"
warning.config.block.behavior.stackable.missing_property: "<yellow>在文件 <arg:0> 发现问题 - 方块 '<arg:1>' 的 'stackable_block' 行为缺少必需的 '<arg:2>' 属性</yellow>"
warning.config.block.behavior.stackable.missing_items: "<yellow>在文件 <arg:0> 发现问题 - 方块 '<arg:1>' 的 'stackable_block' 行为缺少必需的 'items' 参数</yellow>"
warning.config.block.behavior.fence_gate.missing_facing: "<yellow>在文件 <arg:0> 发现问题 - 方块 '<arg:1>' 的 'fence_gate_block' 行为缺少必需的 'facing' 属性</yellow>"
warning.config.block.behavior.fence_gate.missing_in_wall: "<yellow>在文件 <arg:0> 发现问题 - 方块 '<arg:1>' 的 'fence_gate_block' 行为缺少必需的 'in_wall' 属性</yellow>"

View File

@@ -1,5 +1,6 @@
package net.momirealms.craftengine.core.entity.projectile;
import net.momirealms.craftengine.core.entity.Billboard;
import net.momirealms.craftengine.core.entity.ItemDisplayContext;
import net.momirealms.craftengine.core.util.Key;
import org.jetbrains.annotations.Nullable;
@@ -8,6 +9,7 @@ import org.joml.Vector3f;
public record ProjectileMeta(Key item,
ItemDisplayContext displayType,
Billboard billboard,
Vector3f scale,
Vector3f translation,
Quaternionf rotation,

View File

@@ -1,5 +1,6 @@
package net.momirealms.craftengine.core.item;
import net.momirealms.craftengine.core.entity.Billboard;
import net.momirealms.craftengine.core.entity.ItemDisplayContext;
import net.momirealms.craftengine.core.entity.projectile.ProjectileMeta;
import net.momirealms.craftengine.core.entity.projectile.ProjectileType;
@@ -324,12 +325,13 @@ public class ItemSettings {
Map<String, Object> args = MiscUtils.castToMap(value, false);
Key customTridentItemId = Key.of(Objects.requireNonNull(args.get("item"), "'item should not be null'").toString());
ItemDisplayContext displayType = ItemDisplayContext.valueOf(args.getOrDefault("display-transform", "NONE").toString().toUpperCase(Locale.ENGLISH));
Billboard billboard = Billboard.valueOf(args.getOrDefault("billboard", "FIXED").toString().toUpperCase(Locale.ENGLISH));
Vector3f translation = MiscUtils.getAsVector3f(args.getOrDefault("translation", "0"), "translation");
Vector3f scale = MiscUtils.getAsVector3f(args.getOrDefault("scale", "1"), "scale");
Quaternionf rotation = MiscUtils.getAsQuaternionf(ResourceConfigUtils.get(args, "rotation-left", "rotation"), "rotation-left");
ProjectileType type = Optional.ofNullable(args.get("type")).map(String::valueOf).map(it -> ProjectileType.valueOf(it.toUpperCase(Locale.ENGLISH))).orElse(null);
double range = ResourceConfigUtils.getAsDouble(args.getOrDefault("range", 1), "range");
return settings -> settings.projectileMeta(new ProjectileMeta(customTridentItemId, displayType, scale, translation, rotation, range, type));
return settings -> settings.projectileMeta(new ProjectileMeta(customTridentItemId, displayType, billboard, scale, translation, rotation, range, type));
}));
registerFactory("helmet", (value -> {
Map<String, Object> args = MiscUtils.castToMap(value, false);

View File

@@ -406,6 +406,11 @@ public abstract class AbstractPackManager implements PackManager {
plugin.saveResource("resources/default/resourcepack/assets/minecraft/textures/entity/equipment/wings/flame_elytra.png");
plugin.saveResource("resources/default/resourcepack/assets/minecraft/textures/item/custom/cap.png");
plugin.saveResource("resources/default/resourcepack/assets/minecraft/models/item/custom/cap.json");
plugin.saveResource("resources/default/resourcepack/assets/minecraft/textures/item/custom/pebble.png");
plugin.saveResource("resources/default/resourcepack/assets/minecraft/textures/block/custom/pebble.png");
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");
// ores
plugin.saveResource("resources/default/configuration/ores.yml");