mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
repairable shredder blades, timed generator tweaks, more dungeon stuff
This commit is contained in:
parent
920599af25
commit
b3bb02526d
@ -511,6 +511,7 @@ item.blade_tungsten.name=Wolframverstärktes Turbinenblatt
|
||||
item.blades_advanced_alloy.name=Fortgeschrittenes Sägeblatt
|
||||
item.blades_aluminium.name=Aluminiumsägeblatt
|
||||
item.blades_combine_steel.name=CMB-Sägeblatt
|
||||
item.blades_desh.name=Desh-Sägeblatt
|
||||
item.blades_gold.name=Goldenes Sägeblatt
|
||||
item.blades_iron.name=Eisensägeblatt
|
||||
item.blades_schrabidium.name=Schrabidiumsägeblatt
|
||||
@ -2023,6 +2024,11 @@ tile.brick_concrete.name=Betonziegel
|
||||
tile.brick_concrete_broken.name=Gebrochene Betonziegel
|
||||
tile.brick_concrete_cracked.name=Rissige Betonziegel
|
||||
tile.brick_concrete_mossy.name=Bemooste Betonziegel
|
||||
tile.brick_jungle.name=Enargitziegel
|
||||
tile.brick_jungle_cracked.name=Rissige Enargitziegel
|
||||
tile.brick_jungle_glyph.name=Enargit-Glyphenziegel
|
||||
tile.brick_jungle_lava.name=Magmatische Enargitziegel
|
||||
tile.brick_jungle_trap.name=Enargit-Falle
|
||||
tile.brick_light.name=Helle Ziegel
|
||||
tile.brick_obsidian.name=Obsidianziegel
|
||||
tile.broadcaster_pc.name=Korrupter Sender
|
||||
@ -2041,6 +2047,7 @@ tile.crate.name=Vorratskiste
|
||||
tile.crate_ammo.name=Sternenmetallkiste
|
||||
tile.crate_can.name=Konservenkiste
|
||||
tile.crate_iron.name=Eisenkiste
|
||||
tile.crate_jungle.name=Enargitkiste
|
||||
tile.crate_lead.name=Gefahrenstoffkiste
|
||||
tile.crate_metal.name=Maschinenkiste
|
||||
tile.crate_red.name=Rote Kiste
|
||||
|
||||
@ -511,6 +511,7 @@ item.blade_tungsten.name=Tungsten Reinforced Blade
|
||||
item.blades_advanced_alloy.name=Advanced Shredder Blades
|
||||
item.blades_aluminium.name=Aluminium Shredder Blades
|
||||
item.blades_combine_steel.name=CMB Shredder Blades
|
||||
item.blades_desh.name=Desh Shredder Blades
|
||||
item.blades_gold.name=Golden Shredder Blades
|
||||
item.blades_iron.name=Iron Shredder Blades
|
||||
item.blades_schrabidium.name=Schrabidium Shredder Blades
|
||||
@ -2023,6 +2024,11 @@ tile.brick_concrete.name=Concrete Bricks
|
||||
tile.brick_concrete_broken.name=Broken Concrete Bricks
|
||||
tile.brick_concrete_cracked.name=Cracked Concrete Bricks
|
||||
tile.brick_concrete_mossy.name=Mossy Concrete Bricks
|
||||
tile.brick_jungle.name=Enargite Bricks
|
||||
tile.brick_jungle_cracked.name=Cracked Enargite Bricks
|
||||
tile.brick_jungle_glyph.name=Enargite Glyph Bricks
|
||||
tile.brick_jungle_lava.name=Magmatic Enargite Bricks
|
||||
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
|
||||
@ -2041,6 +2047,7 @@ tile.crate.name=Supply Crate
|
||||
tile.crate_ammo.name=Starmetal Crate
|
||||
tile.crate_can.name=Conserve Crate
|
||||
tile.crate_iron.name=Iron Crate
|
||||
tile.crate_jungle.name=Enargite Crate
|
||||
tile.crate_lead.name=Hazmat Crate
|
||||
tile.crate_metal.name=Machine Crate
|
||||
tile.crate_red.name=Red Crate
|
||||
@ -2198,10 +2205,10 @@ tile.machine_waste_drum.name=Spent Fuel Pool Drum
|
||||
tile.machine_well.name=Oil Derrick
|
||||
tile.marker_structure.name=Multiblock Structure Marker
|
||||
tile.meteor_battery.name=Starmetal Static Electricity Generator
|
||||
tile.meteor_brick.name=Meteor Brick
|
||||
tile.meteor_brick_chiseled.name=Chiseled Meteor Brick
|
||||
tile.meteor_brick_cracked.name=Cracked Meteor Brick
|
||||
tile.meteor_brick_mossy.name=Mossy Meteor Brick
|
||||
tile.meteor_brick.name=Meteor Bricks
|
||||
tile.meteor_brick_chiseled.name=Chiseled Meteor Bricks
|
||||
tile.meteor_brick_cracked.name=Cracked Meteor Bricks
|
||||
tile.meteor_brick_mossy.name=Mossy Meteor Bricks
|
||||
tile.meteor_pillar.name=Meteor Pillar
|
||||
tile.meteor_polished.name=Polished Meteor Block
|
||||
tile.meteor_spawner.name=Cyber Crab Assembler
|
||||
|
||||
BIN
src/main/java/assets/hbm/textures/blocks/brick_jungle_mystic.png
Normal file
BIN
src/main/java/assets/hbm/textures/blocks/brick_jungle_mystic.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.4 KiB |
BIN
src/main/java/assets/hbm/textures/blocks/brick_jungle_ooze.png
Normal file
BIN
src/main/java/assets/hbm/textures/blocks/brick_jungle_ooze.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.4 KiB |
@ -7,6 +7,7 @@ import com.hbm.items.ModItems;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
@ -22,8 +23,16 @@ public class BlockJungleCrate extends Block {
|
||||
|
||||
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)));
|
||||
ret.add(new ItemStack(Items.gold_ingot, 4 + rand.nextInt(4)));
|
||||
ret.add(new ItemStack(Items.gold_nugget, 8 + rand.nextInt(10)));
|
||||
ret.add(new ItemStack(ModItems.powder_gold, 2 + rand.nextInt(3)));
|
||||
ret.add(new ItemStack(ModItems.wire_gold, 2 + rand.nextInt(2)));
|
||||
|
||||
if(rand.nextInt(2) == 0)
|
||||
ret.add(new ItemStack(ModItems.plate_gold, 1 + rand.nextInt(2)));
|
||||
|
||||
if(rand.nextInt(3) == 0)
|
||||
ret.add(new ItemStack(ModItems.crystal_gold));
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -2444,7 +2444,7 @@ public class ModItems {
|
||||
blades_advanced_alloy = new ItemBlades(85).setUnlocalizedName("blades_advanced_alloy").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":blades_advanced_alloy");
|
||||
blades_combine_steel = new ItemBlades(150).setUnlocalizedName("blades_combine_steel").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":blades_combine_steel");
|
||||
blades_schrabidium = new ItemBlades(250).setUnlocalizedName("blades_schrabidium").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":blades_schrabidium");
|
||||
blades_desh = new ItemBlades(250).setUnlocalizedName("blades_desh").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":blades_desh");
|
||||
blades_desh = new ItemBlades(0).setUnlocalizedName("blades_desh").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":blades_desh");
|
||||
|
||||
part_lithium = new Item().setUnlocalizedName("part_lithium").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":part_lithium");
|
||||
part_beryllium = new Item().setUnlocalizedName("part_beryllium").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":part_beryllium");
|
||||
|
||||
@ -2,8 +2,6 @@ package com.hbm.items.block;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.blocks.generic.RedBarrel;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
|
||||
@ -639,6 +639,15 @@ public class CraftingManager {
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.blades_advanced_alloy, 1), new Object[] { " P ", "PIP", " P ", 'P', "plateAdvanced", 'I', "ingotAdvanced" }));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.blades_combine_steel, 1), new Object[] { " P ", "PIP", " P ", 'P', "plateCMBSteel", 'I', "ingotCMBSteel" }));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.blades_schrabidium, 1), new Object[] { " P ", "PIP", " P ", 'P', "plateSchrabidium", 'I', "ingotSchrabidium" }));
|
||||
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.blades_aluminium, 1), new Object[] { "PIP", 'P', "plateAluminum", 'I', new ItemStack(ModItems.blades_aluminium, 1, OreDictionary.WILDCARD_VALUE) }));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.blades_gold, 1), new Object[] { "PIP", 'P', "plateGold", 'I', new ItemStack(ModItems.blades_gold, 1, OreDictionary.WILDCARD_VALUE) }));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.blades_iron, 1), new Object[] { "PIP", 'P', "plateIron", 'I', new ItemStack(ModItems.blades_iron, 1, OreDictionary.WILDCARD_VALUE) }));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.blades_steel, 1), new Object[] { "PIP", 'P', "plateSteel", 'I', new ItemStack(ModItems.blades_steel, 1, OreDictionary.WILDCARD_VALUE) }));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.blades_titanium, 1), new Object[] { "PIP", 'P', "plateTitanium", 'I', new ItemStack(ModItems.blades_titanium, 1, OreDictionary.WILDCARD_VALUE) }));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.blades_advanced_alloy, 1), new Object[] { "PIP", 'P', "plateAdvanced", 'I', new ItemStack(ModItems.blades_advanced_alloy, 1, OreDictionary.WILDCARD_VALUE) }));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.blades_combine_steel, 1), new Object[] { "PIP", 'P', "plateCMBSteel", 'I', new ItemStack(ModItems.blades_combine_steel, 1, OreDictionary.WILDCARD_VALUE) }));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.blades_schrabidium, 1), new Object[] { "PIP", 'P', "plateSchrabidium", 'I', new ItemStack(ModItems.blades_schrabidium, 1, OreDictionary.WILDCARD_VALUE) }));
|
||||
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.stamp_stone_flat, 1), new Object[] { " R ", "III", "SSS", 'R', "dustRedstone", 'I', "ingotBrick", 'S', "stone" }));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.stamp_iron_flat, 1), new Object[] { " R ", "III", "SSS", 'R', "dustRedstone", 'I', "ingotBrick", 'S', "ingotIron" }));
|
||||
|
||||
@ -4,7 +4,6 @@ import java.util.Random;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.interfaces.IConsumer;
|
||||
import com.hbm.interfaces.Untested;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.packet.AuxElectricityPacket;
|
||||
@ -19,13 +18,10 @@ import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.tileentity.TileEntityChest;
|
||||
import net.minecraft.tileentity.TileEntityHopper;
|
||||
@ -52,8 +48,6 @@ public class TileEntityMachineMiningDrill extends TileEntityMachineBase implemen
|
||||
private static final int[] slots_side = new int[] {0};
|
||||
Random rand = new Random();
|
||||
|
||||
private String customName;
|
||||
|
||||
public TileEntityMachineMiningDrill() {
|
||||
super(13);
|
||||
}
|
||||
@ -99,7 +93,6 @@ public class TileEntityMachineMiningDrill extends TileEntityMachineBase implemen
|
||||
return (power * i) / maxPower;
|
||||
}
|
||||
|
||||
@Untested
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
|
||||
@ -404,8 +397,9 @@ public class TileEntityMachineMiningDrill extends TileEntityMachineBase implemen
|
||||
for(int ix = x - rad; ix <= x + rad; ix++) {
|
||||
for(int iz = z - rad; iz <= z + rad; iz++) {
|
||||
|
||||
if(tryDrill(ix, y, iz))
|
||||
return true;
|
||||
if(ix != x || iz != z)
|
||||
if(tryDrill(ix, y, iz))
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -11,24 +11,6 @@ import net.minecraft.world.World;
|
||||
|
||||
public class DungeonToolbox {
|
||||
|
||||
public static void generateBoxTimed(World world, int x, int y, int z, int sx, int sy, int sz, List<MetaBlock> 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++) {
|
||||
|
||||
MetaBlock b = getRandom(blocks, world.rand);
|
||||
TimedGenerator.addOp(world, i, j, k, b.block, b.meta, 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void generateBox(World world, int x, int y, int z, int sx, int sy, int sz, List<MetaBlock> blocks) {
|
||||
|
||||
if(blocks.isEmpty())
|
||||
@ -65,24 +47,6 @@ public class DungeonToolbox {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void generateBoxTimed(World world, int x, int y, int z, int sx, int sy, int sz, Block block) {
|
||||
generateBoxTimed(world, x, y, z, sx, sy, sz, new MetaBlock(block));
|
||||
}
|
||||
|
||||
public static void generateBoxTimed(World world, int x, int y, int z, int sx, int sy, int sz, MetaBlock 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++) {
|
||||
|
||||
TimedGenerator.addOp(world, i, j, k, block.block, block.meta, 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//now with vectors to provide handy rotations
|
||||
public static void generateBox(World world, int x, int y, int z, Vec3 size, List<MetaBlock> blocks) {
|
||||
|
||||
@ -1,9 +1,16 @@
|
||||
package com.hbm.world.generator;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.inventory.RecipesCommon.MetaBlock;
|
||||
import com.hbm.world.generator.TimedGenerator.ITimedJob;
|
||||
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class JungleDungeon extends CellularDungeon {
|
||||
|
||||
public boolean hasHole = false;
|
||||
|
||||
public JungleDungeon(int width, int height, int dimX, int dimZ, int tries, int branches) {
|
||||
super(width, height, dimX, dimZ, tries, branches);
|
||||
@ -22,5 +29,17 @@ public class JungleDungeon extends CellularDungeon {
|
||||
this.ceiling.add(new MetaBlock(ModBlocks.brick_jungle));
|
||||
this.ceiling.add(new MetaBlock(ModBlocks.brick_jungle_cracked));
|
||||
}
|
||||
|
||||
public void generate(World world, int x, int y, int z, Random rand) {
|
||||
super.generate(world, x, y, z, rand);
|
||||
|
||||
TimedGenerator.addOp(world, new ITimedJob() {
|
||||
@Override
|
||||
public void work() { JungleDungeon.this.hasHole = false; }
|
||||
} );
|
||||
|
||||
//since all the building is timed jobs, this has to be as well. timed jobs are ordered so this works!
|
||||
//is it shitty coding? is it not? who knows?
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -3,46 +3,49 @@ package com.hbm.world.generator;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class TimedGenerator {
|
||||
|
||||
//TODO: replace with timed operations, allows not only for direct block placements but also snazzy conditioned stuff
|
||||
private static final HashMap<Integer, ArrayList<Object[]>> operations = new HashMap();
|
||||
private static final HashMap<Integer, ArrayList<ITimedJob>> operations = new HashMap();
|
||||
|
||||
public static void automaton(World world, int amount) {
|
||||
|
||||
ArrayList<Object[]> list = operations.get(world.provider.dimensionId);
|
||||
ArrayList<ITimedJob> list = operations.get(world.provider.dimensionId);
|
||||
|
||||
if(list == null)
|
||||
return;
|
||||
|
||||
long start = System.currentTimeMillis();
|
||||
|
||||
while(start + 15 > System.currentTimeMillis()) {
|
||||
while(start + 10 > System.currentTimeMillis()) {
|
||||
|
||||
if(list.isEmpty())
|
||||
return;
|
||||
|
||||
Object[] entry = list.get(0);
|
||||
ITimedJob entry = list.get(0);
|
||||
list.remove(0);
|
||||
|
||||
world.setBlock((Integer)entry[0], (Integer)entry[1], (Integer)entry[2], (Block)entry[3], (Integer)entry[4], (Integer)entry[5]);
|
||||
|
||||
//amount --;
|
||||
entry.work();
|
||||
}
|
||||
}
|
||||
|
||||
public static void addOp(World world, int x, int y, int z, Block b, int meta, int flags) {
|
||||
public static void addOp(World world, ITimedJob job) {
|
||||
|
||||
ArrayList<Object[]> list = operations.get(world.provider.dimensionId);
|
||||
ArrayList<ITimedJob> list = operations.get(world.provider.dimensionId);
|
||||
|
||||
if(list == null) {
|
||||
list = new ArrayList();
|
||||
operations.put(world.provider.dimensionId, list);
|
||||
}
|
||||
|
||||
list.add(new Object[] {x, y, z, b, meta, flags});
|
||||
list.add(job);
|
||||
}
|
||||
|
||||
//should i be doing this? probably not, but watch me go
|
||||
public interface ITimedJob {
|
||||
|
||||
public void work();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,13 +1,18 @@
|
||||
package com.hbm.world.generator.room;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.inventory.RecipesCommon.MetaBlock;
|
||||
import com.hbm.world.generator.CellularDungeon;
|
||||
import com.hbm.world.generator.CellularDungeonRoom;
|
||||
import com.hbm.world.generator.DungeonToolbox;
|
||||
import com.hbm.world.generator.JungleDungeon;
|
||||
import com.hbm.world.generator.TimedGenerator;
|
||||
import com.hbm.world.generator.TimedGenerator.ITimedJob;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
@ -18,50 +23,104 @@ public class JungleDungeonRoom extends CellularDungeonRoom {
|
||||
super(parent);
|
||||
}
|
||||
|
||||
public void generateMain(World world, int x, int y, int z) {
|
||||
public void generateMain(final World world, final int x, final int y, final int z) {
|
||||
|
||||
DungeonToolbox.generateBoxTimed(world, x, y, z, parent.width, 1, parent.width, parent.floor);
|
||||
DungeonToolbox.generateBoxTimed(world, x, y + 1, z, parent.width, parent.height - 1, parent.width, Blocks.air);
|
||||
DungeonToolbox.generateBoxTimed(world, x, y + parent.height - 1, z, parent.width, 1, parent.width, parent.ceiling);
|
||||
if(!(this.parent instanceof JungleDungeon))
|
||||
return; //just to be safe
|
||||
|
||||
int rtd = world.rand.nextInt(10);
|
||||
ITimedJob job = new ITimedJob() {
|
||||
|
||||
@Override
|
||||
public void work() {
|
||||
|
||||
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);
|
||||
|
||||
int rtd = world.rand.nextInt(50);
|
||||
|
||||
// 1:10 chance to have a lava floor
|
||||
if(rtd < 5) {
|
||||
List<MetaBlock> metas = new ArrayList() {{
|
||||
add(new MetaBlock(ModBlocks.brick_jungle_cracked));
|
||||
add(new MetaBlock(ModBlocks.brick_jungle_lava));
|
||||
add(new MetaBlock(ModBlocks.brick_jungle_lava));
|
||||
}};
|
||||
|
||||
DungeonToolbox.generateBox(world, x + parent.width / 2 - 1, y, z + parent.width / 2 - 1, 3, 1, 3, metas );
|
||||
|
||||
// 1:5 chance to have a jungle crate
|
||||
} else if(rtd < 10) {
|
||||
world.setBlock(x + 1 + world.rand.nextInt(parent.width - 1), y + 1, z + world.rand.nextInt(parent.width - 1), ModBlocks.crate_jungle, 0, 2);
|
||||
|
||||
// 1:5 chance to try for making a hole
|
||||
} else if(rtd < 20) {
|
||||
|
||||
if(!((JungleDungeon)JungleDungeonRoom.this.parent).hasHole) {
|
||||
|
||||
boolean punched = false;
|
||||
|
||||
for(int a = 0; a < 3; a++) {
|
||||
for(int b = 0; b < 3; b++) {
|
||||
|
||||
Block bl = world.getBlock(x + 1 + a, y - 4, z + 1 + b);
|
||||
|
||||
if(world.getBlock(x + 1 + a, y - 1, z + 1 + b) == Blocks.air) {
|
||||
if(bl == ModBlocks.brick_jungle || bl == ModBlocks.brick_jungle_cracked || bl == ModBlocks.brick_jungle_lava || bl == ModBlocks.brick_jungle_trap) {
|
||||
world.setBlockToAir(x + 1 + a, y, z + 1 + b);
|
||||
punched = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(punched)
|
||||
((JungleDungeon)JungleDungeonRoom.this.parent).hasHole = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
if(rtd == 0) {
|
||||
DungeonToolbox.generateBoxTimed(world, x + parent.width / 2 - 1, y, z + parent.width / 2 - 1, 3, 1, 3, new ArrayList() {{ add(ModBlocks.brick_jungle_cracked); add(ModBlocks.brick_jungle_lava); }});
|
||||
|
||||
} else if(rtd == 1) {
|
||||
TimedGenerator.addOp(world, x + 1 + world.rand.nextInt(parent.width - 1), y + 1, z + world.rand.nextInt(parent.width - 1), ModBlocks.crate_jungle, 0, 2);
|
||||
}
|
||||
TimedGenerator.addOp(world, job);
|
||||
}
|
||||
|
||||
public void generateWall(World world, int x, int y, int z, ForgeDirection wall, boolean door) {
|
||||
public void generateWall(final World world, final int x, final int y, final int z, final ForgeDirection wall, final boolean door) {
|
||||
|
||||
if(wall == ForgeDirection.NORTH) {
|
||||
DungeonToolbox.generateBoxTimed(world, x, y + 1, z, parent.width, parent.height - 2, 1, parent.wall);
|
||||
|
||||
if(door)
|
||||
DungeonToolbox.generateBoxTimed(world, x + parent.width / 2 - 1, y + 1, z, 3, 3, 1, Blocks.air);
|
||||
}
|
||||
ITimedJob job = new ITimedJob() {
|
||||
|
||||
@Override
|
||||
public void work() {
|
||||
|
||||
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 - 1, y + 1, z, 3, 3, 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 - 1, y + 1, z + parent.width - 1, 3, 3, 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, 1, 3, 3, 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, 1, 3, 3, Blocks.air);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
if(wall == ForgeDirection.SOUTH) {
|
||||
DungeonToolbox.generateBoxTimed(world, x, y + 1, z + parent.width - 1, parent.width, parent.height - 2, 1, parent.wall);
|
||||
|
||||
if(door)
|
||||
DungeonToolbox.generateBoxTimed(world, x + parent.width / 2 - 1, y + 1, z + parent.width - 1, 3, 3, 1, Blocks.air);
|
||||
}
|
||||
|
||||
if(wall == ForgeDirection.WEST) {
|
||||
DungeonToolbox.generateBoxTimed(world, x, y + 1, z, 1, parent.height - 2, parent.width, parent.wall);
|
||||
|
||||
if(door)
|
||||
DungeonToolbox.generateBoxTimed(world, x, y + 1, z + parent.width / 2 - 1, 1, 3, 3, Blocks.air);
|
||||
}
|
||||
|
||||
if(wall == ForgeDirection.EAST) {
|
||||
DungeonToolbox.generateBoxTimed(world, x + parent.width - 1, y + 1, z, 1, parent.height - 2, parent.width, parent.wall);
|
||||
|
||||
if(door)
|
||||
DungeonToolbox.generateBoxTimed(world, x + parent.width - 1, y + 1, z + parent.width / 2 - 1, 1, 3, 3, Blocks.air);
|
||||
}
|
||||
TimedGenerator.addOp(world, job);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user