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")) {
|
||||
expand(
|
||||
Pair("project_version", rootProject.properties["project_version"]),
|
||||
Pair("config_version", rootProject.properties["config_version"]),
|
||||
Pair("lang_version", rootProject.properties["lang_version"])
|
||||
Pair("project_version", rootProject.properties["project_version"]!!),
|
||||
Pair("config_version", rootProject.properties["config_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")
|
||||
}.standardOutput.asText.map { it.trim() }.getOrElse("Unknown")
|
||||
|
||||
fun builder() = project.providers.exec {
|
||||
fun builder(): String = project.providers.exec {
|
||||
commandLine("git", "config", "user.name")
|
||||
}.standardOutput.asText.map { it.trim() }.getOrElse("Unknown")
|
||||
@@ -80,7 +80,7 @@ tasks.withType<JavaCompile> {
|
||||
}
|
||||
|
||||
artifacts {
|
||||
archives(tasks.shadowJar)
|
||||
implementation(tasks.shadowJar)
|
||||
}
|
||||
|
||||
tasks {
|
||||
|
||||
@@ -29,5 +29,5 @@ tasks.withType<JavaCompile> {
|
||||
}
|
||||
|
||||
artifacts {
|
||||
archives(tasks.shadowJar)
|
||||
implementation(tasks.shadowJar)
|
||||
}
|
||||
@@ -56,7 +56,7 @@ bukkit {
|
||||
}
|
||||
|
||||
artifacts {
|
||||
archives(tasks.shadowJar)
|
||||
implementation(tasks.shadowJar)
|
||||
}
|
||||
|
||||
tasks {
|
||||
|
||||
@@ -130,7 +130,7 @@ paper {
|
||||
}
|
||||
|
||||
artifacts {
|
||||
archives(tasks.shadowJar)
|
||||
implementation(tasks.shadowJar)
|
||||
}
|
||||
|
||||
tasks {
|
||||
|
||||
@@ -34,6 +34,8 @@ public class ItemDisplayBlockEntityElementConfig implements BlockEntityElementCo
|
||||
private final Quaternionf rotation;
|
||||
private final ItemDisplayContext displayContext;
|
||||
private final Billboard billboard;
|
||||
private final float shadowRadius;
|
||||
private final float shadowStrength;
|
||||
|
||||
public ItemDisplayBlockEntityElementConfig(Function<Player, Item<?>> item,
|
||||
Vector3f scale,
|
||||
@@ -43,7 +45,9 @@ public class ItemDisplayBlockEntityElementConfig implements BlockEntityElementCo
|
||||
float yRot,
|
||||
Quaternionf rotation,
|
||||
ItemDisplayContext displayContext,
|
||||
Billboard billboard) {
|
||||
Billboard billboard,
|
||||
float shadowRadius,
|
||||
float shadowStrength) {
|
||||
this.item = item;
|
||||
this.scale = scale;
|
||||
this.position = position;
|
||||
@@ -53,6 +57,8 @@ public class ItemDisplayBlockEntityElementConfig implements BlockEntityElementCo
|
||||
this.rotation = rotation;
|
||||
this.displayContext = displayContext;
|
||||
this.billboard = billboard;
|
||||
this.shadowRadius = shadowRadius;
|
||||
this.shadowStrength = shadowStrength;
|
||||
this.lazyMetadataPacket = player -> {
|
||||
List<Object> dataValues = new ArrayList<>();
|
||||
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.Translation.addEntityDataIfNotDefaultValue(this.translation, dataValues);
|
||||
ItemDisplayEntityData.DisplayType.addEntityDataIfNotDefaultValue(this.displayContext.id(), dataValues);
|
||||
ItemDisplayEntityData.ShadowRadius.addEntityDataIfNotDefaultValue(this.shadowRadius, dataValues);
|
||||
ItemDisplayEntityData.ShadowStrength.addEntityDataIfNotDefaultValue(this.shadowStrength, dataValues);
|
||||
return dataValues;
|
||||
};
|
||||
}
|
||||
@@ -106,6 +114,14 @@ public class ItemDisplayBlockEntityElementConfig implements BlockEntityElementCo
|
||||
return rotation;
|
||||
}
|
||||
|
||||
public float shadowRadius() {
|
||||
return shadowRadius;
|
||||
}
|
||||
|
||||
public float shadowStrength() {
|
||||
return shadowStrength;
|
||||
}
|
||||
|
||||
public List<Object> metadataValues(Player player) {
|
||||
return this.lazyMetadataPacket.apply(player);
|
||||
}
|
||||
@@ -125,7 +141,9 @@ public class ItemDisplayBlockEntityElementConfig implements BlockEntityElementCo
|
||||
ResourceConfigUtils.getAsFloat(arguments.getOrDefault("yaw", 0f), "yaw"),
|
||||
ResourceConfigUtils.getAsQuaternionf(arguments.getOrDefault("rotation", 0f), "rotation"),
|
||||
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 position,
|
||||
Quaternionf rotation,
|
||||
float shadowRadius,
|
||||
float shadowStrength,
|
||||
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<>();
|
||||
ItemDisplayEntityData.Scale.addEntityDataIfNotDefaultValue(scale(), this.commonValues);
|
||||
ItemDisplayEntityData.RotationLeft.addEntityDataIfNotDefaultValue(rotation(), this.commonValues);
|
||||
ItemDisplayEntityData.BillboardConstraints.addEntityDataIfNotDefaultValue(billboard().id(), this.commonValues);
|
||||
ItemDisplayEntityData.Translation.addEntityDataIfNotDefaultValue(translation(), this.commonValues);
|
||||
ItemDisplayEntityData.DisplayType.addEntityDataIfNotDefaultValue(transform().id(), this.commonValues);
|
||||
ItemDisplayEntityData.ShadowRadius.addEntityDataIfNotDefaultValue(shadowRadius, this.commonValues);
|
||||
ItemDisplayEntityData.ShadowStrength.addEntityDataIfNotDefaultValue(shadowStrength, this.commonValues);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -102,6 +106,8 @@ public class BukkitFurnitureElement extends AbstractFurnitureElement {
|
||||
private Vector3f translation;
|
||||
private Vector3f position;
|
||||
private Quaternionf rotation;
|
||||
private float shadowRadius;
|
||||
private float shadowStrength;
|
||||
|
||||
@Override
|
||||
public Builder applyDyedColor(boolean applyDyedColor) {
|
||||
@@ -151,9 +157,21 @@ public class BukkitFurnitureElement extends AbstractFurnitureElement {
|
||||
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
|
||||
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(),
|
||||
ExecutionCoordinator.simpleCoordinator(),
|
||||
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.index = Index.create(CommandFeature::getFeatureID, List.of(
|
||||
new ReloadCommand(this, plugin),
|
||||
|
||||
@@ -26,6 +26,8 @@ items:
|
||||
billboard: FIXED
|
||||
position: 0.5,0,0
|
||||
translation: 0,0.5,0
|
||||
shadow-radius: 1
|
||||
shadow-strength: 0.2
|
||||
hitboxes:
|
||||
- position: 0,0,0
|
||||
type: shulker
|
||||
|
||||
@@ -47,6 +47,8 @@ furniture:
|
||||
billboard: FIXED
|
||||
position: 0,0,0
|
||||
translation: 0,0.5,0
|
||||
shadow-radius: 0.5
|
||||
shadow-strength: 0.5
|
||||
hitboxes:
|
||||
- type: interaction
|
||||
can-use-item-on: true
|
||||
|
||||
@@ -23,6 +23,8 @@ items:
|
||||
elements:
|
||||
- item: default:wooden_chair
|
||||
display-transform: NONE
|
||||
shadow-radius: 0.4
|
||||
shadow-strength: 0.5
|
||||
billboard: FIXED
|
||||
translation: 0,0.5,0
|
||||
hitboxes:
|
||||
|
||||
@@ -15,6 +15,8 @@ public abstract class AbstractFurnitureElement implements FurnitureElement {
|
||||
private final Vector3f position;
|
||||
private final Quaternionf rotation;
|
||||
private final boolean applyDyedColor;
|
||||
private final float shadowRadius;
|
||||
private final float shadowStrength;
|
||||
|
||||
public AbstractFurnitureElement(Key item,
|
||||
Billboard billboard,
|
||||
@@ -23,6 +25,8 @@ public abstract class AbstractFurnitureElement implements FurnitureElement {
|
||||
Vector3f translation,
|
||||
Vector3f position,
|
||||
Quaternionf rotation,
|
||||
float shadowRadius,
|
||||
float shadowStrength,
|
||||
boolean applyDyedColor) {
|
||||
this.billboard = billboard;
|
||||
this.transform = transform;
|
||||
@@ -32,6 +36,18 @@ public abstract class AbstractFurnitureElement implements FurnitureElement {
|
||||
this.rotation = rotation;
|
||||
this.position = position;
|
||||
this.applyDyedColor = applyDyedColor;
|
||||
this.shadowRadius = shadowRadius;
|
||||
this.shadowStrength = shadowStrength;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float shadowRadius() {
|
||||
return shadowRadius;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float shadowStrength() {
|
||||
return shadowStrength;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -137,6 +137,8 @@ public abstract class AbstractFurnitureManager implements FurnitureManager {
|
||||
.position(ResourceConfigUtils.getAsVector3f(element.getOrDefault("position", "0"), "position"))
|
||||
.translation(ResourceConfigUtils.getAsVector3f(element.getOrDefault("translation", "0"), "translation"))
|
||||
.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();
|
||||
elements.add(furnitureElement);
|
||||
}
|
||||
|
||||
@@ -18,6 +18,10 @@ public interface FurnitureElement {
|
||||
|
||||
ItemDisplayContext transform();
|
||||
|
||||
float shadowRadius();
|
||||
|
||||
float shadowStrength();
|
||||
|
||||
boolean applyDyedColor();
|
||||
|
||||
Vector3f scale();
|
||||
@@ -46,6 +50,10 @@ public interface FurnitureElement {
|
||||
|
||||
Builder applyDyedColor(boolean applyDyedColor);
|
||||
|
||||
Builder shadowStrength(float shadowStrength);
|
||||
|
||||
Builder shadowRadius(float shadowRadius);
|
||||
|
||||
FurnitureElement build();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,16 +17,16 @@ jetbrains_annotations_version=26.0.2
|
||||
slf4j_version=2.0.17
|
||||
log4j_version=2.25.2
|
||||
gson_version=2.13.2
|
||||
asm_version=9.8
|
||||
asm_commons_version=9.8
|
||||
asm_version=9.9
|
||||
asm_commons_version=9.9
|
||||
jar_relocator_version=1.7
|
||||
adventure_bundle_version=4.25.0
|
||||
cloud_core_version=2.0.0
|
||||
cloud_services_version=2.0.0
|
||||
cloud_brigadier_version=2.0.0-beta.11
|
||||
cloud_bukkit_version=2.0.0-beta.11
|
||||
cloud_paper_version=2.0.0-beta.11
|
||||
cloud_minecraft_extras_version=2.0.0-beta.11
|
||||
cloud_brigadier_version=2.0.0-beta.13
|
||||
cloud_bukkit_version=2.0.0-beta.13
|
||||
cloud_paper_version=2.0.0-beta.13
|
||||
cloud_minecraft_extras_version=2.0.0-beta.13
|
||||
boosted_yaml_version=1.3.7
|
||||
bstats_version=3.1.0
|
||||
caffeine_version=3.2.2
|
||||
@@ -41,12 +41,12 @@ commons_imaging_version=1.0.0-alpha6
|
||||
commons_lang3_version=3.19.0
|
||||
sparrow_nbt_version=0.10.6
|
||||
sparrow_util_version=0.52
|
||||
fastutil_version=8.5.16
|
||||
fastutil_version=8.5.18
|
||||
netty_version=4.1.127.Final
|
||||
joml_version=1.10.8
|
||||
datafixerupper_version=8.0.16
|
||||
mojang_brigadier_version=1.0.18
|
||||
byte_buddy_version=1.17.5
|
||||
byte_buddy_version=1.17.8
|
||||
ahocorasick_version=0.6.3
|
||||
snake_yaml_version=2.5
|
||||
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
|
||||
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
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
||||
Reference in New Issue
Block a user