Skip to content

Commit cafd40e

Browse files
author
Circulate233
committed
仍然是修复服务端崩溃
1 parent 32d5507 commit cafd40e

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

src/main/java/github/kasuminova/novaeng/common/item/ItemWirelessUniversalTerminal.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
import net.minecraft.util.*;
3232
import net.minecraft.util.math.BlockPos;
3333
import net.minecraft.world.World;
34+
import net.minecraftforge.fml.common.FMLCommonHandler;
3435
import net.minecraftforge.fml.common.Loader;
3536
import net.minecraftforge.fml.common.Optional;
3637
import net.minecraftforge.fml.common.network.IGuiHandler;
@@ -146,10 +147,14 @@ public boolean canHandle(ItemStack is) {
146147
@Nonnull
147148
@Override
148149
public String getItemStackDisplayName(@Nonnull ItemStack stack) {
149-
if (stack.getTagCompound() != null) {
150-
return (I18n.format(this.getUnlocalizedNameInefficiently(stack) + ".name").trim() + AllWireless(stack.getTagCompound().getInteger("mode"))).trim();
150+
if (FMLCommonHandler.instance().getEffectiveSide().isClient()) {
151+
if (stack.getTagCompound() != null) {
152+
return (I18n.format(this.getUnlocalizedNameInefficiently(stack) + ".name").trim() + AllWireless(stack.getTagCompound().getInteger("mode"))).trim();
153+
} else {
154+
return super.getItemStackDisplayName(stack);
155+
}
151156
} else {
152-
return super.getItemStackDisplayName(stack);
157+
return "";
153158
}
154159
}
155160

0 commit comments

Comments
 (0)