-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #28 from KosmX/port_1.18
Backport fixes to 1.18
- Loading branch information
Showing
34 changed files
with
269 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
minecraft/common/src/main/java/dev/kosmx/playerAnim/impl/Helper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
minecraft/common/src/main/java/dev/kosmx/playerAnim/impl/IPlayerModel.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
package dev.kosmx.playerAnim.impl; | ||
|
||
import org.jetbrains.annotations.ApiStatus; | ||
|
||
@ApiStatus.Internal | ||
public interface IPlayerModel { | ||
void playerAnimator_prepForFirstPersonRender(); | ||
} |
3 changes: 3 additions & 0 deletions
3
minecraft/common/src/main/java/dev/kosmx/playerAnim/impl/IUpperPartHelper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
...mmon/src/main/java/dev/kosmx/playerAnim/impl/compat/skinLayers/SkinLayersTransformer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package dev.kosmx.playerAnim.impl.compat.skinLayers; | ||
|
||
import dev.kosmx.playerAnim.impl.IAnimatedPlayer; | ||
import dev.kosmx.playerAnim.impl.IUpperPartHelper; | ||
import dev.kosmx.playerAnim.impl.animation.IBendHelper; | ||
import dev.tr7zw.skinlayers.api.LayerFeatureTransformerAPI; | ||
import org.jetbrains.annotations.ApiStatus; | ||
import org.slf4j.Logger; | ||
|
||
@ApiStatus.Internal | ||
public class SkinLayersTransformer { | ||
|
||
public static void init(Logger logger) { | ||
logger.info("Loading 3D skin compat"); | ||
|
||
LayerFeatureTransformerAPI.setLayerTransformer((player, matrixStack, modelPart) -> { | ||
if (((IUpperPartHelper)modelPart).isUpperPart()) { | ||
IBendHelper.rotateMatrixStack(matrixStack, ((IAnimatedPlayer) player).getAnimation().getBend("body")); | ||
} | ||
}); | ||
} | ||
} |
52 changes: 52 additions & 0 deletions
52
minecraft/common/src/main/java/dev/kosmx/playerAnim/impl/mixin/MixinConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
package dev.kosmx.playerAnim.impl.mixin; | ||
|
||
import dev.kosmx.playerAnim.impl.Helper; | ||
import org.jetbrains.annotations.ApiStatus; | ||
import org.objectweb.asm.tree.ClassNode; | ||
import org.spongepowered.asm.mixin.extensibility.IMixinConfigPlugin; | ||
import org.spongepowered.asm.mixin.extensibility.IMixinInfo; | ||
|
||
import java.util.List; | ||
import java.util.Set; | ||
|
||
@ApiStatus.Internal | ||
public class MixinConfig implements IMixinConfigPlugin { | ||
|
||
@Override | ||
public void onLoad(String mixinPackage) { | ||
|
||
} | ||
|
||
@Override | ||
public String getRefMapperConfig() { | ||
return null; | ||
} | ||
|
||
@Override | ||
public boolean shouldApplyMixin(String targetClassName, String mixinClassName) { | ||
if (mixinClassName.endsWith("bendOnly") && !Helper.isBendEnabled()) { | ||
return false; | ||
} | ||
return true; | ||
} | ||
|
||
@Override | ||
public void acceptTargets(Set<String> myTargets, Set<String> otherTargets) { | ||
|
||
} | ||
|
||
@Override | ||
public List<String> getMixins() { | ||
return null; | ||
} | ||
|
||
@Override | ||
public void preApply(String targetClassName, ClassNode targetClass, String mixinClassName, IMixinInfo mixinInfo) { | ||
|
||
} | ||
|
||
@Override | ||
public void postApply(String targetClassName, ClassNode targetClass, String mixinClassName, IMixinInfo mixinInfo) { | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 18 additions & 3 deletions
21
minecraft/common/src/main/java/dev/kosmx/playerAnim/mixin/FeatureRendererMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,34 @@ | ||
package dev.kosmx.playerAnim.mixin; | ||
|
||
import dev.kosmx.playerAnim.impl.IUpperPartHelper; | ||
import net.minecraft.client.renderer.entity.RenderLayerParent; | ||
import net.minecraft.client.renderer.entity.layers.RenderLayer; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Unique; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
|
||
@Mixin(RenderLayer.class) | ||
public class FeatureRendererMixin implements IUpperPartHelper { | ||
private boolean Emotecraft_isUpperPart = true; | ||
@Unique | ||
private boolean isUpperPart = true; | ||
|
||
|
||
@Inject(method = "<init>", at = @At("RETURN")) | ||
private void init(RenderLayerParent renderLayerParent, CallbackInfo ci) { | ||
if (this.getClass().getPackageName().contains("skinlayers") && !this.getClass().getSimpleName().toLowerCase().contains("head")) { | ||
isUpperPart = false; | ||
} | ||
} | ||
|
||
@Override | ||
public boolean isUpperPart() { | ||
return this.Emotecraft_isUpperPart; | ||
return this.isUpperPart; | ||
} | ||
|
||
@Override | ||
public void setUpperPart(boolean bl) { | ||
this.Emotecraft_isUpperPart = bl; | ||
this.isUpperPart = bl; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.