Website Name Fix.

Meteorite Spawns tweaked and chest contents tweaked.
Catch Dimension Registration.
This commit is contained in:
AlgorithmX2 2014-03-08 17:31:09 -06:00
parent cd51b00b31
commit 6beaa85da6
4 changed files with 57 additions and 30 deletions

View file

@ -27,7 +27,14 @@ public class PacketNewStorageDimension extends AppEngPacket
@SideOnly(Side.CLIENT)
public void clientPacketData(INetworkInfo network, AppEngPacket packet, EntityPlayer player)
{
DimensionManager.registerDimension( newDim, AEConfig.instance.storageProviderID );
try
{
DimensionManager.registerDimension( newDim, AEConfig.instance.storageProviderID );
}
catch (IllegalArgumentException iae)
{
// ok!
}
}
// api

View file

@ -11,7 +11,9 @@ import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import appeng.api.AEApi;
import appeng.util.InventoryAdaptor;
import appeng.util.Platform;
public class MeteoritePlacer
@ -143,7 +145,7 @@ public class MeteoritePlacer
Fallout type = new Fallout();
Block skystone = AEApi.instance().blocks().blockSkyStone.block();
Block skychest = AEApi.instance().blocks().blockSkyChest.block();
Block skychest;
double real_sizeOfMetorite = (Math.random() * 6.0) + 2;
double real_crator = real_sizeOfMetorite * 2 + 5;
@ -153,6 +155,11 @@ public class MeteoritePlacer
public MeteoritePlacer() {
if ( AEApi.instance().blocks().blockSkyChest.block() == null )
skychest = Blocks.chest;
else
skychest = AEApi.instance().blocks().blockSkyChest.block();
validSpawn.add( Blocks.stone );
validSpawn.add( Blocks.cobblestone );
validSpawn.add( Blocks.grass );
@ -311,34 +318,44 @@ public class MeteoritePlacer
TileEntity te = w.getTileEntity( x, y, z );
if ( te instanceof IInventory )
{
switch ((int) (Math.random() * 1000) % 4)
InventoryAdaptor ap = InventoryAdaptor.getAdaptor( te, ForgeDirection.UP );
int primary = (int) (Math.random() * 4);
for (int zz = 0; zz < primary; zz++)
{
case 0:
((IInventory) te).setInventorySlotContents( 0, AEApi.instance().materials().materialCalcProcessorPress.stack( 1 ) );
break;
case 1:
((IInventory) te).setInventorySlotContents( 0, AEApi.instance().materials().materialEngProcessorPress.stack( 1 ) );
break;
case 2:
((IInventory) te).setInventorySlotContents( 0, AEApi.instance().materials().materialLogicProcessorPress.stack( 1 ) );
break;
case 3:
((IInventory) te).setInventorySlotContents( 0, AEApi.instance().materials().materialSiliconPress.stack( 1 ) );
break;
default:
switch ((int) (Math.random() * 1000) % 4)
{
case 0:
ap.addItems( AEApi.instance().materials().materialCalcProcessorPress.stack( 1 ) );
break;
case 1:
ap.addItems( AEApi.instance().materials().materialEngProcessorPress.stack( 1 ) );
break;
case 2:
ap.addItems( AEApi.instance().materials().materialLogicProcessorPress.stack( 1 ) );
break;
case 3:
ap.addItems( AEApi.instance().materials().materialSiliconPress.stack( 1 ) );
break;
default:
}
}
switch ((int) (Math.random() * 1000) % 3)
int secondary = (int) (Math.random() * 3);
for (int zz = 0; zz < secondary; zz++)
{
case 0:
((IInventory) te).setInventorySlotContents( 1, AEApi.instance().blocks().blockSkyStone.stack( (int) (Math.random() * 12) + 1 ) );
break;
case 1:
((IInventory) te).setInventorySlotContents( 1, AEApi.instance().materials().materialIronNugget.stack( (int) (Math.random() * 12) + 1 ) );
break;
case 2:
((IInventory) te).setInventorySlotContents( 1, new ItemStack( net.minecraft.init.Items.gold_nugget, (int) (Math.random() * 12) + 1 ) );
break;
switch ((int) (Math.random() * 1000) % 3)
{
case 0:
ap.addItems( AEApi.instance().blocks().blockSkyStone.stack( (int) (Math.random() * 12) + 1 ) );
break;
case 1:
ap.addItems( AEApi.instance().materials().materialIronNugget.stack( (int) (Math.random() * 12) + 1 ) );
break;
case 2:
ap.addItems( new ItemStack( net.minecraft.init.Items.gold_nugget, (int) (Math.random() * 12) + 1 ) );
break;
}
}
}
}

View file

@ -59,7 +59,7 @@ final public class MeteoriteWorldGen implements IWorldGenerator
}
}
if ( obj.distance > 1000 * 1000 )
if ( obj.distance > 1000 * 500 )
{
int depth = 180 + r.nextInt( 20 );
for (int trys = 0; trys < 20; trys++)

View file

@ -179,10 +179,12 @@ public class RecipeHandler implements IRecipeHandler
{
try
{
return getName( i.getItemStack() );
for (ItemStack is : i.getItemStackSet())
return getName( is );
}
catch (Throwable t)
{
t.printStackTrace();
// :P
}
@ -191,12 +193,13 @@ public class RecipeHandler implements IRecipeHandler
public String getName(ItemStack is)
{
UniqueIdentifier id = GameRegistry.findUniqueIdentifierFor( is.getItem() );
String realName = id.modId + ":" + id.name;
AELog.info( realName );
if ( is.getItem() instanceof ItemMaterial )
realName += ":" + ((ItemMaterial) is.getItem()).getType( is ).name();
realName += ":" + ((ItemMaterial) is.getItem()).getTypeByStack( is ).name();
else if ( is.getItem() instanceof ItemPart )
realName += ":" + ((ItemPart) is.getItem()).getTypeByStack( is ).name();
else if ( is.getItemDamage() > 0 )