okay fixed

uxn
Walker Fowlkes 1 month ago
parent f610b58d40
commit da44fe3daf

@ -2,6 +2,7 @@ package net.brokenmoon.redcontrol.screen;
import net.brokenmoon.redcontrol.RedControl;
import net.brokenmoon.redcontrol.RedControlNetworking;
import net.brokenmoon.redcontrol.api.CpuState;
import net.brokenmoon.redcontrol.blockentities.CpuEntity;
import net.fabricmc.fabric.api.client.networking.v1.ClientPlayNetworking;
import net.fabricmc.fabric.api.networking.v1.PacketByteBufs;
@ -64,12 +65,7 @@ public class CpuScreen extends Screen {
@Override
public void render(DrawContext context, int mouseX, int mouseY, float delta) {
super.render(context, mouseX, mouseY, delta);
int buttonPos = 7;
if(cpu.isRunning){
buttonPos = 0;
} else if(cpu.isResetting || cpu.isReset){
buttonPos = 14;
}
int buttonPos = cpu.getCpuState().offset;
int x = (width - 176) / 2;
int y = (height - 166) / 2;
context.drawTexture(cpuTexture,x,y,0,0,176,166);

@ -0,0 +1,5 @@
package net.brokenmoon.redcontrol.api;
public interface CpuControl {
CpuState getCpuState();
}

@ -0,0 +1,7 @@
package net.brokenmoon.redcontrol.api;
public enum CpuState {
RUNNING(0), STOPPED(7), RESET(14);
public final int offset;
CpuState(int off){offset = off;}
}

@ -24,7 +24,7 @@ public class CpuEntity extends Peripheral implements CpuControl {
private int defaultMonitorId = 1;
private int defaultDriveId = 2;
private CpuState state;
private CpuState state = CpuState.STOPPED;
@Override
public CpuState getCpuState() {return state;}

Loading…
Cancel
Save