Skip to content

Commit

Permalink
fix small bug
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfieboy09 committed Nov 6, 2024
1 parent f1535b1 commit bd86c4f
Showing 1 changed file with 5 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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) {
Expand All @@ -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++) {
Expand Down

0 comments on commit bd86c4f

Please sign in to comment.