1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2025-08-30 17:17:55 +00:00

Add redstone relay block (#2002)

- Move redstone methods out of the IAPIEnvironment, and into a new
   RedstoneAccess. We similarly move the implementation from Environment
   into a new RedstoneState class.

   The interface is possibly a little redundant (interfaces with a
   single implementation are always a little suspect), but it's nice to
   keep the consumer/producer interfaces separate.

 - Abstract most redstone API methods into a separate shared class, that
   can be used by both the rs API and the new redstone relay.

 - Add the new redstone relay block.

The docs are probably a little lacking here, but I really struggled to
write anything which wasn't just "look, it's the same as the redstone
API".
This commit is contained in:
Jonathan Coates
2024-11-12 09:05:27 +00:00
committed by GitHub
parent ba6da3bc6c
commit 4f66ac79d3
50 changed files with 1610 additions and 353 deletions

View File

@@ -0,0 +1,12 @@
{
"type": "minecraft:crafting_shaped",
"category": "redstone",
"key": {
"C": {"item": "computercraft:wired_modem"},
"R": {"tag": "c:redstone_dusts"},
"S": {"item": "minecraft:stone"}
},
"pattern": ["SRS", "RCR", "SRS"],
"result": {"item": "computercraft:redstone_relay"},
"show_notification": true
}

View File

@@ -0,0 +1 @@
{"replace": false, "values": ["computercraft:lectern"]}

View File

@@ -13,6 +13,7 @@
"computercraft:wireless_modem_normal",
"computercraft:wireless_modem_advanced",
"computercraft:wired_modem_full",
"computercraft:cable"
"computercraft:cable",
"computercraft:redstone_relay"
]
}

View File

@@ -79,6 +79,7 @@ public class ComputerCraft {
PeripheralLookup.get().registerForBlockEntity(WirelessModemBlockEntity::getPeripheral, ModRegistry.BlockEntities.WIRELESS_MODEM_ADVANCED.get());
PeripheralLookup.get().registerForBlockEntity(WiredModemFullBlockEntity::getPeripheral, ModRegistry.BlockEntities.WIRED_MODEM_FULL.get());
PeripheralLookup.get().registerForBlockEntity(CableBlockEntity::getPeripheral, ModRegistry.BlockEntities.CABLE.get());
PeripheralLookup.get().registerForBlockEntity((b, d) -> b.peripheral(), ModRegistry.BlockEntities.REDSTONE_RELAY.get());
WiredElementLookup.get().registerForBlockEntity((b, d) -> b.getElement(), ModRegistry.BlockEntities.WIRED_MODEM_FULL.get());
WiredElementLookup.get().registerForBlockEntity(CableBlockEntity::getWiredElement, ModRegistry.BlockEntities.CABLE.get());