use of net.minecraft.world.biome.BiomeGenBase in project BloodMagic by WayofTime.
the class OmegaArmourFire method getAttributeModifiers.
@Override
public Multimap getAttributeModifiers(ItemStack stack) {
Multimap map = HashMultimap.create();
int biomeID = this.getBiomeIDStored(stack);
BiomeGenBase biome = BiomeGenBase.getBiome(biomeID);
if (biome != null) {
map.put(SharedMonsterAttributes.maxHealth.getAttributeUnlocalizedName(), new AttributeModifier(new UUID(895132, /**
* Random number *
*/
armorType), "Health modifier" + armorType, getDefaultArmourBoost() * getHealthBoostModifierForBiome(biome), 1));
map.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(), new AttributeModifier(new UUID(196312, /**
* Random number *
*/
armorType), "Damage modifier" + armorType, getDefaultArmourBoost() * getDamageModifierForBiome(biome), 1));
}
return map;
}
use of net.minecraft.world.biome.BiomeGenBase in project BloodMagic by WayofTime.
the class OmegaArmourWater method getAttributeModifiers.
@Override
public Multimap getAttributeModifiers(ItemStack stack) {
Multimap map = HashMultimap.create();
int biomeID = this.getBiomeIDStored(stack);
BiomeGenBase biome = BiomeGenBase.getBiome(biomeID);
if (biome != null) {
map.put(SharedMonsterAttributes.maxHealth.getAttributeUnlocalizedName(), new AttributeModifier(new UUID(85312, /**
* Random number *
*/
armorType), "Health modifier" + armorType, getDefaultArmourBoost() * getHealthBoostModifierForBiome(biome), 2));
map.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(), new AttributeModifier(new UUID(85432, /**
* Random number *
*/
armorType), "Damage modifier" + armorType, getDefaultArmourBoost() * getDamageModifierForBiome(biome), 2));
}
return map;
}
use of net.minecraft.world.biome.BiomeGenBase in project pvp-mode by VulcanForge.
the class MiddleEarthBiomeOverrideCondition method isPvPEnabled.
@Override
public Boolean isPvPEnabled(EntityPlayer player) {
Boolean pvpEnabled = null;
BiomeGenBase currentBiome = player.worldObj.getWorldChunkManager().getBiomeGenAt((int) player.posX, (int) player.posZ);
// Check if we are in a relevant LOTR biome
if (currentBiome instanceof LOTRBiome && configurationData.containsKey(currentBiome.biomeID)) {
for (BiomeFactionEntry entry : configurationData.get(currentBiome.biomeID)) {
Boolean enabled = handleCondition(entry, player);
if (enabled != null) {
pvpEnabled = enabled;
}
}
}
return pvpEnabled;
}
use of net.minecraft.world.biome.BiomeGenBase in project BluePower by Qmunity.
the class WorldGenerationHandler method generate.
@Override
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {
if (!world.provider.isSurfaceWorld()) {
return;
}
if (Config.generateAmethyst) {
addOreToGenerate(random, Config.veinCountAmethyst, Config.veinSizeAmethyst, Config.minAmethystY, Config.maxAmethystY, BPBlocks.amethyst_ore, world, chunkX, chunkZ);
}
if (Config.generateRuby) {
addOreToGenerate(random, Config.veinCountRuby, Config.veinSizeRuby, Config.minRubyY, Config.maxRubyY, BPBlocks.ruby_ore, world, chunkX, chunkZ);
}
if (Config.generateSapphire) {
addOreToGenerate(random, Config.veinCountSapphire, Config.veinSizeSapphire, Config.minSapphireY, Config.maxSapphireY, BPBlocks.sapphire_ore, world, chunkX, chunkZ);
}
if (Config.generateSilver) {
addOreToGenerate(random, Config.veinCountSilver, Config.veinSizeSilver, Config.minSilverY, Config.maxSilverY, BPBlocks.silver_ore, world, chunkX, chunkZ);
}
if (Config.generateTeslatite) {
addOreToGenerate(random, Config.veinCountTeslatite, Config.veinSizeTeslatite, Config.minTeslatiteY, Config.maxTeslatiteY, BPBlocks.teslatite_ore, world, chunkX, chunkZ);
}
if (Config.generateZinc) {
addOreToGenerate(random, Config.veinCountZinc, Config.veinSizeZinc, Config.minZincY, Config.maxZincY, BPBlocks.zinc_ore, world, chunkX, chunkZ);
}
if (Config.generateCopper) {
addOreToGenerate(random, Config.veinCountCopper, Config.veinSizeCopper, Config.minCopperY, Config.maxCopperY, BPBlocks.copper_ore, world, chunkX, chunkZ);
}
if (Config.generateTungsten) {
addOreToGenerate(random, Config.veinCountTungsten, Config.veinSizeTungsten, Config.minTungstenY, Config.maxTungstenY, BPBlocks.tungsten_ore, world, chunkX, chunkZ);
}
BiomeGenBase bgb = world.getWorldChunkManager().getBiomeGenAt(chunkX * 16 + 16, chunkZ * 16 + 16);
int n = 0;
if (bgb == BiomeGenBase.birchForest)
n = 1;
else if (bgb == BiomeGenBase.birchForestHills)
n = 1;
else if (bgb == BiomeGenBase.plains)
n = 1;
else if (bgb == BiomeGenBase.forest)
n = 4;
else if (bgb == BiomeGenBase.roofedForest)
n = 4;
for (int i = 0; i < n; i++) {
int x = chunkX * 16 + random.nextInt(16) + 8;
int y = random.nextInt(128);
int z = chunkZ * 16 + random.nextInt(16) + 8;
new WorldGenFlowers(BPBlocks.indigo_flower).generate(world, random, x, y, z);
}
if (Config.veinSizeMarble > 0) {
for (int i = 0; i < 4; i++) {
int x = chunkX * 16 + random.nextInt(16);
int y = 32 + random.nextInt(32);
int z = chunkZ * 16 + random.nextInt(16);
new WorldGenMarble(BPBlocks.marble, random.nextInt(Config.veinSizeMarble)).generate(world, random, x, y, z);
}
}
if (random.nextDouble() < Config.volcanoSpawnChance) {
int x = chunkX * 16 + random.nextInt(16);
//20
int z = chunkZ * 16 + random.nextInt(16);
int y = world.getHeightValue(x, z) + 30 + random.nextInt(40);
if (world.getBlock(x, 10, z) == Blocks.lava && world.getHeightValue(x, z) <= 90) {
new WorldGenVolcano().generate(world, random, x, y, z);
}
}
}
use of net.minecraft.world.biome.BiomeGenBase in project NewHorizonsCoreMod by GTNewHorizons.
the class AllPurposeDebugCommand method processCommand.
@Override
public void processCommand(ICommandSender pCmdSender, String[] pArgs) {
try {
if (pArgs.length == 0) {
moarArgs(pCmdSender);
return;
} else if (pArgs[0].equalsIgnoreCase("ci")) {
EntityPlayer tEP = ((EntityPlayer) pCmdSender);
World tWorldObj = tEP.worldObj;
int x = (int) tEP.posX;
int z = (int) tEP.posZ;
BiomeGenBase tBiomeInfo = tWorldObj.getBiomeGenForCoords(x, z);
PlayerChatHelper.SendInfo(pCmdSender, "POS: x/z %d / %d", x, z);
PlayerChatHelper.SendInfo(pCmdSender, "DimID: %d", tWorldObj.provider.dimensionId);
PlayerChatHelper.SendInfo(pCmdSender, "BiomeID / Name: %d / %s", tBiomeInfo.biomeID, tBiomeInfo.biomeName);
} else if (pArgs[0].equalsIgnoreCase("reloadconfig")) {
MainRegistry.CoreConfig.LoadConfig();
PlayerChatHelper.SendInfo(pCmdSender, "Config reloaded");
} else if (pArgs[0].equalsIgnoreCase("test")) {
if (pArgs.length == 2) {
PlayerChatHelper.SendInfo(pCmdSender, "LOC: %d %d %d", (int) ((EntityPlayer) pCmdSender).posX, (int) ((EntityPlayer) pCmdSender).posY, (int) ((EntityPlayer) pCmdSender).posZ);
Vec3 calculatedPos = PlayerHelper.addDistanceByPlayerDirection((EntityPlayer) pCmdSender, Integer.parseInt(pArgs[1]));
PlayerChatHelper.SendInfo(pCmdSender, "Calculated Block: %d %d %d", (int) calculatedPos.xCoord, (int) calculatedPos.yCoord, (int) calculatedPos.zCoord);
((EntityPlayer) pCmdSender).getEntityWorld().setBlock((int) calculatedPos.xCoord, (int) calculatedPos.yCoord, (int) calculatedPos.zCoord, Blocks.bedrock);
} else
moarArgs(pCmdSender);
} else if (pArgs[0].equalsIgnoreCase("oilstruct")) {
IModFix tModFix = ModFixesMaster.getModFixInstance(OilGeneratorFix.ModFixName);
if (tModFix == null) {
PlayerChatHelper.SendError(pCmdSender, "Required ModFix is not loaded");
return;
}
OilGeneratorFix tOilGenFix = (OilGeneratorFix) tModFix;
if (pArgs.length == 5) {
String[] tBlock = pArgs[1].split(":");
Vec3 tSourcePos = Vec3.createVectorHelper(((EntityPlayer) pCmdSender).posX, (double) Integer.parseInt(pArgs[2]), ((EntityPlayer) pCmdSender).posZ);
// Offset Structure-gen by 50 Blocks from players current location
Vec3 tOilStructPos = PlayerHelper.addDistanceByVecAndYaw(tSourcePos, ((EntityPlayer) pCmdSender).rotationYaw, 50);
int tStructRadius = Integer.parseInt(pArgs[3]);
int tStructGroundLevel = Integer.parseInt(pArgs[4]);
Block tTargetBlock = GameRegistry.findBlock(tBlock[0], tBlock[1]);
if (tTargetBlock != null) {
PlayerChatHelper.SendInfo(pCmdSender, "Creating oilStruct at location %d / %d / %d, radius [%d], virtual groundLevel [%d] with block [%s]", (int) tOilStructPos.xCoord, (int) tOilStructPos.yCoord, (int) tOilStructPos.zCoord, tStructRadius, tStructGroundLevel, pArgs[1]);
tOilGenFix.buildOilStructure(((EntityPlayer) pCmdSender).worldObj, new Random(), (int) tOilStructPos.xCoord, (int) tOilStructPos.yCoord, (int) tOilStructPos.zCoord, tStructRadius, tStructGroundLevel, tTargetBlock, false);
} else
PlayerChatHelper.SendError(pCmdSender, "Unknown block [%s]", pArgs[1]);
} else {
moarArgs(pCmdSender);
return;
}
}
} catch (Exception e) {
e.printStackTrace();
PlayerChatHelper.SendError(pCmdSender, "Unknown error occoured [%s]", e.getMessage());
}
}
Aggregations