更换DPS发电机的贴图
This commit is contained in:
parent
6aa5da1311
commit
709f36a812
5 changed files with 16 additions and 1 deletions
|
@ -3,6 +3,7 @@ package com.atsuishio.superbwarfare.client.model.entity;
|
||||||
import com.atsuishio.superbwarfare.Mod;
|
import com.atsuishio.superbwarfare.Mod;
|
||||||
import com.atsuishio.superbwarfare.entity.DPSGeneratorEntity;
|
import com.atsuishio.superbwarfare.entity.DPSGeneratorEntity;
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.ResourceLocation;
|
||||||
|
import net.minecraft.util.Mth;
|
||||||
import software.bernie.geckolib.model.GeoModel;
|
import software.bernie.geckolib.model.GeoModel;
|
||||||
|
|
||||||
public class DPSGeneratorModel extends GeoModel<DPSGeneratorEntity> {
|
public class DPSGeneratorModel extends GeoModel<DPSGeneratorEntity> {
|
||||||
|
@ -19,6 +20,6 @@ public class DPSGeneratorModel extends GeoModel<DPSGeneratorEntity> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ResourceLocation getTextureResource(DPSGeneratorEntity entity) {
|
public ResourceLocation getTextureResource(DPSGeneratorEntity entity) {
|
||||||
return Mod.loc("textures/entity/dps_generator_tier_" + entity.getGeneratorLevel() + ".png");
|
return Mod.loc("textures/entity/dps_generator_tier_" + Mth.clamp(entity.getGeneratorLevel(), 0, 7) + ".png");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,8 +2,10 @@ package com.atsuishio.superbwarfare.item;
|
||||||
|
|
||||||
import com.atsuishio.superbwarfare.entity.DPSGeneratorEntity;
|
import com.atsuishio.superbwarfare.entity.DPSGeneratorEntity;
|
||||||
import com.atsuishio.superbwarfare.init.ModEntities;
|
import com.atsuishio.superbwarfare.init.ModEntities;
|
||||||
|
import net.minecraft.ChatFormatting;
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.core.Direction;
|
import net.minecraft.core.Direction;
|
||||||
|
import net.minecraft.network.chat.Component;
|
||||||
import net.minecraft.server.level.ServerLevel;
|
import net.minecraft.server.level.ServerLevel;
|
||||||
import net.minecraft.stats.Stats;
|
import net.minecraft.stats.Stats;
|
||||||
import net.minecraft.world.InteractionHand;
|
import net.minecraft.world.InteractionHand;
|
||||||
|
@ -13,6 +15,7 @@ import net.minecraft.world.entity.MobSpawnType;
|
||||||
import net.minecraft.world.entity.player.Player;
|
import net.minecraft.world.entity.player.Player;
|
||||||
import net.minecraft.world.item.Item;
|
import net.minecraft.world.item.Item;
|
||||||
import net.minecraft.world.item.ItemStack;
|
import net.minecraft.world.item.ItemStack;
|
||||||
|
import net.minecraft.world.item.TooltipFlag;
|
||||||
import net.minecraft.world.item.context.UseOnContext;
|
import net.minecraft.world.item.context.UseOnContext;
|
||||||
import net.minecraft.world.level.ClipContext;
|
import net.minecraft.world.level.ClipContext;
|
||||||
import net.minecraft.world.level.Level;
|
import net.minecraft.world.level.Level;
|
||||||
|
@ -23,13 +26,22 @@ import net.minecraft.world.phys.BlockHitResult;
|
||||||
import net.minecraft.world.phys.HitResult;
|
import net.minecraft.world.phys.HitResult;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
|
import javax.annotation.ParametersAreNonnullByDefault;
|
||||||
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
public class DPSGeneratorDeployer extends Item {
|
public class DPSGeneratorDeployer extends Item {
|
||||||
|
|
||||||
public DPSGeneratorDeployer() {
|
public DPSGeneratorDeployer() {
|
||||||
super(new Properties());
|
super(new Properties());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@ParametersAreNonnullByDefault
|
||||||
|
public void appendHoverText(ItemStack stack, TooltipContext context, List<Component> tooltipComponents, TooltipFlag tooltipFlag) {
|
||||||
|
tooltipComponents.add(Component.translatable("des.superbwarfare.dps_generator_deployer").withStyle(ChatFormatting.GRAY).withStyle(ChatFormatting.ITALIC));
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public @NotNull InteractionResult useOn(UseOnContext pContext) {
|
public @NotNull InteractionResult useOn(UseOnContext pContext) {
|
||||||
Level level = pContext.getLevel();
|
Level level = pContext.getLevel();
|
||||||
|
|
|
@ -177,6 +177,7 @@
|
||||||
"item.superbwarfare.ancient_cpu": "Ancient CPU",
|
"item.superbwarfare.ancient_cpu": "Ancient CPU",
|
||||||
"item.superbwarfare.target_deployer": "Target",
|
"item.superbwarfare.target_deployer": "Target",
|
||||||
"item.superbwarfare.dps_generator_deployer": "DPS Generator",
|
"item.superbwarfare.dps_generator_deployer": "DPS Generator",
|
||||||
|
"des.superbwarfare.dps_generator_deployer": "\"So what is your DPS?\"",
|
||||||
"item.superbwarfare.senpai_spawn_egg": "Senpai Spawn Egg",
|
"item.superbwarfare.senpai_spawn_egg": "Senpai Spawn Egg",
|
||||||
"item.superbwarfare.knife": "Knife",
|
"item.superbwarfare.knife": "Knife",
|
||||||
"item.superbwarfare.hammer": "Hammer",
|
"item.superbwarfare.hammer": "Hammer",
|
||||||
|
|
|
@ -177,6 +177,7 @@
|
||||||
"item.superbwarfare.ancient_cpu": "古代处理器",
|
"item.superbwarfare.ancient_cpu": "古代处理器",
|
||||||
"item.superbwarfare.target_deployer": "标靶",
|
"item.superbwarfare.target_deployer": "标靶",
|
||||||
"item.superbwarfare.dps_generator_deployer": "DPS发电机",
|
"item.superbwarfare.dps_generator_deployer": "DPS发电机",
|
||||||
|
"des.superbwarfare.dps_generator_deployer": "“那我问你,你DPS多少?”",
|
||||||
"item.superbwarfare.senpai_spawn_egg": "野兽先辈刷怪蛋",
|
"item.superbwarfare.senpai_spawn_egg": "野兽先辈刷怪蛋",
|
||||||
"item.superbwarfare.knife": "军刀",
|
"item.superbwarfare.knife": "军刀",
|
||||||
"item.superbwarfare.hammer": "大锤",
|
"item.superbwarfare.hammer": "大锤",
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 428 B After Width: | Height: | Size: 207 B |
Loading…
Add table
Reference in a new issue