mirror of
https://github.com/GTNewHorizons/Baubles-Expanded.git
synced 2026-11-20 03:59:41 +00:00
1 parent
3e8015e246
commit
2ef1fca7cb
6 files changed
+37
-11
No files matched your search
+1
-1
@@ -17,7 +17,7 @@ buildscript {
|
||||
|
||||
apply plugin: 'forge'
|
||||
|
||||
version = "1.7.10-1.0.1.2"
|
||||
version = "1.7.10-1.0.1.3"
|
||||
group= "com.azanor.baubles"
|
||||
archivesBaseName = "Baubles"
|
||||
|
||||
|
||||
@@ -45,8 +45,13 @@ public class GuiPlayerExpanded extends InventoryEffectRenderer {
|
||||
@Override
|
||||
public void updateScreen()
|
||||
{
|
||||
try {
|
||||
((ContainerPlayerExpanded)inventorySlots).baubles.blockEvents=false;
|
||||
} catch (Exception e) { }
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Adds the buttons (and other controls) to the screen in question.
|
||||
*/
|
||||
@@ -55,6 +60,7 @@ public class GuiPlayerExpanded extends InventoryEffectRenderer {
|
||||
{
|
||||
this.buttonList.clear();
|
||||
super.initGui();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -24,7 +24,7 @@ public class Baubles {
|
||||
|
||||
public static final String MODID = "Baubles";
|
||||
public static final String MODNAME = "Baubles";
|
||||
public static final String VERSION = "1.0.1.2";
|
||||
public static final String VERSION = "1.0.1.3";
|
||||
|
||||
@SidedProxy(clientSide = "baubles.client.ClientProxy", serverSide = "baubles.common.CommonProxy")
|
||||
public static CommonProxy proxy;
|
||||
|
||||
@@ -86,6 +86,7 @@ public class ContainerPlayerExpanded extends Container
|
||||
}
|
||||
|
||||
this.onCraftMatrixChanged(this.craftMatrix);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -264,7 +265,18 @@ public class ContainerPlayerExpanded extends Container
|
||||
}
|
||||
}
|
||||
|
||||
protected boolean mergeItemStack(ItemStack par1ItemStack, int par2, int par3, boolean par4, Slot ss)
|
||||
|
||||
|
||||
@Override
|
||||
public void putStacksInSlots(ItemStack[] p_75131_1_) {
|
||||
baubles.blockEvents=true;
|
||||
super.putStacksInSlots(p_75131_1_);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
protected boolean mergeItemStack(ItemStack par1ItemStack, int par2, int par3, boolean par4, Slot ss)
|
||||
{
|
||||
boolean flag1 = false;
|
||||
int k = par2;
|
||||
|
||||
@@ -22,6 +22,7 @@ public class InventoryBaubles implements IInventory {
|
||||
public ItemStack[] stackList;
|
||||
private Container eventHandler;
|
||||
public WeakReference<EntityPlayer> player;
|
||||
public boolean blockEvents=false;
|
||||
|
||||
public InventoryBaubles(EntityPlayer player) {
|
||||
this.stackList = new ItemStack[4];
|
||||
@@ -95,12 +96,13 @@ public class InventoryBaubles implements IInventory {
|
||||
|
||||
if (this.stackList[par1].stackSize <= par2) {
|
||||
itemstack = this.stackList[par1];
|
||||
this.stackList[par1] = null;
|
||||
|
||||
if (itemstack != null && itemstack.getItem() instanceof IBauble) {
|
||||
((IBauble) itemstack.getItem()).onUnequipped(itemstack,
|
||||
player.get());
|
||||
}
|
||||
|
||||
this.stackList[par1] = null;
|
||||
|
||||
if (eventHandler != null)
|
||||
this.eventHandler.onCraftMatrixChanged(this);
|
||||
@@ -108,15 +110,16 @@ public class InventoryBaubles implements IInventory {
|
||||
return itemstack;
|
||||
} else {
|
||||
itemstack = this.stackList[par1].splitStack(par2);
|
||||
|
||||
if (this.stackList[par1].stackSize == 0) {
|
||||
this.stackList[par1] = null;
|
||||
}
|
||||
|
||||
|
||||
if (itemstack != null && itemstack.getItem() instanceof IBauble) {
|
||||
((IBauble) itemstack.getItem()).onUnequipped(itemstack,
|
||||
player.get());
|
||||
}
|
||||
|
||||
if (this.stackList[par1].stackSize == 0) {
|
||||
this.stackList[par1] = null;
|
||||
}
|
||||
|
||||
if (eventHandler != null)
|
||||
this.eventHandler.onCraftMatrixChanged(this);
|
||||
syncSlotToClients(par1);
|
||||
@@ -133,11 +136,12 @@ public class InventoryBaubles implements IInventory {
|
||||
*/
|
||||
@Override
|
||||
public void setInventorySlotContents(int par1, ItemStack stack) {
|
||||
if(this.stackList[par1] != null) {
|
||||
|
||||
if(!blockEvents && this.stackList[par1] != null) {
|
||||
((IBauble)stackList[par1].getItem()).onUnequipped(stackList[par1], player.get());
|
||||
}
|
||||
this.stackList[par1] = stack;
|
||||
if (stack != null && stack.getItem() instanceof IBauble) {
|
||||
if (!blockEvents && stack != null && stack.getItem() instanceof IBauble) {
|
||||
((IBauble) stack.getItem()).onEquipped(stack, player.get());
|
||||
}
|
||||
if (eventHandler != null)
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
1.0.1.3
|
||||
- created workaround for unnecessary calls to onEquipped and onUneEquipped
|
||||
- fixed a bug where onUneEquipped wasn't being called if you pick an item up from a slot
|
||||
|
||||
1.0.1.2
|
||||
- added a simple way to switch between the normal and baubles inventory. Thanks to Vazkii for the idea and permission to port it to base Baubles.
|
||||
- removed the Miners Ring crafting recipe... it is a bit op. I will leave the item in so it is attainable in creative and so it can still serve as an example bauble for devs.
|
||||
|
||||
Reference in new issue
Block a user