mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-19 12:17:17 -04:00
Merge branch 'master' of github.com:MightyPirates/OpenComputers into master-MC1.7.10
Conflicts: src/main/java/li/cil/oc/common/asm/SimpleComponentTickHandler.java
This commit is contained in:
commit
b651a24362
@ -5,12 +5,16 @@ import cpw.mods.fml.common.gameevent.TickEvent;
|
|||||||
import li.cil.oc.api.Network;
|
import li.cil.oc.api.Network;
|
||||||
import li.cil.oc.util.SideTracker;
|
import li.cil.oc.util.SideTracker;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
import org.apache.logging.log4j.LogManager;
|
||||||
|
import org.apache.logging.log4j.Logger;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
// This class is used for adding simple components to the component network.
|
// This class is used for adding simple components to the component network.
|
||||||
// It is triggered from a validate call, and executed in the next update tick.
|
// It is triggered from a validate call, and executed in the next update tick.
|
||||||
public final class SimpleComponentTickHandler {
|
public final class SimpleComponentTickHandler {
|
||||||
|
private static final Logger log = LogManager.getLogger("OpenComputers");
|
||||||
|
|
||||||
public static final ArrayList<Runnable> pending = new java.util.ArrayList<Runnable>();
|
public static final ArrayList<Runnable> pending = new java.util.ArrayList<Runnable>();
|
||||||
|
|
||||||
public static final SimpleComponentTickHandler Instance = new SimpleComponentTickHandler();
|
public static final SimpleComponentTickHandler Instance = new SimpleComponentTickHandler();
|
||||||
@ -40,7 +44,11 @@ public final class SimpleComponentTickHandler {
|
|||||||
pending.clear();
|
pending.clear();
|
||||||
}
|
}
|
||||||
for (Runnable runnable : adds) {
|
for (Runnable runnable : adds) {
|
||||||
runnable.run();
|
try {
|
||||||
|
runnable.run();
|
||||||
|
} catch (Throwable t) {
|
||||||
|
log.warn("Error in scheduled tick action.", t);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -71,6 +71,9 @@ abstract class GraphicsCard extends component.ManagedComponent {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Callback(doc = """function():string -- Get the address of the screen the GPU is currently bound to.""")
|
||||||
|
def getScreen(context: Context, args: Arguments): Array[AnyRef] = screen(s => result(s.node.address))
|
||||||
|
|
||||||
@Callback(direct = true, doc = """function():number, boolean -- Get the current background color and whether it's from the palette or not.""")
|
@Callback(direct = true, doc = """function():number, boolean -- Get the current background color and whether it's from the palette or not.""")
|
||||||
def getBackground(context: Context, args: Arguments): Array[AnyRef] =
|
def getBackground(context: Context, args: Arguments): Array[AnyRef] =
|
||||||
screen(s => result(s.getBackgroundColor, s.isBackgroundFromPalette))
|
screen(s => result(s.getBackgroundColor, s.isBackgroundFromPalette))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user