fixed NPE

This commit is contained in:
FlorianMichael 2023-02-25 18:39:25 +01:00
parent 193281823e
commit 1e66320771
3 changed files with 6 additions and 3 deletions

View File

@ -4,7 +4,9 @@ public class IdlePacketExecutor {
private static Runnable skipIdlePacketExecute;
public static void skipIdlePacket() {
skipIdlePacketExecute.run();
if (skipIdlePacketExecute != null) {
skipIdlePacketExecute.run();
}
}
public static void registerIdlePacketSkipExecute(final Runnable runnable) {

View File

@ -29,8 +29,9 @@ public class MixinSoulSandBlock extends Block {
@Override
public float getVelocityMultiplier() {
if (ViaLoadingBase.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_14_4))
if (ViaLoadingBase.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_14_4)) {
return 1.0F;
}
return super.getVelocityMultiplier();
}
}

View File

@ -34,7 +34,7 @@ public class ProtocolSelectionScreen extends Screen {
protected void init() {
super.init();
this.addDrawableChild(new SlotList(this.client, width, height, 3 + 3 /* start offset */ + (textRenderer.fontHeight + 2) * 3 /* title is 2 */, height + 5, textRenderer.fontHeight + 4));
this.addDrawableChild(new SlotList(this.client, width, height, 3 + 3 /* start offset */ + (textRenderer.fontHeight + 2) * 3 /* title is 2 */, height + 5, textRenderer.fontHeight + 2));
this.addDrawableChild(ButtonWidget.builder(Text.literal("<-"), button -> this.close()).position(0, height - 20).size(20, 20).build());
this.addDrawableChild(ButtonWidget.builder(Text.literal("Values"), button -> ValuesScreen.open(this)).position(0, 0).size(98, 20).build());