Skip to content

Commit 551a593

Browse files
author
AdrianTodt
committed
Minor patch to fix a bug with Elytra Hopping
1 parent 2f1ea0b commit 551a593

File tree

5 files changed

+37
-8
lines changed

5 files changed

+37
-8
lines changed

README.md

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,25 @@ You can add the library by inserting the following in your `build.gradle` :
1818

1919
```gradle
2020
repositories {
21-
maven { url 'https://jitpack.io' }
21+
maven {
22+
url = 'https://maven.cafeteria.dev'
23+
content {
24+
includeGroup 'net.adriantodt.fabricmc'
25+
}
26+
}
27+
maven {
28+
name = 'Ladysnake Mods'
29+
url = 'https://ladysnake.jfrog.io/artifactory/mods'
30+
content {
31+
includeGroup 'io.github.ladysnake'
32+
includeGroupByRegex 'io\\.github\\.onyxstudios.*'
33+
}
34+
}
2235
}
2336
2437
dependencies {
25-
modImplementation com.github.CafeteriaGuild:FallFlyingLib:${project.ffl_version}"
26-
include "com.github.CafeteriaGuild:FallFlyingLib:${project.ffl_version}"
38+
modImplementation "net.adriantodt.fabricmc:fallflyinglib:${project.ffl_version}"
39+
include "net.adriantodt.fabricmc:fallflyinglib:${project.ffl_version}"
2740
}
2841
```
2942

build.gradle.kts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,17 @@ publishing {
9595
}
9696
// select the repositories you want to publish to
9797
repositories {
98+
maven {
99+
url = uri("https://maven.cafeteria.dev/releases")
100+
101+
credentials {
102+
username = "${project.property("mcdUsername")}"
103+
password = "${project.property("mcdPassword")}"
104+
}
105+
authentication {
106+
create("basic", BasicAuthentication::class.java)
107+
}
108+
}
98109
mavenLocal()
99110
}
100111
}

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ loader_version=0.11.3
66
#Fabric api
77
fabric_version=0.34.2+1.16
88
# Mod Properties
9-
mod_version=2.0.0
9+
mod_version=2.0.1
1010
maven_group=net.adriantodt.fabricmc
1111
archives_base_name=fallflyinglib

src/main/java/net/adriantodt/fallflyinglib/impl/FallFlyingPipeline.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public void tick() {
3939

4040
// Check conditions, then call the appropriate method.
4141
// If the method returns false, player is not fall flying anymore.
42-
boolean flag = (checkConditions() || stopFallFly(Reason.CONDITIONS_NOT_MET)) && (canFallFly() || stopFallFly(Reason.NO_SOURCE));
42+
boolean flag = canFallFly();
4343

4444
// Generate a PostTick event if we're fall flying.
4545
// It is used to implement Vanilla support.
@@ -53,9 +53,14 @@ public void tick() {
5353
}
5454
}
5555

56+
public boolean canFallFly() {
57+
return (checkFlightConditions() || stopFallFly(Reason.CONDITIONS_NOT_MET))
58+
&& (checkFallFlyAbility() || stopFallFly(Reason.NO_SOURCE));
59+
}
60+
5661
// Exploitable methods
5762

58-
public boolean checkConditions() {
63+
public boolean checkFlightConditions() {
5964
// This method is called to check if we can start or keep fall flying.
6065
// It's implementation comes from PlayerEntity#checkFallFlying.
6166

@@ -65,7 +70,7 @@ public boolean checkConditions() {
6570
&& !player.hasStatusEffect(StatusEffects.LEVITATION);
6671
}
6772

68-
public boolean canFallFly() {
73+
public boolean checkFallFlyAbility() {
6974
// This method is called to check only if we can keep fall flying. Basically, the Elytra check.
7075

7176
return data.ffl_isFallFlyingAbilityEnabled(); // Don't mixin it unless strictly necessary.

src/main/java/net/adriantodt/fallflyinglib/mixin/PlayerEntityMixin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public void ffl_setFallFlyingAbilityEnabled(boolean enabled) {
5252
cancellable = true
5353
)
5454
public void ffl_patchCheckFallFlying(CallbackInfoReturnable<Boolean> info) {
55-
if (!fallflyinglib$lock && this.fallflyinglib$pipeline.checkConditions() && this.fallflyinglib$pipeline.canFallFly()) {
55+
if (!fallflyinglib$lock && this.fallflyinglib$pipeline.canFallFly()) {
5656
this.startFallFlying();
5757
info.setReturnValue(true);
5858
} else {

0 commit comments

Comments
 (0)