Couple of warnings

This commit is contained in:
drcrazy 2020-10-29 15:13:05 +03:00
parent fae818db1c
commit f5107cacd0

View file

@ -50,9 +50,7 @@ public class AlarmBlockEntity extends BlockEntity
} }
public void rightClick() { public void rightClick() {
if (world.isClient) { if (world == null || world.isClient) return;
return;
}
if (selectedSound < 3) { if (selectedSound < 3) {
selectedSound++; selectedSound++;
@ -84,15 +82,12 @@ public class AlarmBlockEntity extends BlockEntity
super.fromTag(blockState, compound); super.fromTag(blockState, compound);
} }
// ITickable // Tickable
@Override @Override
public void tick() { public void tick() {
if (world.isClient()) { if (world == null || world.isClient()) return;
return; if (world.getTime() % 25 != 0) return;
}
if (world.getTime() % 25 != 0) {
return;
}
if (world.isReceivingRedstonePower(getPos())) { if (world.isReceivingRedstonePower(getPos())) {
BlockAlarm.setActive(true, world, pos); BlockAlarm.setActive(true, world, pos);
switch (selectedSound) { switch (selectedSound) {