This commit is contained in:
parent
6811fec674
commit
246231e0ad
@ -5,7 +5,7 @@ import com.thebrokenrail.energonrelics.block.reactor.ReactorControllerBlock;
|
||||
import com.thebrokenrail.energonrelics.block.reactor.ReactorCoreBlock;
|
||||
import com.thebrokenrail.energonrelics.block.reactor.ReactorInputBlock;
|
||||
import com.thebrokenrail.energonrelics.block.ThermalCasingBlock;
|
||||
import com.thebrokenrail.energonrelics.block.battery.BatteryControllerBlock;
|
||||
import com.thebrokenrail.energonrelics.block.battery.PassiveBatteryControllerBlock;
|
||||
import com.thebrokenrail.energonrelics.block.battery.BatteryCoreBlock;
|
||||
import com.thebrokenrail.energonrelics.block.EnergonLightBlock;
|
||||
import com.thebrokenrail.energonrelics.block.SolarPanelBlock;
|
||||
@ -44,7 +44,7 @@ public class EnergonRelics implements ModInitializer {
|
||||
public static final ThermalCasingBlock THERMAL_CASING_BLOCK = new ThermalCasingBlock();
|
||||
|
||||
public static final BatteryCoreBlock BATTERY_CORE_BLOCk = new BatteryCoreBlock();
|
||||
public static final BatteryControllerBlock BATTERY_CONTROLLER_BLOCk = new BatteryControllerBlock();
|
||||
public static final PassiveBatteryControllerBlock PASSIVE_BATTERY_CONTROLLER_BLOCk = new PassiveBatteryControllerBlock();
|
||||
public static final ActiveBatteryControllerBlock ACTIVE_BATTERY_CONTROLLER_BLOCK = new ActiveBatteryControllerBlock();
|
||||
|
||||
public static final ReactorCoreBlock REACTOR_CORE_BLOCK = new ReactorCoreBlock();
|
||||
@ -71,7 +71,7 @@ public class EnergonRelics implements ModInitializer {
|
||||
THERMAL_CASING_BLOCK.register("thermal_casing");
|
||||
|
||||
BATTERY_CORE_BLOCk.register("battery_core");
|
||||
BATTERY_CONTROLLER_BLOCk.register("battery_controller");
|
||||
PASSIVE_BATTERY_CONTROLLER_BLOCk.register("passive_battery_controller");
|
||||
ACTIVE_BATTERY_CONTROLLER_BLOCK.register("active_battery_controller");
|
||||
|
||||
REACTOR_CORE_BLOCK.register("reactor_core");
|
||||
|
@ -6,7 +6,7 @@ import net.minecraft.block.entity.BlockEntityType;
|
||||
|
||||
import java.util.function.Function;
|
||||
|
||||
public class ActiveBatteryControllerBlock extends BatteryControllerBlock {
|
||||
public class ActiveBatteryControllerBlock extends PassiveBatteryControllerBlock {
|
||||
public ActiveBatteryControllerBlock() {
|
||||
super();
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
package com.thebrokenrail.energonrelics.block.battery;
|
||||
|
||||
import com.thebrokenrail.energonrelics.block.entity.battery.BatteryControllerBlockEntity;
|
||||
import com.thebrokenrail.energonrelics.block.entity.battery.PassiveBatteryControllerBlockEntity;
|
||||
import com.thebrokenrail.energonrelics.block.util.EnergyProviderBlock;
|
||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||
import net.minecraft.block.Block;
|
||||
@ -19,10 +19,10 @@ import net.minecraft.util.math.Direction;
|
||||
import java.util.function.Function;
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public class BatteryControllerBlock extends EnergyProviderBlock {
|
||||
public class PassiveBatteryControllerBlock extends EnergyProviderBlock {
|
||||
public static final DirectionProperty FACING = Properties.FACING;
|
||||
|
||||
public BatteryControllerBlock() {
|
||||
public PassiveBatteryControllerBlock() {
|
||||
super(FabricBlockSettings.of(Material.STONE).requiresTool().strength(1.5f, 6.0f));
|
||||
setDefaultState(getDefaultState().with(FACING, Direction.NORTH));
|
||||
}
|
||||
@ -49,6 +49,6 @@ public class BatteryControllerBlock extends EnergyProviderBlock {
|
||||
|
||||
@Override
|
||||
protected Function<BlockEntityType<BlockEntity>, BlockEntity> getFactory() {
|
||||
return BatteryControllerBlockEntity::new;
|
||||
return PassiveBatteryControllerBlockEntity::new;
|
||||
}
|
||||
}
|
@ -2,7 +2,7 @@ package com.thebrokenrail.energonrelics.block.entity.battery;
|
||||
|
||||
import net.minecraft.block.entity.BlockEntityType;
|
||||
|
||||
public class ActiveBatteryControllerBlockEntity extends BatteryControllerBlockEntity {
|
||||
public class ActiveBatteryControllerBlockEntity extends PassiveBatteryControllerBlockEntity {
|
||||
public ActiveBatteryControllerBlockEntity(BlockEntityType<?> type) {
|
||||
super(type);
|
||||
}
|
||||
|
@ -2,7 +2,7 @@ package com.thebrokenrail.energonrelics.block.entity.battery;
|
||||
|
||||
import com.thebrokenrail.energonrelics.Config;
|
||||
import com.thebrokenrail.energonrelics.EnergonRelics;
|
||||
import com.thebrokenrail.energonrelics.block.battery.BatteryControllerBlock;
|
||||
import com.thebrokenrail.energonrelics.block.battery.PassiveBatteryControllerBlock;
|
||||
import com.thebrokenrail.energonrelics.energy.core.EnergyReceiverBlockEntity;
|
||||
import com.thebrokenrail.energonrelics.energy.core.util.Action;
|
||||
import com.thebrokenrail.energonrelics.energy.helper.EnergyGenerator;
|
||||
@ -13,8 +13,8 @@ import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BatteryControllerBlockEntity extends EnergyReceiverBlockEntity implements EnergyGenerator {
|
||||
public BatteryControllerBlockEntity(BlockEntityType<?> type) {
|
||||
public class PassiveBatteryControllerBlockEntity extends EnergyReceiverBlockEntity implements EnergyGenerator {
|
||||
public PassiveBatteryControllerBlockEntity(BlockEntityType<?> type) {
|
||||
super(type);
|
||||
}
|
||||
|
||||
@ -39,8 +39,8 @@ public class BatteryControllerBlockEntity extends EnergyReceiverBlockEntity impl
|
||||
@Override
|
||||
public void pay(long amount) {
|
||||
BlockEntity entity = world.getBlockEntity(pos);
|
||||
if (entity instanceof BatteryControllerBlockEntity) {
|
||||
BatteryControllerBlockEntity battery = (BatteryControllerBlockEntity) entity;
|
||||
if (entity instanceof PassiveBatteryControllerBlockEntity) {
|
||||
PassiveBatteryControllerBlockEntity battery = (PassiveBatteryControllerBlockEntity) entity;
|
||||
battery.setEnergy(battery.getEnergy() + amount);
|
||||
}
|
||||
}
|
||||
@ -52,8 +52,8 @@ public class BatteryControllerBlockEntity extends EnergyReceiverBlockEntity impl
|
||||
if (!isActiveController()) {
|
||||
addAction(new Action(charge, (world, pos, state) -> {
|
||||
BlockEntity entity = world.getBlockEntity(pos);
|
||||
if (entity instanceof BatteryControllerBlockEntity) {
|
||||
BatteryControllerBlockEntity battery = (BatteryControllerBlockEntity) entity;
|
||||
if (entity instanceof PassiveBatteryControllerBlockEntity) {
|
||||
PassiveBatteryControllerBlockEntity battery = (PassiveBatteryControllerBlockEntity) entity;
|
||||
battery.setEnergy(battery.getEnergy() + charge);
|
||||
}
|
||||
}, (world, pos, state) -> {}));
|
||||
@ -101,7 +101,7 @@ public class BatteryControllerBlockEntity extends EnergyReceiverBlockEntity impl
|
||||
|
||||
private BatteryCoreBlockEntity getBatteryCore() {
|
||||
if (hasWorld()) {
|
||||
Direction facing = getCachedState().get(BatteryControllerBlock.FACING);
|
||||
Direction facing = getCachedState().get(PassiveBatteryControllerBlock.FACING);
|
||||
BlockPos corePos = getPos().offset(facing.getOpposite());
|
||||
|
||||
assert getWorld() != null;
|
@ -2,7 +2,7 @@ package com.thebrokenrail.energonrelics.block.entity.reactor;
|
||||
|
||||
import com.thebrokenrail.energonrelics.Config;
|
||||
import com.thebrokenrail.energonrelics.EnergonRelics;
|
||||
import com.thebrokenrail.energonrelics.block.battery.BatteryControllerBlock;
|
||||
import com.thebrokenrail.energonrelics.block.battery.PassiveBatteryControllerBlock;
|
||||
import com.thebrokenrail.energonrelics.block.reactor.ReactorControllerBlock;
|
||||
import com.thebrokenrail.energonrelics.energy.helper.EnergyGeneratorBlockEntity;
|
||||
import net.minecraft.block.BlockState;
|
||||
@ -64,7 +64,7 @@ public class ReactorControllerBlockEntity extends EnergyGeneratorBlockEntity {
|
||||
|
||||
private Reactor getReactor() {
|
||||
if (hasWorld()) {
|
||||
Direction facing = getCachedState().get(BatteryControllerBlock.FACING);
|
||||
Direction facing = getCachedState().get(PassiveBatteryControllerBlock.FACING);
|
||||
BlockPos corePos = getPos().offset(facing.getOpposite());
|
||||
|
||||
assert getWorld() != null;
|
||||
|
@ -1,6 +1,6 @@
|
||||
package com.thebrokenrail.energonrelics.block.reactor;
|
||||
|
||||
import com.thebrokenrail.energonrelics.block.battery.BatteryControllerBlock;
|
||||
import com.thebrokenrail.energonrelics.block.battery.PassiveBatteryControllerBlock;
|
||||
import com.thebrokenrail.energonrelics.block.entity.reactor.ReactorControllerBlockEntity;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
@ -19,7 +19,7 @@ import java.util.Random;
|
||||
import java.util.function.Function;
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public class ReactorControllerBlock extends BatteryControllerBlock {
|
||||
public class ReactorControllerBlock extends PassiveBatteryControllerBlock {
|
||||
public static final BooleanProperty POWERED = Properties.POWERED;
|
||||
|
||||
public ReactorControllerBlock() {
|
||||
|
@ -1,27 +0,0 @@
|
||||
{
|
||||
"variants": {
|
||||
"facing=down": {
|
||||
"model": "energonrelics:block/battery_controller",
|
||||
"x": 90
|
||||
},
|
||||
"facing=east": {
|
||||
"model": "energonrelics:block/battery_controller",
|
||||
"y": 90
|
||||
},
|
||||
"facing=north": {
|
||||
"model": "energonrelics:block/battery_controller"
|
||||
},
|
||||
"facing=south": {
|
||||
"model": "energonrelics:block/battery_controller",
|
||||
"y": 180
|
||||
},
|
||||
"facing=up": {
|
||||
"model": "energonrelics:block/battery_controller",
|
||||
"x": 270
|
||||
},
|
||||
"facing=west": {
|
||||
"model": "energonrelics:block/battery_controller",
|
||||
"y": 270
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
{
|
||||
"variants": {
|
||||
"facing=down": {
|
||||
"model": "energonrelics:block/passive_battery_controller",
|
||||
"x": 90
|
||||
},
|
||||
"facing=east": {
|
||||
"model": "energonrelics:block/passive_battery_controller",
|
||||
"y": 90
|
||||
},
|
||||
"facing=north": {
|
||||
"model": "energonrelics:block/passive_battery_controller"
|
||||
},
|
||||
"facing=south": {
|
||||
"model": "energonrelics:block/passive_battery_controller",
|
||||
"y": 180
|
||||
},
|
||||
"facing=up": {
|
||||
"model": "energonrelics:block/passive_battery_controller",
|
||||
"x": 270
|
||||
},
|
||||
"facing=west": {
|
||||
"model": "energonrelics:block/passive_battery_controller",
|
||||
"y": 270
|
||||
}
|
||||
}
|
||||
}
|
@ -10,7 +10,7 @@
|
||||
"text.energonrelics.energy_available": "Energy Available: %s Energon",
|
||||
"block.energonrelics.thermal_casing": "Thermal Casing",
|
||||
"block.energonrelics.battery_core": "Battery Core",
|
||||
"block.energonrelics.battery_controller": "Passive Battery Controller",
|
||||
"block.energonrelics.passive_battery_controller": "Passive Battery Controller",
|
||||
"block.energonrelics.active_battery_controller": "Active Battery Controller",
|
||||
"item.energonrelics.circuit_board": "Circuit Board",
|
||||
"block.energonrelics.reactor_controller": "Reactor Controller",
|
||||
|
@ -1,8 +0,0 @@
|
||||
{
|
||||
"parent": "minecraft:block/orientable",
|
||||
"textures": {
|
||||
"top": "energonrelics:block/battery_controller_side",
|
||||
"front": "energonrelics:block/battery_controller",
|
||||
"side": "energonrelics:block/battery_controller_side"
|
||||
}
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
{
|
||||
"parent": "minecraft:block/orientable",
|
||||
"textures": {
|
||||
"top": "energonrelics:block/passive_battery_controller_side",
|
||||
"front": "energonrelics:block/passive_battery_controller",
|
||||
"side": "energonrelics:block/passive_battery_controller_side"
|
||||
}
|
||||
}
|
@ -1,3 +0,0 @@
|
||||
{
|
||||
"parent": "energonrelics:block/battery_controller"
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
{
|
||||
"parent": "energonrelics:block/passive_battery_controller"
|
||||
}
|
Before Width: | Height: | Size: 769 B After Width: | Height: | Size: 769 B |
Before Width: | Height: | Size: 674 B After Width: | Height: | Size: 674 B |
@ -6,7 +6,7 @@
|
||||
"entries": [
|
||||
{
|
||||
"type": "minecraft:item",
|
||||
"name": "energonrelics:battery_controller"
|
||||
"name": "energonrelics:active_battery_controller"
|
||||
}
|
||||
],
|
||||
"conditions": [
|
@ -0,0 +1,19 @@
|
||||
{
|
||||
"type": "minecraft:block",
|
||||
"pools": [
|
||||
{
|
||||
"rolls": 1,
|
||||
"entries": [
|
||||
{
|
||||
"type": "minecraft:item",
|
||||
"name": "energonrelics:passive_battery_controller"
|
||||
}
|
||||
],
|
||||
"conditions": [
|
||||
{
|
||||
"condition": "minecraft:survives_explosion"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
@ -1,16 +1,19 @@
|
||||
{
|
||||
"type": "minecraft:crafting_shaped",
|
||||
"pattern": [
|
||||
" # ",
|
||||
"#E#",
|
||||
" # "
|
||||
"EOE",
|
||||
"#E#"
|
||||
],
|
||||
"key": {
|
||||
"#": {
|
||||
"item": "energonrelics:circuit_board"
|
||||
},
|
||||
"E": {
|
||||
"item": "energonrelics:battery_controller"
|
||||
"item": "energonrelics:thermal_casing"
|
||||
},
|
||||
"O": {
|
||||
"item": "minecraft:orange_dye"
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
|
@ -0,0 +1,23 @@
|
||||
{
|
||||
"type": "minecraft:crafting_shaped",
|
||||
"pattern": [
|
||||
"#E#",
|
||||
"ERE",
|
||||
"#E#"
|
||||
],
|
||||
"key": {
|
||||
"#": {
|
||||
"item": "energonrelics:circuit_board"
|
||||
},
|
||||
"E": {
|
||||
"item": "energonrelics:thermal_casing"
|
||||
},
|
||||
"R": {
|
||||
"item": "minecraft:red_dye"
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"item": "energonrelics:passive_battery_controller",
|
||||
"count": 1
|
||||
}
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
{
|
||||
"type": "minecraft:crafting_shaped",
|
||||
"pattern": [
|
||||
"#E#",
|
||||
"EPE",
|
||||
"#E#"
|
||||
],
|
||||
"key": {
|
||||
"#": {
|
||||
"item": "energonrelics:circuit_board"
|
||||
},
|
||||
"E": {
|
||||
"item": "energonrelics:thermal_casing"
|
||||
},
|
||||
"P": {
|
||||
"item": "minecraft:purple_dye"
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"item": "energonrelics:reactor_controller",
|
||||
"count": 1
|
||||
}
|
||||
}
|
@ -15,6 +15,6 @@
|
||||
},
|
||||
"result": {
|
||||
"item": "energonrelics:thermal_casing",
|
||||
"count": 1
|
||||
"count": 4
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user