Updated Fabric API

This commit is contained in:
FlorianMichael 2024-01-14 04:32:35 +01:00
parent 751090cdfd
commit 88a1376881
No known key found for this signature in database
GPG Key ID: C2FB87E71C425126
2 changed files with 11 additions and 5 deletions

View File

@ -6,7 +6,7 @@ org.gradle.parallel=true
minecraft_version=1.20.4
yarn_mappings=1.20.4+build.3
loader_version=0.15.3
fabric_api_version=0.91.3+1.20.4
fabric_api_version=0.93.1+1.20.4
# Project Details
mod_version=3.0.6-SNAPSHOT
@ -18,11 +18,12 @@ viaversion_version=4.10.0-23w51b-SNAPSHOT
viabackwards_version=4.10.0-23w51b-SNAPSHOT
vialegacy_version=2.2.22-SNAPSHOT
viaaprilfools_version=2.0.11-SNAPSHOT
viabedrock_version=0.0.4-SNAPSHOT
vialoader_version=2.2.13-SNAPSHOT
# RaphiMC Libraries
minecraftauth_version=3.1.0
viabedrock_version=0.0.4-SNAPSHOT
raknet_transport_version=1.0.0.CR1-SNAPSHOT
# Lenni0451 Libraries

View File

@ -38,9 +38,14 @@ public abstract class MixinMetadataRewriter1_15To1_14_4 extends EntityRewriter<C
@Redirect(method = "registerRewrites", at = @At(value = "INVOKE", target = "Lcom/viaversion/viaversion/rewriter/meta/MetaFilter$Builder;removeIndex(I)V"))
private void trackHealth(MetaFilter.Builder instance, int index) {
instance.index(18).handler((event, meta) -> {
instance.handler((event, meta) -> { // Basically removeIndex, but we need to track the actual health value
final int metaIndex = event.index();
if (metaIndex == index) {
WolfHealthTracker.get(event.user()).setWolfHealth(event.entityId(), meta.value());
event.cancel();
} else if (metaIndex > index) {
event.setIndex(metaIndex - 1);
}
});
}