Skip to content

Commit 4e3bc7c

Browse files
committed
1.19.3
1 parent 353d526 commit 4e3bc7c

File tree

5 files changed

+23
-55
lines changed

5 files changed

+23
-55
lines changed

build.gradle

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import com.modrinth.minotaur.TaskModrinthUpload
22

33
plugins {
4-
id 'fabric-loom' version '0.12-SNAPSHOT'
4+
id 'fabric-loom' version '1.0-SNAPSHOT'
55
id 'maven-publish'
66

77
// Quilt Mappings, for parameters and javadoc. Also hashed mojmap.
@@ -11,8 +11,8 @@ plugins {
1111
id "com.modrinth.minotaur" version "1.1.0"
1212
}
1313

14-
sourceCompatibility = JavaVersion.VERSION_16
15-
targetCompatibility = JavaVersion.VERSION_16
14+
sourceCompatibility = JavaVersion.VERSION_17
15+
targetCompatibility = JavaVersion.VERSION_17
1616

1717
archivesBaseName = project.archives_base_name
1818
version = project.mod_version
@@ -21,7 +21,7 @@ group = project.maven_group
2121
def ENV = System.getenv()
2222

2323
repositories {
24-
maven { url 'https://jitpack.io'}
24+
maven { url 'https://jitpack.io' }
2525
maven { url "https://maven.architectury.dev/" }
2626
maven { url 'https://maven.nucleoid.xyz' }
2727
maven {
@@ -34,7 +34,7 @@ dependencies {
3434
minecraft "com.mojang:minecraft:${project.minecraft_version}"
3535
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
3636
mappings loom.layered {
37-
it.addLayer(quiltMappings.mappings("org.quiltmc:quilt-mappings:${rootProject.minecraft_version}+build.${rootProject.quilt_mappings}:v2"))
37+
//it.addLayer(quiltMappings.mappings("org.quiltmc:quilt-mappings:${rootProject.minecraft_version}+build.${rootProject.quilt_mappings}:v2"))
3838
// https://lambdaurora.dev/tools/import_quilt.html
3939
it.officialMojangMappings {
4040
setNameSyntheticMembers(false)

gradle.properties

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
# Done to increase the memory available to gradle.
22
org.gradle.jvmargs=-Xmx1G
33
# Fabric Properties
4-
minecraft_version=1.19.1
5-
yarn_mappings=1.19.1+build.1
6-
loader_version=0.14.8
4+
minecraft_version=1.19.3
5+
yarn_mappings=1.19.3+build.3
6+
loader_version=0.14.11
77
#Fabric api
8-
fabric_version=0.58.5+1.19.1
8+
fabric_version=0.69.1+1.19.3
99
quilt_mappings=1
1010
# Mod Properties
11-
mod_version=1.2.0
11+
mod_version=1.2.1
1212
maven_group=org.samo_lego
1313
archives_base_name=healthcare
1414
# Dependencies
1515
c2b_version=1.2.1
16-
translations_version=1.4.16+1.19
16+
translations_version=1.4.19+1.19.3

src/main/java/org/samo_lego/healthcare/mixin/EntityTrackerUpdateS2CPacketAccessor.java

Lines changed: 0 additions & 27 deletions
This file was deleted.

src/main/java/org/samo_lego/healthcare/mixin/ServerPlayNetworkHandlerMixin_HealthTag.java

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package org.samo_lego.healthcare.mixin;
22

3-
import net.minecraft.core.Registry;
3+
import net.minecraft.core.registries.BuiltInRegistries;
44
import net.minecraft.network.PacketSendListener;
55
import net.minecraft.network.chat.Component;
66
import net.minecraft.network.chat.MutableComponent;
@@ -65,33 +65,33 @@ public abstract class ServerPlayNetworkHandlerMixin_HealthTag {
6565
),
6666
cancellable = true
6767
)
68-
private void onPacketSend(Packet<?> packet, PacketSendListener listener, CallbackInfo ci) {
69-
if (packet instanceof ClientboundSetEntityDataPacket && !this.hc_skipCheck) {
70-
int id = ((EntityTrackerUpdateS2CPacketAccessor) packet).getId();
68+
private void onPacketSend(Packet<?> sendPacket, PacketSendListener listener, CallbackInfo ci) {
69+
if (sendPacket instanceof ClientboundSetEntityDataPacket packet && !this.hc_skipCheck) {
70+
int id = packet.id();
7171
Entity entity = this.player.getLevel().getEntity(id);
7272
final var hb = ((HealthbarPreferences) this.player).healthcarePrefs();
7373

7474
if (entity instanceof LivingEntity living &&
7575
hb.enabled &&
7676
!(entity instanceof Player) &&
77-
!config.blacklistedEntities.contains(Registry.ENTITY_TYPE.getKey(entity.getType()).toString()) &&
77+
!config.blacklistedEntities.contains(BuiltInRegistries.ENTITY_TYPE.getKey(entity.getType()).toString()) &&
7878
!entity.isInvisibleTo(player)) {
7979

80-
var trackedValues = new ArrayList<>(((EntityTrackerUpdateS2CPacketAccessor) packet).getPackedItems());
80+
var trackedValues = new ArrayList<>(packet.packedItems());
8181

8282
// Removing current custom name
83-
var customName = trackedValues.stream().filter(value -> value.getAccessor().getId() == 2).findFirst();
83+
var customName = trackedValues.stream().filter(value -> value.id() == 2).findFirst();
8484

8585
// Ensure name is visible only if mob is not too far away
8686
boolean visible = (entity.distanceTo(player) < config.activationRange || entity.isCustomNameVisible()) && hb.alwaysVisible;
87-
var visibleTag = new SynchedEntityData.DataItem<>(EntityAccessor.getNAME_VISIBLE(), visible);
87+
var visibleTag = SynchedEntityData.DataValue.create(EntityAccessor.getNAME_VISIBLE(), visible);
8888

8989
float health = living.getHealth();
9090
float maxHealth = living.getMaxHealth();
9191

9292
MutableComponent name = Component.empty();
93-
if (customName.isPresent() && ((Optional<Component>) customName.get().getValue()).isPresent()) {
94-
name = ((Optional<Component>) customName.get().getValue()).get().copy().append(" ");
93+
if (customName.isPresent() && ((Optional<Component>) customName.get().value()).isPresent()) {
94+
name = ((Optional<Component>) customName.get().value()).get().copy().append(" ");
9595
} else if (entity.hasCustomName()) {
9696
// @SpaceClouds42 saved me here, `.copy()` after getting custom name is essential!
9797
name = entity.getCustomName().copy().append(" ");
@@ -100,17 +100,13 @@ private void onPacketSend(Packet<?> packet, PacketSendListener listener, Callbac
100100
}
101101

102102
var healthbar = ((HealthbarPreferences) this.player).createHealthbarText(health, maxHealth);
103-
var healthTag = new SynchedEntityData.DataItem<>(EntityAccessor.getCUSTOM_NAME(), Optional.of(name.append(healthbar)));
103+
var healthTag = SynchedEntityData.DataValue.create(EntityAccessor.getCUSTOM_NAME(), Optional.of(name.append(healthbar)));
104104

105105
Collections.addAll(trackedValues, visibleTag, healthTag);
106106

107107
// Create a new packet in order to not mess with other network handlers
108108
// since same packet object is sent to every player
109-
var trackerUpdatePacket = new ClientboundSetEntityDataPacket(id, this.hc_dummyTracker, false);
110-
var accessor = (EntityTrackerUpdateS2CPacketAccessor) trackerUpdatePacket;
111-
112-
accessor.setId(id);
113-
accessor.setPackedItems(trackedValues);
109+
var trackerUpdatePacket = new ClientboundSetEntityDataPacket(id, trackedValues);
114110

115111
this.hc_skipCheck = true;
116112
this.send(trackerUpdatePacket, listener);

src/main/resources/healthcare.mixins.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
"compatibilityLevel": "JAVA_8",
66
"mixins": [
77
"EntityAccessor",
8-
"EntityTrackerUpdateS2CPacketAccessor",
98
"PlayerEntityMixinCast_Preferences",
109
"ServerPlayNetworkHandlerMixin_HealthTag"
1110
],

0 commit comments

Comments
 (0)