Skip to content

Commit

Permalink
1.19.1
Browse files Browse the repository at this point in the history
  • Loading branch information
samolego committed Jul 28, 2022
1 parent dcd07e8 commit 353d526
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 21 deletions.
12 changes: 11 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ import com.modrinth.minotaur.TaskModrinthUpload
plugins {
id 'fabric-loom' version '0.12-SNAPSHOT'
id 'maven-publish'

// Quilt Mappings, for parameters and javadoc. Also hashed mojmap.
id "org.quiltmc.quilt-mappings-on-loom" version "4.2.0"

id "com.matthewprenger.cursegradle" version "1.4.0"
id "com.modrinth.minotaur" version "1.1.0"
}
Expand All @@ -28,8 +32,14 @@ repositories {
dependencies {
// To change the versions see the gradle.properties file
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings loom.officialMojangMappings()
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
mappings loom.layered {
it.addLayer(quiltMappings.mappings("org.quiltmc:quilt-mappings:${rootProject.minecraft_version}+build.${rootProject.quilt_mappings}:v2"))
// https://lambdaurora.dev/tools/import_quilt.html
it.officialMojangMappings {
setNameSyntheticMembers(false)
}
}

// Fabric API. This is technically optional, but you probably want it anyway.
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
Expand Down
17 changes: 9 additions & 8 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
# Done to increase the memory available to gradle.
org.gradle.jvmargs=-Xmx1G
# Fabric Properties
minecraft_version=1.19
yarn_mappings=1.19+build.1
loader_version=0.14.6
minecraft_version=1.19.1
yarn_mappings=1.19.1+build.1
loader_version=0.14.8
#Fabric api
fabric_version=0.55.2+1.19
fabric_version=0.58.5+1.19.1
quilt_mappings=1
# Mod Properties
mod_version=1.1.0
mod_version=1.2.0
maven_group=org.samo_lego
archives_base_name=healthcare
# Config editing lib
c2b_version=1.1.4
translations_version=1.4.14+1.19-rc2
# Dependencies
c2b_version=1.2.1
translations_version=1.4.16+1.19
1 change: 1 addition & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ pluginManagement {
name = 'Fabric'
url = 'https://maven.fabricmc.net/'
}
maven { url = "https://maven.quiltmc.org/repository/release" }
gradlePluginPortal()
}
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
package org.samo_lego.healthcare.mixin;

import io.netty.util.concurrent.Future;
import io.netty.util.concurrent.GenericFutureListener;
import net.minecraft.core.Registry;
import net.minecraft.network.Connection;
import net.minecraft.network.PacketSendListener;
import net.minecraft.network.chat.Component;
import net.minecraft.network.chat.MutableComponent;
import net.minecraft.network.protocol.Packet;
Expand All @@ -16,7 +14,6 @@
import net.minecraft.world.entity.player.Player;
import org.jetbrains.annotations.Nullable;
import org.samo_lego.healthcare.healthbar.HealthbarPreferences;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.Unique;
Expand All @@ -36,15 +33,11 @@ public abstract class ServerPlayNetworkHandlerMixin_HealthTag {
public ServerPlayer player;

@Shadow
@Final
public Connection connection;
public abstract void send(Packet<?> packet, @Nullable PacketSendListener packetSendListener);

@Unique
private boolean hc_skipCheck;

@Shadow
public abstract void send(Packet<?> packet, @Nullable GenericFutureListener<? extends Future<? super Void>> genericFutureListener);

/**
* Dummy handler used for creating modified
* packets with health.
Expand All @@ -65,14 +58,14 @@ public abstract class ServerPlayNetworkHandlerMixin_HealthTag {
* @param ci
*/
@Inject(
method = "send(Lnet/minecraft/network/protocol/Packet;Lio/netty/util/concurrent/GenericFutureListener;)V",
method = "send(Lnet/minecraft/network/protocol/Packet;Lnet/minecraft/network/PacketSendListener;)V",
at = @At(
value = "INVOKE",
target = "Lnet/minecraft/network/Connection;send(Lnet/minecraft/network/protocol/Packet;Lio/netty/util/concurrent/GenericFutureListener;)V"
target = "Lnet/minecraft/network/Connection;send(Lnet/minecraft/network/protocol/Packet;Lnet/minecraft/network/PacketSendListener;)V"
),
cancellable = true
)
private void onPacketSend(Packet<?> packet, GenericFutureListener<? extends Future<? super Void>> listener, CallbackInfo ci) {
private void onPacketSend(Packet<?> packet, PacketSendListener listener, CallbackInfo ci) {
if (packet instanceof ClientboundSetEntityDataPacket && !this.hc_skipCheck) {
int id = ((EntityTrackerUpdateS2CPacketAccessor) packet).getId();
Entity entity = this.player.getLevel().getEntity(id);
Expand Down

0 comments on commit 353d526

Please sign in to comment.