- End Stone Smelter REI fuel display
- End Furnaces REI fuel and smelting displays
This commit is contained in:
parent
2fabb39f41
commit
f29d69c69b
8 changed files with 205 additions and 34 deletions
|
@ -1,5 +1,6 @@
|
|||
package ru.betterend.integration.rei;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
@ -8,14 +9,19 @@ import com.google.common.collect.Lists;
|
|||
import me.shedaniel.rei.api.EntryStack;
|
||||
import me.shedaniel.rei.api.RecipeHelper;
|
||||
import me.shedaniel.rei.api.plugins.REIPluginV0;
|
||||
import me.shedaniel.rei.plugin.DefaultPlugin;
|
||||
import me.shedaniel.rei.plugin.fuel.DefaultFuelDisplay;
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
import net.fabricmc.fabric.impl.content.registry.FuelRegistryImpl;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.item.BlockItem;
|
||||
import net.minecraft.recipe.BlastingRecipe;
|
||||
import net.minecraft.util.Identifier;
|
||||
import ru.betterend.BetterEnd;
|
||||
import ru.betterend.blocks.basis.EndAnvilBlock;
|
||||
import ru.betterend.blocks.basis.EndFurnaceBlock;
|
||||
import ru.betterend.blocks.entities.EndStoneSmelterBlockEntity;
|
||||
import ru.betterend.recipe.builders.AlloyingRecipe;
|
||||
import ru.betterend.recipe.builders.AnvilRecipe;
|
||||
import ru.betterend.recipe.builders.InfusionRecipe;
|
||||
|
@ -26,14 +32,16 @@ import ru.betterend.registry.EndItems;
|
|||
public class REIPlugin implements REIPluginV0 {
|
||||
|
||||
public final static Identifier PLUGIN_ID = BetterEnd.makeID("rei_plugin");
|
||||
public final static Identifier ALLOYING_FUEL = BetterEnd.makeID("alloying_fuel");
|
||||
public final static Identifier ALLOYING = AlloyingRecipe.ID;
|
||||
public final static Identifier SMITHING = AnvilRecipe.ID;
|
||||
public final static Identifier INFUSION = InfusionRecipe.ID;
|
||||
|
||||
|
||||
public final static EntryStack END_STONE_SMELTER = EntryStack.create(EndBlocks.END_STONE_SMELTER);
|
||||
public final static EntryStack INFUSION_RITUAL = EntryStack.create(EndBlocks.INFUSION_PEDESTAL);
|
||||
public final static List<EntryStack> ANVILS;
|
||||
|
||||
public final static EntryStack[] FURNACES;
|
||||
public final static EntryStack[] ANVILS;
|
||||
|
||||
@Override
|
||||
public Identifier getPluginIdentifier() {
|
||||
return PLUGIN_ID;
|
||||
|
@ -45,26 +53,43 @@ public class REIPlugin implements REIPluginV0 {
|
|||
recipeHelper.registerRecipes(ALLOYING, BlastingRecipe.class, REIAlloyingDisplay::new);
|
||||
recipeHelper.registerRecipes(SMITHING, AnvilRecipe.class, REIAnvilDisplay::new);
|
||||
recipeHelper.registerRecipes(INFUSION, InfusionRecipe.class, REIInfusionDisplay::new);
|
||||
FuelRegistryImpl.INSTANCE.getFuelTimes().forEach((item, time) -> {
|
||||
if (time >= 2000) {
|
||||
System.out.println(item);
|
||||
recipeHelper.registerDisplay(new REIAlloyingFuelDisplay(EntryStack.create(item), time));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerOthers(RecipeHelper recipeHelper) {
|
||||
recipeHelper.registerWorkingStations(ALLOYING_FUEL, END_STONE_SMELTER);
|
||||
recipeHelper.registerWorkingStations(ALLOYING, END_STONE_SMELTER);
|
||||
recipeHelper.registerWorkingStations(INFUSION, INFUSION_RITUAL);
|
||||
recipeHelper.registerWorkingStations(SMITHING, ANVILS.toArray(new EntryStack[]{}));
|
||||
recipeHelper.registerWorkingStations(SMITHING, ANVILS);
|
||||
recipeHelper.removeAutoCraftButton(ALLOYING_FUEL);
|
||||
recipeHelper.removeAutoCraftButton(SMITHING);
|
||||
|
||||
recipeHelper.registerWorkingStations(DefaultPlugin.SMELTING, FURNACES);
|
||||
recipeHelper.registerWorkingStations(DefaultPlugin.FUEL, FURNACES);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerPluginCategories(RecipeHelper recipeHelper) {
|
||||
recipeHelper.registerCategories(new REIAlloyingCategory(),
|
||||
new REIInfusionCategory(),
|
||||
new REIAnvilCategory());
|
||||
recipeHelper.registerCategories(
|
||||
new REIAlloyingFuelCategory(),
|
||||
new REIAlloyingCategory(),
|
||||
new REIInfusionCategory(),
|
||||
new REIAnvilCategory());
|
||||
}
|
||||
|
||||
static {
|
||||
ANVILS = Lists.newArrayList(EntryStack.ofItems(EndItems.getModBlocks().stream()
|
||||
List<EntryStack> anvils = Lists.newArrayList(EntryStack.ofItems(EndItems.getModBlocks().stream()
|
||||
.filter(item -> ((BlockItem) item).getBlock() instanceof EndAnvilBlock).collect(Collectors.toList())));
|
||||
ANVILS.add(0, EntryStack.create(Blocks.ANVIL));
|
||||
anvils.add(0, EntryStack.create(Blocks.ANVIL));
|
||||
ANVILS = anvils.toArray(new EntryStack[0]);
|
||||
FURNACES = Lists.newArrayList(EntryStack.ofItems(EndItems.getModBlocks().stream()
|
||||
.filter(item -> ((BlockItem) item).getBlock() instanceof EndFurnaceBlock).collect(Collectors.toList())))
|
||||
.toArray(new EntryStack[0]);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue