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 f24b733 commit 41d6e20
Show file tree
Hide file tree
Showing 18 changed files with 1 addition and 56 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,4 @@ src/main/java/dev/tr7zw/notenoughanimations/NEAnimationsMod.java
src/main/java/dev/tr7zw/util/NMSHelper.java
src/main/java/dev/tr7zw/util/ModLoaderUtil.java
src/main/neoforge-resources/META-INF/neoforge.mods.toml
/src/main/java/dev/tr7zw/util
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package dev.tr7zw.notenoughanimations;

//spotless:off
//#if FABRIC
import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,11 @@ public boolean isEnabled() {

@Override
public boolean isValid(AbstractClientPlayer entity, PlayerData data) {
// spotless:off
//#if MC >= 11700
if (!entity.isFallFlying() && !entity.onGround() && !entity.onClimbable() && !entity.getAbilities().flying
//#else
//$$ if (!entity.isFallFlying() && !entity.isOnGround() && !entity.onClimbable() && !entity.abilities.flying
//#endif
//spotless:on
&& !entity.isSwimming()) {
FallingData fallData = data.getData(this, () -> new FallingData(entity.getY()));
if (entity instanceof LocalPlayer) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,11 @@ public boolean isEnabled() {

@Override
public boolean isValid(AbstractClientPlayer entity, PlayerData data) {
// spotless:off
//#if MC >= 11800
return entity.canFreeze() && entity.level().getBlockStatesIfLoaded(entity.getBoundingBox().deflate(1.0E-6D))
//#else
//$$ return entity.canFreeze() && entity.level.getBlockStatesIfLoaded(entity.getBoundingBox().deflate(1.0E-6D))
//#endif
//spotless:on
.anyMatch(blockState -> (blockState.is(Blocks.POWDER_SNOW)
|| blockState.is(Blocks.POWDER_SNOW_CAULDRON)));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,11 @@ public boolean isValid(AbstractClientPlayer entity, PlayerData data) {
if (entity.onClimbable() && !entity.onGround() && entity.getLastClimbablePos().isPresent()) {
for (Class<? extends Block> blocktype : ladderLikeBlocks) {
if (blocktype.isAssignableFrom(
// spotless:off
//#if MC >= 11800
entity.level().getBlockState(entity.getLastClimbablePos().get()).getBlock().getClass()))
//#else
//$$ entity.level.getBlockState(entity.getLastClimbablePos().get()).getBlock().getClass()))
//#endif
//spotless:on

return true;
}
Expand Down Expand Up @@ -87,13 +85,11 @@ public void apply(AbstractClientPlayer entity, PlayerData data, PlayerModel mode
}
if (part == BodyPart.BODY) {
if (NEABaseMod.config.enableRotateToLadder) {
// spotless:off
//#if MC >= 12005
BlockState blockState = entity.getInBlockState();
//#else
//$$ BlockState blockState = entity.getFeetBlockState();
//#endif
//spotless:on
if (blockState.hasProperty(HorizontalDirectionalBlock.FACING)) {
Direction dir = blockState.getValue(HorizontalDirectionalBlock.FACING);
data.setDisableBodyRotation(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,11 @@ public void apply(AbstractClientPlayer entity, PlayerData data, PlayerModel mode
AbstractHorse horse = (AbstractHorse) entity.getVehicle();
int id = horse.getPassengers().indexOf(entity);
if (id == 0) {
// spotless:off
//#if MC >= 11904
float rotation = -Mth.cos(horse.walkAnimation.position() * 0.3f);
//#else
//$$ float rotation = -Mth.cos(horse.animationPosition * 0.3f);
//#endif
//spotless:on
rotation *= 0.1;
AnimationUtil.applyArmTransforms(model, arm, -1.1f - rotation, -0.2f, 0.3f);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,11 @@ public boolean isEnabled() {

private ArmPose rightArmPose;
private ArmPose leftArmPose;
// spotless:off
//#if MC >= 11700
private final EnumSet<ArmPose> singleHandedAnimatios = EnumSet.of(ArmPose.SPYGLASS, ArmPose.THROW_SPEAR);
//#else
//$$ private final EnumSet<ArmPose> singleHandedAnimatios = EnumSet.of(ArmPose.THROW_SPEAR);
//#endif
//spotless:on
private final BodyPart[] left = new BodyPart[] { BodyPart.LEFT_ARM, BodyPart.BODY };
private final BodyPart[] right = new BodyPart[] { BodyPart.RIGHT_ARM, BodyPart.BODY };

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,11 @@
import dev.tr7zw.notenoughanimations.versionless.animations.HoldUpTarget;
import dev.tr7zw.notenoughanimations.versionless.config.Config;
import net.minecraft.client.gui.screens.Screen;
//spotless:off
//#if MC >= 11900
import net.minecraft.client.OptionInstance;
//#else
//$$ import net.minecraft.client.Option;
//#endif
//spotless:on

public class ConfigScreenProvider {

Expand Down Expand Up @@ -110,13 +108,11 @@ public void initialize() {
options.add(getOnOffOption("text.nea.enable.burningAnimation", () -> config.burningAnimation,
b -> config.burningAnimation = b));

// spotless:off
//#if MC >= 11900
getOptions().addSmall(options.toArray(new OptionInstance[0]));
//#else
//$$getOptions().addSmall(options.toArray(new Option[0]));
//#endif
// spotless:on

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,9 @@
import dev.tr7zw.notenoughanimations.versionless.animations.BodyPart;
import net.minecraft.client.model.PlayerModel;
import net.minecraft.client.player.AbstractClientPlayer;
// spotless:off
//#if MC >= 11700
import dev.tr7zw.notenoughanimations.animations.fullbody.FreezingAnimation;
//#endif
//spotless:on

public class AnimationProvider {

Expand Down Expand Up @@ -115,11 +113,9 @@ private void loadAnimations() {
addAnimation(new CustomBowAnimation());
addAnimation(new ActionRotationLockAnimation());
addAnimation(new BurningAnimation());
// spotless:off
//#if MC >= 11700
addAnimation(new FreezingAnimation());
//#endif
//spotless:on
}

public void addAnimation(BasicAnimation animation) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,9 @@
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
// spotless:off
//#if MC >= 11700
import net.minecraft.client.model.geom.ModelLayers;
//#endif
//spotless:on

public class HeldItemHandler {

Expand All @@ -63,7 +61,6 @@ public class HeldItemHandler {
public void onRenderItem(LivingEntity entity, EntityModel<?> model, ItemStack itemStack, HumanoidArm arm,
PoseStack matrices, MultiBufferSource vertexConsumers, int light, CallbackInfo info) {
if (bookModel == null) {
// spotless:off
//#if MC >= 11700
bookModel = new BookModel(Minecraft.getInstance().getEntityModels().bakeLayer(ModelLayers.BOOK));
//#else
Expand Down Expand Up @@ -195,13 +192,11 @@ private void renderBook(LivingEntity entity, float delta, ItemStack itemStack, H
//$$vertexConsumer = EnchantTableRenderer.BOOK_LOCATION.buffer(vertexConsumers, RenderType::entitySolid, glow);
//#endif
}
// spotless:off
//#if MC >= 12100
bookModel.renderToBuffer(matrices, vertexConsumer, light, OverlayTexture.NO_OVERLAY, Integer.MAX_VALUE);
//#else
//$$ bookModel.render(matrices, vertexConsumer, light, OverlayTexture.NO_OVERLAY, 1.0F, 1.0F, 1.0F, 1.0F);
//#endif
//spotless:on
matrices.popPose();
if (item == writtenBook) {
matrices.pushPose();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import net.minecraft.world.entity.HumanoidArm;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.item.ItemStack;
// spotless:off
//#if MC >= 12104
import net.minecraft.client.renderer.item.ItemStackRenderState;
import dev.tr7zw.notenoughanimations.access.ExtendedItemStackRenderState;
Expand All @@ -33,7 +32,6 @@
//#else
//$$ import net.minecraft.client.renderer.block.model.ItemTransforms.TransformType;
//#endif
//spotless:on

@Mixin(ItemInHandLayer.class)
//#if MC >= 12102
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import net.minecraft.client.renderer.LevelRenderer;
import net.minecraft.client.renderer.LightTexture;

//spotless:off
//#if MC >= 12100
import net.minecraft.client.DeltaTracker;
//#if MC >= 12102
Expand All @@ -26,13 +25,11 @@
//#else
//$$ import com.mojang.math.Matrix4f;
//#endif
//spotless:on

@Mixin(LevelRenderer.class)
public class LevelRendererMixin {

@Inject(method = "renderLevel", at = @At("HEAD"))
// spotless:off
//#if MC <= 12004
//$$ private void beforeRender(PoseStack matrices, float tickDelta, long limitTime, boolean renderBlockOutline,
//$$ Camera camera, GameRenderer gameRenderer, LightTexture lightmapTextureManager, Matrix4f matrix4f, CallbackInfo ci) {
Expand All @@ -54,7 +51,6 @@ private void beforeRender(GraphicsResourceAllocator graphicsResourceAllocator, D
Matrix4f matrix4f2, CallbackInfo ci) {
float tickDelta = deltaTracker.getGameTimeDeltaPartialTick(false);
//#endif
//spotless:on
NEAnimationsLoader.INSTANCE.playerTransformer.setDeltaTick(tickDelta);
// NEAnimationsLoader.INSTANCE.playerTransformer.nextFrame();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ public abstract class PlayerEntityModelMixin extends HumanoidModel<PlayerRenderS
//#endif

public PlayerEntityModelMixin() {
// spotless:off
//#if MC >= 11700
super(null);
//#else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

import net.minecraft.client.renderer.entity.LivingEntityRenderer;
import net.minecraft.client.renderer.entity.player.PlayerRenderer;
// spotless:off
//#if MC >= 12102
import net.minecraft.client.renderer.entity.state.PlayerRenderState;
//#endif
Expand All @@ -22,7 +21,6 @@
//#else
//$$ import net.minecraft.client.renderer.entity.EntityRenderDispatcher;
//#endif
//spotless:on

@Mixin(PlayerRenderer.class)
//#if MC >= 12102
Expand All @@ -33,7 +31,6 @@ public abstract class PlayerRendererMixin
//$$ extends LivingEntityRenderer<AbstractClientPlayer, PlayerModel<AbstractClientPlayer>> {
//#endif

// spotless:off
//#if MC >= 12102
public PlayerRendererMixin(Context context, PlayerModel model, float shadowRadius) {
super(context, model, shadowRadius);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,20 @@
import net.minecraft.world.entity.HumanoidArm;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.Item;
//spotless:off
//#if MC >= 11904
import net.minecraft.world.item.ItemDisplayContext;
//#else
//$$ import net.minecraft.client.renderer.block.model.ItemTransforms;
//#endif
//spotless:on
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.Items;

//spotless:off
//#if MC >= 12102
import net.minecraft.client.renderer.entity.state.PlayerRenderState;
public class SwordRenderLayer extends RenderLayer<PlayerRenderState, PlayerModel> {
//#else
//$$public class SwordRenderLayer extends RenderLayer<AbstractClientPlayer, PlayerModel<AbstractClientPlayer>> {
//#endif
//spotless:on

//#if MC >= 12102
public SwordRenderLayer(RenderLayerParent<PlayerRenderState, PlayerModel> renderer) {
Expand Down Expand Up @@ -64,7 +60,6 @@ public static void update(Player player) {
}

@Override
// spotless:off
//#if MC >= 12102
public void render(PoseStack poseStack, MultiBufferSource multiBufferSource, int light,
PlayerRenderState entityRenderState, float f, float g) {
Expand All @@ -78,7 +73,6 @@ public void render(PoseStack poseStack, MultiBufferSource multiBufferSource, int
//$$ AbstractClientPlayer player, float paramFloat1, float paramFloat2, float paramFloat3, float paramFloat4,
//$$ float paramFloat5, float paramFloat6) {
//#endif
//spotless:on
if (disabled) {
return;
}
Expand Down Expand Up @@ -121,7 +115,6 @@ public void render(PoseStack poseStack, MultiBufferSource multiBufferSource, int
poseStack.mulPose(NMSHelper.XP.rotationDegrees(swordRotation));
poseStack.mulPose(NMSHelper.YP.rotationDegrees(180.0F));

// spotless:off
//#if MC >= 11904
Minecraft.getInstance().getEntityRenderDispatcher().getItemInHandRenderer().renderItem(player, itemStack,
lefthanded ? ItemDisplayContext.THIRD_PERSON_RIGHT_HAND : ItemDisplayContext.THIRD_PERSON_LEFT_HAND,
Expand All @@ -133,7 +126,6 @@ public void render(PoseStack poseStack, MultiBufferSource multiBufferSource, int
//$$ Minecraft.getInstance().getItemInHandRenderer().renderItem(player, itemStack, lefthanded ? ItemTransforms.TransformType.THIRD_PERSON_RIGHT_HAND : ItemTransforms.TransformType.THIRD_PERSON_LEFT_HAND, lefthanded,
//$$ poseStack, multiBufferSource, light);
//#endif
//spotless:on
poseStack.popPose();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,11 @@ public static ArmPose getArmPose(AbstractClientPlayer abstractClientPlayerEntity
return ArmPose.THROW_SPEAR;
}

// spotless:off
//#if MC >= 11700
if (useAction == ItemUseAnimation.SPYGLASS) {
return ArmPose.SPYGLASS;
}
//#endif
//spotless:on

if (useAction == ItemUseAnimation.CROSSBOW
&& hand.equals(abstractClientPlayerEntity.getUsedItemHand())) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,11 @@
import net.minecraft.world.item.MapItem;
import net.minecraft.world.level.saveddata.maps.MapItemSavedData;

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

public class MapRenderer {

Expand Down Expand Up @@ -54,13 +52,11 @@ public static void renderFirstPersonMap(PoseStack matrices, MultiBufferSource ve

matrices.scale(0.0138125f, 0.0138125f, 0.0138125f);
}
// spotless:off
//#if MC <= 12004
//$$ Integer mapid = MapItem.getMapId(stack);
//#else
net.minecraft.world.level.saveddata.maps.MapId mapid = stack.get(net.minecraft.core.component.DataComponents.MAP_ID);
//#endif
//spotless:on
MapItemSavedData mapState = MapItem.getSavedData(stack, client.level);
com.mojang.blaze3d.vertex.VertexConsumer vertexConsumer = vertexConsumers
.getBuffer(mapState == null ? MAP_BACKGROUND : MAP_BACKGROUND_CHECKERBOARD);
Expand All @@ -77,7 +73,6 @@ public static void renderFirstPersonMap(PoseStack matrices, MultiBufferSource ve
addVertex(vertexConsumer, matrix4f, -7.0f, 135.0f, 0.0f, 0, 1, light);

if (mapState != null) {
// spotless:off
//#if MC >= 12102
net.minecraft.client.renderer.state.MapRenderState mapRenderState = new net.minecraft.client.renderer.state.MapRenderState();
client.getMapRenderer().extractRenderState(mapid, mapState, mapRenderState);
Expand All @@ -87,20 +82,17 @@ public static void renderFirstPersonMap(PoseStack matrices, MultiBufferSource ve
//#else
//$$ client.gameRenderer.getMapRenderer().render(matrices, vertexConsumers, mapState, false, light);
//#endif
//spotless:on
}
}

public static void addVertex(VertexConsumer cons, Matrix4f matrix4f, float x, float y, float z, float u, float v,
int lightmapUV) {
// spotless:off
//#if MC >= 12100
cons.addVertex(matrix4f, x, y, z).setColor(-1).setUv(u, v).setLight(lightmapUV);
//#else
//$$ cons.vertex(matrix4f, x, y, z).color(255, 255, 255, 255).uv(u, v).uv2(lightmapUV)
//$$ .endVertex();
//#endif
//spotless:on
}

}
Loading

0 comments on commit 41d6e20

Please sign in to comment.