merged PR #319 (that's the funny one)
@ -440,6 +440,10 @@ public class ModBlocks {
|
||||
public static Block dirt_oily;
|
||||
public static Block sand_dirty;
|
||||
public static Block sand_dirty_red;
|
||||
public static Block burning_earth;
|
||||
public static Block tektite;
|
||||
public static Block ore_tektite_osmiridium;
|
||||
public static Block impact_dirt;
|
||||
|
||||
public static Block fallout;
|
||||
public static Block foam_layer;
|
||||
@ -1608,7 +1612,11 @@ public class ModBlocks {
|
||||
foam_layer = new BlockLayering(Material.snow).setBlockName("foam_layer").setStepSound(Block.soundTypeSnow).setCreativeTab(MainRegistry.blockTab).setHardness(0.1F).setLightOpacity(0).setBlockTextureName(RefStrings.MODID + ":foam");
|
||||
sand_boron_layer = new BlockLayering(Material.sand).setBlockName("sand_boron_layer").setStepSound(Block.soundTypeSand).setCreativeTab(MainRegistry.blockTab).setHardness(0.1F).setLightOpacity(0).setBlockTextureName(RefStrings.MODID + ":sand_boron");
|
||||
|
||||
dirt_dead = new BlockGeneric(Material.ground).setBlockName("dirt_dead").setStepSound(Block.soundTypeGravel).setCreativeTab(MainRegistry.blockTab).setHardness(0.5F).setLightOpacity(0).setBlockTextureName(RefStrings.MODID + ":dirt_dead");
|
||||
burning_earth = new WasteEarth(Material.ground, true).setBlockName("burning_earth").setStepSound(Block.soundTypeGrass).setCreativeTab(MainRegistry.blockTab).setHardness(0.6F).setBlockTextureName(RefStrings.MODID + ":burning_earth");
|
||||
tektite = new BlockGeneric(Material.sand).setBlockName("tektite").setStepSound(Block.soundTypeSand).setCreativeTab(MainRegistry.blockTab).setHardness(0.5F).setBlockTextureName(RefStrings.MODID + ":tektite");
|
||||
ore_tektite_osmiridium = new BlockGeneric(Material.sand).setBlockName("ore_tektite_osmiridium").setStepSound(Block.soundTypeSand).setCreativeTab(MainRegistry.blockTab).setHardness(0.5F).setBlockTextureName(RefStrings.MODID + ":ore_tektite_osmiridium");
|
||||
impact_dirt = new BlockDirt(Material.ground, true).setBlockName("impact_dirt").setStepSound(Block.soundTypeGravel).setCreativeTab(MainRegistry.blockTab).setHardness(0.5F).setBlockTextureName(RefStrings.MODID + ":waste_earth_bottom");
|
||||
dirt_dead = new BlockGeneric(Material.ground).setBlockName("dirt_dead").setStepSound(Block.soundTypeGravel).setCreativeTab(MainRegistry.blockTab).setHardness(0.5F).setBlockTextureName(RefStrings.MODID + ":dirt_dead");
|
||||
dirt_oily = new BlockGeneric(Material.ground).setBlockName("dirt_oily").setStepSound(Block.soundTypeGravel).setCreativeTab(MainRegistry.blockTab).setHardness(0.5F).setBlockTextureName(RefStrings.MODID + ":dirt_oily");
|
||||
sand_dirty = new BlockFalling(Material.sand).setBlockName("sand_dirty").setStepSound(Block.soundTypeSand).setCreativeTab(MainRegistry.blockTab).setHardness(0.5F).setBlockTextureName(RefStrings.MODID + ":sand_dirty");
|
||||
sand_dirty_red = new BlockFalling(Material.sand).setBlockName("sand_dirty_red").setStepSound(Block.soundTypeSand).setCreativeTab(MainRegistry.blockTab).setHardness(0.5F).setBlockTextureName(RefStrings.MODID + ":sand_dirty_red");
|
||||
@ -2587,6 +2595,10 @@ public class ModBlocks {
|
||||
GameRegistry.registerBlock(fallout, ItemBlockHazard.class, fallout.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(foam_layer, foam_layer.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(sand_boron_layer, sand_boron_layer.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(burning_earth, burning_earth.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(tektite, tektite.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(ore_tektite_osmiridium, ore_tektite_osmiridium.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(impact_dirt, impact_dirt.getUnlocalizedName());
|
||||
|
||||
//RAD
|
||||
GameRegistry.registerBlock(sellafield_slaked, sellafield_slaked.getUnlocalizedName());
|
||||
|
||||
@ -2,8 +2,15 @@ package com.hbm.blocks.generic;
|
||||
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.network.NetworkManager;
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
@ -27,6 +34,12 @@ public class BlockBobble extends BlockContainer {
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) {
|
||||
int meta = MathHelper.floor_double((double)((player.rotationYaw + 180.0F) * 16.0F / 360.0F) + 0.5D) & 15;
|
||||
world.setBlockMetadataWithNotify(x, y, z, meta, 2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) {
|
||||
@ -46,14 +59,52 @@ public class BlockBobble extends BlockContainer {
|
||||
|
||||
public static class TileEntityBobble extends TileEntity {
|
||||
|
||||
public BobbleType type = BobbleType.NONE;
|
||||
|
||||
@Override
|
||||
public boolean canUpdate() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Packet getDescriptionPacket() {
|
||||
NBTTagCompound nbt = new NBTTagCompound();
|
||||
this.writeToNBT(nbt);
|
||||
return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, 0, nbt);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) {
|
||||
this.readFromNBT(pkt.func_148857_g());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
super.readFromNBT(nbt);
|
||||
this.type = BobbleType.values()[nbt.getByte("type") % BobbleType.values().length];
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbt) {
|
||||
super.writeToNBT(nbt);
|
||||
nbt.setByte("type", (byte) type.ordinal());
|
||||
}
|
||||
}
|
||||
|
||||
public static enum BobbleType {
|
||||
|
||||
NONE;
|
||||
NONE("null", "null", null, null);
|
||||
|
||||
public String name; //the title of the tooltip
|
||||
public String label; //the name engraved in the socket
|
||||
public String contribution; //what contributions this person has made, if applicable
|
||||
public String inscription; //the flavor text
|
||||
|
||||
public String name;
|
||||
public String contribution;
|
||||
public String inscription;
|
||||
private BobbleType(String name, String label, String contribution, String inscription) {
|
||||
this.name = name;
|
||||
this.label = label;
|
||||
this.contribution = contribution;
|
||||
this.inscription = inscription;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
80
src/main/java/com/hbm/blocks/generic/BlockDirt.java
Normal file
@ -0,0 +1,80 @@
|
||||
package com.hbm.blocks.generic;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.handler.radiation.ChunkRadiationManager;
|
||||
import com.hbm.interfaces.Spaghetti;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.main.ModEventHandler;
|
||||
import com.hbm.potion.HbmPotion;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockGrass;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.world.EnumSkyBlock;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
/*
|
||||
* ___________
|
||||
* / \
|
||||
* |\___________/|
|
||||
* | , |
|
||||
* | | ` |
|
||||
* | | |
|
||||
* | ' . |
|
||||
* \___________/
|
||||
*
|
||||
* PU-238
|
||||
*
|
||||
*/
|
||||
public class BlockDirt extends Block {
|
||||
|
||||
public BlockDirt(Material mat) {
|
||||
super(mat);
|
||||
}
|
||||
|
||||
public BlockDirt(Material mat, boolean tick) {
|
||||
super(mat);
|
||||
this.setTickRandomly(tick);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(int i, Random rand, int j) {
|
||||
return Item.getItemFromBlock(Blocks.dirt);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNeighborBlockChange(World world, int x, int y, int z, Block block) {
|
||||
|
||||
for(int i = -1; i < 2; i++) {
|
||||
for(int j = -1; j < 2; j++) {
|
||||
for(int k = -1; k < 2; k++) {
|
||||
Block b = world.getBlock(x + i, y + j, z + k);
|
||||
if(b instanceof BlockGrass) {
|
||||
world.setBlock(x, y, z, Blocks.dirt);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateTick(World world, int x, int y, int z, Random rand) {
|
||||
|
||||
if(!world.isRemote) {
|
||||
int light = Math.max(world.getSavedLightValue(EnumSkyBlock.Block, x, y + 1, z), (int) (world.getBlockLightValue(x, y + 1, z) * (1 - ModEventHandler.dust)));
|
||||
if(light >= 9 && ModEventHandler.fire == 0) {
|
||||
world.setBlock(x, y, z, Blocks.grass);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -11,6 +11,9 @@ import com.hbm.potion.HbmPotion;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockBush;
|
||||
import net.minecraft.block.BlockLeaves;
|
||||
import net.minecraft.block.BlockLiquid;
|
||||
import net.minecraft.block.BlockMushroom;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
@ -27,6 +30,7 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.EnumPlantType;
|
||||
import net.minecraftforge.common.IPlantable;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.BlockFluidBase;
|
||||
|
||||
public class WasteEarth extends Block {
|
||||
|
||||
@ -43,9 +47,9 @@ public class WasteEarth extends Block {
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister iconRegister) {
|
||||
this.iconTop = iconRegister.registerIcon(RefStrings.MODID + (this == ModBlocks.waste_earth ? ":waste_grass_top" : (this == ModBlocks.waste_mycelium ? ":waste_mycelium_top" : ":frozen_grass_top")));
|
||||
this.iconBottom = iconRegister.registerIcon(RefStrings.MODID + (this == ModBlocks.waste_earth ? ":waste_earth_bottom" : (this == ModBlocks.waste_mycelium ? ":waste_earth_bottom" : ":frozen_dirt")));
|
||||
this.blockIcon = iconRegister.registerIcon(RefStrings.MODID + (this == ModBlocks.waste_earth ? ":waste_grass_side" : (this == ModBlocks.waste_mycelium ? ":waste_mycelium_side" : ":frozen_grass_side")));
|
||||
this.iconTop = iconRegister.registerIcon(RefStrings.MODID + (this == ModBlocks.waste_earth ? ":waste_grass_top" : (this == ModBlocks.burning_earth ? ":burning_grass_top" : (this == ModBlocks.waste_mycelium ? ":waste_mycelium_top" : ":frozen_grass_top"))));
|
||||
this.iconBottom = iconRegister.registerIcon(RefStrings.MODID + (this == ModBlocks.waste_earth ? ":waste_earth_bottom" : (this == ModBlocks.burning_earth ? ":waste_earth_bottom" : (this == ModBlocks.waste_mycelium ? ":waste_earth_bottom" : ":frozen_dirt"))));
|
||||
this.blockIcon = iconRegister.registerIcon(RefStrings.MODID + (this == ModBlocks.waste_earth ? ":waste_grass_side" : (this == ModBlocks.burning_earth ? ":burning_grass_side" : (this == ModBlocks.waste_mycelium ? ":waste_mycelium_side" : ":frozen_grass_side"))));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -56,7 +60,8 @@ public class WasteEarth extends Block {
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) {
|
||||
if(this == ModBlocks.waste_earth || this == ModBlocks.waste_mycelium) {
|
||||
|
||||
if(this == ModBlocks.waste_earth || this == ModBlocks.waste_mycelium || this == ModBlocks.burning_earth) {
|
||||
return Item.getItemFromBlock(Blocks.dirt);
|
||||
}
|
||||
|
||||
@ -73,23 +78,35 @@ public class WasteEarth extends Block {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEntityWalking(World p_149724_1_, int p_149724_2_, int p_149724_3_, int p_149724_4_, Entity entity) {
|
||||
if(entity instanceof EntityLivingBase && this == ModBlocks.frozen_grass) {
|
||||
|
||||
((EntityLivingBase) entity).addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 2 * 60 * 20, 2));
|
||||
}
|
||||
if(entity instanceof EntityLivingBase && this == ModBlocks.waste_mycelium) {
|
||||
|
||||
((EntityLivingBase) entity).addPotionEffect(new PotionEffect(HbmPotion.radiation.id, 30 * 20, 3));
|
||||
public void onEntityWalking(World p_149724_1_, int x, int y, int z, Entity entity) {
|
||||
|
||||
if(entity instanceof EntityLivingBase) {
|
||||
|
||||
EntityLivingBase living = (EntityLivingBase) entity;
|
||||
|
||||
if(this == ModBlocks.frozen_grass) {
|
||||
living.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 2 * 60 * 20, 2));
|
||||
}
|
||||
if(this == ModBlocks.waste_mycelium) {
|
||||
living.addPotionEffect(new PotionEffect(HbmPotion.radiation.id, 30 * 20, 3));
|
||||
}
|
||||
if(this == ModBlocks.burning_earth) {
|
||||
living.setFire(5);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void randomDisplayTick(World p_149734_1_, int p_149734_2_, int p_149734_3_, int p_149734_4_, Random p_149734_5_) {
|
||||
super.randomDisplayTick(p_149734_1_, p_149734_2_, p_149734_3_, p_149734_4_, p_149734_5_);
|
||||
public void randomDisplayTick(World world, int x, int y, int z, Random rand) {
|
||||
super.randomDisplayTick(world, x, y, z, rand);
|
||||
|
||||
if(this == ModBlocks.waste_mycelium) {
|
||||
p_149734_1_.spawnParticle("townaura", p_149734_2_ + p_149734_5_.nextFloat(), p_149734_3_ + 1.1F, p_149734_4_ + p_149734_5_.nextFloat(), 0.0D, 0.0D, 0.0D);
|
||||
world.spawnParticle("townaura", x + rand.nextFloat(), y + 1.1F, z + rand.nextFloat(), 0.0D, 0.0D, 0.0D);
|
||||
}
|
||||
if(this == ModBlocks.burning_earth) {
|
||||
world.spawnParticle("flame", x + rand.nextFloat(), y + 1.1F, z + rand.nextFloat(), 0.0D, 0.0D, 0.0D);
|
||||
world.spawnParticle("smoke", x + rand.nextFloat(), y + 1.1F, z + rand.nextFloat(), 0.0D, 0.0D, 0.0D);
|
||||
}
|
||||
}
|
||||
|
||||
@ -109,6 +126,36 @@ public class WasteEarth extends Block {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(this == ModBlocks.burning_earth) {
|
||||
|
||||
for(int i = -1; i < 2; i++) {
|
||||
for(int j = -1; j < 2; j++) {
|
||||
for(int k = -1; k < 2; k++) {
|
||||
|
||||
Block b0 = world.getBlock(x + i, y + j, z + k);
|
||||
Block b1 = world.getBlock(x + i, y + j + 1, z + k);
|
||||
|
||||
if(!b1.isOpaqueCube() &&
|
||||
((b0 == Blocks.grass || b0 == Blocks.mycelium || b0 == ModBlocks.waste_earth ||
|
||||
b0 == ModBlocks.frozen_grass || b0 == ModBlocks.waste_mycelium)
|
||||
&& !world.canLightningStrikeAt(x, y, z))) {
|
||||
world.setBlock(x + i, y + j, z + k, ModBlocks.burning_earth);
|
||||
}
|
||||
if((b0 instanceof BlockLeaves || b0 instanceof BlockBush)) {
|
||||
world.setBlockToAir(x + i, y + j, z + k);
|
||||
}
|
||||
if(b0 == ModBlocks.frozen_dirt) {
|
||||
world.setBlock(x + i, y + j, z + k, Blocks.dirt);
|
||||
}
|
||||
if(b1.isFlammable(world, x, y, z, ForgeDirection.UP) && !(b1 instanceof BlockLeaves || b1 instanceof BlockBush) && world.getBlock(x, y + 1, z) == Blocks.air) {
|
||||
world.setBlock(x, y + 1, z, Blocks.fire);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
world.setBlock(x, y, z, ModBlocks.impact_dirt);
|
||||
}
|
||||
|
||||
if(this == ModBlocks.waste_earth || this == ModBlocks.waste_mycelium) {
|
||||
|
||||
@ -123,6 +170,17 @@ public class WasteEarth extends Block {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNeighborBlockChange(World world, int x, int y, int z, Block block) {
|
||||
|
||||
if(this == ModBlocks.burning_earth) {
|
||||
Block b = world.getBlock(x, y + 1, z);
|
||||
if(b instanceof BlockLiquid || b instanceof BlockFluidBase || b.isBlockNormalCube()) {
|
||||
world.setBlock(x, y, z, Blocks.dirt);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canSustainPlant(IBlockAccess world, int x, int y, int z, ForgeDirection direction, IPlantable plantable) {
|
||||
|
||||
|
||||
@ -354,6 +354,8 @@ public class MineralRecipes {
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.nugget_mercury, 8), new Object[] { "#", '#', ModItems.bottle_mercury });
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.egg_balefire, 1), new Object[] { "###", "###", "###", '#', ModItems.egg_balefire_shard });
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.egg_balefire_shard, 9), new Object[] { "#", '#', ModItems.egg_balefire });
|
||||
add1To9Pair(ModItems.powder_paleogenite, ModItems.powder_paleogenite_tiny);
|
||||
add1To9Pair(ModItems.ingot_osmiridium, ModItems.nugget_osmiridium);
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(ModBlocks.hazmat, 8), new Object[] { "###", "# #", "###", '#', ModItems.hazmat_cloth });
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.hazmat_cloth, 1), new Object[] { "#", '#', ModBlocks.hazmat });
|
||||
|
||||
@ -142,6 +142,7 @@ public class SmeltingRecipes {
|
||||
GameRegistry.addSmelting(ModItems.crystal_starmetal, new ItemStack(ModItems.ingot_starmetal, 2), 2.0F);
|
||||
GameRegistry.addSmelting(ModItems.crystal_trixite, new ItemStack(ModItems.ingot_plutonium, 4), 2.0F);
|
||||
GameRegistry.addSmelting(ModItems.crystal_cinnebar, new ItemStack(ModItems.cinnebar, 4), 2.0F);
|
||||
GameRegistry.addSmelting(ModItems.crystal_osmiridium, new ItemStack(ModItems.ingot_osmiridium, 1), 2.0F);
|
||||
|
||||
GameRegistry.addSmelting(ModItems.casing_357, new ItemStack(ModItems.ingot_copper), 0.1F);
|
||||
GameRegistry.addSmelting(ModItems.casing_44, new ItemStack(ModItems.ingot_copper), 0.1F);
|
||||
|
||||
@ -6,6 +6,7 @@ import com.hbm.config.GeneralConfig;
|
||||
import com.hbm.explosion.ExplosionNukeGeneric;
|
||||
import com.hbm.explosion.ExplosionTom;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.saveddata.TomSaveData;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
@ -71,6 +72,11 @@ public class EntityTomBlast extends Entity {
|
||||
|
||||
if(flag) {
|
||||
this.setDead();
|
||||
TomSaveData data = TomSaveData.forWorld(worldObj);
|
||||
NBTTagCompound tag = data.getData();
|
||||
tag.setBoolean("impact", true);
|
||||
tag.setFloat("fire", 1);
|
||||
data.markDirty();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
package com.hbm.explosion;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
@ -105,7 +107,22 @@ public class ExplosionTom
|
||||
if(y == 0)
|
||||
break;
|
||||
|
||||
worldObj.setBlockToAir(pX, y, pZ);
|
||||
if(y <= threshold + 2 && worldObj.getBlock(pX, y, pZ) != Blocks.air) {
|
||||
|
||||
if(worldObj.rand.nextInt(499) < 1) {
|
||||
worldObj.setBlock(pX, y, pZ, ModBlocks.ore_tektite_osmiridium);
|
||||
} else {
|
||||
worldObj.setBlock(pX, y, pZ, ModBlocks.tektite);
|
||||
}
|
||||
|
||||
} else {
|
||||
if(y > 16) {
|
||||
worldObj.setBlockToAir(pX, y, pZ);
|
||||
} else {
|
||||
worldObj.setBlock(pX, y, pZ, Blocks.lava, 0, 2);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
y--;
|
||||
}
|
||||
|
||||
@ -94,7 +94,8 @@ public class FluidTypeHandler {
|
||||
PLASMA_BF (0xA7F1A3, 12, 1, 2, 4, 5, 4, EnumSymbol.ANTIMATTER, "hbmfluid.plasma_bf", 8500, FluidTrait.NO_CONTAINER, FluidTrait.NO_ID),
|
||||
PLASMA_DH3 (0xFF83AA, 6, 2, 2, 0, 4, 0, EnumSymbol.RADIATION, "hbmfluid.plasma_dh3", 3480, FluidTrait.NO_CONTAINER, FluidTrait.NO_ID),
|
||||
|
||||
HELIUM3 (0xFCF0C4, 7, 2, 2, 3, 4, 0, EnumSymbol.ASPHYXIANT, "hbmfluid.helium3");
|
||||
HELIUM3 (0xFCF0C4, 7, 2, 2, 3, 4, 0, EnumSymbol.ASPHYXIANT, "hbmfluid.helium3"),
|
||||
DEATH (0x717A88, 8, 2, 2, 2, 0, 1, EnumSymbol.ACID, "hbmfluid.death", 300, FluidTrait.CORROSIVE_2);
|
||||
|
||||
|
||||
//Approximate HEX Color of the fluid, used for pipe rendering
|
||||
|
||||
112
src/main/java/com/hbm/handler/ImpactWorldHandler.java
Normal file
@ -0,0 +1,112 @@
|
||||
package com.hbm.handler;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.main.ModEventHandler;
|
||||
import com.hbm.saveddata.TomSaveData;
|
||||
import com.hbm.world.WorldProviderNTM;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
|
||||
import net.minecraft.block.BlockBush;
|
||||
import net.minecraft.block.BlockLeaves;
|
||||
import net.minecraft.block.BlockLog;
|
||||
import net.minecraft.block.BlockVine;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.world.ChunkCoordIntPair;
|
||||
import net.minecraft.world.EnumSkyBlock;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.WorldServer;
|
||||
import net.minecraft.world.chunk.Chunk;
|
||||
import net.minecraft.world.gen.ChunkProviderServer;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class ImpactWorldHandler {
|
||||
|
||||
public static void impactEffects(World world) {
|
||||
|
||||
if(!(world instanceof WorldServer))
|
||||
return;
|
||||
|
||||
if(!(world.provider.dimensionId == 0)) {
|
||||
return;
|
||||
}
|
||||
|
||||
WorldServer serv = (WorldServer) world;
|
||||
|
||||
ChunkProviderServer provider = (ChunkProviderServer) serv.getChunkProvider();
|
||||
Random rand = new Random();
|
||||
List<Chunk> list = serv.theChunkProviderServer.loadedChunks;
|
||||
int listSize = list.size();
|
||||
|
||||
if(listSize > 0) {
|
||||
for(int i = 0; i < 3; i++) {
|
||||
|
||||
Chunk chunk = list.get(serv.rand.nextInt(listSize));
|
||||
ChunkCoordIntPair coord = chunk.getChunkCoordIntPair();
|
||||
|
||||
for(int x = 0; x < 16; x++) {
|
||||
for(int z = 0; z < 16; z++) {
|
||||
|
||||
int X = coord.getCenterXPos() - 8 + x;
|
||||
int Z = coord.getCenterZPosition() - 8 + z;
|
||||
int Y = world.getHeightValue(X, Z) - world.rand.nextInt(Math.max(1, world.getHeightValue(X, Z)));
|
||||
int Y2 = world.getHeightValue(X, Z) - world.rand.nextInt(2);
|
||||
|
||||
die(world, X, Y, Z);
|
||||
if(TomSaveData.fire > 0 || ModEventHandler.fire > 0) {
|
||||
burn(world, X, Y, Z);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Plants die without sufficient light.
|
||||
public static void die(World world, int x, int y, int z) {
|
||||
|
||||
int light = Math.max(world.getSavedLightValue(EnumSkyBlock.Block, x, y + 1, z), (int) (world.getBlockLightValue(x, y + 1, z) * (1 - ModEventHandler.dust)));
|
||||
|
||||
if(world.getBlock(x, y, z) == Blocks.grass) {
|
||||
if(light < 4)
|
||||
world.setBlock(x, y, z, Blocks.dirt);
|
||||
|
||||
} else if(world.getBlock(x, y, z) instanceof BlockBush) {
|
||||
if(light < 4)
|
||||
world.setBlock(x, y, z, Blocks.air);
|
||||
|
||||
} else if(world.getBlock(x, y, z) instanceof BlockLeaves) {
|
||||
if(light < 4)
|
||||
world.setBlock(x, y, z, Blocks.air);
|
||||
|
||||
} else if(world.getBlock(x, y, z) instanceof BlockVine) {
|
||||
if(light < 4)
|
||||
world.setBlock(x, y, z, Blocks.air);
|
||||
}
|
||||
}
|
||||
|
||||
/// Burn the world.
|
||||
public static void burn(World world, int x, int y, int z) {
|
||||
|
||||
Block b = world.getBlock(x, y, z);
|
||||
if(b.isFlammable(world, x, y, z, ForgeDirection.UP) && world.getBlock(x, y + 1, z) == Blocks.air && world.getSavedLightValue(EnumSkyBlock.Sky, x, y + 1, z) >= 7) {
|
||||
if(b instanceof BlockLeaves || b instanceof BlockBush) {
|
||||
world.setBlockToAir(x, y, z);
|
||||
}
|
||||
world.setBlock(x, y + 1, z, Blocks.fire);
|
||||
|
||||
} else if((b == Blocks.grass || b == Blocks.mycelium || b == ModBlocks.waste_earth || b == ModBlocks.frozen_grass || b == ModBlocks.waste_mycelium) &&
|
||||
!world.canLightningStrikeAt(x, y, z) && world.getSavedLightValue(EnumSkyBlock.Sky, x, y + 1, z) >= 7) {
|
||||
world.setBlock(x, y, z, ModBlocks.burning_earth);
|
||||
|
||||
} else if(b == ModBlocks.frozen_dirt && world.getSavedLightValue(EnumSkyBlock.Sky, x, y + 1, z) >= 7) {
|
||||
world.setBlock(x, y, z, Blocks.dirt);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -149,6 +149,7 @@ public class OreDictManager {
|
||||
public static final DictFrame DNT = new DictFrame("Dineutronium");
|
||||
public static final DictFrame FIBER = new DictFrame("Fiberglass");
|
||||
public static final DictFrame ASBESTOS = new DictFrame("Asbestos");
|
||||
public static final DictFrame OSMIRIDIUM = new DictFrame("Osmiridium");
|
||||
/*
|
||||
* DUST AND GEM ORES
|
||||
*/
|
||||
@ -281,6 +282,7 @@ public class OreDictManager {
|
||||
DNT .nugget(nugget_dineutronium) .ingot(ingot_dineutronium) .dust(powder_dineutronium) .block(block_dineutronium);
|
||||
FIBER .ingot(ingot_fiberglass) .block(block_fiberglass);
|
||||
ASBESTOS .asbestos(1F) .ingot(ingot_asbestos) .dust(powder_asbestos) .block(block_asbestos) .ore(ore_asbestos, ore_gneiss_asbestos, basalt_asbestos);
|
||||
OSMIRIDIUM .nugget(nugget_osmiridium) .ingot(ingot_osmiridium);
|
||||
|
||||
/*
|
||||
* DUST AND GEM ORES
|
||||
|
||||
@ -209,6 +209,12 @@ public class CentrifugeRecipes {
|
||||
new ItemStack(ModItems.powder_copper, 1),
|
||||
new ItemStack(Blocks.gravel, 1) });
|
||||
|
||||
recipes.put(new ComparableStack(ModItems.powder_tektite), new ItemStack[] {
|
||||
new ItemStack(ModItems.powder_meteorite_tiny, 1),
|
||||
new ItemStack(ModItems.powder_paleogenite_tiny, 1),
|
||||
new ItemStack(ModItems.powder_meteorite_tiny, 1),
|
||||
new ItemStack(ModItems.dust, 6) });
|
||||
|
||||
List<ItemStack> quartz = OreDictionary.getOres("crystalCertusQuartz");
|
||||
|
||||
if(quartz != null && !quartz.isEmpty()) {
|
||||
|
||||
@ -77,6 +77,8 @@ public class CrystallizerRecipes {
|
||||
|
||||
recipes.put(new ComparableStack(ModItems.meteorite_sword_treated), new ItemStack(ModItems.meteorite_sword_etched, 1));
|
||||
|
||||
recipes.put(new ComparableStack(ModItems.powder_impure_osmiridium), new ItemStack(ModItems.crystal_osmiridium));
|
||||
|
||||
List<ItemStack> quartz = OreDictionary.getOres("crystalCertusQuartz");
|
||||
|
||||
if(quartz != null && !quartz.isEmpty()) {
|
||||
|
||||
@ -1469,6 +1469,11 @@ public class MachineRecipes {
|
||||
case HELIUM3:
|
||||
list.add(new ItemStack(ModBlocks.moon_turf, 8));
|
||||
break;
|
||||
case OSMIRIDIUM_DEATH:
|
||||
list.add(new ItemStack(ModItems.powder_paleogenite, 1));
|
||||
list.add(new ItemStack(ModItems.fluorite, 8));
|
||||
list.add(new ItemStack(ModItems.nugget_bismuth, 4));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -1715,6 +1720,9 @@ public class MachineRecipes {
|
||||
input[0] = new FluidStack(100, FluidType.PETROLEUM);
|
||||
input[1] = new FluidStack(1000, FluidType.WATER);
|
||||
break;
|
||||
case OSMIRIDIUM_DEATH:
|
||||
input[0] = new FluidStack(1000, FluidType.ACID);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -2021,6 +2029,9 @@ public class MachineRecipes {
|
||||
break;
|
||||
case HELIUM3:
|
||||
output[0] = new FluidStack(1000, FluidType.HELIUM3);
|
||||
case OSMIRIDIUM_DEATH:
|
||||
output[0] = new FluidStack(1000, FluidType.DEATH);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
@ -76,6 +76,10 @@ public class SILEXRecipes {
|
||||
.addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_cobalt), 3))
|
||||
);
|
||||
|
||||
recipes.put(new ComparableStack(ModItems.fluid_icon, 1, FluidType.DEATH.ordinal()), new SILEXRecipe(1000, 1000)
|
||||
.addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_impure_osmiridium), 1))
|
||||
);
|
||||
|
||||
for(int i = 0; i < 5; i++) {
|
||||
|
||||
// UEU //
|
||||
|
||||
@ -173,6 +173,7 @@ public class ShredderRecipes {
|
||||
ShredderRecipes.setRecipe(Items.reeds, new ItemStack(Items.paper, 3));
|
||||
ShredderRecipes.setRecipe(Items.fermented_spider_eye, new ItemStack(ModItems.powder_poison, 3));
|
||||
ShredderRecipes.setRecipe(Items.poisonous_potato, new ItemStack(ModItems.powder_poison, 1));
|
||||
ShredderRecipes.setRecipe(ModBlocks.ore_tektite_osmiridium, new ItemStack(ModItems.powder_tektite, 1));
|
||||
|
||||
for(int i = 0; i < 5; i++) ShredderRecipes.setRecipe(new ItemStack(Items.skull, 1, i), new ItemStack(ModItems.biomass));
|
||||
|
||||
|
||||
@ -244,6 +244,8 @@ public class ModItems {
|
||||
public static Item ingot_tantalium;
|
||||
public static Item nugget_tantalium;
|
||||
public static Item ingot_niobium;
|
||||
public static Item ingot_osmiridium;
|
||||
public static Item nugget_osmiridium;
|
||||
public static Item plate_lead;
|
||||
public static Item nugget_schrabidium;
|
||||
public static Item plate_schrabidium;
|
||||
@ -335,6 +337,7 @@ public class ModItems {
|
||||
public static Item crystal_starmetal;
|
||||
public static Item crystal_cinnebar;
|
||||
public static Item crystal_trixite;
|
||||
public static Item crystal_osmiridium;
|
||||
|
||||
public static Item gem_tantalium;
|
||||
public static Item gem_volcanic;
|
||||
@ -423,6 +426,10 @@ public class ModItems {
|
||||
|
||||
public static Item powder_coltan_ore;
|
||||
public static Item powder_coltan;
|
||||
public static Item powder_tektite;
|
||||
public static Item powder_paleogenite;
|
||||
public static Item powder_paleogenite_tiny;
|
||||
public static Item powder_impure_osmiridium;
|
||||
|
||||
public static Item powder_lanthanium;
|
||||
public static Item powder_actinium;
|
||||
@ -2717,7 +2724,9 @@ public class ModItems {
|
||||
ingot_tantalium = new ItemCustomLore().setUnlocalizedName("ingot_tantalium").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":ingot_tantalium");
|
||||
nugget_tantalium = new ItemCustomLore().setUnlocalizedName("nugget_tantalium").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":nugget_tantalium");
|
||||
ingot_niobium = new Item().setUnlocalizedName("ingot_niobium").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":ingot_niobium");
|
||||
nugget_schrabidium = new ItemHazard(ItemHazard.sa326 * ItemHazard.nugget, false, true).setUnlocalizedName("nugget_schrabidium").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":nugget_schrabidium");
|
||||
ingot_osmiridium = new Item().setUnlocalizedName("ingot_osmiridium").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":ingot_osmiridium");
|
||||
nugget_osmiridium = new Item().setUnlocalizedName("nugget_osmiridium").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":nugget_osmiridium");
|
||||
nugget_schrabidium = new Item().setUnlocalizedName("nugget_schrabidium").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":nugget_schrabidium");
|
||||
nugget_beryllium = new Item().setUnlocalizedName("nugget_beryllium").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":nugget_beryllium");
|
||||
hazmat_cloth = new Item().setUnlocalizedName("hazmat_cloth").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":hazmat_cloth");
|
||||
hazmat_cloth_red = new Item().setUnlocalizedName("hazmat_cloth_red").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":hazmat_cloth_red");
|
||||
@ -2727,10 +2736,10 @@ public class ModItems {
|
||||
rag_damp = new Item().setUnlocalizedName("rag_damp").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":rag_damp");
|
||||
rag_piss = new Item().setUnlocalizedName("rag_piss").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":rag_piss");
|
||||
filter_coal = new Item().setUnlocalizedName("filter_coal").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":filter_coal");
|
||||
ingot_hes = new ItemHazard(ItemHazard.saf * ItemHazard.ingot, false, true).setUnlocalizedName("ingot_hes").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":ingot_hes");
|
||||
ingot_les = new ItemHazard(ItemHazard.saf * ItemHazard.ingot, false, true).setUnlocalizedName("ingot_les").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":ingot_les");
|
||||
nugget_hes = new ItemHazard(ItemHazard.saf * ItemHazard.nugget, false, true).setUnlocalizedName("nugget_hes").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":nugget_hes");
|
||||
nugget_les = new ItemHazard(ItemHazard.saf * ItemHazard.nugget, false, true).setUnlocalizedName("nugget_les").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":nugget_les");
|
||||
ingot_hes = new Item().setUnlocalizedName("ingot_hes").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":ingot_hes");
|
||||
ingot_les = new Item().setUnlocalizedName("ingot_les").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":ingot_les");
|
||||
nugget_hes = new Item().setUnlocalizedName("nugget_hes").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":nugget_hes");
|
||||
nugget_les = new Item().setUnlocalizedName("nugget_les").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":nugget_les");
|
||||
plate_combine_steel = new Item().setUnlocalizedName("plate_combine_steel").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":plate_combine_steel");
|
||||
|
||||
crystal_coal = new Item().setUnlocalizedName("crystal_coal").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":crystal_coal");
|
||||
@ -2760,6 +2769,7 @@ public class ModItems {
|
||||
crystal_starmetal = new Item().setUnlocalizedName("crystal_starmetal").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":crystal_starmetal");
|
||||
crystal_cinnebar = new Item().setUnlocalizedName("crystal_cinnebar").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":crystal_cinnebar");
|
||||
crystal_trixite = new ItemHazard().addRadiation(ItemHazard.trx * ItemHazard.crystal).toItem().setUnlocalizedName("crystal_trixite").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":crystal_trixite");
|
||||
crystal_osmiridium = new Item().setUnlocalizedName("crystal_osmiridium").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":crystal_osmiridium");
|
||||
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");
|
||||
|
||||
@ -2852,7 +2862,11 @@ public class ModItems {
|
||||
powder_balefire = new ItemHazard().addRadiation(500F).addFire(5).toItem().setUnlocalizedName("powder_balefire").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":powder_balefire");
|
||||
powder_coltan_ore = new ItemHazard().addAsbestos(3).toItem().setUnlocalizedName("powder_coltan_ore").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":powder_coltan_ore");
|
||||
powder_coltan = new Item().setUnlocalizedName("powder_coltan").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":powder_coltan");
|
||||
|
||||
powder_tektite = new Item().setUnlocalizedName("powder_tektite").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":powder_tektite");
|
||||
powder_paleogenite = new Item().setUnlocalizedName("powder_paleogenite").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":powder_paleogenite");
|
||||
powder_paleogenite_tiny = new Item().setUnlocalizedName("powder_paleogenite_tiny").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":powder_paleogenite_tiny");
|
||||
powder_impure_osmiridium = new Item().setUnlocalizedName("powder_impure_osmiridium").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":powder_impure_osmiridium");
|
||||
|
||||
fragment_neodymium = new Item().setUnlocalizedName("fragment_neodymium").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":fragment_neodymium");
|
||||
fragment_cobalt = new Item().setUnlocalizedName("fragment_cobalt").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":fragment_cobalt");
|
||||
fragment_niobium = new Item().setUnlocalizedName("fragment_niobium").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":fragment_niobium");
|
||||
@ -5493,6 +5507,7 @@ public class ModItems {
|
||||
GameRegistry.registerItem(ingot_dineutronium, ingot_dineutronium.getUnlocalizedName());
|
||||
GameRegistry.registerItem(ingot_electronium, ingot_electronium.getUnlocalizedName());
|
||||
GameRegistry.registerItem(ingot_smore, ingot_smore.getUnlocalizedName());
|
||||
GameRegistry.registerItem(ingot_osmiridium, ingot_osmiridium.getUnlocalizedName());
|
||||
|
||||
//Meteorite Ingots
|
||||
GameRegistry.registerItem(ingot_steel_dusted, ingot_steel_dusted.getUnlocalizedName());
|
||||
@ -5603,6 +5618,10 @@ public class ModItems {
|
||||
GameRegistry.registerItem(powder_lead, powder_lead.getUnlocalizedName());
|
||||
GameRegistry.registerItem(powder_coltan_ore, powder_coltan_ore.getUnlocalizedName());
|
||||
GameRegistry.registerItem(powder_coltan, powder_coltan.getUnlocalizedName());
|
||||
GameRegistry.registerItem(powder_tektite, powder_tektite.getUnlocalizedName());
|
||||
GameRegistry.registerItem(powder_paleogenite, powder_paleogenite.getUnlocalizedName());
|
||||
GameRegistry.registerItem(powder_paleogenite_tiny, powder_paleogenite_tiny.getUnlocalizedName());
|
||||
GameRegistry.registerItem(powder_impure_osmiridium, powder_impure_osmiridium.getUnlocalizedName());
|
||||
GameRegistry.registerItem(powder_tantalium, powder_tantalium.getUnlocalizedName());
|
||||
GameRegistry.registerItem(powder_yellowcake, powder_yellowcake.getUnlocalizedName());
|
||||
GameRegistry.registerItem(powder_beryllium, powder_beryllium.getUnlocalizedName());
|
||||
@ -5699,6 +5718,7 @@ public class ModItems {
|
||||
GameRegistry.registerItem(crystal_starmetal, crystal_starmetal.getUnlocalizedName());
|
||||
GameRegistry.registerItem(crystal_cinnebar, crystal_cinnebar.getUnlocalizedName());
|
||||
GameRegistry.registerItem(crystal_trixite, crystal_trixite.getUnlocalizedName());
|
||||
GameRegistry.registerItem(crystal_osmiridium, crystal_osmiridium.getUnlocalizedName());
|
||||
GameRegistry.registerItem(gem_tantalium, gem_tantalium.getUnlocalizedName());
|
||||
GameRegistry.registerItem(gem_volcanic, gem_volcanic.getUnlocalizedName());
|
||||
|
||||
@ -5765,6 +5785,7 @@ public class ModItems {
|
||||
GameRegistry.registerItem(nugget_desh, nugget_desh.getUnlocalizedName());
|
||||
GameRegistry.registerItem(nugget_euphemium, nugget_euphemium.getUnlocalizedName());
|
||||
GameRegistry.registerItem(nugget_dineutronium, nugget_dineutronium.getUnlocalizedName());
|
||||
GameRegistry.registerItem(nugget_osmiridium, nugget_osmiridium.getUnlocalizedName());
|
||||
|
||||
//Plates
|
||||
GameRegistry.registerItem(plate_iron, plate_iron.getUnlocalizedName());
|
||||
|
||||
@ -103,7 +103,8 @@ public class ItemChemistryTemplate extends Item {
|
||||
TEL,
|
||||
GASOLINE,
|
||||
FRACKSOL,
|
||||
HELIUM3;
|
||||
HELIUM3,
|
||||
OSMIRIDIUM_DEATH;
|
||||
|
||||
public static EnumChemistryTemplate getEnum(int i) {
|
||||
if(i < EnumChemistryTemplate.values().length)
|
||||
@ -303,6 +304,8 @@ public class ItemChemistryTemplate extends Item {
|
||||
return 20;
|
||||
case HELIUM3:
|
||||
return 200;
|
||||
case OSMIRIDIUM_DEATH:
|
||||
return 240;
|
||||
default:
|
||||
return 100;
|
||||
}
|
||||
|
||||
@ -692,10 +692,10 @@ public class CraftingManager {
|
||||
addShapelessAuto(new ItemStack(ModItems.ams_catalyst_schrabidium, 1), new Object[] { ModItems.ams_catalyst_blank, ModItems.rune_dagaz, ModItems.rune_hagalaz, ModItems.rune_thurisaz, ModItems.rune_thurisaz, SA326.dust(), SA326.dust(), SA326.dust(), SA326.dust() });
|
||||
addShapelessAuto(new ItemStack(ModItems.ams_catalyst_dineutronium, 1), new Object[] { ModItems.ams_catalyst_blank, ModItems.rune_hagalaz, ModItems.rune_hagalaz, ModItems.rune_thurisaz, ModItems.rune_thurisaz, DNT.dust(), DNT.dust(), DNT.dust(), DNT.dust() });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.dfc_core, 1), new Object[] { "DLD", "LML", "DLD", 'D', ModItems.ingot_bismuth, 'L', DNT.block(), 'M', ModItems.circuit_bismuth });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.dfc_emitter, 1), new Object[] { "SDS", "TXL", "SDS", 'S', STAR.ingot(), 'D', ModItems.plate_desh, 'T', ModBlocks.machine_transformer_dnt, 'X', ModItems.crystal_xen, 'L', ModItems.sat_head_laser });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.dfc_receiver, 1), new Object[] { "SDS", "TXL", "SDS", 'S', STAR.ingot(), 'D', ModItems.plate_desh, 'T', ModBlocks.machine_transformer_dnt, 'X', ModBlocks.sellafield_core, 'L', ModItems.hull_small_steel });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.dfc_injector, 1), new Object[] { "SDS", "TXL", "SDS", 'S', STAR.ingot(), 'D', CMB.plate(), 'T', ModBlocks.machine_fluidtank, 'X', ModItems.motor, 'L', ModItems.pipes_steel });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.dfc_stabilizer, 1), new Object[] { "SDS", "TXL", "SDS", 'S', STAR.ingot(), 'D', ModItems.plate_desh, 'T', ModItems.singularity_spark, 'X', ModItems.magnet_circular, 'L', ModItems.crystal_xen });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.dfc_emitter, 1), new Object[] { "SDS", "TXL", "SDS", 'S', OSMIRIDIUM.ingot(), 'D', ModItems.plate_desh, 'T', ModBlocks.machine_transformer_dnt, 'X', ModItems.crystal_xen, 'L', ModItems.sat_head_laser });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.dfc_receiver, 1), new Object[] { "SDS", "TXL", "SDS", 'S', OSMIRIDIUM.ingot(), 'D', ModItems.plate_desh, 'T', ModBlocks.machine_transformer_dnt, 'X', ModBlocks.sellafield_core, 'L', ModItems.hull_small_steel });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.dfc_injector, 1), new Object[] { "SDS", "TXL", "SDS", 'S', OSMIRIDIUM.ingot(), 'D', CMB.plate(), 'T', ModBlocks.machine_fluidtank, 'X', ModItems.motor, 'L', ModItems.pipes_steel });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.dfc_stabilizer, 1), new Object[] { "SDS", "TXL", "SDS", 'S', OSMIRIDIUM.ingot(), 'D', ModItems.plate_desh, 'T', ModItems.singularity_spark, 'X', ModItems.magnet_circular, 'L', ModItems.crystal_xen });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.barrel_plastic, 1), new Object[] { "IPI", "I I", "IPI", 'I', ModItems.plate_polymer, 'P', AL.plate() });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.barrel_iron, 1), new Object[] { "IPI", "I I", "IPI", 'I', IRON.plate(), 'P', IRON.ingot() });
|
||||
addShapelessAuto(new ItemStack(ModBlocks.barrel_iron, 1), new Object[] { ModBlocks.barrel_corroded, ModItems.oil_tar });
|
||||
|
||||
@ -50,12 +50,15 @@ import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.packet.PlayerInformPacket;
|
||||
import com.hbm.potion.HbmPotion;
|
||||
import com.hbm.saveddata.AuxSavedData;
|
||||
import com.hbm.saveddata.TomSaveData;
|
||||
import com.hbm.util.ArmorUtil;
|
||||
import com.hbm.util.ContaminationUtil;
|
||||
import com.hbm.util.EnchantmentUtil;
|
||||
import com.hbm.util.EntityDamageUtil;
|
||||
import com.hbm.world.WorldProviderNTM;
|
||||
import com.hbm.world.generator.TimedGenerator;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.Event.Result;
|
||||
import cpw.mods.fml.common.eventhandler.EventPriority;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.gameevent.PlayerEvent;
|
||||
@ -67,6 +70,12 @@ import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import cpw.mods.fml.relauncher.ReflectionHelper;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockBush;
|
||||
import net.minecraft.block.BlockCrops;
|
||||
import net.minecraft.block.BlockDoor;
|
||||
import net.minecraft.block.BlockLeaves;
|
||||
import net.minecraft.block.BlockLog;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.enchantment.Enchantment;
|
||||
import net.minecraft.enchantment.EnchantmentHelper;
|
||||
@ -83,6 +92,7 @@ import net.minecraft.entity.passive.EntityAnimal;
|
||||
import net.minecraft.entity.passive.EntityCow;
|
||||
import net.minecraft.entity.passive.EntityMooshroom;
|
||||
import net.minecraft.entity.passive.EntityVillager;
|
||||
import net.minecraft.entity.passive.EntityWaterMob;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.event.ClickEvent;
|
||||
@ -104,12 +114,16 @@ import net.minecraft.util.FoodStats;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.chunk.Chunk;
|
||||
import net.minecraft.world.chunk.storage.ExtendedBlockStorage;
|
||||
import net.minecraftforge.common.DimensionManager;
|
||||
import net.minecraftforge.common.util.FakePlayer;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.event.AnvilUpdateEvent;
|
||||
import net.minecraftforge.event.ServerChatEvent;
|
||||
import net.minecraftforge.event.entity.EntityEvent;
|
||||
import net.minecraftforge.event.entity.EntityEvent.EnteringChunk;
|
||||
import net.minecraftforge.event.entity.EntityJoinWorldEvent;
|
||||
import net.minecraftforge.event.entity.item.ItemTossEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingAttackEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingDeathEvent;
|
||||
@ -122,11 +136,22 @@ import net.minecraftforge.event.entity.living.LivingSpawnEvent;
|
||||
import net.minecraftforge.event.entity.player.PlayerFlyableFallEvent;
|
||||
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
|
||||
import net.minecraftforge.event.entity.player.PlayerUseItemEvent;
|
||||
import net.minecraftforge.event.terraingen.BiomeEvent;
|
||||
import net.minecraftforge.event.terraingen.DecorateBiomeEvent;
|
||||
import net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType;
|
||||
import net.minecraftforge.event.terraingen.PopulateChunkEvent;
|
||||
import net.minecraftforge.event.entity.player.PlayerInteractEvent.Action;
|
||||
import net.minecraftforge.event.world.BlockEvent.BreakEvent;
|
||||
import net.minecraftforge.event.world.WorldEvent;
|
||||
|
||||
public class ModEventHandler {
|
||||
static Random rand = new Random();
|
||||
|
||||
//////////////////////////////////////////
|
||||
private static Random rand = new Random();
|
||||
public static float dust;
|
||||
public static float fire;
|
||||
public static boolean impact;
|
||||
//////////////////////////////////////////
|
||||
|
||||
@SubscribeEvent
|
||||
public void onPlayerLogin(PlayerEvent.PlayerLoggedInEvent event) {
|
||||
@ -515,6 +540,174 @@ public class ModEventHandler {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//TODO: move all of this insto its own event handler
|
||||
/// TOM STUFF ///
|
||||
/// TOM STUFF ///
|
||||
/// TOM STUFF ///
|
||||
@SubscribeEvent(priority = EventPriority.LOWEST)
|
||||
public void onLoad(WorldEvent.Load event) {
|
||||
DimensionManager.unregisterProviderType(0);
|
||||
DimensionManager.registerProviderType(0, WorldProviderNTM.class, true);
|
||||
}
|
||||
|
||||
@SubscribeEvent(priority = EventPriority.LOWEST)
|
||||
public void onUnload(WorldEvent.Unload event) {
|
||||
// We don't want Tom's impact data transferring between worlds.
|
||||
TomSaveData data = TomSaveData.forWorld(event.world);
|
||||
this.fire = 0;
|
||||
this.dust = 0;
|
||||
this.impact = false;
|
||||
data.fire = 0;
|
||||
data.dust = 0;
|
||||
data.impact = false;
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void extinction(EntityJoinWorldEvent event) {
|
||||
if(impact == true) {
|
||||
if(!(event.entity instanceof EntityPlayer) && event.entity instanceof EntityLivingBase) {
|
||||
EntityLivingBase living = (EntityLivingBase) event.entity;
|
||||
if(event.world.provider.dimensionId == 0) {
|
||||
if(event.entity.height >= 0.85f || event.entity.width >= 0.85f && event.entity.ticksExisted < 20 && !(event.entity instanceof EntityWaterMob) && !living.isChild()) {
|
||||
event.setCanceled(true);
|
||||
}
|
||||
}
|
||||
if(event.entity instanceof EntityWaterMob && event.entity.ticksExisted < 20) {
|
||||
Random rand = new Random();
|
||||
if(rand.nextInt(9) != 0) {
|
||||
event.setCanceled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void villages(BiomeEvent.GetVillageBlockID event) {
|
||||
Block b = event.original;
|
||||
Material mat = event.original.getMaterial();
|
||||
|
||||
if(event.biome == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
if(impact == true) {
|
||||
if(mat == Material.wood || mat == Material.glass || b == Blocks.ladder || b instanceof BlockCrops ||
|
||||
b == Blocks.chest || b instanceof BlockDoor || mat == Material.cloth || mat == Material.water) {
|
||||
event.replacement = Blocks.air;
|
||||
|
||||
} else if(b == Blocks.cobblestone || b == Blocks.stonebrick) {
|
||||
if(rand.nextInt(3) == 1) {
|
||||
event.replacement = Blocks.gravel;
|
||||
}
|
||||
} else if(b == Blocks.sandstone) {
|
||||
if(rand.nextInt(3) == 1) {
|
||||
event.replacement = Blocks.sand;
|
||||
}
|
||||
} else if(b == Blocks.farmland) {
|
||||
event.replacement = Blocks.dirt;
|
||||
}
|
||||
}
|
||||
|
||||
if(event.replacement != null) {
|
||||
event.setResult(Result.DENY);
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void postImpactGeneration(BiomeEvent event) {
|
||||
/// Disables post-impact surface replacement for superflat worlds
|
||||
/// because they are retarded and crash with a NullPointerException if
|
||||
/// you try to look for biome-specific blocks.
|
||||
if(event.biome != null) {
|
||||
if(event.biome.topBlock != null) {
|
||||
if(event.biome.topBlock == Blocks.grass) {
|
||||
if(impact == true && (dust > 0 || fire > 0)) {
|
||||
// if(dust > 0 || fire > 0)
|
||||
// {
|
||||
final Block newtop = ModBlocks.impact_dirt;
|
||||
event.biome.topBlock = newtop;
|
||||
/*
|
||||
* } else { event.biome.topBlock=Blocks.grass; }
|
||||
*/
|
||||
} else {
|
||||
event.biome.topBlock = Blocks.grass;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void postImpactDecoration(DecorateBiomeEvent.Decorate event) {
|
||||
|
||||
if(impact == true) {
|
||||
EventType type = event.type;
|
||||
|
||||
if(dust > 0 || fire > 0) {
|
||||
if(type == event.type.TREE || type == event.type.BIG_SHROOM || type == event.type.GRASS || type == event.type.REED || type == event.type.FLOWERS || type == event.type.DEAD_BUSH
|
||||
|| type == event.type.CACTUS || type == event.type.PUMPKIN || type == event.type.LILYPAD) {
|
||||
event.setResult(Result.DENY);
|
||||
}
|
||||
|
||||
} else if(dust == 0 && fire == 0) {
|
||||
if(type == event.type.TREE || type == event.type.BIG_SHROOM || type == event.type.CACTUS) {
|
||||
if(event.world.rand.nextInt(9) == 0) {
|
||||
event.setResult(Result.DEFAULT);
|
||||
} else {
|
||||
event.setResult(Result.DENY);
|
||||
}
|
||||
}
|
||||
|
||||
if(type == event.type.GRASS || type == event.type.REED) {
|
||||
event.setResult(Result.DEFAULT);
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
event.setResult(Result.DEFAULT);
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void populateChunk(PopulateChunkEvent.Post event) {
|
||||
if(impact == true) {
|
||||
Chunk chunk = event.world.getChunkFromChunkCoords(event.chunkX, event.chunkZ);
|
||||
|
||||
for(ExtendedBlockStorage storage : chunk.getBlockStorageArray()) {
|
||||
|
||||
if(storage != null) {
|
||||
|
||||
for(int x = 0; x < 16; ++x) {
|
||||
for(int y = 0; y < 16; ++y) {
|
||||
for(int z = 0; z < 16; ++z) {
|
||||
|
||||
if(dust > 0.25 || fire > 0) {
|
||||
if(storage.getBlockByExtId(x, y, z) == Blocks.grass) {
|
||||
storage.func_150818_a(x, y, z, ModBlocks.impact_dirt);
|
||||
} else if(storage.getBlockByExtId(x, y, z) instanceof BlockLog) {
|
||||
storage.func_150818_a(x, y, z, Blocks.air);
|
||||
} else if(storage.getBlockByExtId(x, y, z) instanceof BlockLeaves) {
|
||||
storage.func_150818_a(x, y, z, Blocks.air);
|
||||
} else if(storage.getBlockByExtId(x, y, z).getMaterial() == Material.leaves) {
|
||||
storage.func_150818_a(x, y, z, Blocks.air);
|
||||
} else if(storage.getBlockByExtId(x, y, z).getMaterial() == Material.plants) {
|
||||
storage.func_150818_a(x, y, z, Blocks.air);
|
||||
} else if(storage.getBlockByExtId(x, y, z) instanceof BlockBush) {
|
||||
storage.func_150818_a(x, y, z, Blocks.air);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/// TOM STUFF ///
|
||||
/// TOM STUFF ///
|
||||
/// TOM STUFF ///
|
||||
|
||||
@SubscribeEvent
|
||||
public void worldTick(WorldTickEvent event) {
|
||||
|
||||
@ -666,15 +666,13 @@ public class ModEventHandlerClient {
|
||||
|
||||
World world = Minecraft.getMinecraft().theWorld;
|
||||
|
||||
if(world != null && world.provider instanceof WorldProviderSurface && !RenderNTMSkybox.didLastRender) {
|
||||
if(world != null && world.provider instanceof WorldProviderSurface) {
|
||||
|
||||
IRenderHandler sky = world.provider.getSkyRenderer();
|
||||
if(!(sky instanceof RenderNTMSkybox)) {
|
||||
world.provider.setSkyRenderer(new RenderNTMSkybox(sky));
|
||||
world.provider.setSkyRenderer(new RenderNTMSkybox());
|
||||
}
|
||||
}
|
||||
|
||||
RenderNTMSkybox.didLastRender = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,115 +1,339 @@
|
||||
package com.hbm.render.world;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.extprop.HbmLivingProps;
|
||||
|
||||
import cpw.mods.fml.client.FMLClientHandler;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.multiplayer.WorldClient;
|
||||
import net.minecraft.client.renderer.ActiveRenderInfo;
|
||||
import net.minecraft.client.renderer.GLAllocation;
|
||||
import net.minecraft.client.renderer.OpenGlHelper;
|
||||
import net.minecraft.client.renderer.RenderGlobal;
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.WorldProviderSurface;
|
||||
import net.minecraftforge.client.IRenderHandler;
|
||||
|
||||
public class RenderNTMSkybox extends IRenderHandler { //why an abstract class uses the I-prefix is beyond me but ok, alright, whatever
|
||||
|
||||
/*
|
||||
* To get the terrain render order right, making a sky rendering handler is absolutely necessary. Turns out MC can only handle one of these, so what do we do?
|
||||
* We make out own renderer, grab any existing renderers that are already occupying the slot, doing what is effectively chainloading while adding our own garbage.
|
||||
* If somebody does the exact same thing as we do we might be screwed due to increasingly long recursive loops but we can fix that too, no worries.
|
||||
*/
|
||||
private IRenderHandler parent;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
import com.hbm.extprop.HbmLivingProps;
|
||||
import com.hbm.main.ModEventHandler;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class RenderNTMSkybox extends IRenderHandler {
|
||||
|
||||
private static final ResourceLocation sunTexture = new ResourceLocation("textures/environment/sun.png");
|
||||
private static final ResourceLocation moonTexture = new ResourceLocation("textures/environment/moon_phases.png");
|
||||
private static final ResourceLocation digammaStar = new ResourceLocation("hbm:textures/misc/star_digamma.png");
|
||||
private static final ResourceLocation bobmazonSat = new ResourceLocation("hbm:textures/misc/sat_bobmazon.png");
|
||||
|
||||
/*
|
||||
* If the skybox was rendered successfully in the last tick (even from other mods' skyboxes chainloading this one) then we don't need to add it again
|
||||
*/
|
||||
public static boolean didLastRender = false;
|
||||
|
||||
public RenderNTMSkybox(IRenderHandler parent) {
|
||||
this.parent = parent;
|
||||
|
||||
public int starGLCallList = GLAllocation.generateDisplayLists(3);
|
||||
public int glSkyList;
|
||||
public int glSkyList2;
|
||||
|
||||
protected double x;
|
||||
protected double y;
|
||||
protected double z;
|
||||
|
||||
/// I had to break your compat feature for other mods' skyboxes in order to
|
||||
/// make the skybox render correctly after Tom. Sorry about that. -Pu
|
||||
|
||||
public RenderNTMSkybox() {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glNewList(this.starGLCallList, GL11.GL_COMPILE);
|
||||
this.renderStars();
|
||||
GL11.glEndList();
|
||||
GL11.glPopMatrix();
|
||||
final Tessellator tessellator = Tessellator.instance;
|
||||
this.glSkyList = this.starGLCallList + 1;
|
||||
GL11.glNewList(this.glSkyList, GL11.GL_COMPILE);
|
||||
final byte byte2 = 64;
|
||||
final int i = 256 / byte2 + 2;
|
||||
float f = 16F;
|
||||
|
||||
for(int j = -byte2 * i; j <= byte2 * i; j += byte2) {
|
||||
for(int l = -byte2 * i; l <= byte2 * i; l += byte2) {
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.addVertex(j + 0, f, l + 0);
|
||||
tessellator.addVertex(j + byte2, f, l + 0);
|
||||
tessellator.addVertex(j + byte2, f, l + byte2);
|
||||
tessellator.addVertex(j + 0, f, l + byte2);
|
||||
tessellator.draw();
|
||||
}
|
||||
}
|
||||
|
||||
GL11.glEndList();
|
||||
this.glSkyList2 = this.starGLCallList + 2;
|
||||
GL11.glNewList(this.glSkyList2, GL11.GL_COMPILE);
|
||||
f = -16F;
|
||||
tessellator.startDrawingQuads();
|
||||
|
||||
for(int k = -byte2 * i; k <= byte2 * i; k += byte2) {
|
||||
for(int i1 = -byte2 * i; i1 <= byte2 * i; i1 += byte2) {
|
||||
tessellator.addVertex(k + byte2, f, i1 + 0);
|
||||
tessellator.addVertex(k + 0, f, i1 + 0);
|
||||
tessellator.addVertex(k + 0, f, i1 + byte2);
|
||||
tessellator.addVertex(k + byte2, f, i1 + byte2);
|
||||
}
|
||||
}
|
||||
|
||||
tessellator.draw();
|
||||
GL11.glEndList();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void render(float partialTicks, WorldClient world, Minecraft mc) {
|
||||
|
||||
if(parent != null) {
|
||||
parent.render(partialTicks, world, mc);
|
||||
} else{
|
||||
RenderGlobal rg = Minecraft.getMinecraft().renderGlobal;
|
||||
world.provider.setSkyRenderer(null);
|
||||
rg.renderSky(partialTicks);
|
||||
world.provider.setSkyRenderer(this);
|
||||
float atmosphericDust = ModEventHandler.dust;
|
||||
|
||||
GL11.glDisable(GL11.GL_TEXTURE_2D);
|
||||
Vec3 vec3 = world.getSkyColor(mc.renderViewEntity, partialTicks);
|
||||
float f1 = (float) vec3.xCoord;
|
||||
float f2 = (float) vec3.yCoord;
|
||||
float f3 = (float) vec3.zCoord;
|
||||
float f6;
|
||||
float dust = Math.max((1.0F - (atmosphericDust * 2)), 0);
|
||||
float rain = dust * (1.0F - world.getRainStrength(partialTicks));
|
||||
|
||||
if(mc.gameSettings.anaglyph) {
|
||||
float f4 = (f1 * 30.0F + f2 * 59.0F + f3 * 11.0F) / 100.0F;
|
||||
float f5 = (f1 * 30.0F + f2 * 70.0F) / 100.0F;
|
||||
f6 = (f1 * 30.0F + f3 * 70.0F) / 100.0F;
|
||||
f1 = f4;
|
||||
f2 = f5;
|
||||
f3 = f6;
|
||||
}
|
||||
|
||||
GL11.glPushMatrix();
|
||||
|
||||
GL11.glColor3f(f1, f2, f3);
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
GL11.glDepthMask(false);
|
||||
GL11.glEnable(GL11.GL_FOG);
|
||||
GL11.glColor3f(f1, f2, f3);
|
||||
GL11.glCallList(this.glSkyList);
|
||||
GL11.glDisable(GL11.GL_FOG);
|
||||
GL11.glDisable(GL11.GL_ALPHA_TEST);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
OpenGlHelper.glBlendFunc(770, 771, 1, 0);
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
float f7;
|
||||
float f8;
|
||||
float f9;
|
||||
float f10;
|
||||
float f18 = world.getStarBrightness(partialTicks);
|
||||
|
||||
if(f18 > 0.0F) {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F);
|
||||
GL11.glRotatef(world.getCelestialAngle(partialTicks) * 360.0F, 1.0F, 0.0F, 0.0F);
|
||||
GL11.glRotatef(-19.0F, 0, 1.0F, 0);
|
||||
GL11.glColor4f(f18, f18, f18, f18 * rain);
|
||||
GL11.glCallList(this.starGLCallList);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
|
||||
GL11.glEnable(GL11.GL_TEXTURE_2D);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glDisable(GL11.GL_ALPHA_TEST);
|
||||
GL11.glDisable(GL11.GL_FOG);
|
||||
OpenGlHelper.glBlendFunc(770, 1, 1, 0);
|
||||
|
||||
float brightness = (float) Math.sin(world.getCelestialAngle(partialTicks) * Math.PI);
|
||||
brightness *= brightness;
|
||||
|
||||
GL11.glColor4f(brightness, brightness, brightness, 1.0F);
|
||||
|
||||
OpenGlHelper.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ONE, GL11.GL_ZERO);
|
||||
GL11.glPushMatrix();
|
||||
f7 = 0.0F;
|
||||
f8 = 0.0F;
|
||||
f9 = 0.0F;
|
||||
GL11.glTranslatef(f7, f8, f9);
|
||||
GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F);
|
||||
GL11.glRotatef(world.getCelestialAngle(partialTicks) * 360.0F, 1.0F, 0.0F, 0.0F);
|
||||
GL11.glRotatef(140.0F, 1.0F, 0.0F, 0.0F);
|
||||
GL11.glRotatef(-40.0F, 0.0F, 0.0F, 1.0F);
|
||||
|
||||
FMLClientHandler.instance().getClient().renderEngine.bindTexture(digammaStar);
|
||||
|
||||
float digamma = HbmLivingProps.getDigamma(Minecraft.getMinecraft().thePlayer);
|
||||
float var12 = 1F * (1 + digamma * 0.25F);
|
||||
double dist = 100D - digamma * 2.5;
|
||||
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.addVertexWithUV(-var12, dist, -var12, 0.0D, 0.0D);
|
||||
tessellator.addVertexWithUV(var12, dist, -var12, 0.0D, 1.0D);
|
||||
tessellator.addVertexWithUV(var12, dist, var12, 1.0D, 1.0D);
|
||||
tessellator.addVertexWithUV(-var12, dist, var12, 1.0D, 0.0D);
|
||||
tessellator.draw();
|
||||
GL11.glPopMatrix();
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glRotatef(-40.0F, 1.0F, 0.0F, 0.0F);
|
||||
GL11.glRotatef((System.currentTimeMillis() % (360 * 1000) / 1000F), 0.0F, 1.0F, 0.0F);
|
||||
GL11.glRotatef((System.currentTimeMillis() % (360 * 100) / 100F), 1.0F, 0.0F, 0.0F);
|
||||
|
||||
FMLClientHandler.instance().getClient().renderEngine.bindTexture(bobmazonSat);
|
||||
|
||||
var12 = 0.5F;
|
||||
dist = 100D;
|
||||
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.addVertexWithUV(-var12, dist, -var12, 0.0D, 0.0D);
|
||||
tessellator.addVertexWithUV(var12, dist, -var12, 0.0D, 1.0D);
|
||||
tessellator.addVertexWithUV(var12, dist, var12, 1.0D, 1.0D);
|
||||
tessellator.addVertexWithUV(-var12, dist, var12, 1.0D, 0.0D);
|
||||
tessellator.draw();
|
||||
GL11.glPopMatrix();
|
||||
|
||||
GL11.glDepthMask(true);
|
||||
|
||||
GL11.glEnable(GL11.GL_FOG);
|
||||
// Render sun
|
||||
GL11.glDisable(GL11.GL_TEXTURE_2D);
|
||||
GL11.glColor4f(0.0F, 0.0F, 0.0F, 1.0F);
|
||||
// Some blanking to conceal the stars
|
||||
f10 = 30.0F;
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.addVertex(-f10, 99.9D, -f10);
|
||||
tessellator.addVertex(f10, 99.9D, -f10);
|
||||
tessellator.addVertex(f10, 99.9D, f10);
|
||||
tessellator.addVertex(-f10, 99.9D, f10);
|
||||
tessellator.draw();
|
||||
{
|
||||
GL11.glEnable(GL11.GL_TEXTURE_2D);
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, rain);
|
||||
mc.renderEngine.bindTexture(this.sunTexture);
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.addVertexWithUV(-f10, 100.0D, -f10, 0.0D, 0.0D);
|
||||
tessellator.addVertexWithUV(f10, 100.0D, -f10, 1.0D, 0.0D);
|
||||
tessellator.addVertexWithUV(f10, 100.0D, f10, 1.0D, 1.0D);
|
||||
tessellator.addVertexWithUV(-f10, 100.0D, f10, 0.0D, 1.0D);
|
||||
tessellator.draw();
|
||||
}
|
||||
{
|
||||
GL11.glColor4d(1, 1, 1, rain);
|
||||
f10 = 20.0F;
|
||||
FMLClientHandler.instance().getClient().renderEngine.bindTexture(RenderNTMSkybox.moonTexture);
|
||||
float sinphi = FMLClientHandler.instance().getClient().theWorld.getMoonPhase();
|
||||
final int cosphi = (int) (sinphi % 4);
|
||||
final int var29 = (int) (sinphi / 4 % 2);
|
||||
final float yy = (cosphi + 0) / 4.0F;
|
||||
final float rand7 = (var29 + 0) / 2.0F;
|
||||
final float zz = (cosphi + 1) / 4.0F;
|
||||
final float rand9 = (var29 + 1) / 2.0F;
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.addVertexWithUV(-f10, -100.0D, f10, zz, rand9);
|
||||
tessellator.addVertexWithUV(f10, -100.0D, f10, yy, rand9);
|
||||
tessellator.addVertexWithUV(f10, -100.0D, -f10, yy, rand7);
|
||||
tessellator.addVertexWithUV(-f10, -100.0D, -f10, zz, rand7);
|
||||
tessellator.draw();
|
||||
}
|
||||
{
|
||||
OpenGlHelper.glBlendFunc(770, 1, 1, 0);
|
||||
|
||||
float brightness = (float) Math.sin(world.getCelestialAngle(partialTicks) * Math.PI);
|
||||
brightness *= brightness;
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glColor4f(brightness, brightness, brightness, dust);
|
||||
GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F);
|
||||
GL11.glRotatef(world.getCelestialAngle(partialTicks) * 360.0F, 1.0F, 0.0F, 0.0F);
|
||||
GL11.glRotatef(140.0F, 1.0F, 0.0F, 0.0F);
|
||||
GL11.glRotatef(-40.0F, 0.0F, 0.0F, 1.0F);
|
||||
|
||||
FMLClientHandler.instance().getClient().renderEngine.bindTexture(digammaStar);
|
||||
|
||||
float digamma = HbmLivingProps.getDigamma(Minecraft.getMinecraft().thePlayer);
|
||||
float var12 = 1F * (1 + digamma * 0.25F);
|
||||
double dist = 100D - digamma * 2.5;
|
||||
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.addVertexWithUV(-var12, dist, -var12, 0.0D, 0.0D);
|
||||
tessellator.addVertexWithUV(var12, dist, -var12, 0.0D, 1.0D);
|
||||
tessellator.addVertexWithUV(var12, dist, var12, 1.0D, 1.0D);
|
||||
tessellator.addVertexWithUV(-var12, dist, var12, 1.0D, 0.0D);
|
||||
tessellator.draw();
|
||||
GL11.glPopMatrix();
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glColor4f(brightness, brightness, brightness, rain);
|
||||
GL11.glRotatef(-40.0F, 1.0F, 0.0F, 0.0F);
|
||||
GL11.glRotatef((System.currentTimeMillis() % (360 * 1000) / 1000F), 0.0F, 1.0F, 0.0F);
|
||||
GL11.glRotatef((System.currentTimeMillis() % (360 * 100) / 100F), 1.0F, 0.0F, 0.0F);
|
||||
|
||||
FMLClientHandler.instance().getClient().renderEngine.bindTexture(bobmazonSat);
|
||||
|
||||
var12 = 0.5F;
|
||||
dist = 100D;
|
||||
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.addVertexWithUV(-var12, dist, -var12, 0.0D, 0.0D);
|
||||
tessellator.addVertexWithUV(var12, dist, -var12, 0.0D, 1.0D);
|
||||
tessellator.addVertexWithUV(var12, dist, var12, 1.0D, 1.0D);
|
||||
tessellator.addVertexWithUV(-var12, dist, var12, 1.0D, 0.0D);
|
||||
tessellator.draw();
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
GL11.glDisable(GL11.GL_TEXTURE_2D);
|
||||
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glEnable(GL11.GL_ALPHA_TEST);
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
|
||||
GL11.glEnable(GL11.GL_FOG);
|
||||
GL11.glPopMatrix();
|
||||
|
||||
didLastRender = true;
|
||||
GL11.glDisable(GL11.GL_TEXTURE_2D);
|
||||
GL11.glColor3f(0.0F, 0.0F, 0.0F);
|
||||
double d0 = mc.thePlayer.getPosition(partialTicks).yCoord - world.getHorizon();
|
||||
|
||||
if(d0 < 0.0D) {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef(0.0F, 12.0F, 0.0F);
|
||||
GL11.glCallList(this.glSkyList2);
|
||||
GL11.glPopMatrix();
|
||||
f8 = 1.0F;
|
||||
f9 = -((float) (d0 + 65.0D));
|
||||
f10 = -f8;
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setColorRGBA_I(0, 255);
|
||||
tessellator.addVertex(-f8, f9, f8);
|
||||
tessellator.addVertex(f8, f9, f8);
|
||||
tessellator.addVertex(f8, f10, f8);
|
||||
tessellator.addVertex(-f8, f10, f8);
|
||||
tessellator.addVertex(-f8, f10, -f8);
|
||||
tessellator.addVertex(f8, f10, -f8);
|
||||
tessellator.addVertex(f8, f9, -f8);
|
||||
tessellator.addVertex(-f8, f9, -f8);
|
||||
tessellator.addVertex(f8, f10, -f8);
|
||||
tessellator.addVertex(f8, f10, f8);
|
||||
tessellator.addVertex(f8, f9, f8);
|
||||
tessellator.addVertex(f8, f9, -f8);
|
||||
tessellator.addVertex(-f8, f9, -f8);
|
||||
tessellator.addVertex(-f8, f9, f8);
|
||||
tessellator.addVertex(-f8, f10, f8);
|
||||
tessellator.addVertex(-f8, f10, -f8);
|
||||
tessellator.addVertex(-f8, f10, -f8);
|
||||
tessellator.addVertex(-f8, f10, f8);
|
||||
tessellator.addVertex(f8, f10, f8);
|
||||
tessellator.addVertex(f8, f10, -f8);
|
||||
tessellator.draw();
|
||||
}
|
||||
|
||||
if(world.provider.isSkyColored()) {
|
||||
GL11.glColor3f(f1 * 0.2F + 0.04F, f2 * 0.2F + 0.04F, f3 * 0.6F + 0.1F);
|
||||
} else {
|
||||
GL11.glColor3f(f1, f2, f3);
|
||||
}
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef(0.0F, -((float) (d0 - 16.0D)), 0.0F);
|
||||
GL11.glCallList(this.glSkyList2);
|
||||
GL11.glPopMatrix();
|
||||
GL11.glEnable(GL11.GL_TEXTURE_2D);
|
||||
GL11.glDepthMask(true);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
private void renderStars() {
|
||||
Random random = new Random(10842L);
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
tessellator.startDrawingQuads();
|
||||
|
||||
for(int i = 0; i < 1500; ++i) {
|
||||
double d0 = (double) (random.nextFloat() * 2.0F - 1.0F);
|
||||
double d1 = (double) (random.nextFloat() * 2.0F - 1.0F);
|
||||
double d2 = (double) (random.nextFloat() * 2.0F - 1.0F);
|
||||
double d3 = (double) (0.15F + random.nextFloat() * 0.1F);
|
||||
double d4 = d0 * d0 + d1 * d1 + d2 * d2;
|
||||
|
||||
if(d4 < 1.0D && d4 > 0.01D) {
|
||||
d4 = 1.0D / Math.sqrt(d4);
|
||||
d0 *= d4;
|
||||
d1 *= d4;
|
||||
d2 *= d4;
|
||||
double d5 = d0 * 100.0D;
|
||||
double d6 = d1 * 100.0D;
|
||||
double d7 = d2 * 100.0D;
|
||||
double d8 = Math.atan2(d0, d2);
|
||||
double d9 = Math.sin(d8);
|
||||
double d10 = Math.cos(d8);
|
||||
double d11 = Math.atan2(Math.sqrt(d0 * d0 + d2 * d2), d1);
|
||||
double d12 = Math.sin(d11);
|
||||
double d13 = Math.cos(d11);
|
||||
double d14 = random.nextDouble() * Math.PI * 2.0D;
|
||||
double d15 = Math.sin(d14);
|
||||
double d16 = Math.cos(d14);
|
||||
|
||||
for(int j = 0; j < 4; ++j) {
|
||||
double d17 = 0.0D;
|
||||
double d18 = (double) ((j & 2) - 1) * d3;
|
||||
double d19 = (double) ((j + 1 & 2) - 1) * d3;
|
||||
double d20 = d18 * d16 - d19 * d15;
|
||||
double d21 = d19 * d16 + d18 * d15;
|
||||
double d22 = d20 * d12 + d17 * d13;
|
||||
double d23 = d17 * d12 - d20 * d13;
|
||||
double d24 = d23 * d9 - d21 * d10;
|
||||
double d25 = d21 * d9 + d23 * d10;
|
||||
tessellator.addVertex(d5 + d24, d6 + d22, d7 + d25);
|
||||
}
|
||||
}
|
||||
}
|
||||
tessellator.draw();
|
||||
}
|
||||
}
|
||||
56
src/main/java/com/hbm/saveddata/TomSaveData.java
Normal file
@ -0,0 +1,56 @@
|
||||
package com.hbm.saveddata;
|
||||
|
||||
import java.util.Iterator;
|
||||
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.main.ModEventHandler;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.village.Village;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.WorldSavedData;
|
||||
import net.minecraft.world.storage.MapStorage;
|
||||
|
||||
public class TomSaveData extends WorldSavedData {
|
||||
|
||||
final static String key = "impactData";
|
||||
public static float dust;
|
||||
public static float fire;
|
||||
public static boolean impact;
|
||||
|
||||
public static TomSaveData forWorld(World world) {
|
||||
TomSaveData result = (TomSaveData)world.perWorldStorage.loadData(TomSaveData.class, "impactData");
|
||||
|
||||
if (result == null) {
|
||||
world.perWorldStorage.setData(key, new TomSaveData(key));
|
||||
result = (TomSaveData)world.perWorldStorage.loadData(TomSaveData.class, "impactData");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private NBTTagCompound data = new NBTTagCompound();
|
||||
|
||||
public TomSaveData(String tagName) {
|
||||
super(tagName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound compound) {
|
||||
data = compound.getCompoundTag(key);
|
||||
this.dust = compound.getFloat("dust");
|
||||
this.fire = compound.getFloat("fire");
|
||||
this.impact = compound.getBoolean("impact");
|
||||
ModEventHandler.dust = this.dust;
|
||||
ModEventHandler.fire = this.fire;
|
||||
ModEventHandler.impact = this.impact;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound compound) {
|
||||
compound.setTag(key, data);
|
||||
}
|
||||
|
||||
public NBTTagCompound getData() {
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -10,11 +10,13 @@ import com.hbm.interfaces.IFluidAcceptor;
|
||||
import com.hbm.interfaces.IFluidSource;
|
||||
import com.hbm.inventory.FluidTank;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.main.ModEventHandler;
|
||||
import com.hbm.tileentity.TileEntityMachineBase;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.EnumSkyBlock;
|
||||
|
||||
public class TileEntityBarrel extends TileEntityMachineBase implements IFluidAcceptor, IFluidSource {
|
||||
|
||||
@ -102,6 +104,15 @@ public class TileEntityBarrel extends TileEntityMachineBase implements IFluidAcc
|
||||
if(b == ModBlocks.barrel_corroded && worldObj.rand.nextInt(3) == 0) {
|
||||
tank.setFill(tank.getFill() - 1);
|
||||
}
|
||||
|
||||
//For when Tom's firestorm hits a barrel full of water
|
||||
if(tank.getTankType() == FluidType.WATER && ModEventHandler.fire > 0) {
|
||||
int light = this.worldObj.getSavedLightValue(EnumSkyBlock.Sky, this.xCoord, this.yCoord, this.zCoord);
|
||||
|
||||
if(light > 7) {
|
||||
worldObj.newExplosion(null, xCoord + 0.5, yCoord + 0.5, zCoord + 0.5, 5, true, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void networkUnpack(NBTTagCompound data) {
|
||||
|
||||
@ -9,10 +9,12 @@ import com.hbm.interfaces.IFluidAcceptor;
|
||||
import com.hbm.interfaces.IFluidSource;
|
||||
import com.hbm.inventory.FluidTank;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.main.ModEventHandler;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.EnumSkyBlock;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityCondenser extends TileEntity implements IFluidAcceptor, IFluidSource {
|
||||
@ -45,6 +47,14 @@ public class TileEntityCondenser extends TileEntity implements IFluidAcceptor, I
|
||||
tanks[0].setFill(tanks[0].getFill() - convert);
|
||||
tanks[1].setFill(tanks[1].getFill() + convert);
|
||||
|
||||
int light = this.worldObj.getSavedLightValue(EnumSkyBlock.Sky, this.xCoord, this.yCoord, this.zCoord);
|
||||
|
||||
if(ModEventHandler.fire > 0 && light > 7) { // Make both steam and water evaporate during firestorms...{
|
||||
tanks[1].setFill(tanks[1].getFill() - convert);
|
||||
} else {
|
||||
tanks[1].setFill(tanks[1].getFill() + convert);
|
||||
}
|
||||
|
||||
fillFluidInit(tanks[1].getTankType());
|
||||
|
||||
} else {
|
||||
|
||||
@ -119,6 +119,7 @@ public class TileEntitySILEX extends TileEntityMachineBase implements IFluidAcce
|
||||
static {
|
||||
fluidConversion.put(FluidType.UF6, new ComparableStack(ModItems.fluid_icon, 1, FluidType.UF6.ordinal()));
|
||||
fluidConversion.put(FluidType.PUF6, new ComparableStack(ModItems.fluid_icon, 1, FluidType.PUF6.ordinal()));
|
||||
fluidConversion.put(FluidType.DEATH, new ComparableStack(ModItems.fluid_icon, 1, FluidType.DEATH.ordinal()));
|
||||
}
|
||||
|
||||
int loadDelay;
|
||||
|
||||
@ -14,6 +14,7 @@ import com.hbm.entity.effect.EntitySpear;
|
||||
import com.hbm.entity.projectile.EntityRBMKDebris;
|
||||
import com.hbm.entity.projectile.EntityRBMKDebris.DebrisType;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.main.ModEventHandler;
|
||||
import com.hbm.packet.AuxParticlePacketNT;
|
||||
import com.hbm.packet.NBTPacket;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
@ -34,6 +35,7 @@ import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.EnumSkyBlock;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.event.RenderGameOverlayEvent;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
@ -203,6 +205,13 @@ public abstract class TileEntityRBMKBase extends TileEntity implements INBTPacke
|
||||
|
||||
protected void coolPassively() {
|
||||
|
||||
if(ModEventHandler.fire > 0) {
|
||||
int light = this.worldObj.getSavedLightValue(EnumSkyBlock.Sky, this.xCoord, this.yCoord, this.zCoord);
|
||||
if(heat < 20 + (480 * (light / 15))) {
|
||||
this.heat += this.passiveCooling() * 2;
|
||||
}
|
||||
}
|
||||
|
||||
this.heat -= this.passiveCooling();
|
||||
|
||||
if(heat < 20)
|
||||
|
||||
154
src/main/java/com/hbm/world/WorldProviderNTM.java
Normal file
@ -0,0 +1,154 @@
|
||||
package com.hbm.world;
|
||||
|
||||
import com.hbm.main.ModEventHandler;
|
||||
|
||||
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.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.ChunkCoordinates;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.WorldProvider;
|
||||
import net.minecraft.world.WorldProviderSurface;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
import net.minecraft.world.biome.WorldChunkManager;
|
||||
import net.minecraft.world.chunk.Chunk;
|
||||
import net.minecraft.world.chunk.IChunkProvider;
|
||||
import net.minecraftforge.client.ForgeHooksClient;
|
||||
import net.minecraftforge.client.IRenderHandler;
|
||||
|
||||
public class WorldProviderNTM extends WorldProviderSurface {
|
||||
|
||||
private float[] colorsSunriseSunset = new float[4];
|
||||
|
||||
public WorldProviderNTM() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public float calculateCelestialAngle(long worldTime, float partialTicks) {
|
||||
return super.calculateCelestialAngle(worldTime, partialTicks);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public float[] calcSunriseSunsetColors(float par1, float par2) {
|
||||
float f2 = 0.4F;
|
||||
float f3 = MathHelper.cos(par1 * (float) Math.PI * 2.0F) - 0.0F;
|
||||
float f4 = -0.0F;
|
||||
float dust = ModEventHandler.dust;
|
||||
|
||||
if(f3 >= f4 - f2 && f3 <= f4 + f2) {
|
||||
float f5 = (f3 - f4) / f2 * 0.5F + 0.5F;
|
||||
float f6 = 1.0F - (1.0F - MathHelper.sin(f5 * (float) Math.PI)) * 0.99F;
|
||||
f6 *= f6;
|
||||
this.colorsSunriseSunset[0] = (f5 * 0.3F + 0.7F) * (1 - dust);
|
||||
this.colorsSunriseSunset[1] = (f5 * f5 * 0.7F + 0.2F) * (1 - dust);
|
||||
this.colorsSunriseSunset[2] = (f5 * f5 * 0.0F + 0.2F) * (1 - dust);
|
||||
this.colorsSunriseSunset[3] = f6 * (1 - dust);
|
||||
return this.colorsSunriseSunset;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public float getStarBrightness(float par1) {
|
||||
float starBr = worldObj.getStarBrightnessBody(par1);
|
||||
float dust = ModEventHandler.dust;
|
||||
float f1 = worldObj.getCelestialAngle(par1);
|
||||
float f2 = 1.0F - (MathHelper.cos(f1 * (float) Math.PI * 2.0F) * 2.0F + 0.25F);
|
||||
|
||||
if(f2 < 0.0F) {
|
||||
f2 = 0.0F;
|
||||
}
|
||||
|
||||
if(f2 > 1.0F) {
|
||||
f2 = 1.0F;
|
||||
}
|
||||
return starBr * (1 - dust);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public float getSunBrightness(float par1) {
|
||||
float dust = ModEventHandler.dust;
|
||||
float sunBr = worldObj.getSunBrightnessFactor(par1);
|
||||
return (sunBr * 0.8F + 0.2F) * (1 - dust);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDaytime() {
|
||||
float dust = ModEventHandler.dust;
|
||||
|
||||
if(dust >= 0.75F) {
|
||||
return false;
|
||||
}
|
||||
return super.isDaytime();
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getSunBrightnessFactor(float par1) {
|
||||
float dust = ModEventHandler.dust;
|
||||
float sunBr = worldObj.getSunBrightnessFactor(par1);
|
||||
float dimSun = sunBr * (1 - dust);
|
||||
return dimSun;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return Vec3D with biome specific fog color
|
||||
*/
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public Vec3 getFogColor(float p_76562_1_, float p_76562_2_) {
|
||||
Vec3 fog = super.getFogColor(p_76562_1_, p_76562_2_);
|
||||
float dust = ModEventHandler.dust;
|
||||
float fire = ModEventHandler.fire;
|
||||
|
||||
float f3 = (float) fog.xCoord;
|
||||
float f4 = (float) fog.yCoord * (1 - (dust * 0.5F));
|
||||
float f5 = (float) fog.zCoord * (1 - dust);
|
||||
|
||||
if(fire > 0) {
|
||||
return Vec3.createVectorHelper((double) f3 * (Math.max((1 - (dust * 2)), 0)), (double) f4 * (Math.max((1 - (dust * 2)), 0)), (double) f5 * (Math.max((1 - (dust * 2)), 0)));
|
||||
}
|
||||
return Vec3.createVectorHelper((double) f3 * (1 - dust), (double) f4 * (1 - dust), (double) f5 * (1 - dust));
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public Vec3 getSkyColor(Entity cameraEntity, float partialTicks) {
|
||||
Vec3 sky = super.getSkyColor(cameraEntity, partialTicks);
|
||||
float dust = ModEventHandler.dust;
|
||||
float fire = ModEventHandler.fire;
|
||||
|
||||
float f4;
|
||||
float f5;
|
||||
float f6;
|
||||
|
||||
if(fire > 0) {
|
||||
f4 = (float) (sky.xCoord * 1.3f);
|
||||
f5 = (float) sky.yCoord * ((Math.max((1 - (dust * 1.4f)), 0)));
|
||||
f6 = (float) sky.zCoord * ((Math.max((1 - (dust * 4)), 0)));
|
||||
} else {
|
||||
f4 = (float) sky.xCoord;
|
||||
f5 = (float) sky.yCoord * (1 - (dust * 0.5F));
|
||||
f6 = (float) sky.zCoord * (1 - dust);
|
||||
}
|
||||
|
||||
return Vec3.createVectorHelper((double) f4 * (fire + (1 - dust)), (double) f5 * (fire + (1 - dust)), (double) f6 * (fire + (1 - dust)));
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public Vec3 drawClouds(float partialTicks) {
|
||||
Vec3 clouds = super.drawClouds(partialTicks);
|
||||
float dust = ModEventHandler.dust;
|
||||
float f3 = (float) clouds.xCoord;
|
||||
float f4 = (float) clouds.yCoord;
|
||||
float f5 = (float) clouds.zCoord;
|
||||
return Vec3.createVectorHelper((double) f3 * (1 - dust), (double) f4 * (1 - dust), (double) f5 * (1 - dust));
|
||||
}
|
||||
}
|
||||
@ -144,6 +144,7 @@ chem.KEVLAR=Kevlarverbundherstellung
|
||||
chem.LPG=Petroleumgasverflüssigung
|
||||
chem.NITAN=NITAN-Supertreibstoff mischen
|
||||
chem.OIL_SAND=Teersand-Extraktion
|
||||
chem.OSMIRIDIUM_DEATH=Osmiridiumlösung-Herstellung
|
||||
chem.PEROXIDE=Wasserstoffperoxidherstellung
|
||||
chem.POLYMER=Polymersynthese
|
||||
chem.PUF6=Plutoniumhexafluoridproduktion
|
||||
@ -437,6 +438,7 @@ hbmfluid.biogas=Biogas
|
||||
hbmfluid.bitumen=Bitumen
|
||||
hbmfluid.coolant=Kühlflüssigkeit
|
||||
hbmfluid.cryogel=Kryogel
|
||||
hbmfluid.death=Osmiridiumlösung
|
||||
hbmfluid.deuterium=Deuterium
|
||||
hbmfluid.diesel=Diesel
|
||||
hbmfluid.fracksol=Frackinglösung
|
||||
@ -1105,6 +1107,7 @@ item.crystal_lead.name=Bleikristalle
|
||||
item.crystal_lapis.name=Lapiskristalle
|
||||
item.crystal_lithium.name=Lithiumkristalle
|
||||
item.crystal_niter.name=Salpeterkristalle
|
||||
item.crystal_osmiridium.name=Osmiridiumkristalle
|
||||
item.crystal_phosphorus.name=Phosphorkristalle
|
||||
item.crystal_plutonium.name=Plutoniumkristalle
|
||||
item.crystal_rare.name=Seltenerdenkristalle
|
||||
@ -1522,6 +1525,7 @@ item.ingot_mox_fuel.name=MOX-Kernbrennstoffbarren
|
||||
item.ingot_neptunium.name=Neptuniumbarren
|
||||
item.ingot_neptunium_fuel.name=Neptuniumkernbrennstoffbarren
|
||||
item.ingot_niobium.name=Niobbarren
|
||||
item.ingot_osmiridium.name=Osmiridiumbarren
|
||||
item.ingot_phosphorus.name=Weiße Phosphortafel
|
||||
item.ingot_plutonium.name=Plutoniumbarren
|
||||
item.ingot_plutonium_fuel.name=Plutoniumkernbrennstoffbarren
|
||||
@ -1874,6 +1878,7 @@ item.nugget_mercury.name=Quecksilbertropfen
|
||||
item.nugget_mox_fuel.name=MOX-Kernbrennstoffnugget
|
||||
item.nugget_neptunium.name=Neptuniumnugget
|
||||
item.nugget_neptunium_fuel.name=Neptuniumkernbrennstoffnugget
|
||||
item.nugget_osmiridium.name=Osmiridiumnugget
|
||||
item.nugget_plutonium.name=Plutoniumnugget
|
||||
item.nugget_plutonium_fuel.name=Plutoniumkernbrennstoffnugget
|
||||
item.nugget_polonium.name=Polonium-210-Nugget
|
||||
@ -2056,6 +2061,7 @@ item.powder_gold.name=Goldstaub
|
||||
item.powder_i131.name=Iod-131-Staub
|
||||
item.powder_i131_tiny.name=Kleiner Haufen Iod-131-Staub
|
||||
item.powder_ice.name=Kryopulver
|
||||
item.powder_impure_osmiridium.name=Unreiner Osmiridiumstaub
|
||||
item.powder_iodine.name=Iodstaub
|
||||
item.powder_iron.name=Eisenstaub
|
||||
item.powder_lanthanium.name=Lanthanstaub
|
||||
@ -2075,6 +2081,8 @@ item.powder_neptunium.name=Neptuniumstaub
|
||||
item.powder_niobium.name=Niobstaub
|
||||
item.powder_niobium_tiny.name=Kleiner Haufen Niobstaub
|
||||
item.powder_nitan_mix.name=Nitaniummischung
|
||||
item.powder_paleogenite.name=Paleogenitstaub
|
||||
item.powder_paleogenite_tiny.name=Kleiner Haufen Paleogenitstaub
|
||||
item.powder_plutonium.name=Plutoniumstaub
|
||||
item.powder_poison.name=Giftpulver
|
||||
item.powder_polonium.name=Polonium-210-Staub
|
||||
@ -2818,6 +2826,7 @@ tile.brick_jungle_trap.name=Enargit-Falle
|
||||
tile.brick_light.name=Helle Ziegel
|
||||
tile.brick_obsidian.name=Obsidianziegel
|
||||
tile.broadcaster_pc.name=Korrupter Sender
|
||||
tile.burning_earth.name=Brennendes Gras
|
||||
tile.cable_switch.name=Stromschalter
|
||||
tile.cheater_virus.name=Geliertes Euphemium
|
||||
tile.cheater_virus_seed.name=Instabiler Euphemiumschrabid-Block
|
||||
@ -3224,6 +3233,7 @@ tile.ore_rare.name=Seltenerden-Erz
|
||||
tile.ore_reiium.name=Reiit
|
||||
tile.ore_schrabidium.name=Schrabidiumerz
|
||||
tile.ore_sulfur.name=Schwefelerz
|
||||
tile.ore_tektite_osmiridium.name=Osmiridiumreiches Tektit
|
||||
tile.ore_thorium.name=Thoriumerz
|
||||
tile.ore_tikite.name=Trixit
|
||||
tile.ore_titanium.name=Titanerz
|
||||
@ -3345,6 +3355,7 @@ tile.struct_soyuz_core.name=Soyuz-Startrampe-Kernkomponente
|
||||
tile.taint.name=Korrupter Schmutz
|
||||
tile.taint_barrel.name=IMP-Rückstandsfass
|
||||
tile.tape_recorder.name=Tonbandgerät
|
||||
tile.tektite.name=Tektit
|
||||
tile.tesla.name=Teslaspule
|
||||
tile.test_nuke.name=Test Atombombe
|
||||
tile.therm_endo.name=Endothermische Bombe
|
||||
|
||||
@ -212,6 +212,7 @@ chem.KEVLAR=Kevlar Compound Production
|
||||
chem.LPG=Petroleum Gas Liquefaction
|
||||
chem.NITAN=NITAN Super Fuel Mixing
|
||||
chem.OIL_SAND=Tar Sand Extraction
|
||||
chem.OSMIRIDIUM_DEATH=Osmiridic Solution Production
|
||||
chem.PEROXIDE=Hydrogen Peroxide Production
|
||||
chem.POLYMER=Polymer Synthesis
|
||||
chem.PUF6=Plutonium Hexafluoride Production
|
||||
@ -505,6 +506,7 @@ hbmfluid.biogas=Biogas
|
||||
hbmfluid.bitumen=Bitumen
|
||||
hbmfluid.coolant=Coolant
|
||||
hbmfluid.cryogel=Cryogel
|
||||
hbmfluid.death=Osmiridic Solution
|
||||
hbmfluid.deuterium=Deuterium
|
||||
hbmfluid.diesel=Diesel
|
||||
hbmfluid.fracksol=Fracking Solution
|
||||
@ -1173,6 +1175,7 @@ item.crystal_lead.name=Lead Crystals
|
||||
item.crystal_lapis.name=Lapis Crystals
|
||||
item.crystal_lithium.name=Lithium Crystals
|
||||
item.crystal_niter.name=Niter Crystals
|
||||
item.crystal_osmiridium.name=Osmiridium Crystals
|
||||
item.crystal_phosphorus.name=Phosphorus Crystals
|
||||
item.crystal_plutonium.name=Plutonium Crystals
|
||||
item.crystal_rare.name=Rare Earth Crystals
|
||||
@ -1590,6 +1593,7 @@ item.ingot_mox_fuel.name=Ingot of MOX Fuel
|
||||
item.ingot_neptunium.name=Neptunium Ingot
|
||||
item.ingot_neptunium_fuel.name=Neptunium Fuel Ingot
|
||||
item.ingot_niobium.name=Niobium Ingot
|
||||
item.ingot_osmiridium.name=Osmiridium Ingot
|
||||
item.ingot_phosphorus.name=Bar of White Phosphorus
|
||||
item.ingot_plutonium.name=Plutonium Ingot
|
||||
item.ingot_plutonium_fuel.name=Ingot of Plutonium Fuel
|
||||
@ -1943,6 +1947,7 @@ item.nugget_mercury.name=Small Drop of Mercury
|
||||
item.nugget_mox_fuel.name=Nugget of MOX Fuel
|
||||
item.nugget_neptunium.name=Neptunium Nugget
|
||||
item.nugget_neptunium_fuel.name=Neptunium Fuel Nugget
|
||||
item.nugget_osmiridium.name=Osmiridium Nugget
|
||||
item.nugget_plutonium.name=Plutonium Nugget
|
||||
item.nugget_plutonium_fuel.name=Nugget of Plutonium Fuel
|
||||
item.nugget_polonium.name=Polonium-210 Nugget
|
||||
@ -2125,6 +2130,7 @@ item.powder_gold.name=Gold Powder
|
||||
item.powder_i131.name=Iodine-131 Powder
|
||||
item.powder_i131_tiny.name=Tiny Pile of Iodine-131 Powder
|
||||
item.powder_ice.name=Cryo Powder
|
||||
item.powder_impure_osmiridium.name=Impure Osmiridium Powder
|
||||
item.powder_iodine.name=Iodine Powder
|
||||
item.powder_iron.name=Iron Powder
|
||||
item.powder_lanthanium.name=Lanthanium Powder
|
||||
@ -2144,6 +2150,8 @@ item.powder_neptunium.name=Neptunium Powder
|
||||
item.powder_niobium.name=Niobium Powder
|
||||
item.powder_niobium_tiny.name=Tiny Pile of Niobium Powder
|
||||
item.powder_nitan_mix.name=Nitanium Blend
|
||||
item.powder_paleogenite.name=Paleogenite Powder
|
||||
item.powder_paleogenite_tiny.name=Tiny Pile of Paleogenite Powder
|
||||
item.powder_plutonium.name=Plutonium Powder
|
||||
item.powder_poison.name=Poison Powder
|
||||
item.powder_polonium.name=Polonium-210 Powder
|
||||
@ -2885,6 +2893,7 @@ tile.brick_jungle_trap.name=Trapped Enargite Bricks
|
||||
tile.brick_light.name=Light Bricks
|
||||
tile.brick_obsidian.name=Obsidian Bricks
|
||||
tile.broadcaster_pc.name=Corrupted Broadcaster
|
||||
tile.burning_earth.name=Burning Grass
|
||||
tile.cable_switch.name=Power Switch
|
||||
tile.cheater_virus.name=Gelid Euphemium
|
||||
tile.cheater_virus_seed.name=Unstable Euphemium Schrabide Block
|
||||
@ -3291,6 +3300,7 @@ tile.ore_rare.name=Rare Earth Ore
|
||||
tile.ore_reiium.name=Reiite
|
||||
tile.ore_schrabidium.name=Schrabidium Ore
|
||||
tile.ore_sulfur.name=Sulfur Ore
|
||||
tile.ore_tektite_osmiridium.name=Osmiridium-Infused Tektite
|
||||
tile.ore_thorium.name=Thorium Ore
|
||||
tile.ore_tikite.name=Trixite
|
||||
tile.ore_titanium.name=Titanium Ore
|
||||
@ -3412,6 +3422,7 @@ tile.struct_soyuz_core.name=Soyuz Launcher Core Component
|
||||
tile.taint.name=Taint
|
||||
tile.taint_barrel.name=IMP Residue Barrel
|
||||
tile.tape_recorder.name=Tape Recorder
|
||||
tile.tektite.name=Tektite
|
||||
tile.tesla.name=Tesla Coil
|
||||
tile.test_nuke.name=Test Nuke
|
||||
tile.therm_endo.name=Endothermic Bomb
|
||||
|
||||
|
After Width: | Height: | Size: 716 B |
|
After Width: | Height: | Size: 724 B |
|
After Width: | Height: | Size: 737 B |
BIN
src/main/resources/assets/hbm/textures/blocks/tektite.png
Normal file
|
After Width: | Height: | Size: 763 B |
|
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 36 KiB |
|
After Width: | Height: | Size: 410 B |
|
After Width: | Height: | Size: 513 B |
|
After Width: | Height: | Size: 420 B |
|
After Width: | Height: | Size: 276 B |
|
After Width: | Height: | Size: 418 B |
|
After Width: | Height: | Size: 343 B |
|
After Width: | Height: | Size: 261 B |
BIN
src/main/resources/assets/hbm/textures/items/powder_tektite.png
Normal file
|
After Width: | Height: | Size: 381 B |