Renamed Inscriber Recipe Type to Inscribe.

Missing Icon now supports Items.
Fixed Missing Icons for debug Items.
SkyStone Chests can now be disabled.
More work on Website Recipes.
Removed Unused method in Network Handler.
This commit is contained in:
AlgorithmX2 2014-03-08 21:35:53 -06:00
parent 6beaa85da6
commit 49fcc7f510
16 changed files with 111 additions and 66 deletions

View file

@ -142,7 +142,7 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
public void registerNoIcons()
{
BlockRenderInfo info = getRendererInstance();
FlipableIcon i = new FlipableIcon( new MissingIcon() );
FlipableIcon i = new FlipableIcon( new MissingIcon( this ) );
info.updateIcons( i, i, i, i, i, i );
}

View file

@ -33,7 +33,7 @@ public class BlockSkyChest extends AEBaseBlock implements ICustomCollision
public BlockSkyChest() {
super( BlockSkyChest.class, Material.rock );
setfeature( EnumSet.of( AEFeature.Core ) );
setfeature( EnumSet.of( AEFeature.Core, AEFeature.SkyStoneChests ) );
setTileEntiy( TileSkyChest.class );
isOpaque = isFullSize = false;
lightOpacity = 0;

View file

@ -1,62 +1,80 @@
package appeng.client.texture;
import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.util.IIcon;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class MissingIcon implements IIcon
{
boolean isBlock;
public MissingIcon(Object forWhat) {
isBlock = forWhat instanceof Block;
}
@SideOnly(Side.CLIENT)
public IIcon getMissing()
{
return ((TextureMap) Minecraft.getMinecraft().getTextureManager()
.getTexture( isBlock ? TextureMap.locationBlocksTexture : TextureMap.locationItemsTexture )).getAtlasSprite( "missingno" );
}
@Override
public int getIconWidth()
{
return ExtraTextures.getMissing().getIconWidth();
return getMissing().getIconWidth();
}
@Override
public int getIconHeight()
{
return ExtraTextures.getMissing().getIconHeight();
return getMissing().getIconHeight();
}
@Override
public float getMinU()
{
return ExtraTextures.getMissing().getMinU();
return getMissing().getMinU();
}
@Override
public float getMaxU()
{
return ExtraTextures.getMissing().getMaxU();
return getMissing().getMaxU();
}
@Override
public float getInterpolatedU(double var1)
{
return ExtraTextures.getMissing().getInterpolatedU( var1 );
return getMissing().getInterpolatedU( var1 );
}
@Override
public float getMinV()
{
return ExtraTextures.getMissing().getMinV();
return getMissing().getMinV();
}
@Override
public float getMaxV()
{
return ExtraTextures.getMissing().getMaxV();
return getMissing().getMaxV();
}
@Override
public float getInterpolatedV(double var1)
{
return ExtraTextures.getMissing().getInterpolatedV( var1 );
return getMissing().getInterpolatedV( var1 );
}
@Override
public String getIconName()
{
return ExtraTextures.getMissing().getIconName();
return getMissing().getIconName();
}
}

View file

@ -17,7 +17,7 @@ import appeng.api.implementations.items.ISpatialStorageCell;
import appeng.api.implementations.items.IStorageComponent;
import appeng.api.implementations.items.IUpgradeModule;
import appeng.api.storage.ICellWorkbenchItem;
import appeng.recipes.handlers.Inscriber;
import appeng.recipes.handlers.Inscribe;
import appeng.util.Platform;
public class SlotRestrictedInput extends AppEngSlot
@ -140,7 +140,7 @@ public class SlotRestrictedInput extends AppEngSlot
case INSCRIBER_PLATE:
for (ItemStack is : Inscriber.plates)
for (ItemStack is : Inscribe.plates)
if ( Platform.isSameItemPrecise( is, i ) )
return true;
@ -148,7 +148,7 @@ public class SlotRestrictedInput extends AppEngSlot
case INSCRIBER_INPUT:
for (ItemStack is : Inscriber.inputs)
for (ItemStack is : Inscribe.inputs)
if ( Platform.isSameItemPrecise( is, i ) )
return true;

View file

@ -128,7 +128,7 @@ import appeng.recipes.RecipeHandler;
import appeng.recipes.game.ShapedRecipe;
import appeng.recipes.game.ShapelessRecipe;
import appeng.recipes.handlers.Grind;
import appeng.recipes.handlers.Inscriber;
import appeng.recipes.handlers.Inscribe;
import appeng.recipes.handlers.Macerator;
import appeng.recipes.handlers.Pulverizer;
import appeng.recipes.handlers.Shaped;
@ -178,7 +178,7 @@ public class Registration
recipeRegistery.addNewCraftHandler( "macerator", Macerator.class );
recipeRegistery.addNewCraftHandler( "smelt", Smelt.class );
recipeRegistery.addNewCraftHandler( "inscriber", Inscriber.class );
recipeRegistery.addNewCraftHandler( "inscribe", Inscribe.class );
recipeRegistery.addNewCraftHandler( "shaped", Shaped.class );
recipeRegistery.addNewCraftHandler( "shapeless", Shapeless.class );

View file

@ -8,7 +8,7 @@ public enum AEFeature
CertusQuartzWorldGen("World"), MeteoriteWorldGen("World"),
DecorativeLights("World"), DecorativeQuartzBlocks("World"),
DecorativeLights("World"), DecorativeQuartzBlocks("World"), SkyStoneChests("World"),
GrindStone("World"), Flour("World"), Inscriber("World"),
@ -48,7 +48,7 @@ public enum AEFeature
DuplicateItems("Misc", false), Profiler("Services", false), VersionChecker("Services"), Debug("Misc", false), Creative("Misc"),
Logging("Misc"), IntegrationLogging("Misc", false), CustomRecipes("Crafting", false), WebsiteRecipes("Misc",false),
Logging("Misc"), IntegrationLogging("Misc", false), CustomRecipes("Crafting", false), WebsiteRecipes("Misc", false),
inWorldSingularity("Crafting"), inWorldFluix("Crafting"), inWorldPurification("Crafting");

View file

@ -9,8 +9,8 @@ import net.minecraft.tileentity.TileEntity;
import appeng.api.util.AEItemDefinition;
import appeng.block.AEBaseBlock;
import appeng.block.AEBaseItemBlock;
import appeng.core.CommonHelper;
import appeng.core.AEConfig;
import appeng.core.CommonHelper;
import appeng.core.CreativeTab;
import appeng.core.CreativeTabFacade;
import appeng.items.parts.ItemFacade;
@ -141,6 +141,8 @@ public class AEFeatureHandler implements AEItemDefinition
@Override
public Item item()
{
if ( ItemData == null && BlockData != null )
return Item.getItemFromBlock( BlockData );
return ItemData;
}

View file

@ -9,11 +9,8 @@ import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.gameevent.PlayerEvent.PlayerLoggedInEvent;
import cpw.mods.fml.common.network.FMLEventChannel;
import cpw.mods.fml.common.network.FMLNetworkEvent.ClientCustomPacketEvent;
import cpw.mods.fml.common.network.FMLNetworkEvent.CustomNetworkEvent;
import cpw.mods.fml.common.network.FMLNetworkEvent.ServerCustomPacketEvent;
import cpw.mods.fml.common.network.NetworkHandshakeEstablished;
import cpw.mods.fml.common.network.NetworkRegistry;
import cpw.mods.fml.relauncher.Side;
public class NetworkHandler
{
@ -59,21 +56,6 @@ public class NetworkHandler
}
}
@SubscribeEvent
public void newConection(CustomNetworkEvent cctse)
{
if ( cctse.wrappedEvent instanceof NetworkHandshakeEstablished )
{
NetworkHandshakeEstablished nhe = (NetworkHandshakeEstablished) cctse.wrappedEvent;
if ( nhe.side == Side.SERVER && nhe.netHandler instanceof NetHandlerPlayServer )
{
NetHandlerPlayServer srv = (NetHandlerPlayServer) nhe.netHandler;
// WorldSettings.getInstance().sendToPlayer( srv.playerEntity );
}
}
}
@SubscribeEvent
public void newConection(PlayerLoggedInEvent loginEvent)
{

View file

@ -5,10 +5,12 @@ import java.util.LinkedList;
import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import appeng.api.util.WorldCoord;
import appeng.client.texture.MissingIcon;
import appeng.core.AELog;
import appeng.core.features.AEFeature;
import appeng.items.AEBaseItem;
@ -72,4 +74,10 @@ public class ToolEraser extends AEBaseItem
next.add( new WorldCoord( i, y, z ) );
}
@Override
public void registerIcons(IIconRegister par1IconRegister)
{
itemIcon = new MissingIcon( this );
}
}

View file

@ -2,10 +2,12 @@ package appeng.debug;
import java.util.EnumSet;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ChatComponentText;
import net.minecraft.world.World;
import appeng.client.texture.MissingIcon;
import appeng.core.features.AEFeature;
import appeng.helpers.MeteoritePlacer;
import appeng.items.AEBaseItem;
@ -34,4 +36,10 @@ public class ToolMeteoritePlacer extends AEBaseItem
return true;
}
@Override
public void registerIcons(IIconRegister par1IconRegister)
{
itemIcon = new MissingIcon( this );
}
}

View file

@ -196,14 +196,38 @@ public class RecipeHandler implements IRecipeHandler
UniqueIdentifier id = GameRegistry.findUniqueIdentifierFor( is.getItem() );
String realName = id.modId + ":" + id.name;
AELog.info( realName );
if ( is.getItem() instanceof ItemMaterial )
realName += ":" + ((ItemMaterial) is.getItem()).getTypeByStack( is ).name();
if ( is.getItem() == AEApi.instance().blocks().blockSkyStone.item() )
{
switch (is.getItemDamage())
{
case 1:
realName += ".Block";
break;
case 2:
realName += ".Brick";
break;
case 3:
realName += ".SmallBrick";
break;
default:
}
}
else if ( is.getItem() == AEApi.instance().blocks().blockSkyChest.item() )
{
switch (is.getItemDamage())
{
case 1:
realName += ".Block";
break;
default:
}
}
else if ( is.getItem() instanceof ItemMaterial )
realName += "." + ((ItemMaterial) is.getItem()).getTypeByStack( is ).name();
else if ( is.getItem() instanceof ItemPart )
realName += ":" + ((ItemPart) is.getItem()).getTypeByStack( is ).name();
realName += "." + ((ItemPart) is.getItem()).getTypeByStack( is ).name();
else if ( is.getItemDamage() > 0 )
realName += ":" + is.getItemDamage();
realName += "." + is.getItemDamage();
return realName;

View file

@ -12,7 +12,7 @@ import appeng.api.recipes.IIngredient;
import appeng.recipes.RecipeHandler;
import appeng.util.Platform;
public class Inscriber implements ICraftHandler, IWebsiteSeralizer
public class Inscribe implements ICraftHandler, IWebsiteSeralizer
{
public static HashSet<ItemStack> plates = new HashSet();

View file

@ -91,27 +91,29 @@ public class Shaped implements ICraftHandler, IWebsiteSeralizer
}
@Override
public boolean canCraft(ItemStack reqOutput) throws RegistrationError, MissingIngredientError {
return Platform.isSameItemPrecise( output.getItemStack(),reqOutput );
public boolean canCraft(ItemStack reqOutput) throws RegistrationError, MissingIngredientError
{
return Platform.isSameItemPrecise( output.getItemStack(), reqOutput );
}
@Override
public String getPattern( RecipeHandler h ) {
String o = "shaped "+output.getQty()+"\n";
public String getPattern(RecipeHandler h)
{
String o = "shaped " + output.getQty() + " " + cols + "x" + rows + "\n";
o += h.getName(output)+"\n";
o += h.getName( output ) + "\n";
for ( int y = 0; y < rows; y++ )
for ( int x= 0; x< cols; x++ )
{
IIngredient i = inputs.get(y).get(x);
if ( i.isAir() )
o += "air"+( x +1 == cols ? "\n" : " " );
else
o += h.getName(i)+( x +1 == cols ? "\n" : " " );
}
for (int y = 0; y < rows; y++)
for (int x = 0; x < cols; x++)
{
IIngredient i = inputs.get( y ).get( x );
if ( i.isAir() )
o += "air" + (x + 1 == cols ? "\n" : " ");
else
o += h.getName( i ) + (x + 1 == cols ? "\n" : " ");
}
return o.trim();
}
}

View file

@ -56,7 +56,7 @@ public class Smelt implements ICraftHandler, IWebsiteSeralizer
@Override
public String getPattern( RecipeHandler h ) {
return "smelt "+out.getQty()+"\n"+
h.getName(in)+"\n"+
h.getName(out);
h.getName(out)+"\n"+
h.getName(in);
}
}

View file

@ -282,6 +282,7 @@ public class AEBaseTile extends TileEntity implements IOrientable, ICommonTile
renderFragment = renderFragment | 1;
else
{
// TODO: Optimize Network Load
if ( worldObj != null )
worldObj.markBlockForUpdate( xCoord, yCoord, zCoord );
}

View file

@ -10,7 +10,7 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.common.util.ForgeDirection;
import appeng.api.util.AECableType;
import appeng.recipes.handlers.Inscriber;
import appeng.recipes.handlers.Inscribe;
import appeng.tile.events.AETileEventHandler;
import appeng.tile.events.TileEventType;
import appeng.tile.grid.AENetworkPowerTile;
@ -145,14 +145,14 @@ public class TileInscriber extends AENetworkPowerTile
{
if ( i == 0 || i == 1 )
{
for (ItemStack s : Inscriber.plates)
for (ItemStack s : Inscribe.plates)
if ( Platform.isSameItemPrecise( s, itemstack ) )
return true;
}
if ( i == 2 )
{
for (ItemStack s : Inscriber.inputs)
for (ItemStack s : Inscribe.inputs)
if ( Platform.isSameItemPrecise( s, itemstack ) )
return true;
}