mirror of
https://github.com/Xiao-MoMi/craft-engine.git
synced 2025-12-19 15:09:15 +00:00
添加shadow-radius和strength
This commit is contained in:
@@ -29,18 +29,18 @@ subprojects {
|
|||||||
|
|
||||||
filesMatching(arrayListOf("commands.yml", "config.yml")) {
|
filesMatching(arrayListOf("commands.yml", "config.yml")) {
|
||||||
expand(
|
expand(
|
||||||
Pair("project_version", rootProject.properties["project_version"]),
|
Pair("project_version", rootProject.properties["project_version"]!!),
|
||||||
Pair("config_version", rootProject.properties["config_version"]),
|
Pair("config_version", rootProject.properties["config_version"]!!),
|
||||||
Pair("lang_version", rootProject.properties["lang_version"])
|
Pair("lang_version", rootProject.properties["lang_version"]!!)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun versionBanner() = project.providers.exec {
|
fun versionBanner(): String = project.providers.exec {
|
||||||
commandLine("git", "rev-parse", "--short=8", "HEAD")
|
commandLine("git", "rev-parse", "--short=8", "HEAD")
|
||||||
}.standardOutput.asText.map { it.trim() }.getOrElse("Unknown")
|
}.standardOutput.asText.map { it.trim() }.getOrElse("Unknown")
|
||||||
|
|
||||||
fun builder() = project.providers.exec {
|
fun builder(): String = project.providers.exec {
|
||||||
commandLine("git", "config", "user.name")
|
commandLine("git", "config", "user.name")
|
||||||
}.standardOutput.asText.map { it.trim() }.getOrElse("Unknown")
|
}.standardOutput.asText.map { it.trim() }.getOrElse("Unknown")
|
||||||
@@ -80,7 +80,7 @@ tasks.withType<JavaCompile> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
artifacts {
|
artifacts {
|
||||||
archives(tasks.shadowJar)
|
implementation(tasks.shadowJar)
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks {
|
tasks {
|
||||||
|
|||||||
@@ -29,5 +29,5 @@ tasks.withType<JavaCompile> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
artifacts {
|
artifacts {
|
||||||
archives(tasks.shadowJar)
|
implementation(tasks.shadowJar)
|
||||||
}
|
}
|
||||||
@@ -56,7 +56,7 @@ bukkit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
artifacts {
|
artifacts {
|
||||||
archives(tasks.shadowJar)
|
implementation(tasks.shadowJar)
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks {
|
tasks {
|
||||||
|
|||||||
@@ -130,7 +130,7 @@ paper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
artifacts {
|
artifacts {
|
||||||
archives(tasks.shadowJar)
|
implementation(tasks.shadowJar)
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks {
|
tasks {
|
||||||
|
|||||||
@@ -34,6 +34,8 @@ public class ItemDisplayBlockEntityElementConfig implements BlockEntityElementCo
|
|||||||
private final Quaternionf rotation;
|
private final Quaternionf rotation;
|
||||||
private final ItemDisplayContext displayContext;
|
private final ItemDisplayContext displayContext;
|
||||||
private final Billboard billboard;
|
private final Billboard billboard;
|
||||||
|
private final float shadowRadius;
|
||||||
|
private final float shadowStrength;
|
||||||
|
|
||||||
public ItemDisplayBlockEntityElementConfig(Function<Player, Item<?>> item,
|
public ItemDisplayBlockEntityElementConfig(Function<Player, Item<?>> item,
|
||||||
Vector3f scale,
|
Vector3f scale,
|
||||||
@@ -43,7 +45,9 @@ public class ItemDisplayBlockEntityElementConfig implements BlockEntityElementCo
|
|||||||
float yRot,
|
float yRot,
|
||||||
Quaternionf rotation,
|
Quaternionf rotation,
|
||||||
ItemDisplayContext displayContext,
|
ItemDisplayContext displayContext,
|
||||||
Billboard billboard) {
|
Billboard billboard,
|
||||||
|
float shadowRadius,
|
||||||
|
float shadowStrength) {
|
||||||
this.item = item;
|
this.item = item;
|
||||||
this.scale = scale;
|
this.scale = scale;
|
||||||
this.position = position;
|
this.position = position;
|
||||||
@@ -53,6 +57,8 @@ public class ItemDisplayBlockEntityElementConfig implements BlockEntityElementCo
|
|||||||
this.rotation = rotation;
|
this.rotation = rotation;
|
||||||
this.displayContext = displayContext;
|
this.displayContext = displayContext;
|
||||||
this.billboard = billboard;
|
this.billboard = billboard;
|
||||||
|
this.shadowRadius = shadowRadius;
|
||||||
|
this.shadowStrength = shadowStrength;
|
||||||
this.lazyMetadataPacket = player -> {
|
this.lazyMetadataPacket = player -> {
|
||||||
List<Object> dataValues = new ArrayList<>();
|
List<Object> dataValues = new ArrayList<>();
|
||||||
ItemDisplayEntityData.DisplayedItem.addEntityDataIfNotDefaultValue(item.apply(player).getLiteralObject(), dataValues);
|
ItemDisplayEntityData.DisplayedItem.addEntityDataIfNotDefaultValue(item.apply(player).getLiteralObject(), dataValues);
|
||||||
@@ -61,6 +67,8 @@ public class ItemDisplayBlockEntityElementConfig implements BlockEntityElementCo
|
|||||||
ItemDisplayEntityData.BillboardConstraints.addEntityDataIfNotDefaultValue(this.billboard.id(), dataValues);
|
ItemDisplayEntityData.BillboardConstraints.addEntityDataIfNotDefaultValue(this.billboard.id(), dataValues);
|
||||||
ItemDisplayEntityData.Translation.addEntityDataIfNotDefaultValue(this.translation, dataValues);
|
ItemDisplayEntityData.Translation.addEntityDataIfNotDefaultValue(this.translation, dataValues);
|
||||||
ItemDisplayEntityData.DisplayType.addEntityDataIfNotDefaultValue(this.displayContext.id(), dataValues);
|
ItemDisplayEntityData.DisplayType.addEntityDataIfNotDefaultValue(this.displayContext.id(), dataValues);
|
||||||
|
ItemDisplayEntityData.ShadowRadius.addEntityDataIfNotDefaultValue(this.shadowRadius, dataValues);
|
||||||
|
ItemDisplayEntityData.ShadowStrength.addEntityDataIfNotDefaultValue(this.shadowStrength, dataValues);
|
||||||
return dataValues;
|
return dataValues;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -106,6 +114,14 @@ public class ItemDisplayBlockEntityElementConfig implements BlockEntityElementCo
|
|||||||
return rotation;
|
return rotation;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public float shadowRadius() {
|
||||||
|
return shadowRadius;
|
||||||
|
}
|
||||||
|
|
||||||
|
public float shadowStrength() {
|
||||||
|
return shadowStrength;
|
||||||
|
}
|
||||||
|
|
||||||
public List<Object> metadataValues(Player player) {
|
public List<Object> metadataValues(Player player) {
|
||||||
return this.lazyMetadataPacket.apply(player);
|
return this.lazyMetadataPacket.apply(player);
|
||||||
}
|
}
|
||||||
@@ -125,7 +141,9 @@ public class ItemDisplayBlockEntityElementConfig implements BlockEntityElementCo
|
|||||||
ResourceConfigUtils.getAsFloat(arguments.getOrDefault("yaw", 0f), "yaw"),
|
ResourceConfigUtils.getAsFloat(arguments.getOrDefault("yaw", 0f), "yaw"),
|
||||||
ResourceConfigUtils.getAsQuaternionf(arguments.getOrDefault("rotation", 0f), "rotation"),
|
ResourceConfigUtils.getAsQuaternionf(arguments.getOrDefault("rotation", 0f), "rotation"),
|
||||||
ItemDisplayContext.valueOf(arguments.getOrDefault("display-context", "none").toString().toUpperCase(Locale.ROOT)),
|
ItemDisplayContext.valueOf(arguments.getOrDefault("display-context", "none").toString().toUpperCase(Locale.ROOT)),
|
||||||
Billboard.valueOf(arguments.getOrDefault("billboard", "fixed").toString().toUpperCase(Locale.ROOT))
|
Billboard.valueOf(arguments.getOrDefault("billboard", "fixed").toString().toUpperCase(Locale.ROOT)),
|
||||||
|
ResourceConfigUtils.getAsFloat(arguments.getOrDefault("shadow-radius", 0f), "shadow-radius"),
|
||||||
|
ResourceConfigUtils.getAsFloat(arguments.getOrDefault("shadow-strength", 1f), "shadow-strength")
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,14 +38,18 @@ public class BukkitFurnitureElement extends AbstractFurnitureElement {
|
|||||||
Vector3f translation,
|
Vector3f translation,
|
||||||
Vector3f position,
|
Vector3f position,
|
||||||
Quaternionf rotation,
|
Quaternionf rotation,
|
||||||
|
float shadowRadius,
|
||||||
|
float shadowStrength,
|
||||||
boolean applyDyedColor) {
|
boolean applyDyedColor) {
|
||||||
super(item, billboard, transform, scale, translation, position, rotation, applyDyedColor);
|
super(item, billboard, transform, scale, translation, position, rotation, shadowRadius, shadowStrength, applyDyedColor);
|
||||||
this.commonValues = new ArrayList<>();
|
this.commonValues = new ArrayList<>();
|
||||||
ItemDisplayEntityData.Scale.addEntityDataIfNotDefaultValue(scale(), this.commonValues);
|
ItemDisplayEntityData.Scale.addEntityDataIfNotDefaultValue(scale(), this.commonValues);
|
||||||
ItemDisplayEntityData.RotationLeft.addEntityDataIfNotDefaultValue(rotation(), this.commonValues);
|
ItemDisplayEntityData.RotationLeft.addEntityDataIfNotDefaultValue(rotation(), this.commonValues);
|
||||||
ItemDisplayEntityData.BillboardConstraints.addEntityDataIfNotDefaultValue(billboard().id(), this.commonValues);
|
ItemDisplayEntityData.BillboardConstraints.addEntityDataIfNotDefaultValue(billboard().id(), this.commonValues);
|
||||||
ItemDisplayEntityData.Translation.addEntityDataIfNotDefaultValue(translation(), this.commonValues);
|
ItemDisplayEntityData.Translation.addEntityDataIfNotDefaultValue(translation(), this.commonValues);
|
||||||
ItemDisplayEntityData.DisplayType.addEntityDataIfNotDefaultValue(transform().id(), this.commonValues);
|
ItemDisplayEntityData.DisplayType.addEntityDataIfNotDefaultValue(transform().id(), this.commonValues);
|
||||||
|
ItemDisplayEntityData.ShadowRadius.addEntityDataIfNotDefaultValue(shadowRadius, this.commonValues);
|
||||||
|
ItemDisplayEntityData.ShadowStrength.addEntityDataIfNotDefaultValue(shadowStrength, this.commonValues);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -102,6 +106,8 @@ public class BukkitFurnitureElement extends AbstractFurnitureElement {
|
|||||||
private Vector3f translation;
|
private Vector3f translation;
|
||||||
private Vector3f position;
|
private Vector3f position;
|
||||||
private Quaternionf rotation;
|
private Quaternionf rotation;
|
||||||
|
private float shadowRadius;
|
||||||
|
private float shadowStrength;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Builder applyDyedColor(boolean applyDyedColor) {
|
public Builder applyDyedColor(boolean applyDyedColor) {
|
||||||
@@ -151,9 +157,21 @@ public class BukkitFurnitureElement extends AbstractFurnitureElement {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Builder shadowStrength(float shadowStrength) {
|
||||||
|
this.shadowStrength = shadowStrength;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Builder shadowRadius(float shadowRadius) {
|
||||||
|
this.shadowRadius = shadowRadius;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public FurnitureElement build() {
|
public FurnitureElement build() {
|
||||||
return new BukkitFurnitureElement(item, billboard, transform, scale, translation, position, rotation, applyDyedColor);
|
return new BukkitFurnitureElement(item, billboard, transform, scale, translation, position, rotation, shadowRadius, shadowStrength, applyDyedColor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,11 +26,7 @@ public class BukkitCommandManager extends AbstractCommandManager<CommandSender>
|
|||||||
plugin.javaPlugin(),
|
plugin.javaPlugin(),
|
||||||
ExecutionCoordinator.simpleCoordinator(),
|
ExecutionCoordinator.simpleCoordinator(),
|
||||||
SenderMapper.identity()
|
SenderMapper.identity()
|
||||||
) {{ // TODO:等 cloud 修复后移除,绕过 obc.command.BukkitCommandWrapper 类检查,因为这个类在 1.21.9 版本被移除了,并且项目貌似没用到这个
|
));
|
||||||
if (VersionHelper.isOrAbove1_21_9() && ReflectionUtils.classExists("com.mojang.brigadier.tree.CommandNode")) {
|
|
||||||
registerCapability(CloudBukkitCapabilities.BRIGADIER);
|
|
||||||
}
|
|
||||||
}});
|
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
this.index = Index.create(CommandFeature::getFeatureID, List.of(
|
this.index = Index.create(CommandFeature::getFeatureID, List.of(
|
||||||
new ReloadCommand(this, plugin),
|
new ReloadCommand(this, plugin),
|
||||||
|
|||||||
@@ -26,6 +26,8 @@ items:
|
|||||||
billboard: FIXED
|
billboard: FIXED
|
||||||
position: 0.5,0,0
|
position: 0.5,0,0
|
||||||
translation: 0,0.5,0
|
translation: 0,0.5,0
|
||||||
|
shadow-radius: 1
|
||||||
|
shadow-strength: 0.2
|
||||||
hitboxes:
|
hitboxes:
|
||||||
- position: 0,0,0
|
- position: 0,0,0
|
||||||
type: shulker
|
type: shulker
|
||||||
|
|||||||
@@ -47,6 +47,8 @@ furniture:
|
|||||||
billboard: FIXED
|
billboard: FIXED
|
||||||
position: 0,0,0
|
position: 0,0,0
|
||||||
translation: 0,0.5,0
|
translation: 0,0.5,0
|
||||||
|
shadow-radius: 0.5
|
||||||
|
shadow-strength: 0.5
|
||||||
hitboxes:
|
hitboxes:
|
||||||
- type: interaction
|
- type: interaction
|
||||||
can-use-item-on: true
|
can-use-item-on: true
|
||||||
|
|||||||
@@ -23,6 +23,8 @@ items:
|
|||||||
elements:
|
elements:
|
||||||
- item: default:wooden_chair
|
- item: default:wooden_chair
|
||||||
display-transform: NONE
|
display-transform: NONE
|
||||||
|
shadow-radius: 0.4
|
||||||
|
shadow-strength: 0.5
|
||||||
billboard: FIXED
|
billboard: FIXED
|
||||||
translation: 0,0.5,0
|
translation: 0,0.5,0
|
||||||
hitboxes:
|
hitboxes:
|
||||||
|
|||||||
@@ -15,6 +15,8 @@ public abstract class AbstractFurnitureElement implements FurnitureElement {
|
|||||||
private final Vector3f position;
|
private final Vector3f position;
|
||||||
private final Quaternionf rotation;
|
private final Quaternionf rotation;
|
||||||
private final boolean applyDyedColor;
|
private final boolean applyDyedColor;
|
||||||
|
private final float shadowRadius;
|
||||||
|
private final float shadowStrength;
|
||||||
|
|
||||||
public AbstractFurnitureElement(Key item,
|
public AbstractFurnitureElement(Key item,
|
||||||
Billboard billboard,
|
Billboard billboard,
|
||||||
@@ -23,6 +25,8 @@ public abstract class AbstractFurnitureElement implements FurnitureElement {
|
|||||||
Vector3f translation,
|
Vector3f translation,
|
||||||
Vector3f position,
|
Vector3f position,
|
||||||
Quaternionf rotation,
|
Quaternionf rotation,
|
||||||
|
float shadowRadius,
|
||||||
|
float shadowStrength,
|
||||||
boolean applyDyedColor) {
|
boolean applyDyedColor) {
|
||||||
this.billboard = billboard;
|
this.billboard = billboard;
|
||||||
this.transform = transform;
|
this.transform = transform;
|
||||||
@@ -32,6 +36,18 @@ public abstract class AbstractFurnitureElement implements FurnitureElement {
|
|||||||
this.rotation = rotation;
|
this.rotation = rotation;
|
||||||
this.position = position;
|
this.position = position;
|
||||||
this.applyDyedColor = applyDyedColor;
|
this.applyDyedColor = applyDyedColor;
|
||||||
|
this.shadowRadius = shadowRadius;
|
||||||
|
this.shadowStrength = shadowStrength;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public float shadowRadius() {
|
||||||
|
return shadowRadius;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public float shadowStrength() {
|
||||||
|
return shadowStrength;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -137,6 +137,8 @@ public abstract class AbstractFurnitureManager implements FurnitureManager {
|
|||||||
.position(ResourceConfigUtils.getAsVector3f(element.getOrDefault("position", "0"), "position"))
|
.position(ResourceConfigUtils.getAsVector3f(element.getOrDefault("position", "0"), "position"))
|
||||||
.translation(ResourceConfigUtils.getAsVector3f(element.getOrDefault("translation", "0"), "translation"))
|
.translation(ResourceConfigUtils.getAsVector3f(element.getOrDefault("translation", "0"), "translation"))
|
||||||
.rotation(ResourceConfigUtils.getAsQuaternionf(element.getOrDefault("rotation", "0"), "rotation"))
|
.rotation(ResourceConfigUtils.getAsQuaternionf(element.getOrDefault("rotation", "0"), "rotation"))
|
||||||
|
.shadowRadius(ResourceConfigUtils.getAsFloat(element.getOrDefault("shadow-radius", 0f), "shadow-radius"))
|
||||||
|
.shadowStrength(ResourceConfigUtils.getAsFloat(element.getOrDefault("shadow-strength", 1f), "shadow-strength"))
|
||||||
.build();
|
.build();
|
||||||
elements.add(furnitureElement);
|
elements.add(furnitureElement);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,10 @@ public interface FurnitureElement {
|
|||||||
|
|
||||||
ItemDisplayContext transform();
|
ItemDisplayContext transform();
|
||||||
|
|
||||||
|
float shadowRadius();
|
||||||
|
|
||||||
|
float shadowStrength();
|
||||||
|
|
||||||
boolean applyDyedColor();
|
boolean applyDyedColor();
|
||||||
|
|
||||||
Vector3f scale();
|
Vector3f scale();
|
||||||
@@ -46,6 +50,10 @@ public interface FurnitureElement {
|
|||||||
|
|
||||||
Builder applyDyedColor(boolean applyDyedColor);
|
Builder applyDyedColor(boolean applyDyedColor);
|
||||||
|
|
||||||
|
Builder shadowStrength(float shadowStrength);
|
||||||
|
|
||||||
|
Builder shadowRadius(float shadowRadius);
|
||||||
|
|
||||||
FurnitureElement build();
|
FurnitureElement build();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,16 +17,16 @@ jetbrains_annotations_version=26.0.2
|
|||||||
slf4j_version=2.0.17
|
slf4j_version=2.0.17
|
||||||
log4j_version=2.25.2
|
log4j_version=2.25.2
|
||||||
gson_version=2.13.2
|
gson_version=2.13.2
|
||||||
asm_version=9.8
|
asm_version=9.9
|
||||||
asm_commons_version=9.8
|
asm_commons_version=9.9
|
||||||
jar_relocator_version=1.7
|
jar_relocator_version=1.7
|
||||||
adventure_bundle_version=4.25.0
|
adventure_bundle_version=4.25.0
|
||||||
cloud_core_version=2.0.0
|
cloud_core_version=2.0.0
|
||||||
cloud_services_version=2.0.0
|
cloud_services_version=2.0.0
|
||||||
cloud_brigadier_version=2.0.0-beta.11
|
cloud_brigadier_version=2.0.0-beta.13
|
||||||
cloud_bukkit_version=2.0.0-beta.11
|
cloud_bukkit_version=2.0.0-beta.13
|
||||||
cloud_paper_version=2.0.0-beta.11
|
cloud_paper_version=2.0.0-beta.13
|
||||||
cloud_minecraft_extras_version=2.0.0-beta.11
|
cloud_minecraft_extras_version=2.0.0-beta.13
|
||||||
boosted_yaml_version=1.3.7
|
boosted_yaml_version=1.3.7
|
||||||
bstats_version=3.1.0
|
bstats_version=3.1.0
|
||||||
caffeine_version=3.2.2
|
caffeine_version=3.2.2
|
||||||
@@ -41,12 +41,12 @@ commons_imaging_version=1.0.0-alpha6
|
|||||||
commons_lang3_version=3.19.0
|
commons_lang3_version=3.19.0
|
||||||
sparrow_nbt_version=0.10.6
|
sparrow_nbt_version=0.10.6
|
||||||
sparrow_util_version=0.52
|
sparrow_util_version=0.52
|
||||||
fastutil_version=8.5.16
|
fastutil_version=8.5.18
|
||||||
netty_version=4.1.127.Final
|
netty_version=4.1.127.Final
|
||||||
joml_version=1.10.8
|
joml_version=1.10.8
|
||||||
datafixerupper_version=8.0.16
|
datafixerupper_version=8.0.16
|
||||||
mojang_brigadier_version=1.0.18
|
mojang_brigadier_version=1.0.18
|
||||||
byte_buddy_version=1.17.5
|
byte_buddy_version=1.17.8
|
||||||
ahocorasick_version=0.6.3
|
ahocorasick_version=0.6.3
|
||||||
snake_yaml_version=2.5
|
snake_yaml_version=2.5
|
||||||
anti_grief_version=1.0.2
|
anti_grief_version=1.0.2
|
||||||
|
|||||||
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,6 +1,6 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-bin.zip
|
||||||
networkTimeout=10000
|
networkTimeout=10000
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
|
|||||||
Reference in New Issue
Block a user