Update for 1.19
This commit is contained in:
parent
524b561539
commit
2702bab886
|
@ -1,13 +1,11 @@
|
|||
apply from: "https://jfmods.gitlab.io/scripts/jfmod.gradle"
|
||||
|
||||
dependencies {
|
||||
include modImplementation("io.gitlab.jfronny.libjf:libjf-config-v0:${project.jfapi_version}")
|
||||
include("io.gitlab.jfronny.libjf:libjf-unsafe-v0:${project.jfapi_version}")
|
||||
include("io.gitlab.jfronny.libjf:libjf-base:${project.jfapi_version}")
|
||||
modImplementation("io.gitlab.jfronny.libjf:libjf-config-v0:${project.jfapi_version}")
|
||||
modRuntimeOnly("io.gitlab.jfronny.libjf:libjf-devutil-v0:${project.jfapi_version}")
|
||||
|
||||
modImplementation "com.terraformersmc:modmenu:3.1.0"
|
||||
modImplementation "com.terraformersmc:modmenu:4.0.0-beta.4"
|
||||
|
||||
// Compat fix
|
||||
include modImplementation(fabricApi.module("fabric-command-api-v1", "${project.fabric_version}"))
|
||||
include modImplementation(fabricApi.module("fabric-command-api-v2", "${project.fabric_version}"))
|
||||
}
|
||||
|
|
|
@ -1,15 +1,17 @@
|
|||
# https://fabricmc.net/develop/
|
||||
minecraft_version=1.18.2
|
||||
yarn_mappings=build.2
|
||||
loader_version=0.13.3
|
||||
minecraft_version=1.19
|
||||
yarn_mappings=build.1
|
||||
loader_version=0.14.6
|
||||
|
||||
maven_group=io.gitlab.jfronny
|
||||
archives_base_name=combit
|
||||
|
||||
fabric_version=0.48.0+1.18.2
|
||||
jfapi_version=2.7.2
|
||||
fabric_version=0.55.1+1.19
|
||||
jfapi_version=2.9.1
|
||||
|
||||
modrinth_id=oPRrsg3M
|
||||
modrinth_required_dependencies=WKwQAwke
|
||||
modrinth_optional_dependencies=mOgUt4GM
|
||||
curseforge_id=561742
|
||||
curseforge_required_dependencies=libjf
|
||||
curseforge_optional_dependencies=modmenu, cloth-config
|
|
@ -1,21 +1,15 @@
|
|||
package io.gitlab.jfronny.combit;
|
||||
|
||||
import io.gitlab.jfronny.combit.events.EntityHurtEvent;
|
||||
import io.gitlab.jfronny.combit.events.EntityKnockbackEvent;
|
||||
import io.gitlab.jfronny.combit.events.PlayerAttackEvent;
|
||||
import net.fabricmc.api.ModInitializer;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityType;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.text.LiteralText;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import io.gitlab.jfronny.combit.events.*;
|
||||
import net.fabricmc.api.*;
|
||||
import net.minecraft.entity.*;
|
||||
import net.minecraft.entity.player.*;
|
||||
import net.minecraft.text.*;
|
||||
import net.minecraft.util.*;
|
||||
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import java.util.*;
|
||||
|
||||
public class Combit implements ModInitializer {
|
||||
private static final UUID debugUUID = new UUID(0L, 0L);
|
||||
@Override
|
||||
public void onInitialize() {
|
||||
EntityHurtEvent.EVENT.register((entity, source, amount) -> {
|
||||
|
@ -30,7 +24,7 @@ public class Combit implements ModInitializer {
|
|||
}
|
||||
String message = String.format("Type of damage received: %s\nAmount: %.3f\nTrue Source (mob id): %s\n",
|
||||
source.getName(), amount, debugSource);
|
||||
entity.sendSystemMessage(new LiteralText(message), debugUUID);
|
||||
entity.sendMessage(Text.literal(message));
|
||||
}
|
||||
|
||||
if (CombitConfig.excludePlayers && entity instanceof PlayerEntity) return ActionResult.PASS;
|
||||
|
@ -66,7 +60,7 @@ public class Combit implements ModInitializer {
|
|||
return ActionResult.PASS;
|
||||
|
||||
if (CombitConfig.debug) {
|
||||
player.sendMessage(new LiteralText(
|
||||
player.sendMessage(Text.literal(
|
||||
target instanceof LivingEntity le
|
||||
? String.format("LivingEntity attacked: %s (%s/%s)", EntityType.getId(target.getType()), le.getHealth(), le.getMaxHealth())
|
||||
: String.format("Entity attacked: %s", EntityType.getId(target.getType()))
|
||||
|
|
|
@ -1,16 +1,13 @@
|
|||
package io.gitlab.jfronny.combit.mixin;
|
||||
|
||||
import io.gitlab.jfronny.combit.CombitConfig;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.gui.hud.InGameHud;
|
||||
import net.minecraft.client.option.AttackIndicator;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import org.spongepowered.asm.mixin.Final;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
import io.gitlab.jfronny.combit.*;
|
||||
import net.minecraft.client.*;
|
||||
import net.minecraft.client.gui.hud.*;
|
||||
import net.minecraft.client.option.*;
|
||||
import net.minecraft.client.util.math.*;
|
||||
import org.spongepowered.asm.mixin.*;
|
||||
import org.spongepowered.asm.mixin.injection.*;
|
||||
import org.spongepowered.asm.mixin.injection.callback.*;
|
||||
|
||||
@Mixin(InGameHud.class)
|
||||
public class InGameHudMixin {
|
||||
|
@ -20,15 +17,15 @@ public class InGameHudMixin {
|
|||
@Inject(at = @At("HEAD"), method = "renderCrosshair(Lnet/minecraft/client/util/math/MatrixStack;)V")
|
||||
private void renderCrosshair(MatrixStack matrices, CallbackInfo info) {
|
||||
if (CombitConfig.cooldownProgressOverride >= 0) {
|
||||
combit$attackIndicator = this.client.options.attackIndicator;
|
||||
this.client.options.attackIndicator = AttackIndicator.OFF;
|
||||
combit$attackIndicator = this.client.options.getAttackIndicator().getValue();
|
||||
this.client.options.getAttackIndicator().setValue(AttackIndicator.OFF);
|
||||
}
|
||||
}
|
||||
|
||||
@Inject(at = @At("RETURN"), method = "renderCrosshair(Lnet/minecraft/client/util/math/MatrixStack;)V")
|
||||
private void renderCrosshairPost(MatrixStack matrices, CallbackInfo info) {
|
||||
if (CombitConfig.cooldownProgressOverride >= 0) {
|
||||
this.client.options.attackIndicator = combit$attackIndicator;
|
||||
this.client.options.getAttackIndicator().setValue(combit$attackIndicator);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue