Подписывайтесь на наш Telegram и не пропускайте важные новости! Перейти

Часть функционала LuminarVisual AutoSwap 1.16.5 Forge

  • Автор темы Автор темы fimizok
  • Дата начала Дата начала
Начинающий
Начинающий
Статус
Оффлайн
Регистрация
25 Окт 2024
Сообщения
19
Реакции
0
Выберите загрузчик игры
  1. Forge
Всем привет, думаю кому-то понадобиться AutoSwap как в пульсе (из luminar visual)


Java:
Expand Collapse Copy
public class AutoSwap extends Function
{
public ModeSetting from;
public ModeSetting to;
public BindSetting swapKey;
public SliderSetting delay;
boolean swap;
boolean opened;
TimerUtil timer;
TimerUtil timer2;
    
public AutoSwap() {
super("AutoSwap", Category.Utils);
this.from = new ModeSetting("Свап с", "Тотем", new String[] { "Тотем", "Сфера" });
this.to = new ModeSetting("Свап на", "Тотем", new String[] { "Тотем", "Сфера" });
this.swapKey = new BindSetting("Кнопка свапа", -1);
this.delay = new SliderSetting("Задержка", 150.0f, 100.0f, 250.0f, 25.0f);
this.timer = new TimerUtil();
this.timer2 = new TimerUtil();
this.addSettings(new Setting[] { this.from, this.to, this.swapKey, this.delay });
    }
    
public void onKey(final int key) {
if (this.swapKey.get() == key && this.timer.passed(250L)) {
this.swap = true;
this.timer.reset();
this.timer2.reset();
        }
    }
    
@Subscribe
    public void onUpdate(final EventUpdate e) {
if (PlayerUtils.connectedTo("space-times")) {
this.print("Эта функция запрещена на сервере Space-Times!");
 this.toggle();
 return;
        }
final ItemStack offhandItemStack = AutoSwap.mc.player.getOffhandItem();
 final Item currentItem = offhandItemStack.getItem();
final boolean isHoldingSwapItem = currentItem == this.getSwapItem();
final boolean isHoldingSelectedItem = currentItem == this.getSelectedItem();
final int selectedItemSlot = this.getBestSlotForItem(this.getSelectedItem());
final int swapItemSlot = this.getBestSlotForItem(this.getSwapItem());
final boolean isSameItem = this.getSwapItem() == this.getSelectedItem();
final KeyBinding[] pressedKeys = { AutoSwap.mc.options.keyUp, AutoSwap.mc.options.keyDown, AutoSwap.mc.options.keyLeft, AutoSwap.mc.options.keyRight, AutoSwap.mc.options.keyJump, AutoSwap.mc.options.keySprint };
if (!this.opened) {
 this.updateKeyBindingState(pressedKeys);
        }
if (!this.swap) {
 return;
        }
 if (isSameItem) {
if (selectedItemSlot >= 0) {
 if (!isHoldingSelectedItem || (isSameItem && isHoldingSwapItem)) {
if (!this.opened) {
if (selectedItemSlot <= 35) {
AutoSwap.mc.setScreen((Screen)new InventoryScreen((PlayerEntity)AutoSwap.mc.player));
                        }
 else {
for (final KeyBinding keyBinding : pressedKeys) {
keyBinding.setDown(false);
                            }
                        }
this.opened = true;
                    }
if (this.timer2.passed(this.delay.get().longValue())) {
InventoryUtil.moveItem(selectedItemSlot, 45);
if (selectedItemSlot <= 35) {
AutoSwap.mc.setScreen((Screen)null);
                        }
this.swap = false;
this.opened = false;
                    }
                }
            }
else if (swapItemSlot >= 0) {
 if (!isHoldingSwapItem || (isSameItem && isHoldingSelectedItem)) {
if (!this.opened) {
if (swapItemSlot <= 35) {
AutoSwap.mc.setScreen((Screen)new InventoryScreen((PlayerEntity)AutoSwap.mc.player));
                        }
 else {
for (final KeyBinding keyBinding : pressedKeys) {
keyBinding.setDown(false);
                            }
                        }
this.opened = true;
                    }
if (this.timer2.passed(this.delay.get().longValue())) {
InventoryUtil.moveItem(swapItemSlot, 45);
if (swapItemSlot <= 35) {
AutoSwap.mc.setScreen((Screen)null);
                        }
this.swap = false;
this.opened = false;
                    }
                }
            }
 else {
this.swap = false;
            }
        }
 else {
if (selectedItemSlot >= 0 && (!isHoldingSelectedItem || (isSameItem && isHoldingSwapItem))) {
if (!this.opened) {
if (selectedItemSlot <= 35) {
AutoSwap.mc.setScreen((Screen)new InventoryScreen((PlayerEntity)AutoSwap.mc.player));
                    }
 else {
for (final KeyBinding keyBinding : pressedKeys) {
keyBinding.setDown(false);
                        }
                    }
this.opened = true;
                }
if (this.timer2.passed(this.delay.get().longValue())) {
InventoryUtil.moveItem(selectedItemSlot, 45);
if (selectedItemSlot <= 35) {
AutoSwap.mc.setScreen((Screen)null);
                    }
this.swap = false;
this.opened = false;
                }
            }
if (swapItemSlot >= 0 && (!isHoldingSwapItem || (isSameItem && isHoldingSelectedItem))) {
if (!this.opened) {
if (swapItemSlot <= 35) {
AutoSwap.mc.setScreen((Screen)new InventoryScreen((PlayerEntity)AutoSwap.mc.player));
                    }
 else {
for (final KeyBinding keyBinding : pressedKeys) {
keyBinding.setDown(false);
                        }
                    }
this.opened = true;
                }
if (this.timer2.passed(this.delay.get().longValue())) {
InventoryUtil.moveItem(swapItemSlot, 45);
if (swapItemSlot <= 35) {
AutoSwap.mc.setScreen((Screen)null);
                    }
this.swap = false;
this.opened = false;
                }
            }
        }
    }
    
private void updateKeyBindingState(final KeyBinding[] keyBindings) {
for (final KeyBinding keyBinding : keyBindings) {
final boolean isKeyPressed = InputMappings.isKeyDown(AutoSwap.mc.getWindow().getWindow(), keyBinding.getKey().getValue());
            keyBinding.setDown(isKeyPressed);
        }
    }
    
private Item getSwapItem() {
return this.getItemByType(this.to.get());
    }
    
private Item getSelectedItem() {
return this.getItemByType(this.from.get());
    }
    
private Item getItemByType(final String itemType) {
Item item = null;
 switch (itemType) {
case "\u0422\u043e\u0442\u0435\u043c": {
                item = Items.TOTEM_OF_UNDYING;
 break;
            }
case "\u0421\u0444\u0435\u0440\u0430": {
                item = Items.PLAYER_HEAD;
 break;
            }
 default: {
                item = Items.AIR;
 break;
            }
        }
 return item;
    }
    
private int getBestSlotForItem(final Item item) {
for (int i = 0; i < 9; ++i) {
if (AutoSwap.mc.player.inventory.getItem(i).getItem() == item) {
return i + 36;
            }
        }
for (int i = 9; i < 36; ++i) {
final ItemStack stack = AutoSwap.mc.player.inventory.getItem(i);
 if (stack.getItem() == item && stack.isEnchanted()) {
 return i;
            }
        }
for (int i = 9; i < 36; ++i) {
if (AutoSwap.mc.player.inventory.getItem(i).getItem() == item) {
 return i;
            }
        }
return -1;
    }
    
public void onEnable() {
 super.onEnable();
    }
}
 
окак
Модуль AutoSwap для LuminarVisual 1.16.5 Forge предоставляет функцию автоматической смены предметов в левой руке (оффхенде), подобно реализации в клиенте Pulse. Пользователь может настроить, с какого и на какой предмет производить "свап" (обмен), выбирая между "Тотемом" (Тотем Бессмертия) и "Сферой" (Голова Игрока), а также установить кнопку активации и задержку. Активировавшись по нажатию клавиши, модуль перемещает указанный предмет в оффхенд из инвентаря, при необходимости открывая его, но функция деактивируется при подключении к серверу "space-times".
 
окак
Модуль AutoSwap для LuminarVisual 1.16.5 Forge предоставляет функцию автоматической смены предметов в левой руке (оффхенде), подобно реализации в клиенте Pulse. Пользователь может настроить, с какого и на какой предмет производить "свап" (обмен), выбирая между "Тотемом" (Тотем Бессмертия) и "Сферой" (Голова Игрока), а также установить кнопку активации и задержку. Активировавшись по нажатию клавиши, модуль перемещает указанный предмет в оффхенд из инвентаря, при необходимости открывая его, но функция деактивируется при подключении к серверу "space-times".
Эта функция запрещена на сервере Space-Times
 
Всем привет, думаю кому-то понадобиться AutoSwap как в пульсе (из luminar visual)


Java:
Expand Collapse Copy
public class AutoSwap extends Function
{
public ModeSetting from;
public ModeSetting to;
public BindSetting swapKey;
public SliderSetting delay;
boolean swap;
boolean opened;
TimerUtil timer;
TimerUtil timer2;
   
public AutoSwap() {
super("AutoSwap", Category.Utils);
this.from = new ModeSetting("Свап с", "Тотем", new String[] { "Тотем", "Сфера" });
this.to = new ModeSetting("Свап на", "Тотем", new String[] { "Тотем", "Сфера" });
this.swapKey = new BindSetting("Кнопка свапа", -1);
this.delay = new SliderSetting("Задержка", 150.0f, 100.0f, 250.0f, 25.0f);
this.timer = new TimerUtil();
this.timer2 = new TimerUtil();
this.addSettings(new Setting[] { this.from, this.to, this.swapKey, this.delay });
    }
   
public void onKey(final int key) {
if (this.swapKey.get() == key && this.timer.passed(250L)) {
this.swap = true;
this.timer.reset();
this.timer2.reset();
        }
    }
   
@Subscribe
    public void onUpdate(final EventUpdate e) {
if (PlayerUtils.connectedTo("space-times")) {
this.print("Эта функция запрещена на сервере Space-Times!");
 this.toggle();
 return;
        }
final ItemStack offhandItemStack = AutoSwap.mc.player.getOffhandItem();
 final Item currentItem = offhandItemStack.getItem();
final boolean isHoldingSwapItem = currentItem == this.getSwapItem();
final boolean isHoldingSelectedItem = currentItem == this.getSelectedItem();
final int selectedItemSlot = this.getBestSlotForItem(this.getSelectedItem());
final int swapItemSlot = this.getBestSlotForItem(this.getSwapItem());
final boolean isSameItem = this.getSwapItem() == this.getSelectedItem();
final KeyBinding[] pressedKeys = { AutoSwap.mc.options.keyUp, AutoSwap.mc.options.keyDown, AutoSwap.mc.options.keyLeft, AutoSwap.mc.options.keyRight, AutoSwap.mc.options.keyJump, AutoSwap.mc.options.keySprint };
if (!this.opened) {
 this.updateKeyBindingState(pressedKeys);
        }
if (!this.swap) {
 return;
        }
 if (isSameItem) {
if (selectedItemSlot >= 0) {
 if (!isHoldingSelectedItem || (isSameItem && isHoldingSwapItem)) {
if (!this.opened) {
if (selectedItemSlot <= 35) {
AutoSwap.mc.setScreen((Screen)new InventoryScreen((PlayerEntity)AutoSwap.mc.player));
                        }
 else {
for (final KeyBinding keyBinding : pressedKeys) {
keyBinding.setDown(false);
                            }
                        }
this.opened = true;
                    }
if (this.timer2.passed(this.delay.get().longValue())) {
InventoryUtil.moveItem(selectedItemSlot, 45);
if (selectedItemSlot <= 35) {
AutoSwap.mc.setScreen((Screen)null);
                        }
this.swap = false;
this.opened = false;
                    }
                }
            }
else if (swapItemSlot >= 0) {
 if (!isHoldingSwapItem || (isSameItem && isHoldingSelectedItem)) {
if (!this.opened) {
if (swapItemSlot <= 35) {
AutoSwap.mc.setScreen((Screen)new InventoryScreen((PlayerEntity)AutoSwap.mc.player));
                        }
 else {
for (final KeyBinding keyBinding : pressedKeys) {
keyBinding.setDown(false);
                            }
                        }
this.opened = true;
                    }
if (this.timer2.passed(this.delay.get().longValue())) {
InventoryUtil.moveItem(swapItemSlot, 45);
if (swapItemSlot <= 35) {
AutoSwap.mc.setScreen((Screen)null);
                        }
this.swap = false;
this.opened = false;
                    }
                }
            }
 else {
this.swap = false;
            }
        }
 else {
if (selectedItemSlot >= 0 && (!isHoldingSelectedItem || (isSameItem && isHoldingSwapItem))) {
if (!this.opened) {
if (selectedItemSlot <= 35) {
AutoSwap.mc.setScreen((Screen)new InventoryScreen((PlayerEntity)AutoSwap.mc.player));
                    }
 else {
for (final KeyBinding keyBinding : pressedKeys) {
keyBinding.setDown(false);
                        }
                    }
this.opened = true;
                }
if (this.timer2.passed(this.delay.get().longValue())) {
InventoryUtil.moveItem(selectedItemSlot, 45);
if (selectedItemSlot <= 35) {
AutoSwap.mc.setScreen((Screen)null);
                    }
this.swap = false;
this.opened = false;
                }
            }
if (swapItemSlot >= 0 && (!isHoldingSwapItem || (isSameItem && isHoldingSelectedItem))) {
if (!this.opened) {
if (swapItemSlot <= 35) {
AutoSwap.mc.setScreen((Screen)new InventoryScreen((PlayerEntity)AutoSwap.mc.player));
                    }
 else {
for (final KeyBinding keyBinding : pressedKeys) {
keyBinding.setDown(false);
                        }
                    }
this.opened = true;
                }
if (this.timer2.passed(this.delay.get().longValue())) {
InventoryUtil.moveItem(swapItemSlot, 45);
if (swapItemSlot <= 35) {
AutoSwap.mc.setScreen((Screen)null);
                    }
this.swap = false;
this.opened = false;
                }
            }
        }
    }
   
private void updateKeyBindingState(final KeyBinding[] keyBindings) {
for (final KeyBinding keyBinding : keyBindings) {
final boolean isKeyPressed = InputMappings.isKeyDown(AutoSwap.mc.getWindow().getWindow(), keyBinding.getKey().getValue());
            keyBinding.setDown(isKeyPressed);
        }
    }
   
private Item getSwapItem() {
return this.getItemByType(this.to.get());
    }
   
private Item getSelectedItem() {
return this.getItemByType(this.from.get());
    }
   
private Item getItemByType(final String itemType) {
Item item = null;
 switch (itemType) {
case "\u0422\u043e\u0442\u0435\u043c": {
                item = Items.TOTEM_OF_UNDYING;
 break;
            }
case "\u0421\u0444\u0435\u0440\u0430": {
                item = Items.PLAYER_HEAD;
 break;
            }
 default: {
                item = Items.AIR;
 break;
            }
        }
 return item;
    }
   
private int getBestSlotForItem(final Item item) {
for (int i = 0; i < 9; ++i) {
if (AutoSwap.mc.player.inventory.getItem(i).getItem() == item) {
return i + 36;
            }
        }
for (int i = 9; i < 36; ++i) {
final ItemStack stack = AutoSwap.mc.player.inventory.getItem(i);
 if (stack.getItem() == item && stack.isEnchanted()) {
 return i;
            }
        }
for (int i = 9; i < 36; ++i) {
if (AutoSwap.mc.player.inventory.getItem(i).getItem() == item) {
 return i;
            }
        }
return -1;
    }
   
public void onEnable() {
 super.onEnable();
    }
}
если че кто делает свой автосвап/автототем лучше так не делать:
AutoSwap.mc.setScreen((Screen)new InventoryScreen((PlayerEntity)AutoSwap.mc.player));
лучше просто юзать в конце свапа это:
mc.player.closeHandledScreen() или через пакет вместе с этим закрывать инв и у вас все будет работать
 
Всем привет, думаю кому-то понадобиться AutoSwap как в пульсе (из luminar visual)


Java:
Expand Collapse Copy
public class AutoSwap extends Function
{
public ModeSetting from;
public ModeSetting to;
public BindSetting swapKey;
public SliderSetting delay;
boolean swap;
boolean opened;
TimerUtil timer;
TimerUtil timer2;
   
public AutoSwap() {
super("AutoSwap", Category.Utils);
this.from = new ModeSetting("Свап с", "Тотем", new String[] { "Тотем", "Сфера" });
this.to = new ModeSetting("Свап на", "Тотем", new String[] { "Тотем", "Сфера" });
this.swapKey = new BindSetting("Кнопка свапа", -1);
this.delay = new SliderSetting("Задержка", 150.0f, 100.0f, 250.0f, 25.0f);
this.timer = new TimerUtil();
this.timer2 = new TimerUtil();
this.addSettings(new Setting[] { this.from, this.to, this.swapKey, this.delay });
    }
   
public void onKey(final int key) {
if (this.swapKey.get() == key && this.timer.passed(250L)) {
this.swap = true;
this.timer.reset();
this.timer2.reset();
        }
    }
   
@Subscribe
    public void onUpdate(final EventUpdate e) {
if (PlayerUtils.connectedTo("space-times")) {
this.print("Эта функция запрещена на сервере Space-Times!");
 this.toggle();
 return;
        }
final ItemStack offhandItemStack = AutoSwap.mc.player.getOffhandItem();
 final Item currentItem = offhandItemStack.getItem();
final boolean isHoldingSwapItem = currentItem == this.getSwapItem();
final boolean isHoldingSelectedItem = currentItem == this.getSelectedItem();
final int selectedItemSlot = this.getBestSlotForItem(this.getSelectedItem());
final int swapItemSlot = this.getBestSlotForItem(this.getSwapItem());
final boolean isSameItem = this.getSwapItem() == this.getSelectedItem();
final KeyBinding[] pressedKeys = { AutoSwap.mc.options.keyUp, AutoSwap.mc.options.keyDown, AutoSwap.mc.options.keyLeft, AutoSwap.mc.options.keyRight, AutoSwap.mc.options.keyJump, AutoSwap.mc.options.keySprint };
if (!this.opened) {
 this.updateKeyBindingState(pressedKeys);
        }
if (!this.swap) {
 return;
        }
 if (isSameItem) {
if (selectedItemSlot >= 0) {
 if (!isHoldingSelectedItem || (isSameItem && isHoldingSwapItem)) {
if (!this.opened) {
if (selectedItemSlot <= 35) {
AutoSwap.mc.setScreen((Screen)new InventoryScreen((PlayerEntity)AutoSwap.mc.player));
                        }
 else {
for (final KeyBinding keyBinding : pressedKeys) {
keyBinding.setDown(false);
                            }
                        }
this.opened = true;
                    }
if (this.timer2.passed(this.delay.get().longValue())) {
InventoryUtil.moveItem(selectedItemSlot, 45);
if (selectedItemSlot <= 35) {
AutoSwap.mc.setScreen((Screen)null);
                        }
this.swap = false;
this.opened = false;
                    }
                }
            }
else if (swapItemSlot >= 0) {
 if (!isHoldingSwapItem || (isSameItem && isHoldingSelectedItem)) {
if (!this.opened) {
if (swapItemSlot <= 35) {
AutoSwap.mc.setScreen((Screen)new InventoryScreen((PlayerEntity)AutoSwap.mc.player));
                        }
 else {
for (final KeyBinding keyBinding : pressedKeys) {
keyBinding.setDown(false);
                            }
                        }
this.opened = true;
                    }
if (this.timer2.passed(this.delay.get().longValue())) {
InventoryUtil.moveItem(swapItemSlot, 45);
if (swapItemSlot <= 35) {
AutoSwap.mc.setScreen((Screen)null);
                        }
this.swap = false;
this.opened = false;
                    }
                }
            }
 else {
this.swap = false;
            }
        }
 else {
if (selectedItemSlot >= 0 && (!isHoldingSelectedItem || (isSameItem && isHoldingSwapItem))) {
if (!this.opened) {
if (selectedItemSlot <= 35) {
AutoSwap.mc.setScreen((Screen)new InventoryScreen((PlayerEntity)AutoSwap.mc.player));
                    }
 else {
for (final KeyBinding keyBinding : pressedKeys) {
keyBinding.setDown(false);
                        }
                    }
this.opened = true;
                }
if (this.timer2.passed(this.delay.get().longValue())) {
InventoryUtil.moveItem(selectedItemSlot, 45);
if (selectedItemSlot <= 35) {
AutoSwap.mc.setScreen((Screen)null);
                    }
this.swap = false;
this.opened = false;
                }
            }
if (swapItemSlot >= 0 && (!isHoldingSwapItem || (isSameItem && isHoldingSelectedItem))) {
if (!this.opened) {
if (swapItemSlot <= 35) {
AutoSwap.mc.setScreen((Screen)new InventoryScreen((PlayerEntity)AutoSwap.mc.player));
                    }
 else {
for (final KeyBinding keyBinding : pressedKeys) {
keyBinding.setDown(false);
                        }
                    }
this.opened = true;
                }
if (this.timer2.passed(this.delay.get().longValue())) {
InventoryUtil.moveItem(swapItemSlot, 45);
if (swapItemSlot <= 35) {
AutoSwap.mc.setScreen((Screen)null);
                    }
this.swap = false;
this.opened = false;
                }
            }
        }
    }
   
private void updateKeyBindingState(final KeyBinding[] keyBindings) {
for (final KeyBinding keyBinding : keyBindings) {
final boolean isKeyPressed = InputMappings.isKeyDown(AutoSwap.mc.getWindow().getWindow(), keyBinding.getKey().getValue());
            keyBinding.setDown(isKeyPressed);
        }
    }
   
private Item getSwapItem() {
return this.getItemByType(this.to.get());
    }
   
private Item getSelectedItem() {
return this.getItemByType(this.from.get());
    }
   
private Item getItemByType(final String itemType) {
Item item = null;
 switch (itemType) {
case "\u0422\u043e\u0442\u0435\u043c": {
                item = Items.TOTEM_OF_UNDYING;
 break;
            }
case "\u0421\u0444\u0435\u0440\u0430": {
                item = Items.PLAYER_HEAD;
 break;
            }
 default: {
                item = Items.AIR;
 break;
            }
        }
 return item;
    }
   
private int getBestSlotForItem(final Item item) {
for (int i = 0; i < 9; ++i) {
if (AutoSwap.mc.player.inventory.getItem(i).getItem() == item) {
return i + 36;
            }
        }
for (int i = 9; i < 36; ++i) {
final ItemStack stack = AutoSwap.mc.player.inventory.getItem(i);
 if (stack.getItem() == item && stack.isEnchanted()) {
 return i;
            }
        }
for (int i = 9; i < 36; ++i) {
if (AutoSwap.mc.player.inventory.getItem(i).getItem() == item) {
 return i;
            }
        }
return -1;
    }
   
public void onEnable() {
 super.onEnable();
    }
}
А ктото говорил луминар не читы сука за такое банить надо
 
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Всем привет, думаю кому-то понадобиться AutoSwap как в пульсе (из luminar visual)


Java:
Expand Collapse Copy
public class AutoSwap extends Function
{
public ModeSetting from;
public ModeSetting to;
public BindSetting swapKey;
public SliderSetting delay;
boolean swap;
boolean opened;
TimerUtil timer;
TimerUtil timer2;
    
public AutoSwap() {
super("AutoSwap", Category.Utils);
this.from = new ModeSetting("Свап с", "Тотем", new String[] { "Тотем", "Сфера" });
this.to = new ModeSetting("Свап на", "Тотем", new String[] { "Тотем", "Сфера" });
this.swapKey = new BindSetting("Кнопка свапа", -1);
this.delay = new SliderSetting("Задержка", 150.0f, 100.0f, 250.0f, 25.0f);
this.timer = new TimerUtil();
this.timer2 = new TimerUtil();
this.addSettings(new Setting[] { this.from, this.to, this.swapKey, this.delay });
    }
    
public void onKey(final int key) {
if (this.swapKey.get() == key && this.timer.passed(250L)) {
this.swap = true;
this.timer.reset();
this.timer2.reset();
        }
    }
    
@Subscribe
    public void onUpdate(final EventUpdate e) {
if (PlayerUtils.connectedTo("space-times")) {
this.print("Эта функция запрещена на сервере Space-Times!");
 this.toggle();
 return;
        }
final ItemStack offhandItemStack = AutoSwap.mc.player.getOffhandItem();
 final Item currentItem = offhandItemStack.getItem();
final boolean isHoldingSwapItem = currentItem == this.getSwapItem();
final boolean isHoldingSelectedItem = currentItem == this.getSelectedItem();
final int selectedItemSlot = this.getBestSlotForItem(this.getSelectedItem());
final int swapItemSlot = this.getBestSlotForItem(this.getSwapItem());
final boolean isSameItem = this.getSwapItem() == this.getSelectedItem();
final KeyBinding[] pressedKeys = { AutoSwap.mc.options.keyUp, AutoSwap.mc.options.keyDown, AutoSwap.mc.options.keyLeft, AutoSwap.mc.options.keyRight, AutoSwap.mc.options.keyJump, AutoSwap.mc.options.keySprint };
if (!this.opened) {
 this.updateKeyBindingState(pressedKeys);
        }
if (!this.swap) {
 return;
        }
 if (isSameItem) {
if (selectedItemSlot >= 0) {
 if (!isHoldingSelectedItem || (isSameItem && isHoldingSwapItem)) {
if (!this.opened) {
if (selectedItemSlot <= 35) {
AutoSwap.mc.setScreen((Screen)new InventoryScreen((PlayerEntity)AutoSwap.mc.player));
                        }
 else {
for (final KeyBinding keyBinding : pressedKeys) {
keyBinding.setDown(false);
                            }
                        }
this.opened = true;
                    }
if (this.timer2.passed(this.delay.get().longValue())) {
InventoryUtil.moveItem(selectedItemSlot, 45);
if (selectedItemSlot <= 35) {
AutoSwap.mc.setScreen((Screen)null);
                        }
this.swap = false;
this.opened = false;
                    }
                }
            }
else if (swapItemSlot >= 0) {
 if (!isHoldingSwapItem || (isSameItem && isHoldingSelectedItem)) {
if (!this.opened) {
if (swapItemSlot <= 35) {
AutoSwap.mc.setScreen((Screen)new InventoryScreen((PlayerEntity)AutoSwap.mc.player));
                        }
 else {
for (final KeyBinding keyBinding : pressedKeys) {
keyBinding.setDown(false);
                            }
                        }
this.opened = true;
                    }
if (this.timer2.passed(this.delay.get().longValue())) {
InventoryUtil.moveItem(swapItemSlot, 45);
if (swapItemSlot <= 35) {
AutoSwap.mc.setScreen((Screen)null);
                        }
this.swap = false;
this.opened = false;
                    }
                }
            }
 else {
this.swap = false;
            }
        }
 else {
if (selectedItemSlot >= 0 && (!isHoldingSelectedItem || (isSameItem && isHoldingSwapItem))) {
if (!this.opened) {
if (selectedItemSlot <= 35) {
AutoSwap.mc.setScreen((Screen)new InventoryScreen((PlayerEntity)AutoSwap.mc.player));
                    }
 else {
for (final KeyBinding keyBinding : pressedKeys) {
keyBinding.setDown(false);
                        }
                    }
this.opened = true;
                }
if (this.timer2.passed(this.delay.get().longValue())) {
InventoryUtil.moveItem(selectedItemSlot, 45);
if (selectedItemSlot <= 35) {
AutoSwap.mc.setScreen((Screen)null);
                    }
this.swap = false;
this.opened = false;
                }
            }
if (swapItemSlot >= 0 && (!isHoldingSwapItem || (isSameItem && isHoldingSelectedItem))) {
if (!this.opened) {
if (swapItemSlot <= 35) {
AutoSwap.mc.setScreen((Screen)new InventoryScreen((PlayerEntity)AutoSwap.mc.player));
                    }
 else {
for (final KeyBinding keyBinding : pressedKeys) {
keyBinding.setDown(false);
                        }
                    }
this.opened = true;
                }
if (this.timer2.passed(this.delay.get().longValue())) {
InventoryUtil.moveItem(swapItemSlot, 45);
if (swapItemSlot <= 35) {
AutoSwap.mc.setScreen((Screen)null);
                    }
this.swap = false;
this.opened = false;
                }
            }
        }
    }
    
private void updateKeyBindingState(final KeyBinding[] keyBindings) {
for (final KeyBinding keyBinding : keyBindings) {
final boolean isKeyPressed = InputMappings.isKeyDown(AutoSwap.mc.getWindow().getWindow(), keyBinding.getKey().getValue());
            keyBinding.setDown(isKeyPressed);
        }
    }
    
private Item getSwapItem() {
return this.getItemByType(this.to.get());
    }
    
private Item getSelectedItem() {
return this.getItemByType(this.from.get());
    }
    
private Item getItemByType(final String itemType) {
Item item = null;
 switch (itemType) {
case "\u0422\u043e\u0442\u0435\u043c": {
                item = Items.TOTEM_OF_UNDYING;
 break;
            }
case "\u0421\u0444\u0435\u0440\u0430": {
                item = Items.PLAYER_HEAD;
 break;
            }
 default: {
                item = Items.AIR;
 break;
            }
        }
 return item;
    }
    
private int getBestSlotForItem(final Item item) {
for (int i = 0; i < 9; ++i) {
if (AutoSwap.mc.player.inventory.getItem(i).getItem() == item) {
return i + 36;
            }
        }
for (int i = 9; i < 36; ++i) {
final ItemStack stack = AutoSwap.mc.player.inventory.getItem(i);
 if (stack.getItem() == item && stack.isEnchanted()) {
 return i;
            }
        }
for (int i = 9; i < 36; ++i) {
if (AutoSwap.mc.player.inventory.getItem(i).getItem() == item) {
 return i;
            }
        }
return -1;
    }
    
public void onEnable() {
 super.onEnable();
    }
}
Смысл, джарка и так без обф тут валяется
 
попробуй с нее достань что, у большинства возникнут проблемы
Т.е открыть через винрар джарку, создать папку на рабочем столе, перекинуть с джарки в папку все файлы и открыть в интелке это настолько сложно ? :roflanEbalo:
 
Всем привет, думаю кому-то понадобиться AutoSwap как в пульсе (из luminar visual)


Java:
Expand Collapse Copy
public class AutoSwap extends Function
{
public ModeSetting from;
public ModeSetting to;
public BindSetting swapKey;
public SliderSetting delay;
boolean swap;
boolean opened;
TimerUtil timer;
TimerUtil timer2;
   
public AutoSwap() {
super("AutoSwap", Category.Utils);
this.from = new ModeSetting("Свап с", "Тотем", new String[] { "Тотем", "Сфера" });
this.to = new ModeSetting("Свап на", "Тотем", new String[] { "Тотем", "Сфера" });
this.swapKey = new BindSetting("Кнопка свапа", -1);
this.delay = new SliderSetting("Задержка", 150.0f, 100.0f, 250.0f, 25.0f);
this.timer = new TimerUtil();
this.timer2 = new TimerUtil();
this.addSettings(new Setting[] { this.from, this.to, this.swapKey, this.delay });
    }
   
public void onKey(final int key) {
if (this.swapKey.get() == key && this.timer.passed(250L)) {
this.swap = true;
this.timer.reset();
this.timer2.reset();
        }
    }
   
@Subscribe
    public void onUpdate(final EventUpdate e) {
if (PlayerUtils.connectedTo("space-times")) {
this.print("Эта функция запрещена на сервере Space-Times!");
 this.toggle();
 return;
        }
final ItemStack offhandItemStack = AutoSwap.mc.player.getOffhandItem();
 final Item currentItem = offhandItemStack.getItem();
final boolean isHoldingSwapItem = currentItem == this.getSwapItem();
final boolean isHoldingSelectedItem = currentItem == this.getSelectedItem();
final int selectedItemSlot = this.getBestSlotForItem(this.getSelectedItem());
final int swapItemSlot = this.getBestSlotForItem(this.getSwapItem());
final boolean isSameItem = this.getSwapItem() == this.getSelectedItem();
final KeyBinding[] pressedKeys = { AutoSwap.mc.options.keyUp, AutoSwap.mc.options.keyDown, AutoSwap.mc.options.keyLeft, AutoSwap.mc.options.keyRight, AutoSwap.mc.options.keyJump, AutoSwap.mc.options.keySprint };
if (!this.opened) {
 this.updateKeyBindingState(pressedKeys);
        }
if (!this.swap) {
 return;
        }
 if (isSameItem) {
if (selectedItemSlot >= 0) {
 if (!isHoldingSelectedItem || (isSameItem && isHoldingSwapItem)) {
if (!this.opened) {
if (selectedItemSlot <= 35) {
AutoSwap.mc.setScreen((Screen)new InventoryScreen((PlayerEntity)AutoSwap.mc.player));
                        }
 else {
for (final KeyBinding keyBinding : pressedKeys) {
keyBinding.setDown(false);
                            }
                        }
this.opened = true;
                    }
if (this.timer2.passed(this.delay.get().longValue())) {
InventoryUtil.moveItem(selectedItemSlot, 45);
if (selectedItemSlot <= 35) {
AutoSwap.mc.setScreen((Screen)null);
                        }
this.swap = false;
this.opened = false;
                    }
                }
            }
else if (swapItemSlot >= 0) {
 if (!isHoldingSwapItem || (isSameItem && isHoldingSelectedItem)) {
if (!this.opened) {
if (swapItemSlot <= 35) {
AutoSwap.mc.setScreen((Screen)new InventoryScreen((PlayerEntity)AutoSwap.mc.player));
                        }
 else {
for (final KeyBinding keyBinding : pressedKeys) {
keyBinding.setDown(false);
                            }
                        }
this.opened = true;
                    }
if (this.timer2.passed(this.delay.get().longValue())) {
InventoryUtil.moveItem(swapItemSlot, 45);
if (swapItemSlot <= 35) {
AutoSwap.mc.setScreen((Screen)null);
                        }
this.swap = false;
this.opened = false;
                    }
                }
            }
 else {
this.swap = false;
            }
        }
 else {
if (selectedItemSlot >= 0 && (!isHoldingSelectedItem || (isSameItem && isHoldingSwapItem))) {
if (!this.opened) {
if (selectedItemSlot <= 35) {
AutoSwap.mc.setScreen((Screen)new InventoryScreen((PlayerEntity)AutoSwap.mc.player));
                    }
 else {
for (final KeyBinding keyBinding : pressedKeys) {
keyBinding.setDown(false);
                        }
                    }
this.opened = true;
                }
if (this.timer2.passed(this.delay.get().longValue())) {
InventoryUtil.moveItem(selectedItemSlot, 45);
if (selectedItemSlot <= 35) {
AutoSwap.mc.setScreen((Screen)null);
                    }
this.swap = false;
this.opened = false;
                }
            }
if (swapItemSlot >= 0 && (!isHoldingSwapItem || (isSameItem && isHoldingSelectedItem))) {
if (!this.opened) {
if (swapItemSlot <= 35) {
AutoSwap.mc.setScreen((Screen)new InventoryScreen((PlayerEntity)AutoSwap.mc.player));
                    }
 else {
for (final KeyBinding keyBinding : pressedKeys) {
keyBinding.setDown(false);
                        }
                    }
this.opened = true;
                }
if (this.timer2.passed(this.delay.get().longValue())) {
InventoryUtil.moveItem(swapItemSlot, 45);
if (swapItemSlot <= 35) {
AutoSwap.mc.setScreen((Screen)null);
                    }
this.swap = false;
this.opened = false;
                }
            }
        }
    }
   
private void updateKeyBindingState(final KeyBinding[] keyBindings) {
for (final KeyBinding keyBinding : keyBindings) {
final boolean isKeyPressed = InputMappings.isKeyDown(AutoSwap.mc.getWindow().getWindow(), keyBinding.getKey().getValue());
            keyBinding.setDown(isKeyPressed);
        }
    }
   
private Item getSwapItem() {
return this.getItemByType(this.to.get());
    }
   
private Item getSelectedItem() {
return this.getItemByType(this.from.get());
    }
   
private Item getItemByType(final String itemType) {
Item item = null;
 switch (itemType) {
case "\u0422\u043e\u0442\u0435\u043c": {
                item = Items.TOTEM_OF_UNDYING;
 break;
            }
case "\u0421\u0444\u0435\u0440\u0430": {
                item = Items.PLAYER_HEAD;
 break;
            }
 default: {
                item = Items.AIR;
 break;
            }
        }
 return item;
    }
   
private int getBestSlotForItem(final Item item) {
for (int i = 0; i < 9; ++i) {
if (AutoSwap.mc.player.inventory.getItem(i).getItem() == item) {
return i + 36;
            }
        }
for (int i = 9; i < 36; ++i) {
final ItemStack stack = AutoSwap.mc.player.inventory.getItem(i);
 if (stack.getItem() == item && stack.isEnchanted()) {
 return i;
            }
        }
for (int i = 9; i < 36; ++i) {
if (AutoSwap.mc.player.inventory.getItem(i).getItem() == item) {
 return i;
            }
        }
return -1;
    }
   
public void onEnable() {
 super.onEnable();
    }
}
/del mod opensrc
 
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
попробуй с нее достань что, у большинства возникнут проблемы
Если у типов проблемы на моменте снятия форж маппингов, стоит задуматься, нужен ли им этот сурс вообще
 
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Ну тебе же нужен
Ну ты братух гений, я написал просто как факт, что джарка и так лежит опенсурс. Да и писал я это типу, который создал мусорный тред, перезалив и так слитое говно второй раз
 
Т.е открыть через винрар джарку, создать папку на рабочем столе, перекинуть с джарки в папку все файлы и открыть в интелке это настолько сложно ? :roflanEbalo:

Т.е открыть через винрар джарку, создать папку на рабочем столе, перекинуть с джарки в папку все файлы и открыть в интелке это настолько сложно ? :roflanEbalo:
гений, у тебя ума не хватит маппинги поставить
 
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Назад
Сверху Снизу