Add Energy Portal Blocks
All checks were successful
EnergonRelics/pipeline/head This commit looks good

This commit is contained in:
TheBrokenRail 2020-08-01 16:22:32 -04:00
parent 33d0d8d08a
commit 87d9e17919
34 changed files with 584 additions and 11 deletions

View File

@ -15,6 +15,10 @@ import com.thebrokenrail.energonrelics.block.forcefield.beam.TractorBeamProjecto
import com.thebrokenrail.energonrelics.block.forcefield.ForcefieldBlock; import com.thebrokenrail.energonrelics.block.forcefield.ForcefieldBlock;
import com.thebrokenrail.energonrelics.block.lightning.LightningRodBlock; import com.thebrokenrail.energonrelics.block.lightning.LightningRodBlock;
import com.thebrokenrail.energonrelics.block.misc.VeridiumBlockBlock; import com.thebrokenrail.energonrelics.block.misc.VeridiumBlockBlock;
import com.thebrokenrail.energonrelics.block.portal.EnergizedObsidianBlock;
import com.thebrokenrail.energonrelics.block.portal.EnergyBeamBlock;
import com.thebrokenrail.energonrelics.block.portal.EnergyPortalBlock;
import com.thebrokenrail.energonrelics.block.portal.EnergyProjectorBlock;
import com.thebrokenrail.energonrelics.block.structure.StructureGeneratorBlock; import com.thebrokenrail.energonrelics.block.structure.StructureGeneratorBlock;
import com.thebrokenrail.energonrelics.block.misc.ThermalGlassBlock; import com.thebrokenrail.energonrelics.block.misc.ThermalGlassBlock;
import com.thebrokenrail.energonrelics.block.battery.ActiveBatteryControllerBlock; import com.thebrokenrail.energonrelics.block.battery.ActiveBatteryControllerBlock;
@ -116,6 +120,12 @@ public class EnergonRelics implements ModInitializer {
public static final InfuserBlock INFUSER_BLOCK = new InfuserBlock(); public static final InfuserBlock INFUSER_BLOCK = new InfuserBlock();
public static final EnergizedObsidianBlock ENERGIZED_OBSIDIAN_BLOCK = new EnergizedObsidianBlock();
public static final EnergyBeamBlock ENERGY_BEAM_BLOCK = new EnergyBeamBlock();
public static final EnergyPortalBlock ENERGY_PORTAL_BLOCK = new EnergyPortalBlock();
public static final EnergyProjectorBlock ENERGY_PROJECTOR_BLOCK = new EnergyProjectorBlock();
public static final Item VERIDIUM_ORB_ITEM = new Item(new Item.Settings().group(ITEM_GROUP));
@Override @Override
public void onInitialize() { public void onInitialize() {
NETWORK_CHIP_ITEM = Registry.register(Registry.ITEM, new Identifier(NAMESPACE, "network_chip"), new NetworkChipItem()); NETWORK_CHIP_ITEM = Registry.register(Registry.ITEM, new Identifier(NAMESPACE, "network_chip"), new NetworkChipItem());
@ -175,6 +185,12 @@ public class EnergonRelics implements ModInitializer {
HOLOGRAPHIC_SKY_BLOCK.register("holographic_sky"); HOLOGRAPHIC_SKY_BLOCK.register("holographic_sky");
INFUSER_BLOCK.register("infuser"); INFUSER_BLOCK.register("infuser");
ENERGIZED_OBSIDIAN_BLOCK.register("energized_obsidian");
ENERGY_BEAM_BLOCK.register("energy_beam");
ENERGY_PORTAL_BLOCK.register("energy_portal");
ENERGY_PROJECTOR_BLOCK.register("energy_projector");
Registry.register(Registry.ITEM, new Identifier(NAMESPACE, "veridium_orb"), VERIDIUM_ORB_ITEM);
} }
public static void playBeep(World world, BlockPos pos) { public static void playBeep(World world, BlockPos pos) {

View File

@ -1,5 +1,6 @@
package com.thebrokenrail.energonrelics.block.entity.infuser; package com.thebrokenrail.energonrelics.block.entity.infuser;
import com.thebrokenrail.energonrelics.EnergonRelics;
import net.minecraft.item.DyeItem; import net.minecraft.item.DyeItem;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
@ -58,6 +59,8 @@ public class InfuserRegistry {
add(Items.GOLDEN_APPLE, new InfuserEntry(510, 0.3d, new InfuserAction[]{new InfuserAction.ItemAction(Items.ENCHANTED_GOLDEN_APPLE)}, new InfuserAction[]{new InfuserAction.ExplosionAction()})); add(Items.GOLDEN_APPLE, new InfuserEntry(510, 0.3d, new InfuserAction[]{new InfuserAction.ItemAction(Items.ENCHANTED_GOLDEN_APPLE)}, new InfuserAction[]{new InfuserAction.ExplosionAction()}));
add(Items.COAL, new InfuserEntry(340, 0.2d, new InfuserAction[]{new InfuserAction.ItemAction(Items.DIAMOND)}, new InfuserAction[]{new InfuserAction.ExplosionAction()})); add(Items.COAL, new InfuserEntry(340, 0.2d, new InfuserAction[]{new InfuserAction.ItemAction(Items.DIAMOND)}, new InfuserAction[]{new InfuserAction.ExplosionAction()}));
add(EnergonRelics.VERIDIUM_INGOT_ITEM, new InfuserEntry(240, 0.25d, new InfuserAction[]{new InfuserAction.ItemAction(EnergonRelics.VERIDIUM_ORB_ITEM)}, new InfuserAction[]{new InfuserAction.ParticleAction(), new InfuserAction.ParticleAction(), new InfuserAction.ExplosionAction()}));
} }
private static void addTransform(Item[] items, long cost, double successChance) { private static void addTransform(Item[] items, long cost, double successChance) {

View File

@ -0,0 +1,73 @@
package com.thebrokenrail.energonrelics.block.entity.portal;
import com.thebrokenrail.energonrelics.EnergonRelics;
import com.thebrokenrail.energonrelics.block.entity.forcefield.FieldProjectorBlockEntity;
import com.thebrokenrail.energonrelics.block.portal.EnergyPortalBlock;
import com.thebrokenrail.energonrelics.block.portal.EnergyProjectorBlock;
import com.thebrokenrail.energonrelics.config.HardcodedConfig;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.block.entity.BlockEntityType;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
import java.util.Objects;
public class EnergyProjectorBlockEntity extends FieldProjectorBlockEntity {
private BlockPos targetPos;
private BlockState targetState;
public EnergyProjectorBlockEntity(BlockEntityType<?> type) {
super(type, state -> EnergonRelics.ENERGY_BEAM_BLOCK);
}
@Override
protected long getCost() {
return HardcodedConfig.ENERGY_PROJECTOR_ENERGY_REQUIRED;
}
@Override
protected void setLastBlock(BlockPos newPos, BlockState newState) {
if (!Objects.equals(newPos, targetPos) || targetState != newState) {
targetPos = newPos;
targetState = newState;
}
}
@Override
protected void energyTick() {
super.energyTick();
assert getWorld() != null;
if (getCachedState().get(EnergyProjectorBlock.POWERED) && targetState != null && targetPos != null) {
boolean isObsidian;
if (targetState.getBlock() == Blocks.OBSIDIAN) {
isObsidian = true;
targetState = EnergonRelics.ENERGIZED_OBSIDIAN_BLOCK.getDefaultState();
getWorld().setBlockState(targetPos, targetState);
} else {
isObsidian = targetState.getBlock() == EnergonRelics.ENERGIZED_OBSIDIAN_BLOCK;
}
if (isObsidian) {
Direction facing = getCachedState().get(EnergyProjectorBlock.FACING);
BlockPos centerPos = null;
for (Direction side : Direction.values()) {
if (EnergyPortalBlock.isValidDirection(side) && side != facing.getOpposite()) {
BlockPos newCenterPos = targetPos.offset(side, 2);
if (EnergyPortalBlock.isValidFrame(getWorld(), newCenterPos)) {
centerPos = newCenterPos;
break;
}
}
}
if (centerPos != null) {
EnergyPortalBlock.fillFrame(getWorld(), centerPos);
}
}
}
}
}

View File

@ -117,4 +117,9 @@ public abstract class AbstractFieldBlock extends SimpleBlock {
public PistonBehavior getPistonBehavior(BlockState state) { public PistonBehavior getPistonBehavior(BlockState state) {
return PistonBehavior.DESTROY; return PistonBehavior.DESTROY;
} }
@Override
public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) {
return collidable ? super.getOutlineShape(state, world, pos, context) : VoxelShapes.empty();
}
} }

View File

@ -44,10 +44,4 @@ public class BeamBlock extends AbstractFieldBlock {
entity.addVelocity(pullForce.getX(), pullForce.getY(), pullForce.getZ()); entity.addVelocity(pullForce.getX(), pullForce.getY(), pullForce.getZ());
} }
} }
@SuppressWarnings("deprecation")
@Override
public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) {
return VoxelShapes.empty();
}
} }

View File

@ -0,0 +1,67 @@
package com.thebrokenrail.energonrelics.block.portal;
import com.thebrokenrail.energonrelics.EnergonRelics;
import com.thebrokenrail.energonrelics.block.util.SimpleBlock;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.item.Item;
import net.minecraft.item.Items;
import net.minecraft.state.property.Properties;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
import net.minecraft.world.BlockView;
import net.minecraft.world.WorldAccess;
public class EnergizedObsidianBlock extends SimpleBlock {
public EnergizedObsidianBlock() {
super(FabricBlockSettings.copy(Blocks.OBSIDIAN).emissiveLighting((state, world, pos) -> true).nonOpaque().lightLevel(state -> 10));
}
@Override
public boolean isTranslucent(BlockState state, BlockView world, BlockPos pos) {
return true;
}
@Override
protected boolean registerItem() {
return false;
}
@Override
public Item asItem() {
return Items.OBSIDIAN;
}
private static boolean faces(WorldAccess world, BlockPos targetPos, BlockPos pos) {
BlockState state = world.getBlockState(targetPos);
if ((state.getBlock() == EnergonRelics.ENERGY_BEAM_BLOCK || state.getBlock() == EnergonRelics.ENERGY_PROJECTOR_BLOCK) && state.contains(Properties.FACING)) {
Direction facing = state.get(Properties.FACING);
for (Direction side : Direction.values()) {
if (targetPos.offset(side).equals(pos)) {
return facing == side;
}
}
}
return false;
}
@SuppressWarnings("deprecation")
@Override
public BlockState getStateForNeighborUpdate(BlockState state, Direction direction, BlockState newState, WorldAccess world, BlockPos pos, BlockPos posFrom) {
boolean valid = false;
for (Direction dir : Direction.values()) {
if (faces(world, pos.offset(dir), pos)) {
valid = true;
break;
}
}
if (valid) {
return super.getStateForNeighborUpdate(state, direction, newState, world, pos, posFrom);
} else {
return Blocks.OBSIDIAN.getDefaultState();
}
}
}

View File

@ -0,0 +1,16 @@
package com.thebrokenrail.energonrelics.block.portal;
import com.thebrokenrail.energonrelics.EnergonRelics;
import com.thebrokenrail.energonrelics.block.forcefield.util.AbstractFieldBlock;
import net.minecraft.block.BlockState;
public class EnergyBeamBlock extends AbstractFieldBlock {
public EnergyBeamBlock() {
super(false);
}
@Override
protected BlockState getProjectorBlockState() {
return EnergonRelics.ENERGY_PROJECTOR_BLOCK.getDefaultState();
}
}

View File

@ -0,0 +1,145 @@
package com.thebrokenrail.energonrelics.block.portal;
import com.thebrokenrail.energonrelics.EnergonRelics;
import com.thebrokenrail.energonrelics.block.util.SimpleBlock;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.block.ShapeContext;
import net.minecraft.block.piston.PistonBehavior;
import net.minecraft.entity.Entity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
import net.minecraft.util.shape.VoxelShape;
import net.minecraft.util.shape.VoxelShapes;
import net.minecraft.world.BlockView;
import net.minecraft.world.World;
import net.minecraft.world.WorldAccess;
@SuppressWarnings("deprecation")
public class EnergyPortalBlock extends SimpleBlock {
public EnergyPortalBlock() {
super(FabricBlockSettings.copy(Blocks.NETHER_PORTAL).dropsNothing().emissiveLighting((state, world, pos) -> true).noCollision());
}
@Override
protected boolean registerItem() {
return false;
}
@Override
public VoxelShape getVisualShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) {
return VoxelShapes.empty();
}
private static final VoxelShape SHAPE = createCuboidShape(0, 6, 0, 16, 10, 16);
@Override
public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) {
return SHAPE;
}
public static boolean isValidDirection(Direction dir) {
return dir != Direction.UP && dir != Direction.DOWN;
}
private static boolean isObsidian(BlockState state) {
return state.getBlock() == Blocks.OBSIDIAN || state.getBlock() == EnergonRelics.ENERGIZED_OBSIDIAN_BLOCK;
}
public static boolean isValidFrame(WorldAccess world, BlockPos centerPos) {
int validSides = 0;
for (Direction side : Direction.values()) {
if (isValidDirection(side)) {
BlockPos energizedPos = centerPos.offset(side, 2);
BlockState energizedObsidian = world.getBlockState(energizedPos);
if (energizedObsidian.getBlock() == EnergonRelics.ENERGIZED_OBSIDIAN_BLOCK) {
BlockState obsidian1 = world.getBlockState(energizedPos.offset(side.rotateYClockwise(), 1));
BlockState obsidian2 = world.getBlockState(energizedPos.offset(side.rotateYCounterclockwise(), 1));
if (isObsidian(obsidian1) && isObsidian(obsidian2)) {
validSides++;
}
}
}
}
return validSides == 4;
}
private static BlockPos getCenterPos(WorldAccess world, BlockPos pos) {
BlockPos centerPos = pos;
for (Direction side : Direction.values()) {
if (isValidDirection(side)) {
if (world.getBlockState(pos.offset(side)).getBlock() != EnergonRelics.ENERGY_PORTAL_BLOCK) {
centerPos = centerPos.offset(side.getOpposite());
}
}
}
return centerPos;
}
private static boolean isValidCenter(WorldAccess world, BlockPos centerPos) {
boolean valid = true;
BlockPos startPos = centerPos.add(-1, 0, -1);
for (int x = 0; x < 3; x++) {
for (int z = 0; z < 3; z++) {
if (world.getBlockState(startPos.add(x, 0, z)).getBlock() != EnergonRelics.ENERGY_PORTAL_BLOCK) {
valid = false;
break;
}
}
}
return valid;
}
public static void fillFrame(WorldAccess world, BlockPos centerPos) {
BlockPos startPos = centerPos.add(-1, 0, -1);
for (int x = 0; x < 3; x++) {
for (int z = 0; z < 3; z++) {
BlockState state = world.getBlockState(startPos.add(x, 0, z));
if (state.getBlock() != EnergonRelics.ENERGY_PORTAL_BLOCK && !state.isAir()) {
return;
}
}
}
for (int x = 0; x < 3; x++) {
for (int z = 0; z < 3; z++) {
world.setBlockState(startPos.add(x, 0, z), EnergonRelics.ENERGY_PORTAL_BLOCK.getDefaultState(), 3 | 16);
}
}
}
@Override
public BlockState getStateForNeighborUpdate(BlockState state, Direction direction, BlockState newState, WorldAccess world, BlockPos pos, BlockPos posFrom) {
boolean valid;
if (isValidDirection(direction)) {
BlockPos centerPos = getCenterPos(world, pos);
boolean isValidFrame = isValidFrame(world, centerPos);
boolean isValidCenter = isValidCenter(world, centerPos);
valid = isValidCenter && isValidFrame;
} else {
valid = true;
}
if (valid) {
return super.getStateForNeighborUpdate(state, direction, newState, world, pos, posFrom);
} else {
return Blocks.AIR.getDefaultState();
}
}
@Override
public PistonBehavior getPistonBehavior(BlockState state) {
return PistonBehavior.BLOCK;
}
@Override
public void onEntityCollision(BlockState state, World world, BlockPos pos, Entity entity) {
super.onEntityCollision(state, world, pos, entity);
if (!world.isClient() && entity.canUsePortals() && ((PortalCooldownEntity) entity).isEnergyPortalCooldown()) {
// Teleport
((PortalCooldownEntity) entity).resetEnergyPortalCooldown();
}
}
}

View File

@ -0,0 +1,19 @@
package com.thebrokenrail.energonrelics.block.portal;
import com.thebrokenrail.energonrelics.block.entity.portal.EnergyProjectorBlockEntity;
import com.thebrokenrail.energonrelics.block.forcefield.util.FieldProjectorBlock;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.block.entity.BlockEntityType;
import java.util.function.Function;
public class EnergyProjectorBlock extends FieldProjectorBlock {
public EnergyProjectorBlock() {
super(null);
}
@Override
protected Function<BlockEntityType<BlockEntity>, BlockEntity> getFactory() {
return EnergyProjectorBlockEntity::new;
}
}

View File

@ -0,0 +1,6 @@
package com.thebrokenrail.energonrelics.block.portal;
public interface PortalCooldownEntity {
void resetEnergyPortalCooldown();
boolean isEnergyPortalCooldown();
}

View File

@ -13,6 +13,7 @@ import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment; import net.fabricmc.api.Environment;
import net.fabricmc.fabric.api.blockrenderlayer.v1.BlockRenderLayerMap; import net.fabricmc.fabric.api.blockrenderlayer.v1.BlockRenderLayerMap;
import net.fabricmc.fabric.api.event.player.AttackBlockCallback; import net.fabricmc.fabric.api.event.player.AttackBlockCallback;
import net.minecraft.block.BlockState;
import net.minecraft.client.MinecraftClient; import net.minecraft.client.MinecraftClient;
import net.minecraft.client.render.RenderLayer; import net.minecraft.client.render.RenderLayer;
import net.minecraft.util.ActionResult; import net.minecraft.util.ActionResult;
@ -47,10 +48,14 @@ public class EnergonRelicsClient implements ClientModInitializer {
BlockRenderLayerMap.INSTANCE.putBlock(EnergonRelics.REPULSOR_BEAM_BLOCK, RenderLayer.getTranslucent()); BlockRenderLayerMap.INSTANCE.putBlock(EnergonRelics.REPULSOR_BEAM_BLOCK, RenderLayer.getTranslucent());
BlockRenderLayerMap.INSTANCE.putBlock(EnergonRelics.INDUSTRIAL_LASER_BLOCK, RenderLayer.getTranslucent()); BlockRenderLayerMap.INSTANCE.putBlock(EnergonRelics.INDUSTRIAL_LASER_BLOCK, RenderLayer.getTranslucent());
BlockRenderLayerMap.INSTANCE.putBlock(EnergonRelics.ENERGY_PORTAL_BLOCK, RenderLayer.getTranslucent());
BlockRenderLayerMap.INSTANCE.putBlock(EnergonRelics.ENERGY_BEAM_BLOCK, RenderLayer.getTranslucent());
AutoConfig.register(UserConfig.class, ReloadSerializer::new); AutoConfig.register(UserConfig.class, ReloadSerializer::new);
AttackBlockCallback.EVENT.register((playerEntity, world, hand, blockPos, direction) -> { AttackBlockCallback.EVENT.register((playerEntity, world, hand, blockPos, direction) -> {
if (world.getBlockState(blockPos).getBlock() instanceof AbstractFieldBlock) { BlockState state = world.getBlockState(blockPos);
if (state.getBlock() instanceof AbstractFieldBlock || state.getBlock() == EnergonRelics.ENERGY_PORTAL_BLOCK) {
return ActionResult.FAIL; return ActionResult.FAIL;
} else { } else {
return ActionResult.PASS; return ActionResult.PASS;

View File

@ -44,4 +44,7 @@ public class HardcodedConfig {
public static final long HOLOGRAPHIC_SKY_ENERGY_REQUIRED = 15; public static final long HOLOGRAPHIC_SKY_ENERGY_REQUIRED = 15;
public static final int INFUSER_TIME = 2200; public static final int INFUSER_TIME = 2200;
public static final long ENERGY_PROJECTOR_ENERGY_REQUIRED = 37;
public static final int ENERGY_PORTAL_COOLDOWN = 20;
} }

View File

@ -1,6 +1,9 @@
package com.thebrokenrail.energonrelics.mixin; package com.thebrokenrail.energonrelics.mixin;
import com.thebrokenrail.energonrelics.EnergonRelics;
import com.thebrokenrail.energonrelics.block.forcefield.util.BeamBlock; import com.thebrokenrail.energonrelics.block.forcefield.util.BeamBlock;
import com.thebrokenrail.energonrelics.block.portal.PortalCooldownEntity;
import com.thebrokenrail.energonrelics.config.HardcodedConfig;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.nbt.CompoundTag; import net.minecraft.nbt.CompoundTag;
@ -14,12 +17,16 @@ import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.Unique; import org.spongepowered.asm.mixin.Unique;
import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import java.util.function.Predicate; import java.util.function.Predicate;
@Mixin(Entity.class) @Mixin(Entity.class)
public abstract class MixinEntity { public abstract class MixinEntity implements PortalCooldownEntity {
@Unique
private int energyPortalCooldown = 0;
@Shadow @Shadow
public abstract Box getBoundingBox(); public abstract Box getBoundingBox();
@ -64,12 +71,35 @@ public abstract class MixinEntity {
} }
@Inject(at = @At("HEAD"), method = "toTag") @Inject(at = @At("HEAD"), method = "toTag")
public void tagTagHead(CompoundTag tag, CallbackInfoReturnable<CompoundTag> info) { public void toTagHead(CompoundTag tag, CallbackInfoReturnable<CompoundTag> info) {
saving = true; saving = true;
tag.putInt(EnergonRelics.NAMESPACE + ":EnergyPortalCooldown", energyPortalCooldown);
} }
@Inject(at = @At("RETURN"), method = "toTag") @Inject(at = @At("RETURN"), method = "toTag")
public void tagTagReturn(CompoundTag tag, CallbackInfoReturnable<CompoundTag> info) { public void toTagReturn(CompoundTag tag, CallbackInfoReturnable<CompoundTag> info) {
saving = false; saving = false;
} }
@Inject(at = @At("HEAD"), method = "fromTag")
public void fromTag(CompoundTag tag, CallbackInfo info) {
energyPortalCooldown = tag.getInt(EnergonRelics.NAMESPACE + ":EnergyPortalCooldown");
}
@Inject(at = @At("RETURN"), method = "tick")
public void tick(CallbackInfo info) {
if (!isTouching(block -> block == EnergonRelics.ENERGY_PORTAL_BLOCK) && energyPortalCooldown > 0) {
energyPortalCooldown--;
}
}
@Override
public void resetEnergyPortalCooldown() {
energyPortalCooldown = HardcodedConfig.ENERGY_PORTAL_COOLDOWN;
}
@Override
public boolean isEnergyPortalCooldown() {
return energyPortalCooldown > 0;
}
} }

View File

@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "energonrelics:block/energized_obsidian"
}
}
}

View File

@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "energonrelics:block/energy_beam"
}
}
}

View File

@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "energonrelics:block/energy_portal"
}
}
}

View File

@ -0,0 +1,50 @@
{
"variants": {
"facing=down,powered=false": {
"model": "energonrelics:block/energy_projector_off",
"x": 90
},
"facing=down,powered=true": {
"model": "energonrelics:block/energy_projector_on",
"x": 90
},
"facing=east,powered=false": {
"model": "energonrelics:block/energy_projector_off",
"y": 90
},
"facing=east,powered=true": {
"model": "energonrelics:block/energy_projector_on",
"y": 90
},
"facing=north,powered=false": {
"model": "energonrelics:block/energy_projector_off"
},
"facing=north,powered=true": {
"model": "energonrelics:block/energy_projector_on"
},
"facing=south,powered=false": {
"model": "energonrelics:block/energy_projector_off",
"y": 180
},
"facing=south,powered=true": {
"model": "energonrelics:block/energy_projector_on",
"y": 180
},
"facing=up,powered=false": {
"model": "energonrelics:block/energy_projector_off",
"x": 270
},
"facing=up,powered=true": {
"model": "energonrelics:block/energy_projector_on",
"x": 270
},
"facing=west,powered=false": {
"model": "energonrelics:block/energy_projector_off",
"y": 270
},
"facing=west,powered=true": {
"model": "energonrelics:block/energy_projector_on",
"y": 270
}
}
}

View File

@ -52,5 +52,10 @@
"text.energonrelics.multimeter_separator": ", ", "text.energonrelics.multimeter_separator": ", ",
"category.rei.energonrelics.infuser.chance": "%s%% Chance", "category.rei.energonrelics.infuser.chance": "%s%% Chance",
"category.rei.energonrelics.infuser.cost": "%s Energon", "category.rei.energonrelics.infuser.cost": "%s Energon",
"category.rei.energonrelics.infuser.name": "Infuser" "category.rei.energonrelics.infuser.name": "Infuser",
"item.energonrelics.veridium_orb": "Veridium Orb",
"block.energonrelics.energy_projector": "Energy Projector",
"block.energonrelics.energy_beam": "Energy Beam",
"block.energonrelics.energy_portal": "Energy Portal",
"block.energonrelics.energized_obsidian": "Energized Obsidian"
} }

View File

@ -0,0 +1,6 @@
{
"parent": "minecraft:block/cube_all",
"textures": {
"all": "energonrelics:block/energized_obsidian"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "minecraft:block/cube_all",
"textures": {
"all": "energonrelics:block/energy_beam"
}
}

View File

@ -0,0 +1,22 @@
{
"textures": {
"particle": "#portal",
"portal": "energonrelics:block/energy_portal"
},
"elements": [
{
"from": [0, 6, 0],
"to": [16, 10, 16],
"faces": {
"up": {
"uv": [0, 0, 16, 16],
"texture": "#portal"
},
"down": {
"uv": [0, 0, 16, 16],
"texture": "#portal"
}
}
}
]
}

View File

@ -0,0 +1,8 @@
{
"parent": "minecraft:block/orientable",
"textures": {
"top": "energonrelics:block/field_projector_side",
"front": "energonrelics:block/energy_projector_off",
"side": "energonrelics:block/field_projector_side"
}
}

View File

@ -0,0 +1,8 @@
{
"parent": "minecraft:block/orientable",
"textures": {
"top": "energonrelics:block/field_projector_side",
"front": "energonrelics:block/energy_projector_on",
"side": "energonrelics:block/field_projector_side"
}
}

View File

@ -0,0 +1,3 @@
{
"parent": "energonrelics:block/energy_projector_off"
}

View File

@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "energonrelics:item/veridium_orb"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 490 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

View File

@ -0,0 +1,3 @@
{
"animation": {}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 722 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 722 B

View File

@ -0,0 +1,19 @@
{
"type": "minecraft:block",
"pools": [
{
"rolls": 1,
"entries": [
{
"type": "minecraft:item",
"name": "minecraft:obsidian"
}
],
"conditions": [
{
"condition": "minecraft:survives_explosion"
}
]
}
]
}

View File

@ -0,0 +1,19 @@
{
"type": "minecraft:block",
"pools": [
{
"rolls": 1,
"entries": [
{
"type": "minecraft:item",
"name": "energonrelics:energy_projector"
}
],
"conditions": [
{
"condition": "minecraft:survives_explosion"
}
]
}
]
}

View File

@ -0,0 +1,15 @@
{
"type": "minecraft:crafting_shapeless",
"ingredients": [
{
"item": "energonrelics:forcefield_projector"
},
{
"item": "energonrelics:veridium_orb"
}
],
"result": {
"item": "energonrelics:energy_projector",
"count": 1
}
}