Skip to content

Commit

Permalink
Remove all spotless comments
Browse files Browse the repository at this point in the history
  • Loading branch information
tr7zw committed Dec 26, 2024
1 parent f76ee9d commit f621e8e
Show file tree
Hide file tree
Showing 16 changed files with 1 addition and 75 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,4 @@ src/main/resources/pack.mcmeta
src/main/java/dev/tr7zw/util/ModLoaderUtil.java
src/main/java/dev/tr7zw/util/NMSHelper.java
src/main/neoforge-resources/META-INF/neoforge.mods.toml
/src/main/java/dev/tr7zw/util
2 changes: 0 additions & 2 deletions src/main/java/dev/tr7zw/skinlayers/SkinLayersMod.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package dev.tr7zw.skinlayers;

//spotless:off
//#if FABRIC
import net.fabricmc.api.ClientModInitializer;

Expand All @@ -19,6 +18,5 @@ public void onInitializeClient() {
//$$ ModLoaderUtil.registerClientSetupListener(this::onInitialize);
//$$ }
//#endif
//spotless:on

}
4 changes: 0 additions & 4 deletions src/main/java/dev/tr7zw/skinlayers/SkinUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ private static NativeImage getSkinTexture(AbstractClientPlayer player) {

private static NativeImage getTexture(ResourceLocation resourceLocation, SkullSettings settings) {
try {
// spotless:off
//#if MC >= 11900
Optional<Resource> optionalRes = Minecraft.getInstance().getResourceManager().getResource(resourceLocation);
if (optionalRes.isPresent()) {
Expand All @@ -55,7 +54,6 @@ private static NativeImage getTexture(ResourceLocation resourceLocation, SkullSe
//$$ Resource resource = Minecraft.getInstance().getResourceManager().getResource(resourceLocation);
//$$ NativeImage skin = NativeImage.read(resource.getInputStream());
//#endif
// spotless:on
return skin;
}
AbstractTexture texture = Minecraft.getInstance().getTextureManager().getTexture(resourceLocation);
Expand Down Expand Up @@ -116,13 +114,11 @@ private static NativeImage getTexture(ResourceLocation resourceLocation, SkullSe
}

private static void checkAllocation(NativeImage image) throws Exception {
// spotless:off
//#if MC >= 12102
image.getLuminanceOrAlpha(0,0); // check that it's allocated
//#else
//$$ image.getPixelRGBA(0, 0); // check that it's allocated
//#endif
//spotless:on
}

public static boolean setup3dLayers(AbstractClientPlayer abstractClientPlayerEntity, PlayerSettings settings,
Expand Down
6 changes: 0 additions & 6 deletions src/main/java/dev/tr7zw/skinlayers/api/Mesh.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@
import com.mojang.blaze3d.vertex.VertexConsumer;

import net.minecraft.client.model.geom.ModelPart;
// spotless:off
//#if MC >= 11700
import net.minecraft.client.model.geom.PartPose;
//#endif
//spotless:on

public interface Mesh {

Expand All @@ -32,13 +30,11 @@ public void render(ModelPart vanillaModel, PoseStack poseStack, VertexConsumer v
}

@Override
// spotless:off
//#if MC >= 11700
public void loadPose(PartPose partPose) {
//#else
//$$ public void loadPose(ModelPart partPose) {
//#endif
//spotless:on
}

@Override
Expand Down Expand Up @@ -82,13 +78,11 @@ public default void render(ModelPart vanillaModel, PoseStack poseStack, VertexCo

public void setRotation(float xRot, float yRot, float zRot);

// spotless:off
//#if MC >= 11700
public void loadPose(PartPose partPose);
//#else
//$$ public void loadPose(ModelPart partPose);
//#endif
//spotless:on

public void copyFrom(ModelPart modelPart);

Expand Down
2 changes: 0 additions & 2 deletions src/main/java/dev/tr7zw/skinlayers/api/MeshTransformer.java
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
package dev.tr7zw.skinlayers.api;

//spotless:off
//#if MC >= 11903
import org.joml.Vector3f;
import org.joml.Vector4f;
//#else
//$$ import com.mojang.math.Vector3f;
//$$ import com.mojang.math.Vector4f;
//#endif
//spotless:on

import net.minecraft.client.model.geom.ModelPart.Cube;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import dev.tr7zw.skinlayers.versionless.config.Config;
import net.minecraft.client.gui.GuiGraphics;
import net.minecraft.client.gui.screens.Screen;
//spotless:off
//#if MC <= 11904
//$$ import net.minecraft.client.gui.screens.inventory.InventoryScreen;
//$$ import com.mojang.blaze3d.vertex.PoseStack;
Expand All @@ -21,7 +20,6 @@
//#else
//$$ import net.minecraft.client.Option;
//#endif
//spotless:on

public class ConfigScreenProvider {

Expand Down Expand Up @@ -77,13 +75,11 @@ public void initialize() {
() -> (double) config.firstPersonPixelScaling, (i) -> {
config.firstPersonPixelScaling = i.floatValue();
}));
// spotless:off
//#if MC >= 11900
getOptions().addSmall(options.toArray(new OptionInstance[0]));
//#else
//$$getOptions().addSmall(options.toArray(new Option[0]));
//#endif
// spotless:on
}

@Override
Expand All @@ -93,15 +89,13 @@ public void save() {
}

@Override
// spotless:off
//#if MC >= 12001
public void render(GuiGraphics guiGraphics, int xMouse, int yMouse, float f) {
super.render(guiGraphics, xMouse, yMouse, f);
//#else
//$$ public void render(PoseStack poseStack, int xMouse, int yMouse, float f) {
//$$ super.render(poseStack, xMouse, yMouse, f);
//#endif
// spotless:on
if (this.minecraft.level != null) {
int x = minecraft.getWindow().getGuiScaledWidth() / 2;
int y = minecraft.getWindow().getGuiScaledHeight() - 45;
Expand All @@ -110,7 +104,6 @@ public void render(GuiGraphics guiGraphics, int xMouse, int yMouse, float f) {
float lookY = y - 80 - yMouse;
// Prevent the model from clipping into the back of the gui^^
lookY = Math.min(lookY, 10);
// spotless:off
//#if MC >= 12001
PreviewHelper.renderEntityInInventoryFollowsMouse(guiGraphics, x, y, size, lookX, lookY,
this.minecraft.player);
Expand All @@ -121,7 +114,6 @@ public void render(GuiGraphics guiGraphics, int xMouse, int yMouse, float f) {
//$$ InventoryScreen.renderEntityInInventory(x, y, size, lookX, lookY,
//$$ this.minecraft.player);
//#endif
// spotless:on
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
@Mixin(CustomHeadLayer.class)
public class CustomHeadLayerMixin<T extends LivingEntity, M extends EntityModel & HeadedModel> {

// spotless:off
//#if MC >= 12102
@SuppressWarnings("resource")
@Inject(method = "render", at = @At("HEAD"))
Expand Down Expand Up @@ -77,7 +76,6 @@ public void render(PoseStack poseStack, MultiBufferSource multiBufferSource, int
//$$ setupHeadRendering(livingEntity.getItemBySlot(net.minecraft.world.entity.EquipmentSlot.HEAD));
//$$ }
//#endif
//spotless:on

//#if MC < 12104
//$$private void setupHeadRendering(ItemStack itemStack) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
@Mixin(EMFModelPart.class)
public abstract class EMFModelPartMixin implements ModelPartInjector {

// spotless:off
//#if MC >= 12100
@Inject(method = "render(Lcom/mojang/blaze3d/vertex/PoseStack;Lcom/mojang/blaze3d/vertex/VertexConsumer;III)V", at = @At(value = "HEAD"), cancellable = true)
public void render(PoseStack poseStack, VertexConsumer vertexConsumer, int light, int overlay, int color,
Expand Down Expand Up @@ -46,7 +45,6 @@ public void render(PoseStack poseStack, VertexConsumer vertexConsumer, int light
//$$ }
//$$
//#endif
// spotless:on

}
//#else
Expand Down
2 changes: 0 additions & 2 deletions src/main/java/dev/tr7zw/skinlayers/mixin/ModelPartMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ public class ModelPartMixin implements ModelPartInjector {
@Getter
private OffsetProvider offsetProvider = null;

// spotless:off
//#if MC >= 12100
@Inject(method = "Lnet/minecraft/client/model/geom/ModelPart;render(Lcom/mojang/blaze3d/vertex/PoseStack;Lcom/mojang/blaze3d/vertex/VertexConsumer;III)V", at = @At(value = "HEAD"), cancellable = true)
public void render(PoseStack poseStack, VertexConsumer vertexConsumer, int light, int overlay, int color,
Expand Down Expand Up @@ -56,7 +55,6 @@ public void render(PoseStack poseStack, VertexConsumer vertexConsumer, int light
//$$ }
//$$
//#endif
// spotless:on

@Override
public void setInjectedMesh(Mesh mesh, OffsetProvider offsetProvider) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
@Mixin(PlayerModel.class)
public class PlayerModelMixin<T extends LivingEntity> extends HumanoidModel implements PlayerEntityModelAccessor {

// spotless:off
//#if MC >= 11700
public PlayerModelMixin(ModelPart modelPart) {
super(modelPart);
Expand All @@ -22,7 +21,6 @@ public PlayerModelMixin(ModelPart modelPart) {
//$$ super(f);
//$$ }
//#endif
//spotless:on

@Shadow
private boolean slim;
Expand Down
10 changes: 0 additions & 10 deletions src/main/java/dev/tr7zw/skinlayers/mixin/PlayerRendererMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import net.minecraft.client.player.AbstractClientPlayer;
import net.minecraft.client.renderer.MultiBufferSource;

// spotless:off
//#if MC >= 12102
import net.minecraft.client.renderer.entity.state.PlayerRenderState;
//#else
Expand All @@ -33,7 +32,6 @@
//#else
//$$ import net.minecraft.client.renderer.entity.EntityRenderDispatcher;
//#endif
// spotless:on
import net.minecraft.client.renderer.entity.LivingEntityRenderer;
import net.minecraft.client.renderer.entity.player.PlayerRenderer;
import net.minecraft.resources.ResourceLocation;
Expand All @@ -43,17 +41,14 @@

@Mixin(PlayerRenderer.class)
public abstract class PlayerRendererMixin
// spotless:off
//#if MC >= 12102
extends LivingEntityRenderer<AbstractClientPlayer, PlayerRenderState, PlayerModel> {
//#else
//$$ extends LivingEntityRenderer<AbstractClientPlayer, PlayerModel<AbstractClientPlayer>> {
//#endif
// spotless:on

private boolean setupFirstpersonArms = false;

// spotless:off
//#if MC >= 11700
public PlayerRendererMixin(Context context, PlayerModel entityModel, float f) {
super(context, entityModel, f);
Expand All @@ -65,9 +60,7 @@ public PlayerRendererMixin(Context context, PlayerModel entityModel, float f) {
//$$ // TODO Auto-generated constructor stub
//$$ }
//#endif
// spotless:on

// spotless:off
//#if MC >= 12102
@Inject(method = "extractRenderState", at = @At("RETURN"))
public void extractRenderState(AbstractClientPlayer abstractClientPlayer, PlayerRenderState playerRenderState,
Expand Down Expand Up @@ -193,10 +186,8 @@ public void extractRenderState(AbstractClientPlayer abstractClientPlayer, Player
//$$ }
//$$ }
//#endif
// spotless:on

@Inject(method = "renderHand", at = @At("HEAD"))
// spotless:off
//#if MC >= 12102
private void renderHandStart(PoseStack poseStack, MultiBufferSource multiBufferSource, int i,
ResourceLocation resourceLocation, ModelPart arm, boolean bl, CallbackInfo info) {
Expand All @@ -212,7 +203,6 @@ private void renderHandStart(PoseStack poseStack, MultiBufferSource multiBufferS
//$$ private void renderHandStart(PoseStack poseStack, MultiBufferSource multiBufferSource, int i,
//$$ AbstractClientPlayer abstractClientPlayer, ModelPart arm, ModelPart sleeve, CallbackInfo info) {
//#endif
// spotless:on
PlayerSettings settings = (PlayerSettings) abstractClientPlayer;
boolean slim = ((PlayerEntityModelAccessor) getModel()).hasThinArms();
((ModelPartInjector) (Object) sleeve).setInjectedMesh(null, null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.level.block.entity.SkullBlockEntity;
import net.minecraft.world.phys.Vec3;
// spotless:off
//#if MC >= 11700
import net.minecraft.client.model.SkullModelBase;
//#else
Expand All @@ -37,12 +36,10 @@
//$$ import org.spongepowered.asm.mixin.Shadow;
//$$ import java.util.Map;
//#endif
// spotless:on

@Mixin(SkullBlockRenderer.class)
public class SkullBlockEntityRendererMixin {

// spotless:off
//#if MC <= 11605
//$$ @Shadow
//$$ private static Map<net.minecraft.world.level.block.SkullBlock.Type, SkullModel> MODEL_BY_TYPE;
Expand All @@ -63,7 +60,6 @@ public void render(SkullBlockEntity skullBlockEntity, float f, PoseStack poseSta
* SkinLayersModBase.config.renderDistanceLOD) {
lastSkull = (SkullSettings) skullBlockEntity;
GameProfile gameProfile = null;
// spotless:off
//#if MC <= 12004
//$$ gameProfile = skullBlockEntity.getOwnerProfile();
//#else
Expand Down Expand Up @@ -96,7 +92,6 @@ private double internalDistToCenterSqr(BlockPos pos, double d, double e, double
}

@Inject(method = "renderSkull", at = @At("HEAD"))
// spotless:off
//#if MC >= 11700
private static void renderSkull(Direction direction, float f, float g, PoseStack poseStack,
MultiBufferSource multiBufferSource, int i, SkullModelBase skullModelBase, RenderType renderType,
Expand Down Expand Up @@ -135,15 +130,13 @@ private static void renderSkull(Direction direction, float f, float g, PoseStack
poseStack.scale(voxelSize, voxelSize, voxelSize);
mesh.setPosition(0, -0.25f, 0);
mesh.setRotation(0, f * 0.017453292F, 0);
// spotless:off
//#if MC <= 11605
//$$ lastSkull.getHeadLayers().render(poseStack, multiBufferSource.getBuffer(getRenderType(type, gameProfile)), i,
//$$ OverlayTexture.NO_OVERLAY);
//#else
lastSkull.getHeadLayers().render(poseStack, multiBufferSource.getBuffer(renderType), i,
OverlayTexture.NO_OVERLAY);
//#endif
//spotless:on
poseStack.popPose();
renderNext = false;
lastSkull = null;
Expand Down
5 changes: 0 additions & 5 deletions src/main/java/dev/tr7zw/skinlayers/mixin/SkullModelMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,24 @@
import net.minecraft.client.model.SkullModel;
import net.minecraft.client.model.geom.ModelPart;

// spotless:off
//#if MC >= 11700
@Mixin(SkullModel.class)
//#else
//$$ import net.minecraft.client.model.HumanoidHeadModel;
//$$
//$$ @Mixin(HumanoidHeadModel.class)
//#endif
//spotless:on
public class SkullModelMixin implements SkullModelAccessor {

@Shadow
// spotless:off
//#if MC >= 11700
private ModelPart head;
//#else
//$$ private ModelPart hat;
//#endif
//spotless:on

@Override
public void showHat(boolean val) {
// spotless:off
//#if MC >= 11700
head.getAllParts().forEach(part -> {
if (part != head) { // is the hat, not the head
Expand Down
Loading

0 comments on commit f621e8e

Please sign in to comment.