mirror of
https://github.com/Xiao-MoMi/craft-engine.git
synced 2025-12-21 16:09:26 +00:00
模板重构
This commit is contained in:
@@ -205,7 +205,7 @@ public class BukkitProjectileManager implements Listener, ProjectileManager {
|
|||||||
private void updateProjectileUpdateInterval(int updateInterval) {
|
private void updateProjectileUpdateInterval(int updateInterval) {
|
||||||
if (this.lastInjectedInterval == updateInterval) return;
|
if (this.lastInjectedInterval == updateInterval) return;
|
||||||
try {
|
try {
|
||||||
CoreReflections.handle$ServerEntity$updateIntervalSetter.invokeExact(this.cachedServerEntity, updateInterval);
|
CoreReflections.methodHandle$ServerEntity$updateIntervalSetter.invokeExact(this.cachedServerEntity, updateInterval);
|
||||||
this.lastInjectedInterval = updateInterval;
|
this.lastInjectedInterval = updateInterval;
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
BukkitProjectileManager.this.plugin.logger().warn("Failed to update server entity update interval for " + this.projectile.getType().getKey() + "[" + this.projectile.getUniqueId() + "]", e);
|
BukkitProjectileManager.this.plugin.logger().warn("Failed to update server entity update interval for " + this.projectile.getType().getKey() + "[" + this.projectile.getUniqueId() + "]", e);
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ public class BukkitNetworkManager implements NetworkManager, Listener, PluginMes
|
|||||||
|
|
||||||
private static final String CONNECTION_HANDLER_NAME = "craftengine_connection_handler";
|
private static final String CONNECTION_HANDLER_NAME = "craftengine_connection_handler";
|
||||||
private static final String SERVER_CHANNEL_HANDLER_NAME = "craftengine_server_channel_handler";
|
private static final String SERVER_CHANNEL_HANDLER_NAME = "craftengine_server_channel_handler";
|
||||||
private static final String PLAYER_CHANNEL_HANDLER_NAME = "craftengine_player_packet_handler";
|
private static final String PLAYER_CHANNEL_HANDLER_NAME = "craftengine_player_channel_handler";
|
||||||
private static final String PACKET_ENCODER = "craftengine_encoder";
|
private static final String PACKET_ENCODER = "craftengine_encoder";
|
||||||
private static final String PACKET_DECODER = "craftengine_decoder";
|
private static final String PACKET_DECODER = "craftengine_decoder";
|
||||||
|
|
||||||
|
|||||||
@@ -1452,11 +1452,11 @@ public class PacketConsumers {
|
|||||||
assert CoreReflections.method$ServerGamePacketListenerImpl$tryPickItem != null;
|
assert CoreReflections.method$ServerGamePacketListenerImpl$tryPickItem != null;
|
||||||
if (VersionHelper.isOrAbove1_21_5()) {
|
if (VersionHelper.isOrAbove1_21_5()) {
|
||||||
CoreReflections.method$ServerGamePacketListenerImpl$tryPickItem.invoke(
|
CoreReflections.method$ServerGamePacketListenerImpl$tryPickItem.invoke(
|
||||||
CoreReflections.handle$ServerPlayer$connectionGetter.invokeExact(FastNMS.INSTANCE.method$CraftPlayer$getHandle(player)),
|
CoreReflections.methodHandle$ServerPlayer$connectionGetter.invokeExact(FastNMS.INSTANCE.method$CraftPlayer$getHandle(player)),
|
||||||
FastNMS.INSTANCE.method$CraftItemStack$asNMSCopy(itemStack), blockPos, entity, true);
|
FastNMS.INSTANCE.method$CraftItemStack$asNMSCopy(itemStack), blockPos, entity, true);
|
||||||
} else {
|
} else {
|
||||||
CoreReflections.method$ServerGamePacketListenerImpl$tryPickItem.invoke(
|
CoreReflections.method$ServerGamePacketListenerImpl$tryPickItem.invoke(
|
||||||
CoreReflections.handle$ServerPlayer$connectionGetter.invokeExact(FastNMS.INSTANCE.method$CraftPlayer$getHandle(player)), FastNMS.INSTANCE.method$CraftItemStack$asNMSCopy(itemStack));
|
CoreReflections.methodHandle$ServerPlayer$connectionGetter.invokeExact(FastNMS.INSTANCE.method$CraftPlayer$getHandle(player)), FastNMS.INSTANCE.method$CraftItemStack$asNMSCopy(itemStack));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3274,21 +3274,21 @@ public final class CoreReflections {
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
public static final MethodHandle handle$ServerEntity$broadcastSetter;
|
public static final MethodHandle methodHandle$ServerEntity$broadcastSetter;
|
||||||
public static final MethodHandle handle$ServerEntity$updateIntervalSetter;
|
public static final MethodHandle methodHandle$ServerEntity$updateIntervalSetter;
|
||||||
public static final MethodHandle handle$ServerPlayer$connectionGetter;
|
public static final MethodHandle methodHandle$ServerPlayer$connectionGetter;
|
||||||
|
|
||||||
static {
|
static {
|
||||||
try {
|
try {
|
||||||
handle$ServerEntity$broadcastSetter = requireNonNull(
|
methodHandle$ServerEntity$broadcastSetter = requireNonNull(
|
||||||
ReflectionUtils.unreflectSetter(field$ServerEntity$broadcast)
|
ReflectionUtils.unreflectSetter(field$ServerEntity$broadcast)
|
||||||
.asType(MethodType.methodType(void.class, Object.class, Consumer.class))
|
.asType(MethodType.methodType(void.class, Object.class, Consumer.class))
|
||||||
);
|
);
|
||||||
handle$ServerEntity$updateIntervalSetter = requireNonNull(
|
methodHandle$ServerEntity$updateIntervalSetter = requireNonNull(
|
||||||
ReflectionUtils.unreflectSetter(field$ServerEntity$updateInterval)
|
ReflectionUtils.unreflectSetter(field$ServerEntity$updateInterval)
|
||||||
.asType(MethodType.methodType(void.class, Object.class, int.class))
|
.asType(MethodType.methodType(void.class, Object.class, int.class))
|
||||||
);
|
);
|
||||||
handle$ServerPlayer$connectionGetter = requireNonNull(
|
methodHandle$ServerPlayer$connectionGetter = requireNonNull(
|
||||||
ReflectionUtils.unreflectGetter(field$ServerPlayer$connection)
|
ReflectionUtils.unreflectGetter(field$ServerPlayer$connection)
|
||||||
.asType(MethodType.methodType(Object.class, Object.class))
|
.asType(MethodType.methodType(Object.class, Object.class))
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ templates:
|
|||||||
default:emoji/basic:
|
default:emoji/basic:
|
||||||
content: "<hover:show_text:'<i18n:emoji.tip>'><!shadow><white><arg:emoji></white></!shadow></hover>"
|
content: "<hover:show_text:'<i18n:emoji.tip>'><!shadow><white><arg:emoji></white></!shadow></hover>"
|
||||||
default:emoji/addition_info:
|
default:emoji/addition_info:
|
||||||
content: "<hover:show_text:'<i18n:emoji.tip>'><!shadow><white><arg:emoji></white></!shadow>{text}</hover>"
|
content: "<hover:show_text:'<i18n:emoji.tip>'><!shadow><white><arg:emoji></white></!shadow>${text}</hover>"
|
||||||
|
|
||||||
emoji:
|
emoji:
|
||||||
default:emoji_location:
|
default:emoji_location:
|
||||||
|
|||||||
@@ -229,16 +229,16 @@ items#topaz_gears:
|
|||||||
|
|
||||||
templates:
|
templates:
|
||||||
default:armor/topaz:
|
default:armor/topaz:
|
||||||
material: "chainmail_{part}"
|
material: "chainmail_${part}"
|
||||||
custom-model-data: 1000
|
custom-model-data: 1000
|
||||||
data:
|
data:
|
||||||
item-name: "<!i><#FF8C00><i18n:item.topaz_{part}>"
|
item-name: "<!i><#FF8C00><i18n:item.topaz_${part}>"
|
||||||
tooltip-style: minecraft:topaz
|
tooltip-style: minecraft:topaz
|
||||||
settings:
|
settings:
|
||||||
tags:
|
tags:
|
||||||
- "default:topaz_tools"
|
- "default:topaz_tools"
|
||||||
equippable:
|
equippable:
|
||||||
slot: "{slot}"
|
slot: "${slot}"
|
||||||
asset-id: topaz
|
asset-id: topaz
|
||||||
humanoid: "minecraft:topaz"
|
humanoid: "minecraft:topaz"
|
||||||
humanoid-leggings: "minecraft:topaz"
|
humanoid-leggings: "minecraft:topaz"
|
||||||
@@ -247,111 +247,111 @@ templates:
|
|||||||
property: minecraft:trim_material
|
property: minecraft:trim_material
|
||||||
fallback:
|
fallback:
|
||||||
type: minecraft:model
|
type: minecraft:model
|
||||||
path: "minecraft:item/custom/topaz_{part}"
|
path: "minecraft:item/custom/topaz_${part}"
|
||||||
generation:
|
generation:
|
||||||
parent: "minecraft:item/generated"
|
parent: "minecraft:item/generated"
|
||||||
textures:
|
textures:
|
||||||
"layer0": "minecraft:item/custom/topaz_{part}"
|
"layer0": "minecraft:item/custom/topaz_${part}"
|
||||||
cases:
|
cases:
|
||||||
- when: minecraft:quartz
|
- when: minecraft:quartz
|
||||||
model:
|
model:
|
||||||
type: minecraft:model
|
type: minecraft:model
|
||||||
path: "minecraft:item/custom/topaz_{part}_quartz_trim"
|
path: "minecraft:item/custom/topaz_${part}_quartz_trim"
|
||||||
generation:
|
generation:
|
||||||
parent: "minecraft:item/generated"
|
parent: "minecraft:item/generated"
|
||||||
textures:
|
textures:
|
||||||
"layer0": "minecraft:item/custom/topaz_{part}"
|
"layer0": "minecraft:item/custom/topaz_${part}"
|
||||||
"layer1": "minecraft:trims/items/{part}_trim_quartz"
|
"layer1": "minecraft:trims/items/${part}_trim_quartz"
|
||||||
- when: minecraft:iron
|
- when: minecraft:iron
|
||||||
model:
|
model:
|
||||||
type: minecraft:model
|
type: minecraft:model
|
||||||
path: "minecraft:item/custom/topaz_{part}_iron_trim"
|
path: "minecraft:item/custom/topaz_${part}_iron_trim"
|
||||||
generation:
|
generation:
|
||||||
parent: "minecraft:item/generated"
|
parent: "minecraft:item/generated"
|
||||||
textures:
|
textures:
|
||||||
"layer0": "minecraft:item/custom/topaz_{part}"
|
"layer0": "minecraft:item/custom/topaz_${part}"
|
||||||
"layer1": "minecraft:trims/items/{part}_trim_iron"
|
"layer1": "minecraft:trims/items/${part}_trim_iron"
|
||||||
- when: minecraft:netherite
|
- when: minecraft:netherite
|
||||||
model:
|
model:
|
||||||
type: minecraft:model
|
type: minecraft:model
|
||||||
path: "minecraft:item/custom/topaz_{part}_netherite_trim"
|
path: "minecraft:item/custom/topaz_${part}_netherite_trim"
|
||||||
generation:
|
generation:
|
||||||
parent: "minecraft:item/generated"
|
parent: "minecraft:item/generated"
|
||||||
textures:
|
textures:
|
||||||
"layer0": "minecraft:item/custom/topaz_{part}"
|
"layer0": "minecraft:item/custom/topaz_${part}"
|
||||||
"layer1": "minecraft:trims/items/{part}_trim_netherite"
|
"layer1": "minecraft:trims/items/${part}_trim_netherite"
|
||||||
- when: minecraft:redstone
|
- when: minecraft:redstone
|
||||||
model:
|
model:
|
||||||
type: minecraft:model
|
type: minecraft:model
|
||||||
path: "minecraft:item/custom/topaz_{part}_redstone_trim"
|
path: "minecraft:item/custom/topaz_${part}_redstone_trim"
|
||||||
generation:
|
generation:
|
||||||
parent: "minecraft:item/generated"
|
parent: "minecraft:item/generated"
|
||||||
textures:
|
textures:
|
||||||
"layer0": "minecraft:item/custom/topaz_{part}"
|
"layer0": "minecraft:item/custom/topaz_${part}"
|
||||||
"layer1": "minecraft:trims/items/{part}_trim_redstone"
|
"layer1": "minecraft:trims/items/${part}_trim_redstone"
|
||||||
- when: minecraft:copper
|
- when: minecraft:copper
|
||||||
model:
|
model:
|
||||||
type: minecraft:model
|
type: minecraft:model
|
||||||
path: "minecraft:item/custom/topaz_{part}_copper_trim"
|
path: "minecraft:item/custom/topaz_${part}_copper_trim"
|
||||||
generation:
|
generation:
|
||||||
parent: "minecraft:item/generated"
|
parent: "minecraft:item/generated"
|
||||||
textures:
|
textures:
|
||||||
"layer0": "minecraft:item/custom/topaz_{part}"
|
"layer0": "minecraft:item/custom/topaz_${part}"
|
||||||
"layer1": "minecraft:trims/items/{part}_trim_copper"
|
"layer1": "minecraft:trims/items/${part}_trim_copper"
|
||||||
- when: minecraft:gold
|
- when: minecraft:gold
|
||||||
model:
|
model:
|
||||||
type: minecraft:model
|
type: minecraft:model
|
||||||
path: "minecraft:item/custom/topaz_{part}_gold_trim"
|
path: "minecraft:item/custom/topaz_${part}_gold_trim"
|
||||||
generation:
|
generation:
|
||||||
parent: "minecraft:item/generated"
|
parent: "minecraft:item/generated"
|
||||||
textures:
|
textures:
|
||||||
"layer0": "minecraft:item/custom/topaz_{part}"
|
"layer0": "minecraft:item/custom/topaz_${part}"
|
||||||
"layer1": "minecraft:trims/items/{part}_trim_gold"
|
"layer1": "minecraft:trims/items/${part}_trim_gold"
|
||||||
- when: minecraft:emerald
|
- when: minecraft:emerald
|
||||||
model:
|
model:
|
||||||
type: minecraft:model
|
type: minecraft:model
|
||||||
path: "minecraft:item/custom/topaz_{part}_emerald_trim"
|
path: "minecraft:item/custom/topaz_${part}_emerald_trim"
|
||||||
generation:
|
generation:
|
||||||
parent: "minecraft:item/generated"
|
parent: "minecraft:item/generated"
|
||||||
textures:
|
textures:
|
||||||
"layer0": "minecraft:item/custom/topaz_{part}"
|
"layer0": "minecraft:item/custom/topaz_${part}"
|
||||||
"layer1": "minecraft:trims/items/{part}_trim_emerald"
|
"layer1": "minecraft:trims/items/${part}_trim_emerald"
|
||||||
- when: minecraft:diamond
|
- when: minecraft:diamond
|
||||||
model:
|
model:
|
||||||
type: minecraft:model
|
type: minecraft:model
|
||||||
path: "minecraft:item/custom/topaz_{part}_diamond_trim"
|
path: "minecraft:item/custom/topaz_${part}_diamond_trim"
|
||||||
generation:
|
generation:
|
||||||
parent: "minecraft:item/generated"
|
parent: "minecraft:item/generated"
|
||||||
textures:
|
textures:
|
||||||
"layer0": "minecraft:item/custom/topaz_{part}"
|
"layer0": "minecraft:item/custom/topaz_${part}"
|
||||||
"layer1": "minecraft:trims/items/{part}_trim_diamond"
|
"layer1": "minecraft:trims/items/${part}_trim_diamond"
|
||||||
- when: minecraft:lapis
|
- when: minecraft:lapis
|
||||||
model:
|
model:
|
||||||
type: minecraft:model
|
type: minecraft:model
|
||||||
path: "minecraft:item/custom/topaz_{part}_lapis_trim"
|
path: "minecraft:item/custom/topaz_${part}_lapis_trim"
|
||||||
generation:
|
generation:
|
||||||
parent: "minecraft:item/generated"
|
parent: "minecraft:item/generated"
|
||||||
textures:
|
textures:
|
||||||
"layer0": "minecraft:item/custom/topaz_{part}"
|
"layer0": "minecraft:item/custom/topaz_${part}"
|
||||||
"layer1": "minecraft:trims/items/{part}_trim_lapis"
|
"layer1": "minecraft:trims/items/${part}_trim_lapis"
|
||||||
- when: minecraft:amethyst
|
- when: minecraft:amethyst
|
||||||
model:
|
model:
|
||||||
type: minecraft:model
|
type: minecraft:model
|
||||||
path: "minecraft:item/custom/topaz_{part}_amethyst_trim"
|
path: "minecraft:item/custom/topaz_${part}_amethyst_trim"
|
||||||
generation:
|
generation:
|
||||||
parent: "minecraft:item/generated"
|
parent: "minecraft:item/generated"
|
||||||
textures:
|
textures:
|
||||||
"layer0": "minecraft:item/custom/topaz_{part}"
|
"layer0": "minecraft:item/custom/topaz_${part}"
|
||||||
"layer1": "minecraft:trims/items/{part}_trim_amethyst"
|
"layer1": "minecraft:trims/items/${part}_trim_amethyst"
|
||||||
- when: minecraft:resin
|
- when: minecraft:resin
|
||||||
model:
|
model:
|
||||||
type: minecraft:model
|
type: minecraft:model
|
||||||
path: "minecraft:item/custom/topaz_{part}_resin_trim"
|
path: "minecraft:item/custom/topaz_${part}_resin_trim"
|
||||||
generation:
|
generation:
|
||||||
parent: "minecraft:item/generated"
|
parent: "minecraft:item/generated"
|
||||||
textures:
|
textures:
|
||||||
"layer0": "minecraft:item/custom/topaz_{part}"
|
"layer0": "minecraft:item/custom/topaz_${part}"
|
||||||
"layer1": "minecraft:trims/items/{part}_trim_resin"
|
"layer1": "minecraft:trims/items/${part}_trim_resin"
|
||||||
|
|
||||||
recipes#11:
|
recipes#11:
|
||||||
default:topaz_shovel:
|
default:topaz_shovel:
|
||||||
|
|||||||
@@ -7,32 +7,32 @@ templates#models#block:
|
|||||||
# model: model_path
|
# model: model_path
|
||||||
# texture: texture_path
|
# texture: texture_path
|
||||||
default:model/cube_all:
|
default:model/cube_all:
|
||||||
path: "{model}"
|
path: "${model}"
|
||||||
generation:
|
generation:
|
||||||
parent: "minecraft:block/cube_all"
|
parent: "minecraft:block/cube_all"
|
||||||
textures:
|
textures:
|
||||||
"all": "{texture}"
|
"all": "${texture}"
|
||||||
# template: default:model/simplified_cube_all
|
# template: default:model/simplified_cube_all
|
||||||
# arguments:
|
# arguments:
|
||||||
# path: [model/texture]_path
|
# path: [model/texture]_path
|
||||||
default:model/simplified_cube_all:
|
default:model/simplified_cube_all:
|
||||||
path: "{path}"
|
path: "${path}"
|
||||||
generation:
|
generation:
|
||||||
parent: "minecraft:block/cube_all"
|
parent: "minecraft:block/cube_all"
|
||||||
textures:
|
textures:
|
||||||
"all": "{path}"
|
"all": "${path}"
|
||||||
# template: default:model/cube_column
|
# template: default:model/cube_column
|
||||||
# arguments:
|
# arguments:
|
||||||
# model: model_path
|
# model: model_path
|
||||||
# end_texture: end_texture_path
|
# end_texture: end_texture_path
|
||||||
# side_texture: side_texture_path
|
# side_texture: side_texture_path
|
||||||
default:model/cube_column:
|
default:model/cube_column:
|
||||||
path: "{model}"
|
path: "${model}"
|
||||||
generation:
|
generation:
|
||||||
parent: "minecraft:block/cube_column"
|
parent: "minecraft:block/cube_column"
|
||||||
textures:
|
textures:
|
||||||
"end": "{end_texture}"
|
"end": "${end_texture}"
|
||||||
"side": "{side_texture}"
|
"side": "${side_texture}"
|
||||||
# template: default:model/cube
|
# template: default:model/cube
|
||||||
# arguments:
|
# arguments:
|
||||||
# model: model_path
|
# model: model_path
|
||||||
@@ -44,7 +44,7 @@ templates#models#block:
|
|||||||
# south_texture: south_texture_path
|
# south_texture: south_texture_path
|
||||||
# west_texture: west_texture_path
|
# west_texture: west_texture_path
|
||||||
default:model/cube:
|
default:model/cube:
|
||||||
path: "{model}"
|
path: "${model}"
|
||||||
generation:
|
generation:
|
||||||
parent: "minecraft:block/cube_column"
|
parent: "minecraft:block/cube_column"
|
||||||
textures:
|
textures:
|
||||||
@@ -64,21 +64,21 @@ templates#models#2d:
|
|||||||
# texture: texture_path
|
# texture: texture_path
|
||||||
default:model/generated:
|
default:model/generated:
|
||||||
type: "minecraft:model"
|
type: "minecraft:model"
|
||||||
path: "{model}"
|
path: "${model}"
|
||||||
generation:
|
generation:
|
||||||
parent: "minecraft:item/generated"
|
parent: "minecraft:item/generated"
|
||||||
textures:
|
textures:
|
||||||
"layer0": "{texture}"
|
"layer0": "${texture}"
|
||||||
# template: default:model/simplified_generated
|
# template: default:model/simplified_generated
|
||||||
# arguments:
|
# arguments:
|
||||||
# path: [model/texture]_path
|
# path: [model/texture]_path
|
||||||
default:model/simplified_generated:
|
default:model/simplified_generated:
|
||||||
type: "minecraft:model"
|
type: "minecraft:model"
|
||||||
path: "{path}"
|
path: "${path}"
|
||||||
generation:
|
generation:
|
||||||
parent: "minecraft:item/generated"
|
parent: "minecraft:item/generated"
|
||||||
textures:
|
textures:
|
||||||
"layer0": "{path}"
|
"layer0": "${path}"
|
||||||
# template: default:model/2_layer_generated
|
# template: default:model/2_layer_generated
|
||||||
# arguments:
|
# arguments:
|
||||||
# model: model_path
|
# model: model_path
|
||||||
@@ -86,33 +86,33 @@ templates#models#2d:
|
|||||||
# layer1: texture_path
|
# layer1: texture_path
|
||||||
default:model/2_layer_generated:
|
default:model/2_layer_generated:
|
||||||
type: "minecraft:model"
|
type: "minecraft:model"
|
||||||
path: "{model}"
|
path: "${model}"
|
||||||
generation:
|
generation:
|
||||||
parent: "minecraft:item/generated"
|
parent: "minecraft:item/generated"
|
||||||
textures:
|
textures:
|
||||||
"layer0": "{layer0}"
|
"layer0": "${layer0}"
|
||||||
"layer1": "{layer1}"
|
"layer1": "${layer1}"
|
||||||
# template: default:model/handheld
|
# template: default:model/handheld
|
||||||
# arguments:
|
# arguments:
|
||||||
# model: model_path
|
# model: model_path
|
||||||
# texture: texture_path
|
# texture: texture_path
|
||||||
default:model/handheld:
|
default:model/handheld:
|
||||||
type: "minecraft:model"
|
type: "minecraft:model"
|
||||||
path: "{model}"
|
path: "${model}"
|
||||||
generation:
|
generation:
|
||||||
parent: "minecraft:item/handheld"
|
parent: "minecraft:item/handheld"
|
||||||
textures:
|
textures:
|
||||||
"layer0": "{texture}"
|
"layer0": "${texture}"
|
||||||
# template: default:model/simplified_handheld
|
# template: default:model/simplified_handheld
|
||||||
# arguments:
|
# arguments:
|
||||||
# path: [model/texture]_path
|
# path: [model/texture]_path
|
||||||
default:model/simplified_handheld:
|
default:model/simplified_handheld:
|
||||||
type: "minecraft:model"
|
type: "minecraft:model"
|
||||||
path: "{path}"
|
path: "${path}"
|
||||||
generation:
|
generation:
|
||||||
parent: "minecraft:item/handheld"
|
parent: "minecraft:item/handheld"
|
||||||
textures:
|
textures:
|
||||||
"layer0": "{path}"
|
"layer0": "${path}"
|
||||||
# template: default:model/elytra
|
# template: default:model/elytra
|
||||||
# arguments:
|
# arguments:
|
||||||
# model: model_path
|
# model: model_path
|
||||||
@@ -123,17 +123,17 @@ templates#models#2d:
|
|||||||
type: "minecraft:condition"
|
type: "minecraft:condition"
|
||||||
property: minecraft:broken
|
property: minecraft:broken
|
||||||
on-false:
|
on-false:
|
||||||
path: "{model}"
|
path: "${model}"
|
||||||
generation:
|
generation:
|
||||||
parent: "minecraft:item/generated"
|
parent: "minecraft:item/generated"
|
||||||
textures:
|
textures:
|
||||||
"layer0": "{texture}"
|
"layer0": "${texture}"
|
||||||
on-true:
|
on-true:
|
||||||
path: "{broken_model}"
|
path: "${broken_model}"
|
||||||
generation:
|
generation:
|
||||||
parent: "minecraft:item/generated"
|
parent: "minecraft:item/generated"
|
||||||
textures:
|
textures:
|
||||||
"layer0": "{broken_texture}"
|
"layer0": "${broken_texture}"
|
||||||
# template: default:model/simplified_elytra
|
# template: default:model/simplified_elytra
|
||||||
# arguments:
|
# arguments:
|
||||||
# path: [model/texture]_path
|
# path: [model/texture]_path
|
||||||
@@ -141,10 +141,10 @@ templates#models#2d:
|
|||||||
default:model/simplified_elytra:
|
default:model/simplified_elytra:
|
||||||
template: default:model/elytra
|
template: default:model/elytra
|
||||||
arguments:
|
arguments:
|
||||||
model: "{path}"
|
model: "${path}"
|
||||||
texture: "{path}"
|
texture: "${path}"
|
||||||
broken_model: "{broken_path}"
|
broken_model: "${broken_path}"
|
||||||
broken_texture: "{broken_path}"
|
broken_texture: "${broken_path}"
|
||||||
|
|
||||||
# shield
|
# shield
|
||||||
templates#models#shield:
|
templates#models#shield:
|
||||||
@@ -157,10 +157,10 @@ templates#models#shield:
|
|||||||
property: "minecraft:using_item"
|
property: "minecraft:using_item"
|
||||||
on-false:
|
on-false:
|
||||||
type: minecraft:model
|
type: minecraft:model
|
||||||
path: "{model}"
|
path: "${model}"
|
||||||
on-true:
|
on-true:
|
||||||
type: minecraft:model
|
type: minecraft:model
|
||||||
path: "{block_model}"
|
path: "${block_model}"
|
||||||
|
|
||||||
# fishing rods
|
# fishing rods
|
||||||
templates#models#fishing_rod:
|
templates#models#fishing_rod:
|
||||||
@@ -173,10 +173,10 @@ templates#models#fishing_rod:
|
|||||||
property: "minecraft:fishing_rod/cast"
|
property: "minecraft:fishing_rod/cast"
|
||||||
on-false:
|
on-false:
|
||||||
type: "minecraft:model"
|
type: "minecraft:model"
|
||||||
path: "{model}"
|
path: "${model}"
|
||||||
on-true:
|
on-true:
|
||||||
type: "minecraft:model"
|
type: "minecraft:model"
|
||||||
path: "{cast_model}"
|
path: "${cast_model}"
|
||||||
# template: default:model/fishing_rod_2d
|
# template: default:model/fishing_rod_2d
|
||||||
# arguments:
|
# arguments:
|
||||||
# model: rod_model_path
|
# model: rod_model_path
|
||||||
@@ -188,18 +188,18 @@ templates#models#fishing_rod:
|
|||||||
property: "minecraft:fishing_rod/cast"
|
property: "minecraft:fishing_rod/cast"
|
||||||
on-false:
|
on-false:
|
||||||
type: "minecraft:model"
|
type: "minecraft:model"
|
||||||
path: "{model}"
|
path: "${model}"
|
||||||
generation:
|
generation:
|
||||||
parent: "minecraft:item/fishing_rod"
|
parent: "minecraft:item/fishing_rod"
|
||||||
textures:
|
textures:
|
||||||
"layer0": "{texture}"
|
"layer0": "${texture}"
|
||||||
on-true:
|
on-true:
|
||||||
type: "minecraft:model"
|
type: "minecraft:model"
|
||||||
path: "{cast_model}"
|
path: "${cast_model}"
|
||||||
generation:
|
generation:
|
||||||
parent: "minecraft:item/fishing_rod"
|
parent: "minecraft:item/fishing_rod"
|
||||||
textures:
|
textures:
|
||||||
"layer0": "{cast_texture}"
|
"layer0": "${cast_texture}"
|
||||||
# template: default:model/simplified_fishing_rod_2d
|
# template: default:model/simplified_fishing_rod_2d
|
||||||
# arguments:
|
# arguments:
|
||||||
# path: rod_[model/texture]_path
|
# path: rod_[model/texture]_path
|
||||||
@@ -207,10 +207,10 @@ templates#models#fishing_rod:
|
|||||||
default:model/simplified_fishing_rod_2d:
|
default:model/simplified_fishing_rod_2d:
|
||||||
template: default:model/fishing_rod_2d
|
template: default:model/fishing_rod_2d
|
||||||
arguments:
|
arguments:
|
||||||
texture: "{path}"
|
texture: "${path}"
|
||||||
model: "{path}"
|
model: "${path}"
|
||||||
cast_texture: "{cast_path}"
|
cast_texture: "${cast_path}"
|
||||||
cast_model: "{cast_path}"
|
cast_model: "${cast_path}"
|
||||||
|
|
||||||
# bows
|
# bows
|
||||||
templates#models#bow:
|
templates#models#bow:
|
||||||
@@ -225,7 +225,7 @@ templates#models#bow:
|
|||||||
property: "minecraft:using_item"
|
property: "minecraft:using_item"
|
||||||
on-false:
|
on-false:
|
||||||
type: "minecraft:model"
|
type: "minecraft:model"
|
||||||
path: "{model}"
|
path: "${model}"
|
||||||
on-true:
|
on-true:
|
||||||
type: "minecraft:range_dispatch"
|
type: "minecraft:range_dispatch"
|
||||||
property: "minecraft:use_duration"
|
property: "minecraft:use_duration"
|
||||||
@@ -233,15 +233,15 @@ templates#models#bow:
|
|||||||
entries:
|
entries:
|
||||||
- model:
|
- model:
|
||||||
type: minecraft:model
|
type: minecraft:model
|
||||||
path: "{pulling_1_model}"
|
path: "${pulling_1_model}"
|
||||||
threshold: 0.65
|
threshold: 0.65
|
||||||
- model:
|
- model:
|
||||||
type: minecraft:model
|
type: minecraft:model
|
||||||
path: "{pulling_2_model}"
|
path: "${pulling_2_model}"
|
||||||
threshold: 0.9
|
threshold: 0.9
|
||||||
fallback:
|
fallback:
|
||||||
type: minecraft:model
|
type: minecraft:model
|
||||||
path: "{pulling_0_model}"
|
path: "${pulling_0_model}"
|
||||||
# template: default:model/bow_2d
|
# template: default:model/bow_2d
|
||||||
# arguments:
|
# arguments:
|
||||||
# model: bow_model_path
|
# model: bow_model_path
|
||||||
@@ -257,11 +257,11 @@ templates#models#bow:
|
|||||||
property: "minecraft:using_item"
|
property: "minecraft:using_item"
|
||||||
on-false:
|
on-false:
|
||||||
type: "minecraft:model"
|
type: "minecraft:model"
|
||||||
path: "{model}"
|
path: "${model}"
|
||||||
generation:
|
generation:
|
||||||
parent: "minecraft:item/bow"
|
parent: "minecraft:item/bow"
|
||||||
textures:
|
textures:
|
||||||
"layer0": "{texture}"
|
"layer0": "${texture}"
|
||||||
on-true:
|
on-true:
|
||||||
type: "minecraft:range_dispatch"
|
type: "minecraft:range_dispatch"
|
||||||
property: "minecraft:use_duration"
|
property: "minecraft:use_duration"
|
||||||
@@ -269,27 +269,27 @@ templates#models#bow:
|
|||||||
entries:
|
entries:
|
||||||
- model:
|
- model:
|
||||||
type: minecraft:model
|
type: minecraft:model
|
||||||
path: "{pulling_1_model}"
|
path: "${pulling_1_model}"
|
||||||
generation:
|
generation:
|
||||||
parent: "minecraft:item/bow_pulling_1"
|
parent: "minecraft:item/bow_pulling_1"
|
||||||
textures:
|
textures:
|
||||||
"layer0": "{pulling_1_texture}"
|
"layer0": "${pulling_1_texture}"
|
||||||
threshold: 0.65
|
threshold: 0.65
|
||||||
- model:
|
- model:
|
||||||
type: minecraft:model
|
type: minecraft:model
|
||||||
path: "{pulling_2_model}"
|
path: "${pulling_2_model}"
|
||||||
generation:
|
generation:
|
||||||
parent: "minecraft:item/bow_pulling_2"
|
parent: "minecraft:item/bow_pulling_2"
|
||||||
textures:
|
textures:
|
||||||
"layer0": "{pulling_2_texture}"
|
"layer0": "${pulling_2_texture}"
|
||||||
threshold: 0.9
|
threshold: 0.9
|
||||||
fallback:
|
fallback:
|
||||||
type: minecraft:model
|
type: minecraft:model
|
||||||
path: "{pulling_0_model}"
|
path: "${pulling_0_model}"
|
||||||
generation:
|
generation:
|
||||||
parent: "minecraft:item/bow_pulling_0"
|
parent: "minecraft:item/bow_pulling_0"
|
||||||
textures:
|
textures:
|
||||||
"layer0": "{pulling_0_texture}"
|
"layer0": "${pulling_0_texture}"
|
||||||
# template: default:model/simplified_bow_2d
|
# template: default:model/simplified_bow_2d
|
||||||
# arguments:
|
# arguments:
|
||||||
# path: bow_[model/texture]_path
|
# path: bow_[model/texture]_path
|
||||||
@@ -299,14 +299,14 @@ templates#models#bow:
|
|||||||
default:model/simplified_bow_2d:
|
default:model/simplified_bow_2d:
|
||||||
template: default:model/bow_2d
|
template: default:model/bow_2d
|
||||||
arguments:
|
arguments:
|
||||||
model: "{path}"
|
model: "${path}"
|
||||||
pulling_0_model: "{pulling_0_path}"
|
pulling_0_model: "${pulling_0_path}"
|
||||||
pulling_1_model: "{pulling_1_path}"
|
pulling_1_model: "${pulling_1_path}"
|
||||||
pulling_2_model: "{pulling_2_path}"
|
pulling_2_model: "${pulling_2_path}"
|
||||||
texture: "{path}"
|
texture: "${path}"
|
||||||
pulling_0_texture: "{pulling_0_path}"
|
pulling_0_texture: "${pulling_0_path}"
|
||||||
pulling_1_texture: "{pulling_1_path}"
|
pulling_1_texture: "${pulling_1_path}"
|
||||||
pulling_2_texture: "{pulling_2_path}"
|
pulling_2_texture: "${pulling_2_path}"
|
||||||
|
|
||||||
# crossbows
|
# crossbows
|
||||||
templates#models#crossbow:
|
templates#models#crossbow:
|
||||||
@@ -328,29 +328,29 @@ templates#models#crossbow:
|
|||||||
- when: arrow
|
- when: arrow
|
||||||
model:
|
model:
|
||||||
type: minecraft:model
|
type: minecraft:model
|
||||||
path: "{arrow_model}"
|
path: "${arrow_model}"
|
||||||
- when: rocket
|
- when: rocket
|
||||||
model:
|
model:
|
||||||
type: minecraft:model
|
type: minecraft:model
|
||||||
path: "{firework_model}"
|
path: "${firework_model}"
|
||||||
fallback:
|
fallback:
|
||||||
type: minecraft:model
|
type: minecraft:model
|
||||||
path: "{model}"
|
path: "${model}"
|
||||||
on-true:
|
on-true:
|
||||||
type: "minecraft:range_dispatch"
|
type: "minecraft:range_dispatch"
|
||||||
property: "minecraft:crossbow/pull"
|
property: "minecraft:crossbow/pull"
|
||||||
entries:
|
entries:
|
||||||
- model:
|
- model:
|
||||||
type: minecraft:model
|
type: minecraft:model
|
||||||
path: "{pulling_1_model}"
|
path: "${pulling_1_model}"
|
||||||
threshold: 0.58
|
threshold: 0.58
|
||||||
- model:
|
- model:
|
||||||
type: minecraft:model
|
type: minecraft:model
|
||||||
path: "{pulling_2_model}"
|
path: "${pulling_2_model}"
|
||||||
threshold: 1.0
|
threshold: 1.0
|
||||||
fallback:
|
fallback:
|
||||||
type: minecraft:model
|
type: minecraft:model
|
||||||
path: "{pulling_0_model}"
|
path: "${pulling_0_model}"
|
||||||
# template: default:model/crossbow_2d
|
# template: default:model/crossbow_2d
|
||||||
# arguments:
|
# arguments:
|
||||||
# model: crossbow_model_path
|
# model: crossbow_model_path
|
||||||
@@ -375,53 +375,53 @@ templates#models#crossbow:
|
|||||||
- when: arrow
|
- when: arrow
|
||||||
model:
|
model:
|
||||||
type: minecraft:model
|
type: minecraft:model
|
||||||
path: "{arrow_model}"
|
path: "${arrow_model}"
|
||||||
generation:
|
generation:
|
||||||
parent: "minecraft:item/crossbow_arrow"
|
parent: "minecraft:item/crossbow_arrow"
|
||||||
textures:
|
textures:
|
||||||
"layer0": "{arrow_texture}"
|
"layer0": "${arrow_texture}"
|
||||||
- when: rocket
|
- when: rocket
|
||||||
model:
|
model:
|
||||||
type: minecraft:model
|
type: minecraft:model
|
||||||
path: "{firework_model}"
|
path: "${firework_model}"
|
||||||
generation:
|
generation:
|
||||||
parent: "minecraft:item/crossbow_firework"
|
parent: "minecraft:item/crossbow_firework"
|
||||||
textures:
|
textures:
|
||||||
"layer0": "{firework_texture}"
|
"layer0": "${firework_texture}"
|
||||||
fallback:
|
fallback:
|
||||||
type: minecraft:model
|
type: minecraft:model
|
||||||
path: "{model}"
|
path: "${model}"
|
||||||
generation:
|
generation:
|
||||||
parent: "minecraft:item/crossbow"
|
parent: "minecraft:item/crossbow"
|
||||||
textures:
|
textures:
|
||||||
"layer0": "{texture}"
|
"layer0": "${texture}"
|
||||||
on-true:
|
on-true:
|
||||||
type: "minecraft:range_dispatch"
|
type: "minecraft:range_dispatch"
|
||||||
property: "minecraft:crossbow/pull"
|
property: "minecraft:crossbow/pull"
|
||||||
entries:
|
entries:
|
||||||
- model:
|
- model:
|
||||||
type: minecraft:model
|
type: minecraft:model
|
||||||
path: "{pulling_1_model}"
|
path: "${pulling_1_model}"
|
||||||
generation:
|
generation:
|
||||||
parent: "minecraft:item/crossbow_pulling_1"
|
parent: "minecraft:item/crossbow_pulling_1"
|
||||||
textures:
|
textures:
|
||||||
"layer0": "{pulling_1_texture}"
|
"layer0": "${pulling_1_texture}"
|
||||||
threshold: 0.58
|
threshold: 0.58
|
||||||
- model:
|
- model:
|
||||||
type: minecraft:model
|
type: minecraft:model
|
||||||
path: "{pulling_2_model}"
|
path: "${pulling_2_model}"
|
||||||
generation:
|
generation:
|
||||||
parent: "minecraft:item/crossbow_pulling_2"
|
parent: "minecraft:item/crossbow_pulling_2"
|
||||||
textures:
|
textures:
|
||||||
"layer0": "{pulling_2_texture}"
|
"layer0": "${pulling_2_texture}"
|
||||||
threshold: 1.0
|
threshold: 1.0
|
||||||
fallback:
|
fallback:
|
||||||
type: minecraft:model
|
type: minecraft:model
|
||||||
path: "{pulling_0_model}"
|
path: "${pulling_0_model}"
|
||||||
generation:
|
generation:
|
||||||
parent: "minecraft:item/crossbow_pulling_0"
|
parent: "minecraft:item/crossbow_pulling_0"
|
||||||
textures:
|
textures:
|
||||||
"layer0": "{pulling_0_texture}"
|
"layer0": "${pulling_0_texture}"
|
||||||
# template: default:model/simplified_crossbow_2d
|
# template: default:model/simplified_crossbow_2d
|
||||||
# arguments:
|
# arguments:
|
||||||
# path: crossbow_[model/texture]_path
|
# path: crossbow_[model/texture]_path
|
||||||
@@ -433,28 +433,28 @@ templates#models#crossbow:
|
|||||||
default:model/simplified_crossbow_2d:
|
default:model/simplified_crossbow_2d:
|
||||||
template: default:model/crossbow_2d
|
template: default:model/crossbow_2d
|
||||||
arguments:
|
arguments:
|
||||||
model: "{path}"
|
model: "${path}"
|
||||||
texture: "{path}"
|
texture: "${path}"
|
||||||
arrow_model: "{arrow_path}"
|
arrow_model: "${arrow_path}"
|
||||||
arrow_texture: "{arrow_path}"
|
arrow_texture: "${arrow_path}"
|
||||||
firework_model: "{firework_path}"
|
firework_model: "${firework_path}"
|
||||||
firework_texture: "{firework_path}"
|
firework_texture: "${firework_path}"
|
||||||
pulling_0_model: "{pulling_0_path}"
|
pulling_0_model: "${pulling_0_path}"
|
||||||
pulling_0_texture: "{pulling_0_path}"
|
pulling_0_texture: "${pulling_0_path}"
|
||||||
pulling_1_model: "{pulling_1_path}"
|
pulling_1_model: "${pulling_1_path}"
|
||||||
pulling_1_texture: "{pulling_1_path}"
|
pulling_1_texture: "${pulling_1_path}"
|
||||||
pulling_2_model: "{pulling_2_path}"
|
pulling_2_model: "${pulling_2_path}"
|
||||||
pulling_2_texture: "{pulling_2_path}"
|
pulling_2_texture: "${pulling_2_path}"
|
||||||
|
|
||||||
# sounds
|
# sounds
|
||||||
templates#settings#sounds:
|
templates#settings#sounds:
|
||||||
default:sound/block_template:
|
default:sound/block_template:
|
||||||
sounds:
|
sounds:
|
||||||
break: "minecraft:block.{block_type}.break"
|
break: "minecraft:block.${block_type}.break"
|
||||||
step: "minecraft:block.{block_type}.step"
|
step: "minecraft:block.${block_type}.step"
|
||||||
place: "minecraft:block.{block_type}.place"
|
place: "minecraft:block.${block_type}.place"
|
||||||
hit: "minecraft:block.{block_type}.hit"
|
hit: "minecraft:block.${block_type}.hit"
|
||||||
fall: "minecraft:block.{block_type}.fall"
|
fall: "minecraft:block.${block_type}.fall"
|
||||||
default:sound/crop:
|
default:sound/crop:
|
||||||
sounds:
|
sounds:
|
||||||
break: "minecraft:block.crop.break"
|
break: "minecraft:block.crop.break"
|
||||||
@@ -614,7 +614,7 @@ templates#settings#break_level:
|
|||||||
# block settings
|
# block settings
|
||||||
templates#settings#blocks:
|
templates#settings#blocks:
|
||||||
default:settings/middle_click_pick_itself:
|
default:settings/middle_click_pick_itself:
|
||||||
item: "{__NAMESPACE__}:{__ID__}"
|
item: "${__NAMESPACE__}:${__ID__}"
|
||||||
default:settings/solid_1x1x1:
|
default:settings/solid_1x1x1:
|
||||||
is-suffocating: true
|
is-suffocating: true
|
||||||
replaceable: false
|
replaceable: false
|
||||||
@@ -696,7 +696,7 @@ templates#settings#blocks:
|
|||||||
default:settings/ore:
|
default:settings/ore:
|
||||||
template:
|
template:
|
||||||
- "default:sound/stone"
|
- "default:sound/stone"
|
||||||
- "default:pickaxe_power/level_{break_power}"
|
- "default:pickaxe_power/level_${break_power}"
|
||||||
overrides:
|
overrides:
|
||||||
hardness: 3.0
|
hardness: 3.0
|
||||||
resistance: 3.0
|
resistance: 3.0
|
||||||
@@ -712,7 +712,7 @@ templates#settings#blocks:
|
|||||||
default:settings/deepslate_ore:
|
default:settings/deepslate_ore:
|
||||||
template:
|
template:
|
||||||
- "default:sound/deepslate"
|
- "default:sound/deepslate"
|
||||||
- "default:pickaxe_power/level_{break_power}"
|
- "default:pickaxe_power/level_${break_power}"
|
||||||
overrides:
|
overrides:
|
||||||
hardness: 4.5
|
hardness: 4.5
|
||||||
resistance: 3.0
|
resistance: 3.0
|
||||||
@@ -735,45 +735,45 @@ templates#block_states:
|
|||||||
default: y
|
default: y
|
||||||
appearances:
|
appearances:
|
||||||
axisY:
|
axisY:
|
||||||
state: "{base_block}:{vanilla_id}"
|
state: "${base_block}:${vanilla_id}"
|
||||||
model:
|
model:
|
||||||
path: "{model_vertical_path}"
|
path: "${model_vertical_path}"
|
||||||
generation:
|
generation:
|
||||||
parent: "minecraft:block/cube_column"
|
parent: "minecraft:block/cube_column"
|
||||||
textures:
|
textures:
|
||||||
"end": "{texture_top_path}"
|
"end": "${texture_top_path}"
|
||||||
"side": "{texture_side_path}"
|
"side": "${texture_side_path}"
|
||||||
axisX:
|
axisX:
|
||||||
state: "{base_block}:{vanilla_id}"
|
state: "${base_block}:${vanilla_id}"
|
||||||
model:
|
model:
|
||||||
x: 90
|
x: 90
|
||||||
y: 90
|
y: 90
|
||||||
path: "{model_horizontal_path}"
|
path: "${model_horizontal_path}"
|
||||||
generation:
|
generation:
|
||||||
parent: "minecraft:block/cube_column_horizontal"
|
parent: "minecraft:block/cube_column_horizontal"
|
||||||
textures:
|
textures:
|
||||||
"end": "{texture_top_path}"
|
"end": "${texture_top_path}"
|
||||||
"side": "{texture_side_path}"
|
"side": "${texture_side_path}"
|
||||||
axisZ:
|
axisZ:
|
||||||
state: "{base_block}:{vanilla_id}"
|
state: "${base_block}:${vanilla_id}"
|
||||||
model:
|
model:
|
||||||
x: 90
|
x: 90
|
||||||
path: "{model_horizontal_path}"
|
path: "${model_horizontal_path}"
|
||||||
generation:
|
generation:
|
||||||
parent: "minecraft:block/cube_column_horizontal"
|
parent: "minecraft:block/cube_column_horizontal"
|
||||||
textures:
|
textures:
|
||||||
"end": "{texture_top_path}"
|
"end": "${texture_top_path}"
|
||||||
"side": "{texture_side_path}"
|
"side": "${texture_side_path}"
|
||||||
variants:
|
variants:
|
||||||
axis=x:
|
axis=x:
|
||||||
appearance: axisX
|
appearance: axisX
|
||||||
id: "{internal_id}"
|
id: "${internal_id}"
|
||||||
axis=y:
|
axis=y:
|
||||||
appearance: axisY
|
appearance: axisY
|
||||||
id: "{internal_id}"
|
id: "${internal_id}"
|
||||||
axis=z:
|
axis=z:
|
||||||
appearance: axisZ
|
appearance: axisZ
|
||||||
id: "{internal_id}"
|
id: "${internal_id}"
|
||||||
default:block_state/leaves:
|
default:block_state/leaves:
|
||||||
properties:
|
properties:
|
||||||
waterlogged:
|
waterlogged:
|
||||||
@@ -788,107 +788,107 @@ templates#block_states:
|
|||||||
range: 1~7
|
range: 1~7
|
||||||
appearances:
|
appearances:
|
||||||
default:
|
default:
|
||||||
state: "{default_state}"
|
state: "${default_state}"
|
||||||
model:
|
model:
|
||||||
path: "{model_path}"
|
path: "${model_path}"
|
||||||
generation:
|
generation:
|
||||||
parent: "minecraft:block/leaves"
|
parent: "minecraft:block/leaves"
|
||||||
textures:
|
textures:
|
||||||
"all": "{texture_path}"
|
"all": "${texture_path}"
|
||||||
waterlogged:
|
waterlogged:
|
||||||
state: "{waterlogged_state}"
|
state: "${waterlogged_state}"
|
||||||
model:
|
model:
|
||||||
path: "{model_path}"
|
path: "${model_path}"
|
||||||
variants:
|
variants:
|
||||||
distance=1,persistent=false,waterlogged=false:
|
distance=1,persistent=false,waterlogged=false:
|
||||||
appearance: "default"
|
appearance: "default"
|
||||||
id: "{internal_id}"
|
id: "${internal_id}"
|
||||||
distance=2,persistent=false,waterlogged=false:
|
distance=2,persistent=false,waterlogged=false:
|
||||||
appearance: "default"
|
appearance: "default"
|
||||||
id: "{internal_id}"
|
id: "${internal_id}"
|
||||||
distance=3,persistent=false,waterlogged=false:
|
distance=3,persistent=false,waterlogged=false:
|
||||||
appearance: "default"
|
appearance: "default"
|
||||||
id: "{internal_id}"
|
id: "${internal_id}"
|
||||||
distance=4,persistent=false,waterlogged=false:
|
distance=4,persistent=false,waterlogged=false:
|
||||||
appearance: "default"
|
appearance: "default"
|
||||||
id: "{internal_id}"
|
id: "${internal_id}"
|
||||||
distance=5,persistent=false,waterlogged=false:
|
distance=5,persistent=false,waterlogged=false:
|
||||||
appearance: "default"
|
appearance: "default"
|
||||||
id: "{internal_id}"
|
id: "${internal_id}"
|
||||||
distance=6,persistent=false,waterlogged=false:
|
distance=6,persistent=false,waterlogged=false:
|
||||||
appearance: "default"
|
appearance: "default"
|
||||||
id: "{internal_id}"
|
id: "${internal_id}"
|
||||||
distance=7,persistent=false,waterlogged=false:
|
distance=7,persistent=false,waterlogged=false:
|
||||||
appearance: "default"
|
appearance: "default"
|
||||||
id: "{internal_id}"
|
id: "${internal_id}"
|
||||||
settings:
|
settings:
|
||||||
is-randomly-ticking: true
|
is-randomly-ticking: true
|
||||||
distance=1,persistent=true,waterlogged=false:
|
distance=1,persistent=true,waterlogged=false:
|
||||||
appearance: "default"
|
appearance: "default"
|
||||||
id: "{internal_id}"
|
id: "${internal_id}"
|
||||||
distance=2,persistent=true,waterlogged=false:
|
distance=2,persistent=true,waterlogged=false:
|
||||||
appearance: "default"
|
appearance: "default"
|
||||||
id: "{internal_id}"
|
id: "${internal_id}"
|
||||||
distance=3,persistent=true,waterlogged=false:
|
distance=3,persistent=true,waterlogged=false:
|
||||||
appearance: "default"
|
appearance: "default"
|
||||||
id: "{internal_id}"
|
id: "${internal_id}"
|
||||||
distance=4,persistent=true,waterlogged=false:
|
distance=4,persistent=true,waterlogged=false:
|
||||||
appearance: "default"
|
appearance: "default"
|
||||||
id: "{internal_id}"
|
id: "${internal_id}"
|
||||||
distance=5,persistent=true,waterlogged=false:
|
distance=5,persistent=true,waterlogged=false:
|
||||||
appearance: "default"
|
appearance: "default"
|
||||||
id: "{internal_id}"
|
id: "${internal_id}"
|
||||||
distance=6,persistent=true,waterlogged=false:
|
distance=6,persistent=true,waterlogged=false:
|
||||||
appearance: "default"
|
appearance: "default"
|
||||||
id: "{internal_id}"
|
id: "${internal_id}"
|
||||||
distance=7,persistent=true,waterlogged=false:
|
distance=7,persistent=true,waterlogged=false:
|
||||||
appearance: "default"
|
appearance: "default"
|
||||||
id: "{internal_id}"
|
id: "${internal_id}"
|
||||||
distance=1,persistent=false,waterlogged=true:
|
distance=1,persistent=false,waterlogged=true:
|
||||||
appearance: "waterlogged"
|
appearance: "waterlogged"
|
||||||
id: "{internal_id}"
|
id: "${internal_id}"
|
||||||
settings:
|
settings:
|
||||||
resistance: 1200.0
|
resistance: 1200.0
|
||||||
burnable: false
|
burnable: false
|
||||||
fluid-state: water
|
fluid-state: water
|
||||||
distance=2,persistent=false,waterlogged=true:
|
distance=2,persistent=false,waterlogged=true:
|
||||||
appearance: "waterlogged"
|
appearance: "waterlogged"
|
||||||
id: "{internal_id}"
|
id: "${internal_id}"
|
||||||
settings:
|
settings:
|
||||||
resistance: 1200.0
|
resistance: 1200.0
|
||||||
burnable: false
|
burnable: false
|
||||||
fluid-state: water
|
fluid-state: water
|
||||||
distance=3,persistent=false,waterlogged=true:
|
distance=3,persistent=false,waterlogged=true:
|
||||||
appearance: "waterlogged"
|
appearance: "waterlogged"
|
||||||
id: "{internal_id}"
|
id: "${internal_id}"
|
||||||
settings:
|
settings:
|
||||||
resistance: 1200.0
|
resistance: 1200.0
|
||||||
burnable: false
|
burnable: false
|
||||||
fluid-state: water
|
fluid-state: water
|
||||||
distance=4,persistent=false,waterlogged=true:
|
distance=4,persistent=false,waterlogged=true:
|
||||||
appearance: "waterlogged"
|
appearance: "waterlogged"
|
||||||
id: "{internal_id}"
|
id: "${internal_id}"
|
||||||
settings:
|
settings:
|
||||||
resistance: 1200.0
|
resistance: 1200.0
|
||||||
burnable: false
|
burnable: false
|
||||||
fluid-state: water
|
fluid-state: water
|
||||||
distance=5,persistent=false,waterlogged=true:
|
distance=5,persistent=false,waterlogged=true:
|
||||||
appearance: "waterlogged"
|
appearance: "waterlogged"
|
||||||
id: "{internal_id}"
|
id: "${internal_id}"
|
||||||
settings:
|
settings:
|
||||||
resistance: 1200.0
|
resistance: 1200.0
|
||||||
burnable: false
|
burnable: false
|
||||||
fluid-state: water
|
fluid-state: water
|
||||||
distance=6,persistent=false,waterlogged=true:
|
distance=6,persistent=false,waterlogged=true:
|
||||||
appearance: "waterlogged"
|
appearance: "waterlogged"
|
||||||
id: "{internal_id}"
|
id: "${internal_id}"
|
||||||
settings:
|
settings:
|
||||||
resistance: 1200.0
|
resistance: 1200.0
|
||||||
burnable: false
|
burnable: false
|
||||||
fluid-state: water
|
fluid-state: water
|
||||||
distance=7,persistent=false,waterlogged=true:
|
distance=7,persistent=false,waterlogged=true:
|
||||||
appearance: "waterlogged"
|
appearance: "waterlogged"
|
||||||
id: "{internal_id}"
|
id: "${internal_id}"
|
||||||
settings:
|
settings:
|
||||||
resistance: 1200.0
|
resistance: 1200.0
|
||||||
burnable: false
|
burnable: false
|
||||||
@@ -896,49 +896,49 @@ templates#block_states:
|
|||||||
fluid-state: water
|
fluid-state: water
|
||||||
distance=1,persistent=true,waterlogged=true:
|
distance=1,persistent=true,waterlogged=true:
|
||||||
appearance: "waterlogged"
|
appearance: "waterlogged"
|
||||||
id: "{internal_id}"
|
id: "${internal_id}"
|
||||||
settings:
|
settings:
|
||||||
resistance: 1200.0
|
resistance: 1200.0
|
||||||
burnable: false
|
burnable: false
|
||||||
fluid-state: water
|
fluid-state: water
|
||||||
distance=2,persistent=true,waterlogged=true:
|
distance=2,persistent=true,waterlogged=true:
|
||||||
appearance: "waterlogged"
|
appearance: "waterlogged"
|
||||||
id: "{internal_id}"
|
id: "${internal_id}"
|
||||||
settings:
|
settings:
|
||||||
resistance: 1200.0
|
resistance: 1200.0
|
||||||
burnable: false
|
burnable: false
|
||||||
fluid-state: water
|
fluid-state: water
|
||||||
distance=3,persistent=true,waterlogged=true:
|
distance=3,persistent=true,waterlogged=true:
|
||||||
appearance: "waterlogged"
|
appearance: "waterlogged"
|
||||||
id: "{internal_id}"
|
id: "${internal_id}"
|
||||||
settings:
|
settings:
|
||||||
resistance: 1200.0
|
resistance: 1200.0
|
||||||
burnable: false
|
burnable: false
|
||||||
fluid-state: water
|
fluid-state: water
|
||||||
distance=4,persistent=true,waterlogged=true:
|
distance=4,persistent=true,waterlogged=true:
|
||||||
appearance: "waterlogged"
|
appearance: "waterlogged"
|
||||||
id: "{internal_id}"
|
id: "${internal_id}"
|
||||||
settings:
|
settings:
|
||||||
resistance: 1200.0
|
resistance: 1200.0
|
||||||
burnable: false
|
burnable: false
|
||||||
fluid-state: water
|
fluid-state: water
|
||||||
distance=5,persistent=true,waterlogged=true:
|
distance=5,persistent=true,waterlogged=true:
|
||||||
appearance: "waterlogged"
|
appearance: "waterlogged"
|
||||||
id: "{internal_id}"
|
id: "${internal_id}"
|
||||||
settings:
|
settings:
|
||||||
resistance: 1200.0
|
resistance: 1200.0
|
||||||
burnable: false
|
burnable: false
|
||||||
fluid-state: water
|
fluid-state: water
|
||||||
distance=6,persistent=true,waterlogged=true:
|
distance=6,persistent=true,waterlogged=true:
|
||||||
appearance: "waterlogged"
|
appearance: "waterlogged"
|
||||||
id: "{internal_id}"
|
id: "${internal_id}"
|
||||||
settings:
|
settings:
|
||||||
resistance: 1200.0
|
resistance: 1200.0
|
||||||
burnable: false
|
burnable: false
|
||||||
fluid-state: water
|
fluid-state: water
|
||||||
distance=7,persistent=true,waterlogged=true:
|
distance=7,persistent=true,waterlogged=true:
|
||||||
appearance: "waterlogged"
|
appearance: "waterlogged"
|
||||||
id: "{internal_id}"
|
id: "${internal_id}"
|
||||||
settings:
|
settings:
|
||||||
resistance: 1200.0
|
resistance: 1200.0
|
||||||
burnable: false
|
burnable: false
|
||||||
@@ -951,9 +951,9 @@ templates#recipes:
|
|||||||
category: building
|
category: building
|
||||||
group: planks
|
group: planks
|
||||||
ingredients:
|
ingredients:
|
||||||
A: "#default:{wood_type}_logs"
|
A: "#default:${wood_type}_logs"
|
||||||
result:
|
result:
|
||||||
id: "default:{wood_type}_planks"
|
id: "default:${wood_type}_planks"
|
||||||
count: 4
|
count: 4
|
||||||
default:recipe/log_2_wood:
|
default:recipe/log_2_wood:
|
||||||
type: shaped
|
type: shaped
|
||||||
@@ -963,29 +963,29 @@ templates#recipes:
|
|||||||
- "AA"
|
- "AA"
|
||||||
- "AA"
|
- "AA"
|
||||||
ingredients:
|
ingredients:
|
||||||
A: "default:{wood_type}_log"
|
A: "default:${wood_type}_log"
|
||||||
result:
|
result:
|
||||||
id: "default:{wood_type}_wood"
|
id: "default:${wood_type}_wood"
|
||||||
count: 3
|
count: 3
|
||||||
default:recipe/smelting_ore:
|
default:recipe/smelting_ore:
|
||||||
type: smelting
|
type: smelting
|
||||||
experience: "{exp}"
|
experience: "${exp}"
|
||||||
category: misc
|
category: misc
|
||||||
group: topaz
|
group: topaz
|
||||||
time: 200
|
time: 200
|
||||||
ingredient: "{ingredient}"
|
ingredient: "${ingredient}"
|
||||||
result:
|
result:
|
||||||
id: "{result}"
|
id: "${result}"
|
||||||
count: 1
|
count: 1
|
||||||
default:recipe/blasting_ore:
|
default:recipe/blasting_ore:
|
||||||
type: blasting
|
type: blasting
|
||||||
experience: "{exp}"
|
experience: "${exp}"
|
||||||
category: misc
|
category: misc
|
||||||
group: topaz
|
group: topaz
|
||||||
time: 100
|
time: 100
|
||||||
ingredient: "{ingredient}"
|
ingredient: "${ingredient}"
|
||||||
result:
|
result:
|
||||||
id: "{result}"
|
id: "${result}"
|
||||||
count: 1
|
count: 1
|
||||||
|
|
||||||
# loot tables
|
# loot tables
|
||||||
@@ -1001,7 +1001,7 @@ templates#loot_tables:
|
|||||||
- type: survives_explosion
|
- type: survives_explosion
|
||||||
entries:
|
entries:
|
||||||
- type: item
|
- type: item
|
||||||
item: "{__NAMESPACE__}:{__ID__}"
|
item: "${__NAMESPACE__}:${__ID__}"
|
||||||
|
|
||||||
# drop one item
|
# drop one item
|
||||||
|
|
||||||
@@ -1015,7 +1015,7 @@ templates#loot_tables:
|
|||||||
- type: survives_explosion
|
- type: survives_explosion
|
||||||
entries:
|
entries:
|
||||||
- type: item
|
- type: item
|
||||||
item: "{item}"
|
item: "${item}"
|
||||||
|
|
||||||
# drop the original furniture item or a fallback item
|
# drop the original furniture item or a fallback item
|
||||||
|
|
||||||
@@ -1027,7 +1027,7 @@ templates#loot_tables:
|
|||||||
- rolls: 1
|
- rolls: 1
|
||||||
entries:
|
entries:
|
||||||
- type: furniture_item
|
- type: furniture_item
|
||||||
item: "{item}"
|
item: "${item}"
|
||||||
|
|
||||||
# drop with silk touch
|
# drop with silk touch
|
||||||
|
|
||||||
@@ -1042,7 +1042,7 @@ templates#loot_tables:
|
|||||||
predicate: minecraft:silk_touch>=1
|
predicate: minecraft:silk_touch>=1
|
||||||
entries:
|
entries:
|
||||||
- type: item
|
- type: item
|
||||||
item: "{item}"
|
item: "${item}"
|
||||||
|
|
||||||
# crop drops
|
# crop drops
|
||||||
|
|
||||||
@@ -1058,21 +1058,21 @@ templates#loot_tables:
|
|||||||
- type: alternatives
|
- type: alternatives
|
||||||
children:
|
children:
|
||||||
- type: item
|
- type: item
|
||||||
item: "{crop_item}"
|
item: "${crop_item}"
|
||||||
conditions:
|
conditions:
|
||||||
- type: match_block_property
|
- type: match_block_property
|
||||||
properties:
|
properties:
|
||||||
age: "{ripe_age}"
|
age: "${ripe_age}"
|
||||||
- type: item
|
- type: item
|
||||||
item: "{crop_seed}"
|
item: "${crop_seed}"
|
||||||
- rolls: 1
|
- rolls: 1
|
||||||
conditions:
|
conditions:
|
||||||
- type: match_block_property
|
- type: match_block_property
|
||||||
properties:
|
properties:
|
||||||
age: "{ripe_age}"
|
age: "${ripe_age}"
|
||||||
entries:
|
entries:
|
||||||
- type: item
|
- type: item
|
||||||
item: "{crop_seed}"
|
item: "${crop_seed}"
|
||||||
functions:
|
functions:
|
||||||
- type: apply_bonus
|
- type: apply_bonus
|
||||||
enchantment: minecraft:fortune
|
enchantment: minecraft:fortune
|
||||||
@@ -1090,15 +1090,15 @@ templates#loot_tables:
|
|||||||
- rolls: 1
|
- rolls: 1
|
||||||
entries:
|
entries:
|
||||||
- type: item
|
- type: item
|
||||||
item: "{crop_item}"
|
item: "${crop_item}"
|
||||||
- rolls: 1
|
- rolls: 1
|
||||||
conditions:
|
conditions:
|
||||||
- type: match_block_property
|
- type: match_block_property
|
||||||
properties:
|
properties:
|
||||||
age: "{ripe_age}"
|
age: "${ripe_age}"
|
||||||
entries:
|
entries:
|
||||||
- type: item
|
- type: item
|
||||||
item: "{crop_item}"
|
item: "${crop_item}"
|
||||||
functions:
|
functions:
|
||||||
- type: apply_bonus
|
- type: apply_bonus
|
||||||
enchantment: minecraft:fortune
|
enchantment: minecraft:fortune
|
||||||
@@ -1122,12 +1122,12 @@ templates#loot_tables:
|
|||||||
- type: alternatives
|
- type: alternatives
|
||||||
children:
|
children:
|
||||||
- type: item
|
- type: item
|
||||||
item: "{ore_block}"
|
item: "${ore_block}"
|
||||||
conditions:
|
conditions:
|
||||||
- type: enchantment
|
- type: enchantment
|
||||||
predicate: minecraft:silk_touch>=1
|
predicate: minecraft:silk_touch>=1
|
||||||
- type: item
|
- type: item
|
||||||
item: "{ore_drop}"
|
item: "${ore_drop}"
|
||||||
functions:
|
functions:
|
||||||
- type: apply_bonus
|
- type: apply_bonus
|
||||||
enchantment: minecraft:fortune
|
enchantment: minecraft:fortune
|
||||||
@@ -1137,8 +1137,8 @@ templates#loot_tables:
|
|||||||
- type: drop_exp
|
- type: drop_exp
|
||||||
count:
|
count:
|
||||||
type: uniform
|
type: uniform
|
||||||
min: "{min_exp}"
|
min: "${min_exp:-2}"
|
||||||
max: "{max_exp}"
|
max: "${max_exp:-4}"
|
||||||
|
|
||||||
# template: default:loot_table/ore_no_exp
|
# template: default:loot_table/ore_no_exp
|
||||||
# arguments:
|
# arguments:
|
||||||
@@ -1151,12 +1151,12 @@ templates#loot_tables:
|
|||||||
- type: alternatives
|
- type: alternatives
|
||||||
children:
|
children:
|
||||||
- type: item
|
- type: item
|
||||||
item: "{ore_block}"
|
item: "${ore_block}"
|
||||||
conditions:
|
conditions:
|
||||||
- type: enchantment
|
- type: enchantment
|
||||||
predicate: minecraft:silk_touch>=1
|
predicate: minecraft:silk_touch>=1
|
||||||
- type: item
|
- type: item
|
||||||
item: "{ore_drop}"
|
item: "${ore_drop}"
|
||||||
functions:
|
functions:
|
||||||
- type: apply_bonus
|
- type: apply_bonus
|
||||||
enchantment: minecraft:fortune
|
enchantment: minecraft:fortune
|
||||||
@@ -1177,7 +1177,7 @@ templates#loot_tables:
|
|||||||
- type: alternatives
|
- type: alternatives
|
||||||
children:
|
children:
|
||||||
- type: item
|
- type: item
|
||||||
item: "{leaves}"
|
item: "${leaves}"
|
||||||
conditions:
|
conditions:
|
||||||
- type: any_of
|
- type: any_of
|
||||||
terms:
|
terms:
|
||||||
@@ -1186,7 +1186,7 @@ templates#loot_tables:
|
|||||||
- type: enchantment
|
- type: enchantment
|
||||||
predicate: minecraft:silk_touch>=1
|
predicate: minecraft:silk_touch>=1
|
||||||
- type: item
|
- type: item
|
||||||
item: "{sapling}"
|
item: "${sapling}"
|
||||||
conditions:
|
conditions:
|
||||||
- type: survives_explosion
|
- type: survives_explosion
|
||||||
- type: table_bonus
|
- type: table_bonus
|
||||||
|
|||||||
@@ -69,21 +69,21 @@ images:
|
|||||||
templates:
|
templates:
|
||||||
internal:icon/2d:
|
internal:icon/2d:
|
||||||
material: arrow
|
material: arrow
|
||||||
custom-model-data: "{model_data}"
|
custom-model-data: "${model_data}"
|
||||||
data:
|
data:
|
||||||
item-name: "{name}"
|
item-name: "${name}"
|
||||||
lore: "{lore}"
|
lore: "${lore}"
|
||||||
model:
|
model:
|
||||||
template: "internal:model/simplified_generated"
|
template: "internal:model/simplified_generated"
|
||||||
arguments:
|
arguments:
|
||||||
path: "minecraft:item/custom/gui/{texture}"
|
path: "minecraft:item/custom/gui/${texture}"
|
||||||
internal:model/simplified_generated:
|
internal:model/simplified_generated:
|
||||||
type: "minecraft:model"
|
type: "minecraft:model"
|
||||||
path: "{path}"
|
path: "${path}"
|
||||||
generation:
|
generation:
|
||||||
parent: "minecraft:item/generated"
|
parent: "minecraft:item/generated"
|
||||||
textures:
|
textures:
|
||||||
"layer0": "{path}"
|
"layer0": "${path}"
|
||||||
|
|
||||||
items:
|
items:
|
||||||
internal:next_page_0:
|
internal:next_page_0:
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ public class ItemSettings {
|
|||||||
Helmet helmet = null;
|
Helmet helmet = null;
|
||||||
FoodData foodData = null;
|
FoodData foodData = null;
|
||||||
Key consumeReplacement = null;
|
Key consumeReplacement = null;
|
||||||
|
Key craftRemainder = null;
|
||||||
|
|
||||||
private ItemSettings() {}
|
private ItemSettings() {}
|
||||||
|
|
||||||
@@ -74,6 +75,7 @@ public class ItemSettings {
|
|||||||
newSettings.helmet = settings.helmet;
|
newSettings.helmet = settings.helmet;
|
||||||
newSettings.foodData = settings.foodData;
|
newSettings.foodData = settings.foodData;
|
||||||
newSettings.consumeReplacement = settings.consumeReplacement;
|
newSettings.consumeReplacement = settings.consumeReplacement;
|
||||||
|
newSettings.craftRemainder = settings.craftRemainder;
|
||||||
return newSettings;
|
return newSettings;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -240,7 +242,10 @@ public class ItemSettings {
|
|||||||
int intValue = ResourceConfigUtils.getAsInt(value, "fuel-time");
|
int intValue = ResourceConfigUtils.getAsInt(value, "fuel-time");
|
||||||
return settings -> settings.fuelTime(intValue);
|
return settings -> settings.fuelTime(intValue);
|
||||||
}));
|
}));
|
||||||
registerFactory("consume-replacement", (value -> settings -> settings.consumeReplacement(Key.of(value.toString()))));
|
registerFactory("consume-replacement", (value -> settings -> {
|
||||||
|
if (value == null) settings.consumeReplacement(null);
|
||||||
|
else settings.consumeReplacement(Key.of(value.toString()));
|
||||||
|
}));
|
||||||
registerFactory("tags", (value -> {
|
registerFactory("tags", (value -> {
|
||||||
List<String> tags = MiscUtils.getAsStringList(value);
|
List<String> tags = MiscUtils.getAsStringList(value);
|
||||||
return settings -> settings.tags(tags.stream().map(Key::of).collect(Collectors.toSet()));
|
return settings -> settings.tags(tags.stream().map(Key::of).collect(Collectors.toSet()));
|
||||||
@@ -293,6 +298,9 @@ public class ItemSettings {
|
|||||||
);
|
);
|
||||||
return settings -> settings.foodData(data);
|
return settings -> settings.foodData(data);
|
||||||
}));
|
}));
|
||||||
|
// registerFactory("craft-remainder", (value -> {
|
||||||
|
//
|
||||||
|
// }));
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void registerFactory(String id, ItemSettings.Modifier.Factory factory) {
|
private static void registerFactory(String id, ItemSettings.Modifier.Factory factory) {
|
||||||
|
|||||||
@@ -66,16 +66,17 @@ public interface TemplateManager extends Manageable {
|
|||||||
private final String rawText;
|
private final String rawText;
|
||||||
private final Object defaultValue;
|
private final Object defaultValue;
|
||||||
|
|
||||||
public Placeholder(String placeholder) {
|
public Placeholder(String placeholderContent) {
|
||||||
this.rawText = "{" + placeholder + "}";
|
this.rawText = "${" + placeholderContent + "}";
|
||||||
int first = placeholder.indexOf(':');
|
int separatorIndex = placeholderContent.indexOf(":-");
|
||||||
if (first == -1) {
|
if (separatorIndex == -1) {
|
||||||
this.placeholder = placeholder;
|
this.placeholder = placeholderContent;
|
||||||
this.defaultValue = this.rawText;
|
this.defaultValue = this.rawText;
|
||||||
} else {
|
} else {
|
||||||
this.placeholder = placeholder.substring(0, first);
|
this.placeholder = placeholderContent.substring(0, separatorIndex);
|
||||||
|
String defaultValueString = placeholderContent.substring(separatorIndex + 2);
|
||||||
try {
|
try {
|
||||||
this.defaultValue = CraftEngine.instance().platform().nbt2Java(placeholder.substring(first + 1));
|
this.defaultValue = CraftEngine.instance().platform().nbt2Java(defaultValueString);
|
||||||
} catch (LocalizedResourceConfigException e) {
|
} catch (LocalizedResourceConfigException e) {
|
||||||
e.appendTailArgument(this.placeholder);
|
e.appendTailArgument(this.placeholder);
|
||||||
throw e;
|
throw e;
|
||||||
@@ -220,42 +221,33 @@ public interface TemplateManager extends Manageable {
|
|||||||
while (i < n) {
|
while (i < n) {
|
||||||
char c = input.charAt(i);
|
char c = input.charAt(i);
|
||||||
|
|
||||||
// --- 1. 处理转义字符 ---
|
// --- 1. 优先检测占位符触发器 ---
|
||||||
if (c == '\\') {
|
if (c == '$' && i + 1 < n && input.charAt(i + 1) == '{') {
|
||||||
// 只在'\'后面是'{'或'}'时才作为转义处理
|
|
||||||
if (i + 1 < n && (input.charAt(i + 1) == '{' || input.charAt(i + 1) == '}')) {
|
|
||||||
currentLiteral.append(input.charAt(i + 1)); // 添加花括号
|
|
||||||
i += 2; // 跳过'\'和花括号
|
|
||||||
} else {
|
|
||||||
// 对于所有其他情况 (如 \\, \n), 将'\'视为普通字符
|
|
||||||
currentLiteral.append(c);
|
|
||||||
i++;
|
|
||||||
}
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
// --- 2. 处理占位符 {key} ---
|
// a. 提交之前的普通文本
|
||||||
if (c == '{') {
|
|
||||||
// 如果在占位符之前有普通文本,先提交它
|
|
||||||
if (!currentLiteral.isEmpty()) {
|
if (!currentLiteral.isEmpty()) {
|
||||||
arguments.add(Literal.literal(currentLiteral.toString()));
|
arguments.add(Literal.literal(currentLiteral.toString()));
|
||||||
currentLiteral.setLength(0); // 清空
|
currentLiteral.setLength(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 开始解析占位符内部
|
// b. 解析占位符内部,此处的逻辑拥有自己的转义规则
|
||||||
|
int contentStartIndex = i + 2;
|
||||||
StringBuilder keyBuilder = new StringBuilder();
|
StringBuilder keyBuilder = new StringBuilder();
|
||||||
int depth = 1;
|
int depth = 1;
|
||||||
int j = i + 1;
|
int j = contentStartIndex;
|
||||||
boolean foundMatch = false;
|
boolean foundMatch = false;
|
||||||
|
|
||||||
while (j < n) {
|
while (j < n) {
|
||||||
char innerChar = input.charAt(j);
|
char innerChar = input.charAt(j);
|
||||||
if (innerChar == '\\') { // 处理占位符内部的转义
|
|
||||||
|
// --- 占位符内部的转义逻辑 ---
|
||||||
|
if (innerChar == '\\') {
|
||||||
if (j + 1 < n && (input.charAt(j + 1) == '{' || input.charAt(j + 1) == '}')) {
|
if (j + 1 < n && (input.charAt(j + 1) == '{' || input.charAt(j + 1) == '}')) {
|
||||||
keyBuilder.append(input.charAt(j + 1));
|
keyBuilder.append(input.charAt(j + 1));
|
||||||
j += 2;
|
j += 2;
|
||||||
} else {
|
} else {
|
||||||
keyBuilder.append(innerChar); // 将'\'视为普通字符
|
// 在占位符内部,一个无法识别的转义\依旧被当作普通\处理
|
||||||
|
keyBuilder.append(innerChar);
|
||||||
j++;
|
j++;
|
||||||
}
|
}
|
||||||
} else if (innerChar == '{') {
|
} else if (innerChar == '{') {
|
||||||
@@ -266,11 +258,11 @@ public interface TemplateManager extends Manageable {
|
|||||||
depth--;
|
depth--;
|
||||||
if (depth == 0) { // 找到匹配的闭合括号
|
if (depth == 0) { // 找到匹配的闭合括号
|
||||||
arguments.add(Placeholder.placeholder(keyBuilder.toString()));
|
arguments.add(Placeholder.placeholder(keyBuilder.toString()));
|
||||||
i = j + 1; // 将主循环的索引跳到占位符之后
|
i = j + 1;
|
||||||
foundMatch = true;
|
foundMatch = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
keyBuilder.append(innerChar); // 嵌套的 '}'
|
keyBuilder.append(innerChar);
|
||||||
j++;
|
j++;
|
||||||
} else {
|
} else {
|
||||||
keyBuilder.append(innerChar);
|
keyBuilder.append(innerChar);
|
||||||
@@ -279,27 +271,31 @@ public interface TemplateManager extends Manageable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (foundMatch) {
|
if (foundMatch) {
|
||||||
continue; // 成功解析占位符,继续主循环
|
continue;
|
||||||
} else {
|
} else {
|
||||||
// 没有找到匹配的 '}',将起始的 '{' 视为普通文本
|
// 未找到闭合括号,将 '$' 视为普通字符
|
||||||
currentLiteral.append(c);
|
currentLiteral.append(c);
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
// --- 3. 处理普通字符 ---
|
// --- 2. 其次,只处理对触发器'$'的转义 ---
|
||||||
|
else if (c == '\\' && i + 1 < n && input.charAt(i + 1) == '$') {
|
||||||
|
currentLiteral.append('$'); // 直接添加 '$'
|
||||||
|
i += 2; // 跳过 '\' 和 '$'
|
||||||
|
}
|
||||||
|
// --- 3. 处理所有其他字符(包括独立的'\'和'{')为普通文本 ---
|
||||||
|
else {
|
||||||
currentLiteral.append(c);
|
currentLiteral.append(c);
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 添加循环结束后剩余的任何普通文本
|
|
||||||
if (!currentLiteral.isEmpty()) {
|
if (!currentLiteral.isEmpty()) {
|
||||||
arguments.add(Literal.literal(currentLiteral.toString()));
|
arguments.add(Literal.literal(currentLiteral.toString()));
|
||||||
}
|
}
|
||||||
|
|
||||||
// 根据解析出的参数数量返回最终结果
|
|
||||||
return switch (arguments.size()) {
|
return switch (arguments.size()) {
|
||||||
case 0 -> Literal.literal(""); // 处理 input = "{}" 等情况
|
case 0 -> Literal.literal("");
|
||||||
case 1 -> arguments.getFirst();
|
case 1 -> arguments.getFirst();
|
||||||
case 2 -> new Complex2(input, arguments.get(0), arguments.get(1));
|
case 2 -> new Complex2(input, arguments.get(0), arguments.get(1));
|
||||||
default -> new Complex(input, arguments);
|
default -> new Complex(input, arguments);
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ public abstract class AbstractCommonContext implements Context {
|
|||||||
public TagResolver[] tagResolvers() {
|
public TagResolver[] tagResolvers() {
|
||||||
if (this.tagResolvers == null) {
|
if (this.tagResolvers == null) {
|
||||||
this.tagResolvers = new TagResolver[]{ShiftTag.INSTANCE, ImageTag.INSTANCE, new I18NTag(this), new NamedArgumentTag(this),
|
this.tagResolvers = new TagResolver[]{ShiftTag.INSTANCE, ImageTag.INSTANCE, new I18NTag(this), new NamedArgumentTag(this),
|
||||||
new PlaceholderTag(null), new ExpressionTag(this), new GlobalVariableTag(this)};
|
new PlaceholderTag(this), new ExpressionTag(this), new GlobalVariableTag(this)};
|
||||||
}
|
}
|
||||||
return this.tagResolvers;
|
return this.tagResolvers;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ public class PlayerOptionalContext extends AbstractChainParameterContext impleme
|
|||||||
@NotNull
|
@NotNull
|
||||||
public TagResolver[] tagResolvers() {
|
public TagResolver[] tagResolvers() {
|
||||||
if (this.tagResolvers == null) {
|
if (this.tagResolvers == null) {
|
||||||
this.tagResolvers = new TagResolver[]{ShiftTag.INSTANCE, ImageTag.INSTANCE, new PlaceholderTag(this.player), new I18NTag(this),
|
this.tagResolvers = new TagResolver[]{ShiftTag.INSTANCE, ImageTag.INSTANCE, new PlaceholderTag(this), new I18NTag(this),
|
||||||
new NamedArgumentTag(this), new ExpressionTag(this), new GlobalVariableTag(this)};
|
new NamedArgumentTag(this), new ExpressionTag(this), new GlobalVariableTag(this)};
|
||||||
}
|
}
|
||||||
return this.tagResolvers;
|
return this.tagResolvers;
|
||||||
|
|||||||
@@ -53,19 +53,15 @@ public class ViewerContext implements RelationalContext {
|
|||||||
@Override
|
@Override
|
||||||
public TagResolver[] tagResolvers() {
|
public TagResolver[] tagResolvers() {
|
||||||
if (this.tagResolvers == null) {
|
if (this.tagResolvers == null) {
|
||||||
Player optionalOwner = null;
|
if (this.owner instanceof PlayerOptionalContext context && context.player != null && this.viewer.player != null) {
|
||||||
if (this.owner instanceof PlayerOptionalContext context) {
|
this.tagResolvers = new TagResolver[]{new RelationalPlaceholderTag(context.player, this.viewer.player, this),
|
||||||
optionalOwner = context.player();
|
|
||||||
}
|
|
||||||
if (optionalOwner != null && this.viewer.player != null) {
|
|
||||||
this.tagResolvers = new TagResolver[]{new RelationalPlaceholderTag(optionalOwner, this.viewer.player),
|
|
||||||
ShiftTag.INSTANCE, ImageTag.INSTANCE,
|
ShiftTag.INSTANCE, ImageTag.INSTANCE,
|
||||||
new PlaceholderTag(optionalOwner), new ViewerPlaceholderTag(this.viewer.player()),
|
new PlaceholderTag(this.owner), new ViewerPlaceholderTag(this.viewer),
|
||||||
new NamedArgumentTag(this.owner), new ViewerNamedArgumentTag(this.viewer),
|
new NamedArgumentTag(this.owner), new ViewerNamedArgumentTag(this.viewer),
|
||||||
new I18NTag(this), new ExpressionTag(this), new GlobalVariableTag(this)};
|
new I18NTag(this), new ExpressionTag(this), new GlobalVariableTag(this)};
|
||||||
} else {
|
} else {
|
||||||
this.tagResolvers = new TagResolver[]{ShiftTag.INSTANCE, ImageTag.INSTANCE,
|
this.tagResolvers = new TagResolver[]{ShiftTag.INSTANCE, ImageTag.INSTANCE,
|
||||||
new PlaceholderTag(optionalOwner), new ViewerPlaceholderTag(this.viewer.player()),
|
new PlaceholderTag(this.owner), new ViewerPlaceholderTag(this.viewer),
|
||||||
new NamedArgumentTag(this.owner), new ViewerNamedArgumentTag(this.viewer),
|
new NamedArgumentTag(this.owner), new ViewerNamedArgumentTag(this.viewer),
|
||||||
new I18NTag(this), new ExpressionTag(this), new GlobalVariableTag(this)};
|
new I18NTag(this), new ExpressionTag(this), new GlobalVariableTag(this)};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,17 +5,17 @@ import net.kyori.adventure.text.minimessage.ParsingException;
|
|||||||
import net.kyori.adventure.text.minimessage.tag.Tag;
|
import net.kyori.adventure.text.minimessage.tag.Tag;
|
||||||
import net.kyori.adventure.text.minimessage.tag.resolver.ArgumentQueue;
|
import net.kyori.adventure.text.minimessage.tag.resolver.ArgumentQueue;
|
||||||
import net.kyori.adventure.text.minimessage.tag.resolver.TagResolver;
|
import net.kyori.adventure.text.minimessage.tag.resolver.TagResolver;
|
||||||
import net.momirealms.craftengine.core.entity.player.Player;
|
|
||||||
import net.momirealms.craftengine.core.plugin.CraftEngine;
|
import net.momirealms.craftengine.core.plugin.CraftEngine;
|
||||||
|
import net.momirealms.craftengine.core.plugin.context.PlayerOptionalContext;
|
||||||
import net.momirealms.craftengine.core.util.AdventureHelper;
|
import net.momirealms.craftengine.core.util.AdventureHelper;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
public class PlaceholderTag implements TagResolver {
|
public class PlaceholderTag implements TagResolver {
|
||||||
private final Player player;
|
private final net.momirealms.craftengine.core.plugin.context.Context context;
|
||||||
|
|
||||||
public PlaceholderTag(@Nullable Player player) {
|
public PlaceholderTag(@NotNull net.momirealms.craftengine.core.plugin.context.Context context) {
|
||||||
this.player = player;
|
this.context = context;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -23,8 +23,10 @@ public class PlaceholderTag implements TagResolver {
|
|||||||
if (!this.has(name) || !CraftEngine.instance().compatibilityManager().hasPlaceholderAPI()) {
|
if (!this.has(name) || !CraftEngine.instance().compatibilityManager().hasPlaceholderAPI()) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
String placeholder = "%" + arguments.popOr("No argument placeholder provided") + "%";
|
String rawArgument = arguments.popOr("No argument relational placeholder provided").toString();
|
||||||
String parsed = CraftEngine.instance().compatibilityManager().parse(player, placeholder);
|
if (rawArgument.contains("<")) rawArgument = AdventureHelper.resolvePlainStringTags(rawArgument, this.context.tagResolvers());
|
||||||
|
String placeholder = "%" + rawArgument + "%";
|
||||||
|
String parsed = this.context instanceof PlayerOptionalContext playerOptionalContext ? CraftEngine.instance().compatibilityManager().parse(playerOptionalContext.player(), placeholder) : CraftEngine.instance().compatibilityManager().parse(null, placeholder);
|
||||||
if (parsed.equals(placeholder)) {
|
if (parsed.equals(placeholder)) {
|
||||||
parsed = arguments.popOr("No default papi value provided").toString();
|
parsed = arguments.popOr("No default papi value provided").toString();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,8 @@ import net.kyori.adventure.text.minimessage.tag.resolver.ArgumentQueue;
|
|||||||
import net.kyori.adventure.text.minimessage.tag.resolver.TagResolver;
|
import net.kyori.adventure.text.minimessage.tag.resolver.TagResolver;
|
||||||
import net.momirealms.craftengine.core.entity.player.Player;
|
import net.momirealms.craftengine.core.entity.player.Player;
|
||||||
import net.momirealms.craftengine.core.plugin.CraftEngine;
|
import net.momirealms.craftengine.core.plugin.CraftEngine;
|
||||||
|
import net.momirealms.craftengine.core.plugin.context.PlayerOptionalContext;
|
||||||
|
import net.momirealms.craftengine.core.plugin.context.RelationalContext;
|
||||||
import net.momirealms.craftengine.core.util.AdventureHelper;
|
import net.momirealms.craftengine.core.util.AdventureHelper;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
@@ -14,10 +16,12 @@ import org.jetbrains.annotations.Nullable;
|
|||||||
public class RelationalPlaceholderTag implements TagResolver {
|
public class RelationalPlaceholderTag implements TagResolver {
|
||||||
private final Player player1;
|
private final Player player1;
|
||||||
private final Player player2;
|
private final Player player2;
|
||||||
|
private final RelationalContext context;
|
||||||
|
|
||||||
public RelationalPlaceholderTag(@NotNull Player player1, @NotNull Player player2) {
|
public RelationalPlaceholderTag(@NotNull Player player1, @NotNull Player player2, RelationalContext context) {
|
||||||
this.player1 = player1;
|
this.player1 = player1;
|
||||||
this.player2 = player2;
|
this.player2 = player2;
|
||||||
|
this.context = context;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -25,8 +29,10 @@ public class RelationalPlaceholderTag implements TagResolver {
|
|||||||
if (!this.has(name) || !CraftEngine.instance().compatibilityManager().hasPlaceholderAPI()) {
|
if (!this.has(name) || !CraftEngine.instance().compatibilityManager().hasPlaceholderAPI()) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
String placeholder = "%" + arguments.popOr("No argument placeholder provided") + "%";
|
String rawArgument = arguments.popOr("No argument placeholder provided").toString();
|
||||||
String parsed = CraftEngine.instance().compatibilityManager().parse(player1, player2, placeholder);
|
if (rawArgument.contains("<")) rawArgument = AdventureHelper.resolvePlainStringTags(rawArgument, this.context.tagResolvers());
|
||||||
|
String placeholder = "%" + rawArgument + "%";
|
||||||
|
String parsed = CraftEngine.instance().compatibilityManager().parse(this.player1, this.player2, placeholder);
|
||||||
if (parsed.equals(placeholder)) {
|
if (parsed.equals(placeholder)) {
|
||||||
parsed = arguments.popOr("No default papi value provided").toString();
|
parsed = arguments.popOr("No default papi value provided").toString();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,11 @@
|
|||||||
package net.momirealms.craftengine.core.plugin.text.minimessage;
|
package net.momirealms.craftengine.core.plugin.text.minimessage;
|
||||||
|
|
||||||
import net.momirealms.craftengine.core.entity.player.Player;
|
import net.momirealms.craftengine.core.plugin.context.Context;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
|
||||||
|
|
||||||
public class ViewerPlaceholderTag extends PlaceholderTag {
|
public class ViewerPlaceholderTag extends PlaceholderTag {
|
||||||
|
|
||||||
public ViewerPlaceholderTag(@Nullable Player player) {
|
public ViewerPlaceholderTag(@NotNull Context player) {
|
||||||
super(player);
|
super(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -316,6 +316,11 @@ public class AdventureHelper {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static String resolvePlainStringTags(String raw, TagResolver... resolvers) {
|
||||||
|
Component resultComponent = AdventureHelper.customMiniMessage().deserialize(raw, resolvers);
|
||||||
|
return AdventureHelper.plainTextContent(resultComponent);
|
||||||
|
}
|
||||||
|
|
||||||
public static Component replaceText(Component text, Map<String, Component> replacements) {
|
public static Component replaceText(Component text, Map<String, Component> replacements) {
|
||||||
String patternString = replacements.keySet().stream()
|
String patternString = replacements.keySet().stream()
|
||||||
.map(Pattern::quote)
|
.map(Pattern::quote)
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ public class MiscUtils {
|
|||||||
public static void deepMergeMaps(Map<String, Object> baseMap, Map<String, Object> mapToMerge) {
|
public static void deepMergeMaps(Map<String, Object> baseMap, Map<String, Object> mapToMerge) {
|
||||||
for (Map.Entry<String, Object> entry : mapToMerge.entrySet()) {
|
for (Map.Entry<String, Object> entry : mapToMerge.entrySet()) {
|
||||||
String key = entry.getKey();
|
String key = entry.getKey();
|
||||||
if (!key.isEmpty() && key.charAt(0) == '$') {
|
if (key.length() > 2 && key.charAt(0) == '$' && key.charAt(1) == '$') {
|
||||||
Object value = entry.getValue();
|
Object value = entry.getValue();
|
||||||
baseMap.put(key.substring(1), value);
|
baseMap.put(key.substring(1), value);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ org.gradle.jvmargs=-Xmx1G
|
|||||||
|
|
||||||
# Project settings
|
# Project settings
|
||||||
# Rule: [major update].[feature update].[bug fix]
|
# Rule: [major update].[feature update].[bug fix]
|
||||||
project_version=0.0.56.5
|
project_version=0.0.56.6
|
||||||
config_version=36
|
config_version=36
|
||||||
lang_version=15
|
lang_version=15
|
||||||
project_group=net.momirealms
|
project_group=net.momirealms
|
||||||
@@ -51,7 +51,7 @@ byte_buddy_version=1.17.5
|
|||||||
ahocorasick_version=0.6.3
|
ahocorasick_version=0.6.3
|
||||||
snake_yaml_version=2.4
|
snake_yaml_version=2.4
|
||||||
anti_grief_version=0.17
|
anti_grief_version=0.17
|
||||||
nms_helper_version=0.67.3
|
nms_helper_version=0.67.7
|
||||||
evalex_version=3.5.0
|
evalex_version=3.5.0
|
||||||
reactive_streams_version=1.0.4
|
reactive_streams_version=1.0.4
|
||||||
amazon_awssdk_version=2.31.23
|
amazon_awssdk_version=2.31.23
|
||||||
|
|||||||
Reference in New Issue
Block a user