Skip to content

Commit

Permalink
Prevent milk bucket from removing flight when player is in creative mode
Browse files Browse the repository at this point in the history
  • Loading branch information
embeddedt committed Jul 8, 2021
1 parent 7f97ab5 commit 3653d93
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/main/java/com/lothrazar/cyclicmagic/item/ItemFlight.java
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,12 @@ private void setFlying(EntityPlayer player) {
}

public static void setNonFlying(EntityPlayer player) {
player.capabilities.allowFlying = false;
player.capabilities.isFlying = false;
if (player instanceof EntityPlayerMP) { //force clientside to update
ModCyclic.network.sendTo(new PacketSyncPlayerFlying(false), (EntityPlayerMP) player);
if(!player.isCreative()) {
player.capabilities.allowFlying = false;
player.capabilities.isFlying = false;
if (player instanceof EntityPlayerMP) { //force clientside to update
ModCyclic.network.sendTo(new PacketSyncPlayerFlying(false), (EntityPlayerMP) player);
}
}
IPlayerExtendedProperties props = CapabilityRegistry.getPlayerProperties(player);
props.setFlyingTimer(0);
Expand Down

0 comments on commit 3653d93

Please sign in to comment.