Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mod sorting #177

Closed
wants to merge 8 commits into from
Prev Previous commit
Merge remote-tracking branch 'upstream/rv2' into modSorting
Conflicts:
	build.properties
	src/main/java/appeng/client/gui/implementations/GuiCellWorkbench.java
	src/main/java/appeng/container/implementations/ContainerFormationPlane.java
	src/main/java/appeng/container/implementations/ContainerLevelEmitter.java
	src/main/java/appeng/container/implementations/ContainerStorageBus.java
	src/main/java/appeng/items/tools/ToolMemoryCard.java
	src/main/java/appeng/me/GridStorage.java
	src/main/java/appeng/tile/storage/TileChest.java
	src/main/java/appeng/util/inv/AdaptorIInventory.java
  • Loading branch information
thepaperpilot committed Sep 29, 2014
commit e7b2767cfe2cc617006dc78eaf4274970165d71f
2 changes: 1 addition & 1 deletion build.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
version=rv2
aechannel=alpha
build=_
build=0
group=appeng
archivesBaseName=appliedenergistics2

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,17 +153,14 @@ protected void handleButtonVisibility()
copyMode.setState( workbench.copyMode == CopyMode.CLEAR_ON_REMOVE );

boolean hasFuzzy = false;
boolean hasMod = false;
IInventory inv = ccwb.getCellUpgradeInventory();
IInventory inv = workbench.getCellUpgradeInventory();
for (int x = 0; x < inv.getSizeInventory(); x++)
{
ItemStack is = inv.getStackInSlot( x );
if ( is != null && is.getItem() instanceof IUpgradeModule )
{
if ( ((IUpgradeModule) is.getItem()).getType( is ) == Upgrades.FUZZY )
hasFuzzy = true;
else if ( ((IUpgradeModule) is.getItem()).getType( is ) == Upgrades.FUZZY )
hasMod = true;
}
}
fuzzyMode.setVisibility( hasFuzzy );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ public void detectAndSendChanges()

if ( Platform.isServer() )
{
this.fzMode = (FuzzyMode) this.myte.getConfigManager().getSetting( Settings.FUZZY_MODE );
this.mmMode = (ModMode) this.myte.getConfigManager().getSetting( Settings.MOD_MODE );
this.fzMode = (FuzzyMode) this.upgradeable.getConfigManager().getSetting( Settings.FUZZY_MODE );
this.mmMode = (ModMode) this.upgradeable.getConfigManager().getSetting( Settings.MOD_MODE );
}

standardDetectAndSendChanges();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,11 @@ public void detectAndSendChanges()
if ( Platform.isServer() )
{
this.EmitterValue = lvlEmitter.getReportingValue();
this.cmType = (YesNo) this.myte.getConfigManager().getSetting( Settings.CRAFT_VIA_REDSTONE );
this.lvType = (LevelType) this.myte.getConfigManager().getSetting( Settings.LEVEL_TYPE );
this.fzMode = (FuzzyMode) this.myte.getConfigManager().getSetting( Settings.FUZZY_MODE );
this.mmMode = (ModMode) this.myte.getConfigManager().getSetting( Settings.MOD_MODE );
this.rsMode = (RedstoneMode) this.myte.getConfigManager().getSetting( Settings.REDSTONE_EMITTER );
this.cmType = (YesNo) this.upgradeable.getConfigManager().getSetting( Settings.CRAFT_VIA_REDSTONE );
this.lvType = (LevelType) this.upgradeable.getConfigManager().getSetting( Settings.LEVEL_TYPE );
this.fzMode = (FuzzyMode) this.upgradeable.getConfigManager().getSetting( Settings.FUZZY_MODE );
this.mmMode = (ModMode) this.upgradeable.getConfigManager().getSetting( Settings.MOD_MODE );
this.rsMode = (RedstoneMode) this.upgradeable.getConfigManager().getSetting( Settings.REDSTONE_EMITTER );
}

standardDetectAndSendChanges();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,10 @@ public void detectAndSendChanges()

if ( Platform.isServer() )
{
this.fzMode = (FuzzyMode) this.myte.getConfigManager().getSetting( Settings.FUZZY_MODE );
this.mmMode = (ModMode) this.myte.getConfigManager().getSetting( Settings.MOD_MODE );
this.rwMode = (AccessRestriction) this.myte.getConfigManager().getSetting( Settings.ACCESS );
this.storageFilter = (StorageFilter) this.myte.getConfigManager().getSetting( Settings.STORAGE_FILTER );
this.fzMode = (FuzzyMode) this.upgradeable.getConfigManager().getSetting( Settings.FUZZY_MODE );
this.mmMode = (ModMode) this.upgradeable.getConfigManager().getSetting( Settings.MOD_MODE );
this.rwMode = (AccessRestriction) this.upgradeable.getConfigManager().getSetting( Settings.ACCESS );
this.storageFilter = (StorageFilter) this.upgradeable.getConfigManager().getSetting( Settings.STORAGE_FILTER );
}

standardDetectAndSendChanges();
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/appeng/items/tools/ToolMemoryCard.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public ToolMemoryCard() {

/**
* Find the localized string...
*
*
* @param name possible names for the localized string
* @return localized name
*/
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/appeng/me/GridStorage.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class GridStorage implements IGridStorage
final NBTTagCompound data;

public boolean isDirty = false;
private WeakHashMap<GridStorage,Boolean> divlist = new WeakHashMap();
private WeakHashMap<GridStorage,Boolean> divided = new WeakHashMap<GridStorage,Boolean>();
final GridStorageSearch mySearchEntry; // keep myself in the list until I'm
// lost...

Expand Down Expand Up @@ -125,12 +125,12 @@ public void setGrid(Grid grid)

public void addDivided(GridStorage gs)
{
divlist.put( gs, true );
divided.put( gs, true );
}

public boolean hasDivided(GridStorage myStorage)
{
return divlist.containsKey( myStorage );
return divided.containsKey( myStorage );
}

public void remove()
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/appeng/tile/storage/TileChest.java
Original file line number Diff line number Diff line change
Expand Up @@ -389,8 +389,7 @@ public T extractItems(T request, Actionable mode, BaseActionSource src)
return null;
return super.extractItems(request, mode, src);
}

};
}

private <StackType extends IAEStack> MEMonitorHandler<StackType> wrap(IMEInventoryHandler h)
{
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/appeng/util/inv/AdaptorIInventory.java
Original file line number Diff line number Diff line change
Expand Up @@ -111,15 +111,15 @@ public ItemStack simulateSimilarRemove(int amount, ItemStack filter, FuzzyMode f
}

@Override
public ItemStack removeModItems(int how_many, ItemStack filter, IInventoryDestination destination)
public ItemStack removeModItems(int amount, ItemStack filter, IInventoryDestination destination)
{
int s = i.getSizeInventory();
for (int x = 0; x < s; x++)
{
ItemStack is = i.getStackInSlot( x );
if ( is != null && canRemoveStackFromSlot( x, is ) && (filter == null || compareMods( is.getItem(), filter.getItem()) ) )
{
int lhow_many = how_many;
int lhow_many = amount;
if ( lhow_many > is.stackSize )
lhow_many = is.stackSize;
if ( destination != null && !destination.canInsert( is ) )
Expand Down Expand Up @@ -156,7 +156,7 @@ public ItemStack removeModItems(int how_many, ItemStack filter, IInventoryDestin
}

@Override
public ItemStack simulateModRemove(int how_many, ItemStack filter, IInventoryDestination destination)
public ItemStack simulateModRemove(int amount, ItemStack filter, IInventoryDestination destination)
{
int s = i.getSizeInventory();
for (int x = 0; x < s; x++)
Expand All @@ -165,7 +165,7 @@ public ItemStack simulateModRemove(int how_many, ItemStack filter, IInventoryDes

if ( is != null && canRemoveStackFromSlot( x, is ) && (filter == null || compareMods( is.getItem(), filter.getItem()) ) )
{
int lhow_many = how_many;
int lhow_many = amount;
if ( lhow_many > is.stackSize )
lhow_many = is.stackSize;
if ( destination != null && !destination.canInsert( is ) )
Expand All @@ -183,7 +183,7 @@ public ItemStack simulateModRemove(int how_many, ItemStack filter, IInventoryDes
}

@Override
public ItemStack removeItems(int how_many, ItemStack filter, IInventoryDestination destination)
public ItemStack removeItems(int amount, ItemStack filter, IInventoryDestination destination)
{
int s = i.getSizeInventory();
ItemStack rv = null;
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.