Skip to content

Commit

Permalink
fixes to shift clicking (closes #194)
Browse files Browse the repository at this point in the history
  • Loading branch information
Azanor committed Aug 1, 2017
1 parent 8f99a00 commit 406ba25
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 10 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ buildscript {
apply plugin: 'net.minecraftforge.gradle.forge'


version = "1.11-1.4.5"
version = "1.11-1.4.6"
group= "com.azanor.baubles"
archivesBaseName = "Baubles"

srcCompat = JavaVersion.VERSION_1_8
targetCompat = JavaVersion.VERSION_1_8

minecraft {
version = "1.11-13.19.0.2180"
version = "1.11-13.19.1.2189"
runDir = "run"
mappings = "snapshot_20170502"
makeObfSourceJar = false
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/baubles/common/Baubles.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class Baubles {

public static final String MODID = "baubles";
public static final String MODNAME = "Baubles";
public static final String VERSION = "1.4.5";
public static final String VERSION = "1.4.6";

@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 @@ -121,7 +121,6 @@ public String getSlotTexture()
});

this.onCraftMatrixChanged(this.craftMatrix);

}

/**
Expand Down Expand Up @@ -276,11 +275,14 @@ else if (!this.mergeItemStack(itemstack1, 9+ slotShift, 45+ slotShift, false))
{
return ItemStack.EMPTY;
}

slot.onTake(playerIn, itemstack1);

if (itemstack1.isEmpty() && !baubles.isEventBlocked() && slot instanceof SlotBauble &&
itemstack.hasCapability(BaublesCapabilities.CAPABILITY_ITEM_BAUBLE, null)) {
itemstack.getCapability(BaublesCapabilities.CAPABILITY_ITEM_BAUBLE, null).onUnequipped(itemstack, playerIn);
}

ItemStack itemstack2 = slot.onTake(playerIn, itemstack1);

if (index == 0)
{
playerIn.dropItem(itemstack2, false);
Expand Down
9 changes: 6 additions & 3 deletions src/main/java/baubles/common/container/SlotBauble.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ public boolean canTakeStack(EntityPlayer player) {

@Override
public ItemStack onTake(EntityPlayer playerIn, ItemStack stack) {

if (!getHasStack() && !((IBaublesItemHandler)getItemHandler()).isEventBlocked() &&
stack.hasCapability(BaublesCapabilities.CAPABILITY_ITEM_BAUBLE, null)) {
stack.getCapability(BaublesCapabilities.CAPABILITY_ITEM_BAUBLE, null).onUnequipped(stack, playerIn);
Expand All @@ -53,14 +52,18 @@ public ItemStack onTake(EntityPlayer playerIn, ItemStack stack) {

@Override
public void putStack(ItemStack stack) {
if (getHasStack() && !((IBaublesItemHandler)getItemHandler()).isEventBlocked() &&
if (getHasStack() && !ItemStack.areItemStacksEqual(stack,getStack()) &&
!((IBaublesItemHandler)getItemHandler()).isEventBlocked() &&
getStack().hasCapability(BaublesCapabilities.CAPABILITY_ITEM_BAUBLE, null)) {
getStack().getCapability(BaublesCapabilities.CAPABILITY_ITEM_BAUBLE, null).onUnequipped(getStack(), player);
}

ItemStack oldstack = getStack().copy();

super.putStack(stack);

if (this.getHasStack() && !((IBaublesItemHandler)getItemHandler()).isEventBlocked() &&
if (this.getHasStack() && !ItemStack.areItemStacksEqual(oldstack,getStack()) &&
!((IBaublesItemHandler)getItemHandler()).isEventBlocked() &&
getStack().hasCapability(BaublesCapabilities.CAPABILITY_ITEM_BAUBLE, null)) {
getStack().getCapability(BaublesCapabilities.CAPABILITY_ITEM_BAUBLE, null).onEquipped(getStack(), player);
}
Expand Down
3 changes: 3 additions & 0 deletions src/main/resources/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
1.4.6
- added IBauble as a capability (see https://github.com/Azanor/Baubles/pull/208)

1.4.5
- fixes for localization bug

Expand Down

0 comments on commit 406ba25

Please sign in to comment.