Merge pull request #142 from SenseiKiwi/master

Various Small Changes
This commit is contained in:
StevenRS11 2014-03-07 21:53:14 -05:00
commit 3b9b839b7d
33 changed files with 294 additions and 267 deletions

View file

@ -119,7 +119,6 @@ public class DDProperties
//Names of categories //Names of categories
private final String CATEGORY_CRAFTING = "crafting"; private final String CATEGORY_CRAFTING = "crafting";
private final String CATEGORY_ENTITY = "entity"; private final String CATEGORY_ENTITY = "entity";
private final String CATEGORY_SPECIAL = "special";
private final String CATEGORY_DIMENSION = "dimension"; private final String CATEGORY_DIMENSION = "dimension";
private final String CATEGORY_PROVIDER = "provider"; private final String CATEGORY_PROVIDER = "provider";
private final String CATEGORY_BIOME = "biome"; private final String CATEGORY_BIOME = "biome";
@ -209,6 +208,9 @@ public class DDProperties
WorldRiftGenerationEnabled = config.get(Configuration.CATEGORY_GENERAL, "Enable Rift World Generation", true, WorldRiftGenerationEnabled = config.get(Configuration.CATEGORY_GENERAL, "Enable Rift World Generation", true,
"Sets whether dungeon rifts generate in dimensions other than Limbo").getBoolean(true); "Sets whether dungeon rifts generate in dimensions other than Limbo").getBoolean(true);
MonolithTeleportationEnabled = config.get(Configuration.CATEGORY_GENERAL, "Enable Monolith Teleportation", true,
"Sets whether Monoliths can teleport players").getBoolean(true);
MonolithSpawningChance = config.get(Configuration.CATEGORY_GENERAL, "Monolith Spawning Chance", 28, MonolithSpawningChance = config.get(Configuration.CATEGORY_GENERAL, "Monolith Spawning Chance", 28,
"Sets the chance (out of " + CustomLimboPopulator.MAX_MONOLITH_SPAWNING_CHANCE + ") that Monoliths will " + "Sets the chance (out of " + CustomLimboPopulator.MAX_MONOLITH_SPAWNING_CHANCE + ") that Monoliths will " +
"spawn in a given Limbo chunk. The default chance is 28.").getInt(); "spawn in a given Limbo chunk. The default chance is 28.").getInt();
@ -237,13 +239,6 @@ public class DDProperties
{ {
throw new IllegalStateException("World generation blocks MUST have block IDs less than 256. Fix your configuration!"); throw new IllegalStateException("World generation blocks MUST have block IDs less than 256. Fix your configuration!");
} }
// SPECIAL CONFIG SETTINGS
// I'm adding this category because one of our users convinced me, personally, to please allow this.
// These settings are checked _after_ we save the config file, so Forge won't generate them automatically.
// Whoever wants to use them must intentionally write them into the config file.
MonolithTeleportationEnabled = config.get(CATEGORY_SPECIAL, "Enable Monolith Teleportation", true).getBoolean(true);
} }
public static DDProperties initialize(File configFile) public static DDProperties initialize(File configFile)

View file

@ -6,10 +6,12 @@ import net.minecraft.block.Block;
import net.minecraft.block.BlockDoor; import net.minecraft.block.BlockDoor;
import net.minecraft.block.ITileEntityProvider; import net.minecraft.block.ITileEntityProvider;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.IconFlipped;
import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.Icon; import net.minecraft.util.Icon;
import net.minecraft.util.MathHelper; import net.minecraft.util.MathHelper;
@ -27,31 +29,40 @@ import cpw.mods.fml.relauncher.SideOnly;
public abstract class BaseDimDoor extends BlockDoor implements IDimDoor, ITileEntityProvider public abstract class BaseDimDoor extends BlockDoor implements IDimDoor, ITileEntityProvider
{ {
protected final DDProperties properties; protected final DDProperties properties;
private Icon blockIconBottom;
@SideOnly(Side.CLIENT)
private Icon[] upperTextures;
@SideOnly(Side.CLIENT)
private Icon[] lowerTextures;
public BaseDimDoor(int blockID, Material material, DDProperties properties) public BaseDimDoor(int blockID, Material material, DDProperties properties)
{ {
super(blockID, material); super(blockID, material);
this.properties = properties; this.properties = properties;
} }
@Override @Override
public void registerIcons(IconRegister par1IconRegister) @SideOnly(Side.CLIENT)
public void registerIcons(IconRegister iconRegister)
{ {
this.blockIcon = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName()+"_top"); upperTextures = new Icon[2];
this.blockIconBottom = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName()+"_bottom"); lowerTextures = new Icon[2];
upperTextures[0] = iconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName() + "_upper");
lowerTextures[0] = iconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName() + "_lower");
upperTextures[1] = new IconFlipped(upperTextures[0], true, false);
lowerTextures[1] = new IconFlipped(lowerTextures[0], true, false);
} }
/** /**
* From the specified side and block metadata retrieves the blocks texture. Args: side, metadata * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata
*/ */
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public Icon getIcon(int par1, int par2) public Icon getIcon(int side, int metadata)
{ {
return this.blockIcon; return this.upperTextures[0];
} }
@Override @Override
@ -63,22 +74,24 @@ public abstract class BaseDimDoor extends BlockDoor implements IDimDoor, ITileEn
@Override @Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ)
{ {
int var10 = this.getFullMetadata(world, x, y, z); final int MAGIC_CONSTANT = 1003;
int var11 = var10 & 7;
var11 ^= 4; int metadata = this.getFullMetadata(world, x, y, z);
int lowMeta = metadata & 7;
lowMeta ^= 4;
if ((var10 & 8) == 0) if (isUpperDoorBlock(metadata))
{ {
world.setBlockMetadataWithNotify(x, y, z, var11,2); world.setBlockMetadataWithNotify(x, y - 1, z, lowMeta, 2);
world.markBlockRangeForRenderUpdate(x, y, z, x, y, z); world.markBlockRangeForRenderUpdate(x, y - 1, z, x, y, z);
} }
else else
{ {
world.setBlockMetadataWithNotify(x, y - 1, z, var11,2); world.setBlockMetadataWithNotify(x, y, z, lowMeta, 2);
world.markBlockRangeForRenderUpdate(x, y - 1, z, x, y, z); world.markBlockRangeForRenderUpdate(x, y, z, x, y, z);
} }
world.playAuxSFXAtEntity(player, 1003, x, y, z, 0); world.playAuxSFXAtEntity(player, MAGIC_CONSTANT, x, y, z, 0);
return true; return true;
} }
@ -90,23 +103,73 @@ public abstract class BaseDimDoor extends BlockDoor implements IDimDoor, ITileEn
this.updateAttachedTile(world, x, y, z); this.updateAttachedTile(world, x, y, z);
} }
/** /**
* Retrieves the block texture to use based on the display side. Args: iBlockAccess, x, y, z, side * Retrieves the block texture to use based on the display side. Args: iBlockAccess, x, y, z, side
*/ */
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public Icon getBlockTexture(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) public Icon getBlockTexture(IBlockAccess blockAccess, int x, int y, int z, int side)
{ {
if(par1IBlockAccess.getBlockId(par2, par3-1, par4) == this.blockID) if (side != 1 && side != 0)
{ {
return this.blockIcon; int fullMetadata = this.getFullMetadata(blockAccess, x, y, z);
} int orientation = fullMetadata & 3;
else boolean reversed = false;
{
return blockIconBottom; if (isDoorOpen(fullMetadata))
} {
} if (orientation == 0 && side == 2)
{
reversed = !reversed;
}
else if (orientation == 1 && side == 5)
{
reversed = !reversed;
}
else if (orientation == 2 && side == 3)
{
reversed = !reversed;
}
else if (orientation == 3 && side == 4)
{
reversed = !reversed;
}
}
else
{
if (orientation == 0 && side == 5)
{
reversed = !reversed;
}
else if (orientation == 1 && side == 3)
{
reversed = !reversed;
}
else if (orientation == 2 && side == 4)
{
reversed = !reversed;
}
else if (orientation == 3 && side == 2)
{
reversed = !reversed;
}
if ((fullMetadata & 16) != 0)
{
reversed = !reversed;
}
}
if (isUpperDoorBlock(fullMetadata))
return this.upperTextures[reversed ? 1 : 0];
else
return this.lowerTextures[reversed ? 1 : 0];
}
else
{
return this.lowerTextures[0];
}
}
//Called to update the render information on the tile entity. Could probably implement a data watcher, //Called to update the render information on the tile entity. Could probably implement a data watcher,
//but this works fine and is more versatile I think. //but this works fine and is more versatile I think.
@ -229,60 +292,38 @@ public abstract class BaseDimDoor extends BlockDoor implements IDimDoor, ITileEn
* their own) Args: x, y, z, neighbor blockID * their own) Args: x, y, z, neighbor blockID
*/ */
@Override @Override
public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) public void onNeighborBlockChange(World world, int x, int y, int z, int neighborID)
{ {
int var6 = par1World.getBlockMetadata(par2, par3, par4); int metadata = world.getBlockMetadata(x, y, z);
if (isUpperDoorBlock(metadata))
if ((var6 & 8) == 0)
{ {
boolean var7 = false; if (world.getBlockId(x, y - 1, z) != this.blockID)
if (par1World.getBlockId(par2, par3 + 1, par4) != this.blockID)
{ {
par1World.setBlock(par2, par3, par4, 0); world.setBlock(x, y, z, 0);
var7 = true;
} }
/** if (neighborID > 0 && neighborID != this.blockID)
if (!par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4))
{
par1World.setBlockWithNotify(par2, par3, par4, 0);
var7 = true;
if (par1World.getBlockId(par2, par3 + 1, par4) == this.blockID)
{
par1World.setBlockWithNotify(par2, par3 + 1, par4, 0);
}
}
**/
if (var7)
{ {
if (!par1World.isRemote) this.onNeighborBlockChange(world, x, y - 1, z, neighborID);
{
this.dropBlockAsItem(par1World, par2, par3, par4, properties.DimensionalDoorID, 0);
}
}
else
{
boolean var8 = par1World.isBlockIndirectlyGettingPowered(par2, par3, par4) || par1World.isBlockIndirectlyGettingPowered(par2, par3 + 1, par4);
if ((var8 || par5 > 0 && Block.blocksList[par5].canProvidePower()) && par5 != this.blockID)
{
this.onPoweredBlockChange(par1World, par2, par3, par4, var8);
}
} }
} }
else else
{ {
if (par1World.getBlockId(par2, par3 - 1, par4) != this.blockID) if (world.getBlockId(x, y + 1, z) != this.blockID)
{ {
par1World.setBlock(par2, par3, par4, 0); world.setBlock(x, y, z, 0);
if (!world.isRemote)
{
this.dropBlockAsItem(world, x, y, z, metadata, 0);
}
} }
else
if (par5 > 0 && par5 != this.blockID)
{ {
this.onNeighborBlockChange(par1World, par2, par3 - 1, par4, par5); boolean powered = world.isBlockIndirectlyGettingPowered(x, y, z) || world.isBlockIndirectlyGettingPowered(x, y + 1, z);
if ((powered || neighborID > 0 && Block.blocksList[neighborID].canProvidePower()) && neighborID != this.blockID)
{
this.onPoweredBlockChange(world, x, y, z, powered);
}
} }
} }
} }
@ -297,15 +338,12 @@ public abstract class BaseDimDoor extends BlockDoor implements IDimDoor, ITileEn
return this.getDrops(); return this.getDrops();
} }
@Override /**
public int idDropped(int par1, Random par2Random, int par3) * Returns the ID of the items to drop on destruction.
*/
public int idDropped(int metadata, Random random, int fortune)
{ {
//I have no idea, but sometimes this is returned as the blockID instead of metadata. return isUpperDoorBlock(metadata) ? 0 : this.getDrops();
if(par1>100)
{
return this.getDrops();
}
return (par1 & 8) != 0 ? 0 :getDrops();
} }
/** /**
@ -365,7 +403,6 @@ public abstract class BaseDimDoor extends BlockDoor implements IDimDoor, ITileEn
// Close the door only after the entity goes through // Close the door only after the entity goes through
// so players don't have it slam in their faces. // so players don't have it slam in their faces.
this.onPoweredBlockChange(world, x, y, z, false); this.onPoweredBlockChange(world, x, y, z, false);
} }
} }
else if (world.getBlockId(x, y + 1, z) == this.blockID) else if (world.getBlockId(x, y + 1, z) == this.blockID)
@ -374,13 +411,12 @@ public abstract class BaseDimDoor extends BlockDoor implements IDimDoor, ITileEn
} }
} }
@Override public static boolean isUpperDoorBlock(int metadata)
public int getDrops()
{ {
return this.blockID; return (metadata & 8) != 0;
} }
protected static boolean isDoorOpen(int metadata) public static boolean isDoorOpen(int metadata)
{ {
return (metadata & 4) != 0; return (metadata & 4) != 0;
} }

View file

@ -27,7 +27,7 @@ public class BlockDimWall extends Block
public BlockDimWall(int blockID, int j, Material par2Material) public BlockDimWall(int blockID, int j, Material par2Material)
{ {
super(blockID, Material.ground); super(blockID, par2Material);
this.setCreativeTab(mod_pocketDim.dimDoorsCreativeTab); this.setCreativeTab(mod_pocketDim.dimDoorsCreativeTab);
} }

View file

@ -8,6 +8,7 @@ import StevenDimDoors.mod_pocketDim.DDProperties;
import StevenDimDoors.mod_pocketDim.mod_pocketDim; import StevenDimDoors.mod_pocketDim.mod_pocketDim;
import net.minecraft.block.BlockDoor; import net.minecraft.block.BlockDoor;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.IconFlipped;
import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.util.Icon; import net.minecraft.util.Icon;
@ -15,19 +16,27 @@ import net.minecraft.world.IBlockAccess;
public class BlockDoorGold extends BlockDoor public class BlockDoorGold extends BlockDoor
{ {
private Icon blockIconBottom; @SideOnly(Side.CLIENT)
private Icon[] upperTextures;
@SideOnly(Side.CLIENT)
private Icon[] lowerTextures;
public BlockDoorGold(int par1, Material par2Material) public BlockDoorGold(int par1, Material par2Material)
{ {
super(par1, par2Material); super(par1, par2Material);
} }
@Override @Override
public void registerIcons(IconRegister par1IconRegister) @SideOnly(Side.CLIENT)
public void registerIcons(IconRegister iconRegister)
{ {
this.blockIcon = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName()+"_top"); upperTextures = new Icon[2];
this.blockIconBottom = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName()+"_bottom"); lowerTextures = new Icon[2];
} upperTextures[0] = iconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName() + "_upper");
lowerTextures[0] = iconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName() + "_lower");
upperTextures[1] = new IconFlipped(upperTextures[0], true, false);
lowerTextures[1] = new IconFlipped(lowerTextures[0], true, false);
}
@Override @Override
public int idDropped(int par1, Random par2Random, int par3) public int idDropped(int par1, Random par2Random, int par3)
@ -35,23 +44,81 @@ public class BlockDoorGold extends BlockDoor
return (par1 & 8) != 0 ? 0 : mod_pocketDim.itemGoldenDoor.itemID; return (par1 & 8) != 0 ? 0 : mod_pocketDim.itemGoldenDoor.itemID;
} }
@Override /**
public Icon getIcon(int par1, int par2) * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata
{ */
return this.blockIcon;
}
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public Icon getBlockTexture(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) public Icon getIcon(int side, int metadata)
{ {
if (par1IBlockAccess.getBlockId(par2, par3-1, par4) == this.blockID) return this.upperTextures[0];
{ }
return this.blockIcon;
} /**
else * Retrieves the block texture to use based on the display side. Args: iBlockAccess, x, y, z, side
{ */
return blockIconBottom; @Override
} @SideOnly(Side.CLIENT)
} public Icon getBlockTexture(IBlockAccess blockAccess, int x, int y, int z, int side)
{
if (side != 1 && side != 0)
{
int fullMetadata = this.getFullMetadata(blockAccess, x, y, z);
int orientation = fullMetadata & 3;
boolean reversed = false;
if (BaseDimDoor.isDoorOpen(fullMetadata))
{
if (orientation == 0 && side == 2)
{
reversed = !reversed;
}
else if (orientation == 1 && side == 5)
{
reversed = !reversed;
}
else if (orientation == 2 && side == 3)
{
reversed = !reversed;
}
else if (orientation == 3 && side == 4)
{
reversed = !reversed;
}
}
else
{
if (orientation == 0 && side == 5)
{
reversed = !reversed;
}
else if (orientation == 1 && side == 3)
{
reversed = !reversed;
}
else if (orientation == 2 && side == 4)
{
reversed = !reversed;
}
else if (orientation == 3 && side == 2)
{
reversed = !reversed;
}
if ((fullMetadata & 16) != 0)
{
reversed = !reversed;
}
}
if (BaseDimDoor.isUpperDoorBlock(fullMetadata))
return this.upperTextures[reversed ? 1 : 0];
else
return this.lowerTextures[reversed ? 1 : 0];
}
else
{
return this.lowerTextures[0];
}
}
} }

View file

@ -32,8 +32,8 @@ public class BlockGoldDimDoor extends BaseDimDoor
dimension.createLink(x, y, z, LinkTypes.POCKET,world.getBlockMetadata(x, y - 1, z)); dimension.createLink(x, y, z, LinkTypes.POCKET,world.getBlockMetadata(x, y - 1, z));
} }
} }
} }
@Override @Override
public int getDrops() public int getDrops()
{ {

View file

@ -1,5 +1,11 @@
package StevenDimDoors.mod_pocketDim.blocks; package StevenDimDoors.mod_pocketDim.blocks;
import net.minecraft.block.material.Material;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.World;
import StevenDimDoors.mod_pocketDim.DDProperties; import StevenDimDoors.mod_pocketDim.DDProperties;
import StevenDimDoors.mod_pocketDim.core.DDTeleporter; import StevenDimDoors.mod_pocketDim.core.DDTeleporter;
import StevenDimDoors.mod_pocketDim.core.DimLink; import StevenDimDoors.mod_pocketDim.core.DimLink;
@ -7,14 +13,6 @@ import StevenDimDoors.mod_pocketDim.core.LinkTypes;
import StevenDimDoors.mod_pocketDim.core.NewDimData; import StevenDimDoors.mod_pocketDim.core.NewDimData;
import StevenDimDoors.mod_pocketDim.core.PocketManager; import StevenDimDoors.mod_pocketDim.core.PocketManager;
import net.minecraft.block.material.Material;
import net.minecraft.client.particle.EntityFX;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.World;
public class TransientDoor extends BaseDimDoor public class TransientDoor extends BaseDimDoor
{ {
public TransientDoor(int blockID, Material material, DDProperties properties) public TransientDoor(int blockID, Material material, DDProperties properties)

View file

@ -1,6 +1,7 @@
package StevenDimDoors.mod_pocketDim.commands; package StevenDimDoors.mod_pocketDim.commands;
import net.minecraft.command.CommandBase; import net.minecraft.command.CommandBase;
import net.minecraft.command.ICommand;
import net.minecraft.command.ICommandSender; import net.minecraft.command.ICommandSender;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ChatMessageComponent; import net.minecraft.util.ChatMessageComponent;
@ -89,4 +90,19 @@ public abstract class DDCommandBase extends CommandBase
cmp.addText(message); cmp.addText(message);
player.sendChatToPlayer(cmp); player.sendChatToPlayer(cmp);
} }
/*
* The following two compareTo() methods are copied from CommandBase because it seems
* that Dryware and Technic Jenkins don't have those functions defined. How in the world?
* I have no idea. But it's breaking our builds. -_- ~SenseiKiwi
*/
public int compareTo(ICommand par1ICommand)
{
return this.getCommandName().compareTo(par1ICommand.getCommandName());
}
public int compareTo(Object par1Obj)
{
return this.compareTo((ICommand)par1Obj);
}
} }

View file

@ -61,6 +61,7 @@ import StevenDimDoors.mod_pocketDim.tileentities.TileEntityRift;
import StevenDimDoors.mod_pocketDim.tileentities.TileEntityTransTrapdoor; import StevenDimDoors.mod_pocketDim.tileentities.TileEntityTransTrapdoor;
import StevenDimDoors.mod_pocketDim.world.BiomeGenLimbo; import StevenDimDoors.mod_pocketDim.world.BiomeGenLimbo;
import StevenDimDoors.mod_pocketDim.world.BiomeGenPocket; import StevenDimDoors.mod_pocketDim.world.BiomeGenPocket;
import StevenDimDoors.mod_pocketDim.world.DDBiomeGenBase;
import StevenDimDoors.mod_pocketDim.world.LimboProvider; import StevenDimDoors.mod_pocketDim.world.LimboProvider;
import StevenDimDoors.mod_pocketDim.world.PocketProvider; import StevenDimDoors.mod_pocketDim.world.PocketProvider;
import StevenDimDoors.mod_pocketDim.world.gateways.GatewayGenerator; import StevenDimDoors.mod_pocketDim.world.gateways.GatewayGenerator;
@ -207,6 +208,11 @@ public class mod_pocketDim
itemStabilizedLinkSignature = (new ItemStabilizedRiftSignature(properties.StabilizedRiftSignatureItemID)).setUnlocalizedName("itemStabilizedRiftSig"); itemStabilizedLinkSignature = (new ItemStabilizedRiftSignature(properties.StabilizedRiftSignatureItemID)).setUnlocalizedName("itemStabilizedRiftSig");
itemWorldThread = (new ItemWorldThread(properties.WorldThreadItemID)).setUnlocalizedName("itemWorldThread"); itemWorldThread = (new ItemWorldThread(properties.WorldThreadItemID)).setUnlocalizedName("itemWorldThread");
// Check if other biomes have been registered with the same IDs we want. If so, crash Minecraft
// to notify the user instead of letting it pass and conflicting with Biomes o' Plenty.
DDBiomeGenBase.checkBiomes( new int[] { properties.LimboBiomeID, properties.PocketBiomeID } );
// Initialize our biomes
mod_pocketDim.limboBiome = (new BiomeGenLimbo(properties.LimboBiomeID)); mod_pocketDim.limboBiome = (new BiomeGenLimbo(properties.LimboBiomeID));
mod_pocketDim.pocketBiome = (new BiomeGenPocket(properties.PocketBiomeID)); mod_pocketDim.pocketBiome = (new BiomeGenPocket(properties.PocketBiomeID));
@ -282,7 +288,10 @@ public class mod_pocketDim
@EventHandler @EventHandler
public void onPostInitialization(FMLPostInitializationEvent event) public void onPostInitialization(FMLPostInitializationEvent event)
{ {
// Check in case other mods have registered over our biome IDs
DDBiomeGenBase.checkBiomes( new int[] { properties.LimboBiomeID, properties.PocketBiomeID } );
ForgeChunkManager.setForcedChunkLoadingCallback(instance, new ChunkLoaderHelper()); ForgeChunkManager.setForcedChunkLoadingCallback(instance, new ChunkLoaderHelper());
} }

View file

@ -2,38 +2,10 @@ package StevenDimDoors.mod_pocketDim.world;
import net.minecraft.world.biome.BiomeGenBase; import net.minecraft.world.biome.BiomeGenBase;
public class BiomeGenLimbo extends BiomeGenBase public class BiomeGenLimbo extends DDBiomeGenBase
{ {
public BiomeGenLimbo(int par1) public BiomeGenLimbo(int biomeID)
{ {
super(par1); super(biomeID, "Limbo");
this.theBiomeDecorator.treesPerChunk = 0;
this.theBiomeDecorator.flowersPerChunk = 0;
this.theBiomeDecorator.grassPerChunk = 0;
this.setBiomeName("Limbo");
this.setDisableRain();
this.spawnableMonsterList.clear();
this.spawnableCreatureList.clear();
this.spawnableWaterCreatureList.clear();
this.spawnableCaveCreatureList.clear();
// this.spawnableMonsterList.add(new SpawnListEntry(MobObelisk.class, 1, 1, 1));
// this.spawnableMonsterList.add(new SpawnListEntry(MobObelisk.class, 300, 0, 0));
// this.spawnableCreatureList.add(new SpawnListEntry(MobObelisk.class, 1, 1, 1));
// this.spawnableCreatureList.add(new SpawnListEntry(MobObelisk.class, 300, 0, 0));
// this.spawnableCaveCreatureList.add(new SpawnListEntry(MobObelisk.class, 1, 1, 1));
// this.spawnableCaveCreatureList.add(new SpawnListEntry(MobObelisk.class, 300, 0, 0));
}
@Override
public float getSpawningChance()
{
return 0.00001F;
} }
} }

View file

@ -2,26 +2,10 @@ package StevenDimDoors.mod_pocketDim.world;
import net.minecraft.world.biome.BiomeGenBase; import net.minecraft.world.biome.BiomeGenBase;
public class BiomeGenPocket extends BiomeGenBase public class BiomeGenPocket extends DDBiomeGenBase
{ {
public BiomeGenPocket(int par1) public BiomeGenPocket(int biomeID)
{ {
super(par1); super(biomeID, "Pocket Dimension");
this.theBiomeDecorator.treesPerChunk = 0;
this.theBiomeDecorator.flowersPerChunk = 0;
this.theBiomeDecorator.grassPerChunk = 0;
this.setBiomeName("Pocket Dimension");
this.setDisableRain();
this.spawnableMonsterList.clear();
this.spawnableCreatureList.clear();
this.spawnableWaterCreatureList.clear();
this.spawnableCaveCreatureList.clear();
// this.spawnableMonsterList.add(new SpawnListEntry(MobObelisk.class, 1, 1, 1));
// this.spawnableCreatureList.add(new SpawnListEntry(MobObelisk.class, 1, 1, 1));
//
// this.spawnableCaveCreatureList.add(new SpawnListEntry(MobObelisk.class, 1, 1, 1));
} }
} }

View file

@ -0,0 +1,34 @@
package StevenDimDoors.mod_pocketDim.world;
import net.minecraft.world.biome.BiomeGenBase;
public class DDBiomeGenBase extends BiomeGenBase
{
public DDBiomeGenBase(int biomeID, String name)
{
super(biomeID);
this.setBiomeName(name);
this.theBiomeDecorator.treesPerChunk = 0;
this.theBiomeDecorator.flowersPerChunk = 0;
this.theBiomeDecorator.grassPerChunk = 0;
this.setDisableRain();
this.spawnableMonsterList.clear();
this.spawnableCreatureList.clear();
this.spawnableWaterCreatureList.clear();
this.spawnableCaveCreatureList.clear();
}
public static void checkBiomes(int[] biomes)
{
for (int k = 0; k < biomes.length; k++)
{
if (biomeList[biomes[k]] != null && !(biomeList[biomes[k]] instanceof DDBiomeGenBase))
{
// Crash Minecraft to avoid having people complain to us about strange things
// that are really the result of silent biome ID conflicts.
throw new IllegalStateException("There is a biome ID conflict between a biome from Dimensional Doors and another biome type. Fix your configuration!");
}
}
}
}

View file

@ -113,10 +113,9 @@ public class GatewayGenerator implements IWorldGenerator
while (random.nextInt(MAX_CLUSTER_GROWTH_CHANCE) < CLUSTER_GROWTH_CHANCE); while (random.nextInt(MAX_CLUSTER_GROWTH_CHANCE) < CLUSTER_GROWTH_CHANCE);
} }
//Check if generating structures is enabled and randomly decide whether to place a Rift Gateway here. // Randomly decide whether to place a Rift Gateway here.
//This only happens if a rift cluster was NOT generated. // This only happens if a rift cluster was NOT generated.
else if (random.nextInt(MAX_GATEWAY_GENERATION_CHANCE) < properties.GatewayGenerationChance && else if (random.nextInt(MAX_GATEWAY_GENERATION_CHANCE) < properties.GatewayGenerationChance)
isStructureGenerationAllowed())
{ {
valid = false; valid = false;
x = y = z = 0; //Stop the compiler from freaking out x = y = z = 0; //Stop the compiler from freaking out
@ -177,9 +176,4 @@ public class GatewayGenerator implements IWorldGenerator
return (material != Material.leaves && material != Material.wood && material != Material.pumpkin return (material != Material.leaves && material != Material.wood && material != Material.pumpkin
&& world.isBlockOpaqueCube(x, y, z) && world.getBlockId(x, y, z) != Block.bedrock.blockID); && world.isBlockOpaqueCube(x, y, z) && world.getBlockId(x, y, z) != Block.bedrock.blockID);
} }
private static boolean isStructureGenerationAllowed()
{
return DimensionManager.getWorld(OVERWORLD_DIMENSION_ID).getWorldInfo().isMapFeaturesEnabled();
}
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.7 KiB

View file

@ -1,27 +0,0 @@
{
"animation":
{
"frametime": 3,
"frames":
[
0,
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15
]
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

View file

@ -1,51 +0,0 @@
{
"animation":
{
"frametime": 3,
"frames":
[
0,
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
18,
17,
16,
15,
14,
13,
12,
11,
10,
9,
8,
7,
6,
5,
4,
3,
2,
1
]
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 625 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 540 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 778 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 698 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB