Skip to content

Commit

Permalink
Fix checkstyle except for import order
Browse files Browse the repository at this point in the history
I don't know what it wants me to do for that
  • Loading branch information
skycatminepokie committed Dec 27, 2024
1 parent fd05fa9 commit e7cef41
Show file tree
Hide file tree
Showing 9 changed files with 37 additions and 44 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

import java.util.concurrent.CompletableFuture;

import com.example.docs.enchantment.ModEnchantmentEffects;

import net.minecraft.component.EnchantmentEffectComponentTypes;
import net.minecraft.component.type.AttributeModifierSlot;
import net.minecraft.enchantment.Enchantment;
Expand All @@ -18,11 +16,11 @@
import net.fabricmc.fabric.api.datagen.v1.provider.FabricDynamicRegistryProvider;
import net.fabricmc.fabric.api.resource.conditions.v1.ResourceCondition;

import com.example.docs.enchantment.ModEnchantmentEffects;
import com.example.docs.enchantment.effect.LightningEnchantmentEffect;

//#entrypoint
public class EnchantmentGenerator extends FabricDynamicRegistryProvider {

public EnchantmentGenerator(FabricDataOutput output, CompletableFuture<RegistryWrapper.WrapperLookup> registriesFuture) {
super(output, registriesFuture);
System.out.println("REGISTERING ENCHANTS");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,9 @@

import com.example.docs.FabricDocsReference;

import com.example.docs.advancement.ModCriteria;

import com.example.docs.advancement.ParameterizedUseToolCriterion;
import com.example.docs.advancement.UseToolCriterion;

import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput;
import net.fabricmc.fabric.api.datagen.v1.provider.FabricAdvancementProvider;
import java.util.concurrent.CompletableFuture;

Check failure on line 5 in reference/latest/src/client/java/com/example/docs/datagen/FabricDocsReferenceAdvancementProvider.java

View workflow job for this annotation

GitHub Actions / mod

Wrong order for 'java.util.concurrent.CompletableFuture' import.
import java.util.function.Consumer;
import java.util.Optional;

Check failure on line 7 in reference/latest/src/client/java/com/example/docs/datagen/FabricDocsReferenceAdvancementProvider.java

View workflow job for this annotation

GitHub Actions / mod

Wrong order for 'java.util.Optional' import.

import net.minecraft.advancement.Advancement;
import net.minecraft.advancement.AdvancementEntry;
Expand All @@ -20,9 +16,13 @@
import net.minecraft.text.Text;
import net.minecraft.util.Identifier;

import java.util.Optional;
import java.util.concurrent.CompletableFuture;
import java.util.function.Consumer;
import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput;
import net.fabricmc.fabric.api.datagen.v1.provider.FabricAdvancementProvider;

import com.example.docs.advancement.ModCriteria;
import com.example.docs.advancement.ParameterizedUseToolCriterion;
import com.example.docs.advancement.UseToolCriterion;

// :::datagen-advancements:provider-start
public class FabricDocsReferenceAdvancementProvider extends FabricAdvancementProvider {
protected FabricDocsReferenceAdvancementProvider(FabricDataOutput output, CompletableFuture<RegistryWrapper.WrapperLookup> registryLookup) {
Expand Down Expand Up @@ -101,4 +101,4 @@ public void generateAdvancement(RegistryWrapper.WrapperLookup wrapperLookup, Con
// :::datagen-advancements:provider-start
}
}
// :::datagen-advancements:provider-start
// :::datagen-advancements:provider-start
Original file line number Diff line number Diff line change
@@ -1,29 +1,23 @@
package com.example.docs.datagen;

import com.example.docs.FabricDocsReference;

import com.example.docs.ModLootTables;

import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput;
import net.fabricmc.fabric.api.datagen.v1.provider.SimpleFabricLootTableProvider;
import java.util.concurrent.CompletableFuture;
import java.util.function.BiConsumer;

import net.minecraft.item.Items;
import net.minecraft.loot.LootPool;
import net.minecraft.loot.LootTable;
import net.minecraft.loot.context.LootContextTypes;
import net.minecraft.loot.entry.ItemEntry;
import net.minecraft.loot.function.EnchantWithLevelsLootFunction;
import net.minecraft.loot.function.SetCountLootFunction;
import net.minecraft.loot.provider.number.ConstantLootNumberProvider;
import net.minecraft.registry.Registries;
import net.minecraft.registry.Registry;
import net.minecraft.registry.RegistryKey;
import net.minecraft.registry.RegistryKeys;
import net.minecraft.registry.RegistryWrapper;
import net.minecraft.util.Identifier;

import java.util.concurrent.CompletableFuture;
import java.util.function.BiConsumer;
import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput;
import net.fabricmc.fabric.api.datagen.v1.provider.SimpleFabricLootTableProvider;

import com.example.docs.ModLootTables;

// :::datagen-loot-tables:chest-provider
public class FabricDocsReferenceChestLootTableProvider extends SimpleFabricLootTableProvider {
public FabricDocsReferenceChestLootTableProvider(FabricDataOutput output, CompletableFuture<RegistryWrapper.WrapperLookup> registryLookup) {
Expand All @@ -40,8 +34,8 @@ public void accept(BiConsumer<RegistryKey<LootTable>, LootTable.Builder> lootTab
.with(ItemEntry.builder(Items.DIAMOND) // With an entry that has diamond(s)
.apply(SetCountLootFunction.builder(ConstantLootNumberProvider.create(1.0f)))) // One diamond
.with(ItemEntry.builder(Items.DIAMOND_SWORD) // With an entry that has a plain diamond sword
)
));
)
));
// :::datagen-loot-tables:chest-loot
// :::datagen-loot-tables:chest-provider
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
package com.example.docs.datagen;

// :::datagen-setup:generator
import net.fabricmc.fabric.api.datagen.v1.DataGeneratorEntrypoint;
import net.fabricmc.fabric.api.datagen.v1.FabricDataGenerator;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ public void generateTranslations(RegistryWrapper.WrapperLookup wrapperLookup, Tr
// :::datagen-translations:provider
}
}
// :::datagen-translations:provider
// :::datagen-translations:provider
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ public void onInitializeDataGenerator(FabricDataGenerator fabricDataGenerator) {
// :::datagen-loot-tables:generator
}
}
// :::datagen-loot-tables:generator
// :::datagen-loot-tables:generator
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
package com.example.docs.datagen;

// :::datagen-recipes:provider
import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput;
import net.fabricmc.fabric.api.datagen.v1.provider.FabricRecipeProvider;
Expand All @@ -11,7 +12,6 @@
import net.minecraft.recipe.book.RecipeCategory;
import net.minecraft.registry.RegistryWrapper;
import net.minecraft.registry.tag.ItemTags;
import net.minecraft.registry.tag.TagKey;

import java.util.List;

Check failure on line 16 in reference/latest/src/client/java/com/example/docs/datagen/FabricDocsReferenceRecipeProvider.java

View workflow job for this annotation

GitHub Actions / mod

Wrong order for 'java.util.List' import.
import java.util.concurrent.CompletableFuture;
Expand Down Expand Up @@ -59,9 +59,9 @@ public void generate(RecipeExporter recipeExporter) {
0.1f, // Experience
300, // Cooking time
"food_to_wheat" // group
);
);
// :::datagen-recipes:other
// :::datagen-recipes:provider
}
}
// :::datagen-recipes:provider
// :::datagen-recipes:provider
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
package com.example.docs.advancement;

Check failure on line 1 in reference/latest/src/main/java/com/example/docs/advancement/ModCriteria.java

View workflow job for this annotation

GitHub Actions / mod

File does not end with a newline.

import net.minecraft.advancement.criterion.Criteria;

import com.example.docs.FabricDocsReference;

// :::datagen-advancements:mod-criteria
import net.minecraft.advancement.criterion.Criteria;

public class ModCriteria {
// :::datagen-advancements:mod-criteria
// :::datagen-advancements:mod-criteria-init
public static void init() {

}
// :::datagen-advancements:mod-criteria-init
// :::datagen-advancements:mod-criteria
public static final UseToolCriterion USE_TOOL = Criteria.register(FabricDocsReference.MOD_ID + "/use_tool", new UseToolCriterion());
// :::datagen-advancements:mod-criteria
// :::datagen-advancements:new-mod-criteria
public static final ParameterizedUseToolCriterion PARAMETERIZED_USE_TOOL = Criteria.register(FabricDocsReference.MOD_ID + "/parameterized_use_tool", new ParameterizedUseToolCriterion());

// :::datagen-advancements:mod-criteria
// :::datagen-advancements:mod-criteria-init
public static void init() {

Check failure on line 18 in reference/latest/src/main/java/com/example/docs/advancement/ModCriteria.java

View workflow job for this annotation

GitHub Actions / mod

blank line after {

}
// :::datagen-advancements:new-mod-criteria
// :::datagen-advancements:mod-criteria
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
package com.example.docs.advancement;

import com.mojang.serialization.Codec;
import java.util.Optional;

import com.mojang.serialization.Codec;
import com.mojang.serialization.codecs.RecordCodecBuilder;

import net.minecraft.advancement.criterion.AbstractCriterion;
import net.minecraft.predicate.entity.LootContextPredicate;
import net.minecraft.server.network.ServerPlayerEntity;

import java.util.Optional;

/**
* {@link UseToolCriterion} but with a parameter. Separated because there was no way to show the process to parameterize
* in just one class.
Expand Down

0 comments on commit e7cef41

Please sign in to comment.