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

@ -26,9 +26,16 @@ public class PacketNewStorageDimension extends AppEngPacket
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void clientPacketData(INetworkInfo network, AppEngPacket packet, EntityPlayer player) public void clientPacketData(INetworkInfo network, AppEngPacket packet, EntityPlayer player)
{
try
{ {
DimensionManager.registerDimension( newDim, AEConfig.instance.storageProviderID ); DimensionManager.registerDimension( newDim, AEConfig.instance.storageProviderID );
} }
catch (IllegalArgumentException iae)
{
// ok!
}
}
// api // api
public PacketNewStorageDimension(int newDim) throws IOException { public PacketNewStorageDimension(int newDim) throws IOException {

View file

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

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 ); int depth = 180 + r.nextInt( 20 );
for (int trys = 0; trys < 20; trys++) for (int trys = 0; trys < 20; trys++)

View file

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