diff --git a/src/main/java/StevenDimDoors/mod_pocketDim/DDProperties.java b/src/main/java/StevenDimDoors/mod_pocketDim/DDProperties.java index a7aed13..0c61faf 100644 --- a/src/main/java/StevenDimDoors/mod_pocketDim/DDProperties.java +++ b/src/main/java/StevenDimDoors/mod_pocketDim/DDProperties.java @@ -119,7 +119,6 @@ public class DDProperties //Names of categories private final String CATEGORY_CRAFTING = "crafting"; private final String CATEGORY_ENTITY = "entity"; - private final String CATEGORY_SPECIAL = "special"; private final String CATEGORY_DIMENSION = "dimension"; private final String CATEGORY_PROVIDER = "provider"; private final String CATEGORY_BIOME = "biome"; @@ -209,6 +208,9 @@ public class DDProperties WorldRiftGenerationEnabled = config.get(Configuration.CATEGORY_GENERAL, "Enable Rift World Generation", 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, "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(); @@ -237,13 +239,6 @@ public class DDProperties { 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) diff --git a/src/main/java/StevenDimDoors/mod_pocketDim/blocks/BaseDimDoor.java b/src/main/java/StevenDimDoors/mod_pocketDim/blocks/BaseDimDoor.java index 3233c6e..ee37ab0 100644 --- a/src/main/java/StevenDimDoors/mod_pocketDim/blocks/BaseDimDoor.java +++ b/src/main/java/StevenDimDoors/mod_pocketDim/blocks/BaseDimDoor.java @@ -6,10 +6,12 @@ import net.minecraft.block.Block; import net.minecraft.block.BlockDoor; import net.minecraft.block.ITileEntityProvider; import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.IconFlipped; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.Icon; import net.minecraft.util.MathHelper; @@ -27,31 +29,40 @@ import cpw.mods.fml.relauncher.SideOnly; public abstract class BaseDimDoor extends BlockDoor implements IDimDoor, ITileEntityProvider { - protected final DDProperties properties; - private Icon blockIconBottom; + protected final DDProperties properties; + + @SideOnly(Side.CLIENT) + private Icon[] upperTextures; + @SideOnly(Side.CLIENT) + private Icon[] lowerTextures; public BaseDimDoor(int blockID, Material material, DDProperties properties) { super(blockID, material); - + this.properties = properties; } @Override - public void registerIcons(IconRegister par1IconRegister) + @SideOnly(Side.CLIENT) + public void registerIcons(IconRegister iconRegister) { - this.blockIcon = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName()+"_top"); - this.blockIconBottom = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName()+"_bottom"); + upperTextures = new Icon[2]; + 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 */ @Override @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 @@ -63,22 +74,24 @@ public abstract class BaseDimDoor extends BlockDoor implements IDimDoor, ITileEn @Override 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); - int var11 = var10 & 7; - var11 ^= 4; + final int MAGIC_CONSTANT = 1003; + + 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.markBlockRangeForRenderUpdate(x, y, z, x, y, z); + world.setBlockMetadataWithNotify(x, y - 1, z, lowMeta, 2); + world.markBlockRangeForRenderUpdate(x, y - 1, z, x, y, z); } else { - world.setBlockMetadataWithNotify(x, y - 1, z, var11,2); - world.markBlockRangeForRenderUpdate(x, y - 1, z, x, y, z); + world.setBlockMetadataWithNotify(x, y, z, lowMeta, 2); + 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; } @@ -90,23 +103,73 @@ public abstract class BaseDimDoor extends BlockDoor implements IDimDoor, ITileEn 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 - @SideOnly(Side.CLIENT) - public Icon getBlockTexture(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) - { - if(par1IBlockAccess.getBlockId(par2, par3-1, par4) == this.blockID) - { - return this.blockIcon; - } - else - { - return blockIconBottom; - } - } + @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 (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, //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 */ @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); - - if ((var6 & 8) == 0) + int metadata = world.getBlockMetadata(x, y, z); + if (isUpperDoorBlock(metadata)) { - boolean var7 = false; - - if (par1World.getBlockId(par2, par3 + 1, par4) != this.blockID) + if (world.getBlockId(x, y - 1, z) != this.blockID) { - par1World.setBlock(par2, par3, par4, 0); - var7 = true; + world.setBlock(x, y, z, 0); } - - /** - 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 (neighborID > 0 && neighborID != this.blockID) { - if (!par1World.isRemote) - { - 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); - } + this.onNeighborBlockChange(world, x, y - 1, z, neighborID); } } 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); + } } - - if (par5 > 0 && par5 != this.blockID) + else { - 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(); } - @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. - if(par1>100) - { - return this.getDrops(); - } - return (par1 & 8) != 0 ? 0 :getDrops(); + return isUpperDoorBlock(metadata) ? 0 : this.getDrops(); } /** @@ -365,7 +403,6 @@ public abstract class BaseDimDoor extends BlockDoor implements IDimDoor, ITileEn // Close the door only after the entity goes through // so players don't have it slam in their faces. this.onPoweredBlockChange(world, x, y, z, false); - } } 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 int getDrops() + public static boolean isUpperDoorBlock(int metadata) { - return this.blockID; + return (metadata & 8) != 0; } - protected static boolean isDoorOpen(int metadata) + public static boolean isDoorOpen(int metadata) { return (metadata & 4) != 0; } diff --git a/src/main/java/StevenDimDoors/mod_pocketDim/blocks/BlockDimWall.java b/src/main/java/StevenDimDoors/mod_pocketDim/blocks/BlockDimWall.java index 8d90548..82e451a 100644 --- a/src/main/java/StevenDimDoors/mod_pocketDim/blocks/BlockDimWall.java +++ b/src/main/java/StevenDimDoors/mod_pocketDim/blocks/BlockDimWall.java @@ -27,7 +27,7 @@ public class BlockDimWall extends Block public BlockDimWall(int blockID, int j, Material par2Material) { - super(blockID, Material.ground); + super(blockID, par2Material); this.setCreativeTab(mod_pocketDim.dimDoorsCreativeTab); } diff --git a/src/main/java/StevenDimDoors/mod_pocketDim/blocks/BlockDoorGold.java b/src/main/java/StevenDimDoors/mod_pocketDim/blocks/BlockDoorGold.java index 5b20779..54972e4 100644 --- a/src/main/java/StevenDimDoors/mod_pocketDim/blocks/BlockDoorGold.java +++ b/src/main/java/StevenDimDoors/mod_pocketDim/blocks/BlockDoorGold.java @@ -8,6 +8,7 @@ import StevenDimDoors.mod_pocketDim.DDProperties; import StevenDimDoors.mod_pocketDim.mod_pocketDim; import net.minecraft.block.BlockDoor; import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.IconFlipped; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.item.Item; import net.minecraft.util.Icon; @@ -15,19 +16,27 @@ import net.minecraft.world.IBlockAccess; 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) { super(par1, par2Material); } - + @Override - public void registerIcons(IconRegister par1IconRegister) + @SideOnly(Side.CLIENT) + public void registerIcons(IconRegister iconRegister) { - this.blockIcon = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName()+"_top"); - this.blockIconBottom = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName()+"_bottom"); - } + upperTextures = new Icon[2]; + 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 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; } - @Override - public Icon getIcon(int par1, int par2) - { - return this.blockIcon; - } - + /** + * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata + */ @Override @SideOnly(Side.CLIENT) - public Icon getBlockTexture(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) - { - if (par1IBlockAccess.getBlockId(par2, par3-1, par4) == this.blockID) - { - return this.blockIcon; - } - else - { - return blockIconBottom; - } - } + public Icon getIcon(int side, int metadata) + { + return this.upperTextures[0]; + } + + /** + * Retrieves the block texture to use based on the display side. Args: iBlockAccess, x, y, z, side + */ + @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]; + } + } } diff --git a/src/main/java/StevenDimDoors/mod_pocketDim/blocks/BlockGoldDimDoor.java b/src/main/java/StevenDimDoors/mod_pocketDim/blocks/BlockGoldDimDoor.java index 7cd4e0c..b4ffd21 100644 --- a/src/main/java/StevenDimDoors/mod_pocketDim/blocks/BlockGoldDimDoor.java +++ b/src/main/java/StevenDimDoors/mod_pocketDim/blocks/BlockGoldDimDoor.java @@ -32,8 +32,8 @@ public class BlockGoldDimDoor extends BaseDimDoor dimension.createLink(x, y, z, LinkTypes.POCKET,world.getBlockMetadata(x, y - 1, z)); } } - } + @Override public int getDrops() { diff --git a/src/main/java/StevenDimDoors/mod_pocketDim/blocks/TransientDoor.java b/src/main/java/StevenDimDoors/mod_pocketDim/blocks/TransientDoor.java index 0c00501..bac5c5d 100644 --- a/src/main/java/StevenDimDoors/mod_pocketDim/blocks/TransientDoor.java +++ b/src/main/java/StevenDimDoors/mod_pocketDim/blocks/TransientDoor.java @@ -1,5 +1,11 @@ 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.core.DDTeleporter; 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.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 TransientDoor(int blockID, Material material, DDProperties properties) diff --git a/src/main/java/StevenDimDoors/mod_pocketDim/commands/DDCommandBase.java b/src/main/java/StevenDimDoors/mod_pocketDim/commands/DDCommandBase.java index ea8061f..b62cc86 100644 --- a/src/main/java/StevenDimDoors/mod_pocketDim/commands/DDCommandBase.java +++ b/src/main/java/StevenDimDoors/mod_pocketDim/commands/DDCommandBase.java @@ -1,6 +1,7 @@ package StevenDimDoors.mod_pocketDim.commands; import net.minecraft.command.CommandBase; +import net.minecraft.command.ICommand; import net.minecraft.command.ICommandSender; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.ChatMessageComponent; @@ -89,4 +90,19 @@ public abstract class DDCommandBase extends CommandBase cmp.addText(message); 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); + } } diff --git a/src/main/java/StevenDimDoors/mod_pocketDim/mod_pocketDim.java b/src/main/java/StevenDimDoors/mod_pocketDim/mod_pocketDim.java index c44eaee..a4e6844 100644 --- a/src/main/java/StevenDimDoors/mod_pocketDim/mod_pocketDim.java +++ b/src/main/java/StevenDimDoors/mod_pocketDim/mod_pocketDim.java @@ -61,6 +61,7 @@ import StevenDimDoors.mod_pocketDim.tileentities.TileEntityRift; import StevenDimDoors.mod_pocketDim.tileentities.TileEntityTransTrapdoor; import StevenDimDoors.mod_pocketDim.world.BiomeGenLimbo; import StevenDimDoors.mod_pocketDim.world.BiomeGenPocket; +import StevenDimDoors.mod_pocketDim.world.DDBiomeGenBase; import StevenDimDoors.mod_pocketDim.world.LimboProvider; import StevenDimDoors.mod_pocketDim.world.PocketProvider; import StevenDimDoors.mod_pocketDim.world.gateways.GatewayGenerator; @@ -207,6 +208,11 @@ public class mod_pocketDim itemStabilizedLinkSignature = (new ItemStabilizedRiftSignature(properties.StabilizedRiftSignatureItemID)).setUnlocalizedName("itemStabilizedRiftSig"); 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.pocketBiome = (new BiomeGenPocket(properties.PocketBiomeID)); @@ -282,7 +288,10 @@ public class mod_pocketDim @EventHandler 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()); } diff --git a/src/main/java/StevenDimDoors/mod_pocketDim/world/BiomeGenLimbo.java b/src/main/java/StevenDimDoors/mod_pocketDim/world/BiomeGenLimbo.java index 243baf1..77eef46 100644 --- a/src/main/java/StevenDimDoors/mod_pocketDim/world/BiomeGenLimbo.java +++ b/src/main/java/StevenDimDoors/mod_pocketDim/world/BiomeGenLimbo.java @@ -2,38 +2,10 @@ package StevenDimDoors.mod_pocketDim.world; 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); - 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; + super(biomeID, "Limbo"); } } diff --git a/src/main/java/StevenDimDoors/mod_pocketDim/world/BiomeGenPocket.java b/src/main/java/StevenDimDoors/mod_pocketDim/world/BiomeGenPocket.java index e9dbdb7..8d09b7b 100644 --- a/src/main/java/StevenDimDoors/mod_pocketDim/world/BiomeGenPocket.java +++ b/src/main/java/StevenDimDoors/mod_pocketDim/world/BiomeGenPocket.java @@ -2,26 +2,10 @@ package StevenDimDoors.mod_pocketDim.world; 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); - 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)); - - + super(biomeID, "Pocket Dimension"); } } diff --git a/src/main/java/StevenDimDoors/mod_pocketDim/world/DDBiomeGenBase.java b/src/main/java/StevenDimDoors/mod_pocketDim/world/DDBiomeGenBase.java new file mode 100644 index 0000000..f6e3428 --- /dev/null +++ b/src/main/java/StevenDimDoors/mod_pocketDim/world/DDBiomeGenBase.java @@ -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!"); + } + } + } +} diff --git a/src/main/java/StevenDimDoors/mod_pocketDim/world/gateways/GatewayGenerator.java b/src/main/java/StevenDimDoors/mod_pocketDim/world/gateways/GatewayGenerator.java index 0257be3..a95ee24 100644 --- a/src/main/java/StevenDimDoors/mod_pocketDim/world/gateways/GatewayGenerator.java +++ b/src/main/java/StevenDimDoors/mod_pocketDim/world/gateways/GatewayGenerator.java @@ -113,10 +113,9 @@ public class GatewayGenerator implements IWorldGenerator 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. - //This only happens if a rift cluster was NOT generated. - else if (random.nextInt(MAX_GATEWAY_GENERATION_CHANCE) < properties.GatewayGenerationChance && - isStructureGenerationAllowed()) + // Randomly decide whether to place a Rift Gateway here. + // This only happens if a rift cluster was NOT generated. + else if (random.nextInt(MAX_GATEWAY_GENERATION_CHANCE) < properties.GatewayGenerationChance) { valid = false; 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 && 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(); - } } diff --git a/src/main/resources/assets/dimdoors/textures/blocks/tile.Corium_flowing.png b/src/main/resources/assets/dimdoors/textures/blocks/tile.Corium_flowing.png deleted file mode 100644 index af07f91..0000000 Binary files a/src/main/resources/assets/dimdoors/textures/blocks/tile.Corium_flowing.png and /dev/null differ diff --git a/src/main/resources/assets/dimdoors/textures/blocks/tile.Corium_flowing.png.mcmeta b/src/main/resources/assets/dimdoors/textures/blocks/tile.Corium_flowing.png.mcmeta deleted file mode 100644 index b374392..0000000 --- a/src/main/resources/assets/dimdoors/textures/blocks/tile.Corium_flowing.png.mcmeta +++ /dev/null @@ -1,27 +0,0 @@ -{ - "animation": - { - "frametime": 3, - "frames": - [ - -0, -1, -2, -3, -4, -5, -6, -7, -8, -9, -10, -11, -12, -13, -14, -15 - - ] - } -} \ No newline at end of file diff --git a/src/main/resources/assets/dimdoors/textures/blocks/tile.Corium_still.png b/src/main/resources/assets/dimdoors/textures/blocks/tile.Corium_still.png deleted file mode 100644 index 78bb29d..0000000 Binary files a/src/main/resources/assets/dimdoors/textures/blocks/tile.Corium_still.png and /dev/null differ diff --git a/src/main/resources/assets/dimdoors/textures/blocks/tile.Corium_still.png.mcmeta b/src/main/resources/assets/dimdoors/textures/blocks/tile.Corium_still.png.mcmeta deleted file mode 100644 index 2b28937..0000000 --- a/src/main/resources/assets/dimdoors/textures/blocks/tile.Corium_still.png.mcmeta +++ /dev/null @@ -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 - - ] - } -} - - diff --git a/src/main/resources/assets/dimdoors/textures/blocks/tile.chaosDoor_bottom.png b/src/main/resources/assets/dimdoors/textures/blocks/tile.chaosDoor_lower.png similarity index 100% rename from src/main/resources/assets/dimdoors/textures/blocks/tile.chaosDoor_bottom.png rename to src/main/resources/assets/dimdoors/textures/blocks/tile.chaosDoor_lower.png diff --git a/src/main/resources/assets/dimdoors/textures/blocks/tile.chaosDoor_top.png b/src/main/resources/assets/dimdoors/textures/blocks/tile.chaosDoor_upper.png similarity index 100% rename from src/main/resources/assets/dimdoors/textures/blocks/tile.chaosDoor_top.png rename to src/main/resources/assets/dimdoors/textures/blocks/tile.chaosDoor_upper.png diff --git a/src/main/resources/assets/dimdoors/textures/blocks/tile.dimDoorGold_bottom.png b/src/main/resources/assets/dimdoors/textures/blocks/tile.dimDoorGold_lower.png similarity index 100% rename from src/main/resources/assets/dimdoors/textures/blocks/tile.dimDoorGold_bottom.png rename to src/main/resources/assets/dimdoors/textures/blocks/tile.dimDoorGold_lower.png diff --git a/src/main/resources/assets/dimdoors/textures/blocks/tile.dimDoorGold_top.png b/src/main/resources/assets/dimdoors/textures/blocks/tile.dimDoorGold_upper.png similarity index 100% rename from src/main/resources/assets/dimdoors/textures/blocks/tile.dimDoorGold_top.png rename to src/main/resources/assets/dimdoors/textures/blocks/tile.dimDoorGold_upper.png diff --git a/src/main/resources/assets/dimdoors/textures/blocks/tile.dimDoorWarp_bottom.png b/src/main/resources/assets/dimdoors/textures/blocks/tile.dimDoorWarp_lower.png similarity index 100% rename from src/main/resources/assets/dimdoors/textures/blocks/tile.dimDoorWarp_bottom.png rename to src/main/resources/assets/dimdoors/textures/blocks/tile.dimDoorWarp_lower.png diff --git a/src/main/resources/assets/dimdoors/textures/blocks/tile.dimDoorWarp_top.png b/src/main/resources/assets/dimdoors/textures/blocks/tile.dimDoorWarp_upper.png similarity index 100% rename from src/main/resources/assets/dimdoors/textures/blocks/tile.dimDoorWarp_top.png rename to src/main/resources/assets/dimdoors/textures/blocks/tile.dimDoorWarp_upper.png diff --git a/src/main/resources/assets/dimdoors/textures/blocks/tile.dimDoor_bottom.png b/src/main/resources/assets/dimdoors/textures/blocks/tile.dimDoor_bottom.png deleted file mode 100644 index 825356d..0000000 Binary files a/src/main/resources/assets/dimdoors/textures/blocks/tile.dimDoor_bottom.png and /dev/null differ diff --git a/src/main/resources/assets/dimdoors/textures/blocks/tile.dimDoorLink_bottom.png b/src/main/resources/assets/dimdoors/textures/blocks/tile.dimDoor_lower.png similarity index 100% rename from src/main/resources/assets/dimdoors/textures/blocks/tile.dimDoorLink_bottom.png rename to src/main/resources/assets/dimdoors/textures/blocks/tile.dimDoor_lower.png diff --git a/src/main/resources/assets/dimdoors/textures/blocks/tile.dimDoor_top.png b/src/main/resources/assets/dimdoors/textures/blocks/tile.dimDoor_top.png deleted file mode 100644 index 4ec9868..0000000 Binary files a/src/main/resources/assets/dimdoors/textures/blocks/tile.dimDoor_top.png and /dev/null differ diff --git a/src/main/resources/assets/dimdoors/textures/blocks/tile.dimDoorLink_top.png b/src/main/resources/assets/dimdoors/textures/blocks/tile.dimDoor_upper.png similarity index 100% rename from src/main/resources/assets/dimdoors/textures/blocks/tile.dimDoorLink_top.png rename to src/main/resources/assets/dimdoors/textures/blocks/tile.dimDoor_upper.png diff --git a/src/main/resources/assets/dimdoors/textures/blocks/tile.dimDoorexitlink_bottom.png b/src/main/resources/assets/dimdoors/textures/blocks/tile.dimDoorexitlink_bottom.png deleted file mode 100644 index 73605a0..0000000 Binary files a/src/main/resources/assets/dimdoors/textures/blocks/tile.dimDoorexitlink_bottom.png and /dev/null differ diff --git a/src/main/resources/assets/dimdoors/textures/blocks/tile.dimDoorexitlink_top.png b/src/main/resources/assets/dimdoors/textures/blocks/tile.dimDoorexitlink_top.png deleted file mode 100644 index 9df8356..0000000 Binary files a/src/main/resources/assets/dimdoors/textures/blocks/tile.dimDoorexitlink_top.png and /dev/null differ diff --git a/src/main/resources/assets/dimdoors/textures/blocks/tile.doorGold_bottom.png b/src/main/resources/assets/dimdoors/textures/blocks/tile.doorGold_lower.png similarity index 100% rename from src/main/resources/assets/dimdoors/textures/blocks/tile.doorGold_bottom.png rename to src/main/resources/assets/dimdoors/textures/blocks/tile.doorGold_lower.png diff --git a/src/main/resources/assets/dimdoors/textures/blocks/tile.doorGold_top.png b/src/main/resources/assets/dimdoors/textures/blocks/tile.doorGold_upper.png similarity index 100% rename from src/main/resources/assets/dimdoors/textures/blocks/tile.doorGold_top.png rename to src/main/resources/assets/dimdoors/textures/blocks/tile.doorGold_upper.png diff --git a/src/main/resources/assets/dimdoors/textures/blocks/tile.transientDoor - Copy.png b/src/main/resources/assets/dimdoors/textures/blocks/tile.transientDoor_lower.png similarity index 100% rename from src/main/resources/assets/dimdoors/textures/blocks/tile.transientDoor - Copy.png rename to src/main/resources/assets/dimdoors/textures/blocks/tile.transientDoor_lower.png diff --git a/src/main/resources/assets/dimdoors/textures/blocks/tile.transientDoor_top.png b/src/main/resources/assets/dimdoors/textures/blocks/tile.transientDoor_top.png deleted file mode 100644 index 8ceb7c9..0000000 Binary files a/src/main/resources/assets/dimdoors/textures/blocks/tile.transientDoor_top.png and /dev/null differ diff --git a/src/main/resources/assets/dimdoors/textures/blocks/tile.transientDoor_bottom.png b/src/main/resources/assets/dimdoors/textures/blocks/tile.transientDoor_upper.png similarity index 100% rename from src/main/resources/assets/dimdoors/textures/blocks/tile.transientDoor_bottom.png rename to src/main/resources/assets/dimdoors/textures/blocks/tile.transientDoor_upper.png