diff --git a/coreLib/src/main/java/dev/kosmx/playerAnim/core/impl/AnimationProcessor.java b/coreLib/src/main/java/dev/kosmx/playerAnim/core/impl/AnimationProcessor.java index d2dda80..c77ba8f 100644 --- a/coreLib/src/main/java/dev/kosmx/playerAnim/core/impl/AnimationProcessor.java +++ b/coreLib/src/main/java/dev/kosmx/playerAnim/core/impl/AnimationProcessor.java @@ -5,11 +5,13 @@ import dev.kosmx.playerAnim.api.layered.IAnimation; import dev.kosmx.playerAnim.core.util.Pair; import dev.kosmx.playerAnim.core.util.Vec3f; +import org.jetbrains.annotations.ApiStatus; /** * Tool to easily play animation to the player. * internal, do not use */ +@ApiStatus.Internal public class AnimationProcessor { private final IAnimation animation; private float tickDelta = 0f; diff --git a/gradle.properties b/gradle.properties index c437f20..275915a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,7 +5,7 @@ enabled_platforms=fabric,forge archives_base_name=player-animation-lib #Major: API break, Minor: non-breaking but significant, Patch: minor bugfix/change + MC implementation fix -mod_version=0.4.0-test1 +mod_version=0.4.0-test2 maven_group=dev.kosmx.player-anim diff --git a/minecraft/common/src/main/java/dev/kosmx/playerAnim/impl/Helper.java b/minecraft/common/src/main/java/dev/kosmx/playerAnim/impl/Helper.java index a1fba25..01d415e 100644 --- a/minecraft/common/src/main/java/dev/kosmx/playerAnim/impl/Helper.java +++ b/minecraft/common/src/main/java/dev/kosmx/playerAnim/impl/Helper.java @@ -1,6 +1,7 @@ package dev.kosmx.playerAnim.impl; import dev.architectury.injectables.annotations.ExpectPlatform; +import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.Nullable; import java.util.concurrent.atomic.AtomicBoolean; @@ -8,6 +9,7 @@ /** * Helper Utility class */ +@ApiStatus.Internal public final class Helper { @Nullable diff --git a/minecraft/common/src/main/java/dev/kosmx/playerAnim/impl/IAnimatedPlayer.java b/minecraft/common/src/main/java/dev/kosmx/playerAnim/impl/IAnimatedPlayer.java index fd144ae..ce6d9c9 100644 --- a/minecraft/common/src/main/java/dev/kosmx/playerAnim/impl/IAnimatedPlayer.java +++ b/minecraft/common/src/main/java/dev/kosmx/playerAnim/impl/IAnimatedPlayer.java @@ -2,7 +2,10 @@ import dev.kosmx.playerAnim.api.IPlayer; import dev.kosmx.playerAnim.impl.animation.AnimationApplier; +import org.jetbrains.annotations.ApiStatus; + +@ApiStatus.Internal public interface IAnimatedPlayer extends IPlayer { AnimationApplier getAnimation(); } diff --git a/minecraft/common/src/main/java/dev/kosmx/playerAnim/impl/IMutableModel.java b/minecraft/common/src/main/java/dev/kosmx/playerAnim/impl/IMutableModel.java index 297c9ea..3f9fe82 100644 --- a/minecraft/common/src/main/java/dev/kosmx/playerAnim/impl/IMutableModel.java +++ b/minecraft/common/src/main/java/dev/kosmx/playerAnim/impl/IMutableModel.java @@ -2,7 +2,9 @@ import dev.kosmx.playerAnim.core.impl.AnimationProcessor; import dev.kosmx.playerAnim.core.util.SetableSupplier; +import org.jetbrains.annotations.ApiStatus; +@ApiStatus.Internal public interface IMutableModel { void setEmoteSupplier(SetableSupplier emoteSupplier); diff --git a/minecraft/common/src/main/java/dev/kosmx/playerAnim/impl/IPlayerModel.java b/minecraft/common/src/main/java/dev/kosmx/playerAnim/impl/IPlayerModel.java index d21e8e2..2497e41 100644 --- a/minecraft/common/src/main/java/dev/kosmx/playerAnim/impl/IPlayerModel.java +++ b/minecraft/common/src/main/java/dev/kosmx/playerAnim/impl/IPlayerModel.java @@ -1,5 +1,8 @@ package dev.kosmx.playerAnim.impl; +import org.jetbrains.annotations.ApiStatus; + +@ApiStatus.Internal public interface IPlayerModel { void playerAnimator_prepForFirstPersonRender(); } diff --git a/minecraft/common/src/main/java/dev/kosmx/playerAnim/impl/IUpperPartHelper.java b/minecraft/common/src/main/java/dev/kosmx/playerAnim/impl/IUpperPartHelper.java index f1bd770..2811d19 100644 --- a/minecraft/common/src/main/java/dev/kosmx/playerAnim/impl/IUpperPartHelper.java +++ b/minecraft/common/src/main/java/dev/kosmx/playerAnim/impl/IUpperPartHelper.java @@ -1,5 +1,8 @@ package dev.kosmx.playerAnim.impl; +import org.jetbrains.annotations.ApiStatus; + +@ApiStatus.Internal public interface IUpperPartHelper { boolean isUpperPart(); diff --git a/minecraft/common/src/main/java/dev/kosmx/playerAnim/impl/animation/AnimationApplier.java b/minecraft/common/src/main/java/dev/kosmx/playerAnim/impl/animation/AnimationApplier.java index 63a8952..cd88f3f 100644 --- a/minecraft/common/src/main/java/dev/kosmx/playerAnim/impl/animation/AnimationApplier.java +++ b/minecraft/common/src/main/java/dev/kosmx/playerAnim/impl/animation/AnimationApplier.java @@ -7,7 +7,9 @@ import dev.kosmx.playerAnim.core.util.Pair; import dev.kosmx.playerAnim.core.util.Vec3f; import net.minecraft.client.model.geom.ModelPart; +import org.jetbrains.annotations.ApiStatus; +@ApiStatus.Internal public class AnimationApplier extends AnimationProcessor { public AnimationApplier(IAnimation animation) { super(animation); diff --git a/minecraft/common/src/main/java/dev/kosmx/playerAnim/impl/animation/BendHelper.java b/minecraft/common/src/main/java/dev/kosmx/playerAnim/impl/animation/BendHelper.java index 9f6b44d..18729cf 100644 --- a/minecraft/common/src/main/java/dev/kosmx/playerAnim/impl/animation/BendHelper.java +++ b/minecraft/common/src/main/java/dev/kosmx/playerAnim/impl/animation/BendHelper.java @@ -6,8 +6,10 @@ import net.minecraft.client.model.geom.ModelPart; import net.minecraft.core.Direction; +import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.Nullable; +@ApiStatus.Internal public class BendHelper implements IBendHelper { diff --git a/minecraft/common/src/main/java/dev/kosmx/playerAnim/impl/animation/IBendHelper.java b/minecraft/common/src/main/java/dev/kosmx/playerAnim/impl/animation/IBendHelper.java index ce96f4e..a3b8424 100644 --- a/minecraft/common/src/main/java/dev/kosmx/playerAnim/impl/animation/IBendHelper.java +++ b/minecraft/common/src/main/java/dev/kosmx/playerAnim/impl/animation/IBendHelper.java @@ -7,8 +7,10 @@ import net.minecraft.client.model.geom.ModelPart; import net.minecraft.core.Direction; +import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.Nullable; +@ApiStatus.Internal public interface IBendHelper { IBendHelper INSTANCE = Helper.isBendEnabled() ? new BendHelper() : new DummyBendable(); diff --git a/minecraft/common/src/main/java/dev/kosmx/playerAnim/minecraftApi/PlayerAnimationAccess.java b/minecraft/common/src/main/java/dev/kosmx/playerAnim/minecraftApi/PlayerAnimationAccess.java index 603c14f..225556d 100644 --- a/minecraft/common/src/main/java/dev/kosmx/playerAnim/minecraftApi/PlayerAnimationAccess.java +++ b/minecraft/common/src/main/java/dev/kosmx/playerAnim/minecraftApi/PlayerAnimationAccess.java @@ -3,8 +3,11 @@ import dev.kosmx.playerAnim.api.IPlayer; import dev.kosmx.playerAnim.api.layered.AnimationStack; import dev.kosmx.playerAnim.core.impl.event.Event; +import net.fabricmc.api.EnvType; +import net.fabricmc.api.Environment; import net.minecraft.client.player.AbstractClientPlayer; +@Environment(EnvType.CLIENT) public final class PlayerAnimationAccess { /** diff --git a/minecraft/common/src/main/java/dev/kosmx/playerAnim/minecraftApi/PlayerAnimationRegistry.java b/minecraft/common/src/main/java/dev/kosmx/playerAnim/minecraftApi/PlayerAnimationRegistry.java index 802439f..32aea03 100644 --- a/minecraft/common/src/main/java/dev/kosmx/playerAnim/minecraftApi/PlayerAnimationRegistry.java +++ b/minecraft/common/src/main/java/dev/kosmx/playerAnim/minecraftApi/PlayerAnimationRegistry.java @@ -2,6 +2,8 @@ import dev.kosmx.playerAnim.core.data.KeyframeAnimation; import dev.kosmx.playerAnim.core.data.gson.AnimationSerializing; +import net.fabricmc.api.EnvType; +import net.fabricmc.api.Environment; import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; import net.minecraft.server.packs.resources.ResourceManager; @@ -35,6 +37,7 @@ *

* Extra animations can be added by ResourcePack(s) or other mods */ +@Environment(EnvType.CLIENT) public final class PlayerAnimationRegistry { private static final HashMap animations = new HashMap<>(); diff --git a/minecraft/fabric/src/main/java/dev/kosmx/playerAnim/impl/FabricCommonInitializer.java b/minecraft/fabric/src/main/java/dev/kosmx/playerAnim/impl/FabricCommonInitializer.java deleted file mode 100644 index 971e1ee..0000000 --- a/minecraft/fabric/src/main/java/dev/kosmx/playerAnim/impl/FabricCommonInitializer.java +++ /dev/null @@ -1,10 +0,0 @@ -package dev.kosmx.playerAnim.impl; - -import net.fabricmc.api.ModInitializer; - -public class FabricCommonInitializer implements ModInitializer { - @Override - public void onInitialize() { - //Hello world! this is not even registered to init - } -} diff --git a/minecraft/fabric/src/main/java/dev/kosmx/playerAnim/impl/client/FabricClientInitializer.java b/minecraft/fabric/src/main/java/dev/kosmx/playerAnim/impl/client/FabricClientInitializer.java index 13616ac..9d4415c 100644 --- a/minecraft/fabric/src/main/java/dev/kosmx/playerAnim/impl/client/FabricClientInitializer.java +++ b/minecraft/fabric/src/main/java/dev/kosmx/playerAnim/impl/client/FabricClientInitializer.java @@ -7,10 +7,12 @@ import net.minecraft.resources.ResourceLocation; import net.minecraft.server.packs.PackType; import net.minecraft.server.packs.resources.ResourceManager; +import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.NotNull; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +@ApiStatus.Internal public class FabricClientInitializer implements ClientModInitializer { public static final Logger LOGGER = LoggerFactory.getLogger("player-animator"); diff --git a/minecraft/fabric/src/main/java/dev/kosmx/playerAnim/impl/fabric/HelperImpl.java b/minecraft/fabric/src/main/java/dev/kosmx/playerAnim/impl/fabric/HelperImpl.java index 93c62b1..586deea 100644 --- a/minecraft/fabric/src/main/java/dev/kosmx/playerAnim/impl/fabric/HelperImpl.java +++ b/minecraft/fabric/src/main/java/dev/kosmx/playerAnim/impl/fabric/HelperImpl.java @@ -1,7 +1,9 @@ package dev.kosmx.playerAnim.impl.fabric; import net.fabricmc.loader.api.FabricLoader; +import org.jetbrains.annotations.ApiStatus; +@ApiStatus.Internal public class HelperImpl { public static boolean isBendyLibPresent() { return FabricLoader.getInstance().isModLoaded("bendy-lib"); diff --git a/minecraft/fabric/src/main/java/dev/kosmx/playerAnim/impl/fabric/PreLaunchEntry.java b/minecraft/fabric/src/main/java/dev/kosmx/playerAnim/impl/fabric/PreLaunchEntry.java index 70f9159..4ca618e 100644 --- a/minecraft/fabric/src/main/java/dev/kosmx/playerAnim/impl/fabric/PreLaunchEntry.java +++ b/minecraft/fabric/src/main/java/dev/kosmx/playerAnim/impl/fabric/PreLaunchEntry.java @@ -2,8 +2,10 @@ import dev.kosmx.playerAnim.impl.Helper; import net.fabricmc.loader.api.entrypoint.PreLaunchEntrypoint; +import org.jetbrains.annotations.ApiStatus; import org.spongepowered.asm.mixin.Mixins; +@ApiStatus.Internal public class PreLaunchEntry implements PreLaunchEntrypoint { @Override public void onPreLaunch() { diff --git a/minecraft/fabric/src/testmod/resources/assets/testmod/player_animation/player.animation.json b/minecraft/fabric/src/testmod/resources/assets/testmod/player_animation/player.animation.json new file mode 100644 index 0000000..cdd20cb --- /dev/null +++ b/minecraft/fabric/src/testmod/resources/assets/testmod/player_animation/player.animation.json @@ -0,0 +1,19 @@ +{ + "format_version": "1.8.0", + "animations": { + "animation.model.rodHand": { + "loop": true, + "bones": { + "right_arm": { + "rotation": { + "vector": [-70, 0, 0] + }, + "position": { + "vector": [0, -2, -1] + } + } + } + } + }, + "geckolib_format_version": 2 +} \ No newline at end of file