Skip to content

Commit

Permalink
Add partitioned cells filter information to the advanced tooltip (#161)
Browse files Browse the repository at this point in the history
  • Loading branch information
repo-alt authored Aug 14, 2022
1 parent 99239d1 commit d06bd36
Show file tree
Hide file tree
Showing 10 changed files with 31 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/main/java/appeng/core/localization/GuiText.java
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public enum GuiText

NoCraftingJobs, CPUs, FacadeCrafting, inWorldCraftingPresses, ChargedQuartzFind,

Included, Excluded, Partitioned, PartitionedOre, Precise, Fuzzy,
Included, Excluded, Partitioned, PartitionedOre, Precise, Fuzzy, Filter,

// Used in a terminal to indicate that an item is craftable
SmallFontCraft, LargeFontCraft,
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/appeng/items/AEBaseItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@

import appeng.core.features.*;
import com.google.common.base.Optional;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
Expand Down Expand Up @@ -71,6 +73,7 @@ public void setFeature( final EnumSet<AEFeature> f )
this.feature = new ItemFeatureHandler( f, this, this, this.subName );
}

@SideOnly(Side.CLIENT)
@Override
@SuppressWarnings( "unchecked" )
public final void addInformation( final ItemStack stack, final EntityPlayer player, final List lines, final boolean displayMoreInfo )
Expand All @@ -91,6 +94,7 @@ public boolean isBookEnchantable( final ItemStack itemstack1, final ItemStack it
return false;
}

@SideOnly(Side.CLIENT)
protected void addCheckedInformation( final ItemStack stack, final EntityPlayer player, final List<String> lines, final boolean displayMoreInfo )
{
super.addInformation( stack, player, lines, displayMoreInfo );
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/appeng/items/misc/ItemCrystalSeed.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
import appeng.items.AEBaseItem;
import appeng.util.Platform;
import cpw.mods.fml.common.registry.EntityRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
Expand Down Expand Up @@ -161,6 +163,7 @@ public float getMultiplier( final Block blk, final Material mat )
return 0.5f;
}

@SideOnly(Side.CLIENT)
@Override
public void addCheckedInformation( final ItemStack stack, final EntityPlayer player, final List<String> lines, final boolean displayMoreInfo )
{
Expand Down
14 changes: 14 additions & 0 deletions src/main/java/appeng/items/storage/ItemBasicStorageCell.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@
import appeng.util.InventoryAdaptor;
import appeng.util.Platform;
import com.google.common.base.Optional;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.java.games.input.Keyboard;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.IInventory;
Expand Down Expand Up @@ -95,6 +99,7 @@ public ItemBasicStorageCell( final MaterialType whichCell, final int kilobytes )
}
}

@SideOnly(Side.CLIENT)
@Override
public void addCheckedInformation( final ItemStack stack, final EntityPlayer player, final List<String> lines, final boolean displayMoreInfo )
{
Expand All @@ -114,6 +119,7 @@ public void addCheckedInformation( final ItemStack stack, final EntityPlayer pla
if( handler.isPreformatted() )
{
String filter = cellInventory.getOreFilter();

if (filter.isEmpty()) {
final String list = (handler.getIncludeExcludeMode() == IncludeExclude.WHITELIST ? GuiText.Included : GuiText.Excluded).getLocal();

Expand All @@ -122,6 +128,14 @@ public void addCheckedInformation( final ItemStack stack, final EntityPlayer pla
} else {
lines.add(GuiText.Partitioned.getLocal() + " - " + list + ' ' + GuiText.Precise.getLocal());
}
if (GuiScreen.isShiftKeyDown()) {
lines.add(GuiText.Filter.getLocal() + ": ");
for (int i = 0; i < cellInventory.getConfigInventory().getSizeInventory(); ++i) {
ItemStack s = cellInventory.getConfigInventory().getStackInSlot(i);
if (s != null)
lines.add(s.getDisplayName());
}
}
}
else {
lines.add(GuiText.PartitionedOre.getLocal() + " : " + filter);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@
import appeng.util.Platform;
import appeng.util.item.AEItemStack;
import com.google.common.base.Optional;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.block.BlockDispenser;
import net.minecraft.entity.player.EntityPlayer;
Expand Down Expand Up @@ -420,6 +422,7 @@ public void cycleColors( final ItemStack is, final ItemStack paintBall, final in
}
}

@SideOnly(Side.CLIENT)
@Override
public void addCheckedInformation( final ItemStack stack, final EntityPlayer player, final List<String> lines, final boolean displayMoreInfo )
{
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/appeng/items/tools/powered/ToolMassCannon.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@
import appeng.tile.misc.TilePaint;
import appeng.util.Platform;
import com.google.common.base.Optional;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.block.BlockDispenser;
import net.minecraft.entity.Entity;
Expand Down Expand Up @@ -89,6 +91,7 @@ public void postInit()
BlockDispenser.dispenseBehaviorRegistry.putObject( this, new DispenserMatterCannon() );
}

@SideOnly(Side.CLIENT)
@Override
public void addCheckedInformation( final ItemStack stack, final EntityPlayer player, final List<String> lines, final boolean displayMoreInfo )
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ public boolean isFull3D()
return false;
}

@SideOnly(Side.CLIENT)
@Override
public void addCheckedInformation( final ItemStack stack, final EntityPlayer player, final List<String> lines, final boolean displayMoreInfo )
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ public boolean isFull3D()
return false;
}

@SideOnly(Side.CLIENT)
@Override
public void addCheckedInformation( final ItemStack stack, final EntityPlayer player, final List<String> lines, final boolean displayMoreInfo )
{
Expand Down
1 change: 0 additions & 1 deletion src/main/java/appeng/services/version/github/Release.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
/**
* Template class for Gson to write values from the Json Object into an actual class
*/
@SuppressWarnings( "all" )
public class Release
{
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ gui.appliedenergistics2.Partitioned=Partitioned
gui.appliedenergistics2.PartitionedOre=Ore dictionary filter
gui.appliedenergistics2.Precise=Precise
gui.appliedenergistics2.Fuzzy=Fuzzy
gui.appliedenergistics2.Filter=Filter
gui.appliedenergistics2.SmallFontCraft=Craft
gui.appliedenergistics2.LargeFontCraft=+
gui.appliedenergistics2.Renamer=Custom Name: (Enter to set)
Expand Down

0 comments on commit d06bd36

Please sign in to comment.