Skip to content

Commit

Permalink
Merge branch 'master-dev' into master-1.11.2
Browse files Browse the repository at this point in the history
  • Loading branch information
CD4017BE committed Mar 25, 2018
2 parents fde4825 + 49bb136 commit 7aae379
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 17 deletions.
18 changes: 18 additions & 0 deletions .github/issue_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
### What I did:
_Description of your setup (how devices where configured, connected etc.) and what you did (eventually a screenshot)_

### What happened:
_Description of what happened, how things behaved and/or crash report (if any) or log entries (only the relevant parts if any)_

### What should have happened:
_The behavior you expected or would like to have (obsolete for crashes)_

_Personal ideas, notes, suggestions, etc. (optional)_

### Used Versions:
- Minecraft-?.?.?
- AutomatedRedstone-?.?.?
- CD4017BE_lib-?.?.?
- Forge-?.?.?.?
- _other installed mods (optional / only if relevant)_
- _relevant changes to config (if any)_
2 changes: 1 addition & 1 deletion src/java/cd4017be/circuits/RedstoneCircuits.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class RedstoneCircuits {
public static CommonProxy proxy;

public RedstoneCircuits() {
RecipeScriptContext.scriptRegistry.add(new Version("automatedRedstone", 409, "/assets/" + ID + "/config/recipes.rcp"));
RecipeScriptContext.scriptRegistry.add(new Version("automatedRedstone", 411, "/assets/" + ID + "/config/recipes.rcp"));
}

@Mod.EventHandler
Expand Down
25 changes: 21 additions & 4 deletions src/java/cd4017be/circuits/tileEntity/Circuit.java
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,8 @@ private int[] cpuTick() {
int a = getNum(ram[++readIdx]);
x = a >= 0 ? sqrt(a) : -sqrt(-a);
} break;
case C_BSR: x = getNum(ram[++readIdx]) >>> getNum(ram[++readIdx]); break;
case C_BSL: x = getNum(ram[++readIdx]) << getNum(ram[++readIdx]); break;
case C_BSR: x = getNumU(ram[++readIdx]) >>> getNum(ram[++readIdx]); break;
case C_BSL: x = getNumU(ram[++readIdx]) << getNum(ram[++readIdx]); break;
case C_COMB: x = 0; s = s * 2 + 1;
for (int mask = 1; s >= 0; s--, mask <<= 1) x |= read8bit() & mask;
ram[n++] = (byte)x;
Expand Down Expand Up @@ -291,6 +291,16 @@ public int getNum(int idx) {
}
}

public int getNumU(int idx) {
int p = idx & 0x3f;
switch(idx & 0xc0) {
case 0x00: return ram[p] & 0xff;
case 0x40: return ram[p] & 0xff | ram[++p] << 8 & 0xff00;
case 0x80: return ram[p] & 0xff | ram[++p] << 8 & 0xff00 | ram[++p] << 16 & 0xff0000;
default: return ram[p] & 0xff | ram[++p] << 8 & 0xff00 | ram[++p] << 16 & 0xff0000 | ram[++p] << 24;
}
}

public int getMinInterval() {
return ClockSpeed[getBlockMetadata() % ClockSpeed.length];
}
Expand Down Expand Up @@ -335,14 +345,21 @@ public void onPacketFromClient(PacketBuffer data, EntityPlayer sender) throws IO
}
} else if (cmd == 3) {
for (int i = startIdx, j = 0; i < ram.length; i++) {
//get op
byte b = ram[i];
if (b == C_SKIP) {
j += ram[++i] & 0x3f;
continue;
}
ModuleType mt = ModuleType.values()[b & 0x3f];
//skip extra data
int w = mt.varInAm ? ((b >> 6 & 3) + 1) * mt.group : mt.cons();
for (int k = 0; k < w; k++)
if (Assembler.extraByte(ram[++i], mt.conType(k))) i++;
//get size
int k = mt.isNum ? j + (b >> 6 & 3) : j + mt.size - 1;
if (mt.cons() == 0) j = k + 1;
else {
if (mt.cons() == 0) j = k + 1; //don't reset constants
else {//reset bytes
if (k >= startIdx) k = startIdx - 1;
while (j <= k) ram[j++] = 0;
}
Expand Down
10 changes: 3 additions & 7 deletions src/java/multiblock/IntegerComp.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,8 @@ public IntegerComp(IAbstractTile tile, int bitSize) {
public short rsIO;

public void setUID(long uid) {
if (this.uid != 0) return;
this.uid = uid;
if (network != null) {
network.components.remove(0L);
network.components.put(uid, this);
} else new SharedInteger(this);
super.setUID(uid);
if (network == null) new SharedInteger(this);
network.setIO(this, rsIO);
}

Expand Down Expand Up @@ -65,7 +61,7 @@ public IntegerComp getNeighbor(byte side) {
public void readFromNBT(NBTTagCompound nbt) {
con = nbt.getByte("con");
rsIO = nbt.getShort("io");
if (uid != 0) network.setIO(this, rsIO);
if (network != null) network.setIO(this, rsIO);
inputState = nbt.getInteger("state");
}

Expand Down
10 changes: 5 additions & 5 deletions src/resources/assets/circuits/config/recipes.rcp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION = 409;
VERSION = 411;
{
circuit_ticks = [20, 5, 1]#; !min operation delay in ticks for each tier of circuit casing
Loc range = 20; !maximum range for sensor modules in blocks
Expand All @@ -21,7 +21,7 @@ PRE_INIT() {
INIT() {
Loc WILDCARD = 32767;
Loc slab = it("minecraft:stone_slab");
Loc nbt = "#IO,#Cap,#Gate,#Calc,#data,#name,#io,#ofs";!<- DON'T EDIT (bad things would happen)
Loc nbt = "#IO,#Cap,#Gate,#Calc,#data,#name,#io,#ofs,#used";!<- DON'T EDIT (bad things would happen)
add("shapeless", it("item.circuit_plan"), it("item.circuit_plan"));
add("shaped", it("item.circuit_plan"), "0/1/2", "dyeBlack", it("minecraft:paper"), it("minecraft:glass_pane"));
add("shaped", it("tile.designer"), "010/232", "dustRedstone", it("item.circuit_plan"), slab, it("minecraft:crafting_table"));
Expand Down Expand Up @@ -51,8 +51,8 @@ INIT() {
add("shapeless", it("item.time_sensor"), it("m.empty_sensor"), it("minecraft:clock"));
add("shapeless", it("item.energy_sensor"), it("m.empty_sensor"), it("minecraft:piston"));
add("shapeless", it("item.remote_comp"), it("m.empty_sensor"), "gemQuartz");
add("shaped", it("m.io_relay", 16), "021", it("rsp1bitI"), it("rsp1bitO"), it("minecraft:lever"));
add("shaped", it("m.ram_plate", 4), " 1 /000", slab, it("tile.rsp_32bit"));
add("shaped", it("m.logic_prc", 8), "010/121/010", "dustRedstone", it("minecraft:redstone_torch"), "ingotIron");
add("shaped", it("m.io_relay", 32), "021", it("rsp1bitI"), it("rsp1bitO"), it("minecraft:lever"));
add("shaped", it("m.ram_plate", 2), "1/0", slab, it("rsp1bitN"));
add("shaped", it("m.logic_prc", 8), "010/121/010", "dustRedstone", it("minecraft:redstone_torch"), "stone");
add("shaped", it("m.calc_prc", 2), "010/010/222", it("m.logic_prc"), "gemQuartz", "nuggetGold");
}

0 comments on commit 7aae379

Please sign in to comment.