Cleaner code
This commit is contained in:
parent
017478b312
commit
9c3ef93695
@ -22,7 +22,7 @@ import java.math.BigDecimal;
|
||||
import java.util.Optional;
|
||||
|
||||
public class AndroidGui {
|
||||
private final Minecraft mc = Minecraft.getInstance();
|
||||
private static final Minecraft mc = Minecraft.getInstance();
|
||||
private final ForgeIngameGui gui = mc.gui instanceof ForgeIngameGui ? (ForgeIngameGui) mc.gui : null;
|
||||
|
||||
public static final ResourceLocation PLAYER_GUI_LOCATION = new ResourceLocation(OverdriveThatMatters.MOD_ID, "textures/gui/player_gui.png");
|
||||
@ -34,12 +34,10 @@ public class AndroidGui {
|
||||
if (!(event.getGui() instanceof DeathScreen screen))
|
||||
return;
|
||||
|
||||
LocalPlayer ply = Minecraft.getInstance().player;
|
||||
|
||||
if (ply == null)
|
||||
if (mc.player == null)
|
||||
return;
|
||||
|
||||
ply.getCapability(MatteryCapability.ANDROID).ifPresent(cap -> {
|
||||
mc.player.getCapability(MatteryCapability.ANDROID).ifPresent(cap -> {
|
||||
if (cap.isAndroid())
|
||||
screen.title = new TranslatableComponent("otm.death_reason");
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user