diff --git a/src/main/java/com/thebrokenrail/energonrelics/EnergonRelics.java b/src/main/java/com/thebrokenrail/energonrelics/EnergonRelics.java index 9cc5be6..8804a48 100644 --- a/src/main/java/com/thebrokenrail/energonrelics/EnergonRelics.java +++ b/src/main/java/com/thebrokenrail/energonrelics/EnergonRelics.java @@ -4,7 +4,7 @@ import com.thebrokenrail.energonrelics.block.BlockBreakerBlock; import com.thebrokenrail.energonrelics.block.CreativeEnergySourceBlock; import com.thebrokenrail.energonrelics.block.DefensiveLaserBlock; import com.thebrokenrail.energonrelics.block.HolographicSkyBlock; -import com.thebrokenrail.energonrelics.block.LightningRodBlock; +import com.thebrokenrail.energonrelics.block.lightning.LightningRodBaseBlock; import com.thebrokenrail.energonrelics.block.forcefield.ForcefieldProjectorBlock; import com.thebrokenrail.energonrelics.block.forcefield.laser.IndustrialLaserProjectorBlock; import com.thebrokenrail.energonrelics.block.forcefield.laser.IndustrialLaserBlock; @@ -12,6 +12,7 @@ import com.thebrokenrail.energonrelics.block.forcefield.beam.RepulsorBeamBlock; import com.thebrokenrail.energonrelics.block.forcefield.beam.TractorBeamBlock; import com.thebrokenrail.energonrelics.block.forcefield.beam.TractorBeamProjectorBlock; import com.thebrokenrail.energonrelics.block.forcefield.ForcefieldBlock; +import com.thebrokenrail.energonrelics.block.lightning.LightningRodBlock; import com.thebrokenrail.energonrelics.block.misc.VeridiumBlockBlock; import com.thebrokenrail.energonrelics.block.structure.StructureGeneratorBlock; import com.thebrokenrail.energonrelics.block.misc.ThermalGlassBlock; @@ -87,6 +88,7 @@ public class EnergonRelics implements ModInitializer { public static final Item VERIDIUM_POWDER_ITEM = new Item(new Item.Settings().group(ITEM_GROUP)); + public static final LightningRodBaseBlock LIGHTNING_ROD_BASE_BLOCK = new LightningRodBaseBlock(); public static final LightningRodBlock LIGHTNING_ROD_BLOCK = new LightningRodBlock(); public static final SpecialRecipeSerializer DUPLICATE_NETWORK_CHIP_RECIPE = new SpecialRecipeSerializer<>(DuplicateNetworkChipRecipe::new); @@ -148,6 +150,7 @@ public class EnergonRelics implements ModInitializer { CustomPotions.register(); + LIGHTNING_ROD_BASE_BLOCK.register("lightning_rod_base"); LIGHTNING_ROD_BLOCK.register("lightning_rod"); Registry.register(Registry.RECIPE_SERIALIZER, new Identifier(NAMESPACE, "duplicate_network_chip"), DUPLICATE_NETWORK_CHIP_RECIPE); diff --git a/src/main/java/com/thebrokenrail/energonrelics/block/LightningRodBlock.java b/src/main/java/com/thebrokenrail/energonrelics/block/LightningRodBlock.java deleted file mode 100644 index 9dee31c..0000000 --- a/src/main/java/com/thebrokenrail/energonrelics/block/LightningRodBlock.java +++ /dev/null @@ -1,54 +0,0 @@ -package com.thebrokenrail.energonrelics.block; - -import com.thebrokenrail.energonrelics.block.entity.LightningRodBlockEntity; -import com.thebrokenrail.energonrelics.block.util.energy.EnergyBlock; -import net.fabricmc.api.EnvType; -import net.fabricmc.api.Environment; -import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; -import net.minecraft.block.BlockState; -import net.minecraft.block.Material; -import net.minecraft.block.MaterialColor; -import net.minecraft.block.ShapeContext; -import net.minecraft.block.entity.BlockEntity; -import net.minecraft.block.entity.BlockEntityType; -import net.minecraft.util.math.BlockPos; -import net.minecraft.util.shape.VoxelShape; -import net.minecraft.util.shape.VoxelShapes; -import net.minecraft.world.BlockView; - -import java.util.function.Function; - -@SuppressWarnings("deprecation") -public class LightningRodBlock extends EnergyBlock { - public LightningRodBlock() { - super(FabricBlockSettings.of(Material.STONE, MaterialColor.BLUE_TERRACOTTA).nonOpaque().allowsSpawning((state, world, pos, type) -> false).solidBlock((state, world, pos) -> false).suffocates((state, world, pos) -> false).emissiveLighting((state, world, pos) -> true).lightLevel(10).requiresTool().strength(1.5f, 6.0f).blockVision((state, world, pos) -> false)); - } - - @Override - @Environment(EnvType.CLIENT) - public float getAmbientOcclusionLightLevel(BlockState state, BlockView world, BlockPos pos) { - return 1f; - } - - @Override - public boolean isTranslucent(BlockState state, BlockView world, BlockPos pos) { - return true; - } - - @Override - public VoxelShape getVisualShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) { - return VoxelShapes.empty(); - } - - @Override - protected Function, BlockEntity> getFactory() { - return LightningRodBlockEntity::new; - } - - private static final VoxelShape SHAPE = VoxelShapes.union(createCuboidShape(3d, 0d, 3d, 13d, 2d, 13d), createCuboidShape(7.5d, 2d, 7.5d, 8.5d, 26d, 8.5d)); - - @Override - public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) { - return SHAPE; - } -} diff --git a/src/main/java/com/thebrokenrail/energonrelics/block/entity/LightningRodBlockEntity.java b/src/main/java/com/thebrokenrail/energonrelics/block/entity/LightningRodBaseBlockEntity.java similarity index 93% rename from src/main/java/com/thebrokenrail/energonrelics/block/entity/LightningRodBlockEntity.java rename to src/main/java/com/thebrokenrail/energonrelics/block/entity/LightningRodBaseBlockEntity.java index 59a192f..81b7a47 100644 --- a/src/main/java/com/thebrokenrail/energonrelics/block/entity/LightningRodBlockEntity.java +++ b/src/main/java/com/thebrokenrail/energonrelics/block/entity/LightningRodBaseBlockEntity.java @@ -16,8 +16,8 @@ import java.util.List; import java.util.Objects; import java.util.Random; -public class LightningRodBlockEntity extends EnergyProviderBlockEntity implements EnergyGenerator { - public LightningRodBlockEntity(BlockEntityType type) { +public class LightningRodBaseBlockEntity extends EnergyProviderBlockEntity implements EnergyGenerator { + public LightningRodBaseBlockEntity(BlockEntityType type) { super(type); } @@ -59,7 +59,7 @@ public class LightningRodBlockEntity extends EnergyProviderBlockEntity implement if (random.nextDouble() <= HardcodedConfig.LIGHTNING_ROD_CHANCE) { LightningEntity entity = EntityType.LIGHTNING_BOLT.create(getWorld()); assert entity != null; - entity.updatePosition(getPos().getX() + 0.5d, getPos().getY(), getPos().getZ() + 0.5d); + entity.updatePosition(getPos().getX() + 0.5d, getPos().getY() + 1d, getPos().getZ() + 0.5d); entity.setCosmetic(true); Objects.requireNonNull(getWorld()).spawnEntity(entity); diff --git a/src/main/java/com/thebrokenrail/energonrelics/block/lightning/LightningRodBaseBlock.java b/src/main/java/com/thebrokenrail/energonrelics/block/lightning/LightningRodBaseBlock.java new file mode 100644 index 0000000..f06ec39 --- /dev/null +++ b/src/main/java/com/thebrokenrail/energonrelics/block/lightning/LightningRodBaseBlock.java @@ -0,0 +1,98 @@ +package com.thebrokenrail.energonrelics.block.lightning; + +import com.thebrokenrail.energonrelics.EnergonRelics; +import com.thebrokenrail.energonrelics.block.entity.LightningRodBaseBlockEntity; +import com.thebrokenrail.energonrelics.block.util.energy.EnergyBlock; +import net.fabricmc.api.EnvType; +import net.fabricmc.api.Environment; +import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; +import net.minecraft.block.BlockState; +import net.minecraft.block.Blocks; +import net.minecraft.block.Material; +import net.minecraft.block.MaterialColor; +import net.minecraft.block.ShapeContext; +import net.minecraft.block.entity.BlockEntity; +import net.minecraft.block.entity.BlockEntityType; +import net.minecraft.block.enums.DoubleBlockHalf; +import net.minecraft.block.piston.PistonBehavior; +import net.minecraft.entity.LivingEntity; +import net.minecraft.item.ItemPlacementContext; +import net.minecraft.item.ItemStack; +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; + +import java.util.function.Function; + +@SuppressWarnings("deprecation") +public class LightningRodBaseBlock extends EnergyBlock { + public LightningRodBaseBlock() { + super(FabricBlockSettings.of(Material.STONE, MaterialColor.CLEAR).nonOpaque().allowsSpawning((state, world, pos, type) -> false).solidBlock((state, world, pos) -> false).suffocates((state, world, pos) -> false).requiresTool().strength(1.5f, 6.0f).blockVision((state, world, pos) -> false)); + } + + @Override + @Environment(EnvType.CLIENT) + public float getAmbientOcclusionLightLevel(BlockState state, BlockView world, BlockPos pos) { + return 1f; + } + + @Override + public boolean isTranslucent(BlockState state, BlockView world, BlockPos pos) { + return true; + } + + @Override + public VoxelShape getVisualShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) { + return VoxelShapes.empty(); + } + + @Override + public PistonBehavior getPistonBehavior(BlockState state) { + return PistonBehavior.DESTROY; + } + + @Override + protected Function, BlockEntity> getFactory() { + return LightningRodBaseBlockEntity::new; + } + + private static final VoxelShape SHAPE = VoxelShapes.union(createCuboidShape(3d, 0d, 3d, 13d, 4d, 13d), createCuboidShape(4d, 4d, 4d, 12d, 8d, 12d), createCuboidShape(5d, 8d, 5d, 11d, 12d, 11d), createCuboidShape(6d, 12d, 6d, 10d, 16d, 10d)); + + @Override + public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) { + return SHAPE; + } + + @Override + public BlockState getStateForNeighborUpdate(BlockState state, Direction direction, BlockState newState, WorldAccess world, BlockPos pos, BlockPos posFrom) { + boolean valid = true; + if (direction == Direction.UP && (newState.getBlock() != EnergonRelics.LIGHTNING_ROD_BLOCK || newState.get(LightningRodBlock.HALF) != DoubleBlockHalf.LOWER)) { + valid = false; + } + + if (valid) { + return super.getStateForNeighborUpdate(state, direction, newState, world, pos, posFrom); + } else { + return Blocks.AIR.getDefaultState(); + } + } + + @Override + public void onPlaced(World world, BlockPos pos, BlockState state, LivingEntity placer, ItemStack itemStack) { + super.onPlaced(world, pos, state, placer, itemStack); + + world.setBlockState(pos.up(2), EnergonRelics.LIGHTNING_ROD_BLOCK.getDefaultState().with(LightningRodBlock.HALF, DoubleBlockHalf.UPPER)); + world.setBlockState(pos.up(1), EnergonRelics.LIGHTNING_ROD_BLOCK.getDefaultState().with(LightningRodBlock.HALF, DoubleBlockHalf.LOWER)); + } + + @Override + public BlockState getPlacementState(ItemPlacementContext ctx) { + BlockPos pos = ctx.getBlockPos(); + World world = ctx.getWorld(); + return world.getBlockState(pos.up(1)).canReplace(ctx) && world.getBlockState(pos.up(2)).canReplace(ctx) ? super.getPlacementState(ctx) : null; + } +} diff --git a/src/main/java/com/thebrokenrail/energonrelics/block/lightning/LightningRodBlock.java b/src/main/java/com/thebrokenrail/energonrelics/block/lightning/LightningRodBlock.java new file mode 100644 index 0000000..5a98070 --- /dev/null +++ b/src/main/java/com/thebrokenrail/energonrelics/block/lightning/LightningRodBlock.java @@ -0,0 +1,124 @@ +package com.thebrokenrail.energonrelics.block.lightning; + +import com.thebrokenrail.energonrelics.EnergonRelics; +import com.thebrokenrail.energonrelics.block.util.SimpleBlock; +import com.thebrokenrail.energonrelics.util.MissingCaseException; +import net.fabricmc.api.EnvType; +import net.fabricmc.api.Environment; +import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; +import net.minecraft.block.Block; +import net.minecraft.block.BlockState; +import net.minecraft.block.Blocks; +import net.minecraft.block.ShapeContext; +import net.minecraft.block.enums.DoubleBlockHalf; +import net.minecraft.block.piston.PistonBehavior; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.state.StateManager; +import net.minecraft.state.property.EnumProperty; +import net.minecraft.state.property.Properties; +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 LightningRodBlock extends SimpleBlock { + public static final EnumProperty HALF = Properties.DOUBLE_BLOCK_HALF; + + public LightningRodBlock() { + super(FabricBlockSettings.copy(EnergonRelics.LIGHTNING_ROD_BASE_BLOCK).dropsNothing().emissiveLighting((state, world, pos) -> true).lightLevel(state -> 10)); + setDefaultState(getDefaultState().with(HALF, DoubleBlockHalf.LOWER)); + } + + @Override + @Environment(EnvType.CLIENT) + public float getAmbientOcclusionLightLevel(BlockState state, BlockView world, BlockPos pos) { + return 1f; + } + + @Override + public boolean isTranslucent(BlockState state, BlockView world, BlockPos pos) { + return true; + } + + @Override + public VoxelShape getVisualShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) { + return VoxelShapes.empty(); + } + + @Override + public PistonBehavior getPistonBehavior(BlockState state) { + return PistonBehavior.DESTROY; + } + + @Override + protected void appendProperties(StateManager.Builder builder) { + super.appendProperties(builder); + builder.add(HALF); + } + + @Override + protected boolean registerItem() { + return false; + } + + private static final VoxelShape LOWER_SHAPE = createCuboidShape(7.5d, 0d, 7.5d, 8.5d, 16d, 8.5d); + private static final VoxelShape UPPER_SHAPE = createCuboidShape(7.5d, 0d, 7.5d, 8.5d, 8d, 8.5d); + + @Override + public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) { + DoubleBlockHalf half = state.get(HALF); + switch (half) { + case LOWER: { + return LOWER_SHAPE; + } + case UPPER: { + return UPPER_SHAPE; + } + default: { + throw new MissingCaseException(half); + } + } + } + + @Override + public BlockState getStateForNeighborUpdate(BlockState state, Direction direction, BlockState newState, WorldAccess world, BlockPos pos, BlockPos posFrom) { + boolean valid = true; + + if (state.get(HALF) == DoubleBlockHalf.LOWER) { + if (direction == Direction.UP) { + if (newState.getBlock() != EnergonRelics.LIGHTNING_ROD_BLOCK || newState.get(HALF) != DoubleBlockHalf.UPPER) { + valid = false; + } + } else if (direction == Direction.DOWN) { + if (newState.getBlock() != EnergonRelics.LIGHTNING_ROD_BASE_BLOCK) { + valid = false; + } + } + } else if (state.get(HALF) == DoubleBlockHalf.UPPER && direction == Direction.DOWN) { + if (newState.getBlock() != EnergonRelics.LIGHTNING_ROD_BLOCK || newState.get(HALF) != DoubleBlockHalf.LOWER) { + valid = false; + } + } + + if (valid) { + return super.getStateForNeighborUpdate(state, direction, newState, world, pos, posFrom); + } else { + return Blocks.AIR.getDefaultState(); + } + } + + @Override + public void onBreak(World world, BlockPos pos, BlockState state, PlayerEntity player) { + if (!world.isClient() && player.isCreative()) { + int distance = state.get(HALF) == DoubleBlockHalf.LOWER ? 1 : 2; + BlockPos targetPos = pos.down(distance); + world.breakBlock(targetPos, false, player); + } + + super.onBreak(world, pos, state, player); + } +} diff --git a/src/main/resources/assets/energonrelics/blockstates/lightning_rod.json b/src/main/resources/assets/energonrelics/blockstates/lightning_rod.json index 044da8a..8a2adfd 100644 --- a/src/main/resources/assets/energonrelics/blockstates/lightning_rod.json +++ b/src/main/resources/assets/energonrelics/blockstates/lightning_rod.json @@ -1,7 +1,10 @@ { "variants": { - "": { - "model": "energonrelics:block/lightning_rod" + "half=lower": { + "model": "energonrelics:block/lightning_rod_lower" + }, + "half=upper": { + "model": "energonrelics:block/lightning_rod_upper" } } } diff --git a/src/main/resources/assets/energonrelics/blockstates/lightning_rod_base.json b/src/main/resources/assets/energonrelics/blockstates/lightning_rod_base.json new file mode 100644 index 0000000..141dba0 --- /dev/null +++ b/src/main/resources/assets/energonrelics/blockstates/lightning_rod_base.json @@ -0,0 +1,7 @@ +{ + "variants": { + "": { + "model": "energonrelics:block/lightning_rod_base" + } + } +} diff --git a/src/main/resources/assets/energonrelics/models/block/lightning_rod.json b/src/main/resources/assets/energonrelics/models/block/lightning_rod.json deleted file mode 100644 index a52156f..0000000 --- a/src/main/resources/assets/energonrelics/models/block/lightning_rod.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "parent": "minecraft:block/block", - "textures": { - "1": "energonrelics:block/lightning_rod", - "2": "minecraft:block/polished_blackstone_bricks", - "particle": "minecraft:block/polished_blackstone_bricks" - }, - "elements": [ - { - "from": [3, 0, 3], - "to": [13, 2, 13], - "rotation": {"angle": 0, "axis": "y", "origin": [0, 0, 0]}, - "faces": { - "north": {"uv": [3, 0, 13, 2], "texture": "#2"}, - "east": {"uv": [3, 0, 13, 2], "texture": "#2"}, - "south": {"uv": [3, 0, 13, 2], "texture": "#2"}, - "west": {"uv": [3, 0, 13, 2], "texture": "#2"}, - "up": {"uv": [0, 0, 16, 16], "texture": "#2"}, - "down": {"uv": [0, 0, 16, 16], "texture": "#2"} - } - }, - { - "from": [7.5, 2, 7.5], - "to": [8.5, 18, 8.5], - "rotation": {"angle": 0, "axis": "y", "origin": [0, 0, 0]}, - "faces": { - "north": {"uv": [0, 0, 1, 16], "texture": "#1"}, - "east": {"uv": [0, 0, 1, 16], "texture": "#1"}, - "south": {"uv": [0, 0, 1, 16], "texture": "#1"}, - "west": {"uv": [0, 0, 1, 16], "texture": "#1"}, - "up": {"uv": [0, 0, 0, 0], "texture": "#1"}, - "down": {"uv": [0, 0, 0, 0], "texture": "#1"} - } - }, - { - "from": [7.5, 18, 7.5], - "to": [8.5, 26, 8.5], - "rotation": {"angle": 0, "axis": "y", "origin": [0, 0, 0]}, - "faces": { - "north": {"uv": [1, 8, 2, 16], "texture": "#1"}, - "east": {"uv": [1, 8, 2, 16], "texture": "#1"}, - "south": {"uv": [1, 8, 2, 16], "texture": "#1"}, - "west": {"uv": [1, 8, 2, 16], "texture": "#1"}, - "up": {"uv": [1, 8, 2, 9], "texture": "#1"}, - "down": {"uv": [0, 0, 0, 0], "texture": "#1"} - } - } - ], - "display": { - "gui": { - "rotation": [30, 225, 0], - "translation": [0, -1.5, 0], - "scale": [0.46875, 0.46875, 0.46875] - }, - "fixed": { - "rotation": [0, 0, 0], - "translation": [0, -2, 0], - "scale": [0.375, 0.375, 0.375] - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/energonrelics/models/block/lightning_rod_base.json b/src/main/resources/assets/energonrelics/models/block/lightning_rod_base.json new file mode 100644 index 0000000..5cf475f --- /dev/null +++ b/src/main/resources/assets/energonrelics/models/block/lightning_rod_base.json @@ -0,0 +1,58 @@ +{ + "parent": "minecraft:block/block", + "textures": { + "1": "energonrelics:block/lightning_rod_base", + "particle": "#1" + }, + "elements": [ + { + "from": [3, 0, 3], + "to": [13, 4, 13], + "rotation": {"angle": 0, "axis": "y", "origin": [0, 0, 0]}, + "faces": { + "north": {"uv": [3, 12, 13, 16], "texture": "#1"}, + "east": {"uv": [3, 12, 13, 16], "texture": "#1"}, + "south": {"uv": [3, 12, 13, 16], "texture": "#1"}, + "west": {"uv": [3, 12, 13, 16], "texture": "#1"}, + "up": {"uv": [3, 3, 13, 13], "texture": "#1"}, + "down": {"uv": [3, 3, 13, 13], "texture": "#1"} + } + }, + { + "from": [4, 4, 4], + "to": [12, 8, 12], + "rotation": {"angle": 0, "axis": "y", "origin": [0, 0, 0]}, + "faces": { + "north": {"uv": [4, 8, 12, 12], "texture": "#1"}, + "east": {"uv": [4, 8, 12, 12], "texture": "#1"}, + "south": {"uv": [4, 8, 12, 12], "texture": "#1"}, + "west": {"uv": [4, 8, 12, 12], "texture": "#1"}, + "up": {"uv": [4, 4, 12, 12], "texture": "#1"} + } + }, + { + "from": [5, 8, 5], + "to": [11, 12, 11], + "rotation": {"angle": 0, "axis": "y", "origin": [0, 0, 0]}, + "faces": { + "north": {"uv": [5, 4, 11, 8], "texture": "#1"}, + "east": {"uv": [5, 4, 11, 8], "texture": "#1"}, + "south": {"uv": [5, 4, 11, 8], "texture": "#1"}, + "west": {"uv": [5, 4, 11, 8], "texture": "#1"}, + "up": {"uv": [5, 5, 11, 11], "texture": "#1"} + } + }, + { + "from": [6, 12, 6], + "to": [10, 16, 10], + "rotation": {"angle": 0, "axis": "y", "origin": [0, 0, 0]}, + "faces": { + "north": {"uv": [6, 0, 10, 4], "texture": "#1"}, + "east": {"uv": [6, 0, 10, 4], "texture": "#1"}, + "south": {"uv": [6, 0, 10, 4], "texture": "#1"}, + "west": {"uv": [6, 0, 10, 4], "texture": "#1"}, + "up": {"uv": [6, 6, 10, 10], "texture": "#1"} + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/energonrelics/models/block/lightning_rod_lower.json b/src/main/resources/assets/energonrelics/models/block/lightning_rod_lower.json new file mode 100644 index 0000000..f496eb1 --- /dev/null +++ b/src/main/resources/assets/energonrelics/models/block/lightning_rod_lower.json @@ -0,0 +1,20 @@ +{ + "parent": "minecraft:block/block", + "textures": { + "1": "energonrelics:block/lightning_rod", + "particle": "#1" + }, + "elements": [ + { + "from": [7.5, 0, 7.5], + "to": [8.5, 16, 8.5], + "rotation": {"angle": 0, "axis": "y", "origin": [0, 0, 0]}, + "faces": { + "north": {"uv": [0, 0, 1, 16], "texture": "#1"}, + "east": {"uv": [0, 0, 1, 16], "texture": "#1"}, + "south": {"uv": [0, 0, 1, 16], "texture": "#1"}, + "west": {"uv": [0, 0, 1, 16], "texture": "#1"} + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/energonrelics/models/block/lightning_rod_upper.json b/src/main/resources/assets/energonrelics/models/block/lightning_rod_upper.json new file mode 100644 index 0000000..6b6a0ea --- /dev/null +++ b/src/main/resources/assets/energonrelics/models/block/lightning_rod_upper.json @@ -0,0 +1,21 @@ +{ + "parent": "minecraft:block/block", + "textures": { + "1": "energonrelics:block/lightning_rod", + "particle": "#1" + }, + "elements": [ + { + "from": [7.5, 0, 7.5], + "to": [8.5, 8, 8.5], + "rotation": {"angle": 0, "axis": "y", "origin": [0, 0, 0]}, + "faces": { + "north": {"uv": [1, 8, 2, 16], "texture": "#1"}, + "east": {"uv": [1, 8, 2, 16], "texture": "#1"}, + "south": {"uv": [1, 8, 2, 16], "texture": "#1"}, + "west": {"uv": [1, 8, 2, 16], "texture": "#1"}, + "up": {"uv": [1, 8, 2, 9], "texture": "#1"} + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/energonrelics/models/item/lightning_rod.json b/src/main/resources/assets/energonrelics/models/item/lightning_rod.json deleted file mode 100644 index 6f3ecf8..0000000 --- a/src/main/resources/assets/energonrelics/models/item/lightning_rod.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "parent": "energonrelics:block/lightning_rod" -} diff --git a/src/main/resources/assets/energonrelics/models/item/lightning_rod_base.json b/src/main/resources/assets/energonrelics/models/item/lightning_rod_base.json new file mode 100644 index 0000000..7c64d99 --- /dev/null +++ b/src/main/resources/assets/energonrelics/models/item/lightning_rod_base.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "energonrelics:item/lightning_rod" + } +} diff --git a/src/main/resources/assets/energonrelics/textures/block/lightning_rod_base.png b/src/main/resources/assets/energonrelics/textures/block/lightning_rod_base.png new file mode 100644 index 0000000..265aa34 Binary files /dev/null and b/src/main/resources/assets/energonrelics/textures/block/lightning_rod_base.png differ diff --git a/src/main/resources/data/energonrelics/loot_tables/blocks/lightning_rod_base.json b/src/main/resources/data/energonrelics/loot_tables/blocks/lightning_rod_base.json new file mode 100644 index 0000000..d17a092 --- /dev/null +++ b/src/main/resources/data/energonrelics/loot_tables/blocks/lightning_rod_base.json @@ -0,0 +1,19 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "energonrelics:lightning_rod_base" + } + ], + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ] + } + ] +} \ No newline at end of file diff --git a/src/main/resources/data/energonrelics/recipes/lightning_rod.json b/src/main/resources/data/energonrelics/recipes/lightning_rod_base.json similarity index 76% rename from src/main/resources/data/energonrelics/recipes/lightning_rod.json rename to src/main/resources/data/energonrelics/recipes/lightning_rod_base.json index 384a24f..43d8103 100644 --- a/src/main/resources/data/energonrelics/recipes/lightning_rod.json +++ b/src/main/resources/data/energonrelics/recipes/lightning_rod_base.json @@ -10,14 +10,14 @@ "item": "minecraft:blaze_rod" }, "B": { - "item": "minecraft:polished_blackstone_bricks" + "item": "minecraft:blackstone" }, "#": { "item": "energonrelics:circuit_board" } }, "result": { - "item": "energonrelics:lightning_rod", + "item": "energonrelics:lightning_rod_base", "count": 1 } } \ No newline at end of file