Some changes to match CoreLibrary
This commit is contained in:
parent
53cbd3c8ae
commit
20e1c5cfa8
18 changed files with 33 additions and 395 deletions
|
@ -1 +1 @@
|
|||
Subproject commit a43c270a7d02e861f2307696c922dc523a7c8177
|
||||
Subproject commit 11866075c5650581b21ae55c261bba30a4e72fb0
|
|
@ -1 +1 @@
|
|||
Subproject commit a33b93b4b5aa5a7049b3f4daa4a9c9650298d00b
|
||||
Subproject commit 16b902a7395ced96d83c440fa8b339c05aa7cc8d
|
|
@ -93,8 +93,6 @@ import com.builtbroken.assemblyline.multipart.MultipartAL;
|
|||
import com.builtbroken.assemblyline.redstone.BlockAdvancedHopper;
|
||||
import com.builtbroken.assemblyline.transmit.BlockWire;
|
||||
import com.builtbroken.assemblyline.transmit.ItemBlockWire;
|
||||
import com.builtbroken.assemblyline.worldgen.OreGenReplaceStone;
|
||||
import com.builtbroken.assemblyline.worldgen.OreGenerator;
|
||||
import com.builtbroken.minecraft.CoreRegistry;
|
||||
import com.builtbroken.minecraft.DarkCore;
|
||||
import com.builtbroken.minecraft.EnumMaterial;
|
||||
|
@ -103,6 +101,8 @@ import com.builtbroken.minecraft.TranslationHelper;
|
|||
import com.builtbroken.minecraft.fluid.EnumGas;
|
||||
import com.builtbroken.minecraft.network.PacketHandler;
|
||||
import com.builtbroken.minecraft.prefab.ItemBlockHolder;
|
||||
import com.builtbroken.minecraft.worldgen.OreGenReplaceStone;
|
||||
import com.builtbroken.minecraft.worldgen.OreGenerator;
|
||||
|
||||
import cpw.mods.fml.common.FMLLog;
|
||||
import cpw.mods.fml.common.Loader;
|
||||
|
|
|
@ -1,16 +0,0 @@
|
|||
package com.builtbroken.assemblyline.api;
|
||||
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
|
||||
/** The interface is applied to TileEntities that can rotate.
|
||||
*
|
||||
* @author Calclavia */
|
||||
|
||||
public interface IRotatable
|
||||
{
|
||||
/** @return Gets the facing direction. Always returns the front side of the block. */
|
||||
public ForgeDirection getDirection();
|
||||
|
||||
/** @param Sets the facing direction. */
|
||||
public void setDirection(ForgeDirection direection);
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
package com.builtbroken.assemblyline.api;
|
||||
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
|
||||
/** The interface is applied to Blocks that can rotate.
|
||||
*
|
||||
* @author DarkGuardsman */
|
||||
|
||||
public interface IRotatableBlock
|
||||
{
|
||||
/** @return Gets the facing direction. Always returns the front side of the block. */
|
||||
public ForgeDirection getDirection(World world, int x, int y, int z);
|
||||
|
||||
/** @param Sets the facing direction. */
|
||||
public void setDirection(World world, int x, int y, int z, ForgeDirection direection);
|
||||
}
|
|
@ -6,7 +6,7 @@ import net.minecraftforge.common.ForgeDirection;
|
|||
import net.minecraftforge.fluids.IFluidHandler;
|
||||
import universalelectricity.api.vector.Vector3;
|
||||
|
||||
import com.builtbroken.assemblyline.api.IRotatable;
|
||||
import com.builtbroken.minecraft.interfaces.IRotatable;
|
||||
|
||||
/** Interface to make or use the TileEntityDrain. This is mostly a dummy interface to help the
|
||||
* construction pump use the TileEntity as the center of drain location
|
||||
|
|
|
@ -11,7 +11,6 @@ import net.minecraft.tileentity.TileEntity;
|
|||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
import universalelectricity.api.UniversalElectricity;
|
||||
import universalelectricity.api.vector.Vector3;
|
||||
|
||||
import com.builtbroken.assemblyline.AssemblyLine;
|
||||
import com.builtbroken.assemblyline.blocks.BlockAssembly;
|
||||
|
@ -19,7 +18,9 @@ import com.builtbroken.assemblyline.client.render.BlockRenderingHandler;
|
|||
import com.builtbroken.assemblyline.client.render.RenderArmbot;
|
||||
import com.builtbroken.common.Pair;
|
||||
import com.builtbroken.minecraft.DarkCore;
|
||||
import com.builtbroken.minecraft.interfaces.IBlockActivated;
|
||||
import com.builtbroken.minecraft.interfaces.IMultiBlock;
|
||||
import com.builtbroken.minecraft.interfaces.IRotatable;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
@ -32,14 +33,20 @@ public class BlockArmbot extends BlockAssembly
|
|||
DarkCore.requestMultiBlock(AssemblyLine.MOD_ID);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canBlockStay(World world, int x, int y, int z)
|
||||
{
|
||||
return world.getBlockMaterial(x, y - 1, z).isSolid();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockAdded(World world, int x, int y, int z)
|
||||
{
|
||||
TileEntity tileEntity = world.getBlockTileEntity(x, y, z);
|
||||
|
||||
if (tileEntity != null && tileEntity instanceof IMultiBlock)
|
||||
if (tileEntity instanceof IMultiBlock)
|
||||
{
|
||||
((IMultiBlock) tileEntity).onCreate(new Vector3(x, y, z));
|
||||
DarkCore.multiBlock.createMultiBlockStructure((IMultiBlock) tileEntity);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -48,9 +55,9 @@ public class BlockArmbot extends BlockAssembly
|
|||
{
|
||||
TileEntity tileEntity = world.getBlockTileEntity(x, y, z);
|
||||
|
||||
if (tileEntity instanceof IMultiBlock)
|
||||
if (tileEntity instanceof IBlockActivated)
|
||||
{
|
||||
return ((IMultiBlock) tileEntity).onActivated(player);
|
||||
return ((IBlockActivated) tileEntity).onActivated(player);
|
||||
}
|
||||
|
||||
return false;
|
||||
|
@ -63,12 +70,10 @@ public class BlockArmbot extends BlockAssembly
|
|||
|
||||
if (tileEntity instanceof TileEntityArmbot)
|
||||
{
|
||||
((TileEntityArmbot) tileEntity).onDestroy(tileEntity);
|
||||
((TileEntityArmbot) tileEntity).dropHeldObject();
|
||||
DarkCore.multiBlock.destroyMultiBlockStructure((TileEntityArmbot) tileEntity);
|
||||
}
|
||||
|
||||
this.dropBlockAsItem_do(world, x, y, z, new ItemStack(this));
|
||||
|
||||
super.breakBlock(world, x, y, z, par5, par6);
|
||||
}
|
||||
|
||||
|
@ -115,11 +120,4 @@ public class BlockArmbot extends BlockAssembly
|
|||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canProvidePower()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -7,7 +7,6 @@ import net.minecraft.entity.player.EntityPlayer;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.network.packet.Packet;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import universalelectricity.api.vector.Vector2;
|
||||
|
@ -25,10 +24,10 @@ import com.builtbroken.assemblyline.armbot.command.TaskRotateTo;
|
|||
import com.builtbroken.assemblyline.machine.TileEntityAssembly;
|
||||
import com.builtbroken.assemblyline.machine.encoder.ItemDisk;
|
||||
import com.builtbroken.common.Pair;
|
||||
import com.builtbroken.minecraft.DarkCore;
|
||||
import com.builtbroken.minecraft.TranslationHelper;
|
||||
import com.builtbroken.minecraft.helpers.HelperMethods;
|
||||
import com.builtbroken.minecraft.helpers.MathHelper;
|
||||
import com.builtbroken.minecraft.interfaces.IBlockActivated;
|
||||
import com.builtbroken.minecraft.interfaces.IMultiBlock;
|
||||
import com.builtbroken.minecraft.network.PacketHandler;
|
||||
import com.google.common.io.ByteArrayDataInput;
|
||||
|
@ -37,7 +36,7 @@ import cpw.mods.fml.common.FMLCommonHandler;
|
|||
import cpw.mods.fml.common.network.Player;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
|
||||
public class TileEntityArmbot extends TileEntityAssembly implements IMultiBlock, IArmbot
|
||||
public class TileEntityArmbot extends TileEntityAssembly implements IMultiBlock, IArmbot, IBlockActivated
|
||||
{
|
||||
protected int ROTATION_SPEED = 6;
|
||||
|
||||
|
@ -354,16 +353,9 @@ public class TileEntityArmbot extends TileEntityAssembly implements IMultiBlock,
|
|||
/************************************ Multi Block code *************************************/
|
||||
|
||||
@Override
|
||||
public void onCreate(Vector3 placedPosition)
|
||||
public Vector3[] getMultiBlockVectors()
|
||||
{
|
||||
DarkCore.multiBlock.makeFakeBlock(this.worldObj, Vector3.translate(placedPosition, new Vector3(0, 1, 0)), new Vector3(this));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy(TileEntity callingBlock)
|
||||
{
|
||||
this.worldObj.setBlock(this.xCoord, this.yCoord, this.zCoord, 0, 0, 3);
|
||||
this.worldObj.setBlock(this.xCoord, this.yCoord + 1, this.zCoord, 0, 0, 3);
|
||||
return new Vector3[] { new Vector3(this).translate(0, 1, 0) };
|
||||
}
|
||||
|
||||
/************************************ Armbot API methods *************************************/
|
||||
|
@ -545,4 +537,5 @@ public class TileEntityArmbot extends TileEntityAssembly implements IMultiBlock,
|
|||
{
|
||||
return this.location;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -17,11 +17,11 @@ import net.minecraftforge.oredict.OreDictionary;
|
|||
|
||||
import com.builtbroken.assemblyline.ALRecipeLoader;
|
||||
import com.builtbroken.assemblyline.AssemblyLine;
|
||||
import com.builtbroken.assemblyline.worldgen.OreGenReplaceStone;
|
||||
import com.builtbroken.common.Pair;
|
||||
import com.builtbroken.minecraft.DarkCore;
|
||||
import com.builtbroken.minecraft.EnumMaterial;
|
||||
import com.builtbroken.minecraft.IExtraInfo.IExtraBlockInfo;
|
||||
import com.builtbroken.minecraft.worldgen.OreGenReplaceStone;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
|
|
@ -31,7 +31,7 @@ public class RenderPipe extends TileEntitySpecialRenderer
|
|||
public static ModelOpenTrough MODEL_TROUGH_PIPE = new ModelOpenTrough();
|
||||
private static HashMap<Pair<FluidPartsMaterial, Integer>, ResourceLocation> TEXTURES = new HashMap<Pair<FluidPartsMaterial, Integer>, ResourceLocation>();
|
||||
public static ResourceLocation TEXTURE = new ResourceLocation(AssemblyLine.DOMAIN, DarkCore.MODEL_DIRECTORY + "pipes/Pipe.png");
|
||||
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity te, double d, double d1, double d2, float f)
|
||||
{
|
||||
|
@ -47,12 +47,12 @@ public class RenderPipe extends TileEntitySpecialRenderer
|
|||
boolean[] sides = ((TileEntityPipe) te).renderConnection;
|
||||
if (mat == FluidPartsMaterial.WOOD || mat == FluidPartsMaterial.STONE)
|
||||
{
|
||||
//FluidStack liquid = ((TileEntityPipe) te).getTank().getFluid();
|
||||
FluidStack liquid = ((TileEntityPipe) te).getTank().getFluid();
|
||||
int cap = ((TileEntityPipe) te).getTankInfo()[0].capacity;
|
||||
FluidStack liquid = new FluidStack(FluidRegistry.WATER, cap);
|
||||
float per = Math.max(1, (float) liquid.amount / (float) (cap));
|
||||
//FluidStack liquid = new FluidStack(FluidRegistry.WATER, cap);
|
||||
if (liquid != null && liquid.amount > 100)
|
||||
{
|
||||
float per = Math.max(1, (float) liquid.amount / (float) (cap));
|
||||
int[] displayList = RenderFluidHelper.getFluidDisplayLists(liquid, te.worldObj, false);
|
||||
bindTexture(RenderFluidHelper.getFluidSheet(liquid));
|
||||
|
||||
|
|
|
@ -7,9 +7,9 @@ import net.minecraft.nbt.NBTTagCompound;
|
|||
import net.minecraftforge.common.ForgeDirection;
|
||||
|
||||
import com.builtbroken.assemblyline.api.IFilterable;
|
||||
import com.builtbroken.assemblyline.api.IRotatable;
|
||||
import com.builtbroken.assemblyline.imprinter.ItemImprinter;
|
||||
import com.builtbroken.assemblyline.machine.TileEntityAssembly;
|
||||
import com.builtbroken.minecraft.interfaces.IRotatable;
|
||||
|
||||
public abstract class TileEntityFilterable extends TileEntityAssembly implements IRotatable, IFilterable
|
||||
{
|
||||
|
|
|
@ -16,9 +16,9 @@ import net.minecraftforge.common.ForgeDirection;
|
|||
import universalelectricity.api.vector.Vector3;
|
||||
|
||||
import com.builtbroken.assemblyline.AssemblyLine;
|
||||
import com.builtbroken.assemblyline.api.IRotatable;
|
||||
import com.builtbroken.assemblyline.api.IRotatableBlock;
|
||||
import com.builtbroken.assemblyline.blocks.BlockAssembly;
|
||||
import com.builtbroken.minecraft.interfaces.IRotatable;
|
||||
import com.builtbroken.minecraft.interfaces.IRotatableBlock;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
|
|
@ -11,10 +11,10 @@ import net.minecraftforge.common.ForgeDirection;
|
|||
import universalelectricity.api.vector.Vector3;
|
||||
|
||||
import com.builtbroken.assemblyline.api.IManipulator;
|
||||
import com.builtbroken.assemblyline.api.IRotatable;
|
||||
import com.builtbroken.assemblyline.imprinter.ItemImprinter;
|
||||
import com.builtbroken.assemblyline.imprinter.prefab.TileEntityFilterable;
|
||||
import com.builtbroken.minecraft.helpers.InvInteractionHelper;
|
||||
import com.builtbroken.minecraft.interfaces.IRotatable;
|
||||
import com.builtbroken.minecraft.network.PacketHandler;
|
||||
import com.google.common.io.ByteArrayDataInput;
|
||||
|
||||
|
|
|
@ -14,8 +14,8 @@ import universalelectricity.api.vector.Vector3;
|
|||
|
||||
import com.builtbroken.assemblyline.ALRecipeLoader;
|
||||
import com.builtbroken.assemblyline.api.IBelt;
|
||||
import com.builtbroken.assemblyline.api.IRotatable;
|
||||
import com.builtbroken.assemblyline.machine.TileEntityAssembly;
|
||||
import com.builtbroken.minecraft.interfaces.IRotatable;
|
||||
import com.builtbroken.minecraft.network.PacketHandler;
|
||||
import com.google.common.io.ByteArrayDataInput;
|
||||
|
||||
|
|
|
@ -1,87 +0,0 @@
|
|||
package com.builtbroken.assemblyline.worldgen;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.chunk.IChunkProvider;
|
||||
import net.minecraftforge.common.Configuration;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import cpw.mods.fml.common.FMLLog;
|
||||
|
||||
/** This class is used for storing ore generation data. If you are too lazy to generate your own
|
||||
* ores, you can do {@link #OreGenerator.addOre()} to add your ore to the list of ores to generate.
|
||||
*
|
||||
* @author Calclavia */
|
||||
public abstract class OreGenBase
|
||||
{
|
||||
public String name;
|
||||
|
||||
public String oreDictionaryName;
|
||||
|
||||
public boolean shouldGenerate = false;
|
||||
|
||||
public int blockIndexTexture;
|
||||
|
||||
public ItemStack oreStack;
|
||||
|
||||
public int oreID;
|
||||
|
||||
public int oreMeta;
|
||||
|
||||
/** What harvest level does this machine need to be acquired? */
|
||||
public int harvestLevel;
|
||||
|
||||
/** The predefined tool classes are "pickaxe", "shovel", "axe". You can add others for custom
|
||||
* tools. */
|
||||
public String harvestTool;
|
||||
|
||||
/** @param name - The name of the ore for display
|
||||
* @param textureFile - The 16x16 png texture of your ore to override
|
||||
* @param minGenerateLevel - The highest generation level of your ore
|
||||
* @param maxGenerateLevel - The lowest generation level of your ore
|
||||
* @param amountPerChunk - The amount of ores to generate per chunk
|
||||
* @param amountPerBranch - The amount of ores to generate in a clutter. E.g coal generates with
|
||||
* a lot of other coal next to it. How much do you want? */
|
||||
public OreGenBase(String name, String oreDiectionaryName, ItemStack stack, String harvestTool, int harvestLevel)
|
||||
{
|
||||
if (stack != null)
|
||||
{
|
||||
this.name = name;
|
||||
this.harvestTool = harvestTool;
|
||||
this.harvestLevel = harvestLevel;
|
||||
this.oreDictionaryName = oreDiectionaryName;
|
||||
this.oreStack = stack;
|
||||
this.oreID = stack.itemID;
|
||||
this.oreMeta = stack.getItemDamage();
|
||||
|
||||
OreDictionary.registerOre(oreDictionaryName, stack);
|
||||
MinecraftForge.setBlockHarvestLevel(Block.blocksList[stack.itemID], stack.getItemDamage(), harvestTool, harvestLevel);
|
||||
}
|
||||
else
|
||||
{
|
||||
FMLLog.severe("ItemStack is null while registering ore generation!");
|
||||
}
|
||||
}
|
||||
|
||||
public OreGenBase enable(Configuration config)
|
||||
{
|
||||
this.shouldGenerate = shouldGenerateOre(config, this.name);
|
||||
return this;
|
||||
}
|
||||
|
||||
/** Checks the config file and see if Universal Electricity should generate this ore */
|
||||
private static boolean shouldGenerateOre(Configuration configuration, String oreName)
|
||||
{
|
||||
configuration.load();
|
||||
boolean shouldGenerate = configuration.get("Ore_Generation", "Generate " + oreName, true).getBoolean(true);
|
||||
configuration.save();
|
||||
return shouldGenerate;
|
||||
}
|
||||
|
||||
public abstract void generate(World world, Random random, int varX, int varZ);
|
||||
|
||||
public abstract boolean isOreGeneratedInWorld(World world, IChunkProvider chunkGenerator);
|
||||
}
|
|
@ -1,146 +0,0 @@
|
|||
package com.builtbroken.assemblyline.worldgen;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.chunk.IChunkProvider;
|
||||
import net.minecraft.world.gen.ChunkProviderEnd;
|
||||
import net.minecraft.world.gen.ChunkProviderGenerate;
|
||||
import net.minecraft.world.gen.ChunkProviderHell;
|
||||
|
||||
/** This class is used for storing ore generation data. If you are too lazy to generate your own
|
||||
* ores, you can do {@link #OreGenerator.ORES_TO_GENERATE.add()} to add your ore to the list of ores
|
||||
* to generate.
|
||||
*
|
||||
* @author Calclavia */
|
||||
public class OreGenReplace extends OreGenBase
|
||||
{
|
||||
|
||||
public int minGenerateLevel;
|
||||
public int maxGenerateLevel;
|
||||
public int amountPerChunk;
|
||||
public int amountPerBranch;
|
||||
public int replaceID;
|
||||
|
||||
/** Dimensions to ignore ore generation */
|
||||
public boolean ignoreSurface = false;
|
||||
public boolean ignoreNether = true;
|
||||
public boolean ignoreEnd = true;
|
||||
|
||||
/** @param name - The name of the ore for display
|
||||
* @param textureFile - The 16x16 png texture of your ore to override
|
||||
* @param minGenerateLevel - The highest generation level of your ore
|
||||
* @param maxGenerateLevel - The lowest generation level of your ore
|
||||
* @param amountPerChunk - The amount of ores to generate per chunk
|
||||
* @param amountPerBranch - The amount of ores to generate in a clutter. E.g coal generates with
|
||||
* a lot of other coal next to it. How much do you want? */
|
||||
public OreGenReplace(String name, String oreDiectionaryName, ItemStack stack, int replaceID, int minGenerateLevel, int maxGenerateLevel, int amountPerChunk, int amountPerBranch, String harvestTool, int harvestLevel)
|
||||
{
|
||||
super(name, oreDiectionaryName, stack, harvestTool, harvestLevel);
|
||||
this.minGenerateLevel = minGenerateLevel;
|
||||
this.maxGenerateLevel = maxGenerateLevel;
|
||||
this.amountPerChunk = amountPerChunk;
|
||||
this.amountPerBranch = amountPerBranch;
|
||||
this.replaceID = replaceID;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate(World world, Random random, int varX, int varZ)
|
||||
{
|
||||
try
|
||||
{
|
||||
for (int i = 0; i < this.amountPerChunk; i++)
|
||||
{
|
||||
int x = varX + random.nextInt(16);
|
||||
int z = varZ + random.nextInt(16);
|
||||
int y = random.nextInt(Math.max(this.maxGenerateLevel - this.minGenerateLevel, 0)) + this.minGenerateLevel;
|
||||
this.generateReplace(world, random, x, y, z);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
System.out.println("Error generating ore: " + this.name);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public boolean generateReplace(World par1World, Random par2Random, int par3, int par4, int par5)
|
||||
{
|
||||
float var6 = par2Random.nextFloat() * (float) Math.PI;
|
||||
double var7 = par3 + 8 + MathHelper.sin(var6) * this.amountPerBranch / 8.0F;
|
||||
double var9 = par3 + 8 - MathHelper.sin(var6) * this.amountPerBranch / 8.0F;
|
||||
double var11 = par5 + 8 + MathHelper.cos(var6) * this.amountPerBranch / 8.0F;
|
||||
double var13 = par5 + 8 - MathHelper.cos(var6) * this.amountPerBranch / 8.0F;
|
||||
double var15 = par4 + par2Random.nextInt(3) - 2;
|
||||
double var17 = par4 + par2Random.nextInt(3) - 2;
|
||||
|
||||
for (int var19 = 0; var19 <= this.amountPerBranch; ++var19)
|
||||
{
|
||||
double var20 = var7 + (var9 - var7) * var19 / this.amountPerBranch;
|
||||
double var22 = var15 + (var17 - var15) * var19 / this.amountPerBranch;
|
||||
double var24 = var11 + (var13 - var11) * var19 / this.amountPerBranch;
|
||||
double var26 = par2Random.nextDouble() * this.amountPerBranch / 16.0D;
|
||||
double var28 = (MathHelper.sin(var19 * (float) Math.PI / this.amountPerBranch) + 1.0F) * var26 + 1.0D;
|
||||
double var30 = (MathHelper.sin(var19 * (float) Math.PI / this.amountPerBranch) + 1.0F) * var26 + 1.0D;
|
||||
int var32 = MathHelper.floor_double(var20 - var28 / 2.0D);
|
||||
int var33 = MathHelper.floor_double(var22 - var30 / 2.0D);
|
||||
int var34 = MathHelper.floor_double(var24 - var28 / 2.0D);
|
||||
int var35 = MathHelper.floor_double(var20 + var28 / 2.0D);
|
||||
int var36 = MathHelper.floor_double(var22 + var30 / 2.0D);
|
||||
int var37 = MathHelper.floor_double(var24 + var28 / 2.0D);
|
||||
|
||||
for (int var38 = var32; var38 <= var35; ++var38)
|
||||
{
|
||||
double var39 = (var38 + 0.5D - var20) / (var28 / 2.0D);
|
||||
|
||||
if (var39 * var39 < 1.0D)
|
||||
{
|
||||
for (int var41 = var33; var41 <= var36; ++var41)
|
||||
{
|
||||
double var42 = (var41 + 0.5D - var22) / (var30 / 2.0D);
|
||||
|
||||
if (var39 * var39 + var42 * var42 < 1.0D)
|
||||
{
|
||||
for (int var44 = var34; var44 <= var37; ++var44)
|
||||
{
|
||||
double var45 = (var44 + 0.5D - var24) / (var28 / 2.0D);
|
||||
|
||||
int block = par1World.getBlockId(var38, var41, var44);
|
||||
if (var39 * var39 + var42 * var42 + var45 * var45 < 1.0D && (this.replaceID == 0 || block == this.replaceID))
|
||||
{
|
||||
par1World.setBlock(var38, var41, var44, this.oreID, this.oreMeta, 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOreGeneratedInWorld(World world, IChunkProvider chunkGenerator)
|
||||
{
|
||||
if (!this.shouldGenerate)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (this.ignoreSurface && chunkGenerator instanceof ChunkProviderGenerate)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (this.ignoreNether && chunkGenerator instanceof ChunkProviderHell)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (this.ignoreEnd && chunkGenerator instanceof ChunkProviderEnd)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
package com.builtbroken.assemblyline.worldgen;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class OreGenReplaceStone extends OreGenReplace
|
||||
{
|
||||
public OreGenReplaceStone(String name, String oreDiectionaryName, ItemStack stack, int minGenerateLevel, int maxGenerateLevel, int amountPerChunk, int amountPerBranch, String harvestTool, int harvestLevel)
|
||||
{
|
||||
super(name, oreDiectionaryName, stack, 1, minGenerateLevel, maxGenerateLevel, amountPerChunk, amountPerBranch, harvestTool, harvestLevel);
|
||||
}
|
||||
|
||||
// A simplified version of the constructor
|
||||
public OreGenReplaceStone(String name, String oreDiectionaryName, ItemStack stack, int maxGenerateLevel, int amountPerChunk, int amountPerBranch)
|
||||
{
|
||||
this(name, oreDiectionaryName, stack, 0, maxGenerateLevel, amountPerChunk, amountPerBranch, "pickaxe", 1);
|
||||
}
|
||||
}
|
|
@ -1,70 +0,0 @@
|
|||
package com.builtbroken.assemblyline.worldgen;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.chunk.IChunkProvider;
|
||||
import cpw.mods.fml.common.IWorldGenerator;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
public class OreGenerator implements IWorldGenerator
|
||||
{
|
||||
public static boolean isInitiated = false;
|
||||
|
||||
/** Add your ore data to this list of ores for it to automatically generate! No hassle indeed! */
|
||||
private static final List<OreGenBase> ORES_TO_GENERATE = new ArrayList<OreGenBase>();
|
||||
|
||||
/** Adds an ore to the ore generate list. Do this in pre-init. */
|
||||
public static void addOre(OreGenBase data)
|
||||
{
|
||||
if (!isInitiated)
|
||||
{
|
||||
GameRegistry.registerWorldGenerator(new OreGenerator());
|
||||
}
|
||||
|
||||
ORES_TO_GENERATE.add(data);
|
||||
}
|
||||
|
||||
/** Checks to see if this ore
|
||||
*
|
||||
* @param oreName
|
||||
* @return */
|
||||
public static boolean oreExists(String oreName)
|
||||
{
|
||||
for (OreGenBase ore : ORES_TO_GENERATE)
|
||||
{
|
||||
if (ore.oreDictionaryName == oreName)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/** Removes an ore to the ore generate list. Do this in init. */
|
||||
public static void removeOre(OreGenBase data)
|
||||
{
|
||||
ORES_TO_GENERATE.remove(data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate(Random rand, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider)
|
||||
{
|
||||
chunkX = chunkX << 4;
|
||||
chunkZ = chunkZ << 4;
|
||||
|
||||
// Checks to make sure this is the normal
|
||||
// world
|
||||
for (OreGenBase oreData : ORES_TO_GENERATE)
|
||||
{
|
||||
if (oreData.shouldGenerate && oreData.isOreGeneratedInWorld(world, chunkGenerator))
|
||||
{
|
||||
oreData.generate(world, rand, chunkX, chunkZ);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue