Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
hamusuke0323 committed May 5, 2021
1 parent abba63b commit aa4dea5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public static void register(CommandDispatcher<ServerCommandSource> dispatcher) {
private static int noGravity(ServerCommandSource source, Collection<? extends Entity> entities, boolean flag) {
entities.forEach((entity) -> {
entity.setNoGravity(flag);
if (flag) {
if (!flag) {
entity.fallDistance = -(float) (entity.getY() + 10.0D);
}
});
Expand Down Expand Up @@ -78,4 +78,4 @@ private static int setInvisible(ServerCommandSource source, Collection<? extends

return entities.size();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ public void appendTooltip(ItemStack stack, @Nullable World world, List<Text> too

public TypedActionResult<ItemStack> use(World world, PlayerEntity playerIn, Hand handIn) {
ItemStack item = playerIn.getStackInHand(handIn);
if(!playerIn.abilities.allowFlying) {
if (!playerIn.abilities.allowFlying) {
playerIn.abilities.allowFlying = true;
playerIn.sendAbilitiesUpdate();
}else {
} else {
playerIn.abilities.allowFlying = false;
playerIn.abilities.flying = false;
playerIn.sendAbilitiesUpdate();
playerIn.fallDistance = -(float)(playerIn.getY() + 10.0D);
playerIn.fallDistance = -(float) (playerIn.getY() + 10.0D);
}
return new TypedActionResult<>(ActionResult.SUCCESS, item);
}
Expand Down

0 comments on commit aa4dea5

Please sign in to comment.