Skip to content

Commit

Permalink
fix: ability fly
Browse files Browse the repository at this point in the history
  • Loading branch information
cnlimiter committed Jan 23, 2024
1 parent 844f753 commit 927f3f9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
3 changes: 3 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@ dependencies {
compileOnly fg.deobf("com.blamejared.crafttweaker:CraftTweaker-forge-${mc_version}:${crafttweaker_version}")
compileOnly fg.deobf("curse.maven:jade-324717:${jade_id}")

compileOnly(fg.deobf("top.theillusivec4.curios:curios-forge:${curios_version}:api"))
runtimeOnly(fg.deobf("top.theillusivec4.curios:curios-forge:${curios_version}"))

compileOnly fg.deobf("dev.latvian.mods:kubejs-forge:${kubejs_version}")
compileOnly fg.deobf("dev.latvian.mods:rhino-forge:${rhino_version}")
compileOnly fg.deobf("dev.architectury:architectury-forge:${architectury_version}")
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jade_id=4986594
kubejs_version=2001.6.3-build.46
architectury_version=9.1.12
rhino_version=2001.2.2-build.6

curios_version=5.4.7+1.20.1

## Mod Properties
mod_id=avaritia
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@ public static void updateAbilities(LivingEvent.LivingTickEvent event) {
if (hasChest) {
handleChestStateChange(entity);
} else {
if (!entity.isCreative()) {
entity.getAbilities().mayfly = false;
entity.getAbilities().flying = false;
}
// if (!entity.isCreative()) {
// entity.getAbilities().mayfly = false;
// entity.getAbilities().flying = false;
// }
entitiesWithChest.remove(key);
}
} else {
Expand All @@ -96,7 +96,6 @@ public static void updateAbilities(LivingEvent.LivingTickEvent event) {
if (entitiesWithBoots.contains(key)) {
if (hasBoots) {
handleBootsStateChange(entity);
entitiesWithBoots.add(key);
} else {
entity.setMaxUpStep(0.5F);
entitiesWithBoots.remove(key);
Expand Down Expand Up @@ -144,7 +143,7 @@ private static void handleHelmetStateChange(LivingEntity entity) {
private static void handleChestStateChange(LivingEntity entity) {
if (entity instanceof Player player) {
player.getAbilities().mayfly = true;
player.getAbilities().mayfly = true;
player.getAbilities().flying = true;
List<MobEffectInstance> effects = Lists.newArrayList(player.getActiveEffects());
for (MobEffectInstance potion : Collections2.filter(effects, potion -> !potion.getEffect().isBeneficial())) {
player.removeEffect(potion.getEffect());
Expand Down

0 comments on commit 927f3f9

Please sign in to comment.