Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Nxer committed Nov 5, 2023
1 parent d51c2a4 commit f5993c0
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
import net.minecraft.util.StatCollector;
import net.minecraftforge.common.util.ForgeDirection;

import org.jetbrains.annotations.NotNull;

import com.gtnewhorizon.structurelib.alignment.constructable.IConstructable;
import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable;
import com.gtnewhorizon.structurelib.structure.IItemSource;
Expand All @@ -48,6 +50,7 @@
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.logic.ProcessingLogic;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_ExtendedPowerMultiBlockBase;
import gregtech.api.recipe.check.CheckRecipeResult;
import gregtech.api.render.TextureFactory;
import gregtech.api.util.GT_HatchElementBuilder;
import gregtech.api.util.GT_Multiblock_Tooltip_Builder;
Expand Down Expand Up @@ -75,8 +78,15 @@ public GT_TileEntity_MagneticDomainConstructor(String aName) {

@Override
protected ProcessingLogic createProcessingLogic() {
return new ProcessingLogic().setMaxParallelSupplier(this::getMaxParallelRecipes)
.setSpeedBonus(this.getSpeedBonus());
return new ProcessingLogic() {

@NotNull
@Override
public CheckRecipeResult process() {
setSpeedBonus(getSpeedBonus());
return super.process();
}
}.setMaxParallelSupplier(this::getMaxParallelRecipes);
}

public int getMaxParallelRecipes() {
Expand Down Expand Up @@ -142,7 +152,7 @@ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack a
// region Structure
@Override
public void construct(ItemStack stackSize, boolean hintsOnly) {
int ring = stackSize.stackSize;
int ExtraRing = stackSize.stackSize - 1;
this.buildPiece(
STRUCTURE_PIECE_MAIN,
stackSize,
Expand All @@ -151,8 +161,8 @@ public void construct(ItemStack stackSize, boolean hintsOnly) {
baseVerticalOffSet,
baseDepthOffSet);

if (ring > 1) {
for (int pointer = 1; pointer < ring; pointer++) {
if (ExtraRing > 0) {
for (int pointer = 1; pointer < ExtraRing; pointer++) {
this.buildPiece(
STRUCTURE_PIECE_MIDDLE,
stackSize,
Expand All @@ -169,7 +179,7 @@ public void construct(ItemStack stackSize, boolean hintsOnly) {
hintsOnly,
baseHorizontalOffSet,
baseVerticalOffSet,
baseDepthOffSet - ring * 4);
baseDepthOffSet - ExtraRing * 4);

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
import net.minecraft.util.EnumChatFormatting;
import net.minecraftforge.common.util.ForgeDirection;

import org.jetbrains.annotations.NotNull;

import com.gtnewhorizon.structurelib.alignment.constructable.IConstructable;
import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable;
import com.gtnewhorizon.structurelib.structure.IItemSource;
Expand All @@ -42,6 +44,7 @@
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.logic.ProcessingLogic;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_ExtendedPowerMultiBlockBase;
import gregtech.api.recipe.check.CheckRecipeResult;
import gregtech.api.render.TextureFactory;
import gregtech.api.util.GTPP_Recipe;
import gregtech.api.util.GT_HatchElementBuilder;
Expand All @@ -68,8 +71,15 @@ public GT_TileEntity_MagneticMixer(String aName) {
// region Processing Logic
@Override
protected ProcessingLogic createProcessingLogic() {
return new ProcessingLogic().setMaxParallelSupplier(this::getMaxParallelRecipes)
.setSpeedBonus(this.getSpeedBonus());
return new ProcessingLogic() {

@NotNull
@Override
public CheckRecipeResult process() {
setSpeedBonus(getSpeedBonus());
return super.process();
}
}.setMaxParallelSupplier(this::getMaxParallelRecipes);
}

public int getMaxParallelRecipes() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,21 @@ public GT_TileEntity_PhysicalFormSwitcher(String aName) {
protected ProcessingLogic createProcessingLogic() {
return new ProcessingLogic() {

@NotNull
@Override
public CheckRecipeResult process() {
setSpeedBonus(getSpeedBonus());
return super.process();
}

@Override
protected @NotNull CheckRecipeResult validateRecipe(@NotNull GT_Recipe recipe) {
if (glassTier < 12 && glassTier < GT_Utility.getTier(recipe.mEUt)) {
return CheckRecipeResultRegistry.insufficientMachineTier(GT_Utility.getTier(recipe.mEUt));
}
return CheckRecipeResultRegistry.SUCCESSFUL;
}
}.setMaxParallelSupplier(this::getMaxParallelRecipes)
.setSpeedBonus(this.getSpeedBonus());
}.setMaxParallelSupplier(this::getMaxParallelRecipes);
}

public int getMaxParallelRecipes() {
Expand Down

0 comments on commit f5993c0

Please sign in to comment.