Skip to content

Commit

Permalink
Merge pull request #12 from r1tsuu/master
Browse files Browse the repository at this point in the history
Fix unequipping Piston Boots with armor stand not resets step height #12780
  • Loading branch information
Dream-Master authored Mar 5, 2023
2 parents 4564f68 + 2ba11b0 commit 7e79370
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,21 +109,14 @@ public void onPlayerJump(LivingEvent.LivingJumpEvent event) {
}
}

private boolean pistonBootsStepHeight = false;

@SubscribeEvent
public void pistonBootsUnequipped(LivingEvent.LivingUpdateEvent event) {
if (event.entityLiving instanceof EntityPlayer) {
if (event.entityLiving instanceof EntityPlayer && ConfigHandler.pistonBootsAutoStep) {
EntityPlayer player = (EntityPlayer) event.entityLiving;
if (Wearing.isWearingBoots(player)) {
if (!pistonBootsStepHeight) {
pistonBootsStepHeight = true;
}
player.stepHeight = 1.001F;
} else {
if (pistonBootsStepHeight) {
player.stepHeight = 0.5001F;
pistonBootsStepHeight = false;
}
player.stepHeight = 0.5001F;
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ public ItemPistonBoots() {

@Override
public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack) {
if (ConfigHandler.pistonBootsAutoStep) player.stepHeight = 1.001F;
if (ConfigHandler.pistonBootsSprintBoost != 0 && player.isSprinting()) player.addPotionEffect(
new PotionEffect(Potion.moveSpeed.getId(), 1, ConfigHandler.pistonBootsSprintBoost - 1));
}
Expand Down

0 comments on commit 7e79370

Please sign in to comment.