Fix crash when opening GUIs
This commit is contained in:
parent
ffa75aba8d
commit
d8db208279
3 changed files with 6 additions and 6 deletions
|
@ -32,7 +32,6 @@ import net.minecraft.client.MinecraftClient;
|
|||
import net.minecraft.client.font.TextRenderer;
|
||||
import net.minecraft.client.gui.Selectable;
|
||||
import net.minecraft.client.gui.screen.ingame.HandledScreen;
|
||||
import net.minecraft.client.gui.widget.ButtonWidget;
|
||||
import net.minecraft.client.gui.widget.ClickableWidget;
|
||||
import net.minecraft.client.resource.language.I18n;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
|
@ -59,7 +58,7 @@ import reborncore.client.screen.builder.slot.PlayerInventorySlot;
|
|||
import reborncore.common.blockentity.MachineBaseBlockEntity;
|
||||
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import reborncore.mixin.client.ScreenAccessor;
|
||||
import reborncore.mixin.client.AccessorScreen;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
|
@ -281,8 +280,8 @@ public class GuiBase<T extends ScreenHandler> extends HandledScreen<T> {
|
|||
offset += 24;
|
||||
}
|
||||
|
||||
ScreenAccessor screenAccessor = (ScreenAccessor)this;
|
||||
for (Selectable selectable : screenAccessor.getSelectables()) {
|
||||
AccessorScreen accessorScreen = (AccessorScreen)this;
|
||||
for (Selectable selectable : accessorScreen.getSelectables()) {
|
||||
if (selectable instanceof ClickableWidget clickable) {
|
||||
if (clickable.isHovered()) {
|
||||
clickable.renderToolTip(matrixStack, mouseX, mouseY);
|
||||
|
|
|
@ -8,7 +8,7 @@ import org.spongepowered.asm.mixin.gen.Accessor;
|
|||
import java.util.List;
|
||||
|
||||
@Mixin(Screen.class)
|
||||
public interface ScreenAccessor {
|
||||
public interface AccessorScreen {
|
||||
@Accessor
|
||||
List<Selectable> getSelectables();
|
||||
}
|
|
@ -8,7 +8,8 @@
|
|||
"MixinDebugRenderer",
|
||||
"MixinWorldRenderer",
|
||||
"AccessorModelPredicateProviderRegistry",
|
||||
"AccessorChatHud"
|
||||
"AccessorChatHud",
|
||||
"AccessorScreen"
|
||||
],
|
||||
"injectors": {
|
||||
"defaultRequire": 1
|
||||
|
|
Loading…
Reference in a new issue