-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compat with 1.21.4 #20
base: master
Are you sure you want to change the base?
Conversation
} else | ||
return false; | ||
} | ||
|
||
public static boolean checkFallFlyingIgnoreGround(ClientPlayerEntity player) { | ||
if (!player.isTouchingWater() && !player.hasStatusEffect(StatusEffects.LEVITATION)) { | ||
var itemStack = player.getEquippedStack(EquipmentSlot.CHEST); | ||
if (itemStack.isOf(Items.ELYTRA) && ElytraItem.isUsable(itemStack)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ElytraItem
is gone I didn't try hard to find a replacement for the ElytraItem.isUsable
call removing it seemed fine enough.
@@ -29,16 +29,16 @@ private ClientPlayerEntity player() { | |||
private boolean awaitingElytra = false; | |||
|
|||
@SuppressWarnings("ConstantConditions") | |||
@Inject(method = "tickFallFlying", at = @At("TAIL")) | |||
@Inject(method = "tickMovement", at = @At("TAIL")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The is a tickGliding
that replaced tickFallFlying
but it doesn't work at all as you never get a gliding tick that would have isGliding
as false. So I opted for tickMovement
which seems to work but is obviously far less efficient.
Get compatibility with 1.21.4. It has a new
Gliding
mechanic that replacesFallFlying
and some other basic api changes but overall the logic is mostly the same. I left some comments in this PR for a few areas.It seems that my changes are slightly less efficient and don't work with Meteor's ElytraFly "bounce" mode but for casual play it works perfectly well... It works better on a server than in single player because of the addition of minor lag on servers, I assume. Something about the last tick before hitting the ground id think.
I am by no means an expert in fabric modding or java so anyone that can figure it out feel free to branch off this or do your own thing. <3