cellular dungeon generator
BIN
assets/hbm/textures/blocks/crate_ammo_bottom.png
Normal file
|
After Width: | Height: | Size: 602 B |
BIN
assets/hbm/textures/blocks/crate_ammo_side.png
Normal file
|
After Width: | Height: | Size: 730 B |
BIN
assets/hbm/textures/blocks/crate_ammo_top.png
Normal file
|
After Width: | Height: | Size: 618 B |
BIN
assets/hbm/textures/blocks/meteor.png
Normal file
|
After Width: | Height: | Size: 514 B |
BIN
assets/hbm/textures/blocks/meteor_brick.png
Normal file
|
After Width: | Height: | Size: 518 B |
BIN
assets/hbm/textures/blocks/meteor_brick_chiseled.png
Normal file
|
After Width: | Height: | Size: 553 B |
BIN
assets/hbm/textures/blocks/meteor_brick_cracked.png
Normal file
|
After Width: | Height: | Size: 547 B |
BIN
assets/hbm/textures/blocks/meteor_brick_mossy.png
Normal file
|
After Width: | Height: | Size: 678 B |
BIN
assets/hbm/textures/blocks/meteor_cobble.png
Normal file
|
After Width: | Height: | Size: 542 B |
BIN
assets/hbm/textures/blocks/meteor_crushed.png
Normal file
|
After Width: | Height: | Size: 454 B |
BIN
assets/hbm/textures/blocks/meteor_pillar.png
Normal file
|
After Width: | Height: | Size: 435 B |
BIN
assets/hbm/textures/blocks/meteor_pillar_top.png
Normal file
|
After Width: | Height: | Size: 472 B |
BIN
assets/hbm/textures/blocks/meteor_polished.png
Normal file
|
After Width: | Height: | Size: 501 B |
BIN
assets/hbm/textures/blocks/meteor_treasure.png
Normal file
|
After Width: | Height: | Size: 528 B |
@ -167,6 +167,12 @@ public class ModBlocks {
|
||||
public static Block block_meteor_broken;
|
||||
public static Block block_meteor_molten;
|
||||
public static Block block_meteor_treasure;
|
||||
public static Block meteor_polished;
|
||||
public static Block meteor_brick;
|
||||
public static Block meteor_brick_mossy;
|
||||
public static Block meteor_brick_cracked;
|
||||
public static Block meteor_brick_chiseled;
|
||||
public static Block meteor_pillar;
|
||||
|
||||
public static Block tape_recorder;
|
||||
public static Block steel_poles;
|
||||
@ -237,6 +243,7 @@ public class ModBlocks {
|
||||
public static Block crate_metal;
|
||||
public static Block crate_red;
|
||||
public static Block crate_can;
|
||||
public static Block crate_ammo;
|
||||
|
||||
public static Block boxcar;
|
||||
public static Block boat;
|
||||
@ -865,11 +872,17 @@ public class ModBlocks {
|
||||
cmb_brick = new BlockGeneric(Material.rock).setBlockName("cmb_brick").setCreativeTab(MainRegistry.blockTab).setHardness(25.0F).setResistance(6000.0F).setBlockTextureName(RefStrings.MODID + ":cmb_brick");
|
||||
cmb_brick_reinforced = new BlockGeneric(Material.rock).setBlockName("cmb_brick_reinforced").setCreativeTab(MainRegistry.blockTab).setHardness(25.0F).setResistance(60000.0F).setBlockTextureName(RefStrings.MODID + ":cmb_brick_reinforced");
|
||||
|
||||
block_meteor = new BlockOre(Material.rock).setBlockName("block_meteor").setCreativeTab(MainRegistry.blockTab).setHardness(15.0F).setResistance(900.0F).setBlockTextureName(RefStrings.MODID + ":block_meteor");
|
||||
block_meteor_cobble = new BlockOre(Material.rock).setBlockName("block_meteor_cobble").setCreativeTab(MainRegistry.blockTab).setHardness(15.0F).setResistance(900.0F).setBlockTextureName(RefStrings.MODID + ":block_meteor_cobble");
|
||||
block_meteor_broken = new BlockOre(Material.rock).setBlockName("block_meteor_broken").setCreativeTab(MainRegistry.blockTab).setHardness(15.0F).setResistance(900.0F).setBlockTextureName(RefStrings.MODID + ":block_meteor_broken");
|
||||
block_meteor = new BlockOre(Material.rock).setBlockName("block_meteor").setCreativeTab(MainRegistry.blockTab).setHardness(15.0F).setResistance(900.0F).setBlockTextureName(RefStrings.MODID + ":meteor");
|
||||
block_meteor_cobble = new BlockOre(Material.rock).setBlockName("block_meteor_cobble").setCreativeTab(MainRegistry.blockTab).setHardness(15.0F).setResistance(900.0F).setBlockTextureName(RefStrings.MODID + ":meteor_cobble");
|
||||
block_meteor_broken = new BlockOre(Material.rock).setBlockName("block_meteor_broken").setCreativeTab(MainRegistry.blockTab).setHardness(15.0F).setResistance(900.0F).setBlockTextureName(RefStrings.MODID + ":meteor_crushed");
|
||||
block_meteor_molten = new BlockOre(Material.rock, true).setBlockName("block_meteor_molten").setLightLevel(0.75F).setCreativeTab(MainRegistry.blockTab).setHardness(15.0F).setResistance(900.0F).setBlockTextureName(RefStrings.MODID + ":block_meteor_molten");
|
||||
block_meteor_treasure = new BlockOre(Material.rock).setBlockName("block_meteor_treasure").setCreativeTab(MainRegistry.blockTab).setHardness(15.0F).setResistance(900.0F).setBlockTextureName(RefStrings.MODID + ":block_meteor_treasure");
|
||||
block_meteor_treasure = new BlockOre(Material.rock).setBlockName("block_meteor_treasure").setCreativeTab(MainRegistry.blockTab).setHardness(15.0F).setResistance(900.0F).setBlockTextureName(RefStrings.MODID + ":meteor_treasure");
|
||||
meteor_polished = new BlockGeneric(Material.rock).setBlockName("meteor_polished").setCreativeTab(MainRegistry.blockTab).setHardness(15.0F).setResistance(900.0F).setBlockTextureName(RefStrings.MODID + ":meteor_polished");
|
||||
meteor_brick = new BlockGeneric(Material.rock).setBlockName("meteor_brick").setCreativeTab(MainRegistry.blockTab).setHardness(15.0F).setResistance(900.0F).setBlockTextureName(RefStrings.MODID + ":meteor_brick");
|
||||
meteor_brick_mossy = new BlockGeneric(Material.rock).setBlockName("meteor_brick_mossy").setCreativeTab(MainRegistry.blockTab).setHardness(15.0F).setResistance(900.0F).setBlockTextureName(RefStrings.MODID + ":meteor_brick_mossy");
|
||||
meteor_brick_cracked = new BlockGeneric(Material.rock).setBlockName("meteor_brick_cracked").setCreativeTab(MainRegistry.blockTab).setHardness(15.0F).setResistance(900.0F).setBlockTextureName(RefStrings.MODID + ":meteor_brick_cracked");
|
||||
meteor_brick_chiseled = new BlockGeneric(Material.rock).setBlockName("meteor_brick_chiseled").setCreativeTab(MainRegistry.blockTab).setHardness(15.0F).setResistance(900.0F).setBlockTextureName(RefStrings.MODID + ":meteor_brick_chiseled");
|
||||
meteor_pillar = new BlockGenericPillar(Material.rock).setBlockName("meteor_pillar").setCreativeTab(MainRegistry.blockTab).setHardness(15.0F).setResistance(900.0F);
|
||||
|
||||
tape_recorder = new DecoTapeRecorder(Material.rock).setBlockName("tape_recorder").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(15.0F).setBlockTextureName(RefStrings.MODID + ":deco_tape_recorder");
|
||||
steel_poles = new DecoSteelPoles(Material.rock).setBlockName("steel_poles").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(15.0F).setBlockTextureName(RefStrings.MODID + ":steel_beam");
|
||||
@ -1163,6 +1176,7 @@ public class ModBlocks {
|
||||
crate_metal = new BlockCrate(Material.iron).setBlockName("crate_metal").setStepSound(Block.soundTypeMetal).setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.consumableTab).setBlockTextureName(RefStrings.MODID + ":crate_metal");
|
||||
crate_red = new BlockCrate(Material.iron).setBlockName("crate_red").setStepSound(Block.soundTypeMetal).setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":crate_red");
|
||||
crate_can = new BlockCanCrate(Material.wood).setBlockName("crate_can").setStepSound(Block.soundTypeWood).setHardness(1.0F).setResistance(2.5F).setCreativeTab(MainRegistry.consumableTab);
|
||||
crate_ammo = new BlockAmmoCrate(Material.wood).setBlockName("crate_ammo").setStepSound(Block.soundTypeMetal).setHardness(1.0F).setResistance(2.5F).setCreativeTab(MainRegistry.consumableTab);
|
||||
crate_iron = new BlockStorageCrate(Material.iron).setBlockName("crate_iron").setStepSound(Block.soundTypeMetal).setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
crate_steel = new BlockStorageCrate(Material.iron).setBlockName("crate_steel").setStepSound(Block.soundTypeMetal).setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
safe = new BlockStorageCrate(Material.iron).setBlockName("safe").setStepSound(Block.soundTypeMetal).setHardness(7.5F).setResistance(10000.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
@ -1457,6 +1471,12 @@ public class ModBlocks {
|
||||
GameRegistry.registerBlock(block_meteor_broken, block_meteor_broken.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(block_meteor_molten, block_meteor_molten.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(block_meteor_treasure, block_meteor_treasure.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(meteor_polished, meteor_polished.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(meteor_brick, meteor_brick.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(meteor_brick_mossy, meteor_brick_mossy.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(meteor_brick_cracked, meteor_brick_cracked.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(meteor_brick_chiseled, meteor_brick_chiseled.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(meteor_pillar, meteor_pillar.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(tape_recorder, tape_recorder.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(steel_poles, steel_poles.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(pole_top, pole_top.getUnlocalizedName());
|
||||
@ -1798,6 +1818,7 @@ public class ModBlocks {
|
||||
GameRegistry.registerBlock(crate_metal, crate_metal.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(crate_red, crate_red.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(crate_can, crate_can.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(crate_ammo, crate_ammo.getUnlocalizedName());
|
||||
|
||||
//ElB
|
||||
GameRegistry.registerBlock(statue_elb, statue_elb.getUnlocalizedName());
|
||||
|
||||
76
com/hbm/blocks/generic/BlockAmmoCrate.java
Normal file
@ -0,0 +1,76 @@
|
||||
package com.hbm.blocks.generic;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.lib.RefStrings;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockAmmoCrate extends Block {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon iconTop;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon iconBottom;
|
||||
|
||||
public BlockAmmoCrate(Material p_i45394_1_) {
|
||||
super(p_i45394_1_);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister iconRegister) {
|
||||
|
||||
this.iconTop = iconRegister.registerIcon(RefStrings.MODID + ":crate_ammo_top");
|
||||
this.iconBottom = iconRegister.registerIcon(RefStrings.MODID + ":crate_ammo_bottom");
|
||||
this.blockIcon = iconRegister.registerIcon(RefStrings.MODID + ":crate_ammo_side");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int metadata) {
|
||||
return side == 0 ? this.iconBottom : (side == 1 ? this.iconTop : this.blockIcon);
|
||||
}
|
||||
|
||||
Random rand = new Random();
|
||||
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune) {
|
||||
|
||||
ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
|
||||
|
||||
ret.add(new ItemStack(ModItems.cap_nuka, 12 + rand.nextInt(21)));
|
||||
ret.add(new ItemStack(ModItems.syringe_metal_stimpak, 1 + rand.nextInt(3)));
|
||||
|
||||
if(rand.nextBoolean()) ret.add(new ItemStack(ModItems.ammo_22lr, 16 + rand.nextInt(17)));
|
||||
if(rand.nextBoolean()) ret.add(new ItemStack(ModItems.ammo_9mm, 6 + rand.nextInt(13)));
|
||||
if(rand.nextBoolean()) ret.add(new ItemStack(ModItems.ammo_12gauge, 6 + rand.nextInt(4)));
|
||||
if(rand.nextBoolean()) ret.add(new ItemStack(ModItems.ammo_20gauge, 3 + rand.nextInt(4)));
|
||||
if(rand.nextBoolean()) ret.add(new ItemStack(ModItems.gun_revolver_ammo, 10 + rand.nextInt(11)));
|
||||
if(rand.nextBoolean()) ret.add(new ItemStack(ModItems.gun_revolver_iron_ammo, 12 + rand.nextInt(15)));
|
||||
if(rand.nextBoolean()) ret.add(new ItemStack(ModItems.ammo_50bmg, 2 + rand.nextInt(7)));
|
||||
if(rand.nextBoolean()) ret.add(new ItemStack(ModItems.ammo_rocket, 1));
|
||||
if(rand.nextBoolean()) ret.add(new ItemStack(ModItems.ammo_grenade, 1 + rand.nextInt(2)));
|
||||
|
||||
if(rand.nextInt(10) == 0) ret.add(new ItemStack(ModItems.ammo_12gauge_incendiary, 3));
|
||||
if(rand.nextInt(10) == 0) ret.add(new ItemStack(ModItems.ammo_20gauge_incendiary, 3));
|
||||
if(rand.nextInt(10) == 0) ret.add(new ItemStack(ModItems.ammo_20gauge_caustic, 3));
|
||||
if(rand.nextInt(10) == 0) ret.add(new ItemStack(ModItems.ammo_20gauge_flechette, 3));
|
||||
if(rand.nextInt(10) == 0) ret.add(new ItemStack(ModItems.ammo_9mm_ap, 7));
|
||||
if(rand.nextInt(10) == 0) ret.add(new ItemStack(ModItems.ammo_rocket_incendiary, 1));
|
||||
if(rand.nextInt(10) == 0) ret.add(new ItemStack(ModItems.ammo_rocket_sleek, 1));
|
||||
if(rand.nextInt(10) == 0) ret.add(new ItemStack(ModItems.ammo_grenade_he, 1));
|
||||
if(rand.nextInt(10) == 0) ret.add(new ItemStack(ModItems.ammo_grenade_incendiary, 1));
|
||||
if(rand.nextInt(10) == 0) ret.add(new ItemStack(ModItems.ammo_grenade_sleek, 1));
|
||||
if(rand.nextInt(10) == 0) ret.add(new ItemStack(ModItems.syringe_metal_super, 2));
|
||||
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
33
com/hbm/blocks/generic/BlockGenericPillar.java
Normal file
@ -0,0 +1,33 @@
|
||||
package com.hbm.blocks.generic;
|
||||
|
||||
import com.hbm.lib.RefStrings;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.BlockRotatedPillar;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
public class BlockGenericPillar extends BlockRotatedPillar {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
protected IIcon iconSide;
|
||||
|
||||
public BlockGenericPillar(Material p_i45425_1_) {
|
||||
super(p_i45425_1_);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister reg)
|
||||
{
|
||||
this.field_150164_N = reg.registerIcon(RefStrings.MODID + ":meteor_pillar_top");
|
||||
this.iconSide = reg.registerIcon(RefStrings.MODID + ":meteor_pillar");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected IIcon getSideIcon(int p_150163_1_) {
|
||||
return iconSide;
|
||||
}
|
||||
|
||||
}
|
||||
@ -3,7 +3,7 @@ package com.hbm.blocks.generic;
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.world.HugeMush;
|
||||
import com.hbm.world.feature.HugeMush;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.IGrowable;
|
||||
|
||||
@ -4,7 +4,7 @@ import com.hbm.entity.particle.EntityGasFlameFX;
|
||||
import com.hbm.entity.particle.EntitySmokeFX;
|
||||
import com.hbm.explosion.ExplosionLarge;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.world.Meteorite;
|
||||
import com.hbm.world.feature.Meteorite;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@ -2916,19 +2916,19 @@ public class ModItems {
|
||||
grenade_pink_cloud = new ItemGrenade(-1).setUnlocalizedName("grenade_pink_cloud").setCreativeTab(null).setTextureName(RefStrings.MODID + ":grenade_pink_cloud");
|
||||
ullapool_caber = new WeaponSpecial(MainRegistry.enumToolMaterialSteel).setUnlocalizedName("ullapool_caber").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":ullapool_caber");
|
||||
|
||||
grenade_if_generic = new ItemGrenade(4).setUnlocalizedName("grenade_if_generic").setCreativeTab(null).setTextureName(RefStrings.MODID + ":grenade_if_generic");
|
||||
grenade_if_he = new ItemGrenade(5).setUnlocalizedName("grenade_if_he").setCreativeTab(null).setTextureName(RefStrings.MODID + ":grenade_if_he");
|
||||
grenade_if_bouncy = new ItemGrenade(4).setUnlocalizedName("grenade_if_bouncy").setCreativeTab(null).setTextureName(RefStrings.MODID + ":grenade_if_bouncy");
|
||||
grenade_if_sticky = new ItemGrenade(4).setUnlocalizedName("grenade_if_sticky").setCreativeTab(null).setTextureName(RefStrings.MODID + ":grenade_if_sticky");
|
||||
grenade_if_impact = new ItemGrenade(-1).setUnlocalizedName("grenade_if_impact").setCreativeTab(null).setTextureName(RefStrings.MODID + ":grenade_if_impact");
|
||||
grenade_if_incendiary = new ItemGrenade(4).setUnlocalizedName("grenade_if_incendiary").setCreativeTab(null).setTextureName(RefStrings.MODID + ":grenade_if_incendiary");
|
||||
grenade_if_toxic = new ItemGrenade(4).setUnlocalizedName("grenade_if_toxic").setCreativeTab(null).setTextureName(RefStrings.MODID + ":grenade_if_toxic");
|
||||
grenade_if_concussion = new ItemGrenade(4).setUnlocalizedName("grenade_if_concussion").setCreativeTab(null).setTextureName(RefStrings.MODID + ":grenade_if_concussion");
|
||||
grenade_if_brimstone = new ItemGrenade(5).setUnlocalizedName("grenade_if_brimstone").setCreativeTab(null).setTextureName(RefStrings.MODID + ":grenade_if_brimstone");
|
||||
grenade_if_mystery = new ItemGrenade(5).setUnlocalizedName("grenade_if_mystery").setCreativeTab(null).setTextureName(RefStrings.MODID + ":grenade_if_mystery");
|
||||
grenade_if_spark = new ItemGrenade(7).setUnlocalizedName("grenade_if_spark").setCreativeTab(null).setTextureName(RefStrings.MODID + ":grenade_if_spark");
|
||||
grenade_if_hopwire = new ItemGrenade(7).setUnlocalizedName("grenade_if_hopwire").setCreativeTab(null).setTextureName(RefStrings.MODID + ":grenade_if_hopwire");
|
||||
grenade_if_null = new ItemGrenade(7).setUnlocalizedName("grenade_if_null").setCreativeTab(null).setTextureName(RefStrings.MODID + ":grenade_if_null");
|
||||
grenade_if_generic = new ItemGrenade(4).setUnlocalizedName("grenade_if_generic").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":grenade_if_generic");
|
||||
grenade_if_he = new ItemGrenade(5).setUnlocalizedName("grenade_if_he").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":grenade_if_he");
|
||||
grenade_if_bouncy = new ItemGrenade(4).setUnlocalizedName("grenade_if_bouncy").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":grenade_if_bouncy");
|
||||
grenade_if_sticky = new ItemGrenade(4).setUnlocalizedName("grenade_if_sticky").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":grenade_if_sticky");
|
||||
grenade_if_impact = new ItemGrenade(-1).setUnlocalizedName("grenade_if_impact").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":grenade_if_impact");
|
||||
grenade_if_incendiary = new ItemGrenade(4).setUnlocalizedName("grenade_if_incendiary").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":grenade_if_incendiary");
|
||||
grenade_if_toxic = new ItemGrenade(4).setUnlocalizedName("grenade_if_toxic").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":grenade_if_toxic");
|
||||
grenade_if_concussion = new ItemGrenade(4).setUnlocalizedName("grenade_if_concussion").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":grenade_if_concussion");
|
||||
grenade_if_brimstone = new ItemGrenade(5).setUnlocalizedName("grenade_if_brimstone").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":grenade_if_brimstone");
|
||||
grenade_if_mystery = new ItemGrenade(5).setUnlocalizedName("grenade_if_mystery").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":grenade_if_mystery");
|
||||
grenade_if_spark = new ItemGrenade(7).setUnlocalizedName("grenade_if_spark").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":grenade_if_spark");
|
||||
grenade_if_hopwire = new ItemGrenade(7).setUnlocalizedName("grenade_if_hopwire").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":grenade_if_hopwire");
|
||||
grenade_if_null = new ItemGrenade(7).setUnlocalizedName("grenade_if_null").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":grenade_if_null");
|
||||
|
||||
grenade_smart = new ItemGrenade(-1).setUnlocalizedName("grenade_smart").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":grenade_smart");
|
||||
grenade_mirv = new ItemGrenade(1).setUnlocalizedName("grenade_mirv").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":grenade_mirv");
|
||||
|
||||
@ -2,57 +2,32 @@ package com.hbm.items.tool;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.tileentity.conductor.TileEntityPylonRedWire;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.world.generator.CellularDungeonFactory;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class ItemWandD extends Item {
|
||||
|
||||
@Override
|
||||
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int p_77648_7_, float p_77648_8_, float p_77648_9_, float p_77648_10_)
|
||||
{
|
||||
Block b = world.getBlock(x, y, z);
|
||||
|
||||
if(!world.isRemote)
|
||||
{
|
||||
if (b == ModBlocks.ore_aluminium)
|
||||
MainRegistry.x++;
|
||||
if (b == ModBlocks.block_aluminium)
|
||||
MainRegistry.x--;
|
||||
if (b == ModBlocks.ore_beryllium)
|
||||
MainRegistry.y++;
|
||||
if (b == ModBlocks.block_beryllium)
|
||||
MainRegistry.y--;
|
||||
if (b == ModBlocks.ore_copper)
|
||||
MainRegistry.z++;
|
||||
if (b == ModBlocks.block_copper)
|
||||
MainRegistry.z--;
|
||||
if (b == ModBlocks.red_pylon) {
|
||||
TileEntityPylonRedWire te = (TileEntityPylonRedWire) world.getTileEntity(x, y, z);
|
||||
for(int i = 0; i < te.connected.size(); i++)
|
||||
if(world.isRemote)
|
||||
player.addChatMessage(new ChatComponentText(te.connected.get(i).xCoord + " " + te.connected.get(i).yCoord + " " + te.connected.get(i).zCoord));
|
||||
}
|
||||
}
|
||||
|
||||
MainRegistry.time = System.currentTimeMillis();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) {
|
||||
if(player.isSneaking())
|
||||
{
|
||||
if(world.isRemote)
|
||||
player.addChatMessage(new ChatComponentText(MainRegistry.x + " " + MainRegistry.y + " " + MainRegistry.z));
|
||||
|
||||
if(world.isRemote)
|
||||
return stack;
|
||||
|
||||
MovingObjectPosition pos = Library.rayTrace(player, 500, 1);
|
||||
|
||||
if(pos != null) {
|
||||
|
||||
int x = pos.blockX;
|
||||
int y = pos.blockY;
|
||||
int z = pos.blockZ;
|
||||
|
||||
CellularDungeonFactory.test.generate(world, x, y, z, world.rand);
|
||||
}
|
||||
|
||||
return stack;
|
||||
|
||||
@ -3,12 +3,12 @@ package com.hbm.items.tool;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.world.FWatz;
|
||||
import com.hbm.world.FactoryAdvanced;
|
||||
import com.hbm.world.FactoryTitanium;
|
||||
import com.hbm.world.FusionReactor;
|
||||
import com.hbm.world.NuclearReactor;
|
||||
import com.hbm.world.Watz;
|
||||
import com.hbm.world.machine.FWatz;
|
||||
import com.hbm.world.machine.FactoryAdvanced;
|
||||
import com.hbm.world.machine.FactoryTitanium;
|
||||
import com.hbm.world.machine.FusionReactor;
|
||||
import com.hbm.world.machine.NuclearReactor;
|
||||
import com.hbm.world.machine.Watz;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
|
||||
@ -5,25 +5,25 @@ import java.util.Random;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.tileentity.machine.TileEntitySafe;
|
||||
import com.hbm.world.Antenna;
|
||||
import com.hbm.world.Barrel;
|
||||
import com.hbm.world.Bunker;
|
||||
import com.hbm.world.CrashedVertibird;
|
||||
import com.hbm.world.DesertAtom001;
|
||||
import com.hbm.world.Dud;
|
||||
import com.hbm.world.Factory;
|
||||
import com.hbm.world.Geyser;
|
||||
import com.hbm.world.GeyserLarge;
|
||||
import com.hbm.world.LibraryDungeon;
|
||||
import com.hbm.world.OilBubble;
|
||||
import com.hbm.world.OilSandBubble;
|
||||
import com.hbm.world.Radio01;
|
||||
import com.hbm.world.Relay;
|
||||
import com.hbm.world.Satellite;
|
||||
import com.hbm.world.Sellafield;
|
||||
import com.hbm.world.Silo;
|
||||
import com.hbm.world.Spaceship;
|
||||
import com.hbm.world.Vertibird;
|
||||
import com.hbm.world.dungeon.Antenna;
|
||||
import com.hbm.world.dungeon.Barrel;
|
||||
import com.hbm.world.dungeon.Bunker;
|
||||
import com.hbm.world.dungeon.CrashedVertibird;
|
||||
import com.hbm.world.dungeon.DesertAtom001;
|
||||
import com.hbm.world.dungeon.Factory;
|
||||
import com.hbm.world.dungeon.LibraryDungeon;
|
||||
import com.hbm.world.dungeon.Radio01;
|
||||
import com.hbm.world.dungeon.Relay;
|
||||
import com.hbm.world.dungeon.Satellite;
|
||||
import com.hbm.world.dungeon.Silo;
|
||||
import com.hbm.world.dungeon.Spaceship;
|
||||
import com.hbm.world.dungeon.Vertibird;
|
||||
import com.hbm.world.feature.Dud;
|
||||
import com.hbm.world.feature.Geyser;
|
||||
import com.hbm.world.feature.GeyserLarge;
|
||||
import com.hbm.world.feature.OilBubble;
|
||||
import com.hbm.world.feature.OilSandBubble;
|
||||
import com.hbm.world.feature.Sellafield;
|
||||
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.tileentity.TileEntityChest;
|
||||
|
||||
@ -62,6 +62,7 @@ import com.hbm.tileentity.conductor.*;
|
||||
import com.hbm.tileentity.deco.*;
|
||||
import com.hbm.tileentity.machine.*;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineReactorLarge.ReactorFuelType;
|
||||
import com.hbm.world.generator.CellularDungeonFactory;
|
||||
|
||||
import cpw.mods.fml.common.SidedProxy;
|
||||
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||
@ -353,6 +354,7 @@ public class MainRegistry
|
||||
GameRegistry.registerFuelHandler(new FuelHandler());
|
||||
HbmPotion.init();
|
||||
BulletConfigSyncingUtil.loadConfigsForSync();
|
||||
CellularDungeonFactory.init();
|
||||
|
||||
Library.superuser.add("192af5d7-ed0f-48d8-bd89-9d41af8524f8");
|
||||
Library.superuser.add("5aee1e3d-3767-4987-a222-e7ce1fbdf88e");
|
||||
|
||||
@ -69,6 +69,9 @@ public class NBTPacket implements IMessage {
|
||||
@Override
|
||||
public IMessage onMessage(NBTPacket m, MessageContext ctx) {
|
||||
|
||||
if(Minecraft.getMinecraft().theWorld == null)
|
||||
return null;
|
||||
|
||||
TileEntity te = Minecraft.getMinecraft().theWorld.getTileEntity(m.x, m.y, m.z);
|
||||
|
||||
if(!(te instanceof TileEntityMachineBase))
|
||||
|
||||
@ -6,11 +6,11 @@ import org.lwjgl.opengl.GL14;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.tileentity.machine.TileEntityStructureMarker;
|
||||
import com.hbm.world.FWatz;
|
||||
import com.hbm.world.FactoryTitanium;
|
||||
import com.hbm.world.FusionReactor;
|
||||
import com.hbm.world.NuclearReactor;
|
||||
import com.hbm.world.Watz;
|
||||
import com.hbm.world.machine.FWatz;
|
||||
import com.hbm.world.machine.FactoryTitanium;
|
||||
import com.hbm.world.machine.FusionReactor;
|
||||
import com.hbm.world.machine.NuclearReactor;
|
||||
import com.hbm.world.machine.Watz;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
|
||||
@ -15,7 +15,7 @@ import com.hbm.items.ModItems;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.packet.AuxElectricityPacket;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.world.FWatz;
|
||||
import com.hbm.world.machine.FWatz;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
//Schematic to java Structure by jajo_11 | inspired by "MITHION'S .SCHEMATIC TO JAVA CONVERTINGTOOL"
|
||||
|
||||
package com.hbm.world;
|
||||
package com.hbm.world.dungeon;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
//Schematic to java Structure by jajo_11 | inspired by "MITHION'S .SCHEMATIC TO JAVA CONVERTINGTOOL"
|
||||
|
||||
package com.hbm.world;
|
||||
package com.hbm.world.dungeon;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
//Schematic to java Structure by jajo_11 | inspired by "MITHION'S .SCHEMATIC TO JAVA CONVERTINGTOOL"
|
||||
|
||||
package com.hbm.world;
|
||||
package com.hbm.world.dungeon;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
//Schematic to java Structure by jajo_11 | inspired by "MITHION'S .SCHEMATIC TO JAVA CONVERTINGTOOL"
|
||||
|
||||
package com.hbm.world;
|
||||
package com.hbm.world.dungeon;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
//Schematic to java Structure by jajo_11 | inspired by "MITHION'S .SCHEMATIC TO JAVA CONVERTINGTOOL"
|
||||
|
||||
package com.hbm.world;
|
||||
package com.hbm.world.dungeon;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
//Schematic to java Structure by jajo_11 | inspired by "MITHION'S.SCHEMATIC TO JAVA CONVERTINGTOOL"
|
||||
|
||||
package com.hbm.world;
|
||||
package com.hbm.world.dungeon;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
//Schematic to java Structure by jajo_11 | inspired by "MITHION'S.SCHEMATIC TO JAVA CONVERTINGTOOL"
|
||||
|
||||
package com.hbm.world;
|
||||
package com.hbm.world.dungeon;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
//Schematic to java Structure by jajo_11 | inspired by "MITHION'S .SCHEMATIC TO JAVA CONVERTINGTOOL"
|
||||
|
||||
package com.hbm.world;
|
||||
package com.hbm.world.dungeon;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
//Schematic to java Structure by jajo_11 | inspired by "MITHION'S .SCHEMATIC TO JAVA CONVERTINGTOOL"
|
||||
|
||||
package com.hbm.world;
|
||||
package com.hbm.world.dungeon;
|
||||
|
||||
import static net.minecraftforge.common.ChestGenHooks.DUNGEON_CHEST;
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
//Schematic to java Structure by jajo_11 | inspired by "MITHION'S .SCHEMATIC TO JAVA CONVERTINGTOOL"
|
||||
|
||||
package com.hbm.world;
|
||||
package com.hbm.world.dungeon;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
//Schematic to java Structure by jajo_11 | inspired by "MITHION'S.SCHEMATIC TO JAVA CONVERTINGTOOL"
|
||||
|
||||
package com.hbm.world;
|
||||
package com.hbm.world.dungeon;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
//Schematic to java Structure by jajo_11 | inspired by "MITHION'S .SCHEMATIC TO JAVA CONVERTINGTOOL"
|
||||
|
||||
package com.hbm.world;
|
||||
package com.hbm.world.dungeon;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
//Schematic to java Structure by jajo_11 | inspired by "MITHION'S .SCHEMATIC TO JAVA CONVERTINGTOOL"
|
||||
|
||||
package com.hbm.world;
|
||||
package com.hbm.world.dungeon;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
//Schematic to java Structure by jajo_11 | inspired by "MITHION'S .SCHEMATIC TO JAVA CONVERTINGTOOL"
|
||||
|
||||
package com.hbm.world;
|
||||
package com.hbm.world.dungeon;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
//Schematic to java Structure by jajo_11 | inspired by "MITHION'S .SCHEMATIC TO JAVA CONVERTINGTOOL"
|
||||
|
||||
package com.hbm.world;
|
||||
package com.hbm.world.dungeon;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
//Schematic to java Structure by jajo_11 | inspired by "MITHION'S.SCHEMATIC TO JAVA CONVERTINGTOOL"
|
||||
|
||||
package com.hbm.world;
|
||||
package com.hbm.world.dungeon;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
//Schematic to java Structure by jajo_11 | inspired by "MITHION'S .SCHEMATIC TO JAVA CONVERTINGTOOL"
|
||||
|
||||
package com.hbm.world;
|
||||
package com.hbm.world.dungeon;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
package com.hbm.world;
|
||||
package com.hbm.world.feature;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
//Schematic to java Structure by jajo_11 | inspired by "MITHION'S .SCHEMATIC TO JAVA CONVERTINGTOOL"
|
||||
|
||||
package com.hbm.world;
|
||||
package com.hbm.world.feature;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
//Schematic to java Structure by jajo_11 | inspired by "MITHION'S .SCHEMATIC TO JAVA CONVERTINGTOOL"
|
||||
|
||||
package com.hbm.world;
|
||||
package com.hbm.world.feature;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
package com.hbm.world;
|
||||
package com.hbm.world.feature;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
package com.hbm.world;
|
||||
package com.hbm.world.feature;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@ -1,4 +1,4 @@
|
||||
package com.hbm.world;
|
||||
package com.hbm.world.feature;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
package com.hbm.world;
|
||||
package com.hbm.world.feature;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
package com.hbm.world;
|
||||
package com.hbm.world.feature;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
145
com/hbm/world/generator/CellularDungeon.java
Normal file
@ -0,0 +1,145 @@
|
||||
package com.hbm.world.generator;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class CellularDungeon {
|
||||
|
||||
//a buffer "map" of the rooms being generated before being spawned in
|
||||
CellularDungeonRoom[][] cells;
|
||||
ForgeDirection[][] doors;
|
||||
//the order in which the buffer should be processed
|
||||
List<int[]> order = new ArrayList();
|
||||
|
||||
//the size of the cell array x
|
||||
int dimX;
|
||||
//the size of the cell array z
|
||||
int dimZ;
|
||||
//the base width (and length) of a room
|
||||
public int width;
|
||||
//the height of a room
|
||||
public int height;
|
||||
//list of random floor blocks with equal weight
|
||||
public List<Block> floor = new ArrayList();
|
||||
//list of random ceiling blocks with equal weight
|
||||
public List<Block> ceiling = new ArrayList();
|
||||
//list of random wall blocks with equal weight
|
||||
public List<Block> wall = new ArrayList();
|
||||
//the rooms that the dungeon can use
|
||||
public List<CellularDungeonRoom> rooms = new ArrayList();
|
||||
int tries;
|
||||
|
||||
public CellularDungeon(int width, int height, int dimX, int dimZ, int tries) {
|
||||
|
||||
this.dimX = dimX;
|
||||
this.dimZ = dimZ;
|
||||
this.width = width;
|
||||
this.height = height;
|
||||
this.tries = tries;
|
||||
}
|
||||
|
||||
public CellularDungeon(int width, int height, int dimX, int dimZ, int tries, Block floor, Block ceiling, Block wall) {
|
||||
|
||||
this.dimX = dimX;
|
||||
this.dimZ = dimZ;
|
||||
this.width = width;
|
||||
this.height = height;
|
||||
this.tries = tries;
|
||||
this.floor.add(floor);
|
||||
this.ceiling.add(ceiling);
|
||||
this.wall.add(wall);
|
||||
}
|
||||
|
||||
public void generate(World world, int x, int y, int z, Random rand) {
|
||||
|
||||
compose(rand);
|
||||
|
||||
for(int[] coord : order) {
|
||||
|
||||
if(coord == null || coord.length != 2)
|
||||
continue;
|
||||
|
||||
int dx = coord[0];
|
||||
int dz = coord[1];
|
||||
|
||||
if(cells[dx][dz] != null) {
|
||||
|
||||
if(doors[dx][dz] == null)
|
||||
doors[dx][dz] = ForgeDirection.UNKNOWN;
|
||||
|
||||
cells[dx][dz].generate(world, x + dx * (width - 1), y, z + dz * (width - 1), doors[dx][dz]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int rec = 0;
|
||||
public void compose(Random rand) {
|
||||
|
||||
cells = new CellularDungeonRoom[dimX][dimZ];
|
||||
doors = new ForgeDirection[dimX][dimZ];
|
||||
order.clear();
|
||||
|
||||
int startX = dimX / 2;
|
||||
int startZ = dimZ / 2;
|
||||
|
||||
cells[startX][startZ] = DungeonToolbox.getRandom(rooms, rand);
|
||||
doors[startX][startZ] = ForgeDirection.UNKNOWN;
|
||||
order.add(new int[] { startX, startZ });
|
||||
|
||||
rec = 0;
|
||||
addRoom(startX, startZ, rand, ForgeDirection.UNKNOWN, DungeonToolbox.getRandom(rooms, rand));
|
||||
}
|
||||
|
||||
//if x and z are occupied, it will just use the next nearby random space
|
||||
private boolean addRoom(int x, int z, Random rand, ForgeDirection door, CellularDungeonRoom room) {
|
||||
|
||||
rec++;
|
||||
if(rec > tries)
|
||||
return false;
|
||||
|
||||
if(x < 0 || z < 0 || x >= dimX || z >= dimZ)
|
||||
return false;
|
||||
|
||||
if(cells[x][z] != null) {
|
||||
|
||||
ForgeDirection dir = getRandomDir(rand);
|
||||
addRoom(x + dir.offsetX, z + dir.offsetZ, rand, dir.getOpposite(), DungeonToolbox.getRandom(rooms, rand));
|
||||
return false;
|
||||
}
|
||||
|
||||
//CellularDungeonRoom next = DungeonToolbox.getRandom(rooms, rand);
|
||||
|
||||
if(room.daisyChain == null || addRoom(x + room.daisyDirection.offsetX, z + room.daisyDirection.offsetZ, rand, ForgeDirection.UNKNOWN, room.daisyChain)) {
|
||||
cells[x][z] = room;
|
||||
doors[x][z] = door;
|
||||
order.add(new int[] { x, z });
|
||||
}
|
||||
|
||||
//if(room.daisyChain == null)
|
||||
for(int i = 0; i < 3; i++) {
|
||||
ForgeDirection dir = getRandomDir(rand);
|
||||
addRoom(x + dir.offsetX, z + dir.offsetZ, rand, dir.getOpposite(), DungeonToolbox.getRandom(rooms, rand));
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/*public boolean addDaisychain(int x, int z, Random rand, ForgeDirection door, CellularDungeonRoom room) {
|
||||
|
||||
if(x < 0 || z < 0 || x >= dimX || z >= dimZ)
|
||||
return false;
|
||||
|
||||
if(cells[x][z] != null)
|
||||
return false;
|
||||
}*/
|
||||
|
||||
public static ForgeDirection getRandomDir(Random rand) {
|
||||
|
||||
return ForgeDirection.getOrientation(rand.nextInt(4) + 2);
|
||||
}
|
||||
}
|
||||
20
com/hbm/world/generator/CellularDungeonFactory.java
Normal file
@ -0,0 +1,20 @@
|
||||
package com.hbm.world.generator;
|
||||
|
||||
import com.hbm.world.generator.room.*;
|
||||
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class CellularDungeonFactory {
|
||||
|
||||
public static CellularDungeon test;
|
||||
|
||||
public static void init() {
|
||||
|
||||
test = new TestDungeon(11, 7, 11, 11, 150);
|
||||
test.rooms.add(new TestDungeonRoom1(test));
|
||||
test.rooms.add(new TestDungeonRoom2(test));
|
||||
test.rooms.add(new TestDungeonRoom3(test));
|
||||
test.rooms.add(new TestDungeonRoom4(test, new TestDungeonRoom5(test), ForgeDirection.NORTH));
|
||||
}
|
||||
|
||||
}
|
||||
67
com/hbm/world/generator/CellularDungeonRoom.java
Normal file
@ -0,0 +1,67 @@
|
||||
package com.hbm.world.generator;
|
||||
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class CellularDungeonRoom {
|
||||
|
||||
protected CellularDungeon parent;
|
||||
protected CellularDungeonRoom daisyChain = null;
|
||||
protected ForgeDirection daisyDirection = ForgeDirection.UNKNOWN;
|
||||
|
||||
public CellularDungeonRoom(CellularDungeon parent) {
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
//per generation, only one door can be made. rooms having multiple doors will be the consequence of daisychaining.
|
||||
//the initial room will use an invalid type to not spawn any doors.
|
||||
public void generate(World world, int x, int y, int z, ForgeDirection door) {
|
||||
|
||||
generateMain(world, x, y, z);
|
||||
|
||||
for(int i = 2; i < 6; i++) {
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(i);
|
||||
generateWall(world, x, y, z, dir, dir == door);
|
||||
}
|
||||
}
|
||||
|
||||
public void generateMain(World world, int x, int y, int z) {
|
||||
|
||||
DungeonToolbox.generateBox(world, x, y, z, parent.width, 1, parent.width, parent.floor);
|
||||
DungeonToolbox.generateBox(world, x, y + 1, z, parent.width, parent.height - 1, parent.width, Blocks.air);
|
||||
DungeonToolbox.generateBox(world, x, y + parent.height - 1, z, parent.width, 1, parent.width, parent.ceiling);
|
||||
}
|
||||
|
||||
public void generateWall(World world, int x, int y, int z, ForgeDirection wall, boolean door) {
|
||||
|
||||
if(wall == ForgeDirection.NORTH) {
|
||||
DungeonToolbox.generateBox(world, x, y + 1, z, parent.width, parent.height - 2, 1, parent.wall);
|
||||
|
||||
if(door)
|
||||
DungeonToolbox.generateBox(world, x + parent.width / 2, y + 1, z, 1, 2, 1, Blocks.air);
|
||||
}
|
||||
|
||||
if(wall == ForgeDirection.SOUTH) {
|
||||
DungeonToolbox.generateBox(world, x, y + 1, z + parent.width - 1, parent.width, parent.height - 2, 1, parent.wall);
|
||||
|
||||
if(door)
|
||||
DungeonToolbox.generateBox(world, x + parent.width / 2, y + 1, z + parent.width - 1, 1, 2, 1, Blocks.air);
|
||||
}
|
||||
|
||||
if(wall == ForgeDirection.WEST) {
|
||||
DungeonToolbox.generateBox(world, x, y + 1, z, 1, parent.height - 2, parent.width, parent.wall);
|
||||
|
||||
if(door)
|
||||
DungeonToolbox.generateBox(world, x, y + 1, z + parent.width / 2, 1, 2, 1, Blocks.air);
|
||||
}
|
||||
|
||||
if(wall == ForgeDirection.EAST) {
|
||||
DungeonToolbox.generateBox(world, x + parent.width - 1, y + 1, z, 1, parent.height - 2, parent.width, parent.wall);
|
||||
|
||||
if(door)
|
||||
DungeonToolbox.generateBox(world, x + parent.width - 1, y + 1, z + parent.width / 2, 1, 2, 1, Blocks.air);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
59
com/hbm/world/generator/DungeonToolbox.java
Normal file
@ -0,0 +1,59 @@
|
||||
package com.hbm.world.generator;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class DungeonToolbox {
|
||||
|
||||
|
||||
public static void generateBox(World world, int x, int y, int z, int sx, int sy, int sz, List<Block> blocks) {
|
||||
|
||||
if(blocks.isEmpty())
|
||||
return;
|
||||
|
||||
for(int i = x; i < x + sx; i++) {
|
||||
|
||||
for(int j = y; j < y + sy; j++) {
|
||||
|
||||
for(int k = z; k < z + sz; k++) {
|
||||
|
||||
Block b = getRandom(blocks, world.rand);
|
||||
world.setBlock(i, j, k, b, 0, 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//i know it's copy paste, but it's a better strat than using a wrapper and generating single-entry lists for no good reason
|
||||
public static void generateBox(World world, int x, int y, int z, int sx, int sy, int sz, Block block) {
|
||||
|
||||
for(int i = x; i < x + sx; i++) {
|
||||
|
||||
for(int j = y; j < y + sy; j++) {
|
||||
|
||||
for(int k = z; k < z + sz; k++) {
|
||||
|
||||
world.setBlock(i, j, k, block, 0, 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//now with vectors to provide handy rotations
|
||||
public static void generateBox(World world, int x, int y, int z, Vec3 size, List<Block> blocks) {
|
||||
|
||||
generateBox(world, x, y, z, (int)size.xCoord, (int)size.yCoord, (int)size.zCoord, blocks);
|
||||
}
|
||||
|
||||
public static <T> T getRandom(List<T> list, Random rand) {
|
||||
|
||||
if(list.isEmpty())
|
||||
return null;
|
||||
|
||||
return list.get(rand.nextInt(list.size()));
|
||||
}
|
||||
}
|
||||
18
com/hbm/world/generator/TestDungeon.java
Normal file
@ -0,0 +1,18 @@
|
||||
package com.hbm.world.generator;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
|
||||
public class TestDungeon extends CellularDungeon {
|
||||
|
||||
public TestDungeon(int width, int height, int dimX, int dimZ, int tries) {
|
||||
super(width, height, dimX, dimZ, tries);
|
||||
|
||||
this.floor.add(ModBlocks.meteor_polished);
|
||||
this.wall.add(ModBlocks.meteor_brick);
|
||||
this.wall.add(ModBlocks.meteor_brick);
|
||||
this.wall.add(ModBlocks.meteor_brick_mossy);
|
||||
this.wall.add(ModBlocks.meteor_brick_cracked);
|
||||
this.ceiling.add(ModBlocks.block_meteor_broken);
|
||||
}
|
||||
|
||||
}
|
||||
31
com/hbm/world/generator/room/TestDungeonRoom1.java
Normal file
@ -0,0 +1,31 @@
|
||||
package com.hbm.world.generator.room;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.world.generator.CellularDungeon;
|
||||
import com.hbm.world.generator.CellularDungeonRoom;
|
||||
import com.hbm.world.generator.DungeonToolbox;
|
||||
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class TestDungeonRoom1 extends CellularDungeonRoom {
|
||||
|
||||
public TestDungeonRoom1(CellularDungeon parent) {
|
||||
super(parent);
|
||||
}
|
||||
|
||||
public void generateMain(World world, int x, int y, int z) {
|
||||
|
||||
super.generateMain(world, x, y, z);
|
||||
DungeonToolbox.generateBox(world, x + parent.width / 2 - 3, y + 1, z + parent.width / 2 - 3, 1, parent.height - 2, 1, ModBlocks.meteor_pillar);
|
||||
DungeonToolbox.generateBox(world, x + parent.width / 2 + 3, y + 1, z + parent.width / 2 - 3, 1, parent.height - 2, 1, ModBlocks.meteor_pillar);
|
||||
DungeonToolbox.generateBox(world, x + parent.width / 2 + 3, y + 1, z + parent.width / 2 + 3, 1, parent.height - 2, 1, ModBlocks.meteor_pillar);
|
||||
DungeonToolbox.generateBox(world, x + parent.width / 2 - 3, y + 1, z + parent.width / 2 + 3, 1, parent.height - 2, 1, ModBlocks.meteor_pillar);
|
||||
world.setBlock(x + parent.width / 2 - 3, y + 3, z + parent.width / 2 - 3, ModBlocks.meteor_brick_chiseled, 0, 2);
|
||||
world.setBlock(x + parent.width / 2 + 3, y + 3, z + parent.width / 2 - 3, ModBlocks.meteor_brick_chiseled, 0, 2);
|
||||
world.setBlock(x + parent.width / 2 + 3, y + 3, z + parent.width / 2 + 3, ModBlocks.meteor_brick_chiseled, 0, 2);
|
||||
world.setBlock(x + parent.width / 2 - 3, y + 3, z + parent.width / 2 + 3, ModBlocks.meteor_brick_chiseled, 0, 2);
|
||||
world.setBlock(x + parent.width / 2, y + 1, z + parent.width / 2, ModBlocks.meteor_pillar, 0, 2);
|
||||
world.setBlock(x + parent.width / 2, y + 2, z + parent.width / 2, Blocks.glowstone, 0, 3);
|
||||
}
|
||||
}
|
||||
34
com/hbm/world/generator/room/TestDungeonRoom2.java
Normal file
@ -0,0 +1,34 @@
|
||||
package com.hbm.world.generator.room;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.world.generator.CellularDungeon;
|
||||
import com.hbm.world.generator.CellularDungeonRoom;
|
||||
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class TestDungeonRoom2 extends CellularDungeonRoom {
|
||||
|
||||
public TestDungeonRoom2(CellularDungeon parent) {
|
||||
super(parent);
|
||||
}
|
||||
|
||||
public void generateMain(World world, int x, int y, int z) {
|
||||
|
||||
super.generateMain(world, x, y, z);
|
||||
|
||||
int j = world.rand.nextInt(2) + 2;
|
||||
int k = world.rand.nextInt(3) + 2;
|
||||
|
||||
for(int i = 0; i < j; i++) {
|
||||
int dx = world.rand.nextInt(parent.width - 6) + 3;
|
||||
int dz = world.rand.nextInt(parent.width - 6) + 3;
|
||||
world.setBlock(x + dx, y + 1, z + dz, ModBlocks.crate_ammo, 0, 2);
|
||||
}
|
||||
|
||||
for(int i = 0; i < k; i++) {
|
||||
int dx = world.rand.nextInt(parent.width - 6) + 3;
|
||||
int dz = world.rand.nextInt(parent.width - 6) + 3;
|
||||
world.setBlock(x + dx, y + 1, z + dz, ModBlocks.crate_can, 0, 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
33
com/hbm/world/generator/room/TestDungeonRoom3.java
Normal file
@ -0,0 +1,33 @@
|
||||
package com.hbm.world.generator.room;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.world.generator.CellularDungeon;
|
||||
import com.hbm.world.generator.CellularDungeonRoom;
|
||||
import com.hbm.world.generator.DungeonToolbox;
|
||||
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.tileentity.TileEntityMobSpawner;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class TestDungeonRoom3 extends CellularDungeonRoom {
|
||||
|
||||
public TestDungeonRoom3(CellularDungeon parent) {
|
||||
super(parent);
|
||||
}
|
||||
|
||||
public void generateMain(World world, int x, int y, int z) {
|
||||
|
||||
super.generateMain(world, x, y, z);
|
||||
DungeonToolbox.generateBox(world, x + parent.width / 2 - 2, y + 1, z + parent.width / 2 - 2, 5, 4, 5, ModBlocks.deco_lead);
|
||||
DungeonToolbox.generateBox(world, x + parent.width / 2 - 1, y + 1, z + parent.width / 2 - 1, 3, 3, 3, ModBlocks.toxic_block);
|
||||
DungeonToolbox.generateBox(world, x + parent.width / 2 - 1, y + 4, z + parent.width / 2 - 1, 3, 1, 3, Blocks.air);
|
||||
|
||||
world.setBlock(x + parent.width / 2, y + 1, z + parent.width / 2, Blocks.mob_spawner, 0, 2);
|
||||
TileEntityMobSpawner tileentitymobspawner2 = (TileEntityMobSpawner)world.getTileEntity(x + parent.width / 2, y + 1, z + parent.width / 2);
|
||||
|
||||
if (tileentitymobspawner2 != null)
|
||||
{
|
||||
tileentitymobspawner2.func_145881_a().setEntityName("Creeper");
|
||||
}
|
||||
}
|
||||
}
|
||||
32
com/hbm/world/generator/room/TestDungeonRoom4.java
Normal file
@ -0,0 +1,32 @@
|
||||
package com.hbm.world.generator.room;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import com.hbm.world.generator.CellularDungeon;
|
||||
import com.hbm.world.generator.CellularDungeonRoom;
|
||||
import com.hbm.world.generator.DungeonToolbox;
|
||||
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TestDungeonRoom4 extends CellularDungeonRoom {
|
||||
|
||||
public TestDungeonRoom4(CellularDungeon parent, CellularDungeonRoom daisyChain, ForgeDirection dir) {
|
||||
super(parent);
|
||||
this.daisyChain = daisyChain;
|
||||
this.daisyDirection = dir;
|
||||
}
|
||||
|
||||
public void generateMain(World world, int x, int y, int z) {
|
||||
|
||||
super.generateMain(world, x, y, z);
|
||||
DungeonToolbox.generateBox(world, x, y + parent.height - 2, z, parent.width, 1, parent.width, new ArrayList() {{ add(Blocks.air); add(Blocks.web); }});
|
||||
}
|
||||
|
||||
public void generateWall(World world, int x, int y, int z, ForgeDirection wall, boolean door) {
|
||||
|
||||
if(wall != ForgeDirection.NORTH)
|
||||
super.generateWall(world, x, y, z, wall, door);
|
||||
}
|
||||
}
|
||||
30
com/hbm/world/generator/room/TestDungeonRoom5.java
Normal file
@ -0,0 +1,30 @@
|
||||
package com.hbm.world.generator.room;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import com.hbm.world.generator.CellularDungeon;
|
||||
import com.hbm.world.generator.CellularDungeonRoom;
|
||||
import com.hbm.world.generator.DungeonToolbox;
|
||||
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TestDungeonRoom5 extends CellularDungeonRoom {
|
||||
|
||||
public TestDungeonRoom5(CellularDungeon parent) {
|
||||
super(parent);
|
||||
}
|
||||
|
||||
public void generateMain(World world, int x, int y, int z) {
|
||||
|
||||
super.generateMain(world, x, y, z);
|
||||
DungeonToolbox.generateBox(world, x, y + parent.height - 2, z, parent.width, 1, parent.width, new ArrayList() {{ add(Blocks.air); add(Blocks.web); }});
|
||||
}
|
||||
|
||||
public void generateWall(World world, int x, int y, int z, ForgeDirection wall, boolean door) {
|
||||
|
||||
if(wall != ForgeDirection.SOUTH)
|
||||
super.generateWall(world, x, y, z, wall, door);
|
||||
}
|
||||
}
|
||||
@ -1,4 +1,4 @@
|
||||
package com.hbm.world;
|
||||
package com.hbm.world.machine;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
//Schematic to java Structure by jajo_11 | inspired by "MITHION'S .SCHEMATIC TO JAVA CONVERTINGTOOL"
|
||||
|
||||
package com.hbm.world;
|
||||
package com.hbm.world.machine;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
//Schematic to java Structure by jajo_11 | inspired by "MITHION'S .SCHEMATIC TO JAVA CONVERTINGTOOL"
|
||||
|
||||
package com.hbm.world;
|
||||
package com.hbm.world.machine;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
//Schematic to java Structure by jajo_11 | inspired by "MITHION'S .SCHEMATIC TO JAVA CONVERTINGTOOL"
|
||||
|
||||
package com.hbm.world;
|
||||
package com.hbm.world.machine;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
//Schematic to java Structure by jajo_11 | inspired by "MITHION'S .SCHEMATIC TO JAVA CONVERTINGTOOL"
|
||||
|
||||
package com.hbm.world;
|
||||
package com.hbm.world.machine;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
//Schematic to java Structure by jajo_11 | inspired by "MITHION'S .SCHEMATIC TO JAVA CONVERTINGTOOL"
|
||||
|
||||
package com.hbm.world;
|
||||
package com.hbm.world.machine;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||