fix 1.19.4 incompatibility
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Dieser Commit ist enthalten in:
Finn 2023-03-24 18:31:21 +01:00
Ursprung 39d5d25b9f
Commit 27bab62132
3 geänderte Dateien mit 11 neuen und 16 gelöschten Zeilen

Datei anzeigen

@ -1,5 +1,5 @@
plugins {
id 'fabric-loom' version '0.10-SNAPSHOT'
id 'fabric-loom' version '1.1-SNAPSHOT'
id 'maven-publish'
}
@ -7,24 +7,14 @@ version = project.mod_version
group = project.maven_group
repositories {
// Add repositories to retrieve artifacts from in here.
// You should only use this when depending on other mods because
// Loom adds the essential maven repositories to download Minecraft and libraries from automatically.
// See https://docs.gradle.org/current/userguide/declaring_repositories.html
// for more information about repositories.
mavenCentral()
}
dependencies {
// To change the versions see the gradle.properties file
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
implementation 'org.json:json:20180130'
// PSA: Some older mods, compiled on Loom 0.2.1, might have outdated Maven POMs.
// You may need to force-disable transitiveness on them.
}
processResources {

Datei anzeigen

@ -4,7 +4,7 @@ org.gradle.jvmargs=-Xmx1G
# check these on https://modmuss50.me/fabric.html
minecraft_version=1.15.2
yarn_mappings=1.15.2+build.17
loader_version=0.12.12
loader_version=0.14.18
# Mod Properties
mod_version=1.0
maven_group=de.steamwar.modsender

Datei anzeigen

@ -18,7 +18,9 @@ package de.steamwar.modsender.mixin;
import de.steamwar.modsender.ModSender;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.network.AbstractClientPlayerEntity;
import net.minecraft.client.network.ClientPlayerEntity;
import net.minecraft.client.world.ClientWorld;
import net.minecraft.entity.Entity;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
@ -27,10 +29,13 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@Mixin(ClientWorld.class)
public class ClientWorldMixin {
@Inject(at = @At("HEAD"), method = "addPlayer")
private void onAddPlayer(int id, AbstractClientPlayerEntity player, CallbackInfo ci) {
if(player == MinecraftClient.getInstance().player) {
ModSender.sendInformationPacket();
@Inject(at = @At("HEAD"), method = "addEntityPrivate")
private void onAddPlayer(int id, Entity entity, CallbackInfo ci) {
if(entity instanceof ClientPlayerEntity) {
ClientPlayerEntity player = (ClientPlayerEntity) entity;
if(player == MinecraftClient.getInstance().player) {
ModSender.sendInformationPacket();
}
}
}