mirror of
https://github.com/Xiao-MoMi/craft-engine.git
synced 2026-01-03 22:26:16 +00:00
Merge branch 'Xiao-MoMi:dev' into dev
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
import net.minecrell.pluginyml.paper.PaperPluginDescription
|
||||
import xyz.jpenilla.runpaper.task.RunServer
|
||||
import xyz.jpenilla.runtask.pluginsapi.DownloadPluginsSpec
|
||||
import java.net.URI
|
||||
|
||||
plugins {
|
||||
id("com.gradleup.shadow") version "9.3.0"
|
||||
@@ -224,10 +222,9 @@ fun registerPaperTask(
|
||||
version: String,
|
||||
dirName: String = version,
|
||||
javaVersion : Int = 21,
|
||||
serverJar: File? = null,
|
||||
downloadPlugins: Action<DownloadPluginsSpec>? = null
|
||||
serverJar: File? = null
|
||||
) {
|
||||
listOf(version, "${version}-with-viaversion").forEach { taskName ->
|
||||
listOf(version).forEach { taskName ->
|
||||
tasks.register(taskName, RunServer::class) {
|
||||
group = "run dev server"
|
||||
minecraftVersion(version)
|
||||
@@ -245,18 +242,6 @@ fun registerPaperTask(
|
||||
jvmArgs("-Ddisable.watchdog=true")
|
||||
jvmArgs("-Xlog:redefine+class*=info")
|
||||
jvmArgs("-XX:+AllowEnhancedClassRedefinition")
|
||||
if (taskName.contains("viaversion")) {
|
||||
downloadPlugins {
|
||||
url("https://ci.viaversion.com/job/ViaVersion/lastBuild/artifact/build/libs/${getJenkinsArtifactFileName("https://ci.viaversion.com/job/ViaVersion/lastSuccessfulBuild/api/json?tree=artifacts[*]")}")
|
||||
url("https://ci.viaversion.com/view/ViaBackwards/job/ViaBackwards/662/artifact/build/libs/${getJenkinsArtifactFileName("https://ci.viaversion.com/job/ViaBackwards/lastSuccessfulBuild/api/json?tree=artifacts[*]")}")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun getJenkinsArtifactFileName(url: String): String {
|
||||
val response = URI.create(url).toURL().readText()
|
||||
val regex = """"fileName":"([^"]+)"""".toRegex()
|
||||
return regex.find(response)?.groupValues?.get(1) ?: throw Exception("fileName not found")
|
||||
}
|
||||
@@ -50,6 +50,7 @@ public class ShulkerFurnitureHitboxConfig extends AbstractFurnitureHitBoxConfig<
|
||||
byte peek,
|
||||
boolean interactive,
|
||||
boolean interactionEntity,
|
||||
boolean invisible,
|
||||
Direction direction) {
|
||||
super(seats, position, canUseItemOn, blocksBuilding, canBeHitByProjectile);
|
||||
this.scale = scale;
|
||||
@@ -66,7 +67,9 @@ public class ShulkerFurnitureHitboxConfig extends AbstractFurnitureHitBoxConfig<
|
||||
ShulkerData.SharedFlags.addEntityDataIfNotDefaultValue((byte) 0x20, this.cachedShulkerValues); // Invisible
|
||||
|
||||
List<Object> cachedInteractionValues = new ArrayList<>();
|
||||
InteractionEntityData.SharedFlags.addEntityDataIfNotDefaultValue((byte) 0x20, cachedInteractionValues);
|
||||
if (invisible) {
|
||||
InteractionEntityData.SharedFlags.addEntityDataIfNotDefaultValue((byte) 0x20, cachedInteractionValues);
|
||||
}
|
||||
float shulkerHeight = (getPhysicalPeek(peek * 0.01F) + 1) * scale;
|
||||
if (direction == Direction.UP) {
|
||||
InteractionEntityData.Height.addEntityDataIfNotDefaultValue(shulkerHeight + 0.01f, cachedInteractionValues);
|
||||
@@ -309,11 +312,12 @@ public class ShulkerFurnitureHitboxConfig extends AbstractFurnitureHitBoxConfig<
|
||||
boolean canUseItemOn = ResourceConfigUtils.getAsBoolean(arguments.getOrDefault("can-use-item-on", true), "can-use-item-on");
|
||||
boolean canBeHitByProjectile = ResourceConfigUtils.getAsBoolean(arguments.getOrDefault("can-be-hit-by-projectile", true), "can-be-hit-by-projectile");
|
||||
boolean blocksBuilding = ResourceConfigUtils.getAsBoolean(arguments.getOrDefault("blocks-building", true), "blocks-building");
|
||||
boolean invisible = ResourceConfigUtils.getAsBoolean(arguments.getOrDefault("invisible", false), "invisible");
|
||||
return new ShulkerFurnitureHitboxConfig(
|
||||
SeatConfig.fromObj(arguments.get("seats")),
|
||||
position,
|
||||
canUseItemOn, blocksBuilding, canBeHitByProjectile,
|
||||
scale, peek, interactive, interactionEntity, directionEnum
|
||||
scale, peek, interactive, interactionEntity, invisible, directionEnum
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user