pre修改:进一步完善命令

This commit is contained in:
叁玖领域 2025-10-24 01:21:34 +08:00
parent 08aae0f1e1
commit b50e28f280
17 changed files with 949 additions and 323 deletions

View File

@ -197,33 +197,60 @@ tasks.named('javadoc', Javadoc).configure {
options.links("https://docs.oracle.com/en/java/javase/17/docs/api/") options.links("https://docs.oracle.com/en/java/javase/17/docs/api/")
options.memberLevel = JavadocMemberLevel.PUBLIC options.memberLevel = JavadocMemberLevel.PUBLIC
options.addBooleanOption('Xdoclint:none', true) options.addBooleanOption('Xdoclint:none', true)
options.addStringOption('doctitle', "${mod_id} ${mod_version} Javadoc") options.addStringOption('doctitle', "${mod_id} ${minecraft_version} ${mod_version} Javadoc")
}
// =====================class/ java =====================
tasks.register('deobfJar', Jar) {
from(sourceSets.main.output) // class
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
manifest {
attributes([
'Specification-Title' : mod_id,
'Specification-Vendor' : mod_authors,
'Specification-Version' : '1',
'Implementation-Title' : project.name,
'Implementation-Version' : archiveVersion,
'Implementation-Vendor' : mod_authors,
'Implementation-Timestamp': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
])
}
dependsOn classes
}
tasks.register('sourceJar', Jar) {
from(sourceSets.main.allSource) // java
archiveFileName = "${mod_id}-${minecraft_version}-${mod_version}-sources.jar"
archiveClassifier.set("sources")
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
manifest {
attributes([
'Specification-Title' : mod_id,
'Specification-Vendor' : mod_authors,
'Specification-Version' : '1',
'Implementation-Title' : project.name,
'Implementation-Version' : archiveVersion,
'Implementation-Vendor' : mod_authors,
'Implementation-Timestamp': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
])
}
dependsOn classes
} }
// ===================== Javadoc ===================== // ===================== Javadoc =====================
tasks.register('javadocJar', Jar) { tasks.register('javadocJar', Jar) {
archiveClassifier.set('javadoc') archiveFileName = "${mod_id}-${minecraft_version}-${mod_version}-javadoc.jar"
archiveClassifier.set("javadoc")
from tasks.javadoc from tasks.javadoc
dependsOn tasks.javadoc dependsOn tasks.javadoc
} }
tasks.register('apiJavadocJar', Jar) { // ===================== API Jarclass / java =====================
archiveClassifier.set('api-javadoc')
from tasks.javadoc
include "top/r3944realms/superleadrope/api/**/*"
dependsOn tasks.javadoc
}
// ===================== API Jarclass + java =====================
tasks.register('apiJar', Jar) { tasks.register('apiJar', Jar) {
archiveClassifier.set('api') archiveFileName = "${mod_id}-${minecraft_version}-${mod_version}-api.jar"
archiveClassifier.set("api")
manifest { manifest {
attributes 'FMLModType': 'GAMELIBRARY' attributes 'FMLModType': 'GAMELIBRARY'
} }
// class java // class java
from(sourceSets.main.allSource) // java
from(sourceSets.main.output) { // class from(sourceSets.main.output) { // class
exclude 'assets/**', 'data/**' exclude 'assets/**', 'data/**'
} }
@ -233,6 +260,31 @@ tasks.register('apiJar', Jar) {
dependsOn classes dependsOn classes
} }
tasks.register('apiSourceJar', Jar) {
archiveFileName = "${mod_id}-${minecraft_version}-${mod_version}-api-sources.jar"
archiveClassifier.set("api-sources")
manifest {
attributes 'FMLModType': 'GAMELIBRARY'
}
// class java
from(sourceSets.main.allSource) { // java
exclude 'assets/**', 'data/**'
}
include "top/r3944realms/superleadrope/api/**/*"
include "top/r3944realms/superleadrope/SuperLeadRopeAPI.*"
dependsOn classes
}
tasks.register('apiJavadocJar', Jar) {
archiveFileName = "${mod_id}-${minecraft_version}-${mod_version}-api-javadoc.jar"
archiveClassifier.set("api-javadoc")
from tasks.javadoc
include "top/r3944realms/superleadrope/api/**/*"
dependsOn tasks.javadoc
}
tasks.register('apiJavadoc', Javadoc) { tasks.register('apiJavadoc', Javadoc) {
group = 'documentation' group = 'documentation'
@ -252,31 +304,8 @@ tasks.register('apiJavadoc', Javadoc) {
options.addStringOption('doctitle', "${mod_name} API ${mod_version} Javadoc") options.addStringOption('doctitle', "${mod_name} API ${mod_version} Javadoc")
} }
tasks.register('javadocApiJar', Jar) {
archiveClassifier.set('api-javadoc')
from tasks.apiJavadoc
dependsOn tasks.apiJavadoc
}
// ===================== Jarclass + java =====================
tasks.register('fullJar', Jar) {
archiveClassifier.set('all') // Maven -all.jar
from(sourceSets.main.allSource) // java
from(sourceSets.main.output) // class
// === 使 jar ===
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
manifest {
attributes([
'Specification-Title' : mod_id,
'Specification-Vendor' : mod_authors,
'Specification-Version' : '1',
'Implementation-Title' : project.name,
'Implementation-Version' : archiveVersion,
'Implementation-Vendor' : mod_authors,
'Implementation-Timestamp': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
])
}
dependsOn classes
}
// ===================== Jar ===================== // ===================== Jar =====================
jar { jar {
@ -291,10 +320,7 @@ jar {
'Implementation-Timestamp': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"), 'Implementation-Timestamp': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
]) ])
} }
archiveFileName = "${mod_id}-${mod_version}-origin.jar" archiveFileName = "${mod_id}-${minecraft_version}-${mod_version}-origin.jar"
// API jar API
// exclude "top/r3944realms/superleadrope/api/**/*"
finalizedBy 'proguard' finalizedBy 'proguard'
} }
@ -374,10 +400,11 @@ publishing {
mavenJava(MavenPublication) { mavenJava(MavenPublication) {
artifactId = mod_id artifactId = mod_id
artifact fullJar artifact deobfJar
artifact apiJar artifact sourceJar
//
artifact javadocJar artifact javadocJar
artifact apiJar
artifact apiSourceJar
artifact apiJavadocJar artifact apiJavadocJar
pom { pom {
@ -402,7 +429,8 @@ publishing {
repositories { repositories {
maven { maven {
url "file://${project.projectDir}/mcmodsrepo" name = "local"
url = layout.buildDirectory.dir("repo")
} }
maven { maven {
name = 'LTDNexus' name = 'LTDNexus'
@ -417,7 +445,7 @@ publishing {
// ===================== ===================== // ===================== =====================
tasks.named('build') { tasks.named('build') {
dependsOn apiJar, javadocApiJar dependsOn apiJar, apiJavadocJar
} }
tasks.named('clean') { tasks.named('clean') {
@ -458,3 +486,17 @@ idea {
downloadJavadoc = true downloadJavadoc = true
} }
} }
afterEvaluate {
tasks.named('deobfJar') {
doLast {
def jar = file(layout.buildDirectory.dir("repo") + "${mod_id}-${minecraft_version}-${mod_version}.jar")
if (jar.exists()) ant.delete(jar)
}
}
tasks.named('apiJar') {
doLast {
def jar = file(layout.buildDirectory.dir("repo") + "${mod_id}-${minecraft_version}-${mod_version}-api.jar")
if (jar.exists()) ant.delete(jar)
}
}
}

View File

@ -59,7 +59,7 @@ mod_name=Super Lead Rope
# The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default. # The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default.
mod_license=GPLv3 mod_license=GPLv3
# The mod version. See https://semver.org/ # The mod version. See https://semver.org/
mod_version=0.0.0.6-pre7 mod_version=0.0.0.6-pre10
# The group ID for the mod. It is only important when publishing as an artifact to a Maven repository. # The group ID for the mod. It is only important when publishing as an artifact to a Maven repository.
# This should match the base package used for the mod sources. # This should match the base package used for the mod sources.
# See https://maven.apache.org/guides/mini/guide-naming-conventions.html # See https://maven.apache.org/guides/mini/guide-naming-conventions.html

View File

@ -62,6 +62,7 @@ import top.r3944realms.superleadrope.content.capability.CapabilityHandler;
import top.r3944realms.superleadrope.content.capability.CapabilityRemainder; import top.r3944realms.superleadrope.content.capability.CapabilityRemainder;
import top.r3944realms.superleadrope.content.capability.impi.LeashDataImpl; import top.r3944realms.superleadrope.content.capability.impi.LeashDataImpl;
import top.r3944realms.superleadrope.content.capability.inter.IEternalPotato; import top.r3944realms.superleadrope.content.capability.inter.IEternalPotato;
import top.r3944realms.superleadrope.content.command.LeashDataCommand;
import top.r3944realms.superleadrope.content.command.MotionCommand; import top.r3944realms.superleadrope.content.command.MotionCommand;
import top.r3944realms.superleadrope.content.entity.SuperLeashKnotEntity; import top.r3944realms.superleadrope.content.entity.SuperLeashKnotEntity;
import top.r3944realms.superleadrope.content.gamerule.server.TeleportWithLeashedEntities; import top.r3944realms.superleadrope.content.gamerule.server.TeleportWithLeashedEntities;
@ -477,6 +478,7 @@ public class CommonEventHandler {
public static void onRegisterCommand (RegisterCommandsEvent event) { public static void onRegisterCommand (RegisterCommandsEvent event) {
CommandDispatcher<CommandSourceStack> dispatcher = event.getDispatcher(); CommandDispatcher<CommandSourceStack> dispatcher = event.getDispatcher();
MotionCommand.register(dispatcher); MotionCommand.register(dispatcher);
LeashDataCommand.register(dispatcher);
} }
} }

View File

@ -122,7 +122,6 @@ public class SuperLeadRopeApi {
* @param clazz the clazz * @param clazz the clazz
* @param box the box * @param box the box
* @param filter the filter * @param filter the filter
*
* @return the list * @return the list
*/ */
public static <T extends Entity> @NotNull List<T> leashableInArea(Entity holder, Class<T> clazz, AABB box, Predicate<T> filter) { public static <T extends Entity> @NotNull List<T> leashableInArea(Entity holder, Class<T> clazz, AABB box, Predicate<T> filter) {

View File

@ -621,6 +621,20 @@ public interface ILeashData extends INBTSerializable<CompoundTag> {
*/ */
Collection<LeashInfo> getAllLeashes(); Collection<LeashInfo> getAllLeashes();
/**
* Gets all leashes.
*
* @return the all leashes
*/
Collection<LeashInfo> getAllHolderLeashes();
/**
* Gets all leashes.
*
* @return the all leashes
*/
Collection<LeashInfo> getAllKnotLeashes();
/** /**
* Is leashed by boolean. * Is leashed by boolean.
* *

View File

@ -77,26 +77,28 @@ public interface ILeashHelper {
default Set<Entity> getAllLeashedEntities() { default Set<Entity> getAllLeashedEntities() {
return getAllLeash().stream().map(ILeashData::self).collect(Collectors.toSet()); return getAllLeash().stream().map(ILeashData::self).collect(Collectors.toSet());
} }
/** /**
* 获取该实体持有的指定实体实例 * 获取该实体持有的指定实体实例
* *
* @param <T> the type parameter
* @param clazz 实体类型 * @param clazz 实体类型
* @param box 搜索范围 * @param box 搜索范围
* @param filter {@link Predicate<Entity> 实体过滤器} * @param filter {@link Predicate<Entity> 实体过滤器}
*
* @return {@link Set<Entity> 持有的实体集合} * @return {@link Set<Entity> 持有的实体集合}
*/ */
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
default <T extends Entity> Set<T> getLeashEntities (Class<T> clazz, AABB box, Predicate<T> filter) { default <T extends Entity> Set<T> getLeashEntities (Class<T> clazz, AABB box, Predicate<T> filter) {
return (Set<T>) getLeash(clazz, box, filter).stream().map(ILeashData::self).collect(Collectors.toSet()); return (Set<T>) getLeash(clazz, box, filter).stream().map(ILeashData::self).collect(Collectors.toSet());
} }
/** /**
* 获取该实体持有的符合条件实体的拴绳数据能力 * 获取该实体持有的符合条件实体的拴绳数据能力
* *
* @param <T> the type parameter
* @param clazz 实体类型 * @param clazz 实体类型
* @param box 搜索范围 * @param box 搜索范围
* @param filter {@link Predicate<Entity> 实体过滤器} * @param filter {@link Predicate<Entity> 实体过滤器}
*
* @return {@link Set<ILeashData> 持有的实体的拴绳数据能力集合} * @return {@link Set<ILeashData> 持有的实体的拴绳数据能力集合}
*/ */
<T extends Entity> Set<ILeashData> getLeash(Class<T> clazz, AABB box, Predicate<T> filter); <T extends Entity> Set<ILeashData> getLeash(Class<T> clazz, AABB box, Predicate<T> filter);
@ -104,10 +106,10 @@ public interface ILeashHelper {
/** /**
* 获取该实体持有的符合条件实体实例 * 获取该实体持有的符合条件实体实例
* *
* @param <T> the type parameter
* @param clazz 实体类型 * @param clazz 实体类型
* @param fetchDistance 搜索范围(以实体为中心的正方体{@link AABB#ofSize(Vec3, double, double, double) 包围盒}) * @param fetchDistance 搜索范围(以实体为中心的正方体{@link AABB#ofSize(Vec3, double, double, double) 包围盒})
* @param filter {@link Predicate<Entity> 实体过滤器} * @param filter {@link Predicate<Entity> 实体过滤器}
*
* @return {@link Set<Entity> 持有的实体实例} * @return {@link Set<Entity> 持有的实体实例}
*/ */
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
@ -118,21 +120,22 @@ public interface ILeashHelper {
/** /**
* 获取该实体持有的符合条件实体的拴绳数据能力 * 获取该实体持有的符合条件实体的拴绳数据能力
* *
* @param <T> the type parameter
* @param clazz 实体类型 * @param clazz 实体类型
* @param fetchDistance 搜索范围(以实体为中心的正方体{@link AABB#ofSize(Vec3, double, double, double) 包围盒}) * @param fetchDistance 搜索范围(以实体为中心的正方体{@link AABB#ofSize(Vec3, double, double, double) 包围盒})
* @param filter {@link Predicate<Entity> 实体过滤器} * @param filter {@link Predicate<Entity> 实体过滤器}
*
* @return {@link Set<ILeashData> 持有的实体的拴绳数据能力集合} * @return {@link Set<ILeashData> 持有的实体的拴绳数据能力集合}
*/ */
default <T extends Entity> Set<ILeashData> getLeash(Class<T> clazz, double fetchDistance, Predicate<T> filter) { default <T extends Entity> Set<ILeashData> getLeash(Class<T> clazz, double fetchDistance, Predicate<T> filter) {
return getLeash(clazz, AABB.ofSize(getHolderEntity().position(), fetchDistance, fetchDistance, fetchDistance), filter); return getLeash(clazz, AABB.ofSize(getHolderEntity().position(), fetchDistance, fetchDistance, fetchDistance), filter);
} }
/** /**
* 获取该实体持有的符合条件实体实例 * 获取该实体持有的符合条件实体实例
* *
* @param <T> the type parameter
* @param clazz 实体类型 * @param clazz 实体类型
* @param filter {@link Predicate<Entity> 实体过滤器} * @param filter {@link Predicate<Entity> 实体过滤器}
*
* @return {@link Set<Entity> 持有的实体实例} * @return {@link Set<Entity> 持有的实体实例}
*/ */
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
@ -143,19 +146,20 @@ public interface ILeashHelper {
/** /**
* 获取该实体持有的符合条件实体的拴绳数据能力 * 获取该实体持有的符合条件实体的拴绳数据能力
* *
* @param <T> the type parameter
* @param clazz 实体类型 * @param clazz 实体类型
* @param filter {@link Predicate<Entity> 实体过滤器} * @param filter {@link Predicate<Entity> 实体过滤器}
*
* @return {@link Set<ILeashData> 持有的实体的拴绳数据能力集合} * @return {@link Set<ILeashData> 持有的实体的拴绳数据能力集合}
*/ */
default <T extends Entity> Set<ILeashData> getLeash(Class<T> clazz, Predicate<T> filter) { default <T extends Entity> Set<ILeashData> getLeash(Class<T> clazz, Predicate<T> filter) {
return getLeash(clazz, 1024D, filter); return getLeash(clazz, 1024D, filter);
} }
/** /**
* 获取该实体持有的符合条件实体实例 * 获取该实体持有的符合条件实体实例
* *
* @param <T> the type parameter
* @param clazz 实体类型 * @param clazz 实体类型
*
* @return {@link Set<Entity> 持有的实体实例} * @return {@link Set<Entity> 持有的实体实例}
*/ */
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
@ -166,8 +170,8 @@ public interface ILeashHelper {
/** /**
* 获取该实体持有的符合条件实体的拴绳数据能力 * 获取该实体持有的符合条件实体的拴绳数据能力
* *
* @param <T> the type parameter
* @param clazz 实体类型 * @param clazz 实体类型
*
* @return {@link Set<ILeashData> 持有的实体的拴绳数据能力集合} * @return {@link Set<ILeashData> 持有的实体的拴绳数据能力集合}
*/ */
default <T extends Entity> Set<ILeashData> getLeash(Class<T> clazz) { default <T extends Entity> Set<ILeashData> getLeash(Class<T> clazz) {
@ -186,6 +190,8 @@ public interface ILeashHelper {
/** /**
* 检查是否持有任何拴绳 * 检查是否持有任何拴绳
*
* @return the boolean
*/ */
default boolean hasLeashes() { default boolean hasLeashes() {
return !getAllLeash().isEmpty(); return !getAllLeash().isEmpty();

View File

@ -47,12 +47,11 @@ public interface IWorkSpaceHelper {
/** /**
* Leashable in area list. * Leashable in area list.
* *
* @param <T> 实体类型
* @param pLevel the p level * @param pLevel the p level
* @param clazz the clazz * @param clazz the clazz
* @param filter the filter * @param filter the filter
* @param box the box * @param box the box
* @param <T> 实体类型
*
* @return the list * @return the list
*/ */
@NotNull <T extends Entity> List<T> leashableInArea(@NotNull Level pLevel, Class<T> clazz,Predicate<T> filter, AABB box); @NotNull <T extends Entity> List<T> leashableInArea(@NotNull Level pLevel, Class<T> clazz,Predicate<T> filter, AABB box);

View File

@ -1343,6 +1343,16 @@ public class LeashDataImpl implements ILeashData {
).collect(Collectors.toList()); ).collect(Collectors.toList());
} }
@Override
public Collection<LeashInfo> getAllHolderLeashes() {
return Collections.unmodifiableCollection(leashHolders.values());
}
@Override
public Collection<LeashInfo> getAllKnotLeashes() {
return Collections.unmodifiableCollection(leashKnots.values());
}
@Override @Override
public boolean isLeashedBy(Entity holder) { public boolean isLeashedBy(Entity holder) {
return holder instanceof SuperLeashKnotEntity superLeashKnotEntity ? return holder instanceof SuperLeashKnotEntity superLeashKnotEntity ?

View File

@ -48,9 +48,38 @@ public class Command {
* The constant ABBREVIATION. * The constant ABBREVIATION.
*/ */
public static final String ABBREVIATION = BASE_ + "abbreviation"; public static final String ABBREVIATION = BASE_ + "abbreviation";
/**
* The constant BLOCK_POS.
*/
public static final String BLOCK_POS = BASE_ + ".block_pos"; public static final String BLOCK_POS = BASE_ + ".block_pos";
/**
* The constant SUC.
*/
public static final String SUC = "suc";
/**
* The constant FAIL.
*/
public static final String FAIL = "fail";
/**
* The constant SUC_FAIL.
*/
public static final String SUC_FAIL = "suc_fail";
/**
* The constant COLON.
*/
public static final String COLON = BASE_ + ".colon";
/**
* The constant MAX_SHOW_NUMBER.
*/
public static final int MAX_SHOW_NUMBER = 4; public static final int MAX_SHOW_NUMBER = 4;
/**
* Gets slp name.
*
* @param entity the entity
* @return the slp name
*/
public static Component getSLPName(Entity entity) { public static Component getSLPName(Entity entity) {
if (entity instanceof SuperLeashKnotEntity superLeashKnot) { if (entity instanceof SuperLeashKnotEntity superLeashKnot) {
BlockPos pos = superLeashKnot.getPos(); BlockPos pos = superLeashKnot.getPos();
@ -58,6 +87,13 @@ public class Command {
} }
return entity.getName(); return entity.getName();
} }
/**
* Gets slp name.
*
* @param pos the pos
* @return the slp name
*/
public static Component getSLPName(BlockPos pos) { public static Component getSLPName(BlockPos pos) {
return Component.translatable(BLOCK_POS, pos.getX(), pos.getY(), pos.getZ()); return Component.translatable(BLOCK_POS, pos.getX(), pos.getY(), pos.getZ());
} }

View File

@ -35,6 +35,8 @@ import net.minecraft.world.level.gameevent.GameEvent;
import net.minecraft.world.phys.AABB; import net.minecraft.world.phys.AABB;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import top.r3944realms.superleadrope.api.SuperLeadRopeApi; import top.r3944realms.superleadrope.api.SuperLeadRopeApi;
import top.r3944realms.superleadrope.content.capability.impi.LeashDataImpl;
import top.r3944realms.superleadrope.content.item.SuperLeadRopeItem;
import top.r3944realms.superleadrope.core.register.SLPEntityTypes; import top.r3944realms.superleadrope.core.register.SLPEntityTypes;
import top.r3944realms.superleadrope.util.capability.LeashDataInnerAPI; import top.r3944realms.superleadrope.util.capability.LeashDataInnerAPI;

View File

@ -66,6 +66,7 @@ public class EternalPotatoItem extends Item {
/** /**
* 获取或生成 ItemStack 的唯一 UUID @param stack the stack * 获取或生成 ItemStack 的唯一 UUID @param stack the stack
* *
* @param stack the stack
* @return the or create item uuid * @return the or create item uuid
*/ */
public static UUID getOrCreateItemUUID(ItemStack stack) { public static UUID getOrCreateItemUUID(ItemStack stack) {

View File

@ -58,6 +58,8 @@ public record PunishmentDefinition(PunishmentDefinition.Type type, float strengt
/** /**
* 序列化到网络 @param buf the buf * 序列化到网络 @param buf the buf
*
* @param buf the buf
*/ */
public void toNetwork(FriendlyByteBuf buf) { public void toNetwork(FriendlyByteBuf buf) {
buf.writeEnum(this.type); buf.writeEnum(this.type);
@ -68,6 +70,7 @@ public record PunishmentDefinition(PunishmentDefinition.Type type, float strengt
/** /**
* 从网络反序列化 @param buf the buf * 从网络反序列化 @param buf the buf
* *
* @param buf the buf
* @return the punishment definition * @return the punishment definition
*/ */
public static PunishmentDefinition fromNetwork(FriendlyByteBuf buf) { public static PunishmentDefinition fromNetwork(FriendlyByteBuf buf) {

View File

@ -348,26 +348,6 @@ public enum SLPLangKeyValue {
"§b倍乘成功.§a%s§7:§f[§e加速§7:(§a%.2f§7,§a%.2f§7,§a%.2f§7)§f]§r", "§b倍乘成功.§a%s§7:§f[§e加速§7:(§a%.2f§7,§a%.2f§7,§a%.2f§7)§f]§r",
"§b倍乘既成.§a%s§7:§f[§e速勢§7:(§a%.2f§7,§a%.2f§7,§a%.2f§7)§f]§r" "§b倍乘既成.§a%s§7:§f[§e速勢§7:(§a%.2f§7,§a%.2f§7,§a%.2f§7)§f]§r"
), ),
/**
* The Message leashdata get title.
*/
MESSAGE_LEASHDATA_GET_TITLE(
LeashDataCommand.TITLE, ModPartEnum.COMMAND,
"=== Leash Data for %s ===",
"=== %s 的拴绳数据 ===",
"=== %s 的拴繩數據 ===",
"=== %s 之繫繩數據 ==="
),
/**
* The Message leashdata get total.
*/
MESSAGE_LEASHDATA_GET_TOTAL(
LeashDataCommand.TOTAL, ModPartEnum.COMMAND,
"Total leashes: %d",
"总拴绳数: %d",
"總拴繩數: %d",
"繫繩總數: %d"
),
/** /**
* Message leashdata get block slp lang key value. * Message leashdata get block slp lang key value.
*/ */

View File

@ -244,12 +244,14 @@ public final class LeashDataInnerAPI {
public static boolean setMaxDistance(Entity entity, Entity holder, @Nullable Double distance) { public static boolean setMaxDistance(Entity entity, Entity holder, @Nullable Double distance) {
return getLeashData(entity).map(data -> data.setMaxDistance(holder, distance)).orElse(false); return getLeashData(entity).map(data -> data.setMaxDistance(holder, distance)).orElse(false);
} }
/** /**
* Sets max distance. * Sets max distance.
* *
* @param entity the entity * @param entity the entity
* @param holder the holder * @param holder the holder
* @param distance the distance * @param distance the distance
* @param reserved the reserved
* @return the max distance * @return the max distance
*/ */
public static boolean setMaxDistance(Entity entity, Entity holder, @Nullable Double distance, @Nullable String reserved) { public static boolean setMaxDistance(Entity entity, Entity holder, @Nullable Double distance, @Nullable String reserved) {