添加DPS发电机Jade适配

This commit is contained in:
Light_Quanta 2025-05-10 18:51:20 +08:00
parent f3d84c58cc
commit 4bb287d327
No known key found for this signature in database
GPG key ID: 11A39A1B8C890959
4 changed files with 45 additions and 4 deletions

View file

@ -3,10 +3,8 @@ package com.atsuishio.superbwarfare.compat.jade;
import com.atsuishio.superbwarfare.block.ContainerBlock; import com.atsuishio.superbwarfare.block.ContainerBlock;
import com.atsuishio.superbwarfare.block.VehicleDeployerBlock; import com.atsuishio.superbwarfare.block.VehicleDeployerBlock;
import com.atsuishio.superbwarfare.block.entity.VehicleDeployerBlockEntity; import com.atsuishio.superbwarfare.block.entity.VehicleDeployerBlockEntity;
import com.atsuishio.superbwarfare.compat.jade.providers.C4InfoProvider; import com.atsuishio.superbwarfare.compat.jade.providers.*;
import com.atsuishio.superbwarfare.compat.jade.providers.ContainerEntityProvider; import com.atsuishio.superbwarfare.entity.DPSGeneratorEntity;
import com.atsuishio.superbwarfare.compat.jade.providers.VehicleDeployerProvider;
import com.atsuishio.superbwarfare.compat.jade.providers.VehicleHealthProvider;
import com.atsuishio.superbwarfare.entity.projectile.C4Entity; import com.atsuishio.superbwarfare.entity.projectile.C4Entity;
import com.atsuishio.superbwarfare.entity.vehicle.base.VehicleEntity; import com.atsuishio.superbwarfare.entity.vehicle.base.VehicleEntity;
import snownee.jade.api.IWailaClientRegistration; import snownee.jade.api.IWailaClientRegistration;
@ -26,6 +24,7 @@ public class SbwJadePlugin implements IWailaPlugin {
public void registerClient(IWailaClientRegistration registration) { public void registerClient(IWailaClientRegistration registration) {
registration.registerEntityComponent(VehicleHealthProvider.INSTANCE, VehicleEntity.class); registration.registerEntityComponent(VehicleHealthProvider.INSTANCE, VehicleEntity.class);
registration.registerEntityComponent(C4InfoProvider.INSTANCE, C4Entity.class); registration.registerEntityComponent(C4InfoProvider.INSTANCE, C4Entity.class);
registration.registerEntityComponent(DPSGeneratorProvider.INSTANCE, DPSGeneratorEntity.class);
registration.registerBlockComponent(ContainerEntityProvider.INSTANCE, ContainerBlock.class); registration.registerBlockComponent(ContainerEntityProvider.INSTANCE, ContainerBlock.class);
registration.registerBlockComponent(VehicleDeployerProvider.INSTANCE, VehicleDeployerBlock.class); registration.registerBlockComponent(VehicleDeployerProvider.INSTANCE, VehicleDeployerBlock.class);
} }

View file

@ -0,0 +1,36 @@
package com.atsuishio.superbwarfare.compat.jade.providers;
import com.atsuishio.superbwarfare.Mod;
import com.atsuishio.superbwarfare.entity.DPSGeneratorEntity;
import net.minecraft.ChatFormatting;
import net.minecraft.network.chat.Component;
import net.minecraft.resources.ResourceLocation;
import snownee.jade.api.EntityAccessor;
import snownee.jade.api.IEntityComponentProvider;
import snownee.jade.api.ITooltip;
import snownee.jade.api.config.IPluginConfig;
public enum DPSGeneratorProvider implements IEntityComponentProvider {
INSTANCE;
private static final ResourceLocation ID = Mod.loc("dps_generator");
public void appendTooltip(ITooltip tooltip, EntityAccessor accessor, IPluginConfig config) {
var generator = (DPSGeneratorEntity) accessor.getEntity();
var level = generator.getGeneratorLevel();
var health = generator.getMaxHealth() * Math.pow(2, level);
tooltip.add(Component.translatable("des.jade_plugin_superbwarfare.dps_generator.level", level).withStyle(ChatFormatting.AQUA));
tooltip.add(Component.translatable("des.jade_plugin_superbwarfare.dps_generator.health", health).withStyle(ChatFormatting.GRAY));
}
public ResourceLocation getUid() {
return ID;
}
public int getDefaultPriority() {
return -4501;
}
}

View file

@ -616,6 +616,9 @@
"config.jade.plugin_superbwarfare.c4_info": "C4 Info", "config.jade.plugin_superbwarfare.c4_info": "C4 Info",
"des.jade_plugin_superbwarfare.c4.remote_control": "Remote Controlled", "des.jade_plugin_superbwarfare.c4.remote_control": "Remote Controlled",
"des.jade_plugin_superbwarfare.c4.time_left": "Time Before Explosion: %1$ss", "des.jade_plugin_superbwarfare.c4.time_left": "Time Before Explosion: %1$ss",
"config.jade.plugin_superbwarfare.dps_generator": "DPS Generator Info",
"des.jade_plugin_superbwarfare.dps_generator.level": "Generator Level: %1$s",
"des.jade_plugin_superbwarfare.dps_generator.health": "Maximum Health: %1$s",
"config.jade.plugin_superbwarfare.vehicle_deployer": "Vehicle Deployer", "config.jade.plugin_superbwarfare.vehicle_deployer": "Vehicle Deployer",
"superbwarfare.advancement.main.root": "Superb Warfare", "superbwarfare.advancement.main.root": "Superb Warfare",

View file

@ -616,6 +616,9 @@
"config.jade.plugin_superbwarfare.c4_info": "C4信息", "config.jade.plugin_superbwarfare.c4_info": "C4信息",
"des.jade_plugin_superbwarfare.c4.remote_control": "远程遥控", "des.jade_plugin_superbwarfare.c4.remote_control": "远程遥控",
"des.jade_plugin_superbwarfare.c4.time_left": "爆炸剩余时间:%1$s秒", "des.jade_plugin_superbwarfare.c4.time_left": "爆炸剩余时间:%1$s秒",
"config.jade.plugin_superbwarfare.dps_generator": "DPS发电机信息",
"des.jade_plugin_superbwarfare.dps_generator.level": "发电机等级:%1$s",
"des.jade_plugin_superbwarfare.dps_generator.health": "当前最大血量:%1$s",
"config.jade.plugin_superbwarfare.vehicle_deployer": "载具部署器", "config.jade.plugin_superbwarfare.vehicle_deployer": "载具部署器",
"superbwarfare.advancement.main.root": "卓越前线", "superbwarfare.advancement.main.root": "卓越前线",