Skip to content

Commit

Permalink
Add recipe for ME Source Jar
Browse files Browse the repository at this point in the history
  • Loading branch information
62832 committed Jun 16, 2024
1 parent a5022e6 commit 20f1117
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
package gripe._90.arseng.data;

import java.nio.file.Path;

import com.hollingsworth.arsnouveau.common.datagen.ApparatusRecipeProvider;
import com.hollingsworth.arsnouveau.setup.registry.BlockRegistry;
import com.hollingsworth.arsnouveau.setup.registry.ItemsRegistry;

import net.minecraft.data.CachedOutput;
import net.minecraft.data.DataGenerator;
import net.minecraft.world.item.Items;
import net.minecraft.world.item.crafting.Ingredient;

import appeng.core.definitions.AEBlocks;
import appeng.core.definitions.AEItems;
import appeng.datagen.providers.tags.ConventionTags;

import gripe._90.arseng.definition.ArsEngBlocks;
import gripe._90.arseng.definition.ArsEngItems;
Expand All @@ -36,7 +36,12 @@ public void addEntries() {
.withPedestalItem(4, BlockRegistry.SOURCE_GEM_BLOCK)
.withPedestalItem(4, Items.GOLD_BLOCK)
.withSourceCost(10000)
.withId(ArsEngBlocks.SOURCE_ACCEPTOR.id())
.build());
addRecipe(builder()
.withResult(ArsEngBlocks.ME_SOURCE_JAR)
.withReagent(BlockRegistry.SOURCE_JAR)
.withPedestalItem(ItemsRegistry.MANIPULATION_ESSENCE)
.withPedestalItem(Ingredient.of(ConventionTags.INTERFACE))
.build());
}

Expand All @@ -48,14 +53,10 @@ public void collectJsons(CachedOutput pOutput) {
saveStable(
pOutput,
recipe.asRecipe(),
getRecipePath(output, recipe.getId().getPath()));
output.resolve("data/arseng/recipes/" + recipe.getId().getPath() + ".json"));
}
}

protected static Path getRecipePath(Path pathIn, String str) {
return pathIn.resolve("data/arseng/recipes/" + str + ".json");
}

@Override
public String getName() {
return "Apparatus Recipes";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ public int getMaxSource() {
}

var oldSource = super.getSource();
var oldSourceCap = super.getMaxSource();
var sourceCap = 0L;

if (getMainNode().isActive()) {
Expand All @@ -106,7 +105,7 @@ public int getMaxSource() {
super.setSource(0);
}

if (oldSource != super.getSource() || oldSourceCap != sourceCap) {
if (oldSource != super.getSource()) {
setChanged();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ public void render(
@NotNull MultiBufferSource buffers,
int light,
int overlay) {
var vertexConsumer = buffers.getBuffer(RenderType.translucentMovingBlock());
var amount = (float) jar.getSource() / jar.getMaxSource();

if (amount <= 0) {
return;
}

var vertexConsumer = buffers.getBuffer(RenderType.translucentMovingBlock());
var fill = Mth.lerp(Mth.clamp(amount, 0, 1), 2 / 16F, 12 / 16F);

var builder = new CubeBuilder();
Expand Down

0 comments on commit 20f1117

Please sign in to comment.