mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-28 07:55:53 +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]>
35 lines
1.7 KiB
Diff
35 lines
1.7 KiB
Diff
--- a/net/minecraft/client/renderer/entity/LivingEntityRenderer.java
|
|
+++ b/net/minecraft/client/renderer/entity/LivingEntityRenderer.java
|
|
@@ -73,6 +_,7 @@
|
|
}
|
|
|
|
public void submit(S p_427824_, PoseStack p_423787_, SubmitNodeCollector p_424901_, CameraRenderState p_422963_) {
|
|
+ if (net.minecraftforge.client.event.ForgeEventFactoryClient.onRenderLivingPre(p_427824_, this, p_423787_, p_424901_, p_422963_)) return;
|
|
p_423787_.pushPose();
|
|
if (p_427824_.hasPose(Pose.SLEEPING)) {
|
|
Direction direction = p_427824_.bedOrientation;
|
|
@@ -108,6 +_,7 @@
|
|
|
|
p_423787_.popPose();
|
|
super.submit(p_427824_, p_423787_, p_424901_, p_422963_);
|
|
+ net.minecraftforge.client.event.ForgeEventFactoryClient.onRenderLivingPost(p_427824_, this, p_423787_, p_424901_, p_422963_);
|
|
}
|
|
|
|
protected boolean shouldRenderLayers(S p_360804_) {
|
|
@@ -286,6 +_,7 @@
|
|
p_363057_.isFullyFrozen = p_368665_.isFullyFrozen();
|
|
p_363057_.isBaby = p_368665_.isBaby();
|
|
p_363057_.isInWater = p_368665_.isInWater();
|
|
+ p_363057_.isInWater = p_368665_.isInWaterOrSwimmable();
|
|
p_363057_.isAutoSpinAttack = p_368665_.isAutoSpinAttack();
|
|
p_363057_.hasRedOverlay = p_368665_.hurtTime > 0 || p_368665_.deathTime > 0;
|
|
ItemStack itemstack = p_368665_.getItemBySlot(EquipmentSlot.HEAD);
|
|
@@ -309,6 +_,7 @@
|
|
}
|
|
|
|
protected void extractAdditionalHitboxes(T p_392957_, Builder<HitboxRenderState> p_396936_, float p_397822_) {
|
|
+ super.extractAdditionalHitboxes(p_392957_, p_396936_, p_397822_);
|
|
AABB aabb = p_392957_.getBoundingBox();
|
|
float f = 0.01F;
|
|
HitboxRenderState hitboxrenderstate = new HitboxRenderState(
|