Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
dnk1234567 committed Dec 12, 2024
1 parent 354a583 commit ad805fd
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,12 @@ public void step() {
}
}

public void updatescreen(){
state = State.RUN;
getCasing().setChanged();
sendPartialState();
}

@Override
public void onEnabled() {
sendFullState();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ public final class MachineImpl implements Machine {
private final ExecutionModule module;
private final Map<Target, TargetInterface> interfaces;

public ExecutionModule getModule(){
return this.module;
}

// --------------------------------------------------------------------- //

public MachineImpl(final ExecutionModule module, final Face face) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
abstract class AbstractMoveInstruction implements Instruction {
protected final Target destination;


protected AbstractMoveInstruction(final Target destination) {
this.destination = destination;
}
Expand All @@ -18,7 +19,12 @@ public void onBeforeWriteComplete(final MachineImpl machine, final Port port) {
}

@Override
public void onWriteCompleted(final Machine machine, final Port port) {
public void onWriteCompleted(final MachineImpl machine, final Port port) {
machine.getState().pc++;
if (machine.getState().pc < 0 || machine.getState().pc >= machine.getState().instructions.size()){
machine.getState().pc = 0;
}
machine.getModule().updatescreen();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,6 @@ default void onBeforeWriteComplete(final MachineImpl machine, final Port port) {
* @param machine the machine the operation finished on.
* @param port the port the operation finished on.
*/
default void onWriteCompleted(final Machine machine, final Port port) {
default void onWriteCompleted(final MachineImpl machine, final Port port) {
}
}
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@ fabric-sodium = { group = "maven.modrinth", name = "sodium", version = "mc1.20.1
forge-platform = { group = "net.minecraftforge", name = "forge", version.ref = "forge-platform" }
forge-architectury = { group = "dev.architectury", name = "architectury-forge", version.ref = "architectury" }

forge-manual = { group = "curse.maven", name = "markdownmanual-502485", version = "4719408" }
forge-manual = { group = "curse.maven", name = "markdownmanual-502485", version = "4873115" }

forge-justEnoughItems = { group = "curse.maven", name = "jei-238222", version = "4690097" }

0 comments on commit ad805fd

Please sign in to comment.