Skip to content
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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

KealJones
Copy link
Contributor

Get compatibility with 1.21.4. It has a new Gliding mechanic that replaces FallFlying 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

} 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)) {
Copy link
Contributor Author

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"))
Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant