mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-19 19:59:42 +00:00
There a lot of performance improvements related to events. No more InheritableEvent for abstract events that you shouldn't add listeners to anyway, like EntityEvent. Use their sub-events. Made a lot more events records and interfaces. Mostly just a binary break, but has better performance. Mod bus posting methods are now static, no more ModLoader.get() for those. ObjectHolder was removed, use RegistryObject. Changed RuntimeEnumExtender to only target Minecraft classes. If you want other modders to interact with your API, use an Interface instead of Enum. Moved some abstract event methods to only the relevant sub-events now, e.g. can no longer check the side of a ClientTickEvent, because it'll always be client Rendering has changed a lot, they now batch most things together so that the game will render faster. RenderHighlightEvent changed a lot See https://github.com/MinecraftForge/MinecraftForge-Experimental/tree/1.21.9-dev for unsquashed commits. Co-authored-by: Paint_Ninja <[email protected]>
59 lines
2.2 KiB
Diff
59 lines
2.2 KiB
Diff
--- a/net/minecraft/client/model/HumanoidModel.java
|
|
+++ b/net/minecraft/client/model/HumanoidModel.java
|
|
@@ -290,6 +_,8 @@
|
|
case BRUSH:
|
|
this.rightArm.xRot = this.rightArm.xRot * 0.5F - (float) (Math.PI / 5);
|
|
this.rightArm.yRot = 0.0F;
|
|
+ default:
|
|
+ p_366231_.applyTransform(this, p_362371_, net.minecraft.world.entity.HumanoidArm.RIGHT);
|
|
}
|
|
}
|
|
|
|
@@ -334,6 +_,8 @@
|
|
case BRUSH:
|
|
this.leftArm.xRot = this.leftArm.xRot * 0.5F - (float) (Math.PI / 5);
|
|
this.leftArm.yRot = 0.0F;
|
|
+ default:
|
|
+ p_370002_.applyTransform(this, p_363560_, net.minecraft.world.entity.HumanoidArm.LEFT);
|
|
}
|
|
}
|
|
|
|
@@ -402,7 +_,7 @@
|
|
}
|
|
|
|
@OnlyIn(Dist.CLIENT)
|
|
- public static enum ArmPose {
|
|
+ public static enum ArmPose implements net.minecraftforge.common.IExtensibleEnum {
|
|
EMPTY(false),
|
|
ITEM(false),
|
|
BLOCK(false),
|
|
@@ -418,10 +_,28 @@
|
|
|
|
private ArmPose(final boolean p_102896_) {
|
|
this.twoHanded = p_102896_;
|
|
+ this.forgeArmPose = null;
|
|
}
|
|
|
|
public boolean isTwoHanded() {
|
|
return this.twoHanded;
|
|
+ }
|
|
+
|
|
+ @javax.annotation.Nullable
|
|
+ private final net.minecraftforge.client.IArmPoseTransformer forgeArmPose;
|
|
+
|
|
+ private ArmPose(boolean twoHanded, @javax.annotation.Nonnull net.minecraftforge.client.IArmPoseTransformer forgeArmPose) {
|
|
+ this.twoHanded = twoHanded;
|
|
+ com.google.common.base.Preconditions.checkNotNull(forgeArmPose, "Cannot create new ArmPose with null transformer!");
|
|
+ this.forgeArmPose = forgeArmPose;
|
|
+ }
|
|
+
|
|
+ public static ArmPose create(String name, boolean twoHanded, @javax.annotation.Nonnull net.minecraftforge.client.IArmPoseTransformer forgeArmPose) {
|
|
+ throw new IllegalStateException("Enum not extended");
|
|
+ }
|
|
+
|
|
+ public <T extends HumanoidRenderState> void applyTransform(HumanoidModel<T> model, T state, net.minecraft.world.entity.HumanoidArm arm) {
|
|
+ if (this.forgeArmPose != null) this.forgeArmPose.applyTransform(model, state, arm);
|
|
}
|
|
}
|
|
}
|