mirror of
https://github.com/GTNewHorizons/ThaumicEnergistics.git
synced 2026-10-25 20:32:27 +00:00
Bug fix
This commit is contained in:
1 parent
fa030a2def
commit
057e3e7a34
6 files changed
+20
-37
No files matched your search
@@ -206,19 +206,12 @@ public class GuiEssentiaCellWorkbench
|
||||
// Call super
|
||||
super.mouseClicked( mouseX, mouseY, mouseButton );
|
||||
|
||||
ItemStack temp = null;
|
||||
if( draggedStack != null )
|
||||
{
|
||||
temp = draggedStack.copy();
|
||||
draggedStack = null;
|
||||
}
|
||||
|
||||
for( SimpleAspectWidget partitionWidget : this.partitionWidgets )
|
||||
{
|
||||
if( partitionWidget.isMouseOverWidget( mouseX, mouseY ) )
|
||||
{
|
||||
// Get the aspect of the currently held item
|
||||
Aspect itemAspect = EssentiaItemContainerHelper.INSTANCE.getFilterAspectFromItem(temp == null ? this.player.inventory.getItemStack() : temp);
|
||||
Aspect itemAspect = EssentiaItemContainerHelper.INSTANCE.getFilterAspectFromItem(this.draggedStack == null ? this.player.inventory.getItemStack() : this.draggedStack.copy());
|
||||
|
||||
// Get the aspect of the widget
|
||||
Aspect widgetAspect = partitionWidget.getAspect();
|
||||
@@ -245,6 +238,7 @@ public class GuiEssentiaCellWorkbench
|
||||
break;
|
||||
}
|
||||
}
|
||||
this.draggedStack = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -286,13 +286,6 @@ public class GuiEssentiaIO
|
||||
// Call super
|
||||
super.mouseClicked( mouseX, mouseY, mouseButton );
|
||||
|
||||
ItemStack temp = null;
|
||||
if( draggedStack != null )
|
||||
{
|
||||
temp = draggedStack.copy();
|
||||
draggedStack = null;
|
||||
}
|
||||
|
||||
// Loop over all widgets
|
||||
for( WidgetAspectSlot aspectSlot : this.aspectSlotList )
|
||||
{
|
||||
@@ -300,7 +293,7 @@ public class GuiEssentiaIO
|
||||
if( aspectSlot.isMouseOverWidget( mouseX, mouseY ) )
|
||||
{
|
||||
// Get the aspect of the currently held item
|
||||
Aspect itemAspect = EssentiaItemContainerHelper.INSTANCE.getFilterAspectFromItem(temp == null ? this.player.inventory.getItemStack() : temp);
|
||||
Aspect itemAspect = EssentiaItemContainerHelper.INSTANCE.getFilterAspectFromItem(this.draggedStack == null ? this.player.inventory.getItemStack() : this.draggedStack.copy());
|
||||
|
||||
// Is there an aspect?
|
||||
if( itemAspect != null )
|
||||
@@ -321,6 +314,7 @@ public class GuiEssentiaIO
|
||||
break;
|
||||
}
|
||||
}
|
||||
this.draggedStack = null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -293,9 +293,9 @@ public class GuiEssentiaLevelEmitter
|
||||
if( this.aspectFilterSlot.isMouseOverWidget( mouseX, mouseY ) )
|
||||
{
|
||||
// Pass to the widget
|
||||
this.aspectFilterSlot
|
||||
.mouseClicked( EssentiaItemContainerHelper.INSTANCE.getFilterAspectFromItem( this.player.inventory.getItemStack() ) );
|
||||
this.aspectFilterSlot.mouseClicked(EssentiaItemContainerHelper.INSTANCE.getFilterAspectFromItem(this.draggedStack == null ? this.player.inventory.getItemStack() : this.draggedStack.copy()));
|
||||
}
|
||||
this.draggedStack = null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -234,19 +234,12 @@ public class GuiEssentiaStorageBus
|
||||
// Call super
|
||||
super.mouseClicked( mouseX, mouseY, mouseButton );
|
||||
|
||||
ItemStack temp = null;
|
||||
if( draggedStack != null )
|
||||
{
|
||||
temp = draggedStack.copy();
|
||||
draggedStack = null;
|
||||
}
|
||||
|
||||
for( WidgetAspectSlot aspectSlot : this.aspectWidgetList )
|
||||
{
|
||||
if( aspectSlot.isMouseOverWidget( mouseX, mouseY ) )
|
||||
{
|
||||
// Get the aspect of the currently held item
|
||||
Aspect itemAspect = EssentiaItemContainerHelper.INSTANCE.getFilterAspectFromItem(temp == null ? this.player.inventory.getItemStack() : temp);
|
||||
Aspect itemAspect = EssentiaItemContainerHelper.INSTANCE.getFilterAspectFromItem(this.draggedStack == null ? this.player.inventory.getItemStack() : this.draggedStack.copy());
|
||||
|
||||
// Is there an aspect?
|
||||
if( itemAspect != null )
|
||||
@@ -265,6 +258,7 @@ public class GuiEssentiaStorageBus
|
||||
break;
|
||||
}
|
||||
}
|
||||
this.draggedStack = null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -239,14 +239,12 @@ public class ModuleNEI
|
||||
|
||||
}
|
||||
|
||||
static class NEIGuiHandler extends INEIGuiAdapter
|
||||
{
|
||||
static class NEIGuiHandler extends INEIGuiAdapter {
|
||||
@Override
|
||||
public boolean handleDragNDrop(GuiContainer gui, int mousex, int mousey, ItemStack draggedStack, int button)
|
||||
{
|
||||
if (gui instanceof ThEBaseGui && draggedStack !=null && draggedStack.getItem() !=null )
|
||||
{
|
||||
((ThEBaseGui)gui).draggedStack = draggedStack;
|
||||
public boolean handleDragNDrop(GuiContainer gui, int mousex, int mousey, ItemStack draggedStack, int button) {
|
||||
if (gui instanceof ThEBaseGui && draggedStack != null && draggedStack.getItem() != null) {
|
||||
((ThEBaseGui) gui).draggedStack = draggedStack.copy();
|
||||
draggedStack.stackSize = 0;
|
||||
}
|
||||
|
||||
return super.handleDragNDrop(gui, mousex, mousey, draggedStack, button);
|
||||
|
||||
+7
-4
@@ -1,6 +1,8 @@
|
||||
package thaumicenergistics.common.integration.tc;
|
||||
|
||||
import com.djgiannuzz.thaumcraftneiplugin.items.ItemAspect;
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.common.Optional;
|
||||
import org.apache.commons.lang3.tuple.ImmutablePair;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -61,7 +63,7 @@ public final class EssentiaItemContainerHelper
|
||||
WispEssence,
|
||||
|
||||
/**
|
||||
* thaumcraftneiplugin.items.ItemAspect
|
||||
* {@link com.djgiannuzz.thaumcraftneiplugin.items.ItemAspect}
|
||||
*/
|
||||
ItemAspect;
|
||||
}
|
||||
@@ -617,9 +619,9 @@ public final class EssentiaItemContainerHelper
|
||||
{
|
||||
return AspectItemType.JarLabel;
|
||||
}
|
||||
//ItemAspect?
|
||||
if( item instanceof ItemAspect )
|
||||
{
|
||||
|
||||
// ItemAspect?
|
||||
if (Loader.isModLoaded("thaumcraftneiplugin") && item instanceof ItemAspect) {
|
||||
return AspectItemType.ItemAspect;
|
||||
}
|
||||
}
|
||||
@@ -949,6 +951,7 @@ public final class EssentiaItemContainerHelper
|
||||
* @param itemStack
|
||||
* @return
|
||||
*/
|
||||
@Optional.Method(modid = "thaumcraftneiplugin")
|
||||
public Aspect getAspectFromItemAspect(ItemStack itemStack){
|
||||
return ItemAspect.getAspects(itemStack).getAspects()[0];
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user