diff --git a/README.md b/README.md index d1a5a0b04..5147eaed4 100644 --- a/README.md +++ b/README.md @@ -4,11 +4,11 @@ A Bukkit server implementation utilizing Mixin. ![Downloads](https://img.shields.io/github/downloads/IzzelAliz/Arclight/total?style=flat-square) ![GitHub](https://img.shields.io/github/license/IzzelAliz/Arclight?style=flat-square) -| Release | Forge | NeoForge | Fabric | Status | Downloads | -|:---------------------|:--------|:---------|:--------|:------:|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:| -| Whisper (1.20.4) | 49.0.38 | 20.4.215 | 0.96.11 | ACTIVE | [![1.20.4 Status](https://img.shields.io/github/actions/workflow/status/IzzelAliz/Arclight/gradle.yml?branch=Whisper&style=flat-square)](https://github.com/IzzelAliz/Arclight/actions?query=branch%3AWhisper) | -| Trials (1.20-1.20.1) | 47.2.20 | - | - | LTS | [![1.20.1 Status](https://img.shields.io/github/actions/workflow/status/IzzelAliz/Arclight/gradle.yml?branch=Trials&style=flat-square)](https://github.com/IzzelAliz/Arclight/actions?query=branch%3ATrials) | -| Horn (1.19-1.19.2) | 43.3.7 | - | - | LTS | [![Horn Status](https://img.shields.io/appveyor/build/IzzelAliz/arclight-19?style=flat-square)](https://ci.appveyor.com/project/IzzelAliz/arclight-19) | +| Release | Forge | NeoForge | Fabric | Status | Downloads | +|:---------------------|:--------|:---------|:-------|:------:|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:| +| Whisper (1.20.4) | 49.0.49 | 20.4.234 | 0.97.0 | ACTIVE | [![1.20.4 Status](https://img.shields.io/github/actions/workflow/status/IzzelAliz/Arclight/gradle.yml?branch=Whisper&style=flat-square)](https://github.com/IzzelAliz/Arclight/actions?query=branch%3AWhisper) | +| Trials (1.20-1.20.1) | 47.2.20 | - | - | LTS | [![1.20.1 Status](https://img.shields.io/github/actions/workflow/status/IzzelAliz/Arclight/gradle.yml?branch=Trials&style=flat-square)](https://github.com/IzzelAliz/Arclight/actions?query=branch%3ATrials) | +| Horn (1.19-1.19.2) | 43.3.7 | - | - | LTS | [![Horn Status](https://img.shields.io/appveyor/build/IzzelAliz/arclight-19?style=flat-square)](https://ci.appveyor.com/project/IzzelAliz/arclight-19) | **Legacy versions**: diff --git a/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/world/damagesource/DamageSourceMixin.java b/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/world/damagesource/DamageSourceMixin.java index 92f00221b..9dcaa320f 100644 --- a/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/world/damagesource/DamageSourceMixin.java +++ b/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/world/damagesource/DamageSourceMixin.java @@ -88,6 +88,11 @@ public Entity getCausingEntity() { @Override public DamageSource bridge$customCausingEntity(Entity entity) { + // This method is not intended for change the causing entity if is already set + // also is only necessary if the entity passed is not the direct entity or different from the current causingEntity + if (this.customCausingEntity != null || this.directEntity == entity || this.causingEntity == entity) { + return (DamageSource) (Object) this; + } var src = cloneInstance(); return ((DamageSourceBridge) src).bridge$setCustomCausingEntity(entity); } diff --git a/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/world/entity/MobMixin.java b/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/world/entity/MobMixin.java index 970d37f24..8939c1798 100644 --- a/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/world/entity/MobMixin.java +++ b/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/world/entity/MobMixin.java @@ -5,7 +5,6 @@ import io.izzel.arclight.common.bridge.core.entity.MobEntityBridge; import io.izzel.arclight.common.bridge.core.world.WorldBridge; import io.izzel.arclight.common.mod.server.ArclightServer; -import io.izzel.arclight.mixin.Eject; import net.minecraft.nbt.CompoundTag; import net.minecraft.network.protocol.game.ClientboundSetEntityLinkPacket; import net.minecraft.resources.ResourceLocation; @@ -325,18 +324,28 @@ public ItemStack equipItemIfPossible(ItemStack stack) { Bukkit.getPluginManager().callEvent(new EntityUnleashEvent(this.getBukkitEntity(), EntityUnleashEvent.UnleashReason.UNKNOWN)); } - @Eject(method = "convertTo", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/level/Level;addFreshEntity(Lnet/minecraft/world/entity/Entity;)Z")) - private boolean arclight$copySpawn(net.minecraft.world.level.Level world, Entity entityIn, CallbackInfoReturnable cir) { + private transient boolean arclight$cancelSpawn; + + @Redirect(method = "convertTo", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/level/Level;addFreshEntity(Lnet/minecraft/world/entity/Entity;)Z")) + private boolean arclight$copySpawn(net.minecraft.world.level.Level world, Entity entityIn) { EntityTransformEvent.TransformReason transformReason = arclight$transform == null ? EntityTransformEvent.TransformReason.UNKNOWN : arclight$transform; arclight$transform = null; if (CraftEventFactory.callEntityTransformEvent((Mob) (Object) this, (LivingEntity) entityIn, transformReason).isCancelled()) { - cir.setReturnValue(null); + arclight$cancelSpawn = true; return false; } else { return world.addFreshEntity(entityIn); } } + @Inject(method = "convertTo", cancellable = true, at = @At(value = "INVOKE", shift = At.Shift.AFTER, target = "Lnet/minecraft/world/level/Level;addFreshEntity(Lnet/minecraft/world/entity/Entity;)Z")) + private void arclight$cancelSpawn(EntityType entityType, boolean bl, CallbackInfoReturnable cir) { + if (arclight$cancelSpawn) { + cir.setReturnValue(null); + } + arclight$cancelSpawn = false; + } + @Inject(method = "convertTo", at = @At("RETURN")) private void arclight$cleanReason(EntityType p_233656_1_, boolean p_233656_2_, CallbackInfoReturnable cir) { ((WorldBridge) this.level()).bridge$pushAddEntityReason(null); diff --git a/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/world/entity/monster/CreeperMixin.java b/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/world/entity/monster/CreeperMixin.java index 96e2d0061..ddebe8176 100644 --- a/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/world/entity/monster/CreeperMixin.java +++ b/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/world/entity/monster/CreeperMixin.java @@ -1,14 +1,19 @@ package io.izzel.arclight.common.mixin.core.world.entity.monster; import io.izzel.arclight.common.bridge.core.entity.monster.CreeperEntityBridge; +import io.izzel.arclight.common.bridge.core.util.DamageSourceBridge; import io.izzel.arclight.common.bridge.core.world.WorldBridge; import io.izzel.arclight.common.mixin.core.world.entity.PathfinderMobMixin; import net.minecraft.network.syncher.EntityDataAccessor; import net.minecraft.server.level.ServerLevel; +import net.minecraft.world.InteractionHand; +import net.minecraft.world.InteractionResult; import net.minecraft.world.effect.MobEffectInstance; import net.minecraft.world.entity.AreaEffectCloud; import net.minecraft.world.entity.LightningBolt; import net.minecraft.world.entity.monster.Creeper; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.level.Explosion; import net.minecraft.world.level.Level; import org.bukkit.Bukkit; import org.bukkit.craftbukkit.v.event.CraftEventFactory; @@ -20,9 +25,11 @@ import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Overwrite; import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.Unique; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; import org.spongepowered.asm.mixin.injection.callback.LocalCapture; import java.util.Collection; @@ -38,6 +45,13 @@ public abstract class CreeperMixin extends PathfinderMobMixin implements Creeper @Shadow public abstract boolean isPowered(); // @formatter:on + @Unique private Player entityIgniter; // CraftBukkit + + @Inject(method = "mobInteract", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/entity/monster/Creeper;ignite()V")) + private void arclight$catchIgniter(Player player, InteractionHand interactionHand, CallbackInfoReturnable cir) { + this.entityIgniter = player; + } + @Inject(method = "thunderHit", cancellable = true, at = @At(value = "FIELD", target = "Lnet/minecraft/world/entity/monster/Creeper;entityData:Lnet/minecraft/network/syncher/SynchedEntityData;")) private void arclight$lightningBolt(ServerLevel world, LightningBolt lightningBolt, CallbackInfo ci) { if (CraftEventFactory.callCreeperPowerEvent((Creeper) (Object) this, lightningBolt, CreeperPowerEvent.PowerCause.LIGHTNING).isCancelled()) { @@ -57,7 +71,9 @@ public final void explodeCreeper() { Bukkit.getPluginManager().callEvent(event); if (!event.isCancelled()) { this.dead = true; - this.level().explode((Creeper) (Object) this, this.getX(), this.getY(), this.getZ(), event.getRadius(), event.getFire(), Level.ExplosionInteraction.MOB); + this.level().explode((Creeper) (Object) this, + ((DamageSourceBridge) Explosion.getDefaultDamageSource(level(), (Creeper) (Object) this)).bridge$customCausingEntity(entityIgniter), null, + this.getX(), this.getY(), this.getZ(), event.getRadius(), event.getFire(), Level.ExplosionInteraction.MOB); this.bridge$pushEntityRemoveCause(EntityRemoveEvent.Cause.EXPLODE); this.discard(); this.spawnLingeringCloud(); diff --git a/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/world/level/LevelMixin.java b/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/world/level/LevelMixin.java index 6dcb74d3e..b90749c5f 100644 --- a/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/world/level/LevelMixin.java +++ b/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/world/level/LevelMixin.java @@ -5,6 +5,7 @@ import io.izzel.arclight.common.bridge.core.world.level.levelgen.ChunkGeneratorBridge; import io.izzel.arclight.common.bridge.core.world.server.ServerChunkProviderBridge; import io.izzel.arclight.common.bridge.core.world.server.ServerWorldBridge; +import io.izzel.arclight.common.mod.ArclightConstants; import io.izzel.arclight.common.mod.mixins.annotation.CreateConstructor; import io.izzel.arclight.common.mod.mixins.annotation.ShadowConstructor; import io.izzel.arclight.common.mod.mixins.annotation.TransformAccess; @@ -22,6 +23,7 @@ import net.minecraft.server.level.ServerLevel; import net.minecraft.util.profiling.ProfilerFiller; import net.minecraft.world.entity.Entity; +import net.minecraft.world.level.Explosion; import net.minecraft.world.level.Level; import net.minecraft.world.level.LevelAccessor; import net.minecraft.world.level.LevelWriter; @@ -59,6 +61,7 @@ import org.spongepowered.asm.mixin.gen.Accessor; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.ModifyVariable; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; @@ -365,4 +368,30 @@ public BlockEntity getBlockEntity(BlockPos pos, boolean validate) { public void bridge$preventPoiUpdated(boolean b) { this.preventPoiUpdated = b; } + + private transient Explosion.BlockInteraction arclight$blockInteractionOverride; + + @ModifyVariable(method = "explode(Lnet/minecraft/world/entity/Entity;Lnet/minecraft/world/damagesource/DamageSource;Lnet/minecraft/world/level/ExplosionDamageCalculator;DDDFZLnet/minecraft/world/level/Level$ExplosionInteraction;ZLnet/minecraft/core/particles/ParticleOptions;Lnet/minecraft/core/particles/ParticleOptions;Lnet/minecraft/sounds/SoundEvent;)Lnet/minecraft/world/level/Explosion;", + ordinal = 0, at = @At("HEAD"), argsOnly = true) + private Level.ExplosionInteraction arclight$standardExplodePre(Level.ExplosionInteraction interaction) { + if (interaction == ArclightConstants.STANDARD) { + arclight$blockInteractionOverride = Explosion.BlockInteraction.DESTROY; + return Level.ExplosionInteraction.BLOCK; + } + return interaction; + } + + @ModifyVariable(method = "explode(Lnet/minecraft/world/entity/Entity;Lnet/minecraft/world/damagesource/DamageSource;Lnet/minecraft/world/level/ExplosionDamageCalculator;DDDFZLnet/minecraft/world/level/Level$ExplosionInteraction;ZLnet/minecraft/core/particles/ParticleOptions;Lnet/minecraft/core/particles/ParticleOptions;Lnet/minecraft/sounds/SoundEvent;)Lnet/minecraft/world/level/Explosion;", + at = @At(value = "LOAD", ordinal = 0)) + private Explosion.BlockInteraction arclight$standardExplodePost(Explosion.BlockInteraction interaction) { + try { + if (arclight$blockInteractionOverride != null) { + return arclight$blockInteractionOverride; + } else { + return interaction; + } + } finally { + arclight$blockInteractionOverride = null; + } + } } diff --git a/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/world/level/Level_ExplosionInteractionMixin.java b/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/world/level/Level_ExplosionInteractionMixin.java new file mode 100644 index 000000000..0f354f6f9 --- /dev/null +++ b/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/world/level/Level_ExplosionInteractionMixin.java @@ -0,0 +1,16 @@ +package io.izzel.arclight.common.mixin.core.world.level; + +import io.izzel.arclight.api.EnumHelper; +import io.izzel.arclight.common.mod.mixins.annotation.TransformAccess; +import net.minecraft.world.level.Level; +import org.objectweb.asm.Opcodes; +import org.spongepowered.asm.mixin.Mixin; + +import java.util.List; + +@Mixin(Level.ExplosionInteraction.class) +public class Level_ExplosionInteractionMixin { + + @TransformAccess(Opcodes.ACC_PUBLIC | Opcodes.ACC_STATIC | Opcodes.ACC_FINAL) + private static final Level.ExplosionInteraction STANDARD = EnumHelper.makeEnum(Level.ExplosionInteraction.class, "STANDARD", Level.ExplosionInteraction.values().length, List.of(), List.of()); +} diff --git a/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/world/level/block/entity/ConduitBlockEntityMixin.java b/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/world/level/block/entity/ConduitBlockEntityMixin.java index bbb6cd291..d13831d6f 100644 --- a/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/world/level/block/entity/ConduitBlockEntityMixin.java +++ b/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/world/level/block/entity/ConduitBlockEntityMixin.java @@ -2,6 +2,7 @@ import io.izzel.arclight.common.bridge.core.entity.player.PlayerEntityBridge; import io.izzel.arclight.common.bridge.core.util.DamageSourceBridge; +import io.izzel.arclight.common.mod.mixins.annotation.TransformAccess; import net.minecraft.core.BlockPos; import net.minecraft.world.damagesource.DamageSource; import net.minecraft.world.damagesource.DamageSources; @@ -9,18 +10,26 @@ import net.minecraft.world.entity.player.Player; import net.minecraft.world.level.Level; import net.minecraft.world.level.block.entity.ConduitBlockEntity; +import net.minecraft.world.level.block.state.BlockState; import org.bukkit.craftbukkit.v.block.CraftBlock; -import org.bukkit.craftbukkit.v.event.CraftEventFactory; import org.bukkit.event.entity.EntityPotionEffectEvent; +import org.objectweb.asm.Opcodes; 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.Redirect; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; +import java.util.List; + @Mixin(ConduitBlockEntity.class) public abstract class ConduitBlockEntityMixin extends BlockEntityMixin { + // @formatter:off + @Shadow private static void updateDestroyTarget(Level level, BlockPos blockPos, BlockState blockState, List list, ConduitBlockEntity conduitBlockEntity) {} + // @formatter:on + @Redirect(method = "applyEffects", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/entity/player/Player;addEffect(Lnet/minecraft/world/effect/MobEffectInstance;)Z")) private static boolean arclight$addEntity(Player player, MobEffectInstance eff) { ((PlayerEntityBridge) player).bridge$pushEffectCause(EntityPotionEffectEvent.Cause.CONDUIT); @@ -31,4 +40,27 @@ public abstract class ConduitBlockEntityMixin extends BlockEntityMixin { private static DamageSource arclight$attackReason(DamageSources instance, Level level, BlockPos pos) { return ((DamageSourceBridge) instance.magic()).bridge$directBlock(CraftBlock.at(level, pos)); } + + @TransformAccess(Opcodes.ACC_PUBLIC | Opcodes.ACC_STATIC) + private static int getRange(List list) { + int i = list.size(); + return i / 7 * 16; + } + + private static boolean arclight$damageTarget = true; + + @Inject(method = "updateDestroyTarget", cancellable = true, at = @At(value = "INVOKE", target = "Lnet/minecraft/world/level/Level;playSound(Lnet/minecraft/world/entity/player/Player;DDDLnet/minecraft/sounds/SoundEvent;Lnet/minecraft/sounds/SoundSource;FF)V")) + private static void arclight$returnIfNot(Level level, BlockPos blockPos, BlockState blockState, List list, ConduitBlockEntity conduitBlockEntity, CallbackInfo ci) { + if (!arclight$damageTarget) { + ci.cancel(); + level.sendBlockUpdated(blockPos, blockState, blockState, 2); + } + } + + @TransformAccess(Opcodes.ACC_PUBLIC | Opcodes.ACC_STATIC) + private static void updateDestroyTarget(Level level, BlockPos blockPos, BlockState blockState, List list, ConduitBlockEntity conduitBlockEntity, boolean damageTarget) { + arclight$damageTarget = damageTarget; + updateDestroyTarget(level, blockPos, blockState, list, conduitBlockEntity); + arclight$damageTarget = true; + } } diff --git a/arclight-common/src/main/java/io/izzel/arclight/common/mod/ArclightConstants.java b/arclight-common/src/main/java/io/izzel/arclight/common/mod/ArclightConstants.java index 6c14b2295..349057168 100644 --- a/arclight-common/src/main/java/io/izzel/arclight/common/mod/ArclightConstants.java +++ b/arclight-common/src/main/java/io/izzel/arclight/common/mod/ArclightConstants.java @@ -5,6 +5,7 @@ import io.izzel.arclight.api.EnumHelper; import io.izzel.arclight.api.Unsafe; import net.minecraft.util.datafix.DataFixTypes; +import net.minecraft.world.level.Level; import net.minecraft.world.level.storage.loot.parameters.LootContextParam; import net.minecraft.world.level.storage.loot.parameters.LootContextParams; import org.bukkit.TreeType; @@ -15,6 +16,7 @@ public class ArclightConstants { public static final TreeType MOD = EnumHelper.addEnum(TreeType.class, "MOD", ImmutableList.of(), ImmutableList.of()); + public static final Level.ExplosionInteraction STANDARD = Unsafe.getStatic(Level.ExplosionInteraction.class, "STANDARD"); public static final LootContextParam LOOTING_MOD = Unsafe.getStatic(LootContextParams.class, "LOOTING_MOD"); private static final DSL.TypeReference PDC_TYPE = () -> "bukkit_pdc"; diff --git a/arclight-common/src/main/resources/arclight.accesswidener b/arclight-common/src/main/resources/arclight.accesswidener index 3f388bb8d..4c71db6af 100644 --- a/arclight-common/src/main/resources/arclight.accesswidener +++ b/arclight-common/src/main/resources/arclight.accesswidener @@ -10,6 +10,10 @@ accessible method net/minecraft/world/damagesource/DamageSource (Lnet/min accessible method net/minecraft/server/level/ServerLevel getEntities ()Lnet/minecraft/world/level/entity/LevelEntityGetter; accessible field net/minecraft/world/entity/animal/MushroomCow stewEffects Ljava/util/List; accessible field net/minecraft/world/entity/LivingEntity useItemRemaining I +accessible method net/minecraft/world/level/block/entity/ConduitBlockEntity getDestroyRangeAABB (Lnet/minecraft/core/BlockPos;)Lnet/minecraft/world/phys/AABB; +accessible field net/minecraft/world/level/block/entity/ConduitBlockEntity effectBlocks Ljava/util/List; +accessible field net/minecraft/world/level/block/entity/ConduitBlockEntity destroyTarget Lnet/minecraft/world/entity/LivingEntity; +accessible field net/minecraft/world/level/block/entity/ConduitBlockEntity destroyTargetUUID Ljava/util/UUID; # Older versions accessible field net/minecraft/world/level/chunk/storage/ChunkSerializer BLOCK_STATE_CODEC Lcom/mojang/serialization/Codec; # TODO field net/minecraft/server/PlayerAdvancements f_135964_ diff --git a/arclight-common/src/main/resources/mixins.arclight.core.json b/arclight-common/src/main/resources/mixins.arclight.core.json index 80dd4a66e..d2f105d46 100644 --- a/arclight-common/src/main/resources/mixins.arclight.core.json +++ b/arclight-common/src/main/resources/mixins.arclight.core.json @@ -360,6 +360,7 @@ "world.item.enchantment.FrostWalkerEnchantmentMixin", "world.level.ExplosionMixin", "world.level.GameRules_ValueMixin", + "world.level.Level_ExplosionInteractionMixin", "world.level.LevelMixin", "world.level.block.BambooSaplingBlockMixin", "world.level.block.BambooStalkBlockMixin", diff --git a/arclight-fabric/src/main/java/io/izzel/arclight/fabric/mixin/core/world/level/block/entity/BrewingStandBlockEntityMixin_Fabric.java b/arclight-fabric/src/main/java/io/izzel/arclight/fabric/mixin/core/world/level/block/entity/BrewingStandBlockEntityMixin_Fabric.java index f7640c2ed..23d17a4aa 100644 --- a/arclight-fabric/src/main/java/io/izzel/arclight/fabric/mixin/core/world/level/block/entity/BrewingStandBlockEntityMixin_Fabric.java +++ b/arclight-fabric/src/main/java/io/izzel/arclight/fabric/mixin/core/world/level/block/entity/BrewingStandBlockEntityMixin_Fabric.java @@ -36,16 +36,14 @@ private static void doBrew(Level level, BlockPos pos, NonNullList sta return; } + itemStack.shrink(1); if (itemStack.getItem().hasCraftingRemainingItem()) { ItemStack itemStack2 = new ItemStack(itemStack.getItem().getCraftingRemainingItem()); - itemStack.shrink(1); if (itemStack.isEmpty()) { itemStack = itemStack2; } else { Containers.dropItemStack(level, pos.getX(), pos.getY(), pos.getZ(), itemStack2); } - } else { - itemStack.shrink(1); } stacks.set(3, itemStack); diff --git a/build.gradle b/build.gradle index 4305dfef1..8f30f3dfa 100644 --- a/build.gradle +++ b/build.gradle @@ -18,10 +18,10 @@ allprojects { ext { minecraftVersion = '1.20.4' supportedPlatforms = ['forge', 'neoforge', 'fabric'] - fabricLoaderVersion = '0.15.6' - fabricApiVersion = '0.96.11+1.20.4' - forgeVersion = '49.0.38' - neoForgeVersion = '20.4.215' + fabricLoaderVersion = '0.15.10' + fabricApiVersion = '0.97.0+1.20.4' + forgeVersion = '49.0.49' + neoForgeVersion = '20.4.234' apiVersion = '1.6.3' toolsVersion = '1.3.0' mixinVersion = '0.8.5' diff --git a/buildSrc/build.gradle b/buildSrc/build.gradle index b491fdd60..9f7c0b9e5 100644 --- a/buildSrc/build.gradle +++ b/buildSrc/build.gradle @@ -24,5 +24,5 @@ dependencies { implementation 'org.cadixdev:lorenz:0.5.8' implementation 'org.cadixdev:at:0.1.0-rc1' implementation 'net.fabricmc:lorenz-tiny:4.0.2' - implementation "dev.architectury:architectury-loom:1.5-SNAPSHOT" + implementation "dev.architectury:architectury-loom:1.6-SNAPSHOT" } \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 211667deb..30a7cf93a 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ #Sun Feb 09 15:27:43 CST 2020 -distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-all.zip distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStorePath=wrapper/dists