Skip to content

Commit

Permalink
Fix crash with revolver in Battlegear slot (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
repo-alt authored Mar 1, 2022
1 parent 28c0708 commit c1d96e9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ dependencies {
compile('thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev')
compile('curse.maven:dummycore-230103:2244260')
compile('com.github.GTNewHorizons:CodeChickenLib:1.1.5.3:dev')
runtime("com.github.GTNewHorizons:NotEnoughItems:2.2.6-GTNH:dev")

runtime('com.github.GTNewHorizons:Baubles:1.0.1.14:dev')
runtime('com.github.GTNewHorizons:CodeChickenCore:1.1.3:dev') // Required to allow dummycore to run in dev
Expand Down
6 changes: 4 additions & 2 deletions src/main/java/tb/client/gui/GuiRevolver.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package tb.client.gui;

import net.minecraft.entity.player.EntityPlayer;
import org.lwjgl.opengl.GL11;

import tb.common.inventory.ContainerRevolver;
Expand Down Expand Up @@ -43,8 +44,9 @@ protected void drawGuiContainerForegroundLayer(int mouseX, int mouseZ)

protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseZ)
{
if (Minecraft.getMinecraft().thePlayer.inventory.mainInventory[this.blockedSlot] == null)
Minecraft.getMinecraft().thePlayer.closeScreen();
EntityPlayer p = Minecraft.getMinecraft().thePlayer;
if (p.inventory.mainInventory.length > this.blockedSlot && p.inventory.mainInventory[this.blockedSlot] == null)
p.closeScreen();

Minecraft.getMinecraft().renderEngine.bindTexture(revolverTextures);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
Expand Down

0 comments on commit c1d96e9

Please sign in to comment.