Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change Neutronium Compressor Ingredient Size View #42

Merged
merged 2 commits into from
Oct 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dependencies.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Add your dependencies here

dependencies {
devOnlyNonPublishable("com.github.GTNewHorizons:NotEnoughItems:2.6.14-GTNH:dev")
devOnlyNonPublishable("com.github.GTNewHorizons:NotEnoughItems:2.6.38-GTNH:dev")

compileOnly("com.github.GTNewHorizons:ForestryMC:4.9.7:api") {
transitive = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,40 +34,40 @@ public CompressionHandler() {

public class CachedCompression extends CachedRecipe {

private PositionedStack ingred;
private PositionedStack result;
private int cost;

public CachedCompression(CompressorRecipe recipe) {
this.ingred = new PositionedStack(recipe.getIngredient(), 51, 16);
this.result = new PositionedStack(recipe.getOutput(), 111, 16);
this.cost = recipe.getCost();
this(recipe.getOutput(), recipe.getCost(), recipe.getIngredient());
}

public CachedCompression(ItemStack output, int price, ItemStack ingredient) {
public CachedCompression(ItemStack output, int price, Object ingredient) {
this.ingred = new PositionedStack(ingredient, 51, 16);
this.result = new PositionedStack(output, 111, 16);
cost = price;
this.cost = price;
}

@Override
public List<PositionedStack> getIngredients() {
return getCycledIngredients(cycleticks / 48, Arrays.asList(ingred));
return getCycledIngredients(cycleticks / 48, Arrays.asList(this.ingred));
}

@Override
public PositionedStack getResult() {
return result;
return this.result;
}

public void computeVisuals() {
ingred.generatePermutations();
for (ItemStack item : this.ingred.items) item.stackSize = this.cost;
this.ingred.item.stackSize = this.cost;
this.ingred.generatePermutations();
}

public int getCost() {
return cost;
}

private int cost;

PositionedStack ingred;
PositionedStack result;
}

@Override
Expand Down Expand Up @@ -111,16 +111,19 @@ public void loadCraftingRecipes(ItemStack result) {

@Override
public void loadUsageRecipes(String inputId, Object... ingredients) {
if (inputId.equals("extreme_compression") && getClass() == CompressionHandler.class)
if (inputId.equals("extreme_compression") && getClass() == CompressionHandler.class) {
loadCraftingRecipes("extreme_compression");
else super.loadUsageRecipes(inputId, ingredients);
} else {
super.loadUsageRecipes(inputId, ingredients);
}
}

@Override
public void loadUsageRecipes(ItemStack ingredient) {
for (CompressorRecipe recipe : CompressorManager.getRecipes()) {
if (safeOre(recipe) && recipe.validInput(ingredient)) {
CachedCompression r = new CachedCompression(recipe.getOutput(), recipe.getCost(), ingredient);
r.computeVisuals();
arecipes.add(r);
}
}
Expand All @@ -136,12 +139,6 @@ public String getGuiTexture() {
return "avaritia:textures/gui/compressor.png";
}

@Override
public void drawForeground(int recipe) {
super.drawForeground(recipe);
fontRender.drawString(((CachedCompression) arecipes.get(recipe)).getCost() + "", 50, 38, 4210752);
}

@Override
public void drawExtras(int recipe) {
drawProgressBar(74, 15, 176, 14, 24, 16, 48, 0);
Expand Down