Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/fabric' into connectfour
Browse files Browse the repository at this point in the history
  • Loading branch information
RealRTTV committed Oct 5, 2024
2 parents 84cd6bb + 29ab4df commit 2e88d30
Show file tree
Hide file tree
Showing 3 changed files with 277 additions and 45 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ org.gradle.jvmargs=-Xmx2G
parchment_version=2024.07.28

# Mod Properties
mod_version=2.9.1
mod_version=2.9.2
maven_group=net.earthcomputer
archives_base_name=clientcommands

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
import net.minecraft.client.player.LocalPlayer;
import net.minecraft.core.BlockPos;
import net.minecraft.tags.BlockTags;
import net.minecraft.tags.FluidTags;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.enchantment.EnchantmentHelper;
import net.minecraft.world.item.enchantment.Enchantments;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.Blocks;
Expand All @@ -22,7 +22,6 @@
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.Slice;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

@Mixin(LivingEntity.class)
Expand All @@ -32,6 +31,8 @@ public abstract class LivingEntityMixin extends Entity {
@Shadow
protected int useItemRemaining;

@Shadow public abstract boolean isAlive();

public LivingEntityMixin(EntityType<?> entityType_1, Level level_1) {
super(entityType_1, level_1);
}
Expand All @@ -57,11 +58,9 @@ public void onEat(ItemStack stack, int particleCount, CallbackInfo ci) {
}
}

@Inject(method = "baseTick",
slice = @Slice(from = @At(value = "FIELD", target = "Lnet/minecraft/tags/FluidTags;WATER:Lnet/minecraft/tags/TagKey;", ordinal = 0)),
at = @At(value = "INVOKE", target = "Lnet/minecraft/world/level/Level;getBlockState(Lnet/minecraft/core/BlockPos;)Lnet/minecraft/world/level/block/state/BlockState;", ordinal = 0))
@Inject(method = "baseTick", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/entity/LivingEntity;isAlive()Z", ordinal = 0))
public void onUnderwater(CallbackInfo ci) {
if (isThePlayer()) {
if (isThePlayer() && isAlive() && isEyeInFluid(FluidTags.WATER)) {
PlayerRandCracker.onUnderwater();
}
}
Expand Down
Loading

0 comments on commit 2e88d30

Please sign in to comment.