Fixed a bug with shift clicking.
Added Quartz Knife Gui. You can now make name presses with the quartz knife. Added Inscriber Recipes. Fixed Bug with Spatial Dim Registrations.
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
package appeng.items.contents;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import appeng.api.implementations.guiobjects.IGuiItemObject;
|
||||
|
||||
public class QuartzKnifeObj implements IGuiItemObject
|
||||
{
|
||||
|
||||
final ItemStack is;
|
||||
|
||||
public QuartzKnifeObj(ItemStack o) {
|
||||
is = o;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getItemStack()
|
||||
{
|
||||
return is;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -17,6 +17,7 @@ import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
@@ -77,15 +78,21 @@ public class ItemMaterial extends AEBaseItem implements IStorageComponent, IUpgr
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
||||
public void addInformation(ItemStack is, EntityPlayer player, List details, boolean moar)
|
||||
{
|
||||
super.addInformation( par1ItemStack, par2EntityPlayer, par3List, par4 );
|
||||
super.addInformation( is, player, details, moar );
|
||||
|
||||
MaterialType mt = getTypeByStack( par1ItemStack );
|
||||
MaterialType mt = getTypeByStack( is );
|
||||
if ( mt == null )
|
||||
return;
|
||||
|
||||
Upgrades u = getType( par1ItemStack );
|
||||
if ( mt == MaterialType.NamePress )
|
||||
{
|
||||
NBTTagCompound c = Platform.openNbtData( is );
|
||||
details.add( c.getString( "InscribeName" ) );
|
||||
}
|
||||
|
||||
Upgrades u = getType( is );
|
||||
if ( u != null )
|
||||
{
|
||||
List<String> textList = new LinkedList();
|
||||
@@ -113,7 +120,7 @@ public class ItemMaterial extends AEBaseItem implements IStorageComponent, IUpgr
|
||||
Pattern p = Pattern.compile( "(\\d+)[^\\d]" );
|
||||
SlightlyBetterSort s = new SlightlyBetterSort( p );
|
||||
Collections.sort( textList, s );
|
||||
par3List.addAll( textList );
|
||||
details.addAll( textList );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,11 +2,19 @@ package appeng.items.tools.quartz;
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import appeng.api.implementations.guiobjects.IGuiItem;
|
||||
import appeng.api.implementations.guiobjects.IGuiItemObject;
|
||||
import appeng.core.features.AEFeature;
|
||||
import appeng.core.sync.GuiBridge;
|
||||
import appeng.items.AEBaseItem;
|
||||
import appeng.items.contents.QuartzKnifeObj;
|
||||
import appeng.util.Platform;
|
||||
|
||||
public class ToolQuartzCuttingKnife extends AEBaseItem
|
||||
public class ToolQuartzCuttingKnife extends AEBaseItem implements IGuiItem
|
||||
{
|
||||
|
||||
public ToolQuartzCuttingKnife(AEFeature type) {
|
||||
@@ -34,6 +42,23 @@ public class ToolQuartzCuttingKnife extends AEBaseItem
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack it, World w, EntityPlayer p)
|
||||
{
|
||||
if ( Platform.isServer() )
|
||||
Platform.openGUI( p, null, ForgeDirection.UNKNOWN, GuiBridge.GUI_QUARTZ_KNIFE );
|
||||
p.swingItem();
|
||||
return it;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUse(ItemStack is, EntityPlayer p, World w, int x, int y, int z, int s, float hitx, float hity, float hitz)
|
||||
{
|
||||
if ( Platform.isServer() )
|
||||
Platform.openGUI( p, null, ForgeDirection.UNKNOWN, GuiBridge.GUI_QUARTZ_KNIFE );
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getContainerItem(ItemStack itemStack)
|
||||
{
|
||||
@@ -41,4 +66,10 @@ public class ToolQuartzCuttingKnife extends AEBaseItem
|
||||
return itemStack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IGuiItemObject getGuiObject(ItemStack is, World world, int x, int y, int z)
|
||||
{
|
||||
return new QuartzKnifeObj( is );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user