Skip to content

Commit

Permalink
Update to 20w45a
Browse files Browse the repository at this point in the history
  • Loading branch information
Pyrofab committed Nov 8, 2020
1 parent 03f40bd commit 839901a
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import net.fabricmc.loom.task.RemapJarTask
import java.time.Year

plugins {
id 'fabric-loom' version '0.4-SNAPSHOT'
id 'fabric-loom' version '0.5-SNAPSHOT'
id "net.minecrell.licenser" version "0.4.1"
id 'com.matthewprenger.cursegradle' version '1.4.0'
id "com.jfrog.bintray" version '1.8.4'
Expand Down
10 changes: 5 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ org.gradle.jvmargs=-Xmx1G

# Fabric Properties
# check these on https://fabricmc.net/use
minecraft_version=1.16.2
yarn_mappings=1.16.2+build.6
loader_version=0.9.1+build.205
fabric_version=0.17.2+build.396-1.16
minecraft_version=20w45a
yarn_mappings=20w45a+build.31
loader_version=0.10.6+build.214
fabric_version=0.25.4+1.17

# Mod Properties
mod_version = 1.2.1
mod_version = 1.3.0-nightly.20w45a
maven_group = io.github.ladysnake
archives_base_name = Pal

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ protected void updateState(boolean enabled) {
}

private void updateBacking(boolean enabled) {
this.setter.set(getGamemode(this.player), this.player.abilities, enabled);
this.setter.set(getGamemode(this.player), this.player.getAbilities(), enabled);
}

@Override
Expand All @@ -57,7 +57,7 @@ protected void sync() {

@Override
public boolean isEnabled() {
return this.getter.test(this.player.abilities);
return this.getter.test(this.player.getAbilities());
}

public void checkConflict() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,24 +39,24 @@ public abstract class ServerPlayerInteractionManagerMixin {
public ServerPlayerEntity player;

@Inject(
method = "setGameMode",
method = "setGameMode(Lnet/minecraft/world/GameMode;Lnet/minecraft/world/GameMode;)V",
at = @At(
value = "INVOKE",
target = "Lnet/minecraft/world/GameMode;setAbilities(Lnet/minecraft/entity/player/PlayerAbilities;)V"
))
private void saveFlying(GameMode newMode, GameMode previousMode, CallbackInfo info) {
PAL_FLYING.set(player.abilities.flying);
PAL_FLYING.set(player.getAbilities().flying);
}

@Inject(
method = "setGameMode",
method = "setGameMode(Lnet/minecraft/world/GameMode;Lnet/minecraft/world/GameMode;)V",
at = @At(
value = "INVOKE",
target = "Lnet/minecraft/world/GameMode;setAbilities(Lnet/minecraft/entity/player/PlayerAbilities;)V",
shift = AFTER
))
private void keepAbilities(GameMode newMode, GameMode previousMode, CallbackInfo info) {
player.abilities.flying = PAL_FLYING.get(); // will be overruled if unworthy
player.getAbilities().flying = PAL_FLYING.get(); // will be overruled if unworthy
PlayerAbilityView.of(this.player).refreshAllPalAbilities(false);
}
}
2 changes: 1 addition & 1 deletion src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
],
"depends": {
"fabric": "*",
"minecraft": ">=1.16-"
"minecraft": ">=1.17-"
},
"custom": {
"modmenu:api": true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ public BadFlightItem(Settings settings) {
public TypedActionResult<ItemStack> use(World world, PlayerEntity user, Hand hand) {
if (!world.isClient) {
// Direct ability access, issues abound !
user.abilities.allowFlying = !user.abilities.allowFlying;
user.abilities.flying &= user.abilities.allowFlying;
user.getAbilities().allowFlying = !user.getAbilities().allowFlying;
user.getAbilities().flying &= user.getAbilities().allowFlying;
user.sendAbilitiesUpdate();
user.sendMessage(new LiteralText("Flight " + (user.abilities.allowFlying ? "enabled" : "disabled")), true);
user.sendMessage(new LiteralText("Flight " + (user.getAbilities().allowFlying ? "enabled" : "disabled")), true);
}
return TypedActionResult.success(user.getStackInHand(hand));
}
Expand Down

0 comments on commit 839901a

Please sign in to comment.