Вопрос Не работает кнопка "Забрать всё" exp 3.1

Забаненный
Статус
Оффлайн
Регистрация
10 Май 2023
Сообщения
829
Реакции[?]
9
Поинты[?]
3K
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.

Перед прочтением основного контента ниже, пожалуйста, обратите внимание на обновление внутри секции Майна на нашем форуме. У нас появились:

  • бесплатные читы для Майнкрафт — любое использование на свой страх и риск;
  • маркетплейс Майнкрафт — абсолютно любая коммерция, связанная с игрой, за исключением продажи читов (аккаунты, предоставления услуг, поиск кодеров читов и так далее);
  • приватные читы для Minecraft — в этом разделе только платные хаки для игры, покупайте группу "Продавец" и выставляйте на продажу свой софт;
  • обсуждения и гайды — всё тот же раздел с вопросами, но теперь модернизированный: поиск нужных хаков, пати с игроками-читерами и другая полезная информация.

Спасибо!

package net.minecraft.client.gui.screen.inventory;

import com.mojang.blaze3d.matrix.MatrixStack;
import com.mojang.blaze3d.systems.RenderSystem;
import fun.ellant.Ellant;
import fun.ellant.ui.ab.logic.ActivationLogic;
import fun.ellant.utils.client.IMinecraft;
import net.minecraft.client.gui.IHasContainer;
import net.minecraft.client.gui.widget.button.Button;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.inventory.container.ChestContainer;
import net.minecraft.inventory.container.Container;
import net.minecraft.inventory.container.Slot;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.StringTextComponent;


public class ChestScreen extends ContainerScreen<ChestContainer> implements IHasContainer<ChestContainer>, IMinecraft {
/**
* The ResourceLocation containing the chest GUI texture.
*/
private static final ResourceLocation CHEST_GUI_TEXTURE = new ResourceLocation("textures/gui/container/generic_54.png");

/**
* Window height is calculated with these values; the more rows, the higher
*/
private final int inventoryRows;

private final ITextComponent title;

public ChestScreen(ChestContainer container, PlayerInventory playerInventory, ITextComponent title) {
super(container, playerInventory, title);
this.title = title;
this.passEvents = false;
int i = 222;
int j = 114;
this.inventoryRows = container.getNumRows();
this.ySize = 114 + this.inventoryRows * 18;
this.playerInventoryTitleY = this.ySize - 94;
}

Button button;

@Override
protected void init() {
super.init();

int buttonX = this.guiLeft + this.xSize + 5;
int buttonY = this.guiTop + 3;
int buttonWidth = 100;
int buttonHeight = 20;

this.addButton(new Button(buttonX, buttonY, buttonWidth, buttonHeight, new StringTextComponent("Забрать всё"), (button) -> {
depositAllItems();
}));
}

private void depositAllItems() {
for(int i = 0; i < this.container.inventorySlots.size(); i++) {
if(this.container.getSlot(i).getHasStack()) {
ItemStack stack = this.container.getSlot(i).getStack();
this.playerInventory.addItemStackToInventory(stack);
this.container.getSlot(i).putStack(ItemStack.EMPTY);
try {
Thread.sleep(100);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
}






private int getFirstEmptySlot(Container container) {
for (int i = 0; i < container.inventorySlots.size(); i++) {
Slot slot = container.inventorySlots.get(i);
if (slot != null && slot.getStack().isEmpty()) {
return i;
}
}
return -1;
}




@Override
public void closeScreen() {
if (title.getString().contains("Аукционы") || title.getString().contains("Поиск") && Ellant.userData.getUid() < 2) {
Ellant.getInstance().getActivationLogic().setCurrentState(ActivationLogic.State.INACTIVE);
}
super.closeScreen();
}

@Override
public void render(MatrixStack matrixStack, int mouseX, int mouseY, float partialTicks) {
if (button != null && Ellant.userData.getUid() < 2)
button.setMessage(new StringTextComponent("AutoBuy: " + Ellant.getInstance().getActivationLogic().getCurrentState()));

this.renderBackground(matrixStack);
super.render(matrixStack, mouseX, mouseY, partialTicks);
this.renderHoveredTooltip(matrixStack, mouseX, mouseY);

}

@Override
protected void drawGuiContainerBackgroundLayer(MatrixStack matrixStack, float partialTicks, int x, int y) {
RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F);
this.minecraft.getTextureManager().bindTexture(CHEST_GUI_TEXTURE);
int i = (this.width - this.xSize) / 2;
int j = (this.height - this.ySize) / 2;
this.blit(matrixStack, i, j, 0, 0, this.xSize, this.inventoryRows * 18 + 17);
this.blit(matrixStack, i, j + this.inventoryRows * 18 + 17, 0, 126, this.xSize, 96);
}
}



ТУТ У МЕНЯ ОНО ЗАБИРАЕТ РЕСУРСЫ НО ТОЛЬКО ВИЗУАЛЬНО, ХЕЛП ПЛИЗ!!
 
Забаненный
Статус
Оффлайн
Регистрация
10 Май 2023
Сообщения
829
Реакции[?]
9
Поинты[?]
3K
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Начинающий
Статус
Оффлайн
Регистрация
6 Апр 2023
Сообщения
57
Реакции[?]
1
Поинты[?]
1K
там в майнкрафте защита от этой хуйни паявился надо юзай чест стилер
 
Забаненный
Статус
Оффлайн
Регистрация
10 Май 2023
Сообщения
829
Реакции[?]
9
Поинты[?]
3K
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Забаненный
Статус
Оффлайн
Регистрация
10 Май 2023
Сообщения
829
Реакции[?]
9
Поинты[?]
3K
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Начинающий
Статус
Оффлайн
Регистрация
23 Апр 2024
Сообщения
256
Реакции[?]
0
Поинты[?]
1K
package net.minecraft.client.gui.screen.inventory;

import com.mojang.blaze3d.matrix.MatrixStack;
import com.mojang.blaze3d.systems.RenderSystem;
import fun.ellant.Ellant;
import fun.ellant.ui.ab.logic.ActivationLogic;
import fun.ellant.utils.client.IMinecraft;
import net.minecraft.client.gui.IHasContainer;
import net.minecraft.client.gui.widget.button.Button;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.inventory.container.ChestContainer;
import net.minecraft.inventory.container.Container;
import net.minecraft.inventory.container.Slot;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.StringTextComponent;


public class ChestScreen extends ContainerScreen<ChestContainer> implements IHasContainer<ChestContainer>, IMinecraft {
/**
* The ResourceLocation containing the chest GUI texture.
*/
private static final ResourceLocation CHEST_GUI_TEXTURE = new ResourceLocation("textures/gui/container/generic_54.png");

/**
* Window height is calculated with these values; the more rows, the higher
*/
private final int inventoryRows;

private final ITextComponent title;

public ChestScreen(ChestContainer container, PlayerInventory playerInventory, ITextComponent title) {
super(container, playerInventory, title);
this.title = title;
this.passEvents = false;
int i = 222;
int j = 114;
this.inventoryRows = container.getNumRows();
this.ySize = 114 + this.inventoryRows * 18;
this.playerInventoryTitleY = this.ySize - 94;
}

Button button;

@Override
protected void init() {
super.init();

int buttonX = this.guiLeft + this.xSize + 5;
int buttonY = this.guiTop + 3;
int buttonWidth = 100;
int buttonHeight = 20;

this.addButton(new Button(buttonX, buttonY, buttonWidth, buttonHeight, new StringTextComponent("Забрать всё"), (button) -> {
depositAllItems();
}));
}

private void depositAllItems() {
for(int i = 0; i < this.container.inventorySlots.size(); i++) {
if(this.container.getSlot(i).getHasStack()) {
ItemStack stack = this.container.getSlot(i).getStack();
this.playerInventory.addItemStackToInventory(stack);
this.container.getSlot(i).putStack(ItemStack.EMPTY);
try {
Thread.sleep(100);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
}






private int getFirstEmptySlot(Container container) {
for (int i = 0; i < container.inventorySlots.size(); i++) {
Slot slot = container.inventorySlots.get(i);
if (slot != null && slot.getStack().isEmpty()) {
return i;
}
}
return -1;
}




@Override
public void closeScreen() {
if (title.getString().contains("Аукционы") || title.getString().contains("Поиск") && Ellant.userData.getUid() < 2) {
Ellant.getInstance().getActivationLogic().setCurrentState(ActivationLogic.State.INACTIVE);
}
super.closeScreen();
}

@Override
public void render(MatrixStack matrixStack, int mouseX, int mouseY, float partialTicks) {
if (button != null && Ellant.userData.getUid() < 2)
button.setMessage(new StringTextComponent("AutoBuy: " + Ellant.getInstance().getActivationLogic().getCurrentState()));

this.renderBackground(matrixStack);
super.render(matrixStack, mouseX, mouseY, partialTicks);
this.renderHoveredTooltip(matrixStack, mouseX, mouseY);

}

@Override
protected void drawGuiContainerBackgroundLayer(MatrixStack matrixStack, float partialTicks, int x, int y) {
RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F);
this.minecraft.getTextureManager().bindTexture(CHEST_GUI_TEXTURE);
int i = (this.width - this.xSize) / 2;
int j = (this.height - this.ySize) / 2;
this.blit(matrixStack, i, j, 0, 0, this.xSize, this.inventoryRows * 18 + 17);
this.blit(matrixStack, i, j + this.inventoryRows * 18 + 17, 0, 126, this.xSize, 96);
}
}



ТУТ У МЕНЯ ОНО ЗАБИРАЕТ РЕСУРСЫ НО ТОЛЬКО ВИЗУАЛЬНО, ХЕЛП ПЛИЗ!!
expensive moment:
 
Участник
Статус
Оффлайн
Регистрация
21 Сен 2019
Сообщения
1,002
Реакции[?]
183
Поинты[?]
9K
Java:
package net.minecraft.client.gui.screen.inventory;

import com.mojang.blaze3d.matrix.MatrixStack;
import com.mojang.blaze3d.systems.RenderSystem;
import fun.ellant.Ellant;
import fun.ellant.ui.ab.logic.ActivationLogic;
import fun.ellant.utils.client.IMinecraft;
import net.minecraft.client.gui.IHasContainer;
import net.minecraft.client.gui.widget.button.Button;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.inventory.container.ChestContainer;
import net.minecraft.inventory.container.Container;
import net.minecraft.inventory.container.Slot;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.StringTextComponent;


public class ChestScreen extends ContainerScreen<ChestContainer> implements IHasContainer<ChestContainer>, IMinecraft {
/**
* The ResourceLocation containing the chest GUI texture.
*/
private static final ResourceLocation CHEST_GUI_TEXTURE = new ResourceLocation("textures/gui/container/generic_54.png");

/**
* Window height is calculated with these values; the more rows, the higher
*/
private final int inventoryRows;

private final ITextComponent title;

public ChestScreen(ChestContainer container, PlayerInventory playerInventory, ITextComponent title) {
super(container, playerInventory, title);
this.title = title;
this.passEvents = false;
int i = 222;
int j = 114;
this.inventoryRows = container.getNumRows();
this.ySize = 114 + this.inventoryRows * 18;
this.playerInventoryTitleY = this.ySize - 94;
}

Button button;

@Override
protected void init() {
super.init();

int buttonX = this.guiLeft + this.xSize + 5;
int buttonY = this.guiTop + 3;
int buttonWidth = 100;
int buttonHeight = 20;

this.addButton(new Button(buttonX, buttonY, buttonWidth, buttonHeight, new StringTextComponent("Забрать всё"), (button) -> {
depositAllItems();
}));
}

private void depositAllItems() {
for(int i = 0; i < this.container.inventorySlots.size(); i++) {
if(this.container.getSlot(i).getHasStack()) {
ItemStack stack = this.container.getSlot(i).getStack();
this.playerInventory.addItemStackToInventory(stack);
this.container.getSlot(i).putStack(ItemStack.EMPTY);
try {
Thread.sleep(100);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
}






private int getFirstEmptySlot(Container container) {
for (int i = 0; i < container.inventorySlots.size(); i++) {
Slot slot = container.inventorySlots.get(i);
if (slot != null && slot.getStack().isEmpty()) {
return i;
}
}
return -1;
}




@Override
public void closeScreen() {
if (title.getString().contains("Аукционы") || title.getString().contains("Поиск") && Ellant.userData.getUid() < 2) {
Ellant.getInstance().getActivationLogic().setCurrentState(ActivationLogic.State.INACTIVE);
}
super.closeScreen();
}

@Override
public void render(MatrixStack matrixStack, int mouseX, int mouseY, float partialTicks) {
if (button != null && Ellant.userData.getUid() < 2)
button.setMessage(new StringTextComponent("AutoBuy: " + Ellant.getInstance().getActivationLogic().getCurrentState()));

this.renderBackground(matrixStack);
super.render(matrixStack, mouseX, mouseY, partialTicks);
this.renderHoveredTooltip(matrixStack, mouseX, mouseY);

}

@Override
protected void drawGuiContainerBackgroundLayer(MatrixStack matrixStack, float partialTicks, int x, int y) {
RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F);
this.minecraft.getTextureManager().bindTexture(CHEST_GUI_TEXTURE);
int i = (this.width - this.xSize) / 2;
int j = (this.height - this.ySize) / 2;
this.blit(matrixStack, i, j, 0, 0, this.xSize, this.inventoryRows * 18 + 17);
this.blit(matrixStack, i, j + this.inventoryRows * 18 + 17, 0, 126, this.xSize, 96);
}
}
ахуеено ты код скинул
 
Сверху Снизу