From ee51f94613a34f375087b5e34c76cf48b7fe8e89 Mon Sep 17 00:00:00 2001 From: Andrew-71 Date: Fri, 14 Jul 2023 19:47:44 +0300 Subject: [PATCH] Lamps, fans and AIR RAID SIRENS --- TODO | 6 +- .../su/a71/new_soviet/NewSovietClient.java | 3 + .../java/su/a71/new_soviet/NSE_Custom.java | 16 ++- .../a71/new_soviet/blocks/AirRaidBlock.java | 59 +++++++++-- .../new_soviet/blocks/CeilingFanBlock.java | 75 ++++++++++++++ .../java/su/a71/new_soviet/blocks/FUNC_IDEAS | 7 ++ .../su/a71/new_soviet/blocks/LampBlock.java | 92 ++++++++++++++++++ .../su/a71/new_soviet/blocks/RadioBlock.java | 2 + .../new_soviet/blockstates/ceiling_fan.json | 10 ++ .../assets/new_soviet/blockstates/lamp.json | 10 ++ .../assets/new_soviet/blockstates/siren.json | 8 ++ .../assets/new_soviet/lang/en_us.json | 6 +- .../new_soviet/models/block/brown_tv.json | 4 +- .../block/ceiling_fan_off.json} | 6 +- .../models/block/ceiling_fan_on.json | 82 ++++++++++++++++ .../custom => models/block}/ceiling_lamp.json | 4 +- .../assets/new_soviet/models/block/radio.json | 4 +- .../new_soviet/models/block/red_tv.json | 4 +- .../block/custom => models/block}/siren.json | 4 +- .../custom => models/block}/table_lamp.json | 4 +- .../assets/new_soviet/models/block/tv.json | 4 +- .../new_soviet/models/item/ceiling_fan.json | 4 + .../assets/new_soviet/models/item/lamp.json | 3 + .../assets/new_soviet/models/item/siren.json | 4 + .../custom/{ => appliances}/bathroom.json | 0 .../custom/{ => appliances}/bathroom.png | Bin .../fan_animated.png} | Bin .../custom/appliances/fan_animated.png.mcmeta | 7 ++ .../custom/{ => appliances}/fan_base.png | Bin .../block/custom/appliances/fan_static.png | Bin 0 -> 420 bytes .../block/custom/{ => appliances}/fridge.json | 0 .../block/custom/{ => appliances}/fridge.png | Bin .../block/custom/{ => appliances}/sink.json | 0 .../block/custom/{ => appliances}/sink.png | Bin .../{nuke.json => appliances/stove.json} | 4 +- .../custom/{nuke.png => appliances/stove.png} | Bin .../block/custom/{ => appliances}/toilet.json | 0 .../block/custom/{ => appliances}/toilet.png | Bin .../custom/{ => appliances}/wash_basin.json | 0 .../custom/{ => appliances}/wash_basin.png | Bin .../{ => electronics}/brown_television.png | Bin .../block/custom/{ => electronics}/phone.json | 0 .../block/custom/{ => electronics}/phone.png | Bin .../custom/{ => electronics}/phone_wall.json | 0 .../custom/{ => electronics}/phone_wall.png | Bin .../block/custom/{ => electronics}/radio.png | Bin .../{ => electronics}/red_television.png | Bin .../block/custom/{ => electronics}/siren.png | Bin .../custom/{ => electronics}/television.png | Bin .../custom/{ => furniture}/bedside_table.json | 4 +- .../bedside_table.png} | Bin .../custom/{ => furniture}/ceiling_lamp.png | Bin .../custom/{ => furniture}/table_lamp.png | Bin 53 files changed, 403 insertions(+), 33 deletions(-) create mode 100644 src/main/java/su/a71/new_soviet/blocks/CeilingFanBlock.java create mode 100644 src/main/java/su/a71/new_soviet/blocks/FUNC_IDEAS create mode 100644 src/main/java/su/a71/new_soviet/blocks/LampBlock.java create mode 100644 src/main/resources/assets/new_soviet/blockstates/ceiling_fan.json create mode 100644 src/main/resources/assets/new_soviet/blockstates/lamp.json create mode 100644 src/main/resources/assets/new_soviet/blockstates/siren.json rename src/main/resources/assets/new_soviet/{textures/block/custom/celling_fan.json => models/block/ceiling_fan_off.json} (92%) create mode 100644 src/main/resources/assets/new_soviet/models/block/ceiling_fan_on.json rename src/main/resources/assets/new_soviet/{textures/block/custom => models/block}/ceiling_lamp.json (98%) rename src/main/resources/assets/new_soviet/{textures/block/custom => models/block}/siren.json (96%) rename src/main/resources/assets/new_soviet/{textures/block/custom => models/block}/table_lamp.json (96%) create mode 100644 src/main/resources/assets/new_soviet/models/item/ceiling_fan.json create mode 100644 src/main/resources/assets/new_soviet/models/item/lamp.json create mode 100644 src/main/resources/assets/new_soviet/models/item/siren.json rename src/main/resources/assets/new_soviet/textures/block/custom/{ => appliances}/bathroom.json (100%) rename src/main/resources/assets/new_soviet/textures/block/custom/{ => appliances}/bathroom.png (100%) rename src/main/resources/assets/new_soviet/textures/block/custom/{van_animated.png => appliances/fan_animated.png} (100%) create mode 100644 src/main/resources/assets/new_soviet/textures/block/custom/appliances/fan_animated.png.mcmeta rename src/main/resources/assets/new_soviet/textures/block/custom/{ => appliances}/fan_base.png (100%) create mode 100644 src/main/resources/assets/new_soviet/textures/block/custom/appliances/fan_static.png rename src/main/resources/assets/new_soviet/textures/block/custom/{ => appliances}/fridge.json (100%) rename src/main/resources/assets/new_soviet/textures/block/custom/{ => appliances}/fridge.png (100%) rename src/main/resources/assets/new_soviet/textures/block/custom/{ => appliances}/sink.json (100%) rename src/main/resources/assets/new_soviet/textures/block/custom/{ => appliances}/sink.png (100%) rename src/main/resources/assets/new_soviet/textures/block/custom/{nuke.json => appliances/stove.json} (98%) rename src/main/resources/assets/new_soviet/textures/block/custom/{nuke.png => appliances/stove.png} (100%) rename src/main/resources/assets/new_soviet/textures/block/custom/{ => appliances}/toilet.json (100%) rename src/main/resources/assets/new_soviet/textures/block/custom/{ => appliances}/toilet.png (100%) rename src/main/resources/assets/new_soviet/textures/block/custom/{ => appliances}/wash_basin.json (100%) rename src/main/resources/assets/new_soviet/textures/block/custom/{ => appliances}/wash_basin.png (100%) rename src/main/resources/assets/new_soviet/textures/block/custom/{ => electronics}/brown_television.png (100%) rename src/main/resources/assets/new_soviet/textures/block/custom/{ => electronics}/phone.json (100%) rename src/main/resources/assets/new_soviet/textures/block/custom/{ => electronics}/phone.png (100%) rename src/main/resources/assets/new_soviet/textures/block/custom/{ => electronics}/phone_wall.json (100%) rename src/main/resources/assets/new_soviet/textures/block/custom/{ => electronics}/phone_wall.png (100%) rename src/main/resources/assets/new_soviet/textures/block/custom/{ => electronics}/radio.png (100%) rename src/main/resources/assets/new_soviet/textures/block/custom/{ => electronics}/red_television.png (100%) rename src/main/resources/assets/new_soviet/textures/block/custom/{ => electronics}/siren.png (100%) rename src/main/resources/assets/new_soviet/textures/block/custom/{ => electronics}/television.png (100%) rename src/main/resources/assets/new_soviet/textures/block/custom/{ => furniture}/bedside_table.json (97%) rename src/main/resources/assets/new_soviet/textures/block/custom/{bedside_tabl.png => furniture/bedside_table.png} (100%) rename src/main/resources/assets/new_soviet/textures/block/custom/{ => furniture}/ceiling_lamp.png (100%) rename src/main/resources/assets/new_soviet/textures/block/custom/{ => furniture}/table_lamp.png (100%) diff --git a/TODO b/TODO index 2a5f5ce..0dc883c 100644 --- a/TODO +++ b/TODO @@ -3,4 +3,8 @@ 3. Add coconut as easter egg 4. Generate/Write crafting recipes 5. Fix PO2 wall -6. Work on custom blocks and doors, etc. \ No newline at end of file +6. Work on custom blocks and doors, etc. +7. Fix lamp (upside down when placed, too big when hanging, uses voxelshape of a lantern) +8. Better organise industrial and custom texture folders. +9. Possibly make all NSE_ into a generic class with inheritance (for registration functions) +10. Decide on block hardness and blast resistance for all block types \ No newline at end of file diff --git a/src/client/java/su/a71/new_soviet/NewSovietClient.java b/src/client/java/su/a71/new_soviet/NewSovietClient.java index 5342aec..0f1f9d8 100644 --- a/src/client/java/su/a71/new_soviet/NewSovietClient.java +++ b/src/client/java/su/a71/new_soviet/NewSovietClient.java @@ -12,5 +12,8 @@ public class NewSovietClient implements ClientModInitializer { @Override public void onInitializeClient() { BlockRenderLayerMap.INSTANCE.putBlock(NSE_Blocks.CRATE, RenderLayer.getCutout()); + BlockRenderLayerMap.INSTANCE.putBlock(NSE_Custom.LAMP, RenderLayer.getCutout()); + BlockRenderLayerMap.INSTANCE.putBlock(NSE_Custom.CEILING_FAN, RenderLayer.getCutout()); + BlockRenderLayerMap.INSTANCE.putBlock(NSE_Custom.SIREN, RenderLayer.getCutout()); } } \ No newline at end of file diff --git a/src/main/java/su/a71/new_soviet/NSE_Custom.java b/src/main/java/su/a71/new_soviet/NSE_Custom.java index 10b9192..0791805 100644 --- a/src/main/java/su/a71/new_soviet/NSE_Custom.java +++ b/src/main/java/su/a71/new_soviet/NSE_Custom.java @@ -3,7 +3,7 @@ package su.a71.new_soviet; import net.fabricmc.fabric.api.item.v1.FabricItemSettings; import net.fabricmc.fabric.api.itemgroup.v1.FabricItemGroup; import net.fabricmc.fabric.api.itemgroup.v1.ItemGroupEvents; -import net.fabricmc.loader.api.FabricLoader; +import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.minecraft.block.Block; import net.minecraft.item.BlockItem; import net.minecraft.item.ItemGroup; @@ -11,10 +11,10 @@ import net.minecraft.item.ItemStack; import net.minecraft.registry.Registries; import net.minecraft.registry.Registry; import net.minecraft.registry.RegistryKey; +import net.minecraft.sound.BlockSoundGroup; import net.minecraft.text.Text; import net.minecraft.util.Identifier; -import su.a71.new_soviet.blocks.RadioBlock; -import su.a71.new_soviet.blocks.TVBlock; +import su.a71.new_soviet.blocks.*; import java.util.Optional; import java.util.function.Supplier; @@ -24,8 +24,12 @@ public class NSE_Custom { public static final TVBlock TV = new TVBlock(); public static final TVBlock RED_TV = new TVBlock(); public static final TVBlock BROWN_TV = new TVBlock(); - public static final RadioBlock RADIO = new RadioBlock(); + public static final LampBlock LAMP = new LampBlock(FabricBlockSettings.create().sounds(BlockSoundGroup.LANTERN)); + public static final CeilingFanBlock CEILING_FAN = new CeilingFanBlock(FabricBlockSettings.create().sounds(BlockSoundGroup.METAL)); + + public static final AirRaidBlock SIREN = new AirRaidBlock(); + private static final ItemGroup NSE_CUSTOM_TAB = FabricItemGroup.builder() .icon(() -> new ItemStack(TV)) @@ -50,5 +54,9 @@ public class NSE_Custom { register("red_tv", () -> RED_TV, NSE_CUSTOM_TAB); register("brown_tv", () -> BROWN_TV, NSE_CUSTOM_TAB); register("radio", () -> RADIO, NSE_CUSTOM_TAB); + register("lamp", () -> LAMP, NSE_CUSTOM_TAB); + register("ceiling_fan", () -> CEILING_FAN, NSE_CUSTOM_TAB); + register("siren", () -> SIREN, NSE_CUSTOM_TAB); + } } \ No newline at end of file diff --git a/src/main/java/su/a71/new_soviet/blocks/AirRaidBlock.java b/src/main/java/su/a71/new_soviet/blocks/AirRaidBlock.java index b171c1b..62fd792 100644 --- a/src/main/java/su/a71/new_soviet/blocks/AirRaidBlock.java +++ b/src/main/java/su/a71/new_soviet/blocks/AirRaidBlock.java @@ -1,11 +1,58 @@ package su.a71.new_soviet.blocks; -import net.minecraft.block.Block; -import net.minecraft.block.Blocks; +import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; +import net.minecraft.block.*; +import net.minecraft.block.piston.PistonBehavior; +import net.minecraft.item.ItemPlacementContext; +import net.minecraft.sound.BlockSoundGroup; +import net.minecraft.state.StateManager; +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; -public class AirRaidBlock extends Block { +import net.minecraft.block.TripwireHookBlock; +import net.minecraft.world.WorldView; - public AirRaidBlock(Settings settings) { - super(settings); +public class AirRaidBlock extends HorizontalFacingBlock { + public AirRaidBlock() { + super(FabricBlockSettings.create().sounds(BlockSoundGroup.METAL).notSolid().pistonBehavior(PistonBehavior.DESTROY)); + setDefaultState(getDefaultState().with(Properties.HORIZONTAL_FACING, Direction.NORTH)); } -} + + @Override + protected void appendProperties(StateManager.Builder builder) { + builder.add(Properties.HORIZONTAL_FACING); + } + + @Override + public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext ctx) { + Direction dir = state.get(FACING); + switch(dir) { + case NORTH: + return Block.createCuboidShape(3.5, 2, 11, 12.5, 15, 16); + case SOUTH: + return Block.createCuboidShape(3.5, 2, 0, 12.5, 15, 5); + case EAST: + return Block.createCuboidShape(0, 2, 3.5, 5, 15, 12.5); + case WEST: + return Block.createCuboidShape(11, 2, 3.5, 16, 15, 12.5); + default: + return VoxelShapes.fullCube(); + } + } + + @Override + public BlockState getPlacementState(ItemPlacementContext ctx) { + return super.getPlacementState(ctx).with(Properties.HORIZONTAL_FACING, ctx.getHorizontalPlayerFacing().getOpposite()); + } + + public boolean canPlaceAt(BlockState state, WorldView world, BlockPos pos) { + Direction direction = (Direction)state.get(FACING); + BlockPos blockPos = pos.offset(direction.getOpposite()); + BlockState blockState = world.getBlockState(blockPos); + return direction.getAxis().isHorizontal() && blockState.isSideSolidFullSquare(world, blockPos, direction); + } +} \ No newline at end of file diff --git a/src/main/java/su/a71/new_soviet/blocks/CeilingFanBlock.java b/src/main/java/su/a71/new_soviet/blocks/CeilingFanBlock.java new file mode 100644 index 0000000..38fc8eb --- /dev/null +++ b/src/main/java/su/a71/new_soviet/blocks/CeilingFanBlock.java @@ -0,0 +1,75 @@ +package su.a71.new_soviet.blocks; + +import net.minecraft.block.*; +import net.minecraft.item.ItemPlacementContext; +import net.minecraft.server.world.ServerWorld; +import net.minecraft.state.StateManager; +import net.minecraft.state.property.BooleanProperty; +import net.minecraft.state.property.Property; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.Direction; +import net.minecraft.util.math.random.Random; +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.WorldView; + +import net.minecraft.block.RedstoneLampBlock; +import net.minecraft.block.TorchBlock; +import org.jetbrains.annotations.Nullable; + +public class CeilingFanBlock extends Block { + protected static final VoxelShape SHAPE; + public static final BooleanProperty ON; + + public CeilingFanBlock(Block.Settings settings) { + super(settings); + this.setDefaultState((BlockState)this.getDefaultState().with(ON, false)); + + } + + @Nullable + public BlockState getPlacementState(ItemPlacementContext ctx) { + return (BlockState)this.getDefaultState().with(ON, ctx.getWorld().isReceivingRedstonePower(ctx.getBlockPos())); + } + + public void neighborUpdate(BlockState state, World world, BlockPos pos, Block sourceBlock, BlockPos sourcePos, boolean notify) { + if (!world.isClient) { + boolean bl = (Boolean)state.get(ON); + if (bl != world.isReceivingRedstonePower(pos)) { + if (bl) { + world.scheduleBlockTick(pos, this, 4); + } else { + world.setBlockState(pos, (BlockState)state.cycle(ON), 2); + } + } + + } + } + + public void scheduledTick(BlockState state, ServerWorld world, BlockPos pos, Random random) { + if ((Boolean)state.get(ON) && !world.isReceivingRedstonePower(pos)) { + world.setBlockState(pos, (BlockState)state.cycle(ON), 2); + } + + } + + protected void appendProperties(StateManager.Builder builder) { + builder.add(new Property[]{ON}); + } + + public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) { + return SHAPE; + } + + public boolean canPlaceAt(BlockState state, WorldView world, BlockPos pos) { + Direction direction = Direction.UP; + return Block.sideCoversSmallSquare(world, pos.offset(direction), direction.getOpposite()); + } + + static { + SHAPE = VoxelShapes.union(Block.createCuboidShape(4.0, 2.0, 4.0, 12.0, 7.0, 12.0), Block.createCuboidShape(7.0, 7.0, 7.0, 9.0, 13.0, 9.0), Block.createCuboidShape(6.0, 13.0, 6.0, 10.0, 16.0, 10.0)); + ON = RedstoneTorchBlock.LIT; + } +} \ No newline at end of file diff --git a/src/main/java/su/a71/new_soviet/blocks/FUNC_IDEAS b/src/main/java/su/a71/new_soviet/blocks/FUNC_IDEAS new file mode 100644 index 0000000..fc1038d --- /dev/null +++ b/src/main/java/su/a71/new_soviet/blocks/FUNC_IDEAS @@ -0,0 +1,7 @@ +Ideas for block functionality + +Radio: Inventory where you can put music disks, and a UI to play, shuffle (and pause?) them. Like a jukebox on steroids +TV: CC compatible peripheral which combines a speaker and an 8x8 monitor +Crate: Inventory, like a barrel but smaller +Air Raid Siren: when powered (?), plays chosen frequency in chosen way at chosen sound. CC Peripheral attached +Lamp: Both bedside and ceiling are one block, Lamp, that functions sort of like a lantern \ No newline at end of file diff --git a/src/main/java/su/a71/new_soviet/blocks/LampBlock.java b/src/main/java/su/a71/new_soviet/blocks/LampBlock.java new file mode 100644 index 0000000..aee0202 --- /dev/null +++ b/src/main/java/su/a71/new_soviet/blocks/LampBlock.java @@ -0,0 +1,92 @@ +package su.a71.new_soviet.blocks; + +import net.minecraft.block.*; +import net.minecraft.entity.ai.pathing.NavigationType; +import net.minecraft.fluid.FluidState; +import net.minecraft.fluid.Fluids; +import net.minecraft.item.ItemPlacementContext; +import net.minecraft.state.StateManager; +import net.minecraft.state.property.BooleanProperty; +import net.minecraft.state.property.Properties; +import net.minecraft.state.property.Property; +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.WorldAccess; +import net.minecraft.world.WorldView; +import org.jetbrains.annotations.Nullable; + +import java.util.function.ToIntFunction; + +public class LampBlock extends Block implements Waterloggable { + public static final BooleanProperty HANGING; + public static final BooleanProperty WATERLOGGED; + protected static final VoxelShape STANDING_SHAPE; + protected static final VoxelShape HANGING_SHAPE; + + public LampBlock(AbstractBlock.Settings settings) { + super(settings.luminance((BlockState state) -> 12)); + this.setDefaultState(this.stateManager.getDefaultState().with(HANGING, false).with(WATERLOGGED, false)); + } + + @Nullable + public BlockState getPlacementState(ItemPlacementContext ctx) { + FluidState fluidState = ctx.getWorld().getFluidState(ctx.getBlockPos()); + Direction[] var3 = ctx.getPlacementDirections(); + int var4 = var3.length; + + for (int var5 = 0; var5 < var4; ++var5) { + Direction direction = var3[var5]; + if (direction.getAxis() == Direction.Axis.Y) { + BlockState blockState = this.getDefaultState().with(HANGING, direction == Direction.UP); + if (blockState.canPlaceAt(ctx.getWorld(), ctx.getBlockPos())) { + return blockState.with(WATERLOGGED, fluidState.getFluid() == Fluids.WATER); + } + } + } + + return null; + } + + public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) { + return (Boolean) state.get(HANGING) ? HANGING_SHAPE : STANDING_SHAPE; + } + + protected void appendProperties(StateManager.Builder builder) { + builder.add(new Property[]{HANGING, WATERLOGGED}); + } + + public boolean canPlaceAt(BlockState state, WorldView world, BlockPos pos) { + Direction direction = attachedDirection(state).getOpposite(); + return Block.sideCoversSmallSquare(world, pos.offset(direction), direction.getOpposite()); + } + + protected static Direction attachedDirection(BlockState state) { + return (Boolean) state.get(HANGING) ? Direction.DOWN : Direction.UP; + } + + public BlockState getStateForNeighborUpdate(BlockState state, Direction direction, BlockState neighborState, WorldAccess world, BlockPos pos, BlockPos neighborPos) { + if ((Boolean) state.get(WATERLOGGED)) { + world.scheduleFluidTick(pos, Fluids.WATER, Fluids.WATER.getTickRate(world)); + } + + return attachedDirection(state).getOpposite() == direction && !state.canPlaceAt(world, pos) ? Blocks.AIR.getDefaultState() : super.getStateForNeighborUpdate(state, direction, neighborState, world, pos, neighborPos); + } + + public FluidState getFluidState(BlockState state) { + return (Boolean) state.get(WATERLOGGED) ? Fluids.WATER.getStill(false) : super.getFluidState(state); + } + + public boolean canPathfindThrough(BlockState state, BlockView world, BlockPos pos, NavigationType type) { + return false; + } + + static { + HANGING = Properties.HANGING; + WATERLOGGED = Properties.WATERLOGGED; + STANDING_SHAPE = VoxelShapes.union(Block.createCuboidShape(5.0, 0.0, 5.0, 11.0, 7.0, 11.0), Block.createCuboidShape(6.0, 7.0, 6.0, 10.0, 9.0, 10.0)); + HANGING_SHAPE = VoxelShapes.union(Block.createCuboidShape(5.0, 1.0, 5.0, 11.0, 8.0, 11.0), Block.createCuboidShape(6.0, 8.0, 6.0, 10.0, 10.0, 10.0)); + } +} \ No newline at end of file diff --git a/src/main/java/su/a71/new_soviet/blocks/RadioBlock.java b/src/main/java/su/a71/new_soviet/blocks/RadioBlock.java index d7c8ac7..6bbeb0f 100644 --- a/src/main/java/su/a71/new_soviet/blocks/RadioBlock.java +++ b/src/main/java/su/a71/new_soviet/blocks/RadioBlock.java @@ -16,6 +16,8 @@ import net.minecraft.util.shape.VoxelShape; import net.minecraft.util.shape.VoxelShapes; import net.minecraft.world.BlockView; +import net.minecraft.block.SkullBlock; + public class RadioBlock extends HorizontalFacingBlock { public RadioBlock() { super(FabricBlockSettings.create().sounds(BlockSoundGroup.METAL).notSolid().pistonBehavior(PistonBehavior.DESTROY)); diff --git a/src/main/resources/assets/new_soviet/blockstates/ceiling_fan.json b/src/main/resources/assets/new_soviet/blockstates/ceiling_fan.json new file mode 100644 index 0000000..8bae30d --- /dev/null +++ b/src/main/resources/assets/new_soviet/blockstates/ceiling_fan.json @@ -0,0 +1,10 @@ +{ + "variants": { + "lit=true": { + "model": "new_soviet:block/ceiling_fan_on" + }, + "lit=false": { + "model": "new_soviet:block/ceiling_fan_off" + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/new_soviet/blockstates/lamp.json b/src/main/resources/assets/new_soviet/blockstates/lamp.json new file mode 100644 index 0000000..db8e5dd --- /dev/null +++ b/src/main/resources/assets/new_soviet/blockstates/lamp.json @@ -0,0 +1,10 @@ +{ + "variants": { + "hanging=false": { + "model": "new_soviet:block/table_lamp" + }, + "hanging=true": { + "model": "new_soviet:block/ceiling_lamp" + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/new_soviet/blockstates/siren.json b/src/main/resources/assets/new_soviet/blockstates/siren.json new file mode 100644 index 0000000..ea1bb1d --- /dev/null +++ b/src/main/resources/assets/new_soviet/blockstates/siren.json @@ -0,0 +1,8 @@ +{ + "variants": { + "facing=north": { "model": "new_soviet:block/siren", "uvlock": true }, + "facing=east": { "model": "new_soviet:block/siren", "y": 90, "uvlock": false }, + "facing=south": { "model": "new_soviet:block/siren", "y": 180, "uvlock": false }, + "facing=west": { "model": "new_soviet:block/siren", "y": 270, "uvlock": false } + } +} diff --git a/src/main/resources/assets/new_soviet/lang/en_us.json b/src/main/resources/assets/new_soviet/lang/en_us.json index 9e7ec78..d76d263 100644 --- a/src/main/resources/assets/new_soviet/lang/en_us.json +++ b/src/main/resources/assets/new_soviet/lang/en_us.json @@ -120,5 +120,9 @@ "block.new_soviet.tv": "TV", "block.new_soviet.red_tv": "Red TV", "block.new_soviet.brown_tv": "Brown TV", - "block.new_soviet.radio": "Radio" + "block.new_soviet.radio": "Radio", + "block.new_soviet.lamp": "Lamp", + "block.new_soviet.ceiling_fan": "Ceiling Fan", + "block.new_soviet.siren": "Siren" + } \ No newline at end of file diff --git a/src/main/resources/assets/new_soviet/models/block/brown_tv.json b/src/main/resources/assets/new_soviet/models/block/brown_tv.json index 979f917..836e5c7 100644 --- a/src/main/resources/assets/new_soviet/models/block/brown_tv.json +++ b/src/main/resources/assets/new_soviet/models/block/brown_tv.json @@ -1,7 +1,7 @@ { "parent": "new_soviet:block/tv", "textures": { - "0": "new_soviet:block/custom/brown_television", - "particle": "new_soviet:block/custom/brown_television" + "0": "new_soviet:block/custom/electronics/brown_television", + "particle": "new_soviet:block/custom/electronics/brown_television" } } \ No newline at end of file diff --git a/src/main/resources/assets/new_soviet/textures/block/custom/celling_fan.json b/src/main/resources/assets/new_soviet/models/block/ceiling_fan_off.json similarity index 92% rename from src/main/resources/assets/new_soviet/textures/block/custom/celling_fan.json rename to src/main/resources/assets/new_soviet/models/block/ceiling_fan_off.json index 28a61d1..08e77cd 100644 --- a/src/main/resources/assets/new_soviet/textures/block/custom/celling_fan.json +++ b/src/main/resources/assets/new_soviet/models/block/ceiling_fan_off.json @@ -2,9 +2,9 @@ "credit": "Made with Blockbench", "texture_size": [64, 64], "textures": { - "0": "C:/Users/Yura/Desktop/van_animated", - "1": "C:/Users/Yura/Desktop/fan_base", - "particle": "C:/Users/Yura/Desktop/van_animated" + "0": "new_soviet:block/custom/appliances/fan_static", + "1": "new_soviet:block/custom/appliances/fan_base", + "particle": "new_soviet:block/custom/appliances/fan_static" }, "elements": [ { diff --git a/src/main/resources/assets/new_soviet/models/block/ceiling_fan_on.json b/src/main/resources/assets/new_soviet/models/block/ceiling_fan_on.json new file mode 100644 index 0000000..007471b --- /dev/null +++ b/src/main/resources/assets/new_soviet/models/block/ceiling_fan_on.json @@ -0,0 +1,82 @@ +{ + "credit": "Made with Blockbench", + "texture_size": [64, 64], + "textures": { + "0": "new_soviet:block/custom/appliances/fan_animated", + "1": "new_soviet:block/custom/appliances/fan_base", + "particle": "new_soviet:block/custom/appliances/fan_animated" + }, + "elements": [ + { + "name": "root", + "from": [6, 13, 6], + "to": [10, 16, 10], + "faces": { + "north": {"uv": [1, 4.25, 2, 5], "texture": "#1"}, + "east": {"uv": [0, 4.25, 1, 5], "texture": "#1"}, + "south": {"uv": [3, 4.25, 4, 5], "texture": "#1"}, + "west": {"uv": [2, 4.25, 3, 5], "texture": "#1"}, + "up": {"uv": [2, 4.25, 1, 3.25], "texture": "#1"}, + "down": {"uv": [3, 3.25, 2, 4.25], "texture": "#1"} + } + }, + { + "name": "root", + "from": [7, 7, 7], + "to": [9, 13, 9], + "faces": { + "north": {"uv": [0.5, 0.5, 1, 2], "texture": "#1"}, + "east": {"uv": [0, 0.5, 0.5, 2], "texture": "#1"}, + "south": {"uv": [1.5, 0.5, 2, 2], "texture": "#1"}, + "west": {"uv": [1, 0.5, 1.5, 2], "texture": "#1"}, + "up": {"uv": [1, 0.5, 0.5, 0], "texture": "#1"}, + "down": {"uv": [1.5, 0, 1, 0.5], "texture": "#1"} + } + }, + { + "name": "root", + "from": [4, 2, 4], + "to": [12, 7, 12], + "faces": { + "north": {"uv": [2, 2, 4, 3.25], "texture": "#1"}, + "east": {"uv": [0, 2, 2, 3.25], "texture": "#1"}, + "south": {"uv": [6, 2, 8, 3.25], "texture": "#1"}, + "west": {"uv": [4, 2, 6, 3.25], "texture": "#1"}, + "up": {"uv": [4, 2, 2, 0], "texture": "#1"}, + "down": {"uv": [6, 0, 4, 2], "texture": "#1"} + } + }, + { + "name": "root", + "from": [6, 0, 6], + "to": [10, 2, 10], + "faces": { + "north": {"uv": [4, 5, 5, 5.5], "texture": "#1"}, + "east": {"uv": [3, 5, 4, 5.5], "texture": "#1"}, + "south": {"uv": [6, 5, 7, 5.5], "texture": "#1"}, + "west": {"uv": [5, 5, 6, 5.5], "texture": "#1"}, + "up": {"uv": [5, 5, 4, 4], "texture": "#1"}, + "down": {"uv": [6, 4, 5, 5], "texture": "#1"} + } + }, + { + "name": "root", + "from": [-8, 1, -8], + "to": [24, 1, 24], + "faces": { + "up": {"uv": [16, 16, 0, 0], "texture": "#0"}, + "down": {"uv": [16, 0, 0, 16], "texture": "#0"} + } + } + ], + "groups": [ + { + "name": "root", + "origin": [0, 0, 0], + "color": 0, + "nbt": "{}", + "armAnimationEnabled": false, + "children": [0, 1, 2, 3, 4] + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/new_soviet/textures/block/custom/ceiling_lamp.json b/src/main/resources/assets/new_soviet/models/block/ceiling_lamp.json similarity index 98% rename from src/main/resources/assets/new_soviet/textures/block/custom/ceiling_lamp.json rename to src/main/resources/assets/new_soviet/models/block/ceiling_lamp.json index 20275da..34a3d90 100644 --- a/src/main/resources/assets/new_soviet/textures/block/custom/ceiling_lamp.json +++ b/src/main/resources/assets/new_soviet/models/block/ceiling_lamp.json @@ -1,8 +1,8 @@ { "credit": "Made with Blockbench", "textures": { - "0": "ceiling_lamp", - "particle": "ceiling_lamp" + "0": "new_soviet:block/custom/furniture/ceiling_lamp", + "particle": "new_soviet:block/custom/furniture/ceiling_lamp" }, "elements": [ { diff --git a/src/main/resources/assets/new_soviet/models/block/radio.json b/src/main/resources/assets/new_soviet/models/block/radio.json index fef5a39..75646e9 100644 --- a/src/main/resources/assets/new_soviet/models/block/radio.json +++ b/src/main/resources/assets/new_soviet/models/block/radio.json @@ -2,8 +2,8 @@ "credit": "Made with Blockbench", "texture_size": [64, 64], "textures": { - "0": "new_soviet:block/custom/radio", - "particle": "new_soviet:block/custom/radio" + "0": "new_soviet:block/custom/electronics/radio", + "particle": "new_soviet:block/custom/electronics/radio" }, "elements": [ { diff --git a/src/main/resources/assets/new_soviet/models/block/red_tv.json b/src/main/resources/assets/new_soviet/models/block/red_tv.json index d3f1025..5a23cf3 100644 --- a/src/main/resources/assets/new_soviet/models/block/red_tv.json +++ b/src/main/resources/assets/new_soviet/models/block/red_tv.json @@ -1,7 +1,7 @@ { "parent": "new_soviet:block/tv", "textures": { - "0": "new_soviet:block/custom/red_television", - "particle": "new_soviet:block/custom/red_television" + "0": "new_soviet:block/custom/electronics/red_television", + "particle": "new_soviet:block/custom/electronics/red_television" } } \ No newline at end of file diff --git a/src/main/resources/assets/new_soviet/textures/block/custom/siren.json b/src/main/resources/assets/new_soviet/models/block/siren.json similarity index 96% rename from src/main/resources/assets/new_soviet/textures/block/custom/siren.json rename to src/main/resources/assets/new_soviet/models/block/siren.json index e14db21..bf5f0bc 100644 --- a/src/main/resources/assets/new_soviet/textures/block/custom/siren.json +++ b/src/main/resources/assets/new_soviet/models/block/siren.json @@ -2,8 +2,8 @@ "credit": "Made with Blockbench", "texture_size": [32, 32], "textures": { - "0": "siren", - "particle": "siren" + "0": "new_soviet:block/custom/electronics/siren", + "particle": "new_soviet:block/custom/electronics/siren" }, "elements": [ { diff --git a/src/main/resources/assets/new_soviet/textures/block/custom/table_lamp.json b/src/main/resources/assets/new_soviet/models/block/table_lamp.json similarity index 96% rename from src/main/resources/assets/new_soviet/textures/block/custom/table_lamp.json rename to src/main/resources/assets/new_soviet/models/block/table_lamp.json index 7f74f93..1e74a47 100644 --- a/src/main/resources/assets/new_soviet/textures/block/custom/table_lamp.json +++ b/src/main/resources/assets/new_soviet/models/block/table_lamp.json @@ -1,8 +1,8 @@ { "credit": "Made with Blockbench", "textures": { - "0": "custom/furniture/table_lamp", - "particle": "custom/furniture/table_lamp" + "0": "new_soviet:block/custom/furniture/table_lamp", + "particle": "new_soviet:block/custom/furniture/table_lamp" }, "elements": [ { diff --git a/src/main/resources/assets/new_soviet/models/block/tv.json b/src/main/resources/assets/new_soviet/models/block/tv.json index 4e4dc75..0a3dbfe 100644 --- a/src/main/resources/assets/new_soviet/models/block/tv.json +++ b/src/main/resources/assets/new_soviet/models/block/tv.json @@ -2,8 +2,8 @@ "credit": "Made with Blockbench", "texture_size": [64, 64], "textures": { - "0": "new_soviet:block/custom/television", - "particle": "new_soviet:block/custom/television" + "0": "new_soviet:block/custom/electronics/television", + "particle": "new_soviet:block/custom/electronics/television" }, "elements": [ { diff --git a/src/main/resources/assets/new_soviet/models/item/ceiling_fan.json b/src/main/resources/assets/new_soviet/models/item/ceiling_fan.json new file mode 100644 index 0000000..ade42ea --- /dev/null +++ b/src/main/resources/assets/new_soviet/models/item/ceiling_fan.json @@ -0,0 +1,4 @@ +{ + "parent": "new_soviet:block/ceiling_fan_off" +} + diff --git a/src/main/resources/assets/new_soviet/models/item/lamp.json b/src/main/resources/assets/new_soviet/models/item/lamp.json new file mode 100644 index 0000000..0218d0a --- /dev/null +++ b/src/main/resources/assets/new_soviet/models/item/lamp.json @@ -0,0 +1,3 @@ +{ + "parent": "new_soviet:block/table_lamp" +} \ No newline at end of file diff --git a/src/main/resources/assets/new_soviet/models/item/siren.json b/src/main/resources/assets/new_soviet/models/item/siren.json new file mode 100644 index 0000000..7d19f7b --- /dev/null +++ b/src/main/resources/assets/new_soviet/models/item/siren.json @@ -0,0 +1,4 @@ +{ + "parent": "new_soviet:block/siren" +} + diff --git a/src/main/resources/assets/new_soviet/textures/block/custom/bathroom.json b/src/main/resources/assets/new_soviet/textures/block/custom/appliances/bathroom.json similarity index 100% rename from src/main/resources/assets/new_soviet/textures/block/custom/bathroom.json rename to src/main/resources/assets/new_soviet/textures/block/custom/appliances/bathroom.json diff --git a/src/main/resources/assets/new_soviet/textures/block/custom/bathroom.png b/src/main/resources/assets/new_soviet/textures/block/custom/appliances/bathroom.png similarity index 100% rename from src/main/resources/assets/new_soviet/textures/block/custom/bathroom.png rename to src/main/resources/assets/new_soviet/textures/block/custom/appliances/bathroom.png diff --git a/src/main/resources/assets/new_soviet/textures/block/custom/van_animated.png b/src/main/resources/assets/new_soviet/textures/block/custom/appliances/fan_animated.png similarity index 100% rename from src/main/resources/assets/new_soviet/textures/block/custom/van_animated.png rename to src/main/resources/assets/new_soviet/textures/block/custom/appliances/fan_animated.png diff --git a/src/main/resources/assets/new_soviet/textures/block/custom/appliances/fan_animated.png.mcmeta b/src/main/resources/assets/new_soviet/textures/block/custom/appliances/fan_animated.png.mcmeta new file mode 100644 index 0000000..6ac175c --- /dev/null +++ b/src/main/resources/assets/new_soviet/textures/block/custom/appliances/fan_animated.png.mcmeta @@ -0,0 +1,7 @@ +{ + "animation": { + "frametime": 1, + "interpolate": false, + "frames": [0, 1, 2, 3] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/new_soviet/textures/block/custom/fan_base.png b/src/main/resources/assets/new_soviet/textures/block/custom/appliances/fan_base.png similarity index 100% rename from src/main/resources/assets/new_soviet/textures/block/custom/fan_base.png rename to src/main/resources/assets/new_soviet/textures/block/custom/appliances/fan_base.png diff --git a/src/main/resources/assets/new_soviet/textures/block/custom/appliances/fan_static.png b/src/main/resources/assets/new_soviet/textures/block/custom/appliances/fan_static.png new file mode 100644 index 0000000000000000000000000000000000000000..9af61ca8c59d6f812691c68b7a31d7c5e02c1d4a GIT binary patch literal 420 zcmV;V0bBlwP)Px$UP(kjR9J=8S20V&P!Rqi{(=x8!c&NY;4UsAy0{iMe?*qz?9iceHh)5fY~5Xy zQV7yr(xC-?(1N9Z;W?D|cnvXxyZA!C>B!67eRtoz3jr7?@>CUhsyHzYsE(7-Q29c@ z7Xp*fkW9j(I{wJ_ouo(NmK2NJfwr)}1U6Du+Rg~9SBpy983BM-Ih%l-FDq?l1T?r^ zIOI5Uv~LB2eoqbhy>3=xr*xGaEfK0%yp3{lW_rU%Vm`%r(wo|n6d;SX@T#Y{Mz(lA3 O0000