Skip to content
This repository has been archived by the owner on Jul 28, 2024. It is now read-only.

Commit

Permalink
checkstyle
Browse files Browse the repository at this point in the history
  • Loading branch information
CrypticVerse committed Jun 21, 2024
1 parent 8461319 commit c0a17a8
Show file tree
Hide file tree
Showing 15 changed files with 187 additions and 24 deletions.
6 changes: 6 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ plugins {
id("com.github.breadmoirai.github-release") version("2.+")
id("com.diffplug.spotless") version("6.25.0")
id("signing")
id("checkstyle")
}

// Gradle Properties
Expand Down Expand Up @@ -93,6 +94,11 @@ dependencies {
// modImplementation "net.fabricmc.fabric-api:fabric-api-deprecated:${project.fabric_version}"
}

checkstyle {
configFile = rootProject.file("checkstyle.xml")
toolVersion = "10.12.1"
}

tasks.withType<ProcessResources> {
inputs.property("version", mod_version)

Expand Down
131 changes: 131 additions & 0 deletions checkstyle.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//Checkstyle//DTD Check Configuration 1.3//EN" "https://checkstyle.org/dtds/configuration_1_3.dtd">

<!--
This configuration file was written by the eclipse-cs plugin configuration editor
-->
<!--
Checkstyle-Configuration: Mixin
Description: none
-->
<module name="Checker">
<property name="severity" value="error"/>
<property name="charset" value="UTF-8"/>
<module name="BeforeExecutionExclusionFileFilter">
<property name="fileNamePattern" value="module\-info\.java$"/>
</module>
<module name="TreeWalker">
<module name="OuterTypeFilename"/>
<module name="IllegalTokenText">
<property name="tokens" value="STRING_LITERAL, CHAR_LITERAL"/>
<property name="format" value="\\u00(08|09|0(a|A)|0(c|C)|0(d|D)|22|27|5(C|c))|\\(0(10|11|12|14|15|42|47)|134)"/>
<property name="message" value="Avoid using corresponding octal or Unicode escape."/>
</module>
<module name="EmptyBlock">
<property name="option" value="TEXT"/>
<property name="tokens" value="LITERAL_TRY, LITERAL_CATCH, LITERAL_FINALLY, LITERAL_IF, LITERAL_ELSE, LITERAL_SWITCH"/>
</module>
<module name="NeedBraces"/>
<module name="LeftCurly"/>
<module name="RightCurly"/>
<module name="RightCurly">
<property name="option" value="alone"/>
<property name="tokens" value="CLASS_DEF,METHOD_DEF,LITERAL_FOR,LITERAL_WHILE,STATIC_INIT,INSTANCE_INIT"/>
</module>
<module name="RightCurly">
<property name="option" value="alone_or_singleline"/>
<property name="tokens" value="CTOR_DEF"/>
</module>
<module name="WhitespaceAround">
<property name="allowEmptyConstructors" value="true"/>
<property name="allowEmptyMethods" value="true"/>
<message key="ws.notPreceded" value="WhitespaceAround: ''{0}'' is not preceded with whitespace."/>
<message key="ws.notFollowed" value="WhitespaceAround: ''{0}'' is not followed by whitespace."/>
</module>
<module name="OneStatementPerLine"/>
<module name="ArrayTypeStyle"/>
<module name="FallThrough"/>
<module name="UpperEll"/>
<module name="ModifierOrder"/>
<module name="PackageName">
<property name="format" value="^[a-z]+(\.[a-z][a-z0-9]*)*$"/>
<message key="name.invalidPattern" value="Package name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="TypeName">
<message key="name.invalidPattern" value="Type name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="MemberName">
<property name="format" value="^[a-z](([a-z0-9])|([a-z0-9][a-zA-Z0-9]*))?$"/>
<message key="name.invalidPattern" value="Member name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="ParameterName">
<property name="format" value="^[a-z](([a-z0-9])|([a-z0-9][a-zA-Z0-9]*))?$"/>
<message key="name.invalidPattern" value="Parameter name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="LocalVariableName">
<property name="format" value="^[a-z](([a-z0-9])|([a-z0-9][a-zA-Z0-9]*))?$"/>
<message key="name.invalidPattern" value="Local variable name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="ClassTypeParameterName">
<property name="format" value="^([A-Z][0-9]?)|([T][A-Z][a-zA-Z0-9]*)$"/>
<message key="name.invalidPattern" value="Class type name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="MethodTypeParameterName">
<property name="format" value="^([A-Z][0-9]?)|([T][A-Z][a-zA-Z0-9]*)$"/>
<message key="name.invalidPattern" value="Method type name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="NoFinalizer"/>
<module name="GenericWhitespace">
<message key="ws.notPreceded" value="GenericWhitespace ''{0}'' is not preceded with whitespace."/>
<message key="ws.followed" value="GenericWhitespace ''{0}'' is followed by whitespace."/>
<message key="ws.preceded" value="GenericWhitespace ''{0}'' is preceded with whitespace."/>
<message key="ws.illegalFollow" value="GenericWhitespace ''{0}'' should followed by whitespace."/>
</module>
<module name="MethodParamPad"/>
<module name="OperatorWrap">
<property name="option" value="NL"/>
<property name="tokens" value="BAND, BOR, BSR, BXOR, DIV, EQUAL, GE, GT, LAND, LE, LITERAL_INSTANCEOF, LOR, LT, MINUS, MOD, NOT_EQUAL, PLUS, QUESTION, SL, SR, STAR "/>
</module>
<module name="RequireThis"/>
<module name="JavadocType">
<property name="scope" value="package"/>
</module>
<module name="JavadocMethod">
<metadata name="net.sf.eclipsecs.core.comment" value="Package members"/>
<property name="accessModifiers" value="package"/>
<property name="allowMissingParamTags" value="true"/>
<property name="allowMissingReturnTag" value="true"/>
<property name="tokens" value="METHOD_DEF"/>
</module>
<module name="JavadocTagContinuationIndentation">
<property name="offset" value="5"/>
</module>
<module name="JavadocMethod">
<metadata name="net.sf.eclipsecs.core.comment" value="Public members"/>
<property name="accessModifiers" value="public"/>
<property name="allowMissingReturnTag" value="true"/>
<property name="tokens" value="METHOD_DEF"/>
</module>
<module name="NonEmptyAtclauseDescription"/>
<module name="AtclauseOrder"/>
<module name="JavadocParagraph"/>
<module name="JavadocStyle">
<property name="scope" value="public"/>
<property name="checkFirstSentence" value="false"/>
</module>
<module name="FinalClass"/>
<module name="TypecastParenPad"/>
<module name="ConstantName">
<property name="applyToProtected" value="false"/>
<property name="applyToPackage" value="false"/>
<property name="applyToPrivate" value="false"/>
</module>
<module name="MethodName"/>
<module name="UncommentedMain"/>
<module name="SuppressionCommentFilter"/>
</module>
<module name="SuppressWithPlainTextCommentFilter">
<property name="offCommentFormat" value="\*.*&lt;pre&gt;"/>
<property name="onCommentFormat" value="\*.*&lt;/pre&gt;"/>
</module>
</module>
15 changes: 12 additions & 3 deletions src/main/java/net/crypticverse/betterbiomes/block/BiomeBlocks.java
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,18 @@ public class BiomeBlocks {
// Block Families
public static final BlockFamily MAPLE_STANDING_FAMILY = BlockFamilies.familyBuilder(MAPLE_PLANKS).sign(STANDING_MAPLE_SIGN, WALL_MAPLE_SIGN).recipeGroupPrefix("wooden").recipeUnlockedBy("has_planks").getFamily();

private static Block registerBlock(String name, Block block) {registerBlockItem(name, block);return Registry.register(BuiltInRegistries.BLOCK, ResourceLocation.fromNamespaceAndPath(BetterBiomes.MOD_ID, name), block);}
private static Item registerBlockItem(String name, Block block) {return Registry.register(BuiltInRegistries.ITEM, ResourceLocation.fromNamespaceAndPath(BetterBiomes.MOD_ID, name), new BlockItem(block, new Item.Properties()));}
public static void registerModBlocks() {BetterBiomes.LOGGER.info("Registering registry objects for " + BetterBiomes.REGISTRY_ID);}
private static Block registerBlock(String name, Block block) {
registerBlockItem(name, block);
return Registry.register(BuiltInRegistries.BLOCK, ResourceLocation.fromNamespaceAndPath(BetterBiomes.MOD_ID, name), block);
}

private static Item registerBlockItem(String name, Block block) {
return Registry.register(BuiltInRegistries.ITEM, ResourceLocation.fromNamespaceAndPath(BetterBiomes.MOD_ID, name), new BlockItem(block, new Item.Properties()));
}

public static void registerModBlocks() {
BetterBiomes.LOGGER.info("Registering registry objects for " + BetterBiomes.REGISTRY_ID);
}

public static Block registerWithoutBlockItem(String name, Block block) {
return Registry.register(BuiltInRegistries.BLOCK, ResourceLocation.fromNamespaceAndPath(BetterBiomes.MOD_ID, name), block);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,7 @@ public class BetterBiomesBlockEntities {
BlockEntityType.Builder.of(MapleSyrupBoilerBlockEntity::new,
BiomeBlocks.MAPLE_SYRUP_BOILER).build());

public static void registerBlockEntities() {}
public static void registerBlockEntities() {

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* Use {@link ContainerHelper#saveAllItems(CompoundTag, NonNullList, HolderLookup.Provider)} and {@link ContainerHelper#loadAllItems(CompoundTag, NonNullList, HolderLookup.Provider)}
* on {@linkplain #getItems() the item list}.
*
* License: <a href="https://creativecommons.org/publicdomain/zero/1.0/">CC0</a>
* <p>License: <a href="https://creativecommons.org/publicdomain/zero/1.0/">CC0</a>
* @author Juuz
*/
@FunctionalInterface
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,16 +97,16 @@ public AbstractContainerMenu createMenu(int syncId, Inventory playerInventory, P
}

public void tick(Level world, BlockPos pos, BlockState state) {
if(world.isClientSide()) {
if (world.isClientSide()) {
return;
}

if(isOutputSlotEmptyOrReceivable()) {
if(this.hasRecipe()) {
if (isOutputSlotEmptyOrReceivable()) {
if (this.hasRecipe()) {
this.increaseCraftProgress();
setChanged(world, pos, state);

if(hasCraftingFinished()) {
if (hasCraftingFinished()) {
this.craftItem();
this.resetProgress();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import me.shedaniel.rei.api.client.registry.display.DisplayRegistry;
import me.shedaniel.rei.api.client.registry.screen.ScreenRegistry;
import me.shedaniel.rei.api.common.util.EntryStacks;

import net.crypticverse.betterbiomes.block.BiomeBlocks;
import net.crypticverse.betterbiomes.recipe.MapleSyrupRecipe;
import net.crypticverse.betterbiomes.screen.MapleSyrupScreen;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package net.crypticverse.betterbiomes.compat.rei;

import java.util.LinkedList;
import java.util.List;

import me.shedaniel.math.Point;
import me.shedaniel.math.Rectangle;
import me.shedaniel.rei.api.client.gui.Renderer;
Expand All @@ -9,13 +12,12 @@
import me.shedaniel.rei.api.common.category.CategoryIdentifier;
import me.shedaniel.rei.api.common.display.basic.BasicDisplay;
import me.shedaniel.rei.api.common.util.EntryStacks;
import net.crypticverse.betterbiomes.BetterBiomes;
import net.crypticverse.betterbiomes.block.BiomeBlocks;

import net.minecraft.network.chat.Component;
import net.minecraft.resources.ResourceLocation;

import java.util.LinkedList;
import java.util.List;
import net.crypticverse.betterbiomes.BetterBiomes;
import net.crypticverse.betterbiomes.block.BiomeBlocks;

public class MapleSyrupCategory implements DisplayCategory<BasicDisplay> {
public static final ResourceLocation TEXTURE =
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
package net.crypticverse.betterbiomes.compat.rei;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

import me.shedaniel.rei.api.common.category.CategoryIdentifier;
import me.shedaniel.rei.api.common.display.basic.BasicDisplay;
import me.shedaniel.rei.api.common.entry.EntryIngredient;
import me.shedaniel.rei.api.common.util.EntryIngredients;
import me.shedaniel.rei.api.common.util.EntryStacks;
import net.crypticverse.betterbiomes.recipe.MapleSyrupRecipe;

import net.minecraft.world.item.crafting.RecipeHolder;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import net.crypticverse.betterbiomes.recipe.MapleSyrupRecipe;

public class MapleSyrupDisplay extends BasicDisplay {
public MapleSyrupDisplay(List<EntryIngredient> inputs, List<EntryIngredient> outputs) {
Expand All @@ -22,7 +24,9 @@ public MapleSyrupDisplay(RecipeHolder<MapleSyrupRecipe> recipe) {
}

private static List<EntryIngredient> getInputList(MapleSyrupRecipe recipe) {
if (recipe == null) return Collections.emptyList();
if (recipe == null) {
return Collections.emptyList();
}
List<EntryIngredient> list = new ArrayList<>();
list.add(EntryIngredients.ofIngredient(recipe.getIngredients().get(0)));
return list;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ public class BetterBiomeFluids {

public static final Item PURE_BOTTLE = registerItem("pure_bottle", new BottleItem(new Item.Properties().rarity(Rarity.UNCOMMON)));

public static void register() {}
public static void register() {

}

private static FlowingFluid registerFluid(String name, FlowingFluid fluid) {
return Registry.register(BuiltInRegistries.FLUID, ResourceLocation.fromNamespaceAndPath(BetterBiomes.MOD_ID, name), fluid);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,5 +75,7 @@ public class BetterBiomesGroup {
}).build());


public static void registerItemGroups() {}
public static void registerItemGroups() {

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,7 @@ private static Item registerItem(String name, Item item) {
return Registry.register(BuiltInRegistries.ITEM, ResourceLocation.fromNamespaceAndPath(BetterBiomes.MOD_ID, name), item);
}

public static void registerMapleItems() {}
public static void registerMapleItems() {

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public record MapleSyrupRecipe(ItemStack input, ItemStack output) implements Rec

@Override
public boolean matches(CraftingInput inventory, Level world) {
if(world.isClientSide()) {
if (world.isClientSide()) {
return false;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,7 @@ public class BetterBiomesScreenHandlers {
Registry.register(BuiltInRegistries.MENU, ResourceLocation.fromNamespaceAndPath(BetterBiomes.MOD_ID, "maple_syrup"),
new ExtendedScreenHandlerType<>(MapleSyrupScreenHandler::new, MapleSyrupScreenHandler.MapleData.CODEC));

public static void registerScreenHandlers() {}
public static void registerScreenHandlers() {

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ protected void renderBg(GuiGraphics context, float delta, int mouseX, int mouseY
}

private void renderProgressArrow(GuiGraphics context, int x, int y) {
if(menu.isCrafting()) {
if (menu.isCrafting()) {
context.blit(TEXTURE, x + 85, y + 30, 176, 0, 8, menu.getScaledProgress());
}
}
Expand Down

0 comments on commit c0a17a8

Please sign in to comment.