Skip to content

Commit

Permalink
See PR4
Browse files Browse the repository at this point in the history
  • Loading branch information
sakura-ryoko committed Jun 23, 2024
1 parent 1596699 commit 700b8c8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public enum FeatureToggle implements IHotkeyTogglable, IConfigNotifiable<IConfig
TWEAK_AFTER_CLICKER ("tweakAfterClicker", false, "", KeybindSettings.INGAME_BOTH, "Enables a \"after clicker\" tweak, which does automatic right\nclicks on the just-placed block.\nUseful for example for Repeaters (setting the delay).\nTo quickly adjust the value, scroll while\nholding down the tweak toggle keybind."),
TWEAK_AIM_LOCK ("tweakAimLock", false, "", "Enables an aim lock, locking the yaw and pitch rotations\nto the current values.\nThis is separate from the snap aim lock,\nwhich locks them to the snapped value.\nThis allows locking them \"freely\" to the current value."),
TWEAK_ANGEL_BLOCK ("tweakAngelBlock", false, "", "Enables an \"Angel Block\" tweak, which allows\nplacing blocks in mid-air in Creative mode.\nPowered by \"Flotato\" technology."),
TWEAK_AUTO_SWITCH_ELYTRA ("tweakAutoSwitchElytra", false, "", "Automatically switches to the Elytra when falling\nmore than 20 blocks, and back to the previous\nchest equipment when landing.\n\n(Inspired by GoodTimeWithScar)"),
TWEAK_AUTO_SWITCH_ELYTRA ("tweakAutoSwitchElytra", false, "", "Automatically switches to the Elytra when falling\nand back to the previous chest equipment when landing."),
TWEAK_BLOCK_REACH_OVERRIDE ("tweakBlockReachOverride", false, true, "", "Overrides the block reach distance with\nthe one set in Generic -> blockReachDistance"),
TWEAK_BLOCK_TYPE_BREAK_RESTRICTION("tweakBlockTypeBreakRestriction", false, "", "Restricts which blocks you are able to break (manually).\nSee the corresponding 'blockBreakRestriction*' configs in the Lists category."),
TWEAK_BREAKING_GRID ("tweakBreakingGrid", false, "", KeybindSettings.INGAME_BOTH, "When enabled, you can only break blocks in\na grid pattern, with a configurable interval.\nTo quickly adjust the interval, scroll while\nholding down the tweak toggle keybind."),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,12 +132,15 @@ private void onFallFlyingCheckChestSlot(CallbackInfo ci)
{
if (FeatureToggle.TWEAK_AUTO_SWITCH_ELYTRA.getBooleanValue())
{
// auto switch if it is not elytra after falling more than 20 blocks, or is totally broken.
// This also shouldn't activate on the Ground if the Chest Equipment is EMPTY, or not an Elytra
// To be swapped back.
// Sakura's version calculating fall distance...
/*
if ((!this.getEquippedStack(EquipmentSlot.CHEST).isOf(Items.ELYTRA) && this.fallDistance > 20.0f)
|| (this.getEquippedStack(EquipmentSlot.CHEST).getDamage() > this.getEquippedStack(EquipmentSlot.CHEST).getMaxDamage() - 10)
&& (!this.getEquippedStack(EquipmentSlot.CHEST).isEmpty() || this.autoSwitchElytraChestplate.isOf(Items.ELYTRA)))
*/
// auto switch if it is not elytra or is totally broken.
if (getEquippedStack(EquipmentSlot.CHEST).isOf(Items.ELYTRA) == false ||
getEquippedStack(EquipmentSlot.CHEST).getDamage() > getEquippedStack(EquipmentSlot.CHEST).getMaxDamage() - 10)
{
this.autoSwitchElytraChestplate = this.getEquippedStack(EquipmentSlot.CHEST).copy();
InventoryUtils.swapElytraWithChestPlate(this);
Expand Down

0 comments on commit 700b8c8

Please sign in to comment.