Skip to content

Commit

Permalink
Update to Minecraft 1.21.3/2
Browse files Browse the repository at this point in the history
  • Loading branch information
Wudji committed Oct 25, 2024
1 parent 026e800 commit 52f2a07
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 11 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'fabric-loom' version '1.6-SNAPSHOT'
id 'fabric-loom' version '1.8-SNAPSHOT'
}

sourceCompatibility = JavaVersion.VERSION_21
Expand Down
12 changes: 6 additions & 6 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ archives_base_name = xplus-autofish

# Fabric Properties
# check these on https://modmuss50.me/fabric.html or https://fabricmc.net/use
minecraft_version=1.21
yarn_mappings=1.21+build.1
loader_version=0.15.11
minecraft_version=1.21.3
yarn_mappings=1.21.3+build.2
loader_version=0.16.7

# Fabric API
fabric_version=0.100.1+1.21
fabric_version = 0.106.1+1.21.3

#Cloth Config API
cloth_config_version=15.0.127
cloth_config_version = 16.0.141

modmenu_version = 11.0.0-beta.1
modmenu_version = 12.0.0-beta.1
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
5 changes: 4 additions & 1 deletion src/main/java/troy/autofish/Autofish.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,15 @@ public Autofish(FabricModAutofish modAutofish) {
//Initiate the repeating action for persistent mode casting
modAutofish.getScheduler().scheduleRepeatingAction(10000, () -> {
if(!modAutofish.getConfig().isPersistentMode()) return;
if(modAutofish.getConfig().isNoBreak() && getHeldItem().getDamage() >= 63) return;
if(!isHoldingFishingRod()) return;
if(hookExists){
if(isBobberInWater()) return;

else useRod();
}
if(modAutofish.getScheduler().isRecastQueued()) return;

useRod();
});
}
Expand Down Expand Up @@ -260,7 +263,7 @@ public void useRod() {
actionResult = client.interactionManager.interactItem(client.player, hand);
}
if (actionResult != null && actionResult.isAccepted()) {
if (actionResult.shouldSwingHand()) {
if (actionResult == ActionResult.SUCCESS) {
client.player.swingHand(hand);
}
client.gameRenderer.firstPersonRenderer.resetEquipProgress(hand);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public void handleHookRemoved() {
@Override
public void handlePacket(Autofish autofish, Packet<?> packet, MinecraftClient minecraft) {
if (packet instanceof EntityVelocityUpdateS2CPacket velocityPacket) {
if (minecraft.player != null && minecraft.player.fishHook != null && minecraft.player.fishHook.getId() == velocityPacket.getId()) {
if (minecraft.player != null && minecraft.player.fishHook != null && minecraft.player.fishHook.getId() == velocityPacket.getEntityId()) {
// Wait until the bobber has rose in the water.
// Prevent remarking the bobber rise timestamp until it is reset by catching.
if (hasHitWater && bobberRiseTimestamp == 0 && velocityPacket.getVelocityY() > 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public void handlePacket(Autofish autofish, Packet<?> packet, MinecraftClient mi
if (packet instanceof PlaySoundS2CPacket) {
PlaySoundS2CPacket soundPacket = (PlaySoundS2CPacket) packet;
SoundEvent soundEvent = soundPacket.getSound().value();
soundName = soundEvent.getId().toString();
soundName = soundEvent.id().toString();
x = soundPacket.getX();
y = soundPacket.getY();
z = soundPacket.getZ();
Expand Down

0 comments on commit 52f2a07

Please sign in to comment.