Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/fabric' into creply
Browse files Browse the repository at this point in the history
  • Loading branch information
RealRTTV committed Oct 5, 2024
2 parents 837c679 + 29ab4df commit 670e0b8
Show file tree
Hide file tree
Showing 4 changed files with 281 additions and 49 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 @@ -162,17 +162,17 @@ public boolean putMark(byte x, byte y, Mark mark) {

public Mark getWinner() {
for (byte x = 0; x < 3; x++) {
if (this.board[x][0] == this.board[x][1] && this.board[x][1] == this.board[x][2]) {
if (this.board[x][0] == this.board[x][1] && this.board[x][1] == this.board[x][2] && this.board[x][0] != null) {
return this.board[x][0];
}
if (this.board[0][x] == this.board[1][x] && this.board[1][x] == this.board[2][x]) {
if (this.board[0][x] == this.board[1][x] && this.board[1][x] == this.board[2][x] && this.board[0][x] != null) {
return this.board[0][x];
}
}
if (this.board[0][0] == this.board[1][1] && this.board[1][1] == this.board[2][2]) {
if (this.board[0][0] == this.board[1][1] && this.board[1][1] == this.board[2][2] && this.board[0][0] != null) {
return this.board[0][0];
}
if (this.board[0][2] == this.board[1][1] && this.board[1][1] == this.board[2][0]) {
if (this.board[0][2] == this.board[1][1] && this.board[1][1] == this.board[2][0] && this.board[0][2] != null) {
return this.board[0][2];
}
return null;
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 670e0b8

Please sign in to comment.