Recipe Stuff

This commit is contained in:
DarkGuardsman 2013-11-02 08:10:51 -04:00
parent 8fa92f8697
commit da96375b8c
9 changed files with 104 additions and 21 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

View file

Before

Width:  |  Height:  |  Size: 271 B

After

Width:  |  Height:  |  Size: 271 B

View file

@ -0,0 +1,41 @@
package dark.core.client;
import net.minecraft.entity.Entity;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
import universalelectricity.core.vector.Vector3;
public class Effects
{
public static void drawParticleStreamTo(World world, Vector3 start, Vector3 end)
{
}
public static void drawParticleStreamTo(Entity shooter, World world, double x, double y, double z)
{
Vec3 direction = shooter.getLookVec().normalize();
double scale = 1.0;
double xoffset = 1.3f;
double yoffset = -.2;
double zoffset = 0.3f;
Vec3 horzdir = direction.normalize();
horzdir.yCoord = 0;
horzdir = horzdir.normalize();
double cx = shooter.posX + direction.xCoord * xoffset - direction.yCoord * horzdir.xCoord * yoffset - horzdir.zCoord * zoffset;
double cy = shooter.posY + shooter.getEyeHeight() + direction.yCoord * xoffset + (1 - Math.abs(direction.yCoord)) * yoffset;
double cz = shooter.posZ + direction.zCoord * xoffset - direction.yCoord * horzdir.zCoord * yoffset + horzdir.xCoord * zoffset;
double dx = x - cx;
double dy = y - cy;
double dz = z - cz;
double ratio = Math.sqrt(dx * dx + dy * dy + dz * dz);
while (Math.abs(cx - x) > Math.abs(dx / ratio))
{
world.spawnParticle("townaura", cx, cy, cz, 0.0D, 0.0D, 0.0D);
cx += dx * 0.1 / ratio;
cy += dy * 0.1 / ratio;
cz += dz * 0.1 / ratio;
}
}
}

View file

@ -44,7 +44,7 @@ public class CoreRecipeLoader extends RecipeLoader
public static ItemStack unfinishedTank;
public static Item itemGlowingSand;
public static Item itemDiggingTool;
public static boolean debugOreItems = true;
public static boolean debugOreItems = false;
@Override
public void loadRecipes()
@ -94,12 +94,21 @@ public class CoreRecipeLoader extends RecipeLoader
// seal
GameRegistry.addRecipe(this.setStackSize(leatherSeal, 16), new Object[] { "LL", "LL", 'L', Item.leather });
// slime steal
new RecipeGrid(this.setStackSize(slimeSeal, 4)).setRowOne(null, leatherSeal, null).setRowTwo(leatherSeal, Item.slimeBall, leatherSeal).setRowThree(null, leatherSeal, null).RegisterRecipe();
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(itemParts, 4, Parts.GasSeal.ordinal()), " # ", "#S#", " # ", '#', "leatherSeal", 'S', Item.slimeBall));
// part valve
GameRegistry.addRecipe(new ShapedOreRecipe(valvePart, new Object[] { "PLP", 'P', "ironPipe", 'L', Block.lever }));
//Basic Circuit
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(itemParts, 1, Parts.CircuitBasic.ordinal()), "!#!", "#@#", "!#!", '@', "plateCopper", '#', Block.glass, '!', "copperWire"));
//Advanced Circuit
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(itemParts, 1, Parts.CircuitAdvanced.ordinal()), "!#!", "#@#", "!#!", '@', "plateCopper", '#', Item.redstone, '!', "copperWire"));
//Elite Circuit
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(itemParts, 1, Parts.CircuitElite.ordinal()), "!#!", "#@#", "!#!", '@', "plateGold", '#', Item.redstone, '!', "copperWire"));
// unfinished tank
new RecipeGrid(unfinishedTank).setRowOne(null, Item.ingotIron, null).setRowTwo(Item.ingotIron, null, Item.ingotIron).setRowThree(null, Item.ingotIron, null).RegisterRecipe();
new RecipeGrid(unfinishedTank).setRowOne(null, bronze, null).setRowTwo(bronze, null, bronze).setRowThree(null, bronze, null).RegisterRecipe();
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(itemParts, 1, Parts.Tank.ordinal()), " # ", "# #", " # ", '#', bronze));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(itemParts, 1, Parts.Tank.ordinal()), " # ", "# #", " # ", '#', steel));
//Motor
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(itemParts, 1, Parts.Motor.ordinal()), new Object[] { "@!@", "!#!", "@!@", '!', "ingotSteel", '#', Item.ingotIron, '@', "copperWire" }));
}
if (itemMetals instanceof ItemOreDirv)

View file

@ -53,6 +53,7 @@ import dark.core.common.items.ItemOreDirv;
import dark.core.common.items.ItemParts;
import dark.core.common.items.ItemReadoutTools;
import dark.core.common.items.ItemWrench;
import dark.core.common.items.ItemParts.Parts;
import dark.core.common.machines.BlockBasicMachine;
import dark.core.common.machines.BlockSolarPanel;
import dark.core.common.transmit.BlockWire;
@ -142,7 +143,14 @@ public class DarkMain extends ModPrefab
}
}
}
if (CoreRecipeLoader.itemMetals instanceof ItemOreDirv)
if (CoreRecipeLoader.itemParts instanceof ItemParts)
{
for (Parts part : Parts.values())
{
OreDictionary.registerOre(part.name, new ItemStack(CoreRecipeLoader.itemParts, 1, part.ordinal()));
}
}
if (CoreRecipeLoader.itemMetals != null)
{
//Ore material recipe loop
for (EnumMaterial mat : EnumMaterial.values())

View file

@ -83,11 +83,16 @@ public class ItemParts extends ItemBasic implements IExtraItemInfo
public static enum Parts
{
Seal("LeatherSeal"),
GasSeal("GasSeal"),
Tank("UnfinishedTank"),
Valve("ValvePart"),
MiningIcon("miningIcon", false);
Seal("leatherSeal"),
GasSeal("gasSeal"),
Tank("unfinishedTank"),
Valve("valvePart"),
MiningIcon("miningIcon", false),
CircuitBasic("circuitBasic"),
CircuitAdvanced("circuitAdvanced"),
CircuitElite("circuitElite"),
Motor("motor"),
IC("IC_Chip");
public String name;
public Icon icon;

View file

@ -65,7 +65,7 @@ public abstract class ModPrefab
* has been made */
public static int getNextItemId()
{
int id = BLOCK_ID_PRE;
int id = ITEM_ID_PREFIX;
while (id > 255 && id < (Item.itemsList.length - 1))
{
@ -76,7 +76,7 @@ public abstract class ModPrefab
}
id++;
}
BLOCK_ID_PRE = id + 1;
ITEM_ID_PREFIX = id + 1;
return id;
}

View file

@ -104,6 +104,24 @@ public abstract class BlockMachine extends BlockTile implements IExtraBlockInfo
}
}
@Override
public void onNeighborTileChange(World world, int x, int y, int z, int tileX, int tileY, int tileZ)
{
super.onNeighborTileChange(world, x, y, z, tileX, tileY, tileZ);
TileEntity tileEntity = world.getBlockTileEntity(x, y, z);
if (tileEntity instanceof INetworkPart)
{
((INetworkPart) tileEntity).refresh();
}
}
public void breakBlock(World world, int x, int y, int z, int par5, int par6)
{
super.breakBlock(world, x, y, z, par5, par6);
world.notifyBlockChange(x, y, z, world.getBlockId(x, y, z));
}
@Override
public TileEntity createTileEntity(World world, int metadata)
{

View file

@ -235,6 +235,8 @@ public abstract class NetworkTileEntities
}
}
}
this.cleanUpMembers();
}
}