Recipe Stuff
This commit is contained in:
parent
8fa92f8697
commit
da96375b8c
9 changed files with 104 additions and 21 deletions
BIN
resources/assets/dark/textures/items/IC_CHIP.png
Normal file
BIN
resources/assets/dark/textures/items/IC_CHIP.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 271 B After Width: | Height: | Size: 271 B |
41
src/dark/core/client/Effects.java
Normal file
41
src/dark/core/client/Effects.java
Normal 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;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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)
|
||||
|
|
|
@ -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())
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ import dark.core.registration.ModObjectRegistry.BlockBuildData;
|
|||
/** Basic TileEntity Container class designed to be used by generic machines. It is suggested that
|
||||
* each mod using this create there own basic block extending this to reduce need to use build data
|
||||
* per block.
|
||||
*
|
||||
*
|
||||
* @author Darkguardsman */
|
||||
public abstract class BlockMachine extends BlockTile implements IExtraBlockInfo
|
||||
{
|
||||
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -32,13 +32,13 @@ public abstract class NetworkTileEntities
|
|||
|
||||
/** Creates a new instance of this network to be used to merge or split networks while still
|
||||
* maintaining each class that extends the base network class
|
||||
*
|
||||
*
|
||||
* @return - new network instance using the current networks properties */
|
||||
public abstract NetworkTileEntities newInstance();
|
||||
|
||||
/** Adds a TileEntity to the network. extends this to catch non-network parts and add them to
|
||||
* other tile lists
|
||||
*
|
||||
*
|
||||
* @param tileEntity - tileEntity instance
|
||||
* @param member - add to network member list
|
||||
* @return */
|
||||
|
@ -127,7 +127,7 @@ public abstract class NetworkTileEntities
|
|||
|
||||
/** Combines two networks together into one. Calls to preMerge and doMerge instead of doing the
|
||||
* merge process itself
|
||||
*
|
||||
*
|
||||
* @param network
|
||||
* @param mergePoint */
|
||||
public void merge(NetworkTileEntities network, INetworkPart mergePoint)
|
||||
|
@ -143,17 +143,17 @@ public abstract class NetworkTileEntities
|
|||
|
||||
/** Processing that needs too be done before the network merges. Use this to do final network
|
||||
* merge calculations and to cause network merge failure
|
||||
*
|
||||
*
|
||||
* @param network the network that is to merge with this one
|
||||
* @param part the part at which started the network merge. Use this to cause damage if two
|
||||
* networks merge with real world style failures
|
||||
*
|
||||
*
|
||||
* @return false if the merge needs to be canceled.
|
||||
*
|
||||
*
|
||||
* Cases in which the network should fail to merge are were the two networks merge with error.
|
||||
* Or, in the case of pipes the two networks merge and the merge point was destroyed by
|
||||
* combination of liquids.
|
||||
*
|
||||
*
|
||||
* Ex Lava and water */
|
||||
public boolean preMergeProcessing(NetworkTileEntities network, INetworkPart part)
|
||||
{
|
||||
|
@ -235,6 +235,8 @@ public abstract class NetworkTileEntities
|
|||
}
|
||||
}
|
||||
}
|
||||
this.cleanUpMembers();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -245,7 +247,7 @@ public abstract class NetworkTileEntities
|
|||
}
|
||||
|
||||
/** invalidates/remove a tile from the networks that surround and connect to it
|
||||
*
|
||||
*
|
||||
* @param tileEntity - tile */
|
||||
public static void invalidate(TileEntity tileEntity)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue