Skip to content

Commit

Permalink
Fixed UI background not being drawn.
Browse files Browse the repository at this point in the history
Mezz removed said displayGuiScreenWithoutClose() so said workaround can be removed.
  • Loading branch information
GuntherDW committed Jul 6, 2017
1 parent fbcf8c4 commit d8c5e6a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 30 deletions.
17 changes: 1 addition & 16 deletions src/main/java/appeng/client/gui/AEBaseGui.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,7 @@
import com.google.common.base.Stopwatch;
import com.google.common.collect.Lists;

import mezz.jei.api.IRecipesGui;
import net.minecraft.client.renderer.BufferBuilder;
import net.minecraft.client.renderer.vertex.VertexBuffer;
import net.minecraftforge.client.event.GuiOpenEvent;
import net.minecraftforge.common.MinecraftForge;
import org.lwjgl.input.Keyboard;
import org.lwjgl.input.Mouse;
import org.lwjgl.opengl.GL11;
Expand Down Expand Up @@ -105,8 +101,6 @@ public AEBaseGui( final Container container )
super( container );
this.subGui = switchingGuis;
switchingGuis = false;
// TODO : Remove when mezz removes displayGuiScreenWithoutClose() in 1.12.
MinecraftForge.EVENT_BUS.register( this );
}

protected static String join( final Collection<String> toolTip, final String delimiter )
Expand Down Expand Up @@ -164,6 +158,7 @@ private List<Slot> getInventorySlots()
@Override
public void drawScreen( final int mouseX, final int mouseY, final float btn )
{
super.drawDefaultBackground();
super.drawScreen( mouseX, mouseY, btn );

for( final Object c : this.buttonList )
Expand Down Expand Up @@ -587,21 +582,11 @@ protected boolean checkHotbarKeys( final int keyCode )
return false;
}

// TODO : Remove when mezz removes displayGuiScreenWithoutClose() in 1.12.
public void onGuiOpenEvent(GuiOpenEvent event) { // Why oh why mezz? (RecipesGui.java, displayGuiScreenWithoutClose()
if(event.getGui() instanceof IRecipesGui)
{
subGui = true;
}
}

@Override
public void onGuiClosed()
{
super.onGuiClosed();
this.subGui = true; // in case the gui is reopened later ( i'm looking at you NEI )
// TODO : Remove when mezz removes displayGuiScreenWithoutClose() in 1.12.
MinecraftForge.EVENT_BUS.unregister( this );
}

protected Slot getSlot( final int mouseX, final int mouseY )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@
import java.io.IOException;
import java.util.List;

import mezz.jei.api.IRecipesGui;
import net.minecraftforge.client.event.GuiOpenEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import org.lwjgl.input.Keyboard;
import org.lwjgl.input.Mouse;

Expand Down Expand Up @@ -383,17 +380,6 @@ public void onGuiClosed()
memoryText = this.searchField.getText();
}

// TODO : Remove when mezz removes displayGuiScreenWithoutClose() in 1.12.
@Override
@SubscribeEvent
public void onGuiOpenEvent(GuiOpenEvent event) {
super.onGuiOpenEvent(event);
if(event.getGui() instanceof IRecipesGui)
{
memoryText = this.searchField.getText();
}
}

@Override
public void drawBG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
{
Expand Down

0 comments on commit d8c5e6a

Please sign in to comment.