mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
sure
This commit is contained in:
parent
4ce7e396be
commit
a2e3a2540d
@ -80,4 +80,8 @@ public class BlockEnums {
|
||||
FLUORESCENT,
|
||||
HALOGEN
|
||||
}
|
||||
|
||||
public static enum EnumGroundType {
|
||||
TRENCH
|
||||
}
|
||||
}
|
||||
|
||||
@ -499,6 +499,7 @@ public class ModBlocks {
|
||||
public static Block frozen_grass;
|
||||
public static Block frozen_log;
|
||||
public static Block frozen_planks;
|
||||
public static Block ground;
|
||||
public static Block dirt_dead;
|
||||
public static Block dirt_oily;
|
||||
public static Block sand_dirty;
|
||||
@ -1702,6 +1703,7 @@ public class ModBlocks {
|
||||
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");
|
||||
ground = new BlockEnumMulti(Material.ground, EnumGroundType.class, true, true).setBlockName("ground").setStepSound(Block.soundTypeGravel).setCreativeTab(MainRegistry.blockTab).setHardness(0.5F).setBlockTextureName(RefStrings.MODID + ":ground");
|
||||
dirt_dead = new BlockFalling(Material.ground).setBlockName("dirt_dead").setStepSound(Block.soundTypeGravel).setCreativeTab(MainRegistry.blockTab).setHardness(0.5F).setBlockTextureName(RefStrings.MODID + ":dirt_dead");
|
||||
dirt_oily = new BlockFalling(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");
|
||||
@ -2849,6 +2851,7 @@ public class ModBlocks {
|
||||
GameRegistry.registerBlock(frozen_dirt, frozen_dirt.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(frozen_log, frozen_log.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(frozen_planks, frozen_planks.getUnlocalizedName());
|
||||
register(ground);
|
||||
GameRegistry.registerBlock(dirt_dead, dirt_dead.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(dirt_oily, dirt_oily.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(sand_dirty, sand_dirty.getUnlocalizedName());
|
||||
|
||||
@ -8,6 +8,7 @@ import org.lwjgl.opengl.GL11;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.render.block.ISBRHUniversal;
|
||||
import com.hbm.render.util.RenderBlocksNT;
|
||||
import com.hbm.world.gen.INBTTransformable;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@ -23,7 +24,7 @@ import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockBarrier extends Block implements ISBRHUniversal {
|
||||
public class BlockBarrier extends Block implements ISBRHUniversal, INBTTransformable {
|
||||
|
||||
public BlockBarrier(Material mat) {
|
||||
super(mat);
|
||||
@ -158,4 +159,9 @@ public class BlockBarrier extends Block implements ISBRHUniversal {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int transformMeta(int meta, int coordBaseMode) {
|
||||
return INBTTransformable.transformMetaDeco(meta, coordBaseMode);
|
||||
}
|
||||
}
|
||||
|
||||
@ -106,8 +106,8 @@ public class DungeonSpawner extends BlockContainer {
|
||||
for(int i = 0; i < 10; i++) {
|
||||
EntityUndeadSoldier mob = new EntityUndeadSoldier(world);
|
||||
for(int j = 0; j < 7; j++) {
|
||||
mob.setPositionAndRotation(x + 0.5 + vec.xCoord, y - 5, z + 0.5 + vec.zCoord, i * 36F, 0);
|
||||
if(mob.getCanSpawnHere()) {
|
||||
mob.setPositionAndRotation(x + 0.5 + vec.xCoord, y - 5 + j, z + 0.5 + vec.zCoord, i * 36F, 0);
|
||||
if(mob.worldObj.checkNoEntityCollision(mob.boundingBox) && mob.worldObj.getCollidingBoundingBoxes(mob, mob.boundingBox).isEmpty() && !mob.worldObj.isAnyLiquid(mob.boundingBox)) {
|
||||
mob.onSpawnWithEgg(null);
|
||||
world.spawnEntityInWorld(mob);
|
||||
break;
|
||||
|
||||
@ -9,7 +9,7 @@ import com.hbm.itempool.ItemPool;
|
||||
import com.hbm.itempool.ItemPoolsSingle;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.main.MainRegistry;
|
||||
|
||||
import com.hbm.main.StructureManager;
|
||||
import com.hbm.tileentity.machine.storage.TileEntitySafe;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
@ -31,40 +31,8 @@ public class ItemWandD extends Item {
|
||||
if(pos != null) {
|
||||
|
||||
int y = world.getHeightValue(pos.blockX, pos.blockZ);
|
||||
|
||||
Random rand = new Random();
|
||||
|
||||
if(world.getBlock(pos.blockX, y - 1, pos.blockZ).canPlaceTorchOnTop(world, pos.blockX, y - 1, pos.blockZ)) {
|
||||
world.setBlock(pos.blockX, y, pos.blockZ, ModBlocks.safe, rand.nextInt(4) + 2, 2);
|
||||
TileEntitySafe safe = (TileEntitySafe) world.getTileEntity(pos.blockX, y, pos.blockZ);
|
||||
|
||||
switch(rand.nextInt(10)) {
|
||||
case 0: case 1: case 2: case 3:
|
||||
safe.setMod(1);
|
||||
WeightedRandomChestContent.generateChestContents(rand, ItemPool.getPool(ItemPoolsSingle.POOL_VAULT_RUSTY), safe, rand.nextInt(4) + 3);
|
||||
break;
|
||||
case 4: case 5: case 6:
|
||||
safe.setMod(0.1);
|
||||
WeightedRandomChestContent.generateChestContents(rand, ItemPool.getPool(ItemPoolsSingle.POOL_VAULT_STANDARD), safe, rand.nextInt(3) + 2);
|
||||
break;
|
||||
case 7: case 8:
|
||||
safe.setMod(0.02);
|
||||
WeightedRandomChestContent.generateChestContents(rand, ItemPool.getPool(ItemPoolsSingle.POOL_VAULT_REINFORCED), safe, rand.nextInt(3) + 1);
|
||||
break;
|
||||
case 9:
|
||||
safe.setMod(0.0);
|
||||
WeightedRandomChestContent.generateChestContents(rand, ItemPool.getPool(ItemPoolsSingle.POOL_VAULT_UNBREAKABLE), safe, rand.nextInt(2) + 1);
|
||||
break;
|
||||
}
|
||||
|
||||
safe.setPins(rand.nextInt(999) + 1);
|
||||
safe.lock();
|
||||
|
||||
safe.fillWithSpiders(); // debug
|
||||
|
||||
if(GeneralConfig.enableDebugMode)
|
||||
MainRegistry.logger.info("[Debug] Successfully spawned safe at " + pos.blockX + " " + (y + 1) +" " + pos.blockZ);
|
||||
}
|
||||
|
||||
StructureManager.spire.build(world, pos.blockX, y, pos.blockZ);
|
||||
|
||||
/*ExplosionVNT vnt = new ExplosionVNT(world, pos.hitVec.xCoord, pos.hitVec.yCoord, pos.hitVec.zCoord, 7);
|
||||
vnt.setBlockAllocator(new BlockAllocatorBulkie(60));
|
||||
|
||||
@ -63,6 +63,12 @@ public class StructureManager {
|
||||
public static final NBTStructure dish = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/dish.nbt"));
|
||||
|
||||
public static final NBTStructure spire = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/spire.nbt"));
|
||||
|
||||
/// TRENCH ///
|
||||
public static final NBTStructure trench = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/trench/trench.nbt"));
|
||||
public static final NBTStructure trench_left = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/trench/trench_left.nbt"));
|
||||
public static final NBTStructure trench_right = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/trench/trench_right.nbt"));
|
||||
public static final NBTStructure trench_junction = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/trench/trench_junction.nbt"));
|
||||
|
||||
// public static final NBTStructure test_rot = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/test-rot.nbt"));
|
||||
// public static final NBTStructure test_jigsaw = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/test-jigsaw.nbt"));
|
||||
|
||||
@ -1235,7 +1235,5 @@ public class NBTStructure {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -47,6 +47,21 @@ public class NTMWorldGenerator implements IWorldGenerator {
|
||||
spawnWeight = 2;
|
||||
}});
|
||||
|
||||
/// TRENCH ///
|
||||
NBTStructure.registerStructure(0, new SpawnCondition() {{
|
||||
sizeLimit = 128;
|
||||
startPool = "trench";
|
||||
spawnWeight = 200;
|
||||
pools = new HashMap<String, NBTStructure.JigsawPool>() {{
|
||||
put("trench", new JigsawPool() {{
|
||||
add(new JigsawPiece("trench", StructureManager.trench) {{ heightOffset = -4; conformToTerrain = true; }}, 100);
|
||||
add(new JigsawPiece("trench_left", StructureManager.trench_left) {{ heightOffset = -4; conformToTerrain = true; }}, 10);
|
||||
add(new JigsawPiece("trench_right", StructureManager.trench_right) {{ heightOffset = -4; conformToTerrain = true; }}, 10);
|
||||
add(new JigsawPiece("trench_junction", StructureManager.trench_junction) {{ heightOffset = -4; conformToTerrain = true; }}, 25);
|
||||
}});
|
||||
}};
|
||||
}});
|
||||
|
||||
NBTStructure.registerStructure(0, new SpawnCondition() {{
|
||||
canSpawn = biome -> !invalidBiomes.contains(biome);
|
||||
start = d -> new MapGenNTMFeatures.Start(d.getW(), d.getX(), d.getY(), d.getZ());
|
||||
|
||||
BIN
src/main/resources/assets/hbm/structures/trench/trench.nbt
Normal file
BIN
src/main/resources/assets/hbm/structures/trench/trench.nbt
Normal file
Binary file not shown.
Binary file not shown.
BIN
src/main/resources/assets/hbm/structures/trench/trench_left.nbt
Normal file
BIN
src/main/resources/assets/hbm/structures/trench/trench_left.nbt
Normal file
Binary file not shown.
BIN
src/main/resources/assets/hbm/structures/trench/trench_right.nbt
Normal file
BIN
src/main/resources/assets/hbm/structures/trench/trench_right.nbt
Normal file
Binary file not shown.
BIN
src/main/resources/assets/hbm/textures/blocks/ground.trench.png
Normal file
BIN
src/main/resources/assets/hbm/textures/blocks/ground.trench.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 709 B |
Loading…
x
Reference in New Issue
Block a user