chore: format code

This commit is contained in:
LordMZTE 2023-12-05 22:21:40 +01:00
parent 8f3727477a
commit 7741ec8df8
Signed by: LordMZTE
GPG key ID: B64802DC33A64FF6
7 changed files with 302 additions and 265 deletions

View file

@ -1,6 +1,5 @@
package net.anvilcraft.ntx4core;
import java.nio.file.Path;
import net.minecraftforge.forgespi.locating.IModFile;

View file

@ -90,9 +90,11 @@ public class Ntx4Core {
}
}
public void registerRecipeSerializers(RegistryEvent.Register<RecipeSerializer<?>> event) {
public void
registerRecipeSerializers(RegistryEvent.Register<RecipeSerializer<?>> event) {
event.getRegistry().registerAll(
new SpecialRecipeSerializer<>(OrbDuplicationRecipe::new).setRegistryName("orb_duplication")
new SpecialRecipeSerializer<>(OrbDuplicationRecipe::new)
.setRegistryName("orb_duplication")
);
}
}

View file

@ -57,11 +57,11 @@ public class InputReplacements implements IEventBusRegisterable {
)
);
var philosopherStoneMapper = new InputReplaceRecipeMapper()
var philosopherStoneMapper
= new InputReplaceRecipeMapper()
.replace("#forge:gems/diamond", "ae2:singularity")
.replace("#forge:dusts/redstone", "chemlib:erbium_dust")
.replace("#forge:dusts/glowstone", "psi:ivory_substance")
;
.replace("#forge:dusts/glowstone", "psi:ivory_substance");
ev.mapRecipeID(
new Identifier("projecte", "philosophers_stone"), philosopherStoneMapper
);

View file

@ -15,14 +15,17 @@ import net.minecraft.util.Identifier;
import net.minecraft.util.collection.DefaultedList;
import net.minecraft.world.World;
public class OrbDuplicationRecipe extends SpecialCraftingRecipe implements IShapedRecipe<CraftingInventory>
{
public class OrbDuplicationRecipe
extends SpecialCraftingRecipe implements IShapedRecipe<CraftingInventory> {
@ObjectHolder("ntx4core:orb_duplication")
public static SpecialRecipeSerializer<OrbDuplicationRecipe> SERIALIZER;
private Item flux = ForgeRegistries.ITEMS.getValue(new Identifier("fluxnetworks", "flux_dust"));
private Item nitro = ForgeRegistries.ITEMS.getValue(new Identifier("powah", "crystal_nitro"));
private Item orb = ForgeRegistries.ITEMS.getValue(new Identifier("enderrift", "rift_orb"));
private Item flux
= ForgeRegistries.ITEMS.getValue(new Identifier("fluxnetworks", "flux_dust"));
private Item nitro
= ForgeRegistries.ITEMS.getValue(new Identifier("powah", "crystal_nitro"));
private Item orb
= ForgeRegistries.ITEMS.getValue(new Identifier("enderrift", "rift_orb"));
private DefaultedList<Ingredient> ingredients = DefaultedList.copyOf(
Ingredient.EMPTY,
Ingredient.ofItems(this.flux),
@ -37,20 +40,17 @@ public class OrbDuplicationRecipe extends SpecialCraftingRecipe implements IShap
);
private ItemStack output = new ItemStack(this.orb, 2);
public OrbDuplicationRecipe(Identifier recipeId)
{
public OrbDuplicationRecipe(Identifier recipeId) {
super(recipeId);
}
@Override
public DefaultedList<Ingredient> getIngredients()
{
public DefaultedList<Ingredient> getIngredients() {
return ingredients;
}
@Override
public boolean matches(CraftingInventory crafting, World worldIn)
{
public boolean matches(CraftingInventory crafting, World worldIn) {
if (crafting.size() < 9)
return false;
@ -92,53 +92,45 @@ public class OrbDuplicationRecipe extends SpecialCraftingRecipe implements IShap
return true;
}
private boolean slotHasItem(CraftingInventory crafting, int slot, Item item)
{
private boolean slotHasItem(CraftingInventory crafting, int slot, Item item) {
ItemStack stack = crafting.getStack(slot);
return stack.getItem() == item;
}
@Override
public ItemStack craft(CraftingInventory crafting)
{
public ItemStack craft(CraftingInventory crafting) {
ItemStack stack = crafting.getStack(4).copy();
stack.setCount(2);
return stack;
}
@Override
public boolean fits(int width, int height)
{
public boolean fits(int width, int height) {
return (width == 3) && (height == 3);
}
@Override
public ItemStack getOutput()
{
public ItemStack getOutput() {
return output;
}
@Override
public DefaultedList<ItemStack> getRemainder(CraftingInventory inv)
{
public DefaultedList<ItemStack> getRemainder(CraftingInventory inv) {
return DefaultedList.ofSize(inv.size(), ItemStack.EMPTY);
}
@Override
public RecipeSerializer<?> getSerializer()
{
public RecipeSerializer<?> getSerializer() {
return SERIALIZER;
}
@Override
public int getRecipeWidth()
{
public int getRecipeWidth() {
return 3;
}
@Override
public int getRecipeHeight()
{
public int getRecipeHeight() {
return 3;
}
}

View file

@ -21,10 +21,12 @@ public class RecipeRemovals implements IEventBusRegisterable {
));
ev.removeRecipesMatching((r) -> {
var id = r.getId();
return id.getNamespace().equals("createappliedkinetics") && id.getPath().startsWith("inscriber");
return id.getNamespace().equals("createappliedkinetics")
&& id.getPath().startsWith("inscriber");
});
ev.removeRecipeID(new Identifier("projecte", "red_matter_alt"));
ev.removeRecipeID(new Identifier("draconicevolution", "components/awakened_core"));
ev.removeRecipeID(new Identifier("draconicevolution", "components/awakened_core")
);
ev.removeRecipeID(new Identifier("electrodynamics", "ingotsteel_ingot_smelting"));
ev.removeRecipeID(new Identifier("beyond_earth", "steel_ingot_blasting"));
ev.removeRecipeID(new Identifier("enderrift", "rift_orb"));

View file

@ -31,7 +31,9 @@ public class RecipeReplacements implements IEventBusRegisterable {
ev.mapRecipeID(
new Identifier("compactmachines", "personal_shrinking_device"),
r
-> new ShapedRecipeBuilder(Ntx4Core.id("personal_shrinking_device"), r.getOutput())
-> new ShapedRecipeBuilder(
Ntx4Core.id("personal_shrinking_device"), r.getOutput()
)
.pattern("IDI", "TFE", "IDI")
.ingredient('I', "#forge:ingots/iron")
.ingredient('D', "fluxnetworks:flux_dust")
@ -186,7 +188,8 @@ public class RecipeReplacements implements IEventBusRegisterable {
ev.mapRecipeID(
new Identifier("laserio", "laser_connector"),
r -> new ShapedRecipeBuilder(Ntx4Core.id("laser_connector"), r.getOutput())
r
-> new ShapedRecipeBuilder(Ntx4Core.id("laser_connector"), r.getOutput())
.pattern(" R ", "BCB", " D ")
.ingredient('R', "#forge:dusts/redstone")
.ingredient('B', "powah:capacitor_blazing")
@ -197,7 +200,8 @@ public class RecipeReplacements implements IEventBusRegisterable {
ev.mapRecipeID(
new Identifier("laserio", "laser_node"),
r -> new ShapedRecipeBuilder(Ntx4Core.id("laser_node"), r.getOutput())
r
-> new ShapedRecipeBuilder(Ntx4Core.id("laser_node"), r.getOutput())
.pattern("BRB", "RCR", "BRB")
.ingredient('R', "#forge:dusts/redstone")
.ingredient('B', "powah:crystal_blazing")
@ -207,7 +211,8 @@ public class RecipeReplacements implements IEventBusRegisterable {
ev.mapRecipeID(
new Identifier("dmlreforged", "simulation_chamber/simulation_chamber"),
r -> new ShapedRecipeBuilder(Ntx4Core.id("simulation_chamber"), r.getOutput())
r
-> new ShapedRecipeBuilder(Ntx4Core.id("simulation_chamber"), r.getOutput())
.pattern("NPN", "ECE", "NDN")
.ingredient('N', "#forge:nuggets/enderium")
.ingredient('E', "powah:energy_cell_niotic")
@ -219,7 +224,8 @@ public class RecipeReplacements implements IEventBusRegisterable {
ev.mapRecipeID(
new Identifier("dmlreforged", "machine_casing"),
r -> new ShapedRecipeBuilder(Ntx4Core.id("machine_casing"), r.getOutput())
r
-> new ShapedRecipeBuilder(Ntx4Core.id("machine_casing"), r.getOutput())
.pattern("NON", "OCO", "NON")
.ingredient('N', "#forge:nuggets/refined_obsidian")
.ingredient('O', "dmlreforged:soot_covered_plate")
@ -229,7 +235,8 @@ public class RecipeReplacements implements IEventBusRegisterable {
ev.mapRecipeID(
new Identifier("dmlreforged", "extraction_chamber/extraction_chamber"),
r -> new ShapedRecipeBuilder(Ntx4Core.id("extraction_chamber"), r.getOutput())
r
-> new ShapedRecipeBuilder(Ntx4Core.id("extraction_chamber"), r.getOutput())
.pattern("NPN", "ECE", "NDN")
.ingredient('N', "powah:crystal_blazing")
.ingredient('E', "powah:energy_cell_niotic")
@ -241,7 +248,8 @@ public class RecipeReplacements implements IEventBusRegisterable {
ev.mapRecipeID(
new Identifier("alchemistry", "reactor_casing"),
r -> new ShapedRecipeBuilder(Ntx4Core.id("reactor_casing"), r.getOutput())
r
-> new ShapedRecipeBuilder(Ntx4Core.id("reactor_casing"), r.getOutput())
.pattern("OPO", "PCP", "OPO")
.ingredient('P', "#forge:ingots/platinum")
.ingredient('O', "#forge:ingots/osmium")
@ -251,7 +259,10 @@ public class RecipeReplacements implements IEventBusRegisterable {
ev.mapRecipeID(
new Identifier("alchemistry", "fission_chamber_controller"),
r -> new ShapedRecipeBuilder(Ntx4Core.id("fission_chamber_controller"), r.getOutput())
r
-> new ShapedRecipeBuilder(
Ntx4Core.id("fission_chamber_controller"), r.getOutput()
)
.pattern("LFL", "GCA", "LFL")
.ingredient('L', "#forge:ingots/lead")
.ingredient('F', "mekanismgenerators:fission_reactor_casing")
@ -263,7 +274,10 @@ public class RecipeReplacements implements IEventBusRegisterable {
ev.mapRecipeID(
new Identifier("alchemistry", "fusion_chamber_controller"),
r -> new ShapedRecipeBuilder(Ntx4Core.id("fusion_chamber_controller"), r.getOutput())
r
-> new ShapedRecipeBuilder(
Ntx4Core.id("fusion_chamber_controller"), r.getOutput()
)
.pattern("LFL", "GCA", "LFL")
.ingredient('L', "#forge:ingots/steel")
.ingredient('F', "mekanismgenerators:fusion_reactor_frame")
@ -275,7 +289,8 @@ public class RecipeReplacements implements IEventBusRegisterable {
ev.mapRecipeID(
new Identifier("alchemistry", "atomizer"),
r -> new ShapedRecipeBuilder(Ntx4Core.id("atomizer"), r.getOutput())
r
-> new ShapedRecipeBuilder(Ntx4Core.id("atomizer"), r.getOutput())
.pattern("ACA", "TMP", "ACA")
.ingredient('M', "mekanism:dynamic_tank")
.ingredient('C', "#forge:circuits/basic")
@ -287,7 +302,8 @@ public class RecipeReplacements implements IEventBusRegisterable {
ev.mapRecipeID(
new Identifier("alchemistry", "liquifier"),
r -> new ShapedRecipeBuilder(Ntx4Core.id("liquifier"), r.getOutput())
r
-> new ShapedRecipeBuilder(Ntx4Core.id("liquifier"), r.getOutput())
.pattern("ACA", "PMT", "ACA")
.ingredient('M', "mekanism:dynamic_tank")
.ingredient('C', "#forge:circuits/basic")
@ -299,7 +315,8 @@ public class RecipeReplacements implements IEventBusRegisterable {
ev.mapRecipeID(
new Identifier("alchemistry", "dissolver"),
r -> new ShapedRecipeBuilder(Ntx4Core.id("dissolver"), r.getOutput())
r
-> new ShapedRecipeBuilder(Ntx4Core.id("dissolver"), r.getOutput())
.pattern("ACA", "PMT", "ACA")
.ingredient('M', "mekanism:steel_casing")
.ingredient('C', "#forge:circuits/elite")
@ -311,7 +328,8 @@ public class RecipeReplacements implements IEventBusRegisterable {
ev.mapRecipeID(
new Identifier("alchemistry", "combiner"),
r -> new ShapedRecipeBuilder(Ntx4Core.id("combiner"), r.getOutput())
r
-> new ShapedRecipeBuilder(Ntx4Core.id("combiner"), r.getOutput())
.pattern("ACA", "PMP", "ACA")
.ingredient('M', "mekanism:steel_casing")
.ingredient('C', "#forge:circuits/advanced")
@ -322,7 +340,8 @@ public class RecipeReplacements implements IEventBusRegisterable {
ev.mapRecipeID(
new Identifier("alchemistry", "compactor"),
r -> new ShapedRecipeBuilder(Ntx4Core.id("compactor"), r.getOutput())
r
-> new ShapedRecipeBuilder(Ntx4Core.id("compactor"), r.getOutput())
.pattern("AQA", "CMC", "AQA")
.ingredient('M', "mekanism:steel_casing")
.ingredient('C', "#forge:circuits/ultimate")
@ -333,7 +352,8 @@ public class RecipeReplacements implements IEventBusRegisterable {
ev.mapRecipeID(
new Identifier("psi", "programmer"),
r -> new ShapedRecipeBuilder(Ntx4Core.id("psi_programmer"), r.getOutput())
r
-> new ShapedRecipeBuilder(Ntx4Core.id("psi_programmer"), r.getOutput())
.pattern("SDS", "SCS", " S ")
.ingredient('S', "#forge:ingots/pure_steel")
.ingredient('D', "psi:psidust")
@ -343,7 +363,8 @@ public class RecipeReplacements implements IEventBusRegisterable {
ev.mapRecipeID(
new Identifier("psi", "assembler"),
r -> new ShapedRecipeBuilder(Ntx4Core.id("psi_assembler"), r.getOutput())
r
-> new ShapedRecipeBuilder(Ntx4Core.id("psi_assembler"), r.getOutput())
.pattern("SDS", "SCS", " S ")
.ingredient('S', "#forge:ingots/pure_steel")
.ingredient('D', "ae2:formation_core")
@ -353,7 +374,8 @@ public class RecipeReplacements implements IEventBusRegisterable {
ev.mapRecipeID(
new Identifier("sfm", "manager"),
r -> new ShapedRecipeBuilder(Ntx4Core.id("sfm_manager"), r.getOutput())
r
-> new ShapedRecipeBuilder(Ntx4Core.id("sfm_manager"), r.getOutput())
.pattern("SRS", "RCR", "SRS")
.ingredient('S', "ae2:smooth_sky_stone_block")
.ingredient('R', "dmlreforged:soot_covered_redstone")
@ -363,7 +385,8 @@ public class RecipeReplacements implements IEventBusRegisterable {
ev.mapRecipeID(
new Identifier("sfm", "cable"),
r -> new ShapedRecipeBuilder(Ntx4Core.id("sfm_cable"), r.getOutput())
r
-> new ShapedRecipeBuilder(Ntx4Core.id("sfm_cable"), r.getOutput())
.pattern("SNS", "FFF", "SCS")
.ingredient('S', "ae2:sky_dust")
.ingredient('F', "#forge:gems/fluix")
@ -374,7 +397,11 @@ public class RecipeReplacements implements IEventBusRegisterable {
ev.mapRecipeID(
new Identifier("modularrouters", "modular_router"),
r -> new ShapedRecipeBuilder(Ntx4Core.id("modular_router"), new ItemStack(r.getOutput().getItem(), 1))
r
-> new ShapedRecipeBuilder(
Ntx4Core.id("modular_router"),
new ItemStack(r.getOutput().getItem(), 1)
)
.pattern("IFI", "NPC", "IFI")
.ingredient('I', "#forge:ingots/iron")
.ingredient('F', "#forge:gems/fluix")
@ -386,7 +413,11 @@ public class RecipeReplacements implements IEventBusRegisterable {
ev.mapRecipeID(
new Identifier("mininggadgets", "mininggadget_simple"),
r -> new ShapedRecipeBuilder(Ntx4Core.id("mininggadget_simple"), new ItemStack(r.getOutput().getItem(), 1))
r
-> new ShapedRecipeBuilder(
Ntx4Core.id("mininggadget_simple"),
new ItemStack(r.getOutput().getItem(), 1)
)
.pattern("RME", "PCD", "EI ")
.ingredient('I', "#forge:ingots/iron")
.ingredient('R', "#forge:dusts/redstone")
@ -400,7 +431,11 @@ public class RecipeReplacements implements IEventBusRegisterable {
ev.mapRecipeID(
new Identifier("mininggadgets", "mininggadget_fancy"),
r -> new ShapedRecipeBuilder(Ntx4Core.id("mininggadget_fancy"), new ItemStack(r.getOutput().getItem(), 1))
r
-> new ShapedRecipeBuilder(
Ntx4Core.id("mininggadget_fancy"),
new ItemStack(r.getOutput().getItem(), 1)
)
.pattern("RME", "PCD", "EI ")
.ingredient('I', "#forge:ingots/iron")
.ingredient('R', "#forge:dusts/redstone")
@ -414,7 +449,10 @@ public class RecipeReplacements implements IEventBusRegisterable {
ev.mapRecipeID(
new Identifier("mininggadgets", "mininggadget"),
r -> new ShapedRecipeBuilder(Ntx4Core.id("mininggadget"), new ItemStack(r.getOutput().getItem(), 1))
r
-> new ShapedRecipeBuilder(
Ntx4Core.id("mininggadget"), new ItemStack(r.getOutput().getItem(), 1)
)
.pattern("RME", "PCD", "EI ")
.ingredient('I', "#forge:ingots/iron")
.ingredient('R', "#forge:dusts/redstone")
@ -428,7 +466,11 @@ public class RecipeReplacements implements IEventBusRegisterable {
ev.mapRecipeID(
new Identifier("mekanism", "metallurgic_infuser"),
r -> new ShapedRecipeBuilder(Ntx4Core.id("metallurgic_infuser"), new ItemStack(r.getOutput().getItem(), 1))
r
-> new ShapedRecipeBuilder(
Ntx4Core.id("metallurgic_infuser"),
new ItemStack(r.getOutput().getItem(), 1)
)
.pattern("IFI", "DCD", "IFI")
.ingredient('I', "#forge:ingots/osmium")
.ingredient('D', "#forge:dusts/redstone")

View file

@ -29,7 +29,8 @@ public class ShapedRecipes implements IEventBusRegisterable {
.ingredient('C', "mekanism:teleportation_core")
.ingredient('E', "mekanism:energy_tablet")
.build());
ev.registerRecipe(new ShapedRecipeBuilder(
ev.registerRecipe(
new ShapedRecipeBuilder(
Ntx4Core.id("dark_matter_conversion"),
Util.stackFromRegistry(new Identifier("projecte", "dark_matter"))
)
@ -48,8 +49,7 @@ public class ShapedRecipes implements IEventBusRegisterable {
.ingredient('D', "#forge:dusts/fluix")
.ingredient('C', "industrialforegoing:machine_frame_simple")
.ingredient('P', "minecraft:piston")
.build()
);
.build());
}
@Override