From bd86c4f77b6e7f023e9282a8d6b2dfd14d6a863d Mon Sep 17 00:00:00 2001 From: wolfieboy09 <105564186+wolfieboy09@users.noreply.github.com> Date: Wed, 6 Nov 2024 13:19:59 -0500 Subject: [PATCH] fix small bug --- .../DiskAssemblerBlockEntity.java | 30 ++++--------------- 1 file changed, 5 insertions(+), 25 deletions(-) diff --git a/src/main/java/dev/wolfieboy09/qstorage/block/disk_assembler/DiskAssemblerBlockEntity.java b/src/main/java/dev/wolfieboy09/qstorage/block/disk_assembler/DiskAssemblerBlockEntity.java index 34119a5..d6ee3e5 100644 --- a/src/main/java/dev/wolfieboy09/qstorage/block/disk_assembler/DiskAssemblerBlockEntity.java +++ b/src/main/java/dev/wolfieboy09/qstorage/block/disk_assembler/DiskAssemblerBlockEntity.java @@ -38,7 +38,7 @@ public class DiskAssemblerBlockEntity extends AbstractEnergyBlockEntity implemen private boolean isValidRecipe = false; public DiskAssemblerBlockEntity(BlockPos pos, BlockState blockState) { - super(QSBlockEntities.DISK_ASSEMBLER.get(), pos, blockState, getEnergyCapacity(), 1000, 0); + super(QSBlockEntities.DISK_ASSEMBLER.get(), pos, blockState, 20000, 1000, 0); } @Override @@ -76,13 +76,13 @@ public void tick() { if (this.crafting_ticks < timeRequired) { this.crafting_ticks++; this.progress = getProgress(); - QuantiumizedStorage.LOGGER.debug("Progress: {}", this.progress); + this.energyStorage.removeEnergy(this.recipe.energyCost() / 100); } // If progress reaches 100%, complete the crafting if (this.progress >= 100) { // Consume energy and input items - this.energyStorage.removeEnergy(this.recipe.energyCost()); // Extract energy here upon successful crafting + // this.energyStorage.removeEnergy(this.recipe.energyCost()); // Extract energy here upon successful crafting consumeInputItems(); // Place result in output slot @@ -130,7 +130,7 @@ private boolean checkRecipe(){ QSRecipes.DISK_ASSEMBLER_TYPE.get(), input, this.level - ).orElseGet(()->null); + ).orElse(null); if (recipeFound == null) return false; DiskAssemblerRecipe recipe = recipeFound.value(); boolean matches = recipe.matches(input, this.level); @@ -179,11 +179,7 @@ public boolean canExtract() { @Override public boolean canReceive() { - return true; - } - - public static int getEnergyCapacity() { - return 20000; + return this.energyStorage.canReceive(); } public EnergyStorage getEnergyHandler(@Nullable Direction side) { @@ -197,22 +193,6 @@ public ItemStackHandler getInventoryHandler() { } - // Crafting land - public void craftDisk() { - if (level == null) return; - ItemStack stack = inventory.getStackInSlot(0); - - } - - private boolean isCrafting() { - return this.crafting_ticks > 0; - } - - private void resetCrafting() { - crafting_ticks = 0; - energy_required = 0; - } - public SimpleContainer getInputContainer() { SimpleContainer container = new SimpleContainer(7); for (int i = 0; i < 7; i++) {