Skip to content

Commit

Permalink
Update spotless to latest version (#829)
Browse files Browse the repository at this point in the history
  • Loading branch information
Technici4n authored Aug 11, 2024
1 parent 7f82740 commit ac3ae7d
Show file tree
Hide file tree
Showing 16 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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.+"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
class MIDragDropHandler implements EmiDragDropHandler<Screen> {
@Override
public boolean dropStack(Screen screen, EmiIngredient ingredient, int mouseX, int mouseY) {
if (!(screen instanceof MIHandledScreen<?>gui)) {
if (!(screen instanceof MIHandledScreen<?> gui)) {
return false;
}

Expand Down Expand Up @@ -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 MIHandledScreen<?>gui)) {
if (!(screen instanceof MIHandledScreen<?> gui)) {
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public List<Slot> getCraftingSlots(MachineMenuCommon menu) {

@Override
public boolean supportsRecipe(EmiRecipe recipe) {
return recipe instanceof ViewerCategoryEmi.ViewerRecipe r && r.recipe instanceof RecipeHolder<?>holder
return recipe instanceof ViewerCategoryEmi.ViewerRecipe r && r.recipe instanceof RecipeHolder<?> holder
&& holder.value() instanceof MachineRecipe;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ public ViewerCategoryEmi<D> getCategory() {

@Override
public @Nullable ResourceLocation getId() {
return recipe instanceof RecipeHolder<?>r ? r.id() : null;
return recipe instanceof RecipeHolder<?> r ? r.id() : null;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ private boolean acceptsStack(DraggingContext<Screen> context, DraggableStack sta
return dw.dragFluid(fk, Simulation.ACT);
}
}
if (context.getScreen() instanceof MIHandledScreen<?>handledScreen) {
if (context.getScreen() instanceof MIHandledScreen<?> handledScreen) {
AbstractContainerMenu handler = handledScreen.getMenu();
Slot slot = handledScreen.getFocusedSlot();
if (slot instanceof ReiDraggable dw) {
Expand Down Expand Up @@ -100,7 +100,7 @@ public Stream<BoundsProvider> getDraggableAcceptingBounds(DraggingContext<Screen
}
}
}
if (context.getScreen() instanceof MIHandledScreen<?>handledScreen) {
if (context.getScreen() instanceof MIHandledScreen<?> handledScreen) {
AbstractContainerMenu handler = handledScreen.getMenu();
for (Slot slot : handler.slots) {
if (slot instanceof ReiDraggable dw) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
class MachineSlotLockingHandler implements TransferHandler {
@Override
public @NotNull Result handle(@NotNull Context context) {
if (!(context.getDisplay() instanceof ViewerCategoryRei.ViewerDisplay<?>d && d.recipe instanceof RecipeHolder<?>holder
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))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ public CategoryIdentifier<?> getCategoryIdentifier() {

@Override
public Optional<ResourceLocation> getDisplayLocation() {
return recipe instanceof RecipeHolder<?>r ? Optional.of(r.id()) : Optional.empty();
return recipe instanceof RecipeHolder<?> r ? Optional.of(r.id()) : Optional.empty();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public boolean hasAnalogOutputSignal(BlockState state) {

@Override
public int getAnalogOutputSignal(BlockState state, Level level, BlockPos pos) {
if (level.getBlockEntity(pos) instanceof AbstractStorageBlockEntity<?>storageBlockEntity) {
if (level.getBlockEntity(pos) instanceof AbstractStorageBlockEntity<?> storageBlockEntity) {
return StorageUtil.calculateComparatorOutput(storageBlockEntity);
}
return 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
import net.minecraft.network.codec.ByteBufCodecs;
import net.minecraft.network.codec.StreamCodec;

public record ResourceStorage<T extends TransferVariant<?>> (T resource, long amount, boolean locked) {
public record ResourceStorage<T extends TransferVariant<?>>(T resource, long amount, boolean locked) {
public ResourceStorage {
if (resource.isBlank() && amount != 0) {
throw new IllegalArgumentException("Expected 0 amount for blank resoruce, got " + amount);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ private static <T> RecipeKey<List<T>> optionalList(RecipeComponent<T> 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"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ public List<Component> getTooltips() {

public interface EUProductionMap<T> {

record InformationEntry<T> (long eu, T variant) {
record InformationEntry<T>(long eu, T variant) {
}

long getEuProduction(T variant);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public class MIPackets {
static final Map<Class<? extends BasePacket>, CustomPacketPayload.Type<?>> packetTypes = new HashMap<>();
private static final List<Registration<?>> registrations = new ArrayList<>();

private record Registration<P extends BasePacket> (CustomPacketPayload.Type<P> packetType, Class<P> clazz,
private record Registration<P extends BasePacket>(CustomPacketPayload.Type<P> packetType, Class<P> clazz,
StreamCodec<? super RegistryFriendlyByteBuf, P> packetCodec) {
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ default INuclearComponent<?> getComponent() {
TransferVariant<?> variant = getVariant();

if (variant instanceof ItemVariant resource) {
if (!variant.isBlank() && getVariantAmount() > 0 && resource.getItem() instanceof INuclearComponent<?>comp) {
if (!variant.isBlank() && getVariantAmount() > 0 && resource.getItem() instanceof INuclearComponent<?> comp) {
return comp;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ public static <T> long tryInsertStacking(@Nullable Storage<T> storage, T resourc
StoragePreconditions.notNegative(maxAmount);

try {
if (storage instanceof SlottedStorage<T>slottedStorage) {
if (storage instanceof SlottedStorage<T> slottedStorage) {
return insertStacking(slottedStorage.getSlots(), resource, maxAmount, transaction);
} else if (storage != null) {
return storage.insert(resource, maxAmount, transaction);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@
*
* @param <T> The type of the stored resource.
*/
public record ResourceAmount<T> (T resource, long amount) {
public record ResourceAmount<T>(T resource, long amount) {
}

0 comments on commit ac3ae7d

Please sign in to comment.