Skip to content

Commit

Permalink
fixed item lost on baubles button click
Browse files Browse the repository at this point in the history
  • Loading branch information
Azanor committed May 2, 2017
1 parent 803f411 commit 2c1e33c
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 5 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ buildscript {
apply plugin: 'net.minecraftforge.gradle.forge'


version = "1.11-1.4.3"
version = "1.11-1.4.4"
group= "com.azanor.baubles"
archivesBaseName = "Baubles"

Expand Down
3 changes: 2 additions & 1 deletion src/main/java/baubles/client/gui/GuiBaublesButton.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.resources.I18n;

public class GuiBaublesButton extends GuiButton {

Expand Down Expand Up @@ -49,7 +50,7 @@ public void drawButton(Minecraft mc, int xx, int yy)
this.drawTexturedModalRect(this.xPosition + potionShift, this.yPosition, 200, 48, 10, 10);
} else {
this.drawTexturedModalRect(this.xPosition + potionShift, this.yPosition, 210, 48, 10, 10);
this.drawCenteredString(fontrenderer, this.displayString,
this.drawCenteredString(fontrenderer, I18n.format(this.displayString, new Object[0]),
this.xPosition + 5 + potionShift, this.yPosition + this.height, 0xffffff);
}

Expand Down
3 changes: 1 addition & 2 deletions src/main/java/baubles/common/Baubles.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,11 @@
name = Baubles.MODNAME,
version = Baubles.VERSION,
guiFactory = "baubles.client.gui.BaublesGuiFactory")
//dependencies="required-after:Forge@[13.19.0.2180,);")
public class Baubles {

public static final String MODID = "baubles";
public static final String MODNAME = "Baubles";
public static final String VERSION = "1.4.3";
public static final String VERSION = "1.4.4";

@SidedProxy(clientSide = "baubles.client.ClientProxy", serverSide = "baubles.common.CommonProxy")
public static CommonProxy proxy;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -300,5 +300,7 @@ public boolean canMergeSlot(ItemStack stack, Slot slot)
{
return slot.inventory != this.craftResult && super.canMergeSlot(stack, slot);
}



}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import baubles.common.Baubles;
import io.netty.buffer.ByteBuf;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IThreadListener;
import net.minecraft.world.WorldServer;
import net.minecraftforge.fml.common.network.simpleimpl.IMessage;
Expand All @@ -24,7 +26,8 @@ public void fromBytes(ByteBuf buffer) {}
@Override
public IMessage onMessage(PacketOpenBaublesInventory message, MessageContext ctx) {
IThreadListener mainThread = (WorldServer) ctx.getServerHandler().playerEntity.world;
mainThread.addScheduledTask(new Runnable(){ public void run() {
mainThread.addScheduledTask(new Runnable(){ public void run() {
ctx.getServerHandler().playerEntity.openContainer.onContainerClosed(ctx.getServerHandler().playerEntity);
ctx.getServerHandler().playerEntity.openGui(Baubles.instance, Baubles.GUI, ctx.getServerHandler().playerEntity.world, (int)ctx.getServerHandler().playerEntity.posX, (int)ctx.getServerHandler().playerEntity.posY, (int)ctx.getServerHandler().playerEntity.posZ);
}});
return null;
Expand Down
4 changes: 4 additions & 0 deletions src/main/resources/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
1.4.4
- item on cursor will no longer be lost if you click on the baubles ring button
- fixed baubles button display text

1.4.3
- added player references to capabilities container and added checks for item validity.

Expand Down

0 comments on commit 2c1e33c

Please sign in to comment.