feat: 添加玩偶的Jade皮肤所属者的显示
This commit is contained in:
parent
6c6883b767
commit
9eec9972f4
|
|
@ -251,6 +251,10 @@ public enum Lib39LangKey implements ILangKeyValueCollection {
|
||||||
addLang(LangKeyValue.copyOf(
|
addLang(LangKeyValue.copyOf(
|
||||||
Lib39Blocks.WALL_DOLL, ModPartEnum.BLOCK, dollName
|
Lib39Blocks.WALL_DOLL, ModPartEnum.BLOCK, dollName
|
||||||
));
|
));
|
||||||
|
addLang(
|
||||||
|
LangKeyValue.ofKey("config.jade.plugin_lib39.lib39", ModPartEnum.DEFAULT,
|
||||||
|
"Lib 39", "叁玖库", "叁玖庫", "叁玖庫"
|
||||||
|
));
|
||||||
addLang(LangKeyValue.ofKey(
|
addLang(LangKeyValue.ofKey(
|
||||||
"tooltip.lib39.content.doll.hover.1", ModPartEnum.DESCRIPTION,
|
"tooltip.lib39.content.doll.hover.1", ModPartEnum.DESCRIPTION,
|
||||||
"§eSkinOwner §7:§a %s ", "§e皮肤所有者§7:§a%s", "§e皮膚所有者§7:§a%s", "§e膚主§7:§a%s"
|
"§eSkinOwner §7:§a %s ", "§e皮肤所有者§7:§a%s", "§e皮膚所有者§7:§a%s", "§e膚主§7:§a%s"
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,7 @@ dependencies {
|
||||||
modImplementation "net.fabricmc.fabric-api:fabric-api:${fabric_version}"
|
modImplementation "net.fabricmc.fabric-api:fabric-api:${fabric_version}"
|
||||||
implementation group: 'com.google.code.findbugs', name: 'jsr305', version: '3.0.1'
|
implementation group: 'com.google.code.findbugs', name: 'jsr305', version: '3.0.1'
|
||||||
implementation project(":common")
|
implementation project(":common")
|
||||||
|
modImplementation "curse.maven:jade-324717:6291330"
|
||||||
testImplementation "net.fabricmc:fabric-loader-junit:${fabric_loader_version}"
|
testImplementation "net.fabricmc:fabric-loader-junit:${fabric_loader_version}"
|
||||||
localRuntime 'net.covers1624:DevLogin:0.1.0.5'
|
localRuntime 'net.covers1624:DevLogin:0.1.0.5'
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,25 @@
|
||||||
|
package top.r3944realms.lib39.base.compat.jade;
|
||||||
|
|
||||||
|
import net.minecraft.resources.ResourceLocation;
|
||||||
|
import snownee.jade.api.IWailaClientRegistration;
|
||||||
|
import snownee.jade.api.IWailaPlugin;
|
||||||
|
import snownee.jade.api.WailaPlugin;
|
||||||
|
import top.r3944realms.lib39.Lib39;
|
||||||
|
import top.r3944realms.lib39.base.compat.jade.provider.FabricDollComponentProvider;
|
||||||
|
import top.r3944realms.lib39.content.block.DollBlock;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The type Fabric jade plugin.
|
||||||
|
*/
|
||||||
|
@WailaPlugin
|
||||||
|
public class FabricJadePlugin implements IWailaPlugin {
|
||||||
|
/**
|
||||||
|
* The constant UID.
|
||||||
|
*/
|
||||||
|
public static final ResourceLocation UID = Lib39.rl("lib39");
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void registerClient(IWailaClientRegistration registration) {
|
||||||
|
registration.registerBlockComponent(new FabricDollComponentProvider(), DollBlock.class);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,31 @@
|
||||||
|
package top.r3944realms.lib39.base.compat.jade.provider;
|
||||||
|
|
||||||
|
import com.mojang.authlib.GameProfile;
|
||||||
|
import net.minecraft.network.chat.Component;
|
||||||
|
import net.minecraft.resources.ResourceLocation;
|
||||||
|
import snownee.jade.api.BlockAccessor;
|
||||||
|
import snownee.jade.api.IBlockComponentProvider;
|
||||||
|
import snownee.jade.api.ITooltip;
|
||||||
|
import snownee.jade.api.config.IPluginConfig;
|
||||||
|
import top.r3944realms.lib39.base.compat.jade.FabricJadePlugin;
|
||||||
|
import top.r3944realms.lib39.content.block.blockentity.DollBlockEntity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The type Fabric doll component provider.
|
||||||
|
*/
|
||||||
|
public class FabricDollComponentProvider implements IBlockComponentProvider {
|
||||||
|
@Override
|
||||||
|
public ResourceLocation getUid() {
|
||||||
|
return FabricJadePlugin.UID;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void appendTooltip(ITooltip iTooltip, BlockAccessor blockAccessor, IPluginConfig iPluginConfig) {
|
||||||
|
if (blockAccessor.getBlockEntity() instanceof DollBlockEntity doll) {
|
||||||
|
GameProfile ownerProfile = doll.getOwnerProfile();
|
||||||
|
if (ownerProfile != null) {
|
||||||
|
iTooltip.add(Component.translatable("tooltip.lib39.content.doll.hover.1", ownerProfile.getName()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -20,6 +20,9 @@
|
||||||
],
|
],
|
||||||
"client": [
|
"client": [
|
||||||
"top.r3944realms.lib39.Lib39FabricClient"
|
"top.r3944realms.lib39.Lib39FabricClient"
|
||||||
|
],
|
||||||
|
"jade": [
|
||||||
|
"top.r3944realms.lib39.base.compat.jade.FabricJadePlugin"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"mixins": [
|
"mixins": [
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,6 @@ legacyForge {
|
||||||
validateAccessTransformers = true
|
validateAccessTransformers = true
|
||||||
|
|
||||||
def at = project(':common').file('src/main/resources/META-INF/accesstransformer.cfg')
|
def at = project(':common').file('src/main/resources/META-INF/accesstransformer.cfg')
|
||||||
def generated = project(':common').file('src/generated/resources/')
|
|
||||||
if (at.exists()) {
|
if (at.exists()) {
|
||||||
accessTransformers = ["src/main/resources/META-INF/accesstransformer.cfg"]
|
accessTransformers = ["src/main/resources/META-INF/accesstransformer.cfg"]
|
||||||
}
|
}
|
||||||
|
|
@ -78,6 +77,7 @@ dependencies {
|
||||||
modImplementation(group: 'tschipp.carryon', name: 'carryon-forge-1.20.1', version: '2.1.2.7') {
|
modImplementation(group: 'tschipp.carryon', name: 'carryon-forge-1.20.1', version: '2.1.2.7') {
|
||||||
transitive = false
|
transitive = false
|
||||||
}
|
}
|
||||||
|
modImplementation ("curse.maven:jade-324717:6855440")
|
||||||
implementation(jarJar("io.github.llamalad7:mixinextras-forge:0.2.0"))
|
implementation(jarJar("io.github.llamalad7:mixinextras-forge:0.2.0"))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,25 @@
|
||||||
|
package top.r3944realms.lib39.base.compat.jade;
|
||||||
|
|
||||||
|
import net.minecraft.resources.ResourceLocation;
|
||||||
|
import snownee.jade.api.IWailaClientRegistration;
|
||||||
|
import snownee.jade.api.IWailaPlugin;
|
||||||
|
import snownee.jade.api.WailaPlugin;
|
||||||
|
import top.r3944realms.lib39.Lib39;
|
||||||
|
import top.r3944realms.lib39.base.compat.jade.provider.ForgeDollComponentProvider;
|
||||||
|
import top.r3944realms.lib39.content.block.DollBlock;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The type Forge jade plugin.
|
||||||
|
*/
|
||||||
|
@WailaPlugin
|
||||||
|
public class ForgeJadePlugin implements IWailaPlugin {
|
||||||
|
/**
|
||||||
|
* The constant UID.
|
||||||
|
*/
|
||||||
|
public static final ResourceLocation UID = Lib39.rl("lib39");
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void registerClient(IWailaClientRegistration registration) {
|
||||||
|
registration.registerBlockComponent(new ForgeDollComponentProvider(), DollBlock.class);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,32 @@
|
||||||
|
package top.r3944realms.lib39.base.compat.jade.provider;
|
||||||
|
|
||||||
|
import com.mojang.authlib.GameProfile;
|
||||||
|
import net.minecraft.network.chat.Component;
|
||||||
|
import net.minecraft.resources.ResourceLocation;
|
||||||
|
import snownee.jade.api.BlockAccessor;
|
||||||
|
import snownee.jade.api.IBlockComponentProvider;
|
||||||
|
import snownee.jade.api.ITooltip;
|
||||||
|
import snownee.jade.api.config.IPluginConfig;
|
||||||
|
|
||||||
|
import top.r3944realms.lib39.base.compat.jade.ForgeJadePlugin;
|
||||||
|
import top.r3944realms.lib39.content.block.blockentity.DollBlockEntity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The type Forge doll component provider.
|
||||||
|
*/
|
||||||
|
public class ForgeDollComponentProvider implements IBlockComponentProvider {
|
||||||
|
@Override
|
||||||
|
public ResourceLocation getUid() {
|
||||||
|
return ForgeJadePlugin.UID;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void appendTooltip(ITooltip iTooltip, BlockAccessor blockAccessor, IPluginConfig iPluginConfig) {
|
||||||
|
if (blockAccessor.getBlockEntity() instanceof DollBlockEntity doll) {
|
||||||
|
GameProfile ownerProfile = doll.getOwnerProfile();
|
||||||
|
if (ownerProfile != null) {
|
||||||
|
iTooltip.add(Component.translatable("tooltip.lib39.content.doll.hover.1", ownerProfile.getName()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user