From ac3ae7d352b5bc80721dc08a84b824296ab5af97 Mon Sep 17 00:00:00 2001 From: Technici4n <13494793+Technici4n@users.noreply.github.com> Date: Sun, 11 Aug 2024 17:57:14 +0200 Subject: [PATCH] Update spotless to latest version (#829) --- build.gradle | 2 +- .../compat/viewer/impl/emi/MIDragDropHandler.java | 4 ++-- .../compat/viewer/impl/emi/MachineRecipeHandler.java | 2 +- .../compat/viewer/impl/emi/ViewerCategoryEmi.java | 2 +- .../compat/viewer/impl/rei/MIDraggableStackVisitor.java | 4 ++-- .../compat/viewer/impl/rei/MachineSlotLockingHandler.java | 2 +- .../compat/viewer/impl/rei/ViewerCategoryRei.java | 2 +- .../blocks/storage/AbstractStorageBlock.java | 2 +- .../blocks/storage/ResourceStorage.java | 2 +- .../compat/kubejs/recipe/MachineRecipeSchema.java | 4 ++-- .../datagen/recipe/DyeRecipesProvider.java | 2 +- .../machines/components/FluidItemConsumerComponent.java | 2 +- .../aztech/modern_industrialization/network/MIPackets.java | 2 +- .../modern_industrialization/nuclear/INuclearTileData.java | 2 +- .../thirdparty/fabrictransfer/api/storage/StorageUtil.java | 2 +- .../fabrictransfer/api/storage/base/ResourceAmount.java | 2 +- 16 files changed, 19 insertions(+), 19 deletions(-) diff --git a/build.gradle b/build.gradle index b64eb5106..7303a89c3 100644 --- a/build.gradle +++ b/build.gradle @@ -4,7 +4,7 @@ plugins { id 'idea' id 'maven-publish' id 'net.neoforged.moddev' version '1.0.1' - id 'com.diffplug.spotless' version '5.14.0' + id 'com.diffplug.spotless' version '6.25.0' id 'com.matthewprenger.cursegradle' version '1.4.0' id "com.modrinth.minotaur" version "2.+" } diff --git a/src/client/java/aztech/modern_industrialization/compat/viewer/impl/emi/MIDragDropHandler.java b/src/client/java/aztech/modern_industrialization/compat/viewer/impl/emi/MIDragDropHandler.java index 420f911d0..0bc3de266 100644 --- a/src/client/java/aztech/modern_industrialization/compat/viewer/impl/emi/MIDragDropHandler.java +++ b/src/client/java/aztech/modern_industrialization/compat/viewer/impl/emi/MIDragDropHandler.java @@ -49,7 +49,7 @@ class MIDragDropHandler implements EmiDragDropHandler { @Override public boolean dropStack(Screen screen, EmiIngredient ingredient, int mouseX, int mouseY) { - if (!(screen instanceof MIHandledScreengui)) { + if (!(screen instanceof MIHandledScreen gui)) { return false; } @@ -88,7 +88,7 @@ public boolean dropStack(Screen screen, EmiIngredient ingredient, int mouseX, in @Override public void render(Screen screen, EmiIngredient ingredient, GuiGraphics guiGraphics, int mouseX, int mouseY, float delta) { - if (!(screen instanceof MIHandledScreengui)) { + if (!(screen instanceof MIHandledScreen gui)) { return; } diff --git a/src/client/java/aztech/modern_industrialization/compat/viewer/impl/emi/MachineRecipeHandler.java b/src/client/java/aztech/modern_industrialization/compat/viewer/impl/emi/MachineRecipeHandler.java index 7aba0d0a5..799ab530a 100644 --- a/src/client/java/aztech/modern_industrialization/compat/viewer/impl/emi/MachineRecipeHandler.java +++ b/src/client/java/aztech/modern_industrialization/compat/viewer/impl/emi/MachineRecipeHandler.java @@ -60,7 +60,7 @@ public List getCraftingSlots(MachineMenuCommon menu) { @Override public boolean supportsRecipe(EmiRecipe recipe) { - return recipe instanceof ViewerCategoryEmi.ViewerRecipe r && r.recipe instanceof RecipeHolderholder + return recipe instanceof ViewerCategoryEmi.ViewerRecipe r && r.recipe instanceof RecipeHolder holder && holder.value() instanceof MachineRecipe; } diff --git a/src/client/java/aztech/modern_industrialization/compat/viewer/impl/emi/ViewerCategoryEmi.java b/src/client/java/aztech/modern_industrialization/compat/viewer/impl/emi/ViewerCategoryEmi.java index e588f0c60..2d550e0d1 100644 --- a/src/client/java/aztech/modern_industrialization/compat/viewer/impl/emi/ViewerCategoryEmi.java +++ b/src/client/java/aztech/modern_industrialization/compat/viewer/impl/emi/ViewerCategoryEmi.java @@ -219,7 +219,7 @@ public ViewerCategoryEmi getCategory() { @Override public @Nullable ResourceLocation getId() { - return recipe instanceof RecipeHolderr ? r.id() : null; + return recipe instanceof RecipeHolder r ? r.id() : null; } @Override diff --git a/src/client/java/aztech/modern_industrialization/compat/viewer/impl/rei/MIDraggableStackVisitor.java b/src/client/java/aztech/modern_industrialization/compat/viewer/impl/rei/MIDraggableStackVisitor.java index 50baecb36..56235b420 100644 --- a/src/client/java/aztech/modern_industrialization/compat/viewer/impl/rei/MIDraggableStackVisitor.java +++ b/src/client/java/aztech/modern_industrialization/compat/viewer/impl/rei/MIDraggableStackVisitor.java @@ -67,7 +67,7 @@ private boolean acceptsStack(DraggingContext context, DraggableStack sta return dw.dragFluid(fk, Simulation.ACT); } } - if (context.getScreen() instanceof MIHandledScreenhandledScreen) { + if (context.getScreen() instanceof MIHandledScreen handledScreen) { AbstractContainerMenu handler = handledScreen.getMenu(); Slot slot = handledScreen.getFocusedSlot(); if (slot instanceof ReiDraggable dw) { @@ -100,7 +100,7 @@ public Stream getDraggableAcceptingBounds(DraggingContexthandledScreen) { + if (context.getScreen() instanceof MIHandledScreen handledScreen) { AbstractContainerMenu handler = handledScreen.getMenu(); for (Slot slot : handler.slots) { if (slot instanceof ReiDraggable dw) { diff --git a/src/client/java/aztech/modern_industrialization/compat/viewer/impl/rei/MachineSlotLockingHandler.java b/src/client/java/aztech/modern_industrialization/compat/viewer/impl/rei/MachineSlotLockingHandler.java index f67189e7d..9e5445bef 100644 --- a/src/client/java/aztech/modern_industrialization/compat/viewer/impl/rei/MachineSlotLockingHandler.java +++ b/src/client/java/aztech/modern_industrialization/compat/viewer/impl/rei/MachineSlotLockingHandler.java @@ -43,7 +43,7 @@ class MachineSlotLockingHandler implements TransferHandler { @Override public @NotNull Result handle(@NotNull Context context) { - if (!(context.getDisplay() instanceof ViewerCategoryRei.ViewerDisplayd && d.recipe instanceof RecipeHolderholder + if (!(context.getDisplay() instanceof ViewerCategoryRei.ViewerDisplay d && d.recipe instanceof RecipeHolder holder && holder.value() instanceof MachineRecipe recipe)) return Result.createNotApplicable(); if (!(context.getMenu() instanceof MachineMenuClient handler)) diff --git a/src/client/java/aztech/modern_industrialization/compat/viewer/impl/rei/ViewerCategoryRei.java b/src/client/java/aztech/modern_industrialization/compat/viewer/impl/rei/ViewerCategoryRei.java index 77c758034..bbf56e902 100644 --- a/src/client/java/aztech/modern_industrialization/compat/viewer/impl/rei/ViewerCategoryRei.java +++ b/src/client/java/aztech/modern_industrialization/compat/viewer/impl/rei/ViewerCategoryRei.java @@ -246,7 +246,7 @@ public CategoryIdentifier getCategoryIdentifier() { @Override public Optional getDisplayLocation() { - return recipe instanceof RecipeHolderr ? Optional.of(r.id()) : Optional.empty(); + return recipe instanceof RecipeHolder r ? Optional.of(r.id()) : Optional.empty(); } } diff --git a/src/main/java/aztech/modern_industrialization/blocks/storage/AbstractStorageBlock.java b/src/main/java/aztech/modern_industrialization/blocks/storage/AbstractStorageBlock.java index 77df8a939..1d52d867e 100644 --- a/src/main/java/aztech/modern_industrialization/blocks/storage/AbstractStorageBlock.java +++ b/src/main/java/aztech/modern_industrialization/blocks/storage/AbstractStorageBlock.java @@ -80,7 +80,7 @@ public boolean hasAnalogOutputSignal(BlockState state) { @Override public int getAnalogOutputSignal(BlockState state, Level level, BlockPos pos) { - if (level.getBlockEntity(pos) instanceof AbstractStorageBlockEntitystorageBlockEntity) { + if (level.getBlockEntity(pos) instanceof AbstractStorageBlockEntity storageBlockEntity) { return StorageUtil.calculateComparatorOutput(storageBlockEntity); } return 0; diff --git a/src/main/java/aztech/modern_industrialization/blocks/storage/ResourceStorage.java b/src/main/java/aztech/modern_industrialization/blocks/storage/ResourceStorage.java index f82b71366..ceb38eff4 100644 --- a/src/main/java/aztech/modern_industrialization/blocks/storage/ResourceStorage.java +++ b/src/main/java/aztech/modern_industrialization/blocks/storage/ResourceStorage.java @@ -35,7 +35,7 @@ import net.minecraft.network.codec.ByteBufCodecs; import net.minecraft.network.codec.StreamCodec; -public record ResourceStorage> (T resource, long amount, boolean locked) { +public record ResourceStorage>(T resource, long amount, boolean locked) { public ResourceStorage { if (resource.isBlank() && amount != 0) { throw new IllegalArgumentException("Expected 0 amount for blank resoruce, got " + amount); diff --git a/src/main/java/aztech/modern_industrialization/compat/kubejs/recipe/MachineRecipeSchema.java b/src/main/java/aztech/modern_industrialization/compat/kubejs/recipe/MachineRecipeSchema.java index 32af2e591..9ef12f224 100644 --- a/src/main/java/aztech/modern_industrialization/compat/kubejs/recipe/MachineRecipeSchema.java +++ b/src/main/java/aztech/modern_industrialization/compat/kubejs/recipe/MachineRecipeSchema.java @@ -65,8 +65,8 @@ private static RecipeKey> optionalList(RecipeComponent component, ITEM_INPUTS, FLUID_INPUTS, MACHINE_PROCESS_CONDITIONS) - .factory(MachineKubeRecipe.FACTORY) - .constructor(EU, DURATION); + .factory(MachineKubeRecipe.FACTORY) + .constructor(EU, DURATION); public static final RecipeSchema FORGE_HAMMER_SCHEMA = new RecipeSchema( ItemStackComponent.ITEM_STACK.outputKey("result"), diff --git a/src/main/java/aztech/modern_industrialization/datagen/recipe/DyeRecipesProvider.java b/src/main/java/aztech/modern_industrialization/datagen/recipe/DyeRecipesProvider.java index ae3658994..e83bcaa0d 100644 --- a/src/main/java/aztech/modern_industrialization/datagen/recipe/DyeRecipesProvider.java +++ b/src/main/java/aztech/modern_industrialization/datagen/recipe/DyeRecipesProvider.java @@ -60,7 +60,7 @@ public void buildRecipes(RecipeOutput consumer) { // 16 fluid pipes with stained glass var fluidPipesStainedGlass = new ShapedRecipeJson("modern_industrialization:" + color.getName() + "_fluid_pipe", 16, "CCC", "rPr", "CCC").addInput('C', "modern_industrialization:bronze_curved_plate").addInput('r', "modern_industrialization:copper_rotor") - .addInput('P', color.getName() + "_stained_glass_pane"); + .addInput('P', color.getName() + "_stained_glass_pane"); fluidPipesStainedGlass.offerTo(consumer, pathPrefix + "craft/fluid_pipe_stained_glass"); fluidPipesStainedGlass.exportToAssembler().offerTo(consumer, pathPrefix + "assembler/fluid_pipe_stained_glass"); // 8 fluid pipes diff --git a/src/main/java/aztech/modern_industrialization/machines/components/FluidItemConsumerComponent.java b/src/main/java/aztech/modern_industrialization/machines/components/FluidItemConsumerComponent.java index 9fcc20a92..ed6c7ad16 100644 --- a/src/main/java/aztech/modern_industrialization/machines/components/FluidItemConsumerComponent.java +++ b/src/main/java/aztech/modern_industrialization/machines/components/FluidItemConsumerComponent.java @@ -213,7 +213,7 @@ public List getTooltips() { public interface EUProductionMap { - record InformationEntry (long eu, T variant) { + record InformationEntry(long eu, T variant) { } long getEuProduction(T variant); diff --git a/src/main/java/aztech/modern_industrialization/network/MIPackets.java b/src/main/java/aztech/modern_industrialization/network/MIPackets.java index 45dec7664..973b4aa01 100644 --- a/src/main/java/aztech/modern_industrialization/network/MIPackets.java +++ b/src/main/java/aztech/modern_industrialization/network/MIPackets.java @@ -56,7 +56,7 @@ public class MIPackets { static final Map, CustomPacketPayload.Type> packetTypes = new HashMap<>(); private static final List> registrations = new ArrayList<>(); - private record Registration

(CustomPacketPayload.Type

packetType, Class

clazz, + private record Registration

(CustomPacketPayload.Type

packetType, Class

clazz, StreamCodec packetCodec) { } diff --git a/src/main/java/aztech/modern_industrialization/nuclear/INuclearTileData.java b/src/main/java/aztech/modern_industrialization/nuclear/INuclearTileData.java index 307417812..b0c6ecd74 100644 --- a/src/main/java/aztech/modern_industrialization/nuclear/INuclearTileData.java +++ b/src/main/java/aztech/modern_industrialization/nuclear/INuclearTileData.java @@ -55,7 +55,7 @@ default INuclearComponent getComponent() { TransferVariant variant = getVariant(); if (variant instanceof ItemVariant resource) { - if (!variant.isBlank() && getVariantAmount() > 0 && resource.getItem() instanceof INuclearComponentcomp) { + if (!variant.isBlank() && getVariantAmount() > 0 && resource.getItem() instanceof INuclearComponent comp) { return comp; } diff --git a/src/main/java/aztech/modern_industrialization/thirdparty/fabrictransfer/api/storage/StorageUtil.java b/src/main/java/aztech/modern_industrialization/thirdparty/fabrictransfer/api/storage/StorageUtil.java index 55fea0bd7..0b08a44c3 100644 --- a/src/main/java/aztech/modern_industrialization/thirdparty/fabrictransfer/api/storage/StorageUtil.java +++ b/src/main/java/aztech/modern_industrialization/thirdparty/fabrictransfer/api/storage/StorageUtil.java @@ -276,7 +276,7 @@ public static long tryInsertStacking(@Nullable Storage storage, T resourc StoragePreconditions.notNegative(maxAmount); try { - if (storage instanceof SlottedStorageslottedStorage) { + if (storage instanceof SlottedStorage slottedStorage) { return insertStacking(slottedStorage.getSlots(), resource, maxAmount, transaction); } else if (storage != null) { return storage.insert(resource, maxAmount, transaction); diff --git a/src/main/java/aztech/modern_industrialization/thirdparty/fabrictransfer/api/storage/base/ResourceAmount.java b/src/main/java/aztech/modern_industrialization/thirdparty/fabrictransfer/api/storage/base/ResourceAmount.java index e640eb62b..c30e7dd4f 100644 --- a/src/main/java/aztech/modern_industrialization/thirdparty/fabrictransfer/api/storage/base/ResourceAmount.java +++ b/src/main/java/aztech/modern_industrialization/thirdparty/fabrictransfer/api/storage/base/ResourceAmount.java @@ -28,5 +28,5 @@ * * @param The type of the stored resource. */ -public record ResourceAmount (T resource, long amount) { +public record ResourceAmount(T resource, long amount) { }