chore: update to 1.21
All checks were successful
ci/woodpecker/push/jfmod Pipeline was successful
ci/woodpecker/tag/jfmod Pipeline was successful

This commit is contained in:
Johannes Frohnmeyer 2024-06-14 11:28:12 +02:00
parent 5db7c4c867
commit e6ae319c07
Signed by: Johannes
GPG Key ID: E76429612C2929F4
5 changed files with 15 additions and 16 deletions

View File

@ -6,11 +6,11 @@ allprojects { group = "io.gitlab.jfronny" }
base.archivesName = "combit"
jfMod {
minecraftVersion = "1.20.5"
minecraftVersion = "1.21"
yarn("build.1")
loaderVersion = "0.15.10"
libJfVersion = "3.15.5"
fabricApiVersion = "0.97.6+1.20.5"
loaderVersion = "0.15.11"
libJfVersion = "3.16.0"
fabricApiVersion = "0.100.1+1.21"
modrinth {
projectId = "combit"
@ -32,7 +32,7 @@ dependencies {
// Dev env
modLocalRuntime("io.gitlab.jfronny.libjf:libjf-config-ui-tiny")
modLocalRuntime("io.gitlab.jfronny.libjf:libjf-devutil")
modLocalRuntime("com.terraformersmc:modmenu:10.0.0-beta.1")
modLocalRuntime("com.terraformersmc:modmenu:11.0.0-beta.1")
// for modmenu
modLocalRuntime("net.fabricmc.fabric-api:fabric-resource-loader-v0")
modLocalRuntime("net.fabricmc.fabric-api:fabric-screen-api-v1")

View File

@ -5,7 +5,7 @@ import net.minecraft.client.*;
import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.gui.hud.*;
import net.minecraft.client.option.*;
import net.minecraft.client.util.math.*;
import net.minecraft.client.render.RenderTickCounter;
import org.spongepowered.asm.mixin.*;
import org.spongepowered.asm.mixin.injection.*;
import org.spongepowered.asm.mixin.injection.callback.*;
@ -15,16 +15,16 @@ public class InGameHudMixin {
@Shadow @Final private MinecraftClient client;
private AttackIndicator combit$attackIndicator;
@Inject(at = @At("HEAD"), method = "renderCrosshair(Lnet/minecraft/client/gui/DrawContext;F)V")
private void renderCrosshair(DrawContext context, float tickDelta, CallbackInfo info) {
@Inject(at = @At("HEAD"), method = "renderCrosshair(Lnet/minecraft/client/gui/DrawContext;Lnet/minecraft/client/render/RenderTickCounter;)V")
private void renderCrosshair(DrawContext context, RenderTickCounter tickCounter, CallbackInfo ci) {
if (CombitConfig.cooldownProgressOverride >= 0) {
combit$attackIndicator = this.client.options.getAttackIndicator().getValue();
this.client.options.getAttackIndicator().setValue(AttackIndicator.OFF);
}
}
@Inject(at = @At("RETURN"), method = "renderCrosshair(Lnet/minecraft/client/gui/DrawContext;F)V")
private void renderCrosshairPost(DrawContext context, float tickDelta, CallbackInfo info) {
@Inject(at = @At("RETURN"), method = "renderCrosshair(Lnet/minecraft/client/gui/DrawContext;Lnet/minecraft/client/render/RenderTickCounter;)V")
private void renderCrosshairPost(DrawContext context, RenderTickCounter tickCounter, CallbackInfo ci) {
if (CombitConfig.cooldownProgressOverride >= 0) {
this.client.options.getAttackIndicator().setValue(combit$attackIndicator);
}

View File

@ -2,12 +2,12 @@ package io.gitlab.jfronny.combit.mixin;
import it.unimi.dsi.fastutil.objects.Reference2ObjectMap;
import net.minecraft.component.ComponentMap;
import net.minecraft.component.DataComponentType;
import net.minecraft.component.ComponentType;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Accessor;
@Mixin(ComponentMap.Builder.class)
public interface ComponentMapBuilderAccessor {
@Accessor("components") Reference2ObjectMap<DataComponentType<?>, Object> combit$getComponents();
@Accessor("components") void combit$setComponents(Reference2ObjectMap<DataComponentType<?>, Object> components);
@Accessor("components") Reference2ObjectMap<ComponentType<?>, Object> combit$getComponents();
@Accessor("components") void combit$setComponents(Reference2ObjectMap<ComponentType<?>, Object> components);
}

View File

@ -29,7 +29,7 @@ public class HostileEntityMixin extends PathAwareEntity {
if (itemStack.isDamageable()) {
itemStack.setDamage(itemStack.getDamage() + this.random.nextInt(2));
if (itemStack.getDamage() >= itemStack.getMaxDamage()) {
sendEquipmentBreakStatus(EquipmentSlot.HEAD);
sendEquipmentBreakStatus(itemStack.getItem(), EquipmentSlot.HEAD);
equipStack(EquipmentSlot.HEAD, ItemStack.EMPTY);
}
}

View File

@ -58,8 +58,7 @@ public abstract class MiningToolItemMixin extends ToolItem {
damageEntry = new AttributeModifiersComponent.Entry(
EntityAttributes.GENERIC_ATTACK_DAMAGE,
new EntityAttributeModifier(
ATTACK_DAMAGE_MODIFIER_ID,
"Tool modifier",
BASE_ATTACK_DAMAGE_MODIFIER_ID,
damage * factor,
EntityAttributeModifier.Operation.ADD_VALUE),
AttributeModifierSlot.MAINHAND);