mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
IMC support for the acidizer, projectile protection for security armor
This commit is contained in:
parent
4c95d1853a
commit
e72a963d38
@ -131,6 +131,7 @@ public class ModBlocks {
|
||||
public static Block basalt_sulfur;
|
||||
public static Block basalt_fluorite;
|
||||
public static Block basalt_asbestos;
|
||||
public static Block basalt_gem;
|
||||
public static Block basalt_smooth;
|
||||
public static Block basalt_brick;
|
||||
public static Block basalt_polished;
|
||||
@ -1239,6 +1240,7 @@ public class ModBlocks {
|
||||
basalt_sulfur = new BlockOre(Material.rock).setBlockName("basalt_sulfur").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":basalt_sulfur");
|
||||
basalt_fluorite = new BlockOre(Material.rock).setBlockName("basalt_fluorite").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":basalt_fluorite");
|
||||
basalt_asbestos = new BlockOutgas(Material.rock, true, 5, true).setBlockName("basalt_asbestos").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":basalt_asbestos");
|
||||
basalt_gem = new BlockCluster(Material.rock).setBlockName("basalt_gem").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":basalt_gem");
|
||||
basalt_smooth = new BlockGeneric(Material.rock).setBlockName("basalt_smooth").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":basalt_smooth");
|
||||
basalt_brick = new BlockGeneric(Material.rock).setBlockName("basalt_brick").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":basalt_brick");
|
||||
basalt_polished = new BlockGeneric(Material.rock).setBlockName("basalt_polished").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":basalt_polished");
|
||||
@ -2166,6 +2168,7 @@ public class ModBlocks {
|
||||
GameRegistry.registerBlock(basalt_sulfur, basalt_sulfur.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(basalt_fluorite, basalt_fluorite.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(basalt_asbestos, basalt_asbestos.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(basalt_gem, ItemBlockCluster.class, basalt_gem.getUnlocalizedName());
|
||||
|
||||
//End Ores
|
||||
GameRegistry.registerBlock(ore_tikite, ore_tikite.getUnlocalizedName());
|
||||
|
||||
@ -79,25 +79,34 @@ public class VolcanicBlock extends BlockFluidClassic {
|
||||
|
||||
super.updateTick(world, x, y, z, rand);
|
||||
|
||||
int count = 0;
|
||||
int lavaCount = 0;
|
||||
int basaltCount = 0;
|
||||
|
||||
for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
|
||||
Block b = world.getBlock(x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ);
|
||||
|
||||
if(b == this)
|
||||
count++;
|
||||
lavaCount++;
|
||||
if(b == ModBlocks.basalt) {
|
||||
basaltCount++;
|
||||
}
|
||||
}
|
||||
|
||||
if(!world.isRemote && ((!this.isSourceBlock(world, x, y, z) && count < 2) || (rand.nextInt(5) == 0) && count < 5) && world.getBlock(x, y - 1, z) != this) {
|
||||
if(!world.isRemote && ((!this.isSourceBlock(world, x, y, z) && lavaCount < 2) || (rand.nextInt(5) == 0) && lavaCount < 5) && world.getBlock(x, y - 1, z) != this) {
|
||||
|
||||
int r = rand.nextInt(200);
|
||||
|
||||
Block above = world.getBlock(x, y + 10, z);
|
||||
boolean canMakeGem = lavaCount + basaltCount == 6 && lavaCount < 3 && (above == ModBlocks.basalt || above == ModBlocks.volcanic_lava_block);
|
||||
|
||||
if(r < 2)
|
||||
world.setBlock(x, y, z, ModBlocks.basalt_sulfur);
|
||||
else if(r == 2)
|
||||
world.setBlock(x, y, z, ModBlocks.basalt_asbestos);
|
||||
else if(r == 3)
|
||||
world.setBlock(x, y, z, ModBlocks.basalt_fluorite);
|
||||
else if(r < 14 && canMakeGem)
|
||||
world.setBlock(x, y, z, ModBlocks.basalt_gem);
|
||||
else
|
||||
world.setBlock(x, y, z, ModBlocks.basalt);
|
||||
}
|
||||
|
||||
@ -58,6 +58,8 @@ public class BlockCluster extends Block {
|
||||
return ModItems.crystal_titanium;
|
||||
if(this == ModBlocks.cluster_aluminium)
|
||||
return ModItems.crystal_aluminium;
|
||||
if(this == ModBlocks.basalt_gem)
|
||||
return ModItems.gem_volcanic;
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -3,6 +3,7 @@ package com.hbm.blocks.test;
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.config.GeneralConfig;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
@ -12,35 +13,36 @@ public class TestTicker extends Block {
|
||||
|
||||
public TestTicker(Material p_i45394_1_) {
|
||||
super(p_i45394_1_);
|
||||
this.setTickRandomly(true);
|
||||
this.setTickRandomly(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Override
|
||||
public void updateTick(World world, int x, int y, int z, Random rand) {
|
||||
{
|
||||
if(world.getBlock(x + 1, y, z) != ModBlocks.test_ticker) {
|
||||
world.setBlock(x + 1, y, z, ModBlocks.test_ticker);
|
||||
}
|
||||
|
||||
if(world.getBlock(x, y + 1, z) != ModBlocks.test_ticker) {
|
||||
world.setBlock(x, y + 1, z, ModBlocks.test_ticker);
|
||||
}
|
||||
|
||||
if(world.getBlock(x, y, z + 1) != ModBlocks.test_ticker) {
|
||||
world.setBlock(x, y, z + 1, ModBlocks.test_ticker);
|
||||
}
|
||||
|
||||
if(world.getBlock(x - 1, y, z) != ModBlocks.test_ticker) {
|
||||
world.setBlock(x - 1, y, z, ModBlocks.test_ticker);
|
||||
}
|
||||
|
||||
if(world.getBlock(x, y - 1, z) != ModBlocks.test_ticker) {
|
||||
world.setBlock(x, y - 1, z, ModBlocks.test_ticker);
|
||||
}
|
||||
|
||||
if(world.getBlock(x, y, z - 1) != ModBlocks.test_ticker) {
|
||||
world.setBlock(x, y, z - 1, ModBlocks.test_ticker);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(GeneralConfig.enableVirus) {
|
||||
if(world.getBlock(x + 1, y, z) != ModBlocks.test_ticker) {
|
||||
world.setBlock(x + 1, y, z, ModBlocks.test_ticker);
|
||||
}
|
||||
|
||||
if(world.getBlock(x, y + 1, z) != ModBlocks.test_ticker) {
|
||||
world.setBlock(x, y + 1, z, ModBlocks.test_ticker);
|
||||
}
|
||||
|
||||
if(world.getBlock(x, y, z + 1) != ModBlocks.test_ticker) {
|
||||
world.setBlock(x, y, z + 1, ModBlocks.test_ticker);
|
||||
}
|
||||
|
||||
if(world.getBlock(x - 1, y, z) != ModBlocks.test_ticker) {
|
||||
world.setBlock(x - 1, y, z, ModBlocks.test_ticker);
|
||||
}
|
||||
|
||||
if(world.getBlock(x, y - 1, z) != ModBlocks.test_ticker) {
|
||||
world.setBlock(x, y - 1, z, ModBlocks.test_ticker);
|
||||
}
|
||||
|
||||
if(world.getBlock(x, y, z - 1) != ModBlocks.test_ticker) {
|
||||
world.setBlock(x, y, z - 1, ModBlocks.test_ticker);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -5,6 +5,10 @@ import net.minecraftforge.common.config.Property;
|
||||
|
||||
public class WorldConfig {
|
||||
|
||||
public static boolean overworldOre = true;
|
||||
public static boolean netherOre = true;
|
||||
public static boolean endOre = true;
|
||||
|
||||
public static int uraniumSpawn = 6;
|
||||
public static int thoriumSpawn = 7;
|
||||
public static int titaniumSpawn = 8;
|
||||
@ -74,6 +78,11 @@ public class WorldConfig {
|
||||
public static void loadFromConfig(Configuration config) {
|
||||
|
||||
final String CATEGORY_OREGEN = "02_ores";
|
||||
|
||||
overworldOre = CommonConfig.createConfigBool(config, CATEGORY_OREGEN, "2.D00_overworldOres", "General switch for whether overworld ores should be generated. Does not include special structures like oil.", true);
|
||||
netherOre = CommonConfig.createConfigBool(config, CATEGORY_OREGEN, "2.D01_netherOres", "General switch for whether nether ores should be generated.", true);
|
||||
endOre = CommonConfig.createConfigBool(config, CATEGORY_OREGEN, "2.D02_endOres", "General switch for whether end ores should be generated. Does not include special structures like trixite crystals.", true);
|
||||
|
||||
uraniumSpawn = CommonConfig.createConfigInt(config, CATEGORY_OREGEN, "2.00_uraniumSpawnrate", "Amount of uranium ore veins per chunk", 7);
|
||||
titaniumSpawn = CommonConfig.createConfigInt(config, CATEGORY_OREGEN, "2.01_titaniumSpawnrate", "Amount of titanium ore veins per chunk", 8);
|
||||
sulfurSpawn = CommonConfig.createConfigInt(config, CATEGORY_OREGEN, "2.02_sulfurSpawnrate", "Amount of sulfur ore veins per chunk", 5);
|
||||
|
||||
@ -1,11 +1,42 @@
|
||||
package com.hbm.handler.imc;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import com.hbm.inventory.RecipesCommon;
|
||||
|
||||
import cpw.mods.fml.common.event.FMLInterModComms.IMCMessage;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
public class IMCCrystallizer extends IMCHandler {
|
||||
|
||||
public static HashMap<Object, ItemStack> buffer = new HashMap();
|
||||
|
||||
@Override
|
||||
public void process(IMCMessage message) {
|
||||
//TODO
|
||||
|
||||
NBTTagCompound data = message.getNBTValue();
|
||||
|
||||
NBTTagCompound output = data.getCompoundTag("output");
|
||||
ItemStack out = ItemStack.loadItemStackFromNBT(output);
|
||||
|
||||
if(out == null) {
|
||||
this.printError(message, "Output stack could not be read!");
|
||||
}
|
||||
|
||||
NBTTagCompound input = data.getCompoundTag("input");
|
||||
ItemStack in = ItemStack.loadItemStackFromNBT(input);
|
||||
|
||||
if(in != null) {
|
||||
buffer.put(new RecipesCommon.ComparableStack(in), out);
|
||||
} else {
|
||||
String dict = data.getString("oredict");
|
||||
|
||||
if(!dict.isEmpty()) {
|
||||
buffer.put(dict, out);
|
||||
} else {
|
||||
this.printError(message, "Input stack could not be read!");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,6 +2,8 @@ package com.hbm.handler.imc;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import com.hbm.main.MainRegistry;
|
||||
|
||||
import cpw.mods.fml.common.event.FMLInterModComms.IMCMessage;
|
||||
|
||||
public abstract class IMCHandler {
|
||||
@ -12,9 +14,13 @@ public abstract class IMCHandler {
|
||||
handlers.put(name, handler);
|
||||
}
|
||||
|
||||
public static IMCHandler getHanlder(String name) {
|
||||
public static IMCHandler getHandler(String name) {
|
||||
return handlers.get(name);
|
||||
}
|
||||
|
||||
public abstract void process(IMCMessage message);
|
||||
|
||||
public void printError(IMCMessage message, String error) {
|
||||
MainRegistry.logger.error("[" + this.getClass().getSimpleName() + "] Error reading IMC message from " + message.getSender() + ": " + error);
|
||||
}
|
||||
}
|
||||
43
src/main/java/com/hbm/handler/imc/package-info.java
Normal file
43
src/main/java/com/hbm/handler/imc/package-info.java
Normal file
@ -0,0 +1,43 @@
|
||||
package com.hbm.handler.imc;
|
||||
|
||||
/*
|
||||
Howdy! This is the documentation for NTM's inter mod comms. This interface allows other mods to tell NTM to do all sorts of things.
|
||||
IMC messages are handled in the IMCEvent which is called between the mod's init and post-init phases. Make sure to send your IMC
|
||||
messages before they are processed!
|
||||
|
||||
|
||||
######################################## RECIPES ########################################
|
||||
|
||||
####################### ACIDIZER #######################
|
||||
KEY: crystallizer
|
||||
VALUE: NBT
|
||||
|
||||
[MANDATORY]
|
||||
To set the output, set a tag compound named "output" that holds the itemstack info (set via ItemStack.writeToNBT)
|
||||
|
||||
[MANDATORY]
|
||||
To set the input, there are two choices:
|
||||
|
||||
- Set another tag compound like the output called "output". This will make the input a fixed item.
|
||||
- Set a string called "oredict". This will make the input an ore dict entry and allow processing of genericized items.
|
||||
|
||||
EXAMPLES:
|
||||
|
||||
Recipe with fixed item, acidizing an alloy chestplate into 8 ingots:
|
||||
NBTTagCompound msg0 = new NBTTagCompound();
|
||||
NBTTagCompound ing0 = new NBTTagCompound();
|
||||
new ItemStack(ModItems.alloy_plate).writeToNBT(ing0);
|
||||
msg0.setTag("input", ing0);
|
||||
NBTTagCompound out0 = new NBTTagCompound();
|
||||
new ItemStack(ModItems.ingot_advanced_alloy, 8).writeToNBT(out0);
|
||||
msg0.setTag("output", out0);
|
||||
FMLInterModComms.sendMessage("hbm", "crystallizer", msg0);
|
||||
|
||||
Recipe with an ore dict item, acidizing all "plateSteel" into a steel ingot:
|
||||
NBTTagCompound msg1 = new NBTTagCompound();
|
||||
msg1.setString("oredict", "plateSteel");
|
||||
NBTTagCompound out1 = new NBTTagCompound();
|
||||
new ItemStack(ModItems.ingot_steel, 1).writeToNBT(out1);
|
||||
msg1.setTag("output", out1);
|
||||
FMLInterModComms.sendMessage("hbm", "crystallizer", msg1);
|
||||
*/
|
||||
@ -6,8 +6,10 @@ import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.handler.imc.IMCCrystallizer;
|
||||
import com.hbm.inventory.RecipesCommon.ComparableStack;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.main.MainRegistry;
|
||||
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
@ -79,6 +81,12 @@ public class CrystallizerRecipes {
|
||||
qItem.stackSize = 6;
|
||||
recipes.put("oreCertusQuartz", qItem);
|
||||
}
|
||||
|
||||
if(!IMCCrystallizer.buffer.isEmpty()) {
|
||||
recipes.putAll(IMCCrystallizer.buffer);
|
||||
MainRegistry.logger.info("Fetched " + IMCCrystallizer.buffer.size() + " IMC crystallizer recipes!");
|
||||
IMCCrystallizer.buffer.clear();
|
||||
}
|
||||
}
|
||||
|
||||
public static ItemStack getOutput(ItemStack stack) {
|
||||
|
||||
@ -321,6 +321,7 @@ public class ModItems {
|
||||
public static Item crystal_trixite;
|
||||
|
||||
public static Item gem_tantalium;
|
||||
public static Item gem_volcanic;
|
||||
|
||||
public static Item powder_lead;
|
||||
public static Item powder_neptunium;
|
||||
@ -2689,6 +2690,7 @@ public class ModItems {
|
||||
crystal_starmetal = new Item().setUnlocalizedName("crystal_starmetal").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":crystal_starmetal");
|
||||
crystal_trixite = new ItemHazard().addRadiation(ItemHazard.trx * ItemHazard.crystal).toItem().setUnlocalizedName("crystal_trixite").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":crystal_trixite");
|
||||
gem_tantalium = new ItemCustomLore().setUnlocalizedName("gem_tantalium").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":gem_tantalium");
|
||||
gem_volcanic = new ItemCustomLore().setRarity(EnumRarity.uncommon).setUnlocalizedName("gem_volcanic").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":gem_volcanic");
|
||||
|
||||
powder_lead = new Item().setUnlocalizedName("powder_lead").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":powder_lead");
|
||||
powder_neptunium = new ItemHazard(ItemHazard.np237 * ItemHazard.powder, true).setUnlocalizedName("powder_neptunium").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":powder_neptunium");
|
||||
@ -4569,7 +4571,7 @@ public class ModItems {
|
||||
asbestos_plate = new ArmorFSB(MainRegistry.aMatAsbestos, 7, 1, RefStrings.MODID + ":textures/armor/asbestos_1.png").setFireproof(true).setUnlocalizedName("asbestos_plate").setTextureName(RefStrings.MODID + ":asbestos_plate");
|
||||
asbestos_legs = new ArmorFSB(MainRegistry.aMatAsbestos, 7, 2, RefStrings.MODID + ":textures/armor/asbestos_2.png").setFireproof(true).setUnlocalizedName("asbestos_legs").setTextureName(RefStrings.MODID + ":asbestos_legs");
|
||||
asbestos_boots = new ArmorFSB(MainRegistry.aMatAsbestos, 7, 3, RefStrings.MODID + ":textures/armor/asbestos_1.png").setFireproof(true).setUnlocalizedName("asbestos_boots").setTextureName(RefStrings.MODID + ":asbestos_boots");
|
||||
security_helmet = new ArmorFSB(MainRegistry.aMatSecurity, 7, 0, RefStrings.MODID + ":textures/armor/security_1.png").setMod(0.5F).setUnlocalizedName("security_helmet").setTextureName(RefStrings.MODID + ":security_helmet");
|
||||
security_helmet = new ArmorFSB(MainRegistry.aMatSecurity, 7, 0, RefStrings.MODID + ":textures/armor/security_1.png").setMod(0.75F).setProjectileProtection(0.5F).setUnlocalizedName("security_helmet").setTextureName(RefStrings.MODID + ":security_helmet");
|
||||
security_plate = new ArmorFSB(MainRegistry.aMatSecurity, 7, 1, RefStrings.MODID + ":textures/armor/security_1.png").cloneStats((ArmorFSB) security_helmet).setUnlocalizedName("security_plate").setTextureName(RefStrings.MODID + ":security_plate");
|
||||
security_legs = new ArmorFSB(MainRegistry.aMatSecurity, 7, 2, RefStrings.MODID + ":textures/armor/security_2.png").cloneStats((ArmorFSB) security_helmet).setUnlocalizedName("security_legs").setTextureName(RefStrings.MODID + ":security_legs");
|
||||
security_boots = new ArmorFSB(MainRegistry.aMatSecurity, 7, 3, RefStrings.MODID + ":textures/armor/security_1.png").cloneStats((ArmorFSB) security_helmet).setUnlocalizedName("security_boots").setTextureName(RefStrings.MODID + ":security_boots");
|
||||
@ -5565,6 +5567,7 @@ public class ModItems {
|
||||
GameRegistry.registerItem(crystal_starmetal, crystal_starmetal.getUnlocalizedName());
|
||||
GameRegistry.registerItem(crystal_trixite, crystal_trixite.getUnlocalizedName());
|
||||
GameRegistry.registerItem(gem_tantalium, gem_tantalium.getUnlocalizedName());
|
||||
GameRegistry.registerItem(gem_volcanic, gem_volcanic.getUnlocalizedName());
|
||||
|
||||
//Fragments
|
||||
GameRegistry.registerItem(fragment_neodymium, fragment_neodymium.getUnlocalizedName());
|
||||
|
||||
@ -48,6 +48,7 @@ public class ArmorFSB extends ItemArmor {
|
||||
public List<PotionEffect> effects = new ArrayList();
|
||||
public HashMap<String, Float> resistance = new HashMap();
|
||||
public float blastProtection = -1;
|
||||
public float projectileProtection = -1;
|
||||
public float damageCap = -1;
|
||||
public float damageMod = -1;
|
||||
public float damageThreshold = 0;
|
||||
@ -98,6 +99,11 @@ public class ArmorFSB extends ItemArmor {
|
||||
return this;
|
||||
}
|
||||
|
||||
public ArmorFSB setProjectileProtection(float projectileProtection) {
|
||||
this.projectileProtection = projectileProtection;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ArmorFSB setFireproof(boolean fire) {
|
||||
this.fireproof = fire;
|
||||
return this;
|
||||
@ -167,6 +173,7 @@ public class ArmorFSB extends ItemArmor {
|
||||
this.damageMod = original.damageMod;
|
||||
this.damageThreshold = original.damageThreshold;
|
||||
this.blastProtection = original.blastProtection;
|
||||
this.projectileProtection = original.projectileProtection;
|
||||
this.fireproof = original.fireproof;
|
||||
this.noHelmet = original.noHelmet;
|
||||
this.vats = original.vats;
|
||||
@ -215,6 +222,11 @@ public class ArmorFSB extends ItemArmor {
|
||||
list.add(EnumChatFormatting.YELLOW + " " + I18nUtil.resolveKey("armor.blastProtection", blastProtection));
|
||||
}
|
||||
|
||||
if(projectileProtection != -1) {
|
||||
|
||||
list.add(EnumChatFormatting.YELLOW + " " + I18nUtil.resolveKey("armor.projectileProtection", projectileProtection));
|
||||
}
|
||||
|
||||
if(damageCap != -1) {
|
||||
list.add(EnumChatFormatting.YELLOW + " " + I18nUtil.resolveKey("armor.cap", damageCap));
|
||||
}
|
||||
@ -368,6 +380,10 @@ public class ArmorFSB extends ItemArmor {
|
||||
event.ammount *= chestplate.blastProtection;
|
||||
}
|
||||
|
||||
if(chestplate.projectileProtection != -1 && event.source.isProjectile()) {
|
||||
event.ammount *= chestplate.projectileProtection;
|
||||
}
|
||||
|
||||
if(chestplate.damageCap != -1) {
|
||||
event.ammount = Math.min(event.ammount, chestplate.damageCap);
|
||||
}
|
||||
|
||||
@ -42,7 +42,6 @@ import net.minecraft.util.WeightedRandomChestContent;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
import net.minecraft.world.chunk.IChunkProvider;
|
||||
import net.minecraft.world.gen.NoiseGeneratorOctaves;
|
||||
import net.minecraft.world.gen.feature.WorldGenMinable;
|
||||
import cpw.mods.fml.common.IWorldGenerator;
|
||||
|
||||
@ -63,78 +62,78 @@ public class HbmWorldGen implements IWorldGenerator {
|
||||
}
|
||||
}
|
||||
|
||||
NoiseGeneratorOctaves octaves = new NoiseGeneratorOctaves(new Random(0x706f6e6379756dL), 1);
|
||||
|
||||
private void generateSurface(World world, Random rand, int i, int j) {
|
||||
|
||||
DungeonToolbox.generateOre(world, rand, i, j, 25, 6, 30, 10, ModBlocks.ore_gneiss_iron, ModBlocks.stone_gneiss);
|
||||
DungeonToolbox.generateOre(world, rand, i, j, 10, 6, 30, 10, ModBlocks.ore_gneiss_gold, ModBlocks.stone_gneiss);
|
||||
DungeonToolbox.generateOre(world, rand, i, j, WorldConfig.uraniumSpawn * 3, 6, 30, 10, ModBlocks.ore_gneiss_uranium, ModBlocks.stone_gneiss);
|
||||
DungeonToolbox.generateOre(world, rand, i, j, WorldConfig.copperSpawn * 3, 6, 30, 10, ModBlocks.ore_gneiss_copper, ModBlocks.stone_gneiss);
|
||||
DungeonToolbox.generateOre(world, rand, i, j, WorldConfig.asbestosSpawn * 3, 6, 30, 10, ModBlocks.ore_gneiss_asbestos, ModBlocks.stone_gneiss);
|
||||
DungeonToolbox.generateOre(world, rand, i, j, WorldConfig.lithiumSpawn, 6, 30, 10, ModBlocks.ore_gneiss_lithium, ModBlocks.stone_gneiss);
|
||||
DungeonToolbox.generateOre(world, rand, i, j, WorldConfig.rareSpawn, 6, 30, 10, ModBlocks.ore_gneiss_asbestos, ModBlocks.stone_gneiss);
|
||||
DungeonToolbox.generateOre(world, rand, i, j, WorldConfig.gassshaleSpawn * 3, 10, 30, 10, ModBlocks.ore_gneiss_gas, ModBlocks.stone_gneiss);
|
||||
|
||||
DungeonToolbox.generateOre(world, rand, i, j, WorldConfig.uraniumSpawn, 5, 5, 20, ModBlocks.ore_uranium);
|
||||
DungeonToolbox.generateOre(world, rand, i, j, WorldConfig.thoriumSpawn, 5, 5, 25, ModBlocks.ore_thorium);
|
||||
DungeonToolbox.generateOre(world, rand, i, j, WorldConfig.titaniumSpawn, 6, 5, 30, ModBlocks.ore_titanium);
|
||||
DungeonToolbox.generateOre(world, rand, i, j, WorldConfig.sulfurSpawn, 8, 5, 30, ModBlocks.ore_sulfur);
|
||||
DungeonToolbox.generateOre(world, rand, i, j, WorldConfig.aluminiumSpawn, 6, 5, 40, ModBlocks.ore_aluminium);
|
||||
DungeonToolbox.generateOre(world, rand, i, j, WorldConfig.copperSpawn, 6, 5, 45, ModBlocks.ore_copper);
|
||||
DungeonToolbox.generateOre(world, rand, i, j, WorldConfig.fluoriteSpawn, 4, 5, 45, ModBlocks.ore_fluorite);
|
||||
DungeonToolbox.generateOre(world, rand, i, j, WorldConfig.niterSpawn, 6, 5, 30, ModBlocks.ore_niter);
|
||||
DungeonToolbox.generateOre(world, rand, i, j, WorldConfig.tungstenSpawn, 8, 5, 30, ModBlocks.ore_tungsten);
|
||||
DungeonToolbox.generateOre(world, rand, i, j, WorldConfig.leadSpawn, 9, 5, 30, ModBlocks.ore_lead);
|
||||
DungeonToolbox.generateOre(world, rand, i, j, WorldConfig.berylliumSpawn, 4, 5, 30, ModBlocks.ore_beryllium);
|
||||
DungeonToolbox.generateOre(world, rand, i, j, WorldConfig.rareSpawn, 5, 5, 20, ModBlocks.ore_rare);
|
||||
DungeonToolbox.generateOre(world, rand, i, j, WorldConfig.ligniteSpawn, 24, 35, 25, ModBlocks.ore_lignite);
|
||||
DungeonToolbox.generateOre(world, rand, i, j, WorldConfig.asbestosSpawn, 4, 16, 16, ModBlocks.ore_asbestos);
|
||||
DungeonToolbox.generateOre(world, rand, i, j, WorldConfig.cinnebarSpawn, 4, 8, 16, ModBlocks.ore_cinnebar);
|
||||
DungeonToolbox.generateOre(world, rand, i, j, WorldConfig.cobaltSpawn, 4, 4, 8, ModBlocks.ore_cobalt);
|
||||
|
||||
DungeonToolbox.generateOre(world, rand, i, j, WorldConfig.ironClusterSpawn, 6, 5, 50, ModBlocks.cluster_iron);
|
||||
DungeonToolbox.generateOre(world, rand, i, j, WorldConfig.titaniumClusterSpawn, 6, 5, 30, ModBlocks.cluster_titanium);
|
||||
DungeonToolbox.generateOre(world, rand, i, j, WorldConfig.aluminiumClusterSpawn, 6, 5, 40, ModBlocks.cluster_aluminium);
|
||||
|
||||
if(WorldConfig.oilcoalSpawn > 0 && rand.nextInt(WorldConfig.oilcoalSpawn) == 0)
|
||||
DungeonToolbox.generateOre(world, rand, i, j, 1, 64, 32, 32, ModBlocks.ore_coal_oil);
|
||||
|
||||
if(WorldConfig.gasbubbleSpawn > 0 && rand.nextInt(WorldConfig.gasbubbleSpawn) == 0)
|
||||
DungeonToolbox.generateOre(world, rand, i, j, 1, 32, 30, 10, ModBlocks.gas_flammable);
|
||||
|
||||
DepthDeposit.generateConditionOverworld(world, i, 0, 3, j, 5, 0.6D, ModBlocks.cluster_depth_iron, rand, 24);
|
||||
DepthDeposit.generateConditionOverworld(world, i, 0, 3, j, 5, 0.6D, ModBlocks.cluster_depth_titanium, rand, 32);
|
||||
DepthDeposit.generateConditionOverworld(world, i, 0, 3, j, 5, 0.6D, ModBlocks.cluster_depth_tungsten, rand, 32);
|
||||
DepthDeposit.generateConditionOverworld(world, i, 0, 3, j, 5, 0.8D, ModBlocks.ore_depth_cinnebar, rand, 16);
|
||||
DepthDeposit.generateConditionOverworld(world, i, 0, 3, j, 5, 0.8D, ModBlocks.ore_depth_zirconium, rand, 16);
|
||||
|
||||
Random colRand = new Random(world.getSeed() + 5);
|
||||
int colX = (int) (colRand.nextGaussian() * 1500);
|
||||
int colZ = (int) (colRand.nextGaussian() * 1500);
|
||||
int colRange = 500;
|
||||
|
||||
for (int k = 0; k < 2; k++) {
|
||||
|
||||
for(int r = 1; r <= 5; r++) {
|
||||
int randPosX = i + rand.nextInt(16);
|
||||
int randPosY = rand.nextInt(25) + 15;
|
||||
int randPosZ = j + rand.nextInt(16);
|
||||
|
||||
int range = colRange / r;
|
||||
if(WorldConfig.overworldOre) {
|
||||
DungeonToolbox.generateOre(world, rand, i, j, 25, 6, 30, 10, ModBlocks.ore_gneiss_iron, ModBlocks.stone_gneiss);
|
||||
DungeonToolbox.generateOre(world, rand, i, j, 10, 6, 30, 10, ModBlocks.ore_gneiss_gold, ModBlocks.stone_gneiss);
|
||||
DungeonToolbox.generateOre(world, rand, i, j, WorldConfig.uraniumSpawn * 3, 6, 30, 10, ModBlocks.ore_gneiss_uranium, ModBlocks.stone_gneiss);
|
||||
DungeonToolbox.generateOre(world, rand, i, j, WorldConfig.copperSpawn * 3, 6, 30, 10, ModBlocks.ore_gneiss_copper, ModBlocks.stone_gneiss);
|
||||
DungeonToolbox.generateOre(world, rand, i, j, WorldConfig.asbestosSpawn * 3, 6, 30, 10, ModBlocks.ore_gneiss_asbestos, ModBlocks.stone_gneiss);
|
||||
DungeonToolbox.generateOre(world, rand, i, j, WorldConfig.lithiumSpawn, 6, 30, 10, ModBlocks.ore_gneiss_lithium, ModBlocks.stone_gneiss);
|
||||
DungeonToolbox.generateOre(world, rand, i, j, WorldConfig.rareSpawn, 6, 30, 10, ModBlocks.ore_gneiss_asbestos, ModBlocks.stone_gneiss);
|
||||
DungeonToolbox.generateOre(world, rand, i, j, WorldConfig.gassshaleSpawn * 3, 10, 30, 10, ModBlocks.ore_gneiss_gas, ModBlocks.stone_gneiss);
|
||||
|
||||
if(randPosX <= colX + range && randPosX >= colX - range && randPosZ <= colZ + range && randPosZ >= colZ - range)
|
||||
(new WorldGenMinable(ModBlocks.ore_coltan, 4)).generate(world, rand, randPosX, randPosY, randPosZ);
|
||||
DungeonToolbox.generateOre(world, rand, i, j, WorldConfig.uraniumSpawn, 5, 5, 20, ModBlocks.ore_uranium);
|
||||
DungeonToolbox.generateOre(world, rand, i, j, WorldConfig.thoriumSpawn, 5, 5, 25, ModBlocks.ore_thorium);
|
||||
DungeonToolbox.generateOre(world, rand, i, j, WorldConfig.titaniumSpawn, 6, 5, 30, ModBlocks.ore_titanium);
|
||||
DungeonToolbox.generateOre(world, rand, i, j, WorldConfig.sulfurSpawn, 8, 5, 30, ModBlocks.ore_sulfur);
|
||||
DungeonToolbox.generateOre(world, rand, i, j, WorldConfig.aluminiumSpawn, 6, 5, 40, ModBlocks.ore_aluminium);
|
||||
DungeonToolbox.generateOre(world, rand, i, j, WorldConfig.copperSpawn, 6, 5, 45, ModBlocks.ore_copper);
|
||||
DungeonToolbox.generateOre(world, rand, i, j, WorldConfig.fluoriteSpawn, 4, 5, 45, ModBlocks.ore_fluorite);
|
||||
DungeonToolbox.generateOre(world, rand, i, j, WorldConfig.niterSpawn, 6, 5, 30, ModBlocks.ore_niter);
|
||||
DungeonToolbox.generateOre(world, rand, i, j, WorldConfig.tungstenSpawn, 8, 5, 30, ModBlocks.ore_tungsten);
|
||||
DungeonToolbox.generateOre(world, rand, i, j, WorldConfig.leadSpawn, 9, 5, 30, ModBlocks.ore_lead);
|
||||
DungeonToolbox.generateOre(world, rand, i, j, WorldConfig.berylliumSpawn, 4, 5, 30, ModBlocks.ore_beryllium);
|
||||
DungeonToolbox.generateOre(world, rand, i, j, WorldConfig.rareSpawn, 5, 5, 20, ModBlocks.ore_rare);
|
||||
DungeonToolbox.generateOre(world, rand, i, j, WorldConfig.ligniteSpawn, 24, 35, 25, ModBlocks.ore_lignite);
|
||||
DungeonToolbox.generateOre(world, rand, i, j, WorldConfig.asbestosSpawn, 4, 16, 16, ModBlocks.ore_asbestos);
|
||||
DungeonToolbox.generateOre(world, rand, i, j, WorldConfig.cinnebarSpawn, 4, 8, 16, ModBlocks.ore_cinnebar);
|
||||
DungeonToolbox.generateOre(world, rand, i, j, WorldConfig.cobaltSpawn, 4, 4, 8, ModBlocks.ore_cobalt);
|
||||
|
||||
DungeonToolbox.generateOre(world, rand, i, j, WorldConfig.ironClusterSpawn, 6, 5, 50, ModBlocks.cluster_iron);
|
||||
DungeonToolbox.generateOre(world, rand, i, j, WorldConfig.titaniumClusterSpawn, 6, 5, 30, ModBlocks.cluster_titanium);
|
||||
DungeonToolbox.generateOre(world, rand, i, j, WorldConfig.aluminiumClusterSpawn, 6, 5, 40, ModBlocks.cluster_aluminium);
|
||||
|
||||
if(WorldConfig.oilcoalSpawn > 0 && rand.nextInt(WorldConfig.oilcoalSpawn) == 0)
|
||||
DungeonToolbox.generateOre(world, rand, i, j, 1, 64, 32, 32, ModBlocks.ore_coal_oil);
|
||||
|
||||
if(WorldConfig.gasbubbleSpawn > 0 && rand.nextInt(WorldConfig.gasbubbleSpawn) == 0)
|
||||
DungeonToolbox.generateOre(world, rand, i, j, 1, 32, 30, 10, ModBlocks.gas_flammable);
|
||||
|
||||
DepthDeposit.generateConditionOverworld(world, i, 0, 3, j, 5, 0.6D, ModBlocks.cluster_depth_iron, rand, 24);
|
||||
DepthDeposit.generateConditionOverworld(world, i, 0, 3, j, 5, 0.6D, ModBlocks.cluster_depth_titanium, rand, 32);
|
||||
DepthDeposit.generateConditionOverworld(world, i, 0, 3, j, 5, 0.6D, ModBlocks.cluster_depth_tungsten, rand, 32);
|
||||
DepthDeposit.generateConditionOverworld(world, i, 0, 3, j, 5, 0.8D, ModBlocks.ore_depth_cinnebar, rand, 16);
|
||||
DepthDeposit.generateConditionOverworld(world, i, 0, 3, j, 5, 0.8D, ModBlocks.ore_depth_zirconium, rand, 16);
|
||||
|
||||
Random colRand = new Random(world.getSeed() + 5);
|
||||
int colX = (int) (colRand.nextGaussian() * 1500);
|
||||
int colZ = (int) (colRand.nextGaussian() * 1500);
|
||||
int colRange = 500;
|
||||
|
||||
for (int k = 0; k < 2; k++) {
|
||||
|
||||
for(int r = 1; r <= 5; r++) {
|
||||
int randPosX = i + rand.nextInt(16);
|
||||
int randPosY = rand.nextInt(25) + 15;
|
||||
int randPosZ = j + rand.nextInt(16);
|
||||
|
||||
int range = colRange / r;
|
||||
|
||||
if(randPosX <= colX + range && randPosX >= colX - range && randPosZ <= colZ + range && randPosZ >= colZ - range)
|
||||
(new WorldGenMinable(ModBlocks.ore_coltan, 4)).generate(world, rand, randPosX, randPosY, randPosZ);
|
||||
}
|
||||
}
|
||||
|
||||
for (int k = 0; k < rand.nextInt(4); k++) {
|
||||
int randPosX = i + rand.nextInt(16);
|
||||
int randPosY = rand.nextInt(15) + 15;
|
||||
int randPosZ = j + rand.nextInt(16);
|
||||
|
||||
if(randPosX <= -350 && randPosX >= -450 && randPosZ <= -350 && randPosZ >= -450)
|
||||
(new WorldGenMinable(ModBlocks.ore_australium, 50)).generate(world, rand, randPosX, randPosY, randPosZ);
|
||||
}
|
||||
}
|
||||
|
||||
for (int k = 0; k < rand.nextInt(4); k++) {
|
||||
int randPosX = i + rand.nextInt(16);
|
||||
int randPosY = rand.nextInt(15) + 15;
|
||||
int randPosZ = j + rand.nextInt(16);
|
||||
|
||||
if(randPosX <= -350 && randPosX >= -450 && randPosZ <= -350 && randPosZ >= -450)
|
||||
(new WorldGenMinable(ModBlocks.ore_australium, 50)).generate(world, rand, randPosX, randPosY, randPosZ);
|
||||
}
|
||||
|
||||
if (GeneralConfig.enableDungeons && world.provider.isSurfaceWorld()) {
|
||||
@ -596,18 +595,20 @@ public class HbmWorldGen implements IWorldGenerator {
|
||||
|
||||
private void generateNether(World world, Random rand, int i, int j) {
|
||||
|
||||
DungeonToolbox.generateOre(world, rand, i, j, WorldConfig.netherUraniumuSpawn, 6, 0, 127, ModBlocks.ore_nether_uranium, Blocks.netherrack);
|
||||
DungeonToolbox.generateOre(world, rand, i, j, WorldConfig.netherTungstenSpawn, 10, 0, 127, ModBlocks.ore_nether_tungsten, Blocks.netherrack);
|
||||
DungeonToolbox.generateOre(world, rand, i, j, WorldConfig.netherSulfurSpawn, 12, 0, 127, ModBlocks.ore_nether_sulfur, Blocks.netherrack);
|
||||
DungeonToolbox.generateOre(world, rand, i, j, WorldConfig.netherPhosphorusSpawn, 6, 0, 127, ModBlocks.ore_nether_fire, Blocks.netherrack);
|
||||
DungeonToolbox.generateOre(world, rand, i, j, WorldConfig.netherCoalSpawn, 32, 16, 96, ModBlocks.ore_nether_coal, Blocks.netherrack);
|
||||
DungeonToolbox.generateOre(world, rand, i, j, WorldConfig.netherCobaltSpawn, 6, 100, 26, ModBlocks.ore_nether_cobalt, Blocks.netherrack);
|
||||
|
||||
if(GeneralConfig.enablePlutoniumOre)
|
||||
DungeonToolbox.generateOre(world, rand, i, j, WorldConfig.netherPlutoniumSpawn, 4, 0, 127, ModBlocks.ore_nether_plutonium, Blocks.netherrack);
|
||||
if(WorldConfig.netherOre) {
|
||||
DungeonToolbox.generateOre(world, rand, i, j, WorldConfig.netherUraniumuSpawn, 6, 0, 127, ModBlocks.ore_nether_uranium, Blocks.netherrack);
|
||||
DungeonToolbox.generateOre(world, rand, i, j, WorldConfig.netherTungstenSpawn, 10, 0, 127, ModBlocks.ore_nether_tungsten, Blocks.netherrack);
|
||||
DungeonToolbox.generateOre(world, rand, i, j, WorldConfig.netherSulfurSpawn, 12, 0, 127, ModBlocks.ore_nether_sulfur, Blocks.netherrack);
|
||||
DungeonToolbox.generateOre(world, rand, i, j, WorldConfig.netherPhosphorusSpawn, 6, 0, 127, ModBlocks.ore_nether_fire, Blocks.netherrack);
|
||||
DungeonToolbox.generateOre(world, rand, i, j, WorldConfig.netherCoalSpawn, 32, 16, 96, ModBlocks.ore_nether_coal, Blocks.netherrack);
|
||||
DungeonToolbox.generateOre(world, rand, i, j, WorldConfig.netherCobaltSpawn, 6, 100, 26, ModBlocks.ore_nether_cobalt, Blocks.netherrack);
|
||||
|
||||
if(GeneralConfig.enablePlutoniumOre)
|
||||
DungeonToolbox.generateOre(world, rand, i, j, WorldConfig.netherPlutoniumSpawn, 4, 0, 127, ModBlocks.ore_nether_plutonium, Blocks.netherrack);
|
||||
|
||||
DepthDeposit.generateConditionNether(world, i, 0, 3, j, 7, 0.6D, ModBlocks.ore_depth_nether_neodymium, rand, 16);
|
||||
DepthDeposit.generateConditionNether(world, i, 125, 3, j, 7, 0.6D, ModBlocks.ore_depth_nether_neodymium, rand, 16);
|
||||
DepthDeposit.generateConditionNether(world, i, 0, 3, j, 7, 0.6D, ModBlocks.ore_depth_nether_neodymium, rand, 16);
|
||||
DepthDeposit.generateConditionNether(world, i, 125, 3, j, 7, 0.6D, ModBlocks.ore_depth_nether_neodymium, rand, 16);
|
||||
}
|
||||
|
||||
for(int k = 0; k < 30; k++){
|
||||
int x = i + rand.nextInt(16);
|
||||
@ -631,17 +632,20 @@ public class HbmWorldGen implements IWorldGenerator {
|
||||
}
|
||||
|
||||
private void generateEnd(World world, Random rand, int i, int j) {
|
||||
DungeonToolbox.generateOre(world, rand, i, j, WorldConfig.endTikiteSpawn, 6, 0, 127, ModBlocks.ore_tikite, Blocks.end_stone);
|
||||
|
||||
/*for(int k = 0; k < 50; k++){
|
||||
int x = i + rand.nextInt(16);
|
||||
int z = j + rand.nextInt(16);
|
||||
int d = 5 + rand.nextInt(60);
|
||||
|
||||
for(int y = d - 5; y <= d; y++)
|
||||
if(world.getBlock(x, y, z) == Blocks.air && world.getBlock(x, y + 1, z).isSideSolid(world, x, y, z, ForgeDirection.DOWN))
|
||||
world.setBlock(x, y, z, ModBlocks.crystal_trixite);
|
||||
}*/
|
||||
|
||||
if(!WorldConfig.endOre) {
|
||||
DungeonToolbox.generateOre(world, rand, i, j, WorldConfig.endTikiteSpawn, 6, 0, 127, ModBlocks.ore_tikite, Blocks.end_stone);
|
||||
|
||||
/*for(int k = 0; k < 50; k++){
|
||||
int x = i + rand.nextInt(16);
|
||||
int z = j + rand.nextInt(16);
|
||||
int d = 5 + rand.nextInt(60);
|
||||
|
||||
for(int y = d - 5; y <= d; y++)
|
||||
if(world.getBlock(x, y, z) == Blocks.air && world.getBlock(x, y + 1, z).isSideSolid(world, x, y, z, ForgeDirection.DOWN))
|
||||
world.setBlock(x, y, z, ModBlocks.crystal_trixite);
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -10,6 +10,7 @@ import net.minecraft.item.Item;
|
||||
import net.minecraft.item.Item.ToolMaterial;
|
||||
import net.minecraft.item.ItemArmor.ArmorMaterial;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.stats.Achievement;
|
||||
import net.minecraft.util.WeightedRandomChestContent;
|
||||
import net.minecraft.world.World;
|
||||
@ -31,6 +32,7 @@ import cpw.mods.fml.common.ModMetadata;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
@ -75,7 +77,6 @@ import com.hbm.tileentity.bomb.*;
|
||||
import com.hbm.tileentity.conductor.*;
|
||||
import com.hbm.tileentity.deco.*;
|
||||
import com.hbm.tileentity.machine.*;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineReactorLarge.ReactorFuelType;
|
||||
import com.hbm.tileentity.machine.rbmk.*;
|
||||
import com.hbm.tileentity.network.TileEntityCableBaseNT;
|
||||
import com.hbm.tileentity.turret.*;
|
||||
@ -84,6 +85,7 @@ import com.hbm.world.generator.CellularDungeonFactory;
|
||||
|
||||
import cpw.mods.fml.common.SidedProxy;
|
||||
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLInterModComms;
|
||||
import cpw.mods.fml.common.event.FMLInterModComms.IMCEvent;
|
||||
import cpw.mods.fml.common.event.FMLInterModComms.IMCMessage;
|
||||
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
||||
@ -106,7 +108,7 @@ public class MainRegistry {
|
||||
@Metadata
|
||||
public static ModMetadata meta;
|
||||
|
||||
public static Logger logger;
|
||||
public static Logger logger = LogManager.getLogger("HBM");
|
||||
|
||||
// Tool Materials
|
||||
public static ToolMaterial tMatSchrab = EnumHelper.addToolMaterial("SCHRABIDIUM", 3, 10000, 50.0F, 100.0F, 200);
|
||||
@ -220,8 +222,7 @@ public class MainRegistry {
|
||||
|
||||
startupTime = System.currentTimeMillis();
|
||||
|
||||
if(logger == null)
|
||||
logger = PreEvent.getModLog();
|
||||
logger.info("TEST LOG AAAAAAAAAA");
|
||||
|
||||
// Reroll Polaroid
|
||||
|
||||
@ -1029,7 +1030,21 @@ public class MainRegistry {
|
||||
BobmazonOfferFactory.init();
|
||||
OreDictManager.registerOres();
|
||||
|
||||
IMCHandler.registerHandler("crystallizer", new IMCCrystallizer());
|
||||
IMCHandler.registerHandler("crystallizer", new IMCCrystallizer());NBTTagCompound msg0 = new NBTTagCompound();
|
||||
NBTTagCompound ing0 = new NBTTagCompound();
|
||||
new ItemStack(ModItems.alloy_plate).writeToNBT(ing0);
|
||||
msg0.setTag("input", ing0);
|
||||
NBTTagCompound out0 = new NBTTagCompound();
|
||||
new ItemStack(ModItems.ingot_advanced_alloy, 8).writeToNBT(out0);
|
||||
msg0.setTag("output", out0);
|
||||
FMLInterModComms.sendMessage("hbm", "crystallizer", msg0);
|
||||
|
||||
NBTTagCompound msg1 = new NBTTagCompound();
|
||||
msg1.setString("oredict", "plateSteel");
|
||||
NBTTagCompound out1 = new NBTTagCompound();
|
||||
new ItemStack(ModItems.ingot_steel, 1).writeToNBT(out1);
|
||||
msg1.setTag("output", out1);
|
||||
FMLInterModComms.sendMessage("hbm", "crystallizer", msg1);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
@ -1038,9 +1053,10 @@ public class MainRegistry {
|
||||
ImmutableList<IMCMessage> inbox = event.getMessages(); //tee-hee
|
||||
|
||||
for(IMCMessage message : inbox) {
|
||||
IMCHandler handler = IMCHandler.getHanlder(message.key);
|
||||
IMCHandler handler = IMCHandler.getHandler(message.key);
|
||||
|
||||
if(handler != null) {
|
||||
MainRegistry.logger.info("Received IMC of type >" + message.key + "< from " + message.getSender() + "!");
|
||||
handler.process(message);
|
||||
} else {
|
||||
MainRegistry.logger.error("Could not process unknown IMC type \"" + message.key + "\"");
|
||||
|
||||
@ -4,8 +4,6 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.entity.effect.EntityCloudFleijaRainbow;
|
||||
import com.hbm.entity.logic.EntityNukeExplosionMK4;
|
||||
import com.hbm.handler.FluidTypeHandler.FluidType;
|
||||
import com.hbm.interfaces.IConsumer;
|
||||
import com.hbm.interfaces.IFluidAcceptor;
|
||||
@ -17,18 +15,15 @@ import com.hbm.items.machine.ItemCatalyst;
|
||||
import com.hbm.items.machine.ItemSatChip;
|
||||
import com.hbm.items.special.ItemAMSCore;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.lib.ModDamageSource;
|
||||
import com.hbm.packet.AuxElectricityPacket;
|
||||
import com.hbm.packet.AuxGaugePacket;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.saveddata.SatelliteSavedData;
|
||||
import com.hbm.saveddata.satellites.SatelliteResonator;
|
||||
import com.hbm.util.ArmorUtil;
|
||||
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@ -315,10 +310,8 @@ public class TileEntityAMSBase extends TileEntity implements ISidedInventory, IS
|
||||
|
||||
this.color = -1;
|
||||
|
||||
float powerMod = 1;
|
||||
float heatMod = 1;
|
||||
float fuelMod = 1;
|
||||
long powerBase = 0;
|
||||
int heatBase = 0;
|
||||
int fuelBase = 0;
|
||||
|
||||
@ -340,18 +333,13 @@ public class TileEntityAMSBase extends TileEntity implements ISidedInventory, IS
|
||||
|
||||
|
||||
for(int i = 8; i < 12; i++) {
|
||||
powerBase += ItemCatalyst.getPowerAbs(slots[i]);
|
||||
powerMod *= ItemCatalyst.getPowerMod(slots[i]);
|
||||
heatMod *= ItemCatalyst.getHeatMod(slots[i]);
|
||||
fuelMod *= ItemCatalyst.getFuelMod(slots[i]);
|
||||
}
|
||||
|
||||
powerBase = ItemAMSCore.getPowerBase(slots[12]);
|
||||
heatBase = ItemAMSCore.getHeatBase(slots[12]);
|
||||
fuelBase = ItemAMSCore.getFuelBase(slots[12]);
|
||||
|
||||
powerBase *= this.efficiency;
|
||||
powerBase *= Math.pow(1.25F, booster);
|
||||
heatBase *= Math.pow(1.25F, booster);
|
||||
heatBase *= (100 - field);
|
||||
|
||||
@ -367,15 +355,9 @@ public class TileEntityAMSBase extends TileEntity implements ISidedInventory, IS
|
||||
if(tanks[3].getFill() <= 0)
|
||||
tanks[3].setFill(0);
|
||||
|
||||
radiation();
|
||||
|
||||
if(heat > maxHeat) {
|
||||
//explode();
|
||||
heat = maxHeat;
|
||||
}
|
||||
|
||||
if(field <= 0)
|
||||
explode();
|
||||
}
|
||||
}
|
||||
|
||||
@ -413,53 +395,6 @@ public class TileEntityAMSBase extends TileEntity implements ISidedInventory, IS
|
||||
}
|
||||
}
|
||||
|
||||
private void radiation() {
|
||||
|
||||
double maxSize = 5;
|
||||
double minSize = 0.5;
|
||||
double scale = minSize;
|
||||
scale += ((((double)this.tanks[2].getFill()) / ((double)this.tanks[2].getMaxFill())) + (((double)this.tanks[3].getFill()) / ((double)this.tanks[3].getMaxFill()))) * ((maxSize - minSize) / 2);
|
||||
|
||||
scale *= 0.60;
|
||||
|
||||
List<Entity> list = worldObj.getEntitiesWithinAABBExcludingEntity(null, AxisAlignedBB.getBoundingBox(xCoord - 10 + 0.5, yCoord - 10 + 0.5 + 6, zCoord - 10 + 0.5, xCoord + 10 + 0.5, yCoord + 10 + 0.5 + 6, zCoord + 10 + 0.5));
|
||||
|
||||
for(Entity e : list) {
|
||||
if(!(e instanceof EntityPlayer && ArmorUtil.checkForHazmat((EntityPlayer)e)))
|
||||
if(!Library.isObstructed(worldObj, xCoord + 0.5, yCoord + 0.5 + 6, zCoord + 0.5, e.posX, e.posY + e.getEyeHeight(), e.posZ)) {
|
||||
e.attackEntityFrom(ModDamageSource.ams, 1000);
|
||||
e.setFire(3);
|
||||
}
|
||||
}
|
||||
|
||||
List<Entity> list2 = worldObj.getEntitiesWithinAABBExcludingEntity(null, AxisAlignedBB.getBoundingBox(xCoord - scale + 0.5, yCoord - scale + 0.5 + 6, zCoord - scale + 0.5, xCoord + scale + 0.5, yCoord + scale + 0.5 + 6, zCoord + scale + 0.5));
|
||||
|
||||
for(Entity e : list2) {
|
||||
if(!(e instanceof EntityPlayer && ArmorUtil.checkForHaz2((EntityPlayer)e)))
|
||||
e.attackEntityFrom(ModDamageSource.amsCore, 10000);
|
||||
}
|
||||
}
|
||||
|
||||
private void explode() {
|
||||
if(!worldObj.isRemote) {
|
||||
|
||||
for(int i = 0; i < 10; i++) {
|
||||
|
||||
EntityCloudFleijaRainbow cloud = new EntityCloudFleijaRainbow(this.worldObj, 100);
|
||||
cloud.posX = xCoord + rand.nextInt(201) - 100;
|
||||
cloud.posY = yCoord + rand.nextInt(201) - 100;
|
||||
cloud.posZ = zCoord + rand.nextInt(201) - 100;
|
||||
this.worldObj.spawnEntityInWorld(cloud);
|
||||
}
|
||||
|
||||
int radius = (int)(50 + (double)(tanks[2].getFill() + tanks[3].getFill()) / 16000D * 150);
|
||||
|
||||
worldObj.spawnEntityInWorld(EntityNukeExplosionMK4.statFacExperimental(worldObj, radius, xCoord, yCoord, zCoord));
|
||||
|
||||
worldObj.setBlockToAir(xCoord, yCoord, zCoord);
|
||||
}
|
||||
}
|
||||
|
||||
private int getCoolingStrength(FluidType type) {
|
||||
switch(type) {
|
||||
case WATER:
|
||||
@ -486,18 +421,6 @@ public class TileEntityAMSBase extends TileEntity implements ISidedInventory, IS
|
||||
}
|
||||
}
|
||||
|
||||
private float gauss(float a, float x) {
|
||||
|
||||
//Greater values -> less difference of temperate impact
|
||||
double amplifier = 0.10;
|
||||
|
||||
return (float) ( (1/Math.sqrt(a * Math.PI)) * Math.pow(Math.E, -1 * Math.pow(x, 2)/amplifier) );
|
||||
}
|
||||
|
||||
private float calcEffect(float a, float x) {
|
||||
return (float) (gauss( 1 / a, x / maxHeat) * Math.sqrt(Math.PI * 2) / (Math.sqrt(2) * Math.sqrt(maxPower)));
|
||||
}
|
||||
|
||||
private float calcField(int a, int b, int c, int d) {
|
||||
return (float)(a + b + c + d) * (a * 25 + b * 25 + c * 25 + d * 25) / 40000;
|
||||
}
|
||||
|
||||
@ -10,7 +10,6 @@ import com.hbm.interfaces.IConsumer;
|
||||
import com.hbm.interfaces.IFluidAcceptor;
|
||||
import com.hbm.interfaces.IFluidSource;
|
||||
import com.hbm.interfaces.ISource;
|
||||
import com.hbm.interfaces.Untested;
|
||||
import com.hbm.inventory.FluidTank;
|
||||
import com.hbm.inventory.MachineRecipes;
|
||||
import com.hbm.lib.Library;
|
||||
|
||||
BIN
src/main/resources/assets/hbm/textures/blocks/basalt_gem.png
Normal file
BIN
src/main/resources/assets/hbm/textures/blocks/basalt_gem.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 894 B |
Binary file not shown.
|
After Width: | Height: | Size: 931 B |
Binary file not shown.
|
After Width: | Height: | Size: 309 B |
BIN
src/main/resources/assets/hbm/textures/items/gem_volcanic.png
Normal file
BIN
src/main/resources/assets/hbm/textures/items/gem_volcanic.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 437 B |
Binary file not shown.
|
After Width: | Height: | Size: 940 B |
Loading…
x
Reference in New Issue
Block a user