Skip to content
This repository has been archived by the owner on Jan 4, 2024. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'origin/1.17-fabric' into 1.17-fabric
Browse files Browse the repository at this point in the history
  • Loading branch information
florensie committed Oct 10, 2021
2 parents 4519e41 + 7c4f252 commit 1d35689
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 13 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [5.0.1] - 2021-10-04
### Fixed
- Update expandability to properly working version

## [4.0.2] - 2021-10-04
### Fixed
- Rollback bundled version of expandability

## [5.0.0] - 2021-10-08
### Changed
- Updated for 1.17.1
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ loader_version=0.11.7
parchment_version=2021.09.05

# Mod Properties
mod_version=5.0.0
mod_version=5.0.1
maven_group=artifacts
archives_base_name=artifacts

# Dependencies
fabric_version=0.40.1+1.17
trinkets_version=3.0.4
cca_version=3.1.1
expandability_version=3.0.2
expandability_version=4.0.2
cloth_config_version=5.0.38
mod_menu_version=2.0.13
step_height_attr_version=v1.0.1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
import be.florens.expandability.api.fabric.PlayerSwimCallback;
import net.fabricmc.fabric.api.networking.v1.PacketSender;
import net.fabricmc.fabric.api.networking.v1.ServerPlayNetworking;
import net.fabricmc.fabric.api.util.TriState;
import net.minecraft.client.Minecraft;
import net.minecraft.locale.Language;
import net.minecraft.network.FriendlyByteBuf;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.server.network.ServerGamePacketListenerImpl;
import net.minecraft.world.InteractionResult;
import net.minecraft.world.entity.player.Player;

import java.util.Collections;
Expand All @@ -35,11 +35,11 @@ public HeliumFlamingoItem() {
ServerPlayNetworking.registerGlobalReceiver(C2S_AIR_SWIMMING_ID, HeliumFlamingoItem::handleAirSwimmingPacket);
}

private static InteractionResult onPlayerSwim(Player player) {
private static TriState onPlayerSwim(Player player) {
return Components.SWIM_ABILITIES.maybeGet(player)
.filter(SwimAbilityComponent::isSwimming)
.map(swimAbilities -> InteractionResult.SUCCESS)
.orElse(InteractionResult.PASS);
.map(swimAbilities -> TriState.TRUE)
.orElse(TriState.DEFAULT);
}

private static void handleAirSwimmingPacket(MinecraftServer server, ServerPlayer player, ServerGamePacketListenerImpl handler, FriendlyByteBuf buf, PacketSender packetSender) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
import artifacts.trinkets.TrinketsHelper;
import be.florens.expandability.api.fabric.PlayerSwimCallback;
import dev.emi.trinkets.api.SlotReference;
import net.fabricmc.fabric.api.util.TriState;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.world.InteractionResult;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.ItemStack;
Expand All @@ -19,11 +19,11 @@ public CharmOfSinkingItem() {
PlayerSwimCallback.EVENT.register(CharmOfSinkingItem::onPlayerSwim);
}

private static InteractionResult onPlayerSwim(Player player) {
private static TriState onPlayerSwim(Player player) {
return Components.SWIM_ABILITIES.maybeGet(player)
.filter(SwimAbilityComponent::isSinking)
.map(swimAbilities -> InteractionResult.FAIL)
.orElse(InteractionResult.PASS);
.map(swimAbilities -> TriState.FALSE)
.orElse(TriState.DEFAULT);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ private double increaseSwimUpSpeed(double y) {

// This is a big method, so I feel more comfortable with a slice than an ordinal
// big method, big annotation, big fun
@ModifyArg(method = "travel", index = 0, allow = 1,
@ModifyArg(method = "travel", allow = 1,
at = @At(value = "INVOKE", target = "Lnet/minecraft/world/entity/LivingEntity;moveRelative(FLnet/minecraft/world/phys/Vec3;)V"),
slice = @Slice(
from = @At(value = "INVOKE", target = "Lnet/minecraft/world/entity/LivingEntity;isInWater()Z"),
Expand All @@ -34,7 +34,6 @@ private float increaseSwimSpeed(float speed) {
@Unique
@Override
public double artifacts$getIncreasedSwimSpeed(double speed) {
return TrinketsHelper.isEquipped(Items.FLIPPERS, (LivingEntity) (Object) this)
? speed * 2 : speed;
return TrinketsHelper.isEquipped(Items.FLIPPERS, (LivingEntity) (Object) this) ? speed * 2 : speed;
}
}

0 comments on commit 1d35689

Please sign in to comment.