From d2d92fea114541c40f0242969ce82e2df9105bd8 Mon Sep 17 00:00:00 2001 From: rearth Date: Tue, 2 Apr 2024 17:15:09 +0200 Subject: [PATCH] Add large energy storage, add energy storage UI --- .../19c08d24c255c2719fbb8ac01f9dff290b763461 | 14 +- .../blockstates/large_storage_block.json | 7 + .../models/item/large_storage_block.json | 3 + .../ExpandableEnergyStorageBlockEntity.java | 90 ++++++++- .../block/blocks/MachineCoreBlock.java | 10 +- .../machines/storage/LargeStorageBlock.java | 89 +++++++++ .../machines/storage/SmallStorageBlock.java | 6 +- .../storage/LargeStorageBlockEntity.java | 114 +++++++++++ .../storage/SmallStorageBlockEntity.java | 5 + .../pipes/EnergyPipeInterfaceEntity.java | 2 +- .../oritech/client/init/ModScreens.java | 2 + .../oritech/client/ui/BasicMachineScreen.java | 15 +- .../client/ui/UpgradableMachineScreen.java | 5 +- .../rearth/oritech/init/BlockContent.java | 2 + .../oritech/init/BlockEntitiesContent.java | 3 + .../oritech/init/datagen/ModelGenerator.java | 1 + .../oritech/network/NetworkContent.java | 16 ++ .../rearth/oritech/util/ScreenProvider.java | 13 +- .../blockstates/large_storage_block.json | 42 ++++ .../models/block/large_storage_block.json | 188 ++++++++++++++++++ .../block/large_storage_block_packaged.json | 54 +++++ .../models/block/small_storage_block.json | 32 ++- .../textures/block/large_storage_block.png | Bin 0 -> 3671 bytes .../block/large_storage_block_packaged.png | Bin 0 -> 840 bytes 24 files changed, 683 insertions(+), 30 deletions(-) create mode 100644 src/main/generated/assets/oritech/blockstates/large_storage_block.json create mode 100644 src/main/generated/assets/oritech/models/item/large_storage_block.json create mode 100644 src/main/java/rearth/oritech/block/blocks/machines/storage/LargeStorageBlock.java create mode 100644 src/main/java/rearth/oritech/block/entity/machines/storage/LargeStorageBlockEntity.java create mode 100644 src/main/resources/assets/oritech/blockstates/large_storage_block.json create mode 100644 src/main/resources/assets/oritech/models/block/large_storage_block.json create mode 100644 src/main/resources/assets/oritech/models/block/large_storage_block_packaged.json create mode 100644 src/main/resources/assets/oritech/textures/block/large_storage_block.png create mode 100644 src/main/resources/assets/oritech/textures/block/large_storage_block_packaged.png diff --git a/src/main/generated/.cache/19c08d24c255c2719fbb8ac01f9dff290b763461 b/src/main/generated/.cache/19c08d24c255c2719fbb8ac01f9dff290b763461 index b17045ca0..f0c66f73b 100644 --- a/src/main/generated/.cache/19c08d24c255c2719fbb8ac01f9dff290b763461 +++ b/src/main/generated/.cache/19c08d24c255c2719fbb8ac01f9dff290b763461 @@ -1,13 +1,13 @@ -// 1.20.4 2024-04-01T19:45:11.2977587 Oritech/Model Definitions -0ea8315aed10abcf90ec950fee0062aed26075cb assets\oritech\models\item\energy_pipe.json +// 1.20.4 2024-04-01T23:00:46.7476488 Oritech/Model Definitions 8ede0997449fd1c3f65a07df184768a843b473ed assets\oritech\models\item\centrifuge_block.json +0ea8315aed10abcf90ec950fee0062aed26075cb assets\oritech\models\item\energy_pipe.json 90e28b721796ff7ee21c8eefe4525f03a251d2fb assets\oritech\models\block\machine_extender.json 3fcaea2f05319816f7904137763182c4106c91a9 assets\oritech\blockstates\destroyer_block.json e6f197ee5ac22cd68bc502a86d40b65bfe40884a assets\oritech\models\item\target_designator.json 7eb395cd65df72caf43bedc54067cbf53940fd6c assets\oritech\blockstates\centrifuge_block.json 8ef5ff056a3d2fa26393ec9ccb4b6f3b410f8be8 assets\oritech\models\item\item_pipe.json -b91305cbccecb97f9d74e2b92787ae9fa6387786 assets\oritech\blockstates\fluid_pipe.json 7eb395cd65df72caf43bedc54067cbf53940fd6c assets\oritech\blockstates\fragment_forge_block.json +b91305cbccecb97f9d74e2b92787ae9fa6387786 assets\oritech\blockstates\fluid_pipe.json 98d62a615b70fca694eb00c6b8aa9297c4a92b62 assets\oritech\blockstates\energy_pipe_connection.json 7eb395cd65df72caf43bedc54067cbf53940fd6c assets\oritech\blockstates\big_solar_panel_block.json 3ceff0ef4325bb269831205626285bc857c60de8 assets\oritech\models\item\destroyer_block.json @@ -24,17 +24,18 @@ ee822d455f99c8c53c789fdb744979f678ca2729 assets\oritech\blockstates\fertilizer_b 46af77abe62b29d232feadccde429fd59d5603fc assets\oritech\blockstates\placer_block.json 3d37038977380bd685f913e722cc3b1c3a25c35d assets\oritech\models\item\atomic_forge_block.json 7eb395cd65df72caf43bedc54067cbf53940fd6c assets\oritech\blockstates\test_generator_block.json -b5ee97616ae0d2da17dfaecf45aa42f2cf19f691 assets\oritech\blockstates\machine_extender.json eafe84c787830ab2a866e0878e9ed718d58659f5 assets\oritech\blockstates\banana_block.json +b5ee97616ae0d2da17dfaecf45aa42f2cf19f691 assets\oritech\blockstates\machine_extender.json 25864df3cd7786f2bf4fe6fa9855b3cf366c28ca assets\oritech\models\item\banana.json 1fdbeb99862a58436d745edb768b503539ecb295 assets\oritech\models\item\placer_block.json 58b38bcc6c404953490330d4cc797464b6874d88 assets\oritech\models\item\test_generator_block.json b8bc03092cb1eb686ede01daffc7421253af860c assets\oritech\models\item\machine_extender.json -9cd64a2fe3b9a0ee479646d36cc0302bcd7cab4f assets\oritech\models\block\destroyer_block.json 45fbece69084d6df6eaa4ba344d25eef914c63c3 assets\oritech\models\item\small_storage_block.json +9cd64a2fe3b9a0ee479646d36cc0302bcd7cab4f assets\oritech\models\block\destroyer_block.json 63f14855c688ce7ec236097ce232dd381cbc1538 assets\oritech\blockstates\addon_indicator_block.json 7ee14de0149c70d1145dbf338518690b536cc02e assets\oritech\models\item\powered_furnace_block.json 746b98d721e5ae0d96dd769e71b786afa8c2d142 assets\oritech\models\item\banana_block.json +c0a08ce14172e22abd9f55d82686f7e96e74834a assets\oritech\blockstates\large_storage_block.json 230eb8fa77942cdf46509bea8df75b48f82e9e8e assets\oritech\blockstates\machine_frame_block.json 9caec2452545622571a137712307b8e0e669af9e assets\oritech\models\block\block_fertilizer_head.json 7eb395cd65df72caf43bedc54067cbf53940fd6c assets\oritech\blockstates\atomic_forge_block.json @@ -48,9 +49,9 @@ a5afa0ba8780ec08bd0a9284bc08e0c681fe7158 assets\oritech\blockstates\block_placer 5054284e6d5fe0785ac93bdda5101c47337953cf assets\oritech\models\item\machine_frame_block.json 7b3ae67ec28f9b36b96539cd48b92096861d0853 assets\oritech\models\item\oil_bucket.json 56c7ceb5cc86d67913ad95cb4ae5ec192aed926f assets\oritech\models\block\pump_block.json -7eb395cd65df72caf43bedc54067cbf53940fd6c assets\oritech\blockstates\powered_furnace_block.json 1b9cd3719105dc1e03398de41f2cab37337816fe assets\oritech\blockstates\machine_core_good.json ccd7e87c2ba5a5062bb88aa6e103d49d47cd56ff assets\oritech\blockstates\energy_pipe.json +7eb395cd65df72caf43bedc54067cbf53940fd6c assets\oritech\blockstates\powered_furnace_block.json 5462a2453fcdd2f8b99129894aec60f282d29ca9 assets\oritech\models\item\pulverizer_block.json ae8496aa356910304cb7036f1290ca3f7d76437e assets\oritech\models\item\item_filter_block.json a3f9b72f6f36d42af4e5c3a87d7e180b2e36a2ed assets\oritech\models\item\machine_core_good.json @@ -58,6 +59,7 @@ a3f9b72f6f36d42af4e5c3a87d7e180b2e36a2ed assets\oritech\models\item\machine_core 469ea8a66c529fe26bc029c21092e7f062ed0e40 assets\oritech\models\block\banana_block.json d35ecef5df9198b12dc04267780c727c144b1959 assets\oritech\models\item\assembler_block.json f337c5c80895d0c133e8218a41a0915b307cce18 assets\oritech\blockstates\small_storage_block.json +b6ebdae5692a337d52fe49ec327da5cff08540da assets\oritech\models\item\large_storage_block.json d39d7a8eaa54d12c155fb1acd1722e322c0aeac3 assets\oritech\models\block\block_destroyer_head.json 7eb395cd65df72caf43bedc54067cbf53940fd6c assets\oritech\blockstates\foundry_block.json 30525b49546801c90bc77faa6eab332ba288eca5 assets\oritech\models\item\fertilizer_block.json diff --git a/src/main/generated/assets/oritech/blockstates/large_storage_block.json b/src/main/generated/assets/oritech/blockstates/large_storage_block.json new file mode 100644 index 000000000..c57d9d0b0 --- /dev/null +++ b/src/main/generated/assets/oritech/blockstates/large_storage_block.json @@ -0,0 +1,7 @@ +{ + "variants": { + "": { + "model": "oritech:block/large_storage_block" + } + } +} \ No newline at end of file diff --git a/src/main/generated/assets/oritech/models/item/large_storage_block.json b/src/main/generated/assets/oritech/models/item/large_storage_block.json new file mode 100644 index 000000000..ab28c0c90 --- /dev/null +++ b/src/main/generated/assets/oritech/models/item/large_storage_block.json @@ -0,0 +1,3 @@ +{ + "parent": "oritech:block/large_storage_block" +} \ No newline at end of file diff --git a/src/main/java/rearth/oritech/block/base/entity/ExpandableEnergyStorageBlockEntity.java b/src/main/java/rearth/oritech/block/base/entity/ExpandableEnergyStorageBlockEntity.java index 4488e7254..c418d6491 100644 --- a/src/main/java/rearth/oritech/block/base/entity/ExpandableEnergyStorageBlockEntity.java +++ b/src/main/java/rearth/oritech/block/base/entity/ExpandableEnergyStorageBlockEntity.java @@ -1,21 +1,33 @@ package rearth.oritech.block.base.entity; import net.fabricmc.fabric.api.lookup.v1.block.BlockApiCache; +import net.fabricmc.fabric.api.screenhandler.v1.ExtendedScreenHandlerFactory; import net.fabricmc.fabric.api.transfer.v1.transaction.Transaction; import net.minecraft.block.BlockState; import net.minecraft.block.entity.BlockEntity; import net.minecraft.block.entity.BlockEntityTicker; import net.minecraft.block.entity.BlockEntityType; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.entity.player.PlayerInventory; +import net.minecraft.inventory.Inventory; import net.minecraft.inventory.SimpleInventory; import net.minecraft.nbt.NbtCompound; +import net.minecraft.network.PacketByteBuf; +import net.minecraft.screen.ScreenHandler; +import net.minecraft.screen.ScreenHandlerType; +import net.minecraft.server.network.ServerPlayerEntity; import net.minecraft.server.world.ServerWorld; +import net.minecraft.state.property.Property; +import net.minecraft.text.Text; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Direction; -import net.minecraft.util.math.Vec3d; import net.minecraft.util.math.Vec3i; import net.minecraft.world.World; +import org.jetbrains.annotations.Nullable; import rearth.oritech.block.blocks.machines.storage.SmallStorageBlock; -import rearth.oritech.client.init.ParticleContent; +import rearth.oritech.client.init.ModScreens; +import rearth.oritech.client.ui.UpgradableMachineScreenHandler; +import rearth.oritech.network.NetworkContent; import rearth.oritech.util.*; import team.reborn.energy.api.EnergyStorage; import team.reborn.energy.api.base.DelegatingEnergyStorage; @@ -25,7 +37,7 @@ import java.util.List; import java.util.Objects; -public abstract class ExpandableEnergyStorageBlockEntity extends BlockEntity implements EnergyProvider, MachineAddonController, BlockEntityTicker { +public abstract class ExpandableEnergyStorageBlockEntity extends BlockEntity implements EnergyProvider, MachineAddonController, ScreenProvider, ExtendedScreenHandlerFactory, BlockEntityTicker { private final List connectedAddons = new ArrayList<>(); private final List openSlots = new ArrayList<>(); @@ -98,9 +110,6 @@ protected HashMap> getNeighbo var facing = getFacing(); var blockInFront = (BlockPos) Geometry.offsetToWorldPosition(facing, new Vec3i(-1, 0, 0), pos); - System.out.println(blockInFront.toCenterPos()); - ParticleContent.HIGHLIGHT_BLOCK.spawn(world, Vec3d.of(blockInFront)); - var frontCache = BlockApiCache.create(EnergyStorage.SIDED, (ServerWorld) world, blockInFront); res.put(Direction.DOWN, frontCache); @@ -186,4 +195,73 @@ public void setBaseAddonData(BaseAddonData data) { } public abstract long getDefaultExtractionRate(); + + @Override + public void writeScreenOpeningData(ServerPlayerEntity player, PacketByteBuf buf) { + buf.writeBlockPos(this.getPos()); + buf.write(ADDON_UI_ENDEC, getUiData()); + buf.writeFloat(getCoreQuality()); + NetworkContent.MACHINE_CHANNEL.serverHandle(this).send(new NetworkContent.GenericEnergySyncPacket(pos, energyStorage.amount, energyStorage.capacity)); + } + + @Override + public Text getDisplayName() { + return Text.literal("invalid"); + } + + @Nullable + @Override + public ScreenHandler createMenu(int syncId, PlayerInventory playerInventory, PlayerEntity player) { + return new UpgradableMachineScreenHandler(syncId, playerInventory, this, getUiData(), getCoreQuality()); + } + + @Override + public List getGuiSlots() { + return List.of(); + } + + @Override + public float getDisplayedEnergyUsage() { + return 0; + } + + @Override + public float getProgress() { + return 0; + } + + @Override + public InventoryInputMode getInventoryInputMode() { + return InventoryInputMode.FILL_LEFT_TO_RIGHT; + } + + @Override + public boolean inputOptionsEnabled() { + return false; + } + + @Override + public Inventory getDisplayedInventory() { + return new SimpleInventory(); + } + + @Override + public ScreenHandlerType getScreenHandlerType() { + return ModScreens.STORAGE_SCREEN; + } + + @Override + public BarConfiguration getEnergyConfiguration() { + return new BarConfiguration(80, 26, 15, 54); + } + + @Override + public boolean showProgress() { + return false; + } + + @Override + public Property getBlockFacingProperty() { + return SmallStorageBlock.TARGET_DIR; + } } diff --git a/src/main/java/rearth/oritech/block/blocks/MachineCoreBlock.java b/src/main/java/rearth/oritech/block/blocks/MachineCoreBlock.java index 16456c06e..a289d486a 100644 --- a/src/main/java/rearth/oritech/block/blocks/MachineCoreBlock.java +++ b/src/main/java/rearth/oritech/block/blocks/MachineCoreBlock.java @@ -15,10 +15,9 @@ import net.minecraft.world.World; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import rearth.oritech.block.base.block.MachineBlock; -import rearth.oritech.block.base.block.MultiblockFrameInteractionBlock; import rearth.oritech.block.entity.machines.MachineCoreEntity; import rearth.oritech.util.MultiblockMachineController; +import rearth.oritech.util.ScreenProvider; import java.util.Objects; @@ -81,11 +80,8 @@ public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEnt if (!world.isClient) { var controllerPos = getControllerPos(world, pos); var controllerBlock = world.getBlockState(controllerPos); - if (Objects.requireNonNull(controllerBlock).getBlock() instanceof MachineBlock) { - return controllerBlock.getBlock().onUse(controllerBlock, world, controllerPos, player, hand, hit); - } - - if (Objects.requireNonNull(controllerBlock).getBlock() instanceof MultiblockFrameInteractionBlock) { + var controllerEntity = world.getBlockEntity(controllerPos); + if (controllerEntity instanceof ScreenProvider) { return controllerBlock.getBlock().onUse(controllerBlock, world, controllerPos, player, hand, hit); } } diff --git a/src/main/java/rearth/oritech/block/blocks/machines/storage/LargeStorageBlock.java b/src/main/java/rearth/oritech/block/blocks/machines/storage/LargeStorageBlock.java new file mode 100644 index 000000000..eaedf116e --- /dev/null +++ b/src/main/java/rearth/oritech/block/blocks/machines/storage/LargeStorageBlock.java @@ -0,0 +1,89 @@ +package rearth.oritech.block.blocks.machines.storage; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockState; +import net.minecraft.block.entity.BlockEntity; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.item.ItemPlacementContext; +import net.minecraft.state.StateManager; +import net.minecraft.text.Text; +import net.minecraft.util.ActionResult; +import net.minecraft.util.Hand; +import net.minecraft.util.hit.BlockHitResult; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import org.jetbrains.annotations.Nullable; +import rearth.oritech.block.entity.machines.storage.LargeStorageBlockEntity; +import rearth.oritech.util.MultiblockMachineController; + +import java.util.Objects; + +import static rearth.oritech.block.base.block.MultiblockMachine.ASSEMBLED; + +public class LargeStorageBlock extends SmallStorageBlock { + + public LargeStorageBlock(Settings settings) { + super(settings); + setDefaultState(getDefaultState().with(ASSEMBLED, false)); + } + + @Override + protected void appendProperties(StateManager.Builder builder) { + super.appendProperties(builder); + builder.add(ASSEMBLED); + } + + @Override + public @Nullable BlockEntity createBlockEntity(BlockPos pos, BlockState state) { + return new LargeStorageBlockEntity(pos, state); + } + + @Override + public @Nullable BlockState getPlacementState(ItemPlacementContext ctx) { + return Objects.requireNonNull(super.getPlacementState(ctx)).with(SmallStorageBlock.TARGET_DIR, ctx.getHorizontalPlayerFacing().getOpposite()); + } + + @Override + public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) { + + if (!world.isClient) { + + var entity = world.getBlockEntity(pos); + if (!(entity instanceof MultiblockMachineController machineEntity)) { + return ActionResult.SUCCESS; + } + + var wasAssembled = state.get(ASSEMBLED); + + var isAssembled = machineEntity.initMultiblock(state); + + // first time created + if (isAssembled && !wasAssembled) { + // NetworkContent.MACHINE_CHANNEL.serverHandle(machineEntity).send(new NetworkContent.MachineSetupEventPacket(pos)); + return ActionResult.SUCCESS; + } + + if (!isAssembled) { + player.sendMessage(Text.literal("Machine is not assembled. Please add missing core blocks")); + return ActionResult.SUCCESS; + } + + } + + return super.onUse(state, world, pos, player, hand, hit); + } + + @Override + public BlockState onBreak(World world, BlockPos pos, BlockState state, PlayerEntity player) { + + if (!world.isClient() && state.get(ASSEMBLED)) { + + var entity = world.getBlockEntity(pos); + if (entity instanceof MultiblockMachineController machineEntity) { + machineEntity.onControllerBroken(); + } + } + + return super.onBreak(world, pos, state, player); + } +} \ No newline at end of file diff --git a/src/main/java/rearth/oritech/block/blocks/machines/storage/SmallStorageBlock.java b/src/main/java/rearth/oritech/block/blocks/machines/storage/SmallStorageBlock.java index 90d977b71..2031c9978 100644 --- a/src/main/java/rearth/oritech/block/blocks/machines/storage/SmallStorageBlock.java +++ b/src/main/java/rearth/oritech/block/blocks/machines/storage/SmallStorageBlock.java @@ -1,5 +1,6 @@ package rearth.oritech.block.blocks.machines.storage; +import net.fabricmc.fabric.api.screenhandler.v1.ExtendedScreenHandlerFactory; import net.minecraft.block.Block; import net.minecraft.block.BlockEntityProvider; import net.minecraft.block.BlockRenderType; @@ -66,9 +67,12 @@ public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEnt machineEntity.initAddons(); + var handler = (ExtendedScreenHandlerFactory) world.getBlockEntity(pos); + player.openHandledScreen(handler); + } - return super.onUse(state, world, pos, player, hand, hit); + return ActionResult.SUCCESS; } @Override diff --git a/src/main/java/rearth/oritech/block/entity/machines/storage/LargeStorageBlockEntity.java b/src/main/java/rearth/oritech/block/entity/machines/storage/LargeStorageBlockEntity.java new file mode 100644 index 000000000..8492bf02f --- /dev/null +++ b/src/main/java/rearth/oritech/block/entity/machines/storage/LargeStorageBlockEntity.java @@ -0,0 +1,114 @@ +package rearth.oritech.block.entity.machines.storage; + +import net.fabricmc.fabric.api.lookup.v1.block.BlockApiCache; +import net.minecraft.block.BlockState; +import net.minecraft.nbt.NbtCompound; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.Direction; +import net.minecraft.util.math.Vec3i; +import net.minecraft.world.World; +import rearth.oritech.block.base.entity.ExpandableEnergyStorageBlockEntity; +import rearth.oritech.init.BlockEntitiesContent; +import rearth.oritech.util.InventoryProvider; +import rearth.oritech.util.MultiblockMachineController; +import team.reborn.energy.api.EnergyStorage; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; + +public class LargeStorageBlockEntity extends ExpandableEnergyStorageBlockEntity implements MultiblockMachineController { + + private final ArrayList coreBlocksConnected = new ArrayList<>(); + + private float coreQuality = 1f; + public LargeStorageBlockEntity(BlockPos pos, BlockState state) { + super(BlockEntitiesContent.LARGE_STORAGE_ENTITY, pos, state); + } + + @Override + protected HashMap> getNeighborCaches(BlockPos pos, World world) { + return super.getNeighborCaches(pos, world); + } + + @Override + public void writeNbt(NbtCompound nbt) { + super.writeNbt(nbt); + addMultiblockToNbt(nbt); + } + + @Override + public void readNbt(NbtCompound nbt) { + super.readNbt(nbt); + loadMultiblockNbtData(nbt); + } + + @Override + public List getAddonSlots() { + return List.of( + new Vec3i(0, 0,-1), + new Vec3i(0, 0,1), + new Vec3i(0, 1,-1), + new Vec3i(0, 1,1), + new Vec3i(1, 0,-1), + new Vec3i(1, 0,1), + new Vec3i(1, 1,-1), + new Vec3i(1, 1,1) + ); + } + + @Override + public long getDefaultCapacity() { + return 500000; + } + + @Override + public long getDefaultInsertRate() { + return 5000; + } + + @Override + public long getDefaultExtractionRate() { + return 5000; + } + + @Override + public List getCorePositions() { + return List.of( + new Vec3i(0, 1,0), + new Vec3i(1, 0,0), + new Vec3i(1, 1,0) + ); + } + + @Override + public Direction getFacingForMultiblock() { + return super.getFacingForAddon(); + } + + @Override + public ArrayList getConnectedCores() { + return coreBlocksConnected; + } + + @Override + public void setCoreQuality(float quality) { + this.coreQuality = quality; + } + + @Override + public float getCoreQuality() { + return this.coreQuality; + } + + @Override + public InventoryProvider getInventoryForLink() { + return null; + } + + @Override + public EnergyStorage getEnergyStorageForLink() { + return energyStorage; + } + +} diff --git a/src/main/java/rearth/oritech/block/entity/machines/storage/SmallStorageBlockEntity.java b/src/main/java/rearth/oritech/block/entity/machines/storage/SmallStorageBlockEntity.java index b055d16d8..4a9fbf9b4 100644 --- a/src/main/java/rearth/oritech/block/entity/machines/storage/SmallStorageBlockEntity.java +++ b/src/main/java/rearth/oritech/block/entity/machines/storage/SmallStorageBlockEntity.java @@ -36,4 +36,9 @@ public long getDefaultInsertRate() { public long getDefaultExtractionRate() { return 1000; } + + @Override + public float getCoreQuality() { + return 3; + } } diff --git a/src/main/java/rearth/oritech/block/entity/pipes/EnergyPipeInterfaceEntity.java b/src/main/java/rearth/oritech/block/entity/pipes/EnergyPipeInterfaceEntity.java index b9311ca12..2fcb34a46 100644 --- a/src/main/java/rearth/oritech/block/entity/pipes/EnergyPipeInterfaceEntity.java +++ b/src/main/java/rearth/oritech/block/entity/pipes/EnergyPipeInterfaceEntity.java @@ -21,7 +21,7 @@ public class EnergyPipeInterfaceEntity extends GenericPipeInterfaceEntity implements EnergyProvider { - private final SimpleEnergyStorage energyStorage = new SimpleEnergyStorage(50000, 50000, 50000); + private final SimpleEnergyStorage energyStorage = new SimpleEnergyStorage(5000, 5000, 5000); private final HashMap> lookupCache = new HashMap<>(); public EnergyPipeInterfaceEntity(BlockPos pos, BlockState state) { diff --git a/src/main/java/rearth/oritech/client/init/ModScreens.java b/src/main/java/rearth/oritech/client/init/ModScreens.java index eeec08721..cf3648866 100644 --- a/src/main/java/rearth/oritech/client/init/ModScreens.java +++ b/src/main/java/rearth/oritech/client/init/ModScreens.java @@ -16,6 +16,7 @@ public class ModScreens implements AutoRegistryContainer> { public static final ExtendedScreenHandlerType FOUNDRY_SCREEN = new ExtendedScreenHandlerType<>(UpgradableMachineScreenHandler::new); public static final ExtendedScreenHandlerType CENTRIFUGE_SCREEN = new ExtendedScreenHandlerType<>(CentrifugeScreenHandler::new); public static final ExtendedScreenHandlerType ATOMIC_FORGE_SCREEN = new ExtendedScreenHandlerType<>(BasicMachineScreenHandler::new); + public static final ExtendedScreenHandlerType STORAGE_SCREEN = new ExtendedScreenHandlerType<>(UpgradableMachineScreenHandler::new); public static final ExtendedScreenHandlerType POWERED_FURNACE_SCREEN = new ExtendedScreenHandlerType<>(UpgradableMachineScreenHandler::new); public static final ExtendedScreenHandlerType TEST_GENERATOR_SCREEN = new ExtendedScreenHandlerType<>(UpgradableMachineScreenHandler::new); public static final ExtendedScreenHandlerType BASIC_GENERATOR_SCREEN = new ExtendedScreenHandlerType<>(UpgradableMachineScreenHandler::new); @@ -35,6 +36,7 @@ public static void assignScreens() { HandledScreens.register(TEST_GENERATOR_SCREEN, UpgradableMachineScreen::new); HandledScreens.register(BASIC_GENERATOR_SCREEN, UpgradableMachineScreen::new); HandledScreens.register(ATOMIC_FORGE_SCREEN, BasicMachineScreen::new); + HandledScreens.register(STORAGE_SCREEN, UpgradableMachineScreen::new); HandledScreens.register(INVENTORY_PROXY_SCREEN, InventoryProxyScreen::new); HandledScreens.register(ITEM_FILTER_SCREEN, ItemFilterScreen::new); HandledScreens.register(DESTROYER_SCREEN, UpgradableMachineScreen::new); diff --git a/src/main/java/rearth/oritech/client/ui/BasicMachineScreen.java b/src/main/java/rearth/oritech/client/ui/BasicMachineScreen.java index a08069b0f..aca4fe312 100644 --- a/src/main/java/rearth/oritech/client/ui/BasicMachineScreen.java +++ b/src/main/java/rearth/oritech/client/ui/BasicMachineScreen.java @@ -82,8 +82,13 @@ protected void build(FlowLayout rootComponent) { @Override protected void handledScreenTick() { super.handledScreenTick(); - updateEnergyBar(); - updateProgressBar(); + + if (handler.screenData.showEnergy()) + updateEnergyBar(); + + if (handler.screenData.showProgress()) + updateProgressBar(); + updateSettingsButtons(); if (handler.fluidProvider != null) @@ -184,8 +189,10 @@ public void fillOverlay(FlowLayout overlay) { updateEnergyBar(); } - addProgressArrow(overlay); - updateProgressBar(); + if (handler.screenData.showProgress()) { + addProgressArrow(overlay); + updateProgressBar(); + } } protected void updateFluidBar() { diff --git a/src/main/java/rearth/oritech/client/ui/UpgradableMachineScreen.java b/src/main/java/rearth/oritech/client/ui/UpgradableMachineScreen.java index cb77f37cc..468219c01 100644 --- a/src/main/java/rearth/oritech/client/ui/UpgradableMachineScreen.java +++ b/src/main/java/rearth/oritech/client/ui/UpgradableMachineScreen.java @@ -6,7 +6,6 @@ import io.wispforest.owo.ui.container.OverlayContainer; import io.wispforest.owo.ui.core.*; import net.minecraft.entity.player.PlayerInventory; -import net.minecraft.state.property.Properties; import net.minecraft.text.Text; import net.minecraft.util.Identifier; import net.minecraft.util.math.Vec3i; @@ -139,7 +138,7 @@ public void remove() { var addonBlock = handler.worldAccess.getBlockState(addonBlockPos); var addonBlockEntity = handler.worldAccess.getBlockEntity(addonBlockPos); - var relativePos = MultiblockMachineEntity.worldToRelativePos(handler.blockPos, addonBlockPos, handler.machineBlock.get(Properties.HORIZONTAL_FACING)); + var relativePos = MultiblockMachineEntity.worldToRelativePos(handler.blockPos, addonBlockPos, handler.machineBlock.get(handler.screenData.getBlockFacingProperty())); holoPreviewContainer.child( new BlockPreviewComponent(addonBlock, addonBlockEntity, relativePos, rotationSpeed) @@ -183,7 +182,7 @@ public void remove() { for (var openPos : handler.addonUiData.openSlots()) { - var relativePos = MultiblockMachineEntity.worldToRelativePos(handler.blockPos, openPos, handler.machineBlock.get(Properties.HORIZONTAL_FACING)); + var relativePos = MultiblockMachineEntity.worldToRelativePos(handler.blockPos, openPos, handler.machineBlock.get(handler.screenData.getBlockFacingProperty())); var dummyBlock = BlockContent.ADDON_INDICATOR_BLOCK.getDefaultState(); holoPreviewContainer.child( diff --git a/src/main/java/rearth/oritech/init/BlockContent.java b/src/main/java/rearth/oritech/init/BlockContent.java index a70e013d6..f4dd13036 100644 --- a/src/main/java/rearth/oritech/init/BlockContent.java +++ b/src/main/java/rearth/oritech/init/BlockContent.java @@ -20,6 +20,7 @@ import rearth.oritech.block.blocks.machines.generators.TestGeneratorBlock; import rearth.oritech.block.blocks.machines.interaction.*; import rearth.oritech.block.blocks.machines.processing.*; +import rearth.oritech.block.blocks.machines.storage.LargeStorageBlock; import rearth.oritech.block.blocks.machines.storage.SmallStorageBlock; import rearth.oritech.block.blocks.pipes.*; import rearth.oritech.util.item.OritechGeoItem; @@ -89,6 +90,7 @@ public class BlockContent implements BlockRegistryContainer { public static final Block LASER_ARM_BLOCK = new LaserArmBlock(FabricBlockSettings.copyOf(Blocks.IRON_BLOCK).nonOpaque()); public static final Block SMALL_STORAGE_BLOCK = new SmallStorageBlock(FabricBlockSettings.copyOf(Blocks.IRON_BLOCK).nonOpaque()); + public static final Block LARGE_STORAGE_BLOCK = new LargeStorageBlock(FabricBlockSettings.copyOf(Blocks.IRON_BLOCK).nonOpaque()); public static final Block PLACER_BLOCK = new PlacerBlock(FabricBlockSettings.copyOf(Blocks.IRON_BLOCK).nonOpaque()); public static final Block DESTROYER_BLOCK = new DestroyerBlock(FabricBlockSettings.copyOf(Blocks.IRON_BLOCK).nonOpaque()); diff --git a/src/main/java/rearth/oritech/init/BlockEntitiesContent.java b/src/main/java/rearth/oritech/init/BlockEntitiesContent.java index 34c49e4ff..34d86ab12 100644 --- a/src/main/java/rearth/oritech/init/BlockEntitiesContent.java +++ b/src/main/java/rearth/oritech/init/BlockEntitiesContent.java @@ -16,6 +16,7 @@ import rearth.oritech.block.entity.machines.generators.TestGeneratorEntity; import rearth.oritech.block.entity.machines.interaction.*; import rearth.oritech.block.entity.machines.processing.*; +import rearth.oritech.block.entity.machines.storage.LargeStorageBlockEntity; import rearth.oritech.block.entity.machines.storage.SmallStorageBlockEntity; import rearth.oritech.block.entity.pipes.EnergyPipeInterfaceEntity; import rearth.oritech.block.entity.pipes.FluidPipeInterfaceEntity; @@ -102,6 +103,8 @@ public class BlockEntitiesContent implements AutoRegistryContainer SMALL_STORAGE_ENTITY = FabricBlockEntityTypeBuilder.create(SmallStorageBlockEntity::new, BlockContent.SMALL_STORAGE_BLOCK).build(); + @AssignSidedEnergy + public static final BlockEntityType LARGE_STORAGE_ENTITY = FabricBlockEntityTypeBuilder.create(LargeStorageBlockEntity::new, BlockContent.LARGE_STORAGE_BLOCK).build(); @AssignSidedFluid public static final BlockEntityType FLUID_PIPE_ENTITY = FabricBlockEntityTypeBuilder.create(FluidPipeInterfaceEntity::new, BlockContent.FLUID_PIPE_CONNECTION).build(); diff --git a/src/main/java/rearth/oritech/init/datagen/ModelGenerator.java b/src/main/java/rearth/oritech/init/datagen/ModelGenerator.java index 0a51a0df6..75472def2 100644 --- a/src/main/java/rearth/oritech/init/datagen/ModelGenerator.java +++ b/src/main/java/rearth/oritech/init/datagen/ModelGenerator.java @@ -27,6 +27,7 @@ public void generateBlockStateModels(BlockStateModelGenerator blockStateModelGen blockStateModelGenerator.registerSimpleState(BlockContent.ITEM_PIPE_CONNECTION); blockStateModelGenerator.registerSimpleState(BlockContent.ITEM_FILTER_BLOCK); blockStateModelGenerator.registerSimpleState(BlockContent.SMALL_STORAGE_BLOCK); + blockStateModelGenerator.registerSimpleState(BlockContent.LARGE_STORAGE_BLOCK); blockStateModelGenerator.registerSimpleCubeAll(BlockContent.PLACER_BLOCK); blockStateModelGenerator.registerSimpleCubeAll(BlockContent.DESTROYER_BLOCK); diff --git a/src/main/java/rearth/oritech/network/NetworkContent.java b/src/main/java/rearth/oritech/network/NetworkContent.java index a559a148c..0db53d715 100644 --- a/src/main/java/rearth/oritech/network/NetworkContent.java +++ b/src/main/java/rearth/oritech/network/NetworkContent.java @@ -21,6 +21,7 @@ import rearth.oritech.init.recipes.OritechRecipeType; import rearth.oritech.util.FluidProvider; import rearth.oritech.util.InventoryInputMode; +import rearth.oritech.util.MachineAddonController; import rearth.oritech.util.ScreenProvider; import java.util.List; @@ -56,6 +57,9 @@ public record MachineFrameMovementPacket(BlockPos position, BlockPos currentTarg public record MachineFrameGuiPacket(BlockPos position, long currentEnergy, long maxEnergy, int progress) { } + // for use with addon providers to sync energy state + public record GenericEnergySyncPacket(BlockPos position, long currentEnergy, long maxEnergy) {} + public record ItemFilterSyncPacket(BlockPos position, ItemFilterBlockEntity.FilterData data) { } // this goes both ways @@ -125,6 +129,18 @@ public static void registerChannels() { })); + MACHINE_CHANNEL.registerClientbound(GenericEnergySyncPacket.class, ((message, access) -> { + + var entity = access.player().clientWorld.getBlockEntity(message.position); + + if (entity instanceof MachineAddonController addonController) { + var storage = addonController.getStorageForAddon(); + storage.capacity = message.maxEnergy; + storage.amount = message.currentEnergy; + } + + })); + MACHINE_CHANNEL.registerClientbound(SingleVariantFluidSyncPacket.class, ((message, access) -> { var entity = access.player().clientWorld.getBlockEntity(message.position); diff --git a/src/main/java/rearth/oritech/util/ScreenProvider.java b/src/main/java/rearth/oritech/util/ScreenProvider.java index 6625a6a5a..98cd2f168 100644 --- a/src/main/java/rearth/oritech/util/ScreenProvider.java +++ b/src/main/java/rearth/oritech/util/ScreenProvider.java @@ -2,13 +2,16 @@ import net.minecraft.inventory.Inventory; import net.minecraft.screen.ScreenHandlerType; +import net.minecraft.state.property.Properties; +import net.minecraft.state.property.Property; import net.minecraft.util.Identifier; +import net.minecraft.util.math.Direction; import rearth.oritech.Oritech; import java.util.List; public interface ScreenProvider { - + record GuiSlot (int index, int x, int y) {} record BarConfiguration(int x, int y, int width, int height) {} @@ -31,6 +34,14 @@ default boolean showEnergy() { ScreenHandlerType getScreenHandlerType(); default boolean inputOptionsEnabled() {return true;} + + default Property getBlockFacingProperty() { + return Properties.HORIZONTAL_FACING; + } + + default boolean showProgress() { + return true; + } default BarConfiguration getEnergyConfiguration() { return new BarConfiguration(7, 24, 15, 54); diff --git a/src/main/resources/assets/oritech/blockstates/large_storage_block.json b/src/main/resources/assets/oritech/blockstates/large_storage_block.json new file mode 100644 index 000000000..3e1f3374a --- /dev/null +++ b/src/main/resources/assets/oritech/blockstates/large_storage_block.json @@ -0,0 +1,42 @@ +{ + "variants": { + "machine_assembled=false,target_dir=south": { + "model": "oritech:block/large_storage_block_packaged", + "y": 180 + }, + "machine_assembled=false,target_dir=east": { + "model": "oritech:block/large_storage_block_packaged", + "y": 90 + }, + "machine_assembled=false,target_dir=north": { + "model": "oritech:block/large_storage_block_packaged" + }, + "machine_assembled=false,target_dir=west": { + "model": "oritech:block/large_storage_block_packaged", + "y": 270 + }, + "machine_assembled=true,target_dir=south": { + "model": "oritech:block/large_storage_block", + "y": 180 + }, + "machine_assembled=true,target_dir=east": { + "model": "oritech:block/large_storage_block", + "y": 90 + }, + "machine_assembled=true,target_dir=north": { + "model": "oritech:block/large_storage_block" + }, + "machine_assembled=true,target_dir=west": { + "model": "oritech:block/large_storage_block", + "y": 270 + }, + "target_dir=up": { + "model": "oritech:block/large_storage_block", + "x": -90 + }, + "target_dir=down": { + "model": "oritech:block/large_storage_block", + "x": 90 + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/oritech/models/block/large_storage_block.json b/src/main/resources/assets/oritech/models/block/large_storage_block.json new file mode 100644 index 000000000..659e6ba97 --- /dev/null +++ b/src/main/resources/assets/oritech/models/block/large_storage_block.json @@ -0,0 +1,188 @@ +{ + "credit": "Made with Blockbench", + "texture_size": [128, 128], + "textures": { + "1": "oritech:block/large_storage_block", + "particle": "oritech:block/machine_particle_texture" + }, + "elements": [ + { + "name": "sides", + "from": [0, 0, 0], + "to": [2, 32, 32], + "faces": { + "north": {"uv": [5.25, 11.5, 5.5, 15.5], "texture": "#1"}, + "east": {"uv": [0, 0, 4, 4], "texture": "#1"}, + "south": {"uv": [5.5, 11.5, 5.75, 15.5], "texture": "#1"}, + "west": {"uv": [0, 4, 4, 8], "texture": "#1"}, + "up": {"uv": [6, 15.5, 5.75, 11.5], "texture": "#1"}, + "down": {"uv": [6.25, 11.5, 6, 15.5], "texture": "#1"} + } + }, + { + "name": "sides", + "from": [14, 0, 0], + "to": [16, 32, 32], + "rotation": {"angle": 0, "axis": "y", "origin": [15, 16, 16]}, + "faces": { + "north": {"uv": [6.25, 11.5, 6.5, 15.5], "texture": "#1"}, + "east": {"uv": [4, 0, 8, 4], "texture": "#1"}, + "south": {"uv": [6.5, 11.5, 6.75, 15.5], "texture": "#1"}, + "west": {"uv": [4, 4, 8, 8], "texture": "#1"}, + "up": {"uv": [7, 15.5, 6.75, 11.5], "texture": "#1"}, + "down": {"uv": [7.25, 11.5, 7, 15.5], "texture": "#1"} + } + }, + { + "name": "inner", + "from": [2, 2, 2], + "to": [14, 30, 30], + "faces": { + "north": {"uv": [3.5, 8, 5, 11.5], "texture": "#1"}, + "east": {"uv": [0, 8, 3.5, 11.5], "texture": "#1"}, + "south": {"uv": [8, 3.5, 9.5, 7], "texture": "#1"}, + "west": {"uv": [8, 0, 11.5, 3.5], "texture": "#1"}, + "up": {"uv": [6.5, 11.5, 5, 8], "texture": "#1"}, + "down": {"uv": [8, 8, 6.5, 11.5], "texture": "#1"} + } + }, + { + "name": "edge", + "from": [2, 1, 1], + "to": [14, 3, 3], + "faces": { + "north": {"uv": [9.5, 6.5, 11, 6.75], "texture": "#1"}, + "east": {"uv": [7.25, 11.5, 7.5, 11.75], "texture": "#1"}, + "south": {"uv": [9.5, 6.75, 11, 7], "texture": "#1"}, + "west": {"uv": [7.5, 11.5, 7.75, 11.75], "texture": "#1"}, + "up": {"uv": [12.5, 6.75, 11, 6.5], "texture": "#1"}, + "down": {"uv": [12.5, 6.75, 11, 7], "texture": "#1"} + } + }, + { + "name": "edge", + "from": [2, 29, 1], + "to": [14, 31, 3], + "faces": { + "north": {"uv": [11.5, 1.5, 13, 1.75], "texture": "#1"}, + "east": {"uv": [7.75, 11.5, 8, 11.75], "texture": "#1"}, + "south": {"uv": [11.5, 1.75, 13, 2], "texture": "#1"}, + "west": {"uv": [11.75, 6, 12, 6.25], "texture": "#1"}, + "up": {"uv": [13, 2.25, 11.5, 2], "texture": "#1"}, + "down": {"uv": [13, 2.25, 11.5, 2.5], "texture": "#1"} + } + }, + { + "name": "edge", + "from": [2, 29, 29], + "to": [14, 31, 31], + "faces": { + "north": {"uv": [11.75, 5, 13.25, 5.25], "texture": "#1"}, + "east": {"uv": [7.5, 11.75, 7.75, 12], "texture": "#1"}, + "south": {"uv": [11.75, 5.25, 13.25, 5.5], "texture": "#1"}, + "west": {"uv": [7.75, 11.75, 8, 12], "texture": "#1"}, + "up": {"uv": [13.25, 5.75, 11.75, 5.5], "texture": "#1"}, + "down": {"uv": [13.25, 5.75, 11.75, 6], "texture": "#1"} + } + }, + { + "name": "edge", + "from": [2, 1, 29], + "to": [14, 3, 31], + "faces": { + "north": {"uv": [11.5, 2.5, 13, 2.75], "texture": "#1"}, + "east": {"uv": [11.75, 6.25, 12, 6.5], "texture": "#1"}, + "south": {"uv": [11.5, 2.75, 13, 3], "texture": "#1"}, + "west": {"uv": [7.25, 11.75, 7.5, 12], "texture": "#1"}, + "up": {"uv": [13, 3.25, 11.5, 3], "texture": "#1"}, + "down": {"uv": [13, 3.25, 11.5, 3.5], "texture": "#1"} + } + }, + { + "name": "cable", + "from": [5, 5, 0], + "to": [11, 11, 32], + "faces": { + "north": {"uv": [9.5, 5, 10.25, 5.75], "texture": "#1"}, + "east": {"uv": [8, 7, 12, 7.75], "texture": "#1"}, + "south": {"uv": [9.5, 5.75, 10.25, 6.5], "texture": "#1"}, + "west": {"uv": [8, 7.75, 12, 8.5], "texture": "#1"}, + "up": {"uv": [8.75, 12.5, 8, 8.5], "texture": "#1"}, + "down": {"uv": [9.5, 8.5, 8.75, 12.5], "texture": "#1"} + } + }, + { + "name": "cable", + "from": [5, 21, 0], + "to": [11, 27, 32], + "faces": { + "north": {"uv": [10.25, 5, 11, 5.75], "texture": "#1"}, + "east": {"uv": [9.5, 3.5, 13.5, 4.25], "texture": "#1"}, + "south": {"uv": [10.25, 5.75, 11, 6.5], "texture": "#1"}, + "west": {"uv": [9.5, 4.25, 13.5, 5], "texture": "#1"}, + "up": {"uv": [10.25, 12.5, 9.5, 8.5], "texture": "#1"}, + "down": {"uv": [11, 8.5, 10.25, 12.5], "texture": "#1"} + } + }, + { + "name": "cable", + "from": [5, 0, 5], + "to": [11, 32, 11], + "rotation": {"angle": 0, "axis": "y", "origin": [8, 24, 16]}, + "faces": { + "north": {"uv": [11, 8.5, 11.75, 12.5], "texture": "#1"}, + "east": {"uv": [0, 11.5, 0.75, 15.5], "texture": "#1"}, + "south": {"uv": [0.75, 11.5, 1.5, 15.5], "texture": "#1"}, + "west": {"uv": [1.5, 11.5, 2.25, 15.5], "texture": "#1"}, + "up": {"uv": [11.75, 5.75, 11, 5], "texture": "#1"}, + "down": {"uv": [11.75, 5.75, 11, 6.5], "texture": "#1"} + } + }, + { + "name": "cable", + "from": [5, 0, 21], + "to": [11, 32, 27], + "rotation": {"angle": 0, "axis": "y", "origin": [8, 24, 16]}, + "faces": { + "north": {"uv": [2.25, 11.5, 3, 15.5], "texture": "#1"}, + "east": {"uv": [3, 11.5, 3.75, 15.5], "texture": "#1"}, + "south": {"uv": [3.75, 11.5, 4.5, 15.5], "texture": "#1"}, + "west": {"uv": [4.5, 11.5, 5.25, 15.5], "texture": "#1"}, + "up": {"uv": [12.25, 0.75, 11.5, 0], "texture": "#1"}, + "down": {"uv": [12.25, 0.75, 11.5, 1.5], "texture": "#1"} + } + } + ], + "display": { + "thirdperson_righthand": { + "rotation": [75, 45, 0], + "translation": [0, 2.5, 0], + "scale": [0.375, 0.375, 0.375] + }, + "thirdperson_lefthand": { + "rotation": [75, 45, 0], + "translation": [0, 2.5, 0], + "scale": [0.375, 0.375, 0.375] + }, + "firstperson_righthand": { + "rotation": [0, 45, 0], + "scale": [0.4, 0.4, 0.4] + }, + "firstperson_lefthand": { + "rotation": [0, 225, 0], + "scale": [0.23, 0.25, 0.19] + }, + "ground": { + "scale": [0.25, 0.25, 0.25] + }, + "gui": { + "rotation": [30, 225, 0], + "translation": [2, -3.75, 0], + "scale": [0.4, 0.35, 0.4] + }, + "fixed": { + "translation": [0, -3.5, 0], + "scale": [0.5, 0.5, 0.5] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/oritech/models/block/large_storage_block_packaged.json b/src/main/resources/assets/oritech/models/block/large_storage_block_packaged.json new file mode 100644 index 000000000..05611b652 --- /dev/null +++ b/src/main/resources/assets/oritech/models/block/large_storage_block_packaged.json @@ -0,0 +1,54 @@ +{ + "credit": "Made with Blockbench", + "texture_size": [64, 64], + "textures": { + "1": "oritech:block/large_storage_block_packaged", + "particle": "oritech:block/machine_particle_texture" + }, + "elements": [ + { + "from": [0, 0, 0], + "to": [16, 16, 16], + "rotation": {"angle": 0, "axis": "y", "origin": [8, 8, 8]}, + "faces": { + "north": {"uv": [4, 4, 8, 8], "texture": "#1"}, + "east": {"uv": [0, 0, 4, 4], "texture": "#1"}, + "south": {"uv": [0, 4, 4, 8], "texture": "#1"}, + "west": {"uv": [4, 0, 8, 4], "texture": "#1"}, + "up": {"uv": [4, 12, 0, 8], "rotation": 90, "texture": "#1"}, + "down": {"uv": [12, 0, 8, 4], "rotation": 270, "texture": "#1"} + } + } + ], + "display": { + "thirdperson_righthand": { + "rotation": [75, 45, 0], + "translation": [0, 2.5, 0], + "scale": [0.375, 0.375, 0.375] + }, + "thirdperson_lefthand": { + "rotation": [75, 45, 0], + "translation": [0, 2.5, 0], + "scale": [0.375, 0.375, 0.375] + }, + "firstperson_righthand": { + "rotation": [0, 45, 0], + "scale": [0.4, 0.4, 0.4] + }, + "firstperson_lefthand": { + "rotation": [0, 225, 0], + "scale": [0.4, 0.4, 0.4] + }, + "ground": { + "translation": [0, 3, 0], + "scale": [0.25, 0.25, 0.25] + }, + "gui": { + "rotation": [30, 225, 0], + "scale": [0.625, 0.625, 0.625] + }, + "fixed": { + "scale": [0.5, 0.5, 0.5] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/oritech/models/block/small_storage_block.json b/src/main/resources/assets/oritech/models/block/small_storage_block.json index 07302124c..739cc1c4b 100644 --- a/src/main/resources/assets/oritech/models/block/small_storage_block.json +++ b/src/main/resources/assets/oritech/models/block/small_storage_block.json @@ -126,5 +126,35 @@ } } ], - "display": {} + "display": { + "thirdperson_righthand": { + "rotation": [75, 45, 0], + "translation": [0, 2.5, 0], + "scale": [0.375, 0.375, 0.375] + }, + "thirdperson_lefthand": { + "rotation": [75, 45, 0], + "translation": [0, 2.5, 0], + "scale": [0.375, 0.375, 0.375] + }, + "firstperson_righthand": { + "rotation": [0, 45, 0], + "scale": [0.4, 0.4, 0.4] + }, + "firstperson_lefthand": { + "rotation": [0, 225, 0], + "scale": [0.4, 0.4, 0.4] + }, + "ground": { + "translation": [0, 3, 0], + "scale": [0.25, 0.25, 0.25] + }, + "gui": { + "rotation": [30, 225, 0], + "scale": [0.625, 0.625, 0.625] + }, + "fixed": { + "scale": [0.5, 0.5, 0.5] + } + } } \ No newline at end of file diff --git a/src/main/resources/assets/oritech/textures/block/large_storage_block.png b/src/main/resources/assets/oritech/textures/block/large_storage_block.png new file mode 100644 index 0000000000000000000000000000000000000000..b39c5d75a88dc2352c7b58e61b184f3f341ea798 GIT binary patch literal 3671 zcmZu!c{CK>+rKkp&6e$J$<|krH7Z-oWJ%&{$u10%B}O5#51~l*eVx8Uc1e~jW6LsG zGnUB`iG;GuXv{Epr{DX}`@ZMB=iKd_d!F-op8L6<=ehBw#`G*8Wt@{a&_s*!X z&G&s^!d}0vt=O$R*>)}{{waMr>wWpCl^18oI>lLr(J$v$GlDKXPWwx7CS?5fuBnG7 zPSh~8YXa%D-U7GWO3r;8@ykeKn;P<1gGhO;v3+gq8gAk77xWm>XtYdDV+#sDF;(!W zs4b7ObkL?P`v>~jHu?1uct|4~P1Biz(+$yVyeN9`LGTHP{8Y;WmR7!R``LGJMFHTQ zd(0FE4ehsTad~92r=%Dzpie-@%xe{2wieJ?UgmF)u#K~`_JLX0-YD@F^igC7WK00v za!nVW?Ko(+*1r}%BQXw}WYvu#lrgcNi?8^4r{N+`#u@}XolC!PIvEPi7Yl#PmjF(t zuqR(huO|JNNQs+7l9yHX4oTnRm(JU5KUPjJCW$XB?MIY>n+xxwzqf|`d!=Q4Bb*Zo zPF6&3oGBbwUXD+Do1(4AwMOPR3%{#;@}Zg%qj2~#38q(KVwb;L@4LHR+SnQ4qSk_u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