Add BlockEntities support as optional/soft dependency
This commit is contained in:
parent
9b37426070
commit
3c8a0fdeab
17 changed files with 540 additions and 17 deletions
|
@ -66,6 +66,8 @@ dependencies {
|
||||||
|
|
||||||
//quiltMod "quilt-mod:resource-loader:1.0.2"
|
//quiltMod "quilt-mod:resource-loader:1.0.2"
|
||||||
quiltMod "com.github.CRModders:FluxAPI:0.4.0"
|
quiltMod "com.github.CRModders:FluxAPI:0.4.0"
|
||||||
|
|
||||||
|
quiltMod "com.github.ForwarD-NerN:BlockEntityPrototype:master-SNAPSHOT"
|
||||||
}
|
}
|
||||||
|
|
||||||
processResources {
|
processResources {
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
org.gradle.caching=false
|
org.gradle.caching=false
|
||||||
|
|
||||||
# Project Info
|
# Project Info
|
||||||
version=1.1.1
|
version=1.2.0
|
||||||
group=net.pietru
|
group=net.pietru
|
||||||
id=omni_power
|
id=omni_power
|
||||||
|
|
||||||
|
|
|
@ -6,19 +6,24 @@ import finalforeach.cosmicreach.world.blockevents.BlockEvents;
|
||||||
import net.pietru.omni_power.blockevents.Power;
|
import net.pietru.omni_power.blockevents.Power;
|
||||||
import org.coolcosmos.cosmicquilt.api.entrypoint.ModInitializer;
|
import org.coolcosmos.cosmicquilt.api.entrypoint.ModInitializer;
|
||||||
import org.quiltmc.loader.api.ModContainer;
|
import org.quiltmc.loader.api.ModContainer;
|
||||||
|
import org.quiltmc.loader.api.QuiltLoader;
|
||||||
|
|
||||||
public class OmniPower implements ModInitializer {
|
public class OmniPower implements ModInitializer {
|
||||||
public static final String MOD_ID = "omni_power";
|
public static final String MOD_ID = "omni_power";
|
||||||
|
public static boolean block_entities = false;
|
||||||
public static final String[] blocks = {
|
public static final String[] blocks = {
|
||||||
"cable",
|
"cable",
|
||||||
"lever",
|
"lever",
|
||||||
"door_cube",
|
"door_cube",
|
||||||
"cable_merger"
|
"cable_merger",
|
||||||
|
"cable_adapter"
|
||||||
};
|
};
|
||||||
@Override
|
@Override
|
||||||
public void onInitialize(ModContainer mod) {
|
public void onInitialize(ModContainer mod) {
|
||||||
|
if (QuiltLoader.isModLoaded("becraft"))
|
||||||
|
block_entities=true;
|
||||||
System.out.println("Pop Structures Mod Initialized!");
|
System.out.println("Pop Structures Mod Initialized!");
|
||||||
BlockEvents.registerBlockEventAction(new Power());
|
BlockEvents.registerBlockEventAction(new Power(block_entities));
|
||||||
for (String block:blocks) {
|
for (String block:blocks) {
|
||||||
BlockBuilderUtils.getBlockFromJson(new Identifier(MOD_ID, block));
|
BlockBuilderUtils.getBlockFromJson(new Identifier(MOD_ID, block));
|
||||||
}
|
}
|
||||||
|
|
15
src/main/java/net/pietru/omni_power/api/EPowerProducer.java
Normal file
15
src/main/java/net/pietru/omni_power/api/EPowerProducer.java
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
package net.pietru.omni_power.api;
|
||||||
|
|
||||||
|
import finalforeach.cosmicreach.world.BlockPosition;
|
||||||
|
import finalforeach.cosmicreach.world.World;
|
||||||
|
import ru.nern.becraft.bed.api.BlockEntity;
|
||||||
|
import ru.nern.becraft.bed.api.BlockEntityType;
|
||||||
|
|
||||||
|
|
||||||
|
public abstract class EPowerProducer extends BlockEntity implements IPowerProducer{
|
||||||
|
public EPowerProducer(BlockEntityType<?> type, World world, BlockPosition blockPos) {
|
||||||
|
super(type, world, blockPos);
|
||||||
|
}
|
||||||
|
|
||||||
|
public abstract void send_to_client(BlockEntity client);
|
||||||
|
}
|
|
@ -0,0 +1,5 @@
|
||||||
|
package net.pietru.omni_power.api;
|
||||||
|
|
||||||
|
|
||||||
|
public interface IPowerClient {
|
||||||
|
}
|
|
@ -0,0 +1,8 @@
|
||||||
|
package net.pietru.omni_power.api;
|
||||||
|
|
||||||
|
import ru.nern.becraft.bed.api.BlockEntity;
|
||||||
|
|
||||||
|
|
||||||
|
public interface IPowerProducer{
|
||||||
|
void send_to_client(BlockEntity client);
|
||||||
|
}
|
|
@ -8,11 +8,21 @@ import finalforeach.cosmicreach.world.blockevents.BlockEventTrigger;
|
||||||
import finalforeach.cosmicreach.world.blockevents.IBlockEventAction;
|
import finalforeach.cosmicreach.world.blockevents.IBlockEventAction;
|
||||||
import finalforeach.cosmicreach.world.blocks.BlockState;
|
import finalforeach.cosmicreach.world.blocks.BlockState;
|
||||||
import net.pietru.omni_power.OmniPower;
|
import net.pietru.omni_power.OmniPower;
|
||||||
|
import net.pietru.omni_power.api.EPowerProducer;
|
||||||
|
import net.pietru.omni_power.api.IPowerClient;
|
||||||
|
import net.pietru.omni_power.api.IPowerProducer;
|
||||||
|
import ru.nern.becraft.bed.BEUtils;
|
||||||
|
import ru.nern.becraft.bed.api.BlockEntity;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
public class Power implements IBlockEventAction {
|
public class Power implements IBlockEventAction {
|
||||||
|
public static boolean block_entities = false;
|
||||||
|
|
||||||
|
public Power(boolean block_entities_enabled){
|
||||||
|
block_entities=block_entities_enabled;
|
||||||
|
}
|
||||||
@Override
|
@Override
|
||||||
public String getActionId() {
|
public String getActionId() {
|
||||||
System.out.println("Registering "+ OmniPower.MOD_ID+":power");
|
System.out.println("Registering "+ OmniPower.MOD_ID+":power");
|
||||||
|
@ -28,9 +38,16 @@ public class Power implements IBlockEventAction {
|
||||||
OrderedMap<String, Object> p = blockEventTrigger.getParams();
|
OrderedMap<String, Object> p = blockEventTrigger.getParams();
|
||||||
String triggerId = (String)p.get("triggerId");
|
String triggerId = (String)p.get("triggerId");
|
||||||
String cable_group = (String)p.get("cable_group");
|
String cable_group = (String)p.get("cable_group");
|
||||||
Boolean self_run = true;
|
boolean self_run = true;
|
||||||
if (p.containsKey("self_run")) {
|
if (p.containsKey("self_run")) {
|
||||||
self_run = (Boolean)p.get("self_run");
|
self_run = (boolean)p.get("self_run");
|
||||||
|
}
|
||||||
|
boolean source_be = false;
|
||||||
|
BlockEntity source_entity = null;
|
||||||
|
if (block_entities){
|
||||||
|
source_entity = BEUtils.getBlockEntity(sourcePos);
|
||||||
|
if (source_entity!=null)
|
||||||
|
source_be = (source_entity instanceof IPowerProducer);
|
||||||
}
|
}
|
||||||
Array<BlockPosition> power_transmitters = new Array<>();
|
Array<BlockPosition> power_transmitters = new Array<>();
|
||||||
Array<BlockPosition> checked_blocks = new Array<>();
|
Array<BlockPosition> checked_blocks = new Array<>();
|
||||||
|
@ -50,6 +67,12 @@ public class Power implements IBlockEventAction {
|
||||||
if (to_check!=sourcePos || self_run){
|
if (to_check!=sourcePos || self_run){
|
||||||
runTrigger(triggerId,to_check,world);
|
runTrigger(triggerId,to_check,world);
|
||||||
}
|
}
|
||||||
|
if (block_entities && source_be){
|
||||||
|
BlockEntity target_entity = BEUtils.getBlockEntity(sourcePos);
|
||||||
|
if (target_entity!=null)
|
||||||
|
if (target_entity instanceof IPowerClient)
|
||||||
|
((EPowerProducer)source_entity).send_to_client(target_entity);
|
||||||
|
}
|
||||||
if (targetBlockState.stringId.contains(cable_group)){
|
if (targetBlockState.stringId.contains(cable_group)){
|
||||||
power_transmitters.add(to_check);
|
power_transmitters.add(to_check);
|
||||||
unchecked_blocks.addAll(get_touching_positions(world,to_check,targetBlockState));
|
unchecked_blocks.addAll(get_touching_positions(world,to_check,targetBlockState));
|
||||||
|
@ -83,20 +106,27 @@ public class Power implements IBlockEventAction {
|
||||||
|
|
||||||
public Array<BlockPosition> get_touching_positions(World world,BlockPosition pos,BlockState state){
|
public Array<BlockPosition> get_touching_positions(World world,BlockPosition pos,BlockState state){
|
||||||
Array<BlockPosition> arr = new Array<>();
|
Array<BlockPosition> arr = new Array<>();
|
||||||
if (state.stringId.contains("xp_power"))
|
BlockPosition side_pos;
|
||||||
arr.add(pos.getOffsetBlockPos(world, 1, 0, 0));
|
side_pos = pos.getOffsetBlockPos(world, 1, 0, 0);
|
||||||
if (state.stringId.contains("xm_power"))
|
if (state.stringId.contains("xp_power") && block_has_dir_or_all(side_pos,"xm_power"))
|
||||||
arr.add(pos.getOffsetBlockPos(world, -1, 0, 0));
|
arr.add(side_pos);
|
||||||
|
side_pos = pos.getOffsetBlockPos(world, -1, 0, 0);
|
||||||
|
if (state.stringId.contains("xm_power") && block_has_dir_or_all(side_pos,"xp_power"))
|
||||||
|
arr.add(side_pos);
|
||||||
|
|
||||||
if (state.stringId.contains("yp_power"))
|
side_pos = pos.getOffsetBlockPos(world, 0, 1, 0);
|
||||||
arr.add(pos.getOffsetBlockPos(world, 0, 1, 0));
|
if (state.stringId.contains("yp_power") && block_has_dir_or_all(side_pos,"ym_power"))
|
||||||
if (state.stringId.contains("ym_power"))
|
arr.add(side_pos);
|
||||||
arr.add(pos.getOffsetBlockPos(world, 0, -1, 0));
|
side_pos = pos.getOffsetBlockPos(world, 0, -1, 0);
|
||||||
|
if (state.stringId.contains("ym_power") && block_has_dir_or_all(side_pos,"yp_power"))
|
||||||
|
arr.add(side_pos);
|
||||||
|
|
||||||
if (state.stringId.contains("zp_power"))
|
side_pos = pos.getOffsetBlockPos(world, 0, 0, 1);
|
||||||
arr.add(pos.getOffsetBlockPos(world, 0, 0, 1));
|
if (state.stringId.contains("zp_power") && block_has_dir_or_all(side_pos,"zm_power"))
|
||||||
if (state.stringId.contains("zm_power"))
|
arr.add(side_pos);
|
||||||
arr.add(pos.getOffsetBlockPos(world, 0, 0, -1));
|
side_pos = pos.getOffsetBlockPos(world, 0, 0, -1);
|
||||||
|
if (state.stringId.contains("zm_power") && block_has_dir_or_all(side_pos,"zp_power"))
|
||||||
|
arr.add(side_pos);
|
||||||
|
|
||||||
if (arr.size<=0) {
|
if (arr.size<=0) {
|
||||||
arr.add(pos.getOffsetBlockPos(world, 1, 0, 0));
|
arr.add(pos.getOffsetBlockPos(world, 1, 0, 0));
|
||||||
|
@ -110,4 +140,20 @@ public class Power implements IBlockEventAction {
|
||||||
}
|
}
|
||||||
return arr;
|
return arr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Boolean block_has_dir_or_all(BlockPosition pos, String dir){
|
||||||
|
if (pos==null)
|
||||||
|
return false;
|
||||||
|
BlockState state = pos.getBlockState();
|
||||||
|
if (state==null)
|
||||||
|
return false;
|
||||||
|
return state.stringId.contains(dir) || !(
|
||||||
|
state.stringId.contains("xp_power")||
|
||||||
|
state.stringId.contains("xm_power")||
|
||||||
|
state.stringId.contains("yp_power")||
|
||||||
|
state.stringId.contains("ym_power")||
|
||||||
|
state.stringId.contains("zp_power")||
|
||||||
|
state.stringId.contains("zm_power")
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,86 @@
|
||||||
|
{
|
||||||
|
"parent":"base:block_events_default",
|
||||||
|
"stringId": "omni_power:adapter/cable_adapter_blue_off",
|
||||||
|
"triggers":
|
||||||
|
{
|
||||||
|
"universal_power":
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"actionId": "base:replace_block_state",
|
||||||
|
"parameters":
|
||||||
|
{
|
||||||
|
"xOff": 0, "yOff": 0, "zOff": 0,
|
||||||
|
"blockStateId": "omni_power:cable_adapter[powered,cable_blue]"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"actionId": "omni_power:power",
|
||||||
|
"parameters":
|
||||||
|
{
|
||||||
|
"triggerId": "power_up_blue",
|
||||||
|
"cable_group": "cable_blue",
|
||||||
|
"self_run": false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"power_up_blue":
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"actionId": "base:replace_block_state",
|
||||||
|
"parameters":
|
||||||
|
{
|
||||||
|
"xOff": 0, "yOff": 0, "zOff": 0,
|
||||||
|
"blockStateId": "omni_power:cable_adapter[powered,cable_blue]"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"actionId": "base:run_trigger",
|
||||||
|
"parameters":
|
||||||
|
{
|
||||||
|
"xOff": 1, "yOff": 0, "zOff": 0,
|
||||||
|
"triggerId": "universal_power"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"actionId": "base:run_trigger",
|
||||||
|
"parameters":
|
||||||
|
{
|
||||||
|
"xOff": -1, "yOff": 0, "zOff": 0,
|
||||||
|
"triggerId": "universal_power"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"actionId": "base:run_trigger",
|
||||||
|
"parameters":
|
||||||
|
{
|
||||||
|
"xOff": 0, "yOff": 1, "zOff": 0,
|
||||||
|
"triggerId": "universal_power"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"actionId": "base:run_trigger",
|
||||||
|
"parameters":
|
||||||
|
{
|
||||||
|
"xOff": 0, "yOff": -1, "zOff": 0,
|
||||||
|
"triggerId": "universal_power"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"actionId": "base:run_trigger",
|
||||||
|
"parameters":
|
||||||
|
{
|
||||||
|
"xOff": 0, "yOff": 0, "zOff": 1,
|
||||||
|
"triggerId": "universal_power"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"actionId": "base:run_trigger",
|
||||||
|
"parameters":
|
||||||
|
{
|
||||||
|
"xOff": 0, "yOff": 0, "zOff": -1,
|
||||||
|
"triggerId": "universal_power"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,86 @@
|
||||||
|
{
|
||||||
|
"parent":"base:block_events_default",
|
||||||
|
"stringId": "omni_power:adapter/cable_adapter_blue_on",
|
||||||
|
"triggers":
|
||||||
|
{
|
||||||
|
"universal_unpower":
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"actionId": "base:replace_block_state",
|
||||||
|
"parameters":
|
||||||
|
{
|
||||||
|
"xOff": 0, "yOff": 0, "zOff": 0,
|
||||||
|
"blockStateId": "omni_power:cable_adapter[default,cable_blue]"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"actionId": "omni_power:power",
|
||||||
|
"parameters":
|
||||||
|
{
|
||||||
|
"triggerId": "power_down_blue",
|
||||||
|
"cable_group": "cable_blue",
|
||||||
|
"self_run": false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"power_down_blue":
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"actionId": "base:replace_block_state",
|
||||||
|
"parameters":
|
||||||
|
{
|
||||||
|
"xOff": 0, "yOff": 0, "zOff": 0,
|
||||||
|
"blockStateId": "omni_power:cable_adapter[default,cable_blue]"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"actionId": "base:run_trigger",
|
||||||
|
"parameters":
|
||||||
|
{
|
||||||
|
"xOff": 1, "yOff": 0, "zOff": 0,
|
||||||
|
"triggerId": "universal_unpower"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"actionId": "base:run_trigger",
|
||||||
|
"parameters":
|
||||||
|
{
|
||||||
|
"xOff": -1, "yOff": 0, "zOff": 0,
|
||||||
|
"triggerId": "universal_unpower"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"actionId": "base:run_trigger",
|
||||||
|
"parameters":
|
||||||
|
{
|
||||||
|
"xOff": 0, "yOff": 1, "zOff": 0,
|
||||||
|
"triggerId": "universal_unpower"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"actionId": "base:run_trigger",
|
||||||
|
"parameters":
|
||||||
|
{
|
||||||
|
"xOff": 0, "yOff": -1, "zOff": 0,
|
||||||
|
"triggerId": "universal_unpower"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"actionId": "base:run_trigger",
|
||||||
|
"parameters":
|
||||||
|
{
|
||||||
|
"xOff": 0, "yOff": 0, "zOff": 1,
|
||||||
|
"triggerId": "universal_unpower"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"actionId": "base:run_trigger",
|
||||||
|
"parameters":
|
||||||
|
{
|
||||||
|
"xOff": 0, "yOff": 0, "zOff": -1,
|
||||||
|
"triggerId": "universal_unpower"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,86 @@
|
||||||
|
{
|
||||||
|
"parent":"base:block_events_default",
|
||||||
|
"stringId": "omni_power:adapter/cable_adapter_red_off",
|
||||||
|
"triggers":
|
||||||
|
{
|
||||||
|
"universal_power":
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"actionId": "base:replace_block_state",
|
||||||
|
"parameters":
|
||||||
|
{
|
||||||
|
"xOff": 0, "yOff": 0, "zOff": 0,
|
||||||
|
"blockStateId": "omni_power:cable_adapter[powered,cable_red]"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"actionId": "omni_power:power",
|
||||||
|
"parameters":
|
||||||
|
{
|
||||||
|
"triggerId": "power_up_red",
|
||||||
|
"cable_group": "cable_red",
|
||||||
|
"self_run": false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"power_up_red":
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"actionId": "base:replace_block_state",
|
||||||
|
"parameters":
|
||||||
|
{
|
||||||
|
"xOff": 0, "yOff": 0, "zOff": 0,
|
||||||
|
"blockStateId": "omni_power:cable_adapter[powered,cable_red]"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"actionId": "base:run_trigger",
|
||||||
|
"parameters":
|
||||||
|
{
|
||||||
|
"xOff": 1, "yOff": 0, "zOff": 0,
|
||||||
|
"triggerId": "universal_power"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"actionId": "base:run_trigger",
|
||||||
|
"parameters":
|
||||||
|
{
|
||||||
|
"xOff": -1, "yOff": 0, "zOff": 0,
|
||||||
|
"triggerId": "universal_power"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"actionId": "base:run_trigger",
|
||||||
|
"parameters":
|
||||||
|
{
|
||||||
|
"xOff": 0, "yOff": 1, "zOff": 0,
|
||||||
|
"triggerId": "universal_power"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"actionId": "base:run_trigger",
|
||||||
|
"parameters":
|
||||||
|
{
|
||||||
|
"xOff": 0, "yOff": -1, "zOff": 0,
|
||||||
|
"triggerId": "universal_power"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"actionId": "base:run_trigger",
|
||||||
|
"parameters":
|
||||||
|
{
|
||||||
|
"xOff": 0, "yOff": 0, "zOff": 1,
|
||||||
|
"triggerId": "universal_power"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"actionId": "base:run_trigger",
|
||||||
|
"parameters":
|
||||||
|
{
|
||||||
|
"xOff": 0, "yOff": 0, "zOff": -1,
|
||||||
|
"triggerId": "universal_power"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,86 @@
|
||||||
|
{
|
||||||
|
"parent":"base:block_events_default",
|
||||||
|
"stringId": "omni_power:adapter/cable_adapter_red_on",
|
||||||
|
"triggers":
|
||||||
|
{
|
||||||
|
"universal_unpower":
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"actionId": "base:replace_block_state",
|
||||||
|
"parameters":
|
||||||
|
{
|
||||||
|
"xOff": 0, "yOff": 0, "zOff": 0,
|
||||||
|
"blockStateId": "omni_power:cable_adapter[default,cable_red]"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"actionId": "omni_power:power",
|
||||||
|
"parameters":
|
||||||
|
{
|
||||||
|
"triggerId": "power_down_red",
|
||||||
|
"cable_group": "cable_red",
|
||||||
|
"self_run": false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"power_down_red":
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"actionId": "base:replace_block_state",
|
||||||
|
"parameters":
|
||||||
|
{
|
||||||
|
"xOff": 0, "yOff": 0, "zOff": 0,
|
||||||
|
"blockStateId": "omni_power:cable_adapter[default,cable_red]"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"actionId": "base:run_trigger",
|
||||||
|
"parameters":
|
||||||
|
{
|
||||||
|
"xOff": 1, "yOff": 0, "zOff": 0,
|
||||||
|
"triggerId": "universal_unpower"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"actionId": "base:run_trigger",
|
||||||
|
"parameters":
|
||||||
|
{
|
||||||
|
"xOff": -1, "yOff": 0, "zOff": 0,
|
||||||
|
"triggerId": "universal_unpower"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"actionId": "base:run_trigger",
|
||||||
|
"parameters":
|
||||||
|
{
|
||||||
|
"xOff": 0, "yOff": 1, "zOff": 0,
|
||||||
|
"triggerId": "universal_unpower"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"actionId": "base:run_trigger",
|
||||||
|
"parameters":
|
||||||
|
{
|
||||||
|
"xOff": 0, "yOff": -1, "zOff": 0,
|
||||||
|
"triggerId": "universal_unpower"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"actionId": "base:run_trigger",
|
||||||
|
"parameters":
|
||||||
|
{
|
||||||
|
"xOff": 0, "yOff": 0, "zOff": 1,
|
||||||
|
"triggerId": "universal_unpower"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"actionId": "base:run_trigger",
|
||||||
|
"parameters":
|
||||||
|
{
|
||||||
|
"xOff": 0, "yOff": 0, "zOff": -1,
|
||||||
|
"triggerId": "universal_unpower"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,53 @@
|
||||||
|
{
|
||||||
|
"stringId": "omni_power:cable_adapter",
|
||||||
|
"blockStates":
|
||||||
|
{
|
||||||
|
"default,cable_red":
|
||||||
|
{
|
||||||
|
"modelName": "omni_power:adapter/model_cable_adapter_red",
|
||||||
|
"blockEventsId": "omni_power:adapter/cable_adapter_red_off",
|
||||||
|
"isTransparent": false,
|
||||||
|
"generateSlabs": false,
|
||||||
|
"isOpaque": true,
|
||||||
|
"lightLevelRed": 0,
|
||||||
|
"lightLevelGreen": 0,
|
||||||
|
"lightLevelBlue": 0
|
||||||
|
},
|
||||||
|
"powered,cable_red":
|
||||||
|
{
|
||||||
|
"modelName": "omni_power:adapter/model_cable_adapter_red",
|
||||||
|
"blockEventsId": "omni_power:adapter/cable_adapter_red_on",
|
||||||
|
"isTransparent": false,
|
||||||
|
"generateSlabs": false,
|
||||||
|
"isOpaque": true,
|
||||||
|
"lightLevelRed": 0,
|
||||||
|
"lightLevelGreen": 0,
|
||||||
|
"lightLevelBlue": 0,
|
||||||
|
"catalogHidden": true
|
||||||
|
},
|
||||||
|
|
||||||
|
"default,cable_blue":
|
||||||
|
{
|
||||||
|
"modelName": "omni_power:adapter/model_cable_adapter_blue",
|
||||||
|
"blockEventsId": "omni_power:adapter/cable_adapter_blue_off",
|
||||||
|
"isTransparent": false,
|
||||||
|
"generateSlabs": false,
|
||||||
|
"isOpaque": true,
|
||||||
|
"lightLevelRed": 0,
|
||||||
|
"lightLevelGreen": 0,
|
||||||
|
"lightLevelBlue": 0
|
||||||
|
},
|
||||||
|
"powered,cable_blue":
|
||||||
|
{
|
||||||
|
"modelName": "omni_power:adapter/model_cable_adapter_blue",
|
||||||
|
"blockEventsId": "omni_power:adapter/cable_adapter_blue_on",
|
||||||
|
"isTransparent": false,
|
||||||
|
"generateSlabs": false,
|
||||||
|
"isOpaque": true,
|
||||||
|
"lightLevelRed": 0,
|
||||||
|
"lightLevelGreen": 0,
|
||||||
|
"lightLevelBlue": 0,
|
||||||
|
"catalogHidden": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,19 @@
|
||||||
|
{
|
||||||
|
"parent": "cube",
|
||||||
|
|
||||||
|
"textures":
|
||||||
|
{
|
||||||
|
"top":
|
||||||
|
{
|
||||||
|
"fileName": "omni_power:cable_adapter_blue.png"
|
||||||
|
},
|
||||||
|
"bottom":
|
||||||
|
{
|
||||||
|
"fileName": "omni_power:cable_adapter_blue.png"
|
||||||
|
},
|
||||||
|
"side":
|
||||||
|
{
|
||||||
|
"fileName": "omni_power:cable_adapter_blue.png"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,19 @@
|
||||||
|
{
|
||||||
|
"parent": "cube",
|
||||||
|
|
||||||
|
"textures":
|
||||||
|
{
|
||||||
|
"top":
|
||||||
|
{
|
||||||
|
"fileName": "omni_power:cable_adapter_red.png"
|
||||||
|
},
|
||||||
|
"bottom":
|
||||||
|
{
|
||||||
|
"fileName": "omni_power:cable_adapter_red.png"
|
||||||
|
},
|
||||||
|
"side":
|
||||||
|
{
|
||||||
|
"fileName": "omni_power:cable_adapter_red.png"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Binary file not shown.
After Width: | Height: | Size: 6.9 KiB |
Binary file not shown.
After Width: | Height: | Size: 4.7 KiB |
|
@ -41,6 +41,13 @@
|
||||||
"id": "fluxapi",
|
"id": "fluxapi",
|
||||||
"versions": ">=0.4.0"
|
"versions": ">=0.4.0"
|
||||||
}
|
}
|
||||||
|
],
|
||||||
|
|
||||||
|
"suggests": [
|
||||||
|
{
|
||||||
|
"id": "becraft",
|
||||||
|
"versions": ">=1.0.7"
|
||||||
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue