Skip to content

Commit

Permalink
Update formatter config to remove extraneous lines at the beginning a…
Browse files Browse the repository at this point in the history
…nd end of declarations (#543)
  • Loading branch information
Technici4n authored Jan 20, 2024
1 parent 894da78 commit 932773f
Show file tree
Hide file tree
Showing 241 changed files with 28 additions and 400 deletions.
8 changes: 4 additions & 4 deletions codeformat/formatter-config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
<setting id="org.eclipse.jdt.core.formatter.align_variable_declarations_on_columns" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body" value="-1"/>
<setting id="org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_catch_clause" value="common_lines"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference" value="insert"/>
Expand Down Expand Up @@ -99,7 +99,7 @@
<setting id="org.eclipse.jdt.core.formatter.comment.align_tags_names_descriptions" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.keep_if_then_body_block_on_one_line" value="one_line_if_empty"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration" value="-1"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line" value="false"/>
Expand Down Expand Up @@ -224,7 +224,7 @@
<setting id="org.eclipse.jdt.core.formatter.disabling_tag" value="@formatter:off"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_enum_constants" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_imports" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_end_of_method_body" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_end_of_method_body" value="-1"/>
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_if_while_statement" value="common_lines"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return" value="insert"/>
Expand Down Expand Up @@ -361,7 +361,7 @@
<setting id="org.eclipse.jdt.core.formatter.comment.format_block_comments" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_last_class_body_declaration" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_last_class_body_declaration" value="-1"/>
<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_body" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.keep_simple_while_body_on_same_line" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.wrap_before_logical_operator" value="true"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
* overrides for {@link CommandSourceStack} so that the methods will run successfully client side
*/
public class ClientCommandSourceStack extends CommandSourceStack {

public ClientCommandSourceStack(CommandSource source, Vec3 position, Vec2 rotation, int permission, String plainTextName, Component displayName,
Entity executing) {
super(source, position, rotation, null, permission, plainTextName, displayName, null, executing);
Expand Down Expand Up @@ -134,5 +133,4 @@ public MinecraftServer getServer() {
public ServerLevel getLevel() {
throw new UnsupportedOperationException("Attempted to get server level in client command");
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
* Manager for custom {@link ColorResolver} instances, collected via {@link RegisterColorHandlersEvent.ColorResolvers}.
*/
public final class ColorResolverManager {

private static ImmutableList<ColorResolver> colorResolvers;

@ApiStatus.Internal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
*/
@FunctionalInterface
public interface IArmPoseTransformer {

/**
* This method should be used to apply all wanted transformations to the player when the ArmPose is active.
* You can use {@link LivingEntity#getTicksUsingItem()} and {@link LivingEntity#getUseItemRemainingTicks()} for moving animations.
Expand All @@ -29,5 +28,4 @@ public interface IArmPoseTransformer {
* @param arm Arm to pose
*/
void applyTransform(HumanoidModel<?> model, LivingEntity entity, HumanoidArm arm);

}
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
* be the same as {@code entity}.
*/
public record RenderTypeGroup(RenderType block, RenderType entity, RenderType entityFabulous) {

public static RenderTypeGroup EMPTY = new RenderTypeGroup(null, null, null);

public RenderTypeGroup {
if ((block == null) != (entity == null) || (block == null) != (entityFabulous == null))
throw new IllegalArgumentException("The render types in a group must either be all null, or all non-null.");
Expand All @@ -26,6 +23,8 @@ public RenderTypeGroup(RenderType block, RenderType entity) {
this(block, entity, entity);
}

public static RenderTypeGroup EMPTY = new RenderTypeGroup(null, null, null);

/**
* {@return true if this group has render types or not. It either has all, or none}
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
* only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
*/
public class CalculatePlayerTurnEvent extends Event {

private double mouseSensitivity;
private boolean cinematicCameraEnabled;

Expand Down Expand Up @@ -63,5 +62,4 @@ public boolean getCinematicCameraEnabled() {
public void setCinematicCameraEnabled(boolean cinematicCameraEnabled) {
this.cinematicCameraEnabled = cinematicCameraEnabled;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,5 @@ public ColorResolvers(ImmutableList.Builder<ColorResolver> builder) {
public void register(ColorResolver resolver) {
this.builder.add(resolver);
}

}

}
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
* <p>This event is fired on the mod-specific event bus, only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
*/
public class RegisterItemDecorationsEvent extends Event implements IModBusEvent {

private final Map<Item, List<IItemDecorator>> decorators;

@ApiStatus.Internal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,5 +82,4 @@ public <T extends ParticleOptions> void registerSprite(ParticleType<T> type, Par
public <T extends ParticleOptions> void registerSpriteSet(ParticleType<T> type, ParticleEngine.SpriteParticleRegistration<T> registration) {
particleEngine.register(type, registration);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
* Extension interface for {@link AbstractWidget}.
*/
public interface IAbstractWidgetExtension {

private AbstractWidget self() {
return (AbstractWidget) this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
* Extension type for the {@link net.minecraft.world.MenuProvider} interface.
*/
public interface IMenuProviderExtension {

/**
* {@return {@code true} if the existing container should be closed on the client side when opening a new one, {@code false} otherwise}
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,5 @@ public void render(GuiGraphics guiGraphics, int entryIdx, int top, int left, fin
}
}
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,6 @@ private void updateCache() {
if (logo != null) {

return Pair.of(tm.register("modlogo", new DynamicTexture(logo) {

@Override
public void upload() {
this.bind();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

@OnlyIn(Dist.CLIENT)
public class TitleScreenModUpdateIndicator extends Screen {

private static final ResourceLocation VERSION_CHECK_ICONS = new ResourceLocation(NeoForgeVersion.MOD_ID, "textures/gui/version_check_icons.png");

private final Button modButton;
Expand Down Expand Up @@ -62,5 +61,4 @@ public static TitleScreenModUpdateIndicator init(TitleScreen guiMainMenu, Button
titleScreenModUpdateIndicator.init();
return titleScreenModUpdateIndicator;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,6 @@ public BakedModel build() {
return new Baked(isGui3d, isSideLit, isAmbientOcclusion, particle, transforms, overrides, childrenBuilder.build(), itemPassesBuilder.build());
}
}

}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ public record ExtraFaceData(int color, int blockLight, int skyLight, boolean amb
Codec.intRange(0, 15).optionalFieldOf("sky_light", 0).forGetter(ExtraFaceData::skyLight),
Codec.BOOL.optionalFieldOf("ambient_occlusion", true).forGetter(ExtraFaceData::ambientOcclusion))
.apply(builder, ExtraFaceData::new));

/**
* Parses an ExtraFaceData from JSON
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
* @see IQuadTransformer
*/
public final class QuadTransformers {

private static final IQuadTransformer EMPTY = quad -> {};
private static final IQuadTransformer[] EMISSIVE_TRANSFORMERS = Util.make(new IQuadTransformer[16], array -> {
Arrays.setAll(array, i -> applyingLightmap(LightTexture.pack(i, i)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
* boilerplate constructor parameters.
*/
public abstract class BlockModelProvider extends ModelProvider<BlockModelBuilder> {

public BlockModelProvider(PackOutput output, String modid, ExistingFileHelper existingFileHelper) {
super(output, modid, BLOCK_FOLDER, BlockModelBuilder::new, existingFileHelper);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@
* blockstates and their referenced models can be provided in tandem.
*/
public abstract class BlockStateProvider implements DataProvider {

private static final Logger LOGGER = LogManager.getLogger();
private static final Gson GSON = (new GsonBuilder()).setPrettyPrinting().disableHtmlEscaping().create();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
* {@link #builder()}.
*/
public final class ConfiguredModel {

/**
* The default random weight of configured models, used by convenience
* overloads.
Expand Down Expand Up @@ -171,7 +170,6 @@ static Builder<MultiPartBlockStateBuilder.PartBuilder> builder(MultiPartBlockSta
* will be returned upon completion.
*/
public static class Builder<T> {

private ModelFile model;
@Nullable
private final Function<ConfiguredModel[], T> callback;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
* {@link #override()}.
*/
public class ItemModelBuilder extends ModelBuilder<ItemModelBuilder> {

private static final List<ResourceKey<TrimMaterial>> VANILLA_TRIM_MATERIALS = List.of(TrimMaterials.QUARTZ, TrimMaterials.IRON, TrimMaterials.NETHERITE, TrimMaterials.REDSTONE, TrimMaterials.COPPER, TrimMaterials.GOLD, TrimMaterials.EMERALD, TrimMaterials.DIAMOND, TrimMaterials.LAPIS, TrimMaterials.AMETHYST);
protected List<OverrideBuilder> overrides = new ArrayList<>();

Expand Down Expand Up @@ -68,7 +67,6 @@ public JsonObject toJson() {
}

public class OverrideBuilder {

private ModelFile model;
private final Map<ResourceLocation, Float> predicates = new LinkedHashMap<>();

Expand Down Expand Up @@ -96,5 +94,4 @@ JsonObject toJson() {
return ret;
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
* boilerplate constructor parameters.
*/
public abstract class ItemModelProvider extends ModelProvider<ItemModelBuilder> {

public ItemModelProvider(PackOutput output, String modid, ExistingFileHelper existingFileHelper) {
super(output, modid, ITEM_FOLDER, ItemModelBuilder::new, existingFileHelper);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
* @param <T> Self type, for simpler chaining of methods.
*/
public class ModelBuilder<T extends ModelBuilder<T>> extends ModelFile {

@Nullable
protected ModelFile parent;
protected final Map<String, String> textures = new LinkedHashMap<>();
Expand Down Expand Up @@ -389,7 +388,6 @@ private Number serializeFloat(float f) {
}

public class ElementBuilder {

private Vector3f from = new Vector3f();
private Vector3f to = new Vector3f(16, 16, 16);
private final Map<Direction, FaceBuilder> faces = new LinkedHashMap<>();
Expand Down Expand Up @@ -583,7 +581,6 @@ public T end() {
}

public class FaceBuilder {

private Direction cullface;
private int tintindex = -1;
private String texture = MissingTextureAtlasSprite.getLocation().toString();
Expand Down Expand Up @@ -687,7 +684,6 @@ public ElementBuilder end() {
}

public class RotationBuilder {

private Vector3f origin;
private Direction.Axis axis;
private float angle;
Expand Down Expand Up @@ -751,7 +747,6 @@ private FaceRotation(int rotation) {
}

public class TransformsBuilder {

private final Map<ItemDisplayContext, TransformVecBuilder> transforms = new LinkedHashMap<>();

/**
Expand All @@ -778,7 +773,6 @@ public T end() {
}

public class TransformVecBuilder {

private Vector3f rotation = new Vector3f(ItemTransform.Deserializer.DEFAULT_ROTATION);
private Vector3f translation = new Vector3f(ItemTransform.Deserializer.DEFAULT_TRANSLATION);
private Vector3f scale = new Vector3f(ItemTransform.Deserializer.DEFAULT_SCALE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import net.neoforged.neoforge.common.data.ExistingFileHelper;

public abstract class ModelFile {

protected ResourceLocation location;

protected ModelFile(ResourceLocation location) {
Expand Down Expand Up @@ -38,7 +37,6 @@ public ResourceLocation getUncheckedLocation() {
}

public static class UncheckedModelFile extends ModelFile {

public UncheckedModelFile(String location) {
this(new ResourceLocation(location));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import org.jetbrains.annotations.VisibleForTesting;

public abstract class ModelProvider<T extends ModelBuilder<T>> implements DataProvider {

public static final String BLOCK_FOLDER = "block";
public static final String ITEM_FOLDER = "item";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import net.minecraft.world.level.block.state.properties.Property;

public final class MultiPartBlockStateBuilder implements IGeneratedBlockState {

private final List<PartBuilder> parts = new ArrayList<>();
private final Block owner;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
* @see BlockStateProvider
*/
public class VariantBlockStateBuilder implements IGeneratedBlockState {

private final Block owner;
private final Map<PartialBlockstate, ConfiguredModelList> models = new LinkedHashMap<>();
private final Set<BlockState> coveredStates = new HashSet<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@ public interface IUnbakedGeometry<T extends IUnbakedGeometry<T>> {
* {@link IUnbakedGeometry#bake(IGeometryBakingContext, ModelBaker, Function, ModelState, ItemOverrides, ResourceLocation)}
* via {@link BlockModel#resolveParents(Function)}
*/
default void resolveParents(Function<ResourceLocation, UnbakedModel> modelGetter, IGeometryBakingContext context) {

}
default void resolveParents(Function<ResourceLocation, UnbakedModel> modelGetter, IGeometryBakingContext context) {}

/**
* {@return a set of all the components whose visibility may be configured via {@link IGeometryBakingContext}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,4 @@ public VertexConsumer normal(float x, float y, float z) {
vec.normalize();
return super.normal(vec.x(), vec.y(), vec.z());
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ public record Context(@Nullable BlockState state, Direction[] faces, RandomSourc

private static final Direction[] ALL_FACES_AND_NULL = Arrays.copyOf(Direction.values(), Direction.values().length + 1);
private static final Vector4f WHITE = new Vector4f(1, 1, 1, 1);

public Context(ModelData data) {
this(null, ALL_FACES_AND_NULL, RandomSource.create(), 42, data, WHITE);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
*/
@ApiStatus.Internal
public final class DebuggingHelper {

private DebuggingHelper() {
throw new IllegalStateException("Tried to create utility class!");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
* This class contains everything needed to make a MerchantOffer, the actual "trade" object shown in trading guis.
*/
public class BasicItemListing implements ItemListing {

protected final ItemStack price;
protected final ItemStack price2;
protected final ItemStack forSale;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,5 +231,4 @@ private static void addTabOrder(CreativeModeTab tab, ResourceLocation name) {
edges.put(before, name);
}
}

}
Loading

0 comments on commit 932773f

Please sign in to comment.