mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-03-11 20:25:36 +00:00
Merge pull request #1934 from MellowArpeggiation/moige
NBT Structures + new Meteor Dungeon + bonus stuff
This commit is contained in:
commit
6043d1df80
@ -5,12 +5,15 @@ import com.hbm.handler.ThreeInts;
|
||||
import com.hbm.interfaces.ICopiable;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.tileentity.IPersistentNBT;
|
||||
import com.hbm.world.gen.INBTTransformable;
|
||||
|
||||
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.RenderGlobal;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
@ -32,7 +35,7 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
public abstract class BlockDummyable extends BlockContainer implements ICustomBlockHighlight, ICopiable {
|
||||
public abstract class BlockDummyable extends BlockContainer implements ICustomBlockHighlight, ICopiable, INBTTransformable {
|
||||
|
||||
public BlockDummyable(Material mat) {
|
||||
super(mat);
|
||||
@ -116,7 +119,7 @@ public abstract class BlockDummyable extends BlockContainer implements ICustomBl
|
||||
return findCoreRec(world, x, y, z);
|
||||
}
|
||||
|
||||
List<ThreeInts> positions = new ArrayList();
|
||||
List<ThreeInts> positions = new ArrayList<>();
|
||||
|
||||
public int[] findCoreRec(World world, int x, int y, int z) {
|
||||
|
||||
@ -216,11 +219,6 @@ public abstract class BlockDummyable extends BlockContainer implements ICustomBl
|
||||
super.onBlockPlacedBy(world, x, y, z, player, itemStack);
|
||||
}
|
||||
|
||||
/*@Override
|
||||
public void onBlockAdded(World world, int x, int y, int z) {
|
||||
lastBlockSet = new BlockPos(x, y, z);
|
||||
}*/
|
||||
|
||||
/**
|
||||
* A bit more advanced than the dir modifier, but it is important that the resulting direction meta is in the core range.
|
||||
* Using the "extra" metas is technically possible but requires a bit of tinkering, e.g. preventing a recursive loop
|
||||
@ -267,9 +265,9 @@ public abstract class BlockDummyable extends BlockContainer implements ICustomBl
|
||||
return;
|
||||
|
||||
// world.setBlockMetadataWithNotify(x, y, z, meta + extra, 3);
|
||||
this.safeRem = true;
|
||||
safeRem = true;
|
||||
world.setBlock(x, y, z, this, meta + extra, 3);
|
||||
this.safeRem = false;
|
||||
safeRem = false;
|
||||
}
|
||||
|
||||
public void removeExtra(World world, int x, int y, int z) {
|
||||
@ -283,9 +281,9 @@ public abstract class BlockDummyable extends BlockContainer implements ICustomBl
|
||||
return;
|
||||
|
||||
// world.setBlockMetadataWithNotify(x, y, z, meta + extra, 3);
|
||||
this.safeRem = true;
|
||||
safeRem = true;
|
||||
world.setBlock(x, y, z, this, meta - extra, 3);
|
||||
this.safeRem = false;
|
||||
safeRem = false;
|
||||
}
|
||||
|
||||
// checks if the dummy metadata is within the extra range
|
||||
@ -423,8 +421,9 @@ public abstract class BlockDummyable extends BlockContainer implements ICustomBl
|
||||
return !bounding.isEmpty();
|
||||
}
|
||||
|
||||
public List<AxisAlignedBB> bounding = new ArrayList();
|
||||
public List<AxisAlignedBB> bounding = new ArrayList<>();
|
||||
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
@Override
|
||||
public void addCollisionBoxesToList(World world, int x, int y, int z, AxisAlignedBB entityBounding, List list, Entity entity) {
|
||||
|
||||
@ -443,7 +442,7 @@ public abstract class BlockDummyable extends BlockContainer implements ICustomBl
|
||||
z = pos[2];
|
||||
|
||||
for(AxisAlignedBB aabb :this.bounding) {
|
||||
AxisAlignedBB boxlet = getAABBRotationOffset(aabb, x + 0.5, y, z + 0.5, ForgeDirection.getOrientation(world.getBlockMetadata(x, y, z) - this.offset).getRotation(ForgeDirection.UP));
|
||||
AxisAlignedBB boxlet = getAABBRotationOffset(aabb, x + 0.5, y, z + 0.5, ForgeDirection.getOrientation(world.getBlockMetadata(x, y, z) - offset).getRotation(ForgeDirection.UP));
|
||||
|
||||
if(entityBounding.intersectsWith(boxlet)) {
|
||||
list.add(boxlet);
|
||||
@ -504,7 +503,7 @@ public abstract class BlockDummyable extends BlockContainer implements ICustomBl
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
|
||||
ICustomBlockHighlight.setup();
|
||||
for(AxisAlignedBB aabb : this.bounding) event.context.drawOutlinedBoundingBox(getAABBRotationOffset(aabb.expand(exp, exp, exp), 0, 0, 0, ForgeDirection.getOrientation(meta - offset).getRotation(ForgeDirection.UP)).getOffsetBoundingBox(x - dX + 0.5, y - dY, z - dZ + 0.5), -1);
|
||||
for(AxisAlignedBB aabb : this.bounding) RenderGlobal.drawOutlinedBoundingBox(getAABBRotationOffset(aabb.expand(exp, exp, exp), 0, 0, 0, ForgeDirection.getOrientation(meta - offset).getRotation(ForgeDirection.UP)).getOffsetBoundingBox(x - dX + 0.5, y - dY, z - dZ + 0.5), -1);
|
||||
ICustomBlockHighlight.cleanup();
|
||||
}
|
||||
|
||||
@ -534,4 +533,27 @@ public abstract class BlockDummyable extends BlockContainer implements ICustomBl
|
||||
return ((ICopiable) tile).infoForDisplay(world, x, y, z);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int transformMeta(int meta, int coordBaseMode) {
|
||||
boolean isOffset = meta >= 12; // squishing causes issues
|
||||
boolean isExtra = !isOffset && meta >= extra;
|
||||
|
||||
if(isOffset) {
|
||||
meta -= offset;
|
||||
} else if(isExtra) {
|
||||
meta -= extra;
|
||||
}
|
||||
|
||||
meta = INBTTransformable.transformMetaDeco(meta, coordBaseMode);
|
||||
|
||||
if(isOffset) {
|
||||
meta += offset;
|
||||
} else if(isExtra) {
|
||||
meta += extra;
|
||||
}
|
||||
|
||||
return meta;
|
||||
}
|
||||
|
||||
}
|
||||
@ -11,4 +11,27 @@ public interface IBlockSideRotation {
|
||||
public static int getRenderType() {
|
||||
return renderID;
|
||||
}
|
||||
|
||||
// 0 1 3 2 becomes 0 2 3 1
|
||||
// I want to smoke that swedish kush because it clearly makes you fucking stupid
|
||||
public static int topToBottom(int topRotation) {
|
||||
switch(topRotation) {
|
||||
case 1: return 2;
|
||||
case 2: return 1;
|
||||
default: return topRotation;
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean isOpposite(int from, int to) {
|
||||
switch(from) {
|
||||
case 0: return to == 1;
|
||||
case 1: return to == 0;
|
||||
case 2: return to == 3;
|
||||
case 3: return to == 2;
|
||||
case 4: return to == 5;
|
||||
case 5: return to == 4;
|
||||
default: return false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -35,6 +35,7 @@ import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockFalling;
|
||||
import net.minecraft.block.material.*;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@ -603,6 +604,7 @@ public class ModBlocks {
|
||||
public static Block spikes;
|
||||
|
||||
public static Block charger;
|
||||
public static Block refueler;
|
||||
|
||||
public static Block tesla;
|
||||
|
||||
@ -1227,6 +1229,11 @@ public class ModBlocks {
|
||||
public static Block pink_double_slab;
|
||||
public static Block pink_stairs;
|
||||
|
||||
// NBT Structure wand blocks
|
||||
public static Block wand_air;
|
||||
public static Block wand_loot;
|
||||
public static Block wand_jigsaw;
|
||||
|
||||
public static Material materialGas = new MaterialGas();
|
||||
|
||||
private static void initializeBlock() {
|
||||
@ -1653,7 +1660,7 @@ public class ModBlocks {
|
||||
plant_dead = new BlockDeadPlant().setBlockName("plant_dead").setCreativeTab(MainRegistry.blockTab).setStepSound(Block.soundTypeGrass).setHardness(0.0F);
|
||||
reeds = new BlockReeds().setBlockName("plant_reeds").setCreativeTab(MainRegistry.blockTab).setStepSound(Block.soundTypeGrass).setHardness(0.0F);
|
||||
vine_phosphor = new BlockHangingVine(thick_foliage).setBlockName("vine_phosphor").setCreativeTab(MainRegistry.blockTab).setStepSound(Block.soundTypeGrass).setHardness(0.5F);
|
||||
|
||||
|
||||
waste_earth = new WasteEarth(Material.ground, true).setBlockName("waste_earth").setStepSound(Block.soundTypeGrass).setCreativeTab(MainRegistry.blockTab).setHardness(0.6F).setBlockTextureName(RefStrings.MODID + ":waste_earth");
|
||||
waste_mycelium = new WasteEarth(Material.ground, true).setBlockName("waste_mycelium").setStepSound(Block.soundTypeGrass).setLightLevel(1F).setCreativeTab(MainRegistry.blockTab).setHardness(0.6F).setBlockTextureName(RefStrings.MODID + ":waste_mycelium_side");
|
||||
waste_trinitite = new BlockOre(Material.sand).noFortune().setBlockName("waste_trinitite").setStepSound(Block.soundTypeSand).setCreativeTab(MainRegistry.blockTab).setHardness(0.5F).setResistance(2.5F).setBlockTextureName(RefStrings.MODID + ":waste_trinitite");
|
||||
@ -1835,7 +1842,7 @@ public class ModBlocks {
|
||||
pa_quadrupole = new BlockPAQuadrupole().setStepSound(Block.soundTypeMetal).setBlockName("pa_quadrupole").setHardness(5.0F).setResistance(10.0F);
|
||||
pa_dipole = new BlockPADipole().setStepSound(Block.soundTypeMetal).setBlockName("pa_dipole").setHardness(5.0F).setResistance(10.0F);
|
||||
pa_detector = new BlockPADetector().setStepSound(Block.soundTypeMetal).setBlockName("pa_detector").setHardness(5.0F).setResistance(10.0F);
|
||||
|
||||
|
||||
machine_electric_furnace_off = new MachineElectricFurnace(false).setBlockName("machine_electric_furnace_off").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
machine_electric_furnace_on = new MachineElectricFurnace(true).setBlockName("machine_electric_furnace_on").setHardness(5.0F).setLightLevel(1.0F).setResistance(10.0F);
|
||||
machine_arc_furnace_off = new MachineArcFurnace(false).setBlockName("machine_arc_furnace_off").setHardness(5.0F).setResistance(10.0F);
|
||||
@ -2068,6 +2075,7 @@ public class ModBlocks {
|
||||
spikes = new Spikes(Material.iron).setBlockName("spikes").setHardness(2.5F).setResistance(5.0F).setCreativeTab(MainRegistry.blockTab).setBlockTextureName(RefStrings.MODID + ":spikes");
|
||||
|
||||
charger = new Charger(Material.iron).setBlockName("charger").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.blockTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
refueler = new BlockRefueler(Material.iron).setBlockName("refueler").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.blockTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
|
||||
tesla = new MachineTesla(Material.iron).setBlockName("tesla").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.blockTab).setBlockTextureName(RefStrings.MODID + ":tesla");
|
||||
|
||||
@ -2352,6 +2360,10 @@ public class ModBlocks {
|
||||
pink_slab = new BlockPinkSlab(false, Material.wood).setBlockName("pink_slab").setStepSound(Block.soundTypeWood).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":pink_planks");
|
||||
pink_double_slab = new BlockPinkSlab(true, Material.wood).setBlockName("pink_double_slab").setStepSound(Block.soundTypeWood).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":pink_planks");
|
||||
pink_stairs = new BlockGenericStairs(pink_planks, 0).setBlockName("pink_stairs").setStepSound(Block.soundTypeWood).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":pink_planks");
|
||||
|
||||
wand_air = new BlockWand(Blocks.air).setBlockName("wand_air").setBlockTextureName(RefStrings.MODID + ":wand_air");
|
||||
wand_loot = new BlockWandLoot().setBlockName("wand_loot").setBlockTextureName(RefStrings.MODID + ":wand_loot");
|
||||
wand_jigsaw = new BlockWandJigsaw().setBlockName("wand_jigsaw").setBlockTextureName(RefStrings.MODID + ":wand_jigsaw");
|
||||
}
|
||||
|
||||
private static void registerBlock() {
|
||||
@ -2709,6 +2721,7 @@ public class ModBlocks {
|
||||
|
||||
//Charger
|
||||
GameRegistry.registerBlock(charger, charger.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(refueler, refueler.getUnlocalizedName());
|
||||
//GameRegistry.registerBlock(floodlight, floodlight.getUnlocalizedName());
|
||||
|
||||
//Decoration Blocks
|
||||
@ -3472,6 +3485,10 @@ public class ModBlocks {
|
||||
GameRegistry.registerBlock(pink_slab, pink_slab.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(pink_double_slab, pink_double_slab.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(pink_stairs, pink_stairs.getUnlocalizedName());
|
||||
|
||||
register(wand_air);
|
||||
register(wand_loot);
|
||||
register(wand_jigsaw);
|
||||
}
|
||||
|
||||
private static void register(Block b) {
|
||||
|
||||
@ -4,6 +4,9 @@ import com.hbm.inventory.gui.GUIScreenBobble;
|
||||
import com.hbm.items.special.ItemPlasticScrap.ScrapType;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.tileentity.IGUIProvider;
|
||||
import com.hbm.world.gen.INBTTileEntityTransformable;
|
||||
import com.hbm.world.gen.INBTTransformable;
|
||||
|
||||
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@ -31,7 +34,7 @@ import net.minecraft.world.World;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
public class BlockBobble extends BlockContainer implements IGUIProvider {
|
||||
public class BlockBobble extends BlockContainer implements IGUIProvider, INBTTransformable {
|
||||
|
||||
public BlockBobble() {
|
||||
super(Material.iron);
|
||||
@ -136,12 +139,17 @@ public class BlockBobble extends BlockContainer implements IGUIProvider {
|
||||
return AxisAlignedBB.getBoundingBox(x + this.minX, y + this.minY, z + this.minZ, x + this.maxX, y + this.maxY, z + this.maxZ);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int transformMeta(int meta, int coordBaseMode) {
|
||||
return (meta + coordBaseMode * 4) % 16;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
return new TileEntityBobble();
|
||||
}
|
||||
|
||||
public static class TileEntityBobble extends TileEntity {
|
||||
public static class TileEntityBobble extends TileEntity implements INBTTileEntityTransformable {
|
||||
|
||||
public BobbleType type = BobbleType.NONE;
|
||||
|
||||
@ -173,6 +181,11 @@ public class BlockBobble extends BlockContainer implements IGUIProvider {
|
||||
super.writeToNBT(nbt);
|
||||
nbt.setByte("type", (byte) type.ordinal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void transformTE(World world, int coordBaseMode) {
|
||||
type = BobbleType.values()[world.rand.nextInt(BobbleType.values().length - 1) + 1];
|
||||
}
|
||||
}
|
||||
|
||||
public static enum BobbleType {
|
||||
@ -200,7 +213,7 @@ public class BlockBobble extends BlockContainer implements IGUIProvider {
|
||||
CIRNO( "Cirno", "Cirno", "the only multi layered skin i had", "No brain. Head empty.", true, ScrapType.BOARD_BLANK),
|
||||
MICROWAVE( "Microwave", "Microwave", "OC Compatibility and massive RBMK/packet optimizations", "they call me the food heater$john optimization", true, ScrapType.BOARD_CONVERTER),
|
||||
PEEP( "Peep", "LePeeperSauvage", "Coilgun, Leadburster and Congo Lake models, BDCL QC", "Fluffy ears can't hide in ash, nor snow.", true, ScrapType.CARD_BOARD),
|
||||
MELLOW( "MELLOWARPEGGIATION", "Mellow", "Industrial lighting, animation tools", "Make something cool now, ask for permission later.", true, ScrapType.CARD_PROCESSOR);
|
||||
MELLOW( "MELLOWARPEGGIATION", "Mellow", "NBT Structures, industrial lighting, animation tools", "Make something cool now, ask for permission later.", true, ScrapType.CARD_PROCESSOR);
|
||||
|
||||
public String name; //the title of the tooltip
|
||||
public String label; //the name engraved in the socket
|
||||
|
||||
@ -2,6 +2,7 @@ package com.hbm.blocks.generic;
|
||||
|
||||
import com.hbm.blocks.BlockMulti;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.world.gen.INBTTransformable;
|
||||
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
@ -14,7 +15,7 @@ import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockDecoCRT extends BlockMulti {
|
||||
public class BlockDecoCRT extends BlockMulti implements INBTTransformable {
|
||||
|
||||
protected String[] variants = new String[] {"crt_clean", "crt_broken", "crt_blinking", "crt_bsod"};
|
||||
@SideOnly(Side.CLIENT) protected IIcon[] icons;
|
||||
@ -24,17 +25,17 @@ public class BlockDecoCRT extends BlockMulti {
|
||||
}
|
||||
|
||||
public static int renderID = RenderingRegistry.getNextAvailableRenderId();
|
||||
|
||||
|
||||
@Override
|
||||
public int getRenderType(){
|
||||
return renderID;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
@ -45,12 +46,12 @@ public class BlockDecoCRT extends BlockMulti {
|
||||
public void registerBlockIcons(IIconRegister reg) {
|
||||
super.registerBlockIcons(reg);
|
||||
this.icons = new IIcon[variants.length];
|
||||
|
||||
|
||||
for(int i = 0; i < variants.length; i++) {
|
||||
this.icons[i] = reg.registerIcon(RefStrings.MODID + ":" + variants[i]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
@ -61,7 +62,7 @@ public class BlockDecoCRT extends BlockMulti {
|
||||
public int damageDropped(int meta) {
|
||||
return (Math.abs(meta) % 16) / 4;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack stack) {
|
||||
int i = MathHelper.floor_double(player.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
|
||||
@ -73,4 +74,10 @@ public class BlockDecoCRT extends BlockMulti {
|
||||
public int getSubCount() {
|
||||
return 4;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int transformMeta(int meta, int coordBaseMode) {
|
||||
return INBTTransformable.transformMetaDecoModel(meta, coordBaseMode);
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,6 +1,7 @@
|
||||
package com.hbm.blocks.generic;
|
||||
|
||||
import com.hbm.blocks.BlockEnumMulti;
|
||||
import com.hbm.world.gen.INBTTransformable;
|
||||
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
import net.minecraft.block.material.Material;
|
||||
@ -11,14 +12,14 @@ import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockDecoModel extends BlockEnumMulti {
|
||||
|
||||
public class BlockDecoModel extends BlockEnumMulti implements INBTTransformable {
|
||||
|
||||
public BlockDecoModel(Material mat, Class<? extends Enum> theEnum, boolean multiName, boolean multiTexture) {
|
||||
super(mat, theEnum, multiName, multiTexture);
|
||||
}
|
||||
|
||||
|
||||
public static int renderID = RenderingRegistry.getNextAvailableRenderId();
|
||||
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return renderID;
|
||||
@ -33,18 +34,18 @@ public class BlockDecoModel extends BlockEnumMulti {
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
//Did somebody say - pain?
|
||||
//Alright fuckers, looks like 2/b010 = North, 3/b011 = South, 4/b100 = West, 5/b101 = East for sides.
|
||||
//I'll just opt for something similar (0/b00 North, 1/b01 South, 2/b10 West, 3/b11 East)
|
||||
|
||||
|
||||
//Assumes meta is using the third and fourth bits.
|
||||
@Override
|
||||
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack stack) {
|
||||
int i = MathHelper.floor_double(player.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
|
||||
|
||||
|
||||
int meta;
|
||||
|
||||
|
||||
if((i & 1) != 1)
|
||||
meta = i >> 1; //For North(b00>b00) and South(b10>b01), shift bits right by one
|
||||
else {
|
||||
@ -53,15 +54,15 @@ public class BlockDecoModel extends BlockEnumMulti {
|
||||
else
|
||||
meta = 3; //For East(b01>b11), just set to 3
|
||||
}
|
||||
|
||||
|
||||
world.setBlockMetadataWithNotify(x, y, z, (meta << 2) | stack.getItemDamage(), 2);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int damageDropped(int meta) {
|
||||
return meta & 3;
|
||||
}
|
||||
|
||||
|
||||
//These are separate because they have to be constant
|
||||
private float mnX = 0.0F; //min
|
||||
private float mnY = 0.0F;
|
||||
@ -69,7 +70,7 @@ public class BlockDecoModel extends BlockEnumMulti {
|
||||
private float mxX = 1.0F; //max
|
||||
private float mxY = 1.0F;
|
||||
private float mxZ = 1.0F;
|
||||
|
||||
|
||||
public BlockDecoModel setBlockBoundsTo(float minX, float minY, float minZ, float maxX, float maxY, float maxZ) {
|
||||
mnX = minX;
|
||||
mnY = minY;
|
||||
@ -77,10 +78,10 @@ public class BlockDecoModel extends BlockEnumMulti {
|
||||
mxX = maxX;
|
||||
mxY = maxY;
|
||||
mxZ = maxZ;
|
||||
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) {
|
||||
switch(world.getBlockMetadata(x, y, z) >> 2) {
|
||||
@ -98,10 +99,39 @@ public class BlockDecoModel extends BlockEnumMulti {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z) {
|
||||
this.setBlockBoundsBasedOnState(world, x, y, z);
|
||||
return AxisAlignedBB.getBoundingBox(x + this.minX, y + this.minY, z + this.minZ, x + this.maxX, y + this.maxY, z + this.maxZ);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int transformMeta(int meta, int coordBaseMode) {
|
||||
//N: 0b00, S: 0b01, W: 0b10, E: 0b11
|
||||
int rot = meta >> 2;
|
||||
int type = meta & 3;
|
||||
|
||||
switch(coordBaseMode) {
|
||||
default: //South
|
||||
break;
|
||||
case 1: //West
|
||||
if((rot & 3) < 2) //N & S can just have bits toggled
|
||||
rot = rot ^ 3;
|
||||
else //W & E can just have first bit set to 0
|
||||
rot = rot ^ 2;
|
||||
break;
|
||||
case 2: //North
|
||||
rot = rot ^ 1; //N, W, E & S can just have first bit toggled
|
||||
break;
|
||||
case 3: //East
|
||||
if((rot & 3) < 2)//N & S can just have second bit set to 1
|
||||
rot = rot ^ 2;
|
||||
else //W & E can just have bits toggled
|
||||
rot = rot ^ 3;
|
||||
break;
|
||||
}
|
||||
//genuinely like. why did i do that
|
||||
return (rot << 2) | type; //To accommodate for BlockDecoModel's shift in the rotation bits; otherwise, simply bit-shift right and or any non-rotation meta after
|
||||
}
|
||||
}
|
||||
@ -2,6 +2,7 @@ package com.hbm.blocks.generic;
|
||||
|
||||
import com.hbm.blocks.BlockMulti;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.world.gen.INBTTransformable;
|
||||
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
@ -16,7 +17,7 @@ import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockDecoToaster extends BlockMulti {
|
||||
public class BlockDecoToaster extends BlockMulti implements INBTTransformable {
|
||||
|
||||
protected String[] variants = new String[] {"toaster_iron", "toaster_steel", "toaster_wood"};
|
||||
@SideOnly(Side.CLIENT) protected IIcon[] icons;
|
||||
@ -26,17 +27,17 @@ public class BlockDecoToaster extends BlockMulti {
|
||||
}
|
||||
|
||||
public static int renderID = RenderingRegistry.getNextAvailableRenderId();
|
||||
|
||||
|
||||
@Override
|
||||
public int getRenderType(){
|
||||
return renderID;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
@ -47,12 +48,12 @@ public class BlockDecoToaster extends BlockMulti {
|
||||
public void registerBlockIcons(IIconRegister reg) {
|
||||
super.registerBlockIcons(reg);
|
||||
this.icons = new IIcon[variants.length];
|
||||
|
||||
|
||||
for(int i = 0; i < variants.length; i++) {
|
||||
this.icons[i] = reg.registerIcon(RefStrings.MODID + ":" + variants[i]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
@ -63,7 +64,7 @@ public class BlockDecoToaster extends BlockMulti {
|
||||
public int damageDropped(int meta) {
|
||||
return (Math.abs(meta) % 12) / 4;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack stack) {
|
||||
int i = MathHelper.floor_double(player.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
|
||||
@ -90,4 +91,10 @@ public class BlockDecoToaster extends BlockMulti {
|
||||
this.setBlockBoundsBasedOnState(world, x, y, z);
|
||||
return AxisAlignedBB.getBoundingBox(x + this.minX, y + this.minY, z + this.minZ, x + this.maxX, y + this.maxY, z + this.maxZ);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int transformMeta(int meta, int coordBaseMode) {
|
||||
return INBTTransformable.transformMetaDecoModel(meta, coordBaseMode);
|
||||
}
|
||||
|
||||
}
|
||||
@ -4,6 +4,7 @@ import java.util.List;
|
||||
|
||||
import com.hbm.blocks.ITooltipProvider;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.world.gen.INBTTransformable;
|
||||
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
@ -16,7 +17,7 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockPipe extends Block implements ITooltipProvider {
|
||||
public class BlockPipe extends Block implements ITooltipProvider, INBTTransformable {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon sideIcon;
|
||||
@ -24,7 +25,7 @@ public class BlockPipe extends Block implements ITooltipProvider {
|
||||
public IIcon frameIcon;
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon meshIcon;
|
||||
|
||||
|
||||
private String sideString;
|
||||
public int rType = 0; //because registering either new renderer classes or making new block classes is a pain in the ass
|
||||
|
||||
@ -33,7 +34,7 @@ public class BlockPipe extends Block implements ITooltipProvider {
|
||||
this.sideString = tex;
|
||||
this.rType = rType;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister iconRegister) {
|
||||
@ -42,7 +43,7 @@ public class BlockPipe extends Block implements ITooltipProvider {
|
||||
this.frameIcon = iconRegister.registerIcon(RefStrings.MODID + ":pipe_frame");
|
||||
this.meshIcon = iconRegister.registerIcon(RefStrings.MODID + ":pipe_mesh");
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int metadata) {
|
||||
@ -92,4 +93,10 @@ public class BlockPipe extends Block implements ITooltipProvider {
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean ext) {
|
||||
list.add("Purely decorative");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int transformMeta(int meta, int coordBaseMode) {
|
||||
return INBTTransformable.transformMetaPillar(meta, coordBaseMode);
|
||||
}
|
||||
|
||||
}
|
||||
51
src/main/java/com/hbm/blocks/generic/BlockWand.java
Normal file
51
src/main/java/com/hbm/blocks/generic/BlockWand.java
Normal file
@ -0,0 +1,51 @@
|
||||
package com.hbm.blocks.generic;
|
||||
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
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.util.AxisAlignedBB;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockWand extends Block {
|
||||
|
||||
public final Block exportAs;
|
||||
|
||||
public BlockWand(Block exportAs) {
|
||||
super(Material.glass);
|
||||
this.exportAs = exportAs;
|
||||
setBlockBounds(1F/16F, 1F/16F, 1F/16F, 15F/16F, 15F/16F, 15F/16F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public static int renderID = RenderingRegistry.getNextAvailableRenderId();
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return renderID;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean shouldSideBeRendered(IBlockAccess world, int x, int y, int z, int side) {
|
||||
Block block = world.getBlock(x, y, z);
|
||||
|
||||
return block != this;
|
||||
}
|
||||
|
||||
}
|
||||
387
src/main/java/com/hbm/blocks/generic/BlockWandJigsaw.java
Normal file
387
src/main/java/com/hbm/blocks/generic/BlockWandJigsaw.java
Normal file
@ -0,0 +1,387 @@
|
||||
package com.hbm.blocks.generic;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.lwjgl.input.Keyboard;
|
||||
|
||||
import com.hbm.blocks.IBlockSideRotation;
|
||||
import com.hbm.blocks.ILookOverlay;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.interfaces.IControlReceiver;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.packet.toserver.NBTControlPacket;
|
||||
import com.hbm.tileentity.IGUIProvider;
|
||||
import com.hbm.tileentity.TileEntityLoadedBase;
|
||||
import com.hbm.util.BufferUtil;
|
||||
import com.hbm.util.I18nUtil;
|
||||
import com.hbm.world.gen.INBTTransformable;
|
||||
|
||||
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.BlockPistonBase;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.client.gui.GuiTextField;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.event.RenderGameOverlayEvent.Pre;
|
||||
|
||||
public class BlockWandJigsaw extends BlockContainer implements IBlockSideRotation, INBTTransformable, IGUIProvider, ILookOverlay {
|
||||
|
||||
private IIcon iconTop;
|
||||
private IIcon iconSide;
|
||||
private IIcon iconBack;
|
||||
|
||||
public BlockWandJigsaw() {
|
||||
super(Material.iron);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
return new TileEntityWandJigsaw();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack stack) {
|
||||
int l = BlockPistonBase.determineOrientation(world, x, y, z, player);
|
||||
world.setBlockMetadataWithNotify(x, y, z, l, 2);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister iconRegister) {
|
||||
this.blockIcon = iconRegister.registerIcon(RefStrings.MODID + ":wand_jigsaw");
|
||||
this.iconTop = iconRegister.registerIcon(RefStrings.MODID + ":wand_jigsaw_top");
|
||||
this.iconSide = iconRegister.registerIcon(RefStrings.MODID + ":wand_jigsaw_side");
|
||||
this.iconBack = iconRegister.registerIcon(RefStrings.MODID + ":wand_jigsaw_back");
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
if(side == meta) return blockIcon;
|
||||
if(IBlockSideRotation.isOpposite(side, meta)) return iconBack;
|
||||
if(side <= 1) return iconTop;
|
||||
if(side > 3 && meta <= 1) return iconTop;
|
||||
return iconSide;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRotationFromSide(IBlockAccess world, int x, int y, int z, int side) {
|
||||
if(side == 0) return IBlockSideRotation.topToBottom(getRotationFromSide(world, x, y, z, 1));
|
||||
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
if(side == meta || IBlockSideRotation.isOpposite(side, meta)) return 0;
|
||||
|
||||
// downwards facing has no changes, upwards flips anything not handled already
|
||||
if(meta == 0) return 0;
|
||||
if(meta == 1) return 3;
|
||||
|
||||
// top (and bottom) is rotated fairly normally
|
||||
if(side == 1) {
|
||||
switch(meta) {
|
||||
case 2: return 3;
|
||||
case 3: return 0;
|
||||
case 4: return 1;
|
||||
case 5: return 2;
|
||||
}
|
||||
}
|
||||
|
||||
// you know what I aint explaining further, it's a fucking mess here
|
||||
if(meta == 2) return side == 4 ? 2 : 1;
|
||||
if(meta == 3) return side == 4 ? 1 : 2;
|
||||
if(meta == 4) return side == 2 ? 1 : 2;
|
||||
if(meta == 5) return side == 2 ? 2 : 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return IBlockSideRotation.getRenderType();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int transformMeta(int meta, int coordBaseMode) {
|
||||
return INBTTransformable.transformMetaDeco(meta, coordBaseMode);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
|
||||
if(!(te instanceof TileEntityWandJigsaw)) return false;
|
||||
|
||||
TileEntityWandJigsaw jigsaw = (TileEntityWandJigsaw) te;
|
||||
|
||||
if(!player.isSneaking()) {
|
||||
Block block = getBlock(world, player.getHeldItem());
|
||||
if(block == ModBlocks.wand_air) block = Blocks.air;
|
||||
|
||||
if(block != null && block != ModBlocks.wand_jigsaw && block != ModBlocks.wand_loot) {
|
||||
jigsaw.replaceBlock = block;
|
||||
jigsaw.replaceMeta = player.getHeldItem().getItemDamage();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
if(world.isRemote) FMLNetworkHandler.openGui(player, MainRegistry.instance, 0, world, x, y, z);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private Block getBlock(World world, ItemStack stack) {
|
||||
if(stack == null) return null;
|
||||
if(!(stack.getItem() instanceof ItemBlock)) return null;
|
||||
|
||||
return ((ItemBlock) stack.getItem()).field_150939_a;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public Object provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return new GuiWandJigsaw((TileEntityWandJigsaw) world.getTileEntity(x, y, z));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Container provideContainer(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void printHook(Pre event, World world, int x, int y, int z) {
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
if(!(te instanceof TileEntityWandJigsaw)) return;
|
||||
TileEntityWandJigsaw jigsaw = (TileEntityWandJigsaw) te;
|
||||
|
||||
List<String> text = new ArrayList<String>();
|
||||
|
||||
text.add(EnumChatFormatting.GRAY + "Target pool: " + EnumChatFormatting.RESET + jigsaw.pool);
|
||||
text.add(EnumChatFormatting.GRAY + "Name: " + EnumChatFormatting.RESET + jigsaw.name);
|
||||
text.add(EnumChatFormatting.GRAY + "Target name: " + EnumChatFormatting.RESET + jigsaw.target);
|
||||
text.add(EnumChatFormatting.GRAY + "Turns into: " + EnumChatFormatting.RESET + GameRegistry.findUniqueIdentifierFor(jigsaw.replaceBlock).toString());
|
||||
text.add(EnumChatFormatting.GRAY + " with meta: " + EnumChatFormatting.RESET + jigsaw.replaceMeta);
|
||||
text.add(EnumChatFormatting.GRAY + "Selection/Placement priority: " + EnumChatFormatting.RESET + jigsaw.selectionPriority + "/" + jigsaw.placementPriority);
|
||||
text.add(EnumChatFormatting.GRAY + "Joint type: " + EnumChatFormatting.RESET + (jigsaw.isRollable ? "Rollable" : "Aligned"));
|
||||
|
||||
ILookOverlay.printGeneric(event, I18nUtil.resolveKey(getUnlocalizedName() + ".name"), 0xffff00, 0x404000, text);
|
||||
}
|
||||
|
||||
|
||||
public static class TileEntityWandJigsaw extends TileEntityLoadedBase implements IControlReceiver {
|
||||
|
||||
private int selectionPriority = 0; // higher priority = this jigsaw block is selected first for generation
|
||||
private int placementPriority = 0; // higher priority = children of this jigsaw block are checked for jigsaw blocks of their own and selected first
|
||||
private String pool = "default";
|
||||
private String name = "default";
|
||||
private String target = "default";
|
||||
private Block replaceBlock = Blocks.air;
|
||||
private int replaceMeta = 0;
|
||||
private boolean isRollable = true; // sets joint type, rollable joints can be placed in any orientation for vertical jigsaw connections
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
if(!worldObj.isRemote) {
|
||||
networkPackNT(15);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void serialize(ByteBuf buf) {
|
||||
buf.writeInt(selectionPriority);
|
||||
buf.writeInt(placementPriority);
|
||||
BufferUtil.writeString(buf, pool);
|
||||
BufferUtil.writeString(buf, name);
|
||||
BufferUtil.writeString(buf, target);
|
||||
buf.writeInt(Block.getIdFromBlock(replaceBlock));
|
||||
buf.writeInt(replaceMeta);
|
||||
buf.writeBoolean(isRollable);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deserialize(ByteBuf buf) {
|
||||
selectionPriority = buf.readInt();
|
||||
placementPriority = buf.readInt();
|
||||
pool = BufferUtil.readString(buf);
|
||||
name = BufferUtil.readString(buf);
|
||||
target = BufferUtil.readString(buf);
|
||||
replaceBlock = Block.getBlockById(buf.readInt());
|
||||
replaceMeta = buf.readInt();
|
||||
isRollable = buf.readBoolean();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbt) {
|
||||
super.writeToNBT(nbt);
|
||||
nbt.setInteger("direction", this.getBlockMetadata());
|
||||
|
||||
nbt.setInteger("selection", selectionPriority);
|
||||
nbt.setInteger("placement", placementPriority);
|
||||
nbt.setString("pool", pool);
|
||||
nbt.setString("name", name);
|
||||
nbt.setString("target", target);
|
||||
nbt.setString("block", GameRegistry.findUniqueIdentifierFor(replaceBlock).toString());
|
||||
nbt.setInteger("meta", replaceMeta);
|
||||
nbt.setBoolean("roll", isRollable);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
super.readFromNBT(nbt);
|
||||
|
||||
selectionPriority = nbt.getInteger("selection");
|
||||
placementPriority = nbt.getInteger("placement");
|
||||
pool = nbt.getString("pool");
|
||||
name = nbt.getString("name");
|
||||
target = nbt.getString("target");
|
||||
replaceBlock = Block.getBlockFromName(nbt.getString("block"));
|
||||
replaceMeta = nbt.getInteger("meta");
|
||||
isRollable = nbt.getBoolean("roll");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasPermission(EntityPlayer player) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void receiveControl(NBTTagCompound nbt) {
|
||||
readFromNBT(nbt);
|
||||
markDirty();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static class GuiWandJigsaw extends GuiScreen {
|
||||
|
||||
private final TileEntityWandJigsaw jigsaw;
|
||||
|
||||
private GuiTextField textPool;
|
||||
private GuiTextField textName;
|
||||
private GuiTextField textTarget;
|
||||
|
||||
private GuiTextField textSelectionPriority;
|
||||
private GuiTextField textPlacementPriority;
|
||||
|
||||
private GuiButton jointToggle;
|
||||
|
||||
public GuiWandJigsaw(TileEntityWandJigsaw jigsaw) {
|
||||
this.jigsaw = jigsaw;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initGui() {
|
||||
Keyboard.enableRepeatEvents(true);
|
||||
|
||||
textPool = new GuiTextField(fontRendererObj, this.width / 2 - 150, 50, 300, 20);
|
||||
textPool.setText(jigsaw.pool);
|
||||
|
||||
textName = new GuiTextField(fontRendererObj, this.width / 2 - 150, 100, 140, 20);
|
||||
textName.setText(jigsaw.name);
|
||||
|
||||
textTarget = new GuiTextField(fontRendererObj, this.width / 2 + 10, 100, 140, 20);
|
||||
textTarget.setText(jigsaw.target);
|
||||
|
||||
textSelectionPriority = new GuiTextField(fontRendererObj, this.width / 2 - 150, 150, 90, 20);
|
||||
textSelectionPriority.setText("" + jigsaw.selectionPriority);
|
||||
|
||||
textPlacementPriority = new GuiTextField(fontRendererObj, this.width / 2 - 40, 150, 90, 20);
|
||||
textPlacementPriority.setText("" + jigsaw.placementPriority);
|
||||
|
||||
jointToggle = new GuiButton(0, this.width / 2 + 60, 150, 90, 20, jigsaw.isRollable ? "Rollable" : "Aligned");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawScreen(int mouseX, int mouseY, float partialTicks) {
|
||||
drawDefaultBackground();
|
||||
|
||||
drawString(fontRendererObj, "Target pool:", this.width / 2 - 150, 37, 0xA0A0A0);
|
||||
textPool.drawTextBox();
|
||||
|
||||
drawString(fontRendererObj, "Name:", this.width / 2 - 150, 87, 0xA0A0A0);
|
||||
textName.drawTextBox();
|
||||
|
||||
drawString(fontRendererObj, "Target name:", this.width / 2 + 10, 87, 0xA0A0A0);
|
||||
textTarget.drawTextBox();
|
||||
|
||||
drawString(fontRendererObj, "Selection priority:", this.width / 2 - 150, 137, 0xA0A0A0);
|
||||
textSelectionPriority.drawTextBox();
|
||||
|
||||
drawString(fontRendererObj, "Placement priority:", this.width / 2 - 40, 137, 0xA0A0A0);
|
||||
textPlacementPriority.drawTextBox();
|
||||
|
||||
drawString(fontRendererObj, "Joint type:", this.width / 2 + 60, 137, 0xA0A0A0);
|
||||
jointToggle.drawButton(mc, mouseX, mouseY);
|
||||
|
||||
super.drawScreen(mouseX, mouseY, partialTicks);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onGuiClosed() {
|
||||
Keyboard.enableRepeatEvents(false);
|
||||
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
jigsaw.writeToNBT(data);
|
||||
|
||||
data.setString("pool", textPool.getText());
|
||||
data.setString("name", textName.getText());
|
||||
data.setString("target", textTarget.getText());
|
||||
|
||||
try { data.setInteger("selection", Integer.parseInt(textSelectionPriority.getText())); } catch(Exception ex) {}
|
||||
try { data.setInteger("placement", Integer.parseInt(textPlacementPriority.getText())); } catch(Exception ex) {}
|
||||
|
||||
data.setBoolean("roll", jointToggle.displayString == "Rollable");
|
||||
|
||||
PacketDispatcher.wrapper.sendToServer(new NBTControlPacket(data, jigsaw.xCoord, jigsaw.yCoord, jigsaw.zCoord));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void keyTyped(char typedChar, int keyCode) {
|
||||
super.keyTyped(typedChar, keyCode);
|
||||
textPool.textboxKeyTyped(typedChar, keyCode);
|
||||
textName.textboxKeyTyped(typedChar, keyCode);
|
||||
textTarget.textboxKeyTyped(typedChar, keyCode);
|
||||
textSelectionPriority.textboxKeyTyped(typedChar, keyCode);
|
||||
textPlacementPriority.textboxKeyTyped(typedChar, keyCode);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void mouseClicked(int mouseX, int mouseY, int mouseButton) {
|
||||
super.mouseClicked(mouseX, mouseY, mouseButton);
|
||||
textPool.mouseClicked(mouseX, mouseY, mouseButton);
|
||||
textName.mouseClicked(mouseX, mouseY, mouseButton);
|
||||
textTarget.mouseClicked(mouseX, mouseY, mouseButton);
|
||||
textSelectionPriority.mouseClicked(mouseX, mouseY, mouseButton);
|
||||
textPlacementPriority.mouseClicked(mouseX, mouseY, mouseButton);
|
||||
|
||||
if(jointToggle.mousePressed(mc, mouseX, mouseY)) {
|
||||
System.out.println("displayString: " + jointToggle.displayString);
|
||||
jointToggle.displayString = jointToggle.displayString == "Rollable" ? "Aligned" : "Rollable";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
338
src/main/java/com/hbm/blocks/generic/BlockWandLoot.java
Normal file
338
src/main/java/com/hbm/blocks/generic/BlockWandLoot.java
Normal file
@ -0,0 +1,338 @@
|
||||
package com.hbm.blocks.generic;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
import com.hbm.blocks.IBlockSideRotation;
|
||||
import com.hbm.blocks.ILookOverlay;
|
||||
import com.hbm.blocks.ITooltipProvider;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.config.StructureConfig;
|
||||
import com.hbm.itempool.ItemPool;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.tileentity.TileEntityLoadedBase;
|
||||
import com.hbm.util.BufferUtil;
|
||||
import com.hbm.util.I18nUtil;
|
||||
import com.hbm.util.LootGenerator;
|
||||
import com.hbm.world.gen.INBTTileEntityTransformable;
|
||||
import com.mojang.authlib.GameProfile;
|
||||
|
||||
import api.hbm.block.IToolable;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.ITileEntityProvider;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.WeightedRandomChestContent;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.WorldServer;
|
||||
import net.minecraftforge.client.event.RenderGameOverlayEvent.Pre;
|
||||
import net.minecraftforge.common.util.FakePlayer;
|
||||
import net.minecraftforge.common.util.FakePlayerFactory;
|
||||
|
||||
public class BlockWandLoot extends BlockContainer implements ILookOverlay, IToolable, ITooltipProvider, IBlockSideRotation {
|
||||
|
||||
@SideOnly(Side.CLIENT) protected IIcon iconTop;
|
||||
|
||||
public BlockWandLoot() {
|
||||
super(Material.iron);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister iconRegister) {
|
||||
this.blockIcon = iconRegister.registerIcon(RefStrings.MODID + ":wand_loot");
|
||||
this.iconTop = iconRegister.registerIcon(RefStrings.MODID + ":wand_loot_top");
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
return (side <= 1) ? iconTop : blockIcon;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRotationFromSide(IBlockAccess world, int x, int y, int z, int side) {
|
||||
if(side == 0) return IBlockSideRotation.topToBottom(world.getBlockMetadata(x, y, z));
|
||||
if(side == 1) return world.getBlockMetadata(x, y, z);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return IBlockSideRotation.getRenderType();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) {
|
||||
int i = MathHelper.floor_double(player.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
|
||||
|
||||
if(i == 0) world.setBlockMetadataWithNotify(x, y, z, 3, 2);
|
||||
if(i == 1) world.setBlockMetadataWithNotify(x, y, z, 2, 2);
|
||||
if(i == 2) world.setBlockMetadataWithNotify(x, y, z, 0, 2);
|
||||
if(i == 3) world.setBlockMetadataWithNotify(x, y, z, 1, 2);
|
||||
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
if(!(te instanceof TileEntityWandLoot)) return;
|
||||
((TileEntityWandLoot) te).placedRotation = player.rotationYaw;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void printHook(Pre event, World world, int x, int y, int z) {
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
|
||||
if(!(te instanceof TileEntityWandLoot)) return;
|
||||
|
||||
TileEntityWandLoot loot = (TileEntityWandLoot) te;
|
||||
|
||||
List<String> text = new ArrayList<String>();
|
||||
text.add("Will replace with: " + loot.replaceBlock.getUnlocalizedName());
|
||||
text.add(" meta: " + loot.replaceMeta);
|
||||
text.add("Loot pool: " + loot.poolName);
|
||||
if(loot.replaceBlock != ModBlocks.deco_loot) {
|
||||
text.add("Minimum items: " + loot.minItems);
|
||||
text.add("Maximum items: " + loot.maxItems);
|
||||
}
|
||||
|
||||
ILookOverlay.printGeneric(event, I18nUtil.resolveKey(getUnlocalizedName() + ".name"), 0xffff00, 0x404000, text);
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean ext) {
|
||||
list.add("Define loot crates/piles in .nbt structures");
|
||||
list.add(EnumChatFormatting.GOLD + "Use screwdriver to increase/decrease minimum loot");
|
||||
list.add(EnumChatFormatting.GOLD + "Use hand drill to increase/decrease maximum loot");
|
||||
list.add(EnumChatFormatting.GOLD + "Use defuser to cycle loot types");
|
||||
list.add(EnumChatFormatting.GOLD + "Use container block to set the block that spawns with loot inside");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
|
||||
if(!(te instanceof TileEntityWandLoot)) return false;
|
||||
|
||||
TileEntityWandLoot loot = (TileEntityWandLoot) te;
|
||||
|
||||
if(!player.isSneaking()) {
|
||||
|
||||
Block block = getLootableBlock(world, player.getHeldItem());
|
||||
|
||||
if(block != null) {
|
||||
loot.replaceBlock = block;
|
||||
loot.replaceMeta = player.getHeldItem().getItemDamage();
|
||||
|
||||
List<String> poolNames = loot.getPoolNames(block == ModBlocks.deco_loot);
|
||||
if(!poolNames.contains(loot.poolName)) {
|
||||
loot.poolName = poolNames.get(0);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private Block getLootableBlock(World world, ItemStack stack) {
|
||||
if(stack == null) return null;
|
||||
|
||||
if(stack.getItem() instanceof ItemBlock) {
|
||||
Block block = ((ItemBlock) stack.getItem()).field_150939_a;
|
||||
|
||||
if(block == ModBlocks.deco_loot) return block;
|
||||
|
||||
if(block instanceof ITileEntityProvider) {
|
||||
TileEntity te = ((ITileEntityProvider) block).createNewTileEntity(world, 12);
|
||||
if(te instanceof IInventory) return block;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onScrew(World world, EntityPlayer player, int x, int y, int z, int side, float fX, float fY, float fZ, ToolType tool) {
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
|
||||
if(!(te instanceof TileEntityWandLoot)) return false;
|
||||
|
||||
TileEntityWandLoot loot = (TileEntityWandLoot) te;
|
||||
|
||||
switch(tool) {
|
||||
case SCREWDRIVER:
|
||||
if(player.isSneaking()) {
|
||||
loot.minItems--;
|
||||
if(loot.minItems < 0) loot.minItems = 0;
|
||||
} else {
|
||||
loot.minItems++;
|
||||
loot.maxItems = Math.max(loot.minItems, loot.maxItems);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
case HAND_DRILL:
|
||||
if(player.isSneaking()) {
|
||||
loot.maxItems--;
|
||||
if(loot.maxItems < 0) loot.maxItems = 0;
|
||||
loot.minItems = Math.min(loot.minItems, loot.maxItems);
|
||||
} else {
|
||||
loot.maxItems++;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
case DEFUSER:
|
||||
List<String> poolNames = loot.getPoolNames(loot.replaceBlock == ModBlocks.deco_loot);
|
||||
int index = poolNames.indexOf(loot.poolName);
|
||||
|
||||
index += player.isSneaking() ? -1 : 1;
|
||||
index = MathHelper.clamp_int(index, 0, poolNames.size() - 1);
|
||||
|
||||
loot.poolName = poolNames.get(index);
|
||||
|
||||
return true;
|
||||
|
||||
default: return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
return new TileEntityWandLoot();
|
||||
}
|
||||
|
||||
public static class TileEntityWandLoot extends TileEntityLoadedBase implements INBTTileEntityTransformable {
|
||||
|
||||
private boolean triggerReplace;
|
||||
|
||||
private Block replaceBlock = ModBlocks.deco_loot;
|
||||
private int replaceMeta;
|
||||
|
||||
private String poolName = LootGenerator.LOOT_BOOKLET;
|
||||
private int minItems;
|
||||
private int maxItems = 1;
|
||||
|
||||
private float placedRotation;
|
||||
|
||||
private static final GameProfile FAKE_PROFILE = new GameProfile(UUID.fromString("839eb18c-50bc-400c-8291-9383f09763e7"), "[NTM]");
|
||||
private static FakePlayer fakePlayer;
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
if(!worldObj.isRemote) {
|
||||
if(triggerReplace) {
|
||||
// On the first tick of this TE, replace with intended block and fill with loot
|
||||
replace();
|
||||
} else {
|
||||
networkPackNT(15);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void replace() {
|
||||
WeightedRandomChestContent[] pool = ItemPool.getPool(poolName);
|
||||
|
||||
worldObj.setBlock(xCoord, yCoord, zCoord, replaceBlock, replaceMeta, 2);
|
||||
|
||||
TileEntity te = worldObj.getTileEntity(xCoord, yCoord, zCoord);
|
||||
|
||||
if(te instanceof IInventory) {
|
||||
int count = minItems;
|
||||
if(maxItems - minItems > 0) count += worldObj.rand.nextInt(maxItems - minItems);
|
||||
WeightedRandomChestContent.generateChestContents(worldObj.rand, pool, (IInventory) te, count);
|
||||
} else if(te instanceof BlockLoot.TileEntityLoot) {
|
||||
LootGenerator.applyLoot(worldObj, xCoord, yCoord, zCoord, poolName);
|
||||
}
|
||||
|
||||
// Shouldn't happen but let's guard anyway, if it fails we just don't rotate the chest block correctly
|
||||
if(!(worldObj instanceof WorldServer)) return;
|
||||
|
||||
if(fakePlayer == null || fakePlayer.worldObj != worldObj) {
|
||||
fakePlayer = FakePlayerFactory.get((WorldServer)worldObj, FAKE_PROFILE);
|
||||
}
|
||||
|
||||
fakePlayer.rotationYaw = fakePlayer.rotationYawHead = placedRotation;
|
||||
|
||||
ItemStack fakeStack = new ItemStack(replaceBlock, 1, replaceMeta);
|
||||
|
||||
replaceBlock.onBlockPlacedBy(worldObj, xCoord, yCoord, zCoord, fakePlayer, fakeStack);
|
||||
}
|
||||
|
||||
private List<String> getPoolNames(boolean loot) {
|
||||
if(loot) return Arrays.asList(LootGenerator.getLootNames());
|
||||
|
||||
List<String> names = new ArrayList<>();
|
||||
names.addAll(ItemPool.pools.keySet());
|
||||
return names;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void transformTE(World world, int coordBaseMode) {
|
||||
triggerReplace = !StructureConfig.debugStructures;
|
||||
placedRotation = MathHelper.wrapAngleTo180_float(placedRotation + coordBaseMode * 90);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbt) {
|
||||
super.writeToNBT(nbt);
|
||||
Block writeBlock = replaceBlock == null ? ModBlocks.deco_loot : replaceBlock;
|
||||
nbt.setString("block", GameRegistry.findUniqueIdentifierFor(writeBlock).toString());
|
||||
nbt.setInteger("meta", replaceMeta);
|
||||
nbt.setInteger("min", minItems);
|
||||
nbt.setInteger("max", maxItems);
|
||||
nbt.setString("pool", poolName);
|
||||
nbt.setFloat("rot", placedRotation);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
super.readFromNBT(nbt);
|
||||
replaceBlock = Block.getBlockFromName(nbt.getString("block"));
|
||||
replaceMeta = nbt.getInteger("meta");
|
||||
minItems = nbt.getInteger("min");
|
||||
maxItems = nbt.getInteger("max");
|
||||
poolName = nbt.getString("pool");
|
||||
placedRotation = nbt.getFloat("rot");
|
||||
|
||||
if(replaceBlock == null) replaceBlock = ModBlocks.deco_loot;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void serialize(ByteBuf buf) {
|
||||
buf.writeInt(Block.getIdFromBlock(replaceBlock));
|
||||
buf.writeInt(replaceMeta);
|
||||
buf.writeInt(minItems);
|
||||
buf.writeInt(maxItems);
|
||||
BufferUtil.writeString(buf, poolName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deserialize(ByteBuf buf) {
|
||||
replaceBlock = Block.getBlockById(buf.readInt());
|
||||
replaceMeta = buf.readInt();
|
||||
minItems = buf.readInt();
|
||||
maxItems = buf.readInt();
|
||||
poolName = BufferUtil.readString(buf);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -6,6 +6,7 @@ import java.util.Random;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.tileentity.deco.TileEntityDecoBlock;
|
||||
import com.hbm.world.gen.INBTTransformable;
|
||||
|
||||
import api.hbm.block.IToolable;
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
@ -24,8 +25,8 @@ import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class DecoBlock extends BlockContainer implements IToolable {
|
||||
|
||||
public class DecoBlock extends BlockContainer implements IToolable, INBTTransformable {
|
||||
|
||||
Random rand = new Random();
|
||||
|
||||
public DecoBlock(Material p_i45386_1_) {
|
||||
@ -36,7 +37,7 @@ public class DecoBlock extends BlockContainer implements IToolable {
|
||||
public boolean onScrew(World world, EntityPlayer player, int x, int y, int z, int side, float fX, float fY, float fZ, ToolType tool) {
|
||||
if(tool != ToolType.SCREWDRIVER) return false;
|
||||
if(this != ModBlocks.steel_wall && this != ModBlocks.steel_corner) return false;
|
||||
|
||||
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
|
||||
if(!player.isSneaking()) {
|
||||
@ -50,7 +51,7 @@ public class DecoBlock extends BlockContainer implements IToolable {
|
||||
else if(meta == 2) world.setBlockMetadataWithNotify(x, y, z, 4, 3);
|
||||
else if(meta == 5) world.setBlockMetadataWithNotify(x, y, z, 2, 3);
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -65,7 +66,7 @@ public class DecoBlock extends BlockContainer implements IToolable {
|
||||
public static int renderIDBeam = RenderingRegistry.getNextAvailableRenderId();
|
||||
public static int renderIDWall = RenderingRegistry.getNextAvailableRenderId();
|
||||
public static int renderIDCorner = RenderingRegistry.getNextAvailableRenderId();
|
||||
|
||||
|
||||
@Override
|
||||
public int getRenderType(){
|
||||
if(this == ModBlocks.steel_wall) return renderIDWall;
|
||||
@ -73,32 +74,32 @@ public class DecoBlock extends BlockContainer implements IToolable {
|
||||
if(this == ModBlocks.steel_beam) return renderIDBeam;
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) {
|
||||
return Item.getItemFromBlock(this);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) {
|
||||
int i = MathHelper.floor_double(player.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
|
||||
|
||||
|
||||
if(i == 0) world.setBlockMetadataWithNotify(x, y, z, 3, 2);
|
||||
if(i == 1) world.setBlockMetadataWithNotify(x, y, z, 4, 2);
|
||||
if(i == 2) world.setBlockMetadataWithNotify(x, y, z, 2, 2);
|
||||
if(i == 3) world.setBlockMetadataWithNotify(x, y, z, 5, 2);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) {
|
||||
int te = world.getBlockMetadata(x, y, z);
|
||||
@ -141,14 +142,14 @@ public class DecoBlock extends BlockContainer implements IToolable {
|
||||
this.setBlockBoundsBasedOnState(world, x, y, z);
|
||||
return AxisAlignedBB.getBoundingBox(x + this.minX, y + this.minY, z + this.minZ, x + this.maxX, y + this.maxY, z + this.maxZ);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void addCollisionBoxesToList(World world, int x, int y, int z, AxisAlignedBB aabb, List list, Entity collider) {
|
||||
|
||||
|
||||
if(this == ModBlocks.steel_corner) {
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
List<AxisAlignedBB> bbs = new ArrayList();
|
||||
|
||||
|
||||
switch(meta) {
|
||||
case 2:
|
||||
bbs.add(AxisAlignedBB.getBoundingBox(x + 0.25D, y + 0D, z + 0.875D, x + 1D, y + 1D, z + 1D));
|
||||
@ -171,7 +172,7 @@ public class DecoBlock extends BlockContainer implements IToolable {
|
||||
bbs.add(AxisAlignedBB.getBoundingBox(x + 0.25D, y + 0D, z + 0D, x + 1D, y + 1D, z + 0.125D));
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
for(AxisAlignedBB bb : bbs) {
|
||||
if(aabb.intersectsWith(bb)) {
|
||||
list.add(bb);
|
||||
@ -181,4 +182,9 @@ public class DecoBlock extends BlockContainer implements IToolable {
|
||||
super.addCollisionBoxesToList(world, x, y, z, aabb, list, collider);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int transformMeta(int meta, int coordBaseMode) {
|
||||
return INBTTransformable.transformMetaDeco(meta, coordBaseMode);
|
||||
}
|
||||
}
|
||||
@ -1,6 +1,7 @@
|
||||
package com.hbm.blocks.generic;
|
||||
|
||||
import com.hbm.tileentity.deco.TileEntityDecoPoleSatelliteReceiver;
|
||||
import com.hbm.world.gen.INBTTransformable;
|
||||
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
@ -10,7 +11,7 @@ import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class DecoPoleSatelliteReceiver extends BlockContainer {
|
||||
public class DecoPoleSatelliteReceiver extends BlockContainer implements INBTTransformable {
|
||||
|
||||
public DecoPoleSatelliteReceiver(Material p_i45386_1_) {
|
||||
super(p_i45386_1_);
|
||||
@ -20,26 +21,26 @@ public class DecoPoleSatelliteReceiver extends BlockContainer {
|
||||
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
|
||||
return new TileEntityDecoPoleSatelliteReceiver();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getRenderType(){
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) {
|
||||
int i = MathHelper.floor_double(player.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
|
||||
|
||||
|
||||
if(i == 0)
|
||||
{
|
||||
world.setBlockMetadataWithNotify(x, y, z, 2, 2);
|
||||
@ -58,4 +59,9 @@ public class DecoPoleSatelliteReceiver extends BlockContainer {
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@Override
|
||||
public int transformMeta(int meta, int coordBaseMode) {
|
||||
return INBTTransformable.transformMetaDeco(meta, coordBaseMode);
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,5 +1,7 @@
|
||||
package com.hbm.blocks.generic;
|
||||
|
||||
import com.hbm.world.gen.INBTTransformable;
|
||||
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
@ -9,7 +11,7 @@ import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class DecoTapeRecorder extends BlockContainer {
|
||||
public class DecoTapeRecorder extends BlockContainer implements INBTTransformable {
|
||||
|
||||
public DecoTapeRecorder(Material p_i45386_1_) {
|
||||
super(p_i45386_1_);
|
||||
@ -19,28 +21,28 @@ public class DecoTapeRecorder extends BlockContainer {
|
||||
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
public static int renderID = RenderingRegistry.getNextAvailableRenderId();
|
||||
|
||||
|
||||
@Override
|
||||
public int getRenderType(){
|
||||
return renderID;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) {
|
||||
int i = MathHelper.floor_double(player.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
|
||||
|
||||
|
||||
if(i == 0)
|
||||
{
|
||||
world.setBlockMetadataWithNotify(x, y, z, 2, 2);
|
||||
@ -59,4 +61,9 @@ public class DecoTapeRecorder extends BlockContainer {
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@Override
|
||||
public int transformMeta(int meta, int coordBaseMode) {
|
||||
return INBTTransformable.transformMetaDeco(meta, coordBaseMode);
|
||||
}
|
||||
|
||||
}
|
||||
101
src/main/java/com/hbm/blocks/machine/BlockRefueler.java
Normal file
101
src/main/java/com/hbm/blocks/machine/BlockRefueler.java
Normal file
@ -0,0 +1,101 @@
|
||||
package com.hbm.blocks.machine;
|
||||
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.items.machine.IItemFluidIdentifier;
|
||||
import com.hbm.tileentity.machine.TileEntityRefueler;
|
||||
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.util.ChatComponentTranslation;
|
||||
import net.minecraft.util.ChatStyle;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockRefueler extends BlockContainer {
|
||||
|
||||
public BlockRefueler(Material mat) {
|
||||
super(mat);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
return new TileEntityRefueler();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||
if(!world.isRemote && !player.isSneaking()) {
|
||||
if(player.getHeldItem() != null && player.getHeldItem().getItem() instanceof IItemFluidIdentifier) {
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
|
||||
if(!(te instanceof TileEntityRefueler))
|
||||
return false;
|
||||
|
||||
TileEntityRefueler refueler = (TileEntityRefueler) te;
|
||||
FluidType type = ((IItemFluidIdentifier) player.getHeldItem().getItem()).getType(world, x, y, z, player.getHeldItem());
|
||||
refueler.tank.setTankType(type);
|
||||
refueler.markDirty();
|
||||
player.addChatComponentMessage(new ChatComponentText("Changed type to ").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.YELLOW)).appendSibling(new ChatComponentTranslation(type.getConditionalName())).appendSibling(new ChatComponentText("!")));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack stack) {
|
||||
int i = MathHelper.floor_double(player.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
|
||||
|
||||
if(i == 0) world.setBlockMetadataWithNotify(x, y, z, 2, 2);
|
||||
if(i == 1) world.setBlockMetadataWithNotify(x, y, z, 5, 2);
|
||||
if(i == 2) world.setBlockMetadataWithNotify(x, y, z, 3, 2);
|
||||
if(i == 3) world.setBlockMetadataWithNotify(x, y, z, 4, 2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) {
|
||||
float f = 0.0625F;
|
||||
|
||||
switch(world.getBlockMetadata(x, y, z)) {
|
||||
case 2: this.setBlockBounds(0F, 0F, 12 * f, 1F, 1F, 1F); break;
|
||||
case 3: this.setBlockBounds(0F, 0F, 0F, 1F, 1F, 4 * f); break;
|
||||
case 4: this.setBlockBounds(12 * f, 0F, 0F, 1F, 1F, 1F); break;
|
||||
case 5: this.setBlockBounds(0F, 0F, 0F, 4 * f, 1F, 1F); break;
|
||||
default: this.setBlockBounds(0F, 0F, 0F, 1F, 1F, 1F); break;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z) {
|
||||
this.setBlockBoundsBasedOnState(world, x, y, z);
|
||||
return AxisAlignedBB.getBoundingBox(x + this.minX, y + this.minY, z + this.minZ, x + this.maxX, y + this.maxY, z + this.maxZ);
|
||||
}
|
||||
|
||||
}
|
||||
@ -7,6 +7,7 @@ import java.util.Random;
|
||||
import com.hbm.blocks.BlockEnums.LightType;
|
||||
import com.hbm.blocks.ISpotlight;
|
||||
import com.hbm.main.ResourceManager;
|
||||
import com.hbm.world.gen.INBTTransformable;
|
||||
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
@ -14,6 +15,7 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockSlab;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
@ -22,7 +24,7 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.model.obj.WavefrontObject;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class Spotlight extends Block implements ISpotlight {
|
||||
public class Spotlight extends Block implements ISpotlight, INBTTransformable {
|
||||
|
||||
// I'd be extending the ReinforcedLamp class if it wasn't for the inverted behaviour of these specific lights
|
||||
// I want these blocks to be eminently useful, so removing the need for redstone by default is desired,
|
||||
@ -38,7 +40,7 @@ public class Spotlight extends Block implements ISpotlight {
|
||||
this.beamLength = beamLength;
|
||||
this.type = type;
|
||||
this.isOn = isOn;
|
||||
|
||||
|
||||
this.setHardness(1F);
|
||||
|
||||
if(isOn) setLightLevel(1.0F);
|
||||
@ -123,6 +125,8 @@ public class Spotlight extends Block implements ISpotlight {
|
||||
}
|
||||
|
||||
private boolean updatePower(World world, int x, int y, int z) {
|
||||
if(isBroken(world.getBlockMetadata(x, y, z))) return false;
|
||||
|
||||
boolean isPowered = world.isBlockIndirectlyGettingPowered(x, y, z);
|
||||
if(isOn && isPowered) {
|
||||
world.scheduleBlockUpdate(x, y, z, this, 4);
|
||||
@ -148,7 +152,7 @@ public class Spotlight extends Block implements ISpotlight {
|
||||
@Override
|
||||
public void updateTick(World world, int x, int y, int z, Random p_149674_5_) {
|
||||
if (world.isRemote) return;
|
||||
|
||||
|
||||
if (isOn && world.isBlockIndirectlyGettingPowered(x, y, z)) {
|
||||
world.setBlock(x, y, z, getOff(), world.getBlockMetadata(x, y, z), 2);
|
||||
}
|
||||
@ -159,6 +163,7 @@ public class Spotlight extends Block implements ISpotlight {
|
||||
public void onNeighborBlockChange(World world, int x, int y, int z, Block neighborBlock) {
|
||||
if(world.isRemote) return;
|
||||
if(neighborBlock instanceof SpotlightBeam) return;
|
||||
if(neighborBlock == Blocks.air) return;
|
||||
|
||||
ForgeDirection dir = getDirection(world, x, y, z);
|
||||
|
||||
@ -172,13 +177,13 @@ public class Spotlight extends Block implements ISpotlight {
|
||||
|
||||
updateBeam(world, x, y, z);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean canPlaceBlockOnSide(World world, int x, int y, int z, int side) {
|
||||
if(!super.canPlaceBlockOnSide(world, x, y, z, side)) return false;
|
||||
|
||||
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(side);
|
||||
|
||||
|
||||
return canPlace(world, x, y, z, dir);
|
||||
}
|
||||
|
||||
@ -215,6 +220,10 @@ public class Spotlight extends Block implements ISpotlight {
|
||||
return ForgeDirection.getOrientation(metadata >> 1);
|
||||
}
|
||||
|
||||
public boolean isBroken(int metadata) {
|
||||
return (metadata & 1) == 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(int i, Random r, int j) {
|
||||
return Item.getItemFromBlock(getOn());
|
||||
@ -292,20 +301,20 @@ public class Spotlight extends Block implements ISpotlight {
|
||||
|
||||
backPropagate(world, x, y, z, dir);
|
||||
}
|
||||
|
||||
|
||||
protected Block getOff() {
|
||||
if(this == ModBlocks.spotlight_incandescent) return ModBlocks.spotlight_incandescent_off;
|
||||
if(this == ModBlocks.spotlight_fluoro) return ModBlocks.spotlight_fluoro_off;
|
||||
if(this == ModBlocks.spotlight_halogen) return ModBlocks.spotlight_halogen_off;
|
||||
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
protected Block getOn() {
|
||||
if(this == ModBlocks.spotlight_incandescent_off) return ModBlocks.spotlight_incandescent;
|
||||
if(this == ModBlocks.spotlight_fluoro_off) return ModBlocks.spotlight_fluoro;
|
||||
if(this == ModBlocks.spotlight_halogen_off) return ModBlocks.spotlight_halogen;
|
||||
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -313,4 +322,19 @@ public class Spotlight extends Block implements ISpotlight {
|
||||
public int getBeamLength() {
|
||||
return this.beamLength;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int transformMeta(int meta, int coordBaseMode) {
|
||||
// +1 to set as broken, won't turn on until broken and replaced
|
||||
return (INBTTransformable.transformMetaDeco(meta >> 1, coordBaseMode) << 1) + 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Block transformBlock(Block block) {
|
||||
if(block == ModBlocks.spotlight_incandescent) return ModBlocks.spotlight_incandescent_off;
|
||||
if(block == ModBlocks.spotlight_fluoro) return ModBlocks.spotlight_fluoro_off;
|
||||
if(block == ModBlocks.spotlight_halogen) return ModBlocks.spotlight_halogen_off;
|
||||
return block;
|
||||
}
|
||||
|
||||
}
|
||||
@ -7,36 +7,40 @@ import com.hbm.main.MainRegistry;
|
||||
import net.minecraftforge.common.config.Configuration;
|
||||
|
||||
public class StructureConfig {
|
||||
|
||||
|
||||
public static int enableStructures = 2;
|
||||
|
||||
|
||||
public static int structureMinChunks = 8;
|
||||
public static int structureMaxChunks = 24;
|
||||
|
||||
|
||||
public static double lootAmountFactor = 1D;
|
||||
|
||||
|
||||
public static boolean debugStructures = false;
|
||||
|
||||
public static void loadFromConfig(Configuration config) {
|
||||
|
||||
|
||||
final String CATEGORY_STRUCTURES = CommonConfig.CATEGORY_STRUCTURES;
|
||||
|
||||
String unparsedStructureFlag = CommonConfig.createConfigString(config, CATEGORY_STRUCTURES, "5.00_enableStructures", "Flag for whether modern NTM structures will spawn. Valid values are true|false|flag - flag will respect the \"Generate Structures\" world flag.", "flag");
|
||||
|
||||
enableStructures = CommonConfig.parseStructureFlag(unparsedStructureFlag);
|
||||
|
||||
|
||||
structureMinChunks = CommonConfig.createConfigInt(config, CATEGORY_STRUCTURES, "5.01_structureMinChunks", "Minimum non-zero distance between structures in chunks (Settings lower than 8 may be problematic).", 8);
|
||||
structureMaxChunks = CommonConfig.createConfigInt(config, CATEGORY_STRUCTURES, "5.02_structureMaxChunks", "Maximum non-zero distance between structures in chunks.", 24);
|
||||
|
||||
|
||||
lootAmountFactor = CommonConfig.createConfigDouble(config, CATEGORY_STRUCTURES, "5.03_lootAmountFactor", "General factor for loot spawns. Applies to spawned IInventories, not loot blocks.", 1D);
|
||||
|
||||
|
||||
debugStructures = CommonConfig.createConfigBool(config, CATEGORY_STRUCTURES, "5.04_debugStructures", "If enabled, special structure blocks like jigsaw blocks will not be transformed after generating", false);
|
||||
|
||||
structureMinChunks = CommonConfig.setDef(structureMinChunks, 8);
|
||||
structureMaxChunks = CommonConfig.setDef(structureMaxChunks, 24);
|
||||
|
||||
|
||||
if(structureMinChunks > structureMaxChunks) {
|
||||
MainRegistry.logger.error("Fatal error config: Minimum value has been set higher than the maximum value!");
|
||||
MainRegistry.logger.error(String.format(Locale.US, "Errored values will default back to %1$d and %2$d respectively, PLEASE REVIEW CONFIGURATION DESCRIPTION BEFORE MEDDLING WITH VALUES!", 8, 24));
|
||||
structureMinChunks = 8;
|
||||
structureMaxChunks = 24;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -7,7 +7,7 @@ public class WorldConfig {
|
||||
public static boolean overworldOre = true;
|
||||
public static boolean netherOre = true;
|
||||
public static boolean endOre = true;
|
||||
|
||||
|
||||
public static int uraniumSpawn = 6;
|
||||
public static int thoriumSpawn = 7;
|
||||
public static int titaniumSpawn = 8;
|
||||
@ -77,7 +77,6 @@ public class WorldConfig {
|
||||
public static int radioStructure = 500;
|
||||
public static int antennaStructure = 250;
|
||||
public static int atomStructure = 500;
|
||||
public static int vertibirdStructure = 500;
|
||||
public static int dungeonStructure = 64;
|
||||
public static int relayStructure = 500;
|
||||
public static int satelliteStructure = 500;
|
||||
@ -88,7 +87,6 @@ public class WorldConfig {
|
||||
public static int geyserWater = 3000;
|
||||
public static int geyserChlorine = 3000;
|
||||
public static int geyserVapor = 500;
|
||||
public static int meteorStructure = 15000;
|
||||
public static int capsuleStructure = 100;
|
||||
public static int arcticStructure = 500;
|
||||
public static int jungleStructure = 2000;
|
||||
@ -115,15 +113,15 @@ public class WorldConfig {
|
||||
public static float craterBiomeInnerRad = 25F;
|
||||
public static float craterBiomeOuterRad = 0.5F;
|
||||
public static float craterBiomeWaterMult = 5F;
|
||||
|
||||
|
||||
public static void loadFromConfig(Configuration config) {
|
||||
|
||||
final String CATEGORY_OREGEN = CommonConfig.CATEGORY_ORES;
|
||||
|
||||
|
||||
overworldOre = CommonConfig.createConfigBool(config, CATEGORY_OREGEN, "2.D00_overworldOres", "General switch for whether overworld ores should be generated. Does not include special structures like oil.", true);
|
||||
netherOre = CommonConfig.createConfigBool(config, CATEGORY_OREGEN, "2.D01_netherOres", "General switch for whether nether ores should be generated.", true);
|
||||
endOre = CommonConfig.createConfigBool(config, CATEGORY_OREGEN, "2.D02_endOres", "General switch for whether end ores should be generated. Does not include special structures like trixite crystals.", true);
|
||||
|
||||
|
||||
uraniumSpawn = CommonConfig.createConfigInt(config, CATEGORY_OREGEN, "2.00_uraniumSpawnrate", "Amount of uranium ore veins per chunk", 7);
|
||||
titaniumSpawn = CommonConfig.createConfigInt(config, CATEGORY_OREGEN, "2.01_titaniumSpawnrate", "Amount of titanium ore veins per chunk", 8);
|
||||
sulfurSpawn = CommonConfig.createConfigInt(config, CATEGORY_OREGEN, "2.02_sulfurSpawnrate", "Amount of sulfur ore veins per chunk", 5);
|
||||
@ -195,7 +193,6 @@ public class WorldConfig {
|
||||
radioStructure = CommonConfig.createConfigInt(config, CATEGORY_DUNGEON, "4.00_radioSpawn", "Spawn radio station on every nTH chunk", 500);
|
||||
antennaStructure = CommonConfig.createConfigInt(config, CATEGORY_DUNGEON, "4.01_antennaSpawn", "Spawn antenna on every nTH chunk", 250);
|
||||
atomStructure = CommonConfig.createConfigInt(config, CATEGORY_DUNGEON, "4.02_atomSpawn", "Spawn power plant on every nTH chunk", 500);
|
||||
vertibirdStructure = CommonConfig.createConfigInt(config, CATEGORY_DUNGEON, "4.03_vertibirdSpawn", "Spawn vertibird on every nTH chunk", 500);
|
||||
dungeonStructure = CommonConfig.createConfigInt(config, CATEGORY_DUNGEON, "4.04_dungeonSpawn", "Spawn library dungeon on every nTH chunk", 64);
|
||||
relayStructure = CommonConfig.createConfigInt(config, CATEGORY_DUNGEON, "4.05_relaySpawn", "Spawn relay on every nTH chunk", 500);
|
||||
satelliteStructure = CommonConfig.createConfigInt(config, CATEGORY_DUNGEON, "4.06_satelliteSpawn", "Spawn satellite dish on every nTH chunk", 500);
|
||||
@ -210,7 +207,6 @@ public class WorldConfig {
|
||||
geyserWater = CommonConfig.createConfigInt(config, CATEGORY_DUNGEON, "4.17_geyserWaterSpawn", "Spawn water geyser on every nTH chunk", 3000);
|
||||
geyserChlorine = CommonConfig.createConfigInt(config, CATEGORY_DUNGEON, "4.18_geyserChlorineSpawn", "Spawn poison geyser on every nTH chunk", 3000);
|
||||
geyserVapor = CommonConfig.createConfigInt(config, CATEGORY_DUNGEON, "4.19_geyserVaporSpawn", "Spawn vapor geyser on every nTH chunk", 500);
|
||||
meteorStructure = CommonConfig.createConfigInt(config, CATEGORY_DUNGEON, "4.20_meteorSpawn", "Spawn meteor dungeon on every nTH chunk", 15000);
|
||||
capsuleStructure = CommonConfig.createConfigInt(config, CATEGORY_DUNGEON, "4.21_capsuleSpawn", "Spawn landing capsule on every nTH chunk", 100);
|
||||
arcticStructure = CommonConfig.createConfigInt(config, CATEGORY_DUNGEON, "4.22_arcticVaultSpawn", "Spawn arctic code vault on every nTH chunk", 500);
|
||||
jungleStructure = CommonConfig.createConfigInt(config, CATEGORY_DUNGEON, "4.23_jungleDungeonSpawn", "Spawn jungle dungeon on every nTH chunk", 2000);
|
||||
@ -238,7 +234,6 @@ public class WorldConfig {
|
||||
radioStructure = CommonConfig.setDefZero(radioStructure, 1000);
|
||||
antennaStructure = CommonConfig.setDefZero(antennaStructure, 1000);
|
||||
atomStructure = CommonConfig.setDefZero(atomStructure, 1000);
|
||||
vertibirdStructure = CommonConfig.setDefZero(vertibirdStructure, 1000);
|
||||
dungeonStructure = CommonConfig.setDefZero(dungeonStructure, 1000);
|
||||
relayStructure = CommonConfig.setDefZero(relayStructure, 1000);
|
||||
satelliteStructure = CommonConfig.setDefZero(satelliteStructure, 1000);
|
||||
@ -253,11 +248,10 @@ public class WorldConfig {
|
||||
minefreq = CommonConfig.setDefZero(minefreq, 1000);
|
||||
radfreq = CommonConfig.setDefZero(radfreq, 1000);
|
||||
vaultfreq = CommonConfig.setDefZero(vaultfreq, 1000);
|
||||
meteorStructure = CommonConfig.setDefZero(meteorStructure, 15000);
|
||||
jungleStructure = CommonConfig.setDefZero(jungleStructure, 1000);
|
||||
capsuleStructure = CommonConfig.setDefZero(capsuleStructure, 100);
|
||||
arcticStructure = CommonConfig.setDefZero(arcticStructure, 500);
|
||||
|
||||
|
||||
meteorStrikeChance = CommonConfig.setDef(meteorStrikeChance, 1000);
|
||||
meteorShowerChance = CommonConfig.setDef(meteorShowerChance, 1000);
|
||||
}
|
||||
|
||||
@ -6,50 +6,52 @@ import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.special.ItemBookLore;
|
||||
|
||||
import net.minecraft.inventory.InventoryCrafting;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class MKUCraftingHandler implements IRecipe {
|
||||
|
||||
|
||||
public static ItemStack[] MKURecipe;
|
||||
private static long lastSeed;
|
||||
|
||||
@Override
|
||||
public boolean matches(InventoryCrafting inventory, World world) {
|
||||
|
||||
|
||||
if(world == null)
|
||||
return false;
|
||||
|
||||
|
||||
if(MKURecipe == null || world.getSeed() != lastSeed)
|
||||
generateRecipe(world);
|
||||
|
||||
|
||||
for(int i = 0; i < 9; i++) {
|
||||
ItemStack stack = inventory.getStackInRowAndColumn(i % 3, i / 3);
|
||||
ItemStack recipe = MKURecipe[i];
|
||||
|
||||
|
||||
if(stack == null && recipe == null)
|
||||
continue;
|
||||
|
||||
|
||||
if(stack != null && recipe != null && stack.getItem() == recipe.getItem() && stack.getItemDamage() == recipe.getItemDamage())
|
||||
continue;
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
public static void generateRecipe(World world) {
|
||||
Random rand = new Random(world.getSeed());
|
||||
|
||||
|
||||
if(lastSeed == world.getSeed() && MKURecipe != null)
|
||||
return;
|
||||
|
||||
|
||||
lastSeed = world.getSeed();
|
||||
|
||||
|
||||
List<ItemStack> list = Arrays.asList(new ItemStack[] {
|
||||
new ItemStack(ModItems.powder_iodine),
|
||||
new ItemStack(ModItems.powder_fire),
|
||||
@ -61,12 +63,54 @@ public class MKUCraftingHandler implements IRecipe {
|
||||
null,
|
||||
null
|
||||
});
|
||||
|
||||
|
||||
Collections.shuffle(list, rand);
|
||||
|
||||
|
||||
MKURecipe = list.toArray(new ItemStack[9]);
|
||||
}
|
||||
|
||||
public static Item getMKUItem(World world) {
|
||||
switch(world.rand.nextInt(6)) {
|
||||
case 0: return ModItems.powder_iodine;
|
||||
case 1: return ModItems.powder_fire;
|
||||
case 2: return ModItems.dust;
|
||||
case 3: return ModItems.ingot_mercury;
|
||||
case 4: return ModItems.morning_glory;
|
||||
case 5: return ModItems.syringe_metal_empty;
|
||||
default: return ModItems.flame_pony;
|
||||
}
|
||||
}
|
||||
|
||||
public static ItemStack generateBook(World world, Item mkuItem) {
|
||||
MKUCraftingHandler.generateRecipe(world);
|
||||
ItemStack[] recipe = MKUCraftingHandler.MKURecipe;
|
||||
|
||||
if(recipe == null) return new ItemStack(ModItems.flame_pony);
|
||||
|
||||
String key = null;
|
||||
int pages = 1;
|
||||
if(mkuItem == ModItems.powder_iodine) { key = "book_iodine"; pages = 3; }
|
||||
if(mkuItem == ModItems.powder_fire) { key = "book_phosphorous"; pages = 2; }
|
||||
if(mkuItem == ModItems.dust) { key = "book_dust"; pages = 3; }
|
||||
if(mkuItem == ModItems.ingot_mercury) { key = "book_mercury"; pages = 2; }
|
||||
if(mkuItem == ModItems.morning_glory) { key = "book_flower"; pages = 2; }
|
||||
if(mkuItem == ModItems.syringe_metal_empty) { key = "book_syringe"; pages = 2; }
|
||||
|
||||
if(key == null) return new ItemStack(ModItems.flame_pony);
|
||||
|
||||
int s = 1;
|
||||
for(int i = 0; i < 9; i++) {
|
||||
if(recipe[i] != null && recipe[i].getItem() == mkuItem) {
|
||||
s = i + 1; break;
|
||||
}
|
||||
}
|
||||
|
||||
ItemStack book = ItemBookLore.createBook(key, pages, 0x271E44, 0xFBFFF4);
|
||||
ItemBookLore.addArgs(book, pages - 1, String.valueOf(s));
|
||||
|
||||
return book;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRecipeSize() {
|
||||
return 6;
|
||||
@ -81,4 +125,4 @@ public class MKUCraftingHandler implements IRecipe {
|
||||
public ItemStack getRecipeOutput() {
|
||||
return new ItemStack(ModItems.syringe_mkunicorn);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -7,6 +7,7 @@ import org.lwjgl.opengl.GL11;
|
||||
import com.hbm.interfaces.NotableComments;
|
||||
import com.hbm.inventory.container.ContainerAutocrafter;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.module.ModulePatternMatcher;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineAutocrafter;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
@ -41,16 +42,7 @@ public class GUIAutocrafter extends GuiInfoContainer {
|
||||
Slot slot = (Slot) this.inventorySlots.inventorySlots.get(i);
|
||||
|
||||
if(this.isMouseOverSlot(slot, x, y) && diFurnace.matcher.modes[i] != null) {
|
||||
|
||||
String label = EnumChatFormatting.YELLOW + "";
|
||||
|
||||
switch(diFurnace.matcher.modes[i]) {
|
||||
case "exact": label += "Item and meta match"; break;
|
||||
case "wildcard": label += "Item matches"; break;
|
||||
default: label += "Ore dict key matches: " + diFurnace.matcher.modes[i]; break;
|
||||
}
|
||||
|
||||
this.func_146283_a(Arrays.asList(new String[] { EnumChatFormatting.RED + "Right click to change", label }), x, y - 30);
|
||||
this.func_146283_a(Arrays.asList(new String[] { EnumChatFormatting.RED + "Right click to change", ModulePatternMatcher.getLabel(diFurnace.matcher.modes[i]) }), x, y - 30);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -7,6 +7,7 @@ import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.inventory.container.ContainerCounterTorch;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.module.ModulePatternMatcher;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.packet.toserver.NBTControlPacket;
|
||||
import com.hbm.tileentity.network.TileEntityRadioTorchCounter;
|
||||
@ -72,16 +73,7 @@ public class GUICounterTorch extends GuiInfoContainer {
|
||||
Slot slot = (Slot) this.inventorySlots.inventorySlots.get(i);
|
||||
|
||||
if(this.isMouseOverSlot(slot, x, y) && counter.matcher.modes[i] != null) {
|
||||
|
||||
String label = EnumChatFormatting.YELLOW + "";
|
||||
|
||||
switch(counter.matcher.modes[i]) {
|
||||
case "exact": label += "Item and meta match"; break;
|
||||
case "wildcard": label += "Item matches"; break;
|
||||
default: label += "Ore dict key matches: " + counter.matcher.modes[i]; break;
|
||||
}
|
||||
|
||||
this.func_146283_a(Arrays.asList(new String[] { EnumChatFormatting.RED + "Right click to change", label }), x, y - 30);
|
||||
this.func_146283_a(Arrays.asList(new String[] { EnumChatFormatting.RED + "Right click to change", ModulePatternMatcher.getLabel(counter.matcher.modes[i]) }), x, y - 30);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -6,6 +6,7 @@ import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.inventory.container.ContainerCraneExtractor;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.module.ModulePatternMatcher;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.packet.toserver.NBTControlPacket;
|
||||
import com.hbm.tileentity.network.TileEntityCraneExtractor;
|
||||
@ -41,16 +42,7 @@ public class GUICraneExtractor extends GuiInfoContainer {
|
||||
Slot slot = (Slot) this.inventorySlots.inventorySlots.get(i);
|
||||
|
||||
if(this.isMouseOverSlot(slot, x, y) && ejector.matcher.modes[i] != null) {
|
||||
|
||||
String label = EnumChatFormatting.YELLOW + "";
|
||||
|
||||
switch(ejector.matcher.modes[i]) {
|
||||
case "exact": label += "Item and meta match"; break;
|
||||
case "wildcard": label += "Item matches"; break;
|
||||
default: label += "Ore dict key matches: " + ejector.matcher.modes[i]; break;
|
||||
}
|
||||
|
||||
this.func_146283_a(Arrays.asList(new String[] { EnumChatFormatting.RED + "Right click to change", label }), x, y - 30);
|
||||
this.func_146283_a(Arrays.asList(new String[] { EnumChatFormatting.RED + "Right click to change", ModulePatternMatcher.getLabel(ejector.matcher.modes[i]) }), x, y - 30);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -6,6 +6,7 @@ import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.inventory.container.ContainerCraneGrabber;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.module.ModulePatternMatcher;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.packet.toserver.NBTControlPacket;
|
||||
import com.hbm.tileentity.network.TileEntityCraneGrabber;
|
||||
@ -41,16 +42,7 @@ public class GUICraneGrabber extends GuiInfoContainer {
|
||||
Slot slot = (Slot) this.inventorySlots.inventorySlots.get(i);
|
||||
|
||||
if(this.isMouseOverSlot(slot, x, y) && grabber.matcher.modes[i] != null) {
|
||||
|
||||
String label = EnumChatFormatting.YELLOW + "";
|
||||
|
||||
switch(grabber.matcher.modes[i]) {
|
||||
case "exact": label += "Item and meta match"; break;
|
||||
case "wildcard": label += "Item matches"; break;
|
||||
default: label += "Ore dict key matches: " + grabber.matcher.modes[i]; break;
|
||||
}
|
||||
|
||||
this.func_146283_a(Arrays.asList(new String[] { EnumChatFormatting.RED + "Right click to change", label }), x, y - 30);
|
||||
this.func_146283_a(Arrays.asList(new String[] { EnumChatFormatting.RED + "Right click to change", ModulePatternMatcher.getLabel(grabber.matcher.modes[i]) }), x, y - 30);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -83,16 +83,7 @@ public class GUICraneRouter extends GuiInfoContainer {
|
||||
int index = i % 5;
|
||||
|
||||
if(this.isMouseOverSlot(slot, x, y) && matcher.modes[index] != null) {
|
||||
|
||||
String label = EnumChatFormatting.YELLOW + "";
|
||||
|
||||
switch(matcher.modes[index]) {
|
||||
case "exact": label += "Item and meta match"; break;
|
||||
case "wildcard": label += "Item matches"; break;
|
||||
default: label += "Ore dict key matches: " + matcher.modes[index]; break;
|
||||
}
|
||||
|
||||
this.func_146283_a(Arrays.asList(new String[] { EnumChatFormatting.RED + "Right click to change", label}), x, y - 30);
|
||||
this.func_146283_a(Arrays.asList(new String[] { EnumChatFormatting.RED + "Right click to change", ModulePatternMatcher.getLabel(matcher.modes[index])}), x, y - 30);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -6,6 +6,7 @@ import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.inventory.container.ContainerDroneRequester;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.module.ModulePatternMatcher;
|
||||
import com.hbm.tileentity.network.TileEntityDroneRequester;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
@ -37,16 +38,7 @@ public class GUIDroneRequester extends GuiInfoContainer {
|
||||
Slot slot = (Slot) this.inventorySlots.inventorySlots.get(i);
|
||||
|
||||
if(this.isMouseOverSlot(slot, x, y) && diFurnace.matcher.modes[i] != null) {
|
||||
|
||||
String label = EnumChatFormatting.YELLOW + "";
|
||||
|
||||
switch(diFurnace.matcher.modes[i]) {
|
||||
case "exact": label += "Item and meta match"; break;
|
||||
case "wildcard": label += "Item matches"; break;
|
||||
default: label += "Ore dict key matches: " + diFurnace.matcher.modes[i]; break;
|
||||
}
|
||||
|
||||
this.func_146283_a(Arrays.asList(new String[] { EnumChatFormatting.RED + "Right click to change", label }), x, y - 30);
|
||||
this.func_146283_a(Arrays.asList(new String[] { EnumChatFormatting.RED + "Right click to change", ModulePatternMatcher.getLabel(diFurnace.matcher.modes[i]) }), x, y - 30);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,6 +10,7 @@ import com.hbm.inventory.SlotPattern;
|
||||
import com.hbm.inventory.container.ContainerMachineCustom;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.module.ModulePatternMatcher;
|
||||
import com.hbm.tileentity.machine.TileEntityCustomMachine;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
@ -44,16 +45,7 @@ public class GUIMachineCustom extends GuiInfoContainer {
|
||||
int tileIndex = slot.getSlotIndex();
|
||||
|
||||
if(this.isMouseOverSlot(slot, x, y) && slot instanceof SlotPattern && custom.matcher.modes[tileIndex - 10] != null) {
|
||||
|
||||
String label = EnumChatFormatting.YELLOW + "";
|
||||
|
||||
switch(custom.matcher.modes[tileIndex - 10]) {
|
||||
case "exact": label += "Item and meta match"; break;
|
||||
case "wildcard": label += "Item matches"; break;
|
||||
default: label += "Ore dict key matches: " + custom.matcher.modes[tileIndex - 10]; break;
|
||||
}
|
||||
|
||||
this.func_146283_a(Arrays.asList(new String[] { EnumChatFormatting.RED + "Right click to change", label }), x, y - 30);
|
||||
this.func_146283_a(Arrays.asList(new String[] { EnumChatFormatting.RED + "Right click to change", ModulePatternMatcher.getLabel(custom.matcher.modes[tileIndex - 10]) }), x, y - 30);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -3077,7 +3077,7 @@ public class ModItems {
|
||||
gas_mask_filter_combo = new ItemFilter().setUnlocalizedName("gas_mask_filter_combo").setTextureName(RefStrings.MODID + ":gas_mask_filter_combo");
|
||||
gas_mask_filter_rag = new ItemFilter().setUnlocalizedName("gas_mask_filter_rag").setTextureName(RefStrings.MODID + ":gas_mask_filter_rag");
|
||||
gas_mask_filter_piss = new ItemFilter().setUnlocalizedName("gas_mask_filter_piss").setTextureName(RefStrings.MODID + ":gas_mask_filter_piss");
|
||||
jetpack_tank = new ItemSyringe().setUnlocalizedName("jetpack_tank").setMaxStackSize(1).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":jetpack_tank");
|
||||
jetpack_tank = new ItemSyringe().setUnlocalizedName("jetpack_tank").setMaxStackSize(16).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":jetpack_tank");
|
||||
gun_kit_1 = new ItemRepairKit(10).setUnlocalizedName("gun_kit_1").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":gun_kit_1");
|
||||
gun_kit_2 = new ItemRepairKit(100).setUnlocalizedName("gun_kit_2").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":gun_kit_2");
|
||||
cbt_device = new ItemSyringe().setUnlocalizedName("cbt_device").setMaxStackSize(1).setCreativeTab(null).setTextureName(RefStrings.MODID + ":cbt_device");
|
||||
@ -6230,7 +6230,7 @@ public class ModItems {
|
||||
GameRegistry.registerItem(plastic_bag, plastic_bag.getUnlocalizedName());
|
||||
|
||||
GameRegistry.registerItem(casing_bag, casing_bag.getUnlocalizedName());
|
||||
|
||||
|
||||
//Keys and Locks
|
||||
GameRegistry.registerItem(key, key.getUnlocalizedName());
|
||||
GameRegistry.registerItem(key_red, key_red.getUnlocalizedName());
|
||||
|
||||
@ -48,7 +48,7 @@ public class ItemSyringe extends Item {
|
||||
if(!player.inventory.addItemStackToInventory(new ItemStack(ModItems.syringe_empty))) {
|
||||
player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.syringe_empty, 1, 0), false);
|
||||
}
|
||||
|
||||
|
||||
VersatileConfig.applyPotionSickness(player, 5);
|
||||
}
|
||||
}
|
||||
@ -77,7 +77,7 @@ public class ItemSyringe extends Item {
|
||||
if(!player.inventory.addItemStackToInventory(new ItemStack(ModItems.syringe_empty))) {
|
||||
player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.syringe_empty, 1, 0), false);
|
||||
}
|
||||
|
||||
|
||||
VersatileConfig.applyPotionSickness(player, 50);
|
||||
}
|
||||
}
|
||||
@ -116,7 +116,7 @@ public class ItemSyringe extends Item {
|
||||
if(!player.inventory.addItemStackToInventory(new ItemStack(ModItems.syringe_metal_empty))) {
|
||||
player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.syringe_metal_empty, 1, 0), false);
|
||||
}
|
||||
|
||||
|
||||
VersatileConfig.applyPotionSickness(player, 5);
|
||||
}
|
||||
}
|
||||
@ -135,7 +135,7 @@ public class ItemSyringe extends Item {
|
||||
if(!player.inventory.addItemStackToInventory(new ItemStack(ModItems.syringe_metal_empty))) {
|
||||
player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.syringe_metal_empty, 1, 0), false);
|
||||
}
|
||||
|
||||
|
||||
VersatileConfig.applyPotionSickness(player, 5);
|
||||
}
|
||||
}
|
||||
@ -155,7 +155,7 @@ public class ItemSyringe extends Item {
|
||||
if(!player.inventory.addItemStackToInventory(new ItemStack(ModItems.syringe_metal_empty))) {
|
||||
player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.syringe_metal_empty, 1, 0), false);
|
||||
}
|
||||
|
||||
|
||||
VersatileConfig.applyPotionSickness(player, 5);
|
||||
}
|
||||
}
|
||||
@ -175,7 +175,7 @@ public class ItemSyringe extends Item {
|
||||
if(!player.inventory.addItemStackToInventory(new ItemStack(ModItems.syringe_metal_empty))) {
|
||||
player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.syringe_metal_empty, 1, 0), false);
|
||||
}
|
||||
|
||||
|
||||
VersatileConfig.applyPotionSickness(player, 15);
|
||||
}
|
||||
}
|
||||
@ -193,7 +193,7 @@ public class ItemSyringe extends Item {
|
||||
player.removePotionEffect(Potion.weakness.id);
|
||||
player.removePotionEffect(Potion.wither.id);
|
||||
player.removePotionEffect(HbmPotion.radiation.id);
|
||||
|
||||
|
||||
VersatileConfig.applyPotionSickness(player, 15);
|
||||
|
||||
stack.stackSize--;
|
||||
@ -283,18 +283,17 @@ public class ItemSyringe extends Item {
|
||||
return stack;
|
||||
|
||||
IFillableItem fillable = (IFillableItem) jetpack.getItem();
|
||||
|
||||
|
||||
if(!fillable.acceptsFluid(Fluids.KEROSENE, jetpack))
|
||||
return stack;
|
||||
|
||||
fillable.tryFill(Fluids.KEROSENE, 1000, jetpack);
|
||||
|
||||
|
||||
if(fillable.tryFill(Fluids.KEROSENE, 1000, jetpack) < 1000) {
|
||||
world.playSoundAtEntity(player, "hbm:item.jetpackTank", 1.0F, 1.0F);
|
||||
stack.stackSize--;
|
||||
}
|
||||
|
||||
if(jetpack.getItem() != player.inventory.armorInventory[2].getItem())
|
||||
ArmorModHandler.applyMod(player.inventory.armorInventory[2], jetpack);
|
||||
|
||||
world.playSoundAtEntity(player, "hbm:item.jetpackTank", 1.0F, 1.0F);
|
||||
|
||||
stack.stackSize--;
|
||||
}
|
||||
}
|
||||
|
||||
@ -386,11 +385,11 @@ public class ItemSyringe extends Item {
|
||||
|
||||
if(this == ModItems.syringe_awesome && !VersatileConfig.hasPotionSickness(entity)) {
|
||||
if(!world.isRemote) {
|
||||
|
||||
|
||||
if(entity instanceof EntityCow) {
|
||||
|
||||
|
||||
entity.addPotionEffect(new PotionEffect(HbmPotion.bang.id, 40, 0));
|
||||
|
||||
|
||||
} else {
|
||||
entity.addPotionEffect(new PotionEffect(Potion.regeneration.id, 50 * 20, 9));
|
||||
entity.addPotionEffect(new PotionEffect(Potion.resistance.id, 50 * 20, 9));
|
||||
@ -592,7 +591,7 @@ public class ItemSyringe extends Item {
|
||||
if(this == ModItems.gun_kit_2) {
|
||||
list.add("Repairs all weapons in hotbar by 50%");
|
||||
}
|
||||
|
||||
|
||||
if(this == ModItems.syringe_mkunicorn) {
|
||||
list.add(EnumChatFormatting.RED + "?");
|
||||
}
|
||||
|
||||
@ -1,7 +1,156 @@
|
||||
package com.hbm.items.tool;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.util.BobMathUtil;
|
||||
import com.hbm.util.Tuple.Pair;
|
||||
import com.hbm.world.gen.NBTStructure;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class ItemWandS extends Item {
|
||||
|
||||
}
|
||||
|
||||
private static final DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd_HH.mm.ss");
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool) {
|
||||
list.add("Creative-only item");
|
||||
list.add("\"Replication breeds decadence\"");
|
||||
list.add("(Saves an area defined by two right-clicks,");
|
||||
list.add("adds a block to the blacklist by crouch right-clicking!)");
|
||||
|
||||
if(stack.stackTagCompound != null) {
|
||||
int px = stack.stackTagCompound.getInteger("x");
|
||||
int py = stack.stackTagCompound.getInteger("y");
|
||||
int pz = stack.stackTagCompound.getInteger("z");
|
||||
|
||||
if(px != 0 || py != 0 || pz != 0) {
|
||||
list.add(EnumChatFormatting.AQUA + "From: " + px + ", " + py + ", " + pz);
|
||||
} else {
|
||||
list.add(EnumChatFormatting.AQUA + "No start position set");
|
||||
}
|
||||
|
||||
Set<Pair<Block, Integer>> blocks = getBlocks(stack);
|
||||
|
||||
if(blocks.size() > 0) {
|
||||
list.add("Blacklist:");
|
||||
for(Pair<Block, Integer> block : blocks) {
|
||||
list.add(EnumChatFormatting.RED + "- " + block.key.getUnlocalizedName());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// why the fuck ye'd leave this whole thing obfuscated is beyond me
|
||||
@Override
|
||||
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float fx, float fy, float fz) {
|
||||
if(stack.stackTagCompound == null) {
|
||||
stack.stackTagCompound = new NBTTagCompound();
|
||||
}
|
||||
|
||||
if(player.isSneaking()) {
|
||||
Pair<Block, Integer> target = new Pair<Block, Integer>(world.getBlock(x, y, z), world.getBlockMetadata(x, y, z));
|
||||
Set<Pair<Block, Integer>> blocks = getBlocks(stack);
|
||||
|
||||
if(blocks.contains(target)) {
|
||||
blocks.remove(target);
|
||||
if(world.isRemote) player.addChatMessage(new ChatComponentText("Removed from blacklist " + target.key.getUnlocalizedName()));
|
||||
} else {
|
||||
blocks.add(target);
|
||||
if(world.isRemote) player.addChatMessage(new ChatComponentText("Added to blacklist " + target.key.getUnlocalizedName()));
|
||||
}
|
||||
|
||||
setBlocks(stack, blocks);
|
||||
|
||||
} else {
|
||||
int px = stack.stackTagCompound.getInteger("x");
|
||||
int py = stack.stackTagCompound.getInteger("y");
|
||||
int pz = stack.stackTagCompound.getInteger("z");
|
||||
|
||||
if(px == 0 && py == 0 && pz == 0) {
|
||||
setPosition(stack, x, y, z);
|
||||
|
||||
if(world.isRemote) player.addChatMessage(new ChatComponentText("First position set!"));
|
||||
} else {
|
||||
setPosition(stack, 0, 0, 0);
|
||||
|
||||
Set<Pair<Block, Integer>> blocks = getBlocks(stack);
|
||||
blocks.add(new Pair<Block, Integer>(Blocks.air, 0));
|
||||
blocks.add(new Pair<Block, Integer>(ModBlocks.spotlight_beam, 0));
|
||||
|
||||
String filename = "structure_" + dateFormat.format(new Date()).toString() + ".nbt";
|
||||
|
||||
NBTStructure.saveArea(filename, world, x, y, z, px, py, pz, blocks);
|
||||
|
||||
if(world.isRemote) player.addChatMessage(new ChatComponentText("Structure saved to: .minecraft/structures/" + filename));
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private void setPosition(ItemStack stack, int x, int y, int z) {
|
||||
stack.stackTagCompound.setInteger("x", x);
|
||||
stack.stackTagCompound.setInteger("y", y);
|
||||
stack.stackTagCompound.setInteger("z", z);
|
||||
}
|
||||
|
||||
private Set<Pair<Block, Integer>> getBlocks(ItemStack stack) {
|
||||
if(stack.stackTagCompound == null) {
|
||||
return new HashSet<>();
|
||||
}
|
||||
|
||||
int[] blockIds = stack.stackTagCompound.getIntArray("blocks");
|
||||
int[] metas = stack.stackTagCompound.getIntArray("metas");
|
||||
Set<Pair<Block, Integer>> blocks = new HashSet<>(blockIds.length);
|
||||
|
||||
for(int i = 0; i < blockIds.length; i++) {
|
||||
blocks.add(new Pair<Block, Integer>(Block.getBlockById(blockIds[i]), metas[i]));
|
||||
}
|
||||
|
||||
return blocks;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private void setBlocks(ItemStack stack, Set<Pair<Block, Integer>> blocks) {
|
||||
if(stack.stackTagCompound == null) {
|
||||
stack.stackTagCompound = new NBTTagCompound();
|
||||
}
|
||||
|
||||
stack.stackTagCompound.setIntArray("blocks", BobMathUtil.collectionToIntArray(blocks, i -> Block.getIdFromBlock(((Pair<Block, Integer>)i).getKey())));
|
||||
stack.stackTagCompound.setIntArray("metas", BobMathUtil.collectionToIntArray(blocks, i -> ((Pair<Block, Integer>)i).getValue()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) {
|
||||
if(stack.stackTagCompound == null) {
|
||||
stack.stackTagCompound = new NBTTagCompound();
|
||||
}
|
||||
|
||||
if(player.isSneaking()) {
|
||||
stack.stackTagCompound.setIntArray("blocks", new int[0]);
|
||||
stack.stackTagCompound.setIntArray("metas", new int[0]);
|
||||
|
||||
if(world.isRemote) {
|
||||
player.addChatMessage(new ChatComponentText("Cleared blacklist"));
|
||||
}
|
||||
}
|
||||
|
||||
return stack;
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,6 +1,7 @@
|
||||
package com.hbm.lib;
|
||||
|
||||
import com.hbm.world.gen.MapGenNTMFeatures;
|
||||
import com.hbm.world.gen.NBTStructure;
|
||||
import com.hbm.world.gen.NTMWorldGenerator;
|
||||
import com.hbm.world.gen.component.*;
|
||||
import com.hbm.world.gen.component.BunkerComponents.BunkerStart;
|
||||
@ -18,9 +19,6 @@ public class HbmWorld {
|
||||
public static NTMWorldGenerator worldGenerator;
|
||||
|
||||
public static void initWorldGen() {
|
||||
|
||||
//MapGenStructureIO.registerStructure(StructureStartTest.class, "HFR_STRUCTURE");
|
||||
//MapGenStructureIO.func_143031_a(StructureComponentTest.class, "HFR_COMPONENT");
|
||||
MapGenStructureIO.registerStructure(MapGenNTMFeatures.Start.class, "NTMFeatures");
|
||||
MapGenStructureIO.registerStructure(BunkerStart.class, "NTMBunker");
|
||||
registerNTMFeatures();
|
||||
@ -30,19 +28,20 @@ public class HbmWorld {
|
||||
worldGenerator = new NTMWorldGenerator();
|
||||
registerWorldGen(worldGenerator, 1); //Ideally, move everything over from HbmWorldGen to NTMWorldGenerator
|
||||
MinecraftForge.EVENT_BUS.register(worldGenerator);
|
||||
//registerWorldGen(new WorldGenTest(), 1);
|
||||
|
||||
NBTStructure.register();
|
||||
}
|
||||
|
||||
public static void registerWorldGen(IWorldGenerator nukerWorldGen, int weightedProbability) {
|
||||
private static void registerWorldGen(IWorldGenerator nukerWorldGen, int weightedProbability) {
|
||||
GameRegistry.registerWorldGenerator(nukerWorldGen, weightedProbability);
|
||||
}
|
||||
|
||||
/** Register structures in MapGenStructureIO */
|
||||
public static void registerNTMFeatures() {
|
||||
private static void registerNTMFeatures() {
|
||||
CivilianFeatures.registerComponents();
|
||||
OfficeFeatures.registerComponents();
|
||||
RuinFeatures.registerComponents();
|
||||
BunkerComponents.registerComponents();
|
||||
MapGenStructureIO.func_143031_a(SiloComponent.class, "NTMSiloComponent");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -28,7 +28,6 @@ import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntityChest;
|
||||
import net.minecraft.tileentity.TileEntitySkull;
|
||||
import net.minecraft.util.WeightedRandom;
|
||||
import net.minecraft.util.WeightedRandomChestContent;
|
||||
import net.minecraft.world.World;
|
||||
@ -260,23 +259,6 @@ public class HbmWorldGen implements IWorldGenerator {
|
||||
}
|
||||
}
|
||||
|
||||
if(!biome.canSpawnLightningBolt() && biome.temperature >= 2F) {
|
||||
if(WorldConfig.vertibirdStructure > 0 && rand.nextInt(WorldConfig.vertibirdStructure) == 0) {
|
||||
for(int a = 0; a < 1; a++) {
|
||||
int x = i + rand.nextInt(16);
|
||||
int z = j + rand.nextInt(16);
|
||||
int y = world.getHeightValue(x, z);
|
||||
|
||||
if(rand.nextInt(2) == 0) {
|
||||
new Vertibird().generate(world, rand, x, y, z);
|
||||
} else {
|
||||
new CrashedVertibird().generate(world, rand, x, y, z);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(WorldConfig.dungeonStructure > 0 && rand.nextInt(WorldConfig.dungeonStructure) == 0) {
|
||||
int x = i + rand.nextInt(16);
|
||||
int y = rand.nextInt(256);
|
||||
@ -545,37 +527,6 @@ public class HbmWorldGen implements IWorldGenerator {
|
||||
|
||||
}
|
||||
|
||||
if (WorldConfig.meteorStructure > 0 && rand.nextInt(WorldConfig.meteorStructure) == 0 && biome != BiomeGenBase.ocean && biome != BiomeGenBase.deepOcean) {
|
||||
int x = i + rand.nextInt(16) + 8;
|
||||
int z = j + rand.nextInt(16) + 8;
|
||||
|
||||
CellularDungeonFactory.meteor.generate(world, x, 10, z, rand);
|
||||
|
||||
if(GeneralConfig.enableDebugMode)
|
||||
MainRegistry.logger.info("[Debug] Successfully spawned meteor dungeon at " + x + " 10 " + z);
|
||||
|
||||
int y = world.getHeightValue(x, z);
|
||||
|
||||
for(int f = 0; f < 3; f++)
|
||||
world.setBlock(x, y + f, z, ModBlocks.meteor_pillar);
|
||||
world.setBlock(x, y + 3, z, ModBlocks.meteor_brick_chiseled);
|
||||
|
||||
for(int f = 0; f < 10; f++) {
|
||||
|
||||
x = i + rand.nextInt(65) - 32;
|
||||
z = j + rand.nextInt(65) - 32;
|
||||
y = world.getHeightValue(x, z);
|
||||
|
||||
if(world.getBlock(x, y - 1, z).canPlaceTorchOnTop(world, x, y - 1, z)) {
|
||||
world.setBlock(x, y, z, Blocks.skull, 1, 2);
|
||||
TileEntitySkull skull = (TileEntitySkull)world.getTileEntity(x, y, z);
|
||||
|
||||
if(skull != null)
|
||||
skull.func_145903_a(rand.nextInt(16));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if((biome == BiomeGenBase.jungle || biome == BiomeGenBase.jungleEdge || biome == BiomeGenBase.jungleHills) &&
|
||||
WorldConfig.jungleStructure > 0 && rand.nextInt(WorldConfig.jungleStructure) == 0) {
|
||||
int x = i + rand.nextInt(16);
|
||||
|
||||
@ -157,7 +157,7 @@ public class ClientProxy extends ServerProxy {
|
||||
registerBlockRenderer();
|
||||
|
||||
Jars.initJars();
|
||||
|
||||
|
||||
((IReloadableResourceManager) Minecraft.getMinecraft().getResourceManager()).registerReloadListener(new QMAWLoader());
|
||||
|
||||
if(GeneralConfig.enableSoundExtension) {
|
||||
@ -376,6 +376,7 @@ public class ClientProxy extends ServerProxy {
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntitySubstation.class, new RenderSubstation());
|
||||
//chargers
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityCharger.class, new RenderCharger());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityRefueler.class, new RenderRefueler());
|
||||
//DecoContainer
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityFileCabinet.class, new RenderFileCabinet());
|
||||
//multiblocks
|
||||
@ -830,6 +831,8 @@ public class ClientProxy extends ServerProxy {
|
||||
RenderingRegistry.registerBlockHandler(new RenderRBMKReflector());
|
||||
RenderingRegistry.registerBlockHandler(new RenderRBMKControl());
|
||||
RenderingRegistry.registerBlockHandler(new RenderPribris());
|
||||
|
||||
RenderingRegistry.registerBlockHandler(new RenderBlockWand());
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -1725,6 +1728,22 @@ public class ClientProxy extends ServerProxy {
|
||||
}
|
||||
}
|
||||
|
||||
if("fluidfill".equals(type)) {
|
||||
double mX = data.getDouble("mX");
|
||||
double mY = data.getDouble("mY");
|
||||
double mZ = data.getDouble("mZ");
|
||||
|
||||
EntityFX fx = new net.minecraft.client.particle.EntityCritFX(world, x, y, z, mX, mY, mZ);
|
||||
fx.nextTextureIndexX();
|
||||
|
||||
if(data.hasKey("color")) {
|
||||
Color color = new Color(data.getInteger("color"));
|
||||
fx.setRBGColorF(color.getRed() / 255F, color.getGreen() / 255F, color.getBlue() / 255F);
|
||||
}
|
||||
|
||||
Minecraft.getMinecraft().effectRenderer.addEffect(fx);
|
||||
}
|
||||
|
||||
if("deadleaf".equals(type)) {
|
||||
if(particleSetting == 0 || (particleSetting == 1 && rand.nextBoolean()))
|
||||
Minecraft.getMinecraft().effectRenderer.addEffect(new ParticleDeadLeaf(man, world, x, y, z));
|
||||
|
||||
@ -11,6 +11,7 @@ import com.hbm.config.GeneralConfig;
|
||||
import com.hbm.crafting.*;
|
||||
import com.hbm.crafting.handlers.*;
|
||||
import com.hbm.inventory.OreDictManager;
|
||||
import com.hbm.inventory.OreDictManager.DictFrame;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.inventory.material.MaterialShapes;
|
||||
import com.hbm.inventory.material.Mats;
|
||||
@ -913,6 +914,7 @@ public class CraftingManager {
|
||||
|
||||
addRecipeAuto(new ItemStack(ModBlocks.charger), new Object[] { "G", "S", "C", 'G', Items.glowstone_dust, 'S', STEEL.ingot(), 'C', ModItems.coil_copper });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.charger, 16), new Object[] { "G", "S", "C", 'G', Blocks.glowstone, 'S', STEEL.block(), 'C', ModItems.coil_copper_torus });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.refueler), new Object[] { "SS", "HC", "SS", 'S', TI.plate(), 'H', DictFrame.fromOne(ModItems.part_generic, EnumPartType.PISTON_HYDRAULIC), 'C', DictFrame.fromOne(ModItems.circuit, EnumCircuitType.BASIC) });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.press_preheater), new Object[] { "CCC", "SLS", "TST", 'C', CU.plate(), 'S', Blocks.stone, 'L', Fluids.LAVA.getDict(1000), 'T', W.ingot() });
|
||||
addRecipeAuto(new ItemStack(ModItems.fluid_identifier_multi), new Object[] { "D", "C", "P", 'D', "dye", 'C', DictFrame.fromOne(ModItems.circuit, EnumCircuitType.ANALOG), 'P', IRON.plate() });
|
||||
|
||||
|
||||
@ -391,6 +391,7 @@ public class ResourceManager {
|
||||
|
||||
//Charging Station
|
||||
public static final IModelCustom charger = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/blocks/charger.obj"));
|
||||
public static final IModelCustom refueler = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/blocks/refueler.obj"));
|
||||
|
||||
//DecoContainer (File Cabinet for now)
|
||||
public static final IModelCustom file_cabinet = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/file_cabinet.obj"));
|
||||
@ -805,6 +806,7 @@ public class ResourceManager {
|
||||
|
||||
//Charger
|
||||
public static final ResourceLocation charger_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/charger.png");
|
||||
public static final ResourceLocation refueler_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/refueler.png");
|
||||
|
||||
//DecoContainer
|
||||
public static final ResourceLocation file_cabinet_tex = new ResourceLocation(RefStrings.MODID, "textures/models/file_cabinet.png");
|
||||
|
||||
65
src/main/java/com/hbm/main/StructureManager.java
Normal file
65
src/main/java/com/hbm/main/StructureManager.java
Normal file
@ -0,0 +1,65 @@
|
||||
package com.hbm.main;
|
||||
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.world.gen.NBTStructure;
|
||||
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class StructureManager {
|
||||
|
||||
// METEOR DUNGEON
|
||||
public static final NBTStructure meteor_spike = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/meteor/meteor-spike.nbt"));
|
||||
public static final NBTStructure meteor_core = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/meteor/meteor-core.nbt"));
|
||||
public static final NBTStructure meteor_corner = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/meteor/meteor-corner.nbt"));
|
||||
public static final NBTStructure meteor_t = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/meteor/meteor-t.nbt"));
|
||||
public static final NBTStructure meteor_stairs = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/meteor/meteor-stairs.nbt"));
|
||||
public static final NBTStructure meteor_fallback = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/meteor/meteor-fallback.nbt"));
|
||||
|
||||
public static final NBTStructure meteor_3_bale = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/meteor/loot3x3/meteor-3-bale.nbt"));
|
||||
public static final NBTStructure meteor_3_blank = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/meteor/loot3x3/meteor-3-blank.nbt"));
|
||||
public static final NBTStructure meteor_3_block = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/meteor/loot3x3/meteor-3-block.nbt"));
|
||||
public static final NBTStructure meteor_3_crab = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/meteor/loot3x3/meteor-3-crab.nbt"));
|
||||
public static final NBTStructure meteor_3_crab_tesla = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/meteor/loot3x3/meteor-3-crab-tesla.nbt"));
|
||||
public static final NBTStructure meteor_3_crate = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/meteor/loot3x3/meteor-3-crate.nbt"));
|
||||
public static final NBTStructure meteor_3_dirt = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/meteor/loot3x3/meteor-3-dirt.nbt"));
|
||||
public static final NBTStructure meteor_3_lead = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/meteor/loot3x3/meteor-3-lead.nbt"));
|
||||
public static final NBTStructure meteor_3_ooze = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/meteor/loot3x3/meteor-3-ooze.nbt"));
|
||||
public static final NBTStructure meteor_3_pillar = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/meteor/loot3x3/meteor-3-pillar.nbt"));
|
||||
public static final NBTStructure meteor_3_star = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/meteor/loot3x3/meteor-3-star.nbt"));
|
||||
public static final NBTStructure meteor_3_tesla = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/meteor/loot3x3/meteor-3-tesla.nbt"));
|
||||
public static final NBTStructure meteor_3_book = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/meteor/loot3x3/meteor-3-book.nbt"));
|
||||
public static final NBTStructure meteor_3_mku = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/meteor/loot3x3/meteor-3-mku.nbt"));
|
||||
public static final NBTStructure meteor_3_statue = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/meteor/loot3x3/meteor-3-statue.nbt"));
|
||||
public static final NBTStructure meteor_3_glow = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/meteor/loot3x3/meteor-3-glow.nbt"));
|
||||
|
||||
public static final NBTStructure meteor_room_base_end = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/meteor/room10/room-base-end.nbt"));
|
||||
public static final NBTStructure meteor_room_base_thru = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/meteor/room10/room-base-thru.nbt"));
|
||||
|
||||
public static final NBTStructure meteor_room_balcony = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/meteor/room10/room-balcony.nbt"));
|
||||
public static final NBTStructure meteor_room_basic = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/meteor/room10/room-basic.nbt"));
|
||||
public static final NBTStructure meteor_room_dragon = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/meteor/room10/room-dragon.nbt"));
|
||||
public static final NBTStructure meteor_room_ladder = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/meteor/room10/room-ladder.nbt"));
|
||||
public static final NBTStructure meteor_room_ooze = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/meteor/room10/room-ooze.nbt"));
|
||||
public static final NBTStructure meteor_room_split = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/meteor/room10/room-split.nbt"));
|
||||
public static final NBTStructure meteor_room_stairs = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/meteor/room10/room-stairs.nbt"));
|
||||
public static final NBTStructure meteor_room_triple = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/meteor/room10/room-triple.nbt"));
|
||||
public static final NBTStructure meteor_room_fallback = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/meteor/room10/room-fallback.nbt"));
|
||||
|
||||
public static final NBTStructure meteor_dragon_chest = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/meteor/room10/headloot/loot-chest.nbt"));
|
||||
public static final NBTStructure meteor_dragon_tesla = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/meteor/room10/headloot/loot-tesla.nbt"));
|
||||
public static final NBTStructure meteor_dragon_trap = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/meteor/room10/headloot/loot-trap.nbt"));
|
||||
public static final NBTStructure meteor_dragon_crate_crab = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/meteor/room10/headloot/loot-crate-crab.nbt"));
|
||||
public static final NBTStructure meteor_dragon_fallback = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/meteor/room10/headloot/loot-fallback.nbt"));
|
||||
|
||||
|
||||
|
||||
|
||||
public static final NBTStructure vertibird = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/vertibird.nbt"));
|
||||
public static final NBTStructure crashed_vertibird = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/crashed-vertibird.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"));
|
||||
// public static final NBTStructure test_jigsaw_core = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/test-jigsaw-core.nbt"));
|
||||
// public static final NBTStructure test_jigsaw_hall = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/test-jigsaw-hall.nbt"));
|
||||
|
||||
}
|
||||
@ -2,18 +2,21 @@ package com.hbm.module;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.items.special.ItemBedrockOreNew;
|
||||
import com.hbm.util.BufferUtil;
|
||||
import com.hbm.util.ItemStackUtil;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class ModulePatternMatcher {
|
||||
|
||||
public static final String MODE_EXACT = "exact";
|
||||
public static final String MODE_WILDCARD = "wildcard";
|
||||
public static final String MODE_BEDROCK = "bedrock";
|
||||
public String[] modes;
|
||||
|
||||
public ModulePatternMatcher() {
|
||||
@ -41,7 +44,9 @@ public class ModulePatternMatcher {
|
||||
if(iterateAndCheck(names, i ,"nugget")) return;
|
||||
if(iterateAndCheck(names, i ,"plate")) return;
|
||||
|
||||
if(stack.getHasSubtypes()) {
|
||||
if(stack.getItem() instanceof ItemBedrockOreNew) {
|
||||
modes[i] = MODE_BEDROCK;
|
||||
} else if(stack.getHasSubtypes()) {
|
||||
modes[i] = MODE_EXACT;
|
||||
} else {
|
||||
modes[i] = MODE_WILDCARD;
|
||||
@ -68,8 +73,10 @@ public class ModulePatternMatcher {
|
||||
modes[i] = null;
|
||||
return;
|
||||
}
|
||||
|
||||
if(stack.getHasSubtypes()) {
|
||||
|
||||
if(stack.getItem() instanceof ItemBedrockOreNew) {
|
||||
modes[i] = MODE_BEDROCK;
|
||||
} else if(stack.getHasSubtypes()) {
|
||||
modes[i] = MODE_EXACT;
|
||||
} else {
|
||||
modes[i] = MODE_WILDCARD;
|
||||
@ -88,6 +95,12 @@ public class ModulePatternMatcher {
|
||||
if(modes[i] == null) {
|
||||
modes[i] = MODE_EXACT;
|
||||
} else if(MODE_EXACT.equals(modes[i])) {
|
||||
if(pattern.getItem() instanceof ItemBedrockOreNew) {
|
||||
modes[i] = MODE_BEDROCK;
|
||||
} else {
|
||||
modes[i] = MODE_WILDCARD;
|
||||
}
|
||||
} else if(MODE_BEDROCK.equals(modes[i])) {
|
||||
modes[i] = MODE_WILDCARD;
|
||||
} else if(MODE_WILDCARD.equals(modes[i])) {
|
||||
|
||||
@ -128,6 +141,10 @@ public class ModulePatternMatcher {
|
||||
switch(mode) {
|
||||
case MODE_EXACT: return input.isItemEqual(filter) && ItemStack.areItemStackTagsEqual(input, filter);
|
||||
case MODE_WILDCARD: return input.getItem() == filter.getItem() && ItemStack.areItemStackTagsEqual(input, filter);
|
||||
case MODE_BEDROCK:
|
||||
if(input.getItem() != filter.getItem()) return false;
|
||||
if(!(input.getItem() instanceof ItemBedrockOreNew)) return false;
|
||||
return ((ItemBedrockOreNew)input.getItem()).getGrade(input.getItemDamage()) == ((ItemBedrockOreNew)filter.getItem()).getGrade(filter.getItemDamage());
|
||||
default:
|
||||
List<String> keys = ItemStackUtil.getOreDictNames(input);
|
||||
return keys.contains(mode);
|
||||
@ -165,4 +182,14 @@ public class ModulePatternMatcher {
|
||||
modes[i] = BufferUtil.readString(buf);
|
||||
}
|
||||
}
|
||||
|
||||
public static String getLabel(String mode) {
|
||||
switch(mode) {
|
||||
case MODE_EXACT: return EnumChatFormatting.YELLOW + "Item and meta match";
|
||||
case MODE_WILDCARD: return EnumChatFormatting.YELLOW + "Item matches";
|
||||
case MODE_BEDROCK: return EnumChatFormatting.YELLOW + "Item and bedrock grade match";
|
||||
default: return EnumChatFormatting.YELLOW + "Ore dict key matches: " + mode;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -14,13 +14,13 @@ public class RenderBlockSideRotation implements ISimpleBlockRenderingHandler {
|
||||
|
||||
@Override
|
||||
public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) {
|
||||
|
||||
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
block.setBlockBoundsForItemRender();
|
||||
renderer.setRenderBoundsFromBlock(block);
|
||||
GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F);
|
||||
GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
|
||||
|
||||
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(0.0F, -1.0F, 0.0F);
|
||||
renderer.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 0, metadata));
|
||||
@ -45,7 +45,7 @@ public class RenderBlockSideRotation implements ISimpleBlockRenderingHandler {
|
||||
tessellator.setNormal(1.0F, 0.0F, 0.0F);
|
||||
renderer.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 5, metadata));
|
||||
tessellator.draw();
|
||||
|
||||
|
||||
GL11.glTranslatef(0.5F, 0.5F, 0.5F);
|
||||
}
|
||||
|
||||
@ -55,20 +55,32 @@ public class RenderBlockSideRotation implements ISimpleBlockRenderingHandler {
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
|
||||
tessellator.setBrightness(block.getMixedBrightnessForBlock(world, x, y, z));
|
||||
|
||||
|
||||
if(!(block instanceof IBlockSideRotation)) {
|
||||
renderer.renderStandardBlock(block, x, y, z);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
IBlockSideRotation rot = (IBlockSideRotation) block;
|
||||
|
||||
|
||||
// I'm almost entirely convinced that MCP mistranslated these properties because north/south and west/east are fucking SWAPPED
|
||||
// YEP, they fucking did, god fucking damn it. I manually figured out the correct side for each uv face property to resolve YAYY
|
||||
renderer.uvRotateBottom = rot.getRotationFromSide(world, x, y, z, 0);
|
||||
renderer.uvRotateTop = rot.getRotationFromSide(world, x, y, z, 1);
|
||||
renderer.uvRotateNorth = rot.getRotationFromSide(world, x, y, z, 5);
|
||||
renderer.uvRotateSouth = rot.getRotationFromSide(world, x, y, z, 4);
|
||||
renderer.uvRotateWest = rot.getRotationFromSide(world, x, y, z, 2);
|
||||
renderer.uvRotateEast = rot.getRotationFromSide(world, x, y, z, 3);
|
||||
|
||||
renderer.setRenderBounds(0.0, 0.0, 0.0, 1.0, 1.0, 1.0);
|
||||
renderer.renderStandardBlock(block, x, y, z);
|
||||
|
||||
|
||||
renderer.uvRotateBottom = 0;
|
||||
renderer.uvRotateTop = 0;
|
||||
renderer.uvRotateNorth = 0;
|
||||
renderer.uvRotateSouth = 0;
|
||||
renderer.uvRotateWest = 0;
|
||||
renderer.uvRotateEast = 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
37
src/main/java/com/hbm/render/block/RenderBlockWand.java
Normal file
37
src/main/java/com/hbm/render/block/RenderBlockWand.java
Normal file
@ -0,0 +1,37 @@
|
||||
package com.hbm.render.block;
|
||||
|
||||
import com.hbm.blocks.generic.BlockWand;
|
||||
|
||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
public class RenderBlockWand implements ISimpleBlockRenderingHandler {
|
||||
|
||||
@Override
|
||||
public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
|
||||
renderer.renderFromInside = true;
|
||||
renderer.renderStandardBlock(block, x, y, z);
|
||||
renderer.renderFromInside = false;
|
||||
renderer.renderStandardBlock(block, x, y, z);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldRender3DInInventory(int modelId) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderId() {
|
||||
return BlockWand.renderID;
|
||||
}
|
||||
|
||||
}
|
||||
@ -49,9 +49,14 @@ public class RenderBobble extends TileEntitySpecialRenderer {
|
||||
public static final ResourceLocation bobble_microwave = new ResourceLocation(RefStrings.MODID, "textures/models/trinkets/microwave.png");
|
||||
public static final ResourceLocation bobble_peep = new ResourceLocation(RefStrings.MODID, "textures/models/trinkets/peep.png");
|
||||
public static final ResourceLocation bobble_mellow = new ResourceLocation(RefStrings.MODID, "textures/models/trinkets/mellowrpg8.png");
|
||||
public static final ResourceLocation bobble_mellow_glow = new ResourceLocation(RefStrings.MODID, "textures/models/trinkets/mellowrpg8_glow.png");
|
||||
|
||||
private long time;
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float intero) {
|
||||
time = System.currentTimeMillis();
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(x + 0.5, y, z + 0.5);
|
||||
|
||||
@ -288,8 +293,8 @@ public class RenderBobble extends TileEntitySpecialRenderer {
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(0, 1.75, 0);
|
||||
GL11.glRotated(Math.sin(System.currentTimeMillis() * speed) * amplitude, 1, 0, 0);
|
||||
GL11.glRotated(Math.sin(System.currentTimeMillis() * speed + (Math.PI * 0.5)) * amplitude, 0, 0, 1);
|
||||
GL11.glRotated(Math.sin(time * speed) * amplitude, 1, 0, 0);
|
||||
GL11.glRotated(Math.sin(time * speed + (Math.PI * 0.5)) * amplitude, 0, 0, 1);
|
||||
|
||||
GL11.glRotated(rotHead[0], 1, 0, 0);
|
||||
GL11.glRotated(rotHead[1], 0, 1, 0);
|
||||
@ -342,7 +347,7 @@ public class RenderBobble extends TileEntitySpecialRenderer {
|
||||
GL11.glAlphaFunc(GL11.GL_GREATER, 0);
|
||||
|
||||
OpenGlHelper.glBlendFunc(770, 771, 1, 0);
|
||||
GL11.glColor4f(1.0F, 1.0F, 0.0F, 0.1F + (float) Math.sin(System.currentTimeMillis() * 0.001D) * 0.05F);
|
||||
GL11.glColor4f(1.0F, 1.0F, 0.0F, 0.1F + (float) Math.sin(time * 0.001D) * 0.05F);
|
||||
bobble.renderPart("PelletShine");
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
|
||||
@ -365,8 +370,8 @@ public class RenderBobble extends TileEntitySpecialRenderer {
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(0, 0.75, 0);
|
||||
GL11.glRotated(Math.sin(System.currentTimeMillis() * speed) * amplitude, 1, 0, 0);
|
||||
GL11.glRotated(Math.sin(System.currentTimeMillis() * speed + (Math.PI * 0.5)) * amplitude, 0, 0, 1);
|
||||
GL11.glRotated(Math.sin(time * speed) * amplitude, 1, 0, 0);
|
||||
GL11.glRotated(Math.sin(time * speed + (Math.PI * 0.5)) * amplitude, 0, 0, 1);
|
||||
GL11.glTranslated(0, -0.75, 0);
|
||||
|
||||
GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
@ -452,11 +457,13 @@ public class RenderBobble extends TileEntitySpecialRenderer {
|
||||
//shotgun.renderDud(0.0625F);
|
||||
break;
|
||||
case MELLOW:
|
||||
GL11.glPushAttrib(GL11.GL_LIGHTING_BIT);
|
||||
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240F, 240F);
|
||||
bindTexture(bobble_mellow_glow);
|
||||
renderGuy(type);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glAlphaFunc(GL11.GL_GREATER, 0);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE);
|
||||
GL11.glPushAttrib(GL11.GL_LIGHTING_BIT);
|
||||
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240F, 240F);
|
||||
this.bindTexture(lamp);
|
||||
bobble.renderPart("Fluoro");
|
||||
this.bindTexture(glow);
|
||||
|
||||
103
src/main/java/com/hbm/render/tileentity/RenderRefueler.java
Normal file
103
src/main/java/com/hbm/render/tileentity/RenderRefueler.java
Normal file
@ -0,0 +1,103 @@
|
||||
package com.hbm.render.tileentity;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.nio.DoubleBuffer;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.main.ResourceManager;
|
||||
import com.hbm.render.item.ItemRenderBase;
|
||||
import com.hbm.tileentity.machine.TileEntityRefueler;
|
||||
|
||||
import net.minecraft.client.renderer.GLAllocation;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.client.IItemRenderer;
|
||||
|
||||
public class RenderRefueler extends TileEntitySpecialRenderer implements IItemRendererProvider {
|
||||
|
||||
private static DoubleBuffer clip = null;
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float interp) {
|
||||
TileEntityRefueler refueler = (TileEntityRefueler) tile;
|
||||
|
||||
GL11.glPushMatrix();
|
||||
{
|
||||
|
||||
GL11.glTranslated(x + 0.5, y, z + 0.5);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||
GL11.glRotatef(90, 0F, 1F, 0F);
|
||||
switch(tile.getBlockMetadata()) {
|
||||
case 4: GL11.glRotatef(90, 0F, 1F, 0F); break;
|
||||
case 3: GL11.glRotatef(180, 0F, 1F, 0F); break;
|
||||
case 5: GL11.glRotatef(270, 0F, 1F, 0F); break;
|
||||
case 2: GL11.glRotatef(0, 0F, 1F, 0F); break;
|
||||
}
|
||||
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
|
||||
bindTexture(ResourceManager.refueler_tex);
|
||||
ResourceManager.refueler.renderPart("Fueler");
|
||||
|
||||
|
||||
if(clip == null) {
|
||||
clip = GLAllocation.createDirectByteBuffer(8*4).asDoubleBuffer();
|
||||
clip.put(new double[] {0, 1, 0, -0.125 });
|
||||
clip.rewind();
|
||||
}
|
||||
|
||||
GL11.glEnable(GL11.GL_CLIP_PLANE0);
|
||||
GL11.glClipPlane(GL11.GL_CLIP_PLANE0, clip);
|
||||
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glDisable(GL11.GL_TEXTURE_2D);
|
||||
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE);
|
||||
|
||||
double fillLevel = refueler.prevFillLevel + (refueler.fillLevel - refueler.prevFillLevel) * interp;
|
||||
GL11.glTranslated(0, (1 - fillLevel) * -0.625, 0);
|
||||
|
||||
Color color = new Color(refueler.tank.getTankType().getColor());
|
||||
GL11.glColor4f(color.getRed() / 255F, color.getGreen() / 255F, color.getBlue() / 255F, 0.75F);
|
||||
ResourceManager.refueler.renderPart("Fluid");
|
||||
GL11.glColor4f(1, 1, 1, 1);
|
||||
|
||||
GL11.glEnable(GL11.GL_TEXTURE_2D);
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
|
||||
GL11.glDisable(GL11.GL_CLIP_PLANE0);
|
||||
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
|
||||
}
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemForRenderer() {
|
||||
return Item.getItemFromBlock(ModBlocks.refueler);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IItemRenderer getRenderer() {
|
||||
return new ItemRenderBase() {
|
||||
public void renderInventory() {
|
||||
GL11.glTranslated(0, -3, 0);
|
||||
GL11.glScaled(6, 6, 6);
|
||||
}
|
||||
public void renderCommon() {
|
||||
GL11.glScaled(2, 2, 2);
|
||||
GL11.glTranslated(0.5, 0, 0);
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
bindTexture(ResourceManager.refueler_tex);
|
||||
ResourceManager.refueler.renderPart("Fueler");
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
@ -15,6 +15,8 @@ import com.hbm.blocks.generic.BlockPedestal.TileEntityPedestal;
|
||||
import com.hbm.blocks.generic.BlockPlushie.TileEntityPlushie;
|
||||
import com.hbm.blocks.generic.BlockSnowglobe.TileEntitySnowglobe;
|
||||
import com.hbm.blocks.generic.BlockSupplyCrate.TileEntitySupplyCrate;
|
||||
import com.hbm.blocks.generic.BlockWandJigsaw.TileEntityWandJigsaw;
|
||||
import com.hbm.blocks.generic.BlockWandLoot.TileEntityWandLoot;
|
||||
import com.hbm.blocks.generic.PartEmitter.TileEntityPartEmitter;
|
||||
import com.hbm.blocks.machine.BlockICF.TileEntityBlockICF;
|
||||
import com.hbm.blocks.machine.BlockPWR.TileEntityBlockPWR;
|
||||
@ -48,7 +50,7 @@ public class TileMappings {
|
||||
|
||||
public static HashMap<Class<? extends TileEntity>, String[]> map = new HashMap<Class<? extends TileEntity>, String[]>();
|
||||
public static List<Class<? extends IConfigurableMachine>> configurables = new ArrayList<Class<? extends IConfigurableMachine>>();
|
||||
|
||||
|
||||
public static void writeMappings() {
|
||||
put(TileEntityDiFurnace.class, "tilentity_diFurnace");
|
||||
put(TileEntityObjTester.class, "tilentity_objtester");
|
||||
@ -206,7 +208,7 @@ public class TileMappings {
|
||||
put(TileEntityMachineOrbus.class, "tileentity_orbus");
|
||||
put(TileEntityGlpyhidSpawner.class, "tileentity_glyphid_spawner");
|
||||
put(TileEntityCustomMachine.class, "tileentity_custom_machine");
|
||||
|
||||
|
||||
put(TileEntityLoot.class, "tileentity_ntm_loot");
|
||||
put(TileEntityPedestal.class, "tileentity_ntm_pedestal");
|
||||
put(TileEntityBobble.class, "tileentity_ntm_bobblehead");
|
||||
@ -217,9 +219,10 @@ public class TileMappings {
|
||||
put(TileEntityDoorGeneric.class, "tileentity_ntm_door");
|
||||
|
||||
put(TileEntityCharger.class, "tileentity_ntm_charger");
|
||||
|
||||
put(TileEntityRefueler.class, "tileentity_ntm_refueler");
|
||||
|
||||
put(TileEntityFileCabinet.class, "tileentity_file_cabinet");
|
||||
|
||||
|
||||
put(TileEntityProxyInventory.class, "tileentity_proxy_inventory");
|
||||
put(TileEntityProxyEnergy.class, "tileentity_proxy_power");
|
||||
put(TileEntityProxyCombo.class, "tileentity_proxy_combo");
|
||||
@ -231,7 +234,10 @@ public class TileMappings {
|
||||
put(TileEntityPWRController.class, "tileentity_pwr_controller");
|
||||
|
||||
put(TileEntityData.class, "tileentity_data");
|
||||
|
||||
|
||||
put(TileEntityWandLoot.class, "tileentity_wand_loot");
|
||||
put(TileEntityWandJigsaw.class, "tileentity_wand_jigsaw");
|
||||
|
||||
putNetwork();
|
||||
putBombs();
|
||||
putTurrets();
|
||||
@ -242,7 +248,7 @@ public class TileMappings {
|
||||
TileEntityMachineRadarNT.registerEntityClasses();
|
||||
TileEntityMachineRadarNT.registerConverters();
|
||||
}
|
||||
|
||||
|
||||
private static void putBombs() {
|
||||
put(TileEntityBombMulti.class, "tileentity_bombmulti");
|
||||
put(TileEntityNukeGadget.class, "tilentity_nukegadget");
|
||||
@ -257,7 +263,7 @@ public class TileMappings {
|
||||
put(TileEntityCharge.class, "tileentity_explosive_charge");
|
||||
put(TileEntityVolcanoCore.class, "tileentity_volcano_core");
|
||||
}
|
||||
|
||||
|
||||
private static void putTurrets() {
|
||||
put(TileEntityTurretChekhov.class, "tileentity_turret_chekhov");
|
||||
put(TileEntityTurretJeremy.class, "tileentity_turret_jeremy");
|
||||
@ -274,7 +280,7 @@ public class TileMappings {
|
||||
put(TileEntityTurretSentry.class, "tileentity_turret_sentry");
|
||||
put(TileEntityTurretSentryDamaged.class, "tileentity_turret_sentry_damaged");
|
||||
}
|
||||
|
||||
|
||||
private static void putMachines() {
|
||||
put(TileEntityHeaterFirebox.class, "tileentity_firebox");
|
||||
put(TileEntityHeaterOven.class, "tileentity_heating_oven");
|
||||
@ -294,7 +300,7 @@ public class TileMappings {
|
||||
|
||||
put(TileEntityMachinePumpSteam.class, "tileentity_steam_pump");
|
||||
put(TileEntityMachinePumpElectric.class, "tileentity_electric_pump");
|
||||
|
||||
|
||||
put(TileEntityFoundryMold.class, "tileentity_foundry_mold");
|
||||
put(TileEntityFoundryBasin.class, "tileentity_foundry_basin");
|
||||
put(TileEntityFoundryChannel.class, "tileentity_foundry_channel");
|
||||
@ -309,7 +315,7 @@ public class TileMappings {
|
||||
put(TileEntityDiFurnaceRTG.class, "tileentity_rtg_difurnace");
|
||||
put(TileEntityMachineRadiolysis.class, "tileentity_radiolysis");
|
||||
put(TileEntityMachineAutosaw.class, "tileentity_autosaw");
|
||||
|
||||
|
||||
put(TileEntityCondenser.class, "tileentity_condenser");
|
||||
put(TileEntityTowerSmall.class, "tileentity_cooling_tower_small");
|
||||
put(TileEntityTowerLarge.class, "tileentity_cooling_tower_large");
|
||||
@ -331,12 +337,12 @@ public class TileMappings {
|
||||
put(TileEntityChungus.class, "tileentity_chungus");
|
||||
|
||||
put(TileEntityMachineCombustionEngine.class, "tileentity_combustion_engine");
|
||||
|
||||
|
||||
put(TileEntityMachineAssembler.class, "tileentity_assembly_machine");
|
||||
put(TileEntityMachineAssemfac.class, "tileentity_assemfac");
|
||||
put(TileEntityMachineChemplant.class, "tileentity_chemical_plant");
|
||||
put(TileEntityMachineChemfac.class, "tileentity_chemfac");
|
||||
|
||||
|
||||
put(TileEntityMachineOilWell.class, "tileentity_derrick");
|
||||
put(TileEntityMachinePumpjack.class, "tileentity_machine_pumpjack");
|
||||
put(TileEntityMachineFrackingTower.class, "tileentity_fracking_tower");
|
||||
@ -352,21 +358,21 @@ public class TileMappings {
|
||||
put(TileEntityMachinePyroOven.class, "tileentity_pyrooven");
|
||||
put(TileEntityChimneyBrick.class, "tileentity_chimney_brick");
|
||||
put(TileEntityChimneyIndustrial.class, "tileentity_chimney_industrial");
|
||||
|
||||
|
||||
put(TileEntityReactorZirnox.class, "tileentity_zirnox");
|
||||
put(TileEntityZirnoxDestroyed.class, "tileentity_zirnox_destroyed");
|
||||
|
||||
put(TileEntityWatz.class, "tileentity_watz");
|
||||
put(TileEntityWatzPump.class, "tileentity_watz_pump");
|
||||
}
|
||||
|
||||
|
||||
private static void putPile() {
|
||||
put(TileEntityPileFuel.class, "tileentity_pile_fuel");
|
||||
put(TileEntityPileSource.class, "tileentity_pile_source");
|
||||
put(TileEntityPileBreedingFuel.class, "tileentity_pile_breedingfuel");
|
||||
put(TileEntityPileNeutronDetector.class, "tileentity_pile_neutrondetector");
|
||||
}
|
||||
|
||||
|
||||
private static void putRBMK() {
|
||||
put(TileEntityRBMKRod.class, "tileentity_rbmk_rod");
|
||||
put(TileEntityRBMKRodReaSim.class, "tileentity_rbmk_rod_reasim");
|
||||
@ -386,12 +392,12 @@ public class TileMappings {
|
||||
put(TileEntityRBMKInlet.class, "tileentity_rbmk_inlet");
|
||||
put(TileEntityRBMKOutlet.class, "tileentity_rbmk_outlet");
|
||||
}
|
||||
|
||||
|
||||
private static void putNetwork() {
|
||||
put(TileEntityCableBaseNT.class, "tileentity_cable", "tileentity_wirecoated");
|
||||
put(TileEntityCableSwitch.class, "tileentity_cable_switch");
|
||||
put(TileEntityDiode.class, "tileentity_cable_diode");
|
||||
|
||||
|
||||
put(TileEntityConnector.class, "tileentity_connector_redwire");
|
||||
put(TileEntityPylon.class, "tileentity_pylon_redwire");
|
||||
put(TileEntityPylonMedium.class, "tileentity_pylon_medium");
|
||||
@ -414,24 +420,24 @@ public class TileMappings {
|
||||
put(TileEntityRadioTorchCounter.class, "tileentity_rtty_counter");
|
||||
put(TileEntityRadioTorchLogic.class, "tileentity_rtty_logic");
|
||||
put(TileEntityRadioTelex.class, "tileentity_rtty_telex");
|
||||
|
||||
|
||||
put(TileEntityDroneWaypoint.class, "tileentity_drone_waypoint");
|
||||
put(TileEntityDroneCrate.class, "tileentity_drone_crate");
|
||||
put(TileEntityDroneWaypointRequest.class, "tileentity_drone_waypoint_request");
|
||||
put(TileEntityDroneDock.class, "tileentity_drone_dock");
|
||||
put(TileEntityDroneProvider.class, "tileentity_drone_provider");
|
||||
put(TileEntityDroneRequester.class, "tileentity_drone_requester");
|
||||
|
||||
|
||||
put(TileEntityRailSwitch.class, "tileentity_rail_switch");
|
||||
}
|
||||
|
||||
|
||||
private static void put(Class<? extends TileEntity> clazz, String... names) {
|
||||
map.put(clazz, names);
|
||||
|
||||
/*if((IFluidSource.class.isAssignableFrom(clazz) || IFluidAcceptor.class.isAssignableFrom(clazz)) && !IFluidConnector.class.isAssignableFrom(clazz)) {
|
||||
LoggingUtil.errorWithHighlight(clazz.getCanonicalName() + " implements the old interfaces but not IFluidConnector!");
|
||||
}*/
|
||||
|
||||
|
||||
if(IConfigurableMachine.class.isAssignableFrom(clazz)) {
|
||||
configurables.add((Class<? extends IConfigurableMachine>) clazz);
|
||||
}
|
||||
|
||||
157
src/main/java/com/hbm/tileentity/machine/TileEntityRefueler.java
Normal file
157
src/main/java/com/hbm/tileentity/machine/TileEntityRefueler.java
Normal file
@ -0,0 +1,157 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.handler.ArmorModHandler;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.inventory.fluid.tank.FluidTank;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.tileentity.TileEntityLoadedBase;
|
||||
import com.hbm.util.BobMathUtil;
|
||||
|
||||
import api.hbm.fluid.IFillableItem;
|
||||
import api.hbm.fluid.IFluidStandardReceiver;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemArmor;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityRefueler extends TileEntityLoadedBase implements IFluidStandardReceiver {
|
||||
|
||||
public double fillLevel;
|
||||
public double prevFillLevel;
|
||||
|
||||
private boolean isOperating = false;
|
||||
private int operatingTime;
|
||||
|
||||
public FluidTank tank;
|
||||
|
||||
public TileEntityRefueler() {
|
||||
super();
|
||||
tank = new FluidTank(Fluids.KEROSENE, 100);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(this.getBlockMetadata()).getOpposite();
|
||||
ForgeDirection rot = dir.getRotation(ForgeDirection.UP);
|
||||
|
||||
if(!worldObj.isRemote) {
|
||||
trySubscribe(tank.getTankType(), worldObj, xCoord + dir.offsetX, yCoord, zCoord + dir.offsetZ, dir);
|
||||
|
||||
isOperating = false;
|
||||
|
||||
List<EntityPlayer> players = worldObj.getEntitiesWithinAABB(EntityPlayer.class, AxisAlignedBB.getBoundingBox(xCoord + 0.5, yCoord, zCoord + 0.5, xCoord + 0.5, yCoord + 0.5, zCoord + 0.5).expand(0.5, 0.0, 0.5));
|
||||
|
||||
for(EntityPlayer player : players) {
|
||||
for(int i = 0; i < 5; i++) {
|
||||
|
||||
ItemStack stack = player.getEquipmentInSlot(i);
|
||||
if(stack == null) continue;
|
||||
|
||||
if(fillFillable(stack)) {
|
||||
isOperating = true;
|
||||
}
|
||||
|
||||
if(stack.getItem() instanceof ItemArmor && ArmorModHandler.hasMods(stack)) {
|
||||
for(ItemStack mod : ArmorModHandler.pryMods(stack)) {
|
||||
if(mod == null) continue;
|
||||
|
||||
if(fillFillable(mod)) {
|
||||
ArmorModHandler.applyMod(stack, mod);
|
||||
isOperating = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(isOperating) {
|
||||
if(operatingTime % 20 == 0)
|
||||
worldObj.playSoundEffect(xCoord + 0.5, yCoord + 0.5, zCoord + 0.5, "random.fizz", 0.2F, 0.5F);
|
||||
|
||||
operatingTime++;
|
||||
} else {
|
||||
operatingTime = 0;
|
||||
}
|
||||
|
||||
networkPackNT(150);
|
||||
} else {
|
||||
if(isOperating) {
|
||||
Random rand = worldObj.rand;
|
||||
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
data.setString("type", "fluidfill");
|
||||
data.setInteger("color", tank.getTankType().getColor());
|
||||
data.setDouble("posX", xCoord + 0.5 + rand.nextDouble() * 0.0625 + dir.offsetX * 0.5 + rot.offsetX * 0.25);
|
||||
data.setDouble("posZ", zCoord + 0.5 + rand.nextDouble() * 0.0625 + dir.offsetZ * 0.5 + rot.offsetZ * 0.25);
|
||||
data.setDouble("posY", yCoord + 0.375);
|
||||
data.setDouble("mX", -dir.offsetX + rand.nextGaussian() * 0.1);
|
||||
data.setDouble("mZ", -dir.offsetZ + rand.nextGaussian() * 0.1);
|
||||
data.setDouble("mY", 0D);
|
||||
|
||||
MainRegistry.proxy.effectNT(data);
|
||||
}
|
||||
|
||||
prevFillLevel = fillLevel;
|
||||
|
||||
double targetFill = (double)tank.getFill() / (double)tank.getMaxFill();
|
||||
fillLevel = BobMathUtil.interp(fillLevel, targetFill, targetFill > fillLevel || !isOperating ? 0.1F : 0.01F);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
private boolean fillFillable(ItemStack stack) {
|
||||
if(stack.getItem() instanceof IFillableItem) {
|
||||
IFillableItem fillable = (IFillableItem) stack.getItem();
|
||||
if(fillable.acceptsFluid(tank.getTankType(), stack)) {
|
||||
int prevFill = tank.getFill();
|
||||
tank.setFill(fillable.tryFill(tank.getTankType(), tank.getFill(), stack));
|
||||
return tank.getFill() < prevFill;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void serialize(ByteBuf buf) {
|
||||
buf.writeBoolean(isOperating);
|
||||
tank.serialize(buf);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deserialize(ByteBuf buf) {
|
||||
isOperating = buf.readBoolean();
|
||||
tank.deserialize(buf);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
super.readFromNBT(nbt);
|
||||
tank.readFromNBT(nbt, "t");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbt) {
|
||||
super.writeToNBT(nbt);
|
||||
tank.writeToNBT(nbt, "t");
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidTank[] getAllTanks() {
|
||||
return new FluidTank[] { tank };
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidTank[] getReceivingTanks() {
|
||||
return new FluidTank[] { tank };
|
||||
}
|
||||
|
||||
}
|
||||
@ -2,6 +2,7 @@ package com.hbm.util;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.blocks.generic.BlockLoot.TileEntityLoot;
|
||||
import com.hbm.crafting.handlers.MKUCraftingHandler;
|
||||
import com.hbm.inventory.OreDictManager.DictFrame;
|
||||
import com.hbm.itempool.ItemPool;
|
||||
import com.hbm.itempool.ItemPoolsPile;
|
||||
@ -10,6 +11,7 @@ import com.hbm.items.special.ItemBookLore;
|
||||
import com.hbm.items.weapon.sedna.factory.GunFactory.EnumAmmo;
|
||||
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
@ -17,6 +19,45 @@ import java.util.Random;
|
||||
|
||||
public class LootGenerator {
|
||||
|
||||
public static final String LOOT_BOOKLET = "LOOT_BOOKLET";
|
||||
public static final String LOOT_CAPNUKE = "LOOT_CAPNUKE";
|
||||
public static final String LOOT_MEDICINE = "LOOT_MEDICINE";
|
||||
public static final String LOOT_CAPSTASH = "LOOT_CAPSTASH";
|
||||
public static final String LOOT_MAKESHIFT_GUN = "LOOT_MAKESHIFT_GUN";
|
||||
public static final String LOOT_NUKE_STORAGE = "LOOT_NUKE_STORAGE";
|
||||
public static final String LOOT_BONES = "LOOT_BONES";
|
||||
public static final String LOOT_GLYPHID_HIVE = "LOOT_GLYPHID_HIVE";
|
||||
public static final String LOOT_METEOR = "LOOT_METEOR";
|
||||
|
||||
public static void applyLoot(World world, int x, int y, int z, String name) {
|
||||
switch(name) {
|
||||
case LOOT_BOOKLET: lootBooklet(world, x, y, z);
|
||||
case LOOT_CAPNUKE: lootCapNuke(world, x, y, z);
|
||||
case LOOT_MEDICINE: lootMedicine(world, x, y, z);
|
||||
case LOOT_CAPSTASH: lootCapStash(world, x, y, z);
|
||||
case LOOT_MAKESHIFT_GUN: lootMakeshiftGun(world, x, y, z);
|
||||
case LOOT_NUKE_STORAGE: lootNukeStorage(world, x, y, z);
|
||||
case LOOT_BONES: lootBones(world, x, y, z);
|
||||
case LOOT_GLYPHID_HIVE: lootGlyphidHive(world, x, y, z);
|
||||
case LOOT_METEOR: lootBookMeteor(world, x, y, z);
|
||||
default: lootBones(world, x, y, z); break;
|
||||
}
|
||||
}
|
||||
|
||||
public static String[] getLootNames() {
|
||||
return new String[] {
|
||||
LOOT_BOOKLET,
|
||||
LOOT_CAPNUKE,
|
||||
LOOT_MEDICINE,
|
||||
LOOT_CAPSTASH,
|
||||
LOOT_MAKESHIFT_GUN,
|
||||
LOOT_NUKE_STORAGE,
|
||||
LOOT_BONES,
|
||||
LOOT_GLYPHID_HIVE,
|
||||
LOOT_METEOR,
|
||||
};
|
||||
}
|
||||
|
||||
public static void setBlock(World world, int x, int y, int z) {
|
||||
world.setBlock(x, y, z, ModBlocks.deco_loot);
|
||||
}
|
||||
@ -142,6 +183,19 @@ public class LootGenerator {
|
||||
}
|
||||
}
|
||||
|
||||
public static void lootBookMeteor(World world, int x, int y, int z) {
|
||||
|
||||
TileEntityLoot loot = (TileEntityLoot) world.getTileEntity(x, y, z);
|
||||
|
||||
if(loot != null && loot.items.isEmpty()) {
|
||||
Item mkuItem = MKUCraftingHandler.getMKUItem(world);
|
||||
ItemStack mkuBook = MKUCraftingHandler.generateBook(world, mkuItem);
|
||||
|
||||
addItemWithDeviation(loot, world.rand, new ItemStack(mkuItem), 0, 0, 0.25);
|
||||
addItemWithDeviation(loot, world.rand, mkuBook, 0, 0, -0.25);
|
||||
}
|
||||
}
|
||||
|
||||
public static void lootBookLore(World world, int x, int y, int z, ItemStack book) {
|
||||
|
||||
TileEntityLoot loot = (TileEntityLoot) world.getTileEntity(x, y, z);
|
||||
@ -157,4 +211,4 @@ public class LootGenerator {
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@ -1,426 +0,0 @@
|
||||
//Schematic to java Structure by jajo_11 | inspired by "MITHION'S .SCHEMATIC TO JAVA CONVERTINGTOOL"
|
||||
|
||||
package com.hbm.world.dungeon;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.config.GeneralConfig;
|
||||
import com.hbm.itempool.ItemPool;
|
||||
import com.hbm.itempool.ItemPoolsLegacy;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.tileentity.TileEntityChest;
|
||||
import net.minecraft.util.WeightedRandomChestContent;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.gen.feature.WorldGenerator;
|
||||
|
||||
public class CrashedVertibird extends WorldGenerator
|
||||
{
|
||||
Block Block1 = ModBlocks.deco_steel;
|
||||
Block Block2 = ModBlocks.deco_tungsten;
|
||||
Block Block3 = ModBlocks.reinforced_glass;
|
||||
Block Block4 = ModBlocks.deco_titanium;
|
||||
|
||||
protected Block[] GetValidSpawnBlocks()
|
||||
{
|
||||
return new Block[]
|
||||
{
|
||||
Blocks.sand,
|
||||
Blocks.sandstone,
|
||||
};
|
||||
}
|
||||
|
||||
public boolean LocationIsValidSpawn(World world, int x, int y, int z)
|
||||
{
|
||||
|
||||
Block checkBlock = world.getBlock(x, y - 1, z);
|
||||
Block blockAbove = world.getBlock(x, y , z);
|
||||
Block blockBelow = world.getBlock(x, y - 2, z);
|
||||
|
||||
for (Block i : GetValidSpawnBlocks())
|
||||
{
|
||||
if (blockAbove != Blocks.air)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (checkBlock == i)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else if (checkBlock == Blocks.snow_layer && blockBelow == i)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else if (checkBlock.getMaterial() == Material.plants && blockBelow == i)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean generate(World world, Random rand, int x, int y, int z)
|
||||
{
|
||||
int i = rand.nextInt(1);
|
||||
|
||||
if(i == 0)
|
||||
{
|
||||
generate_r0(world, rand, x, y, z);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
public boolean generate_r0(World world, Random rand, int x, int y, int z)
|
||||
{
|
||||
int yOffset = 8 + rand.nextInt(4);
|
||||
|
||||
if(!LocationIsValidSpawn(world, x + 9, y, z + 9))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
world.setBlock(x + 4, y + 0 - yOffset, z + 1, Block1, 0, 3);
|
||||
world.setBlock(x + 5, y + 0 - yOffset, z + 1, Block1, 0, 3);
|
||||
world.setBlock(x + 6, y + 0 - yOffset, z + 1, Block1, 0, 3);
|
||||
world.setBlock(x + 5, y + 0 - yOffset, z + 2, Block2, 0, 3);
|
||||
world.setBlock(x + 4, y + 1 - yOffset, z + 0, Block1, 0, 3);
|
||||
world.setBlock(x + 5, y + 1 - yOffset, z + 0, Block1, 0, 3);
|
||||
world.setBlock(x + 6, y + 1 - yOffset, z + 0, Block1, 0, 3);
|
||||
world.setBlock(x + 3, y + 1 - yOffset, z + 1, Block1, 0, 3);
|
||||
world.setBlock(x + 7, y + 1 - yOffset, z + 1, Block1, 0, 3);
|
||||
world.setBlock(x + 4, y + 1 - yOffset, z + 2, Block1, 0, 3);
|
||||
world.setBlock(x + 5, y + 1 - yOffset, z + 2, Block1, 0, 3);
|
||||
world.setBlock(x + 6, y + 1 - yOffset, z + 2, Block1, 0, 3);
|
||||
world.setBlock(x + 3, y + 1 - yOffset, z + 3, Block2, 0, 3);
|
||||
world.setBlock(x + 4, y + 1 - yOffset, z + 3, Block1, 0, 3);
|
||||
world.setBlock(x + 5, y + 1 - yOffset, z + 3, Block1, 0, 3);
|
||||
world.setBlock(x + 6, y + 1 - yOffset, z + 3, Block1, 0, 3);
|
||||
world.setBlock(x + 7, y + 1 - yOffset, z + 3, Block2, 0, 3);
|
||||
world.setBlock(x + 4, y + 2 - yOffset, z + 0, Block3, 0, 3);
|
||||
world.setBlock(x + 5, y + 2 - yOffset, z + 0, Block3, 0, 3);
|
||||
world.setBlock(x + 3, y + 2 - yOffset, z + 1, Block3, 0, 3);
|
||||
world.setBlock(x + 7, y + 2 - yOffset, z + 1, Block3, 0, 3);
|
||||
world.setBlock(x + 3, y + 2 - yOffset, z + 2, Block1, 0, 3);
|
||||
world.setBlock(x + 4, y + 2 - yOffset, z + 2, Blocks.stone_stairs, 2, 3);
|
||||
world.setBlock(x + 6, y + 2 - yOffset, z + 2, Blocks.stone_stairs, 2, 3);
|
||||
world.setBlock(x + 7, y + 2 - yOffset, z + 2, Block1, 0, 3);
|
||||
world.setBlock(x + 7, y + 2 - yOffset, z + 3, Block4, 0, 3);
|
||||
world.setBlock(x + 3, y + 2 - yOffset, z + 4, Block2, 0, 3);
|
||||
world.setBlock(x + 4, y + 2 - yOffset, z + 4, Block1, 0, 3);
|
||||
world.setBlock(x + 5, y + 2 - yOffset, z + 4, Block1, 0, 3);
|
||||
world.setBlock(x + 6, y + 2 - yOffset, z + 4, Block1, 0, 3);
|
||||
world.setBlock(x + 7, y + 2 - yOffset, z + 4, Block2, 0, 3);
|
||||
world.setBlock(x + 3, y + 2 - yOffset, z + 5, Block2, 0, 3);
|
||||
world.setBlock(x + 4, y + 2 - yOffset, z + 5, Block1, 0, 3);
|
||||
world.setBlock(x + 5, y + 2 - yOffset, z + 5, Block1, 0, 3);
|
||||
world.setBlock(x + 6, y + 2 - yOffset, z + 5, Block1, 0, 3);
|
||||
world.setBlock(x + 7, y + 2 - yOffset, z + 5, Block2, 0, 3);
|
||||
world.setBlock(x + 4, y + 2 - yOffset, z + 7, Block2, 0, 3);
|
||||
world.setBlock(x + 6, y + 2 - yOffset, z + 7, Block2, 0, 3);
|
||||
world.setBlock(x + 4, y + 3 - yOffset, z + 0, Block1, 0, 3);
|
||||
world.setBlock(x + 5, y + 3 - yOffset, z + 0, Block1, 0, 3);
|
||||
world.setBlock(x + 6, y + 3 - yOffset, z + 0, Block1, 0, 3);
|
||||
world.setBlock(x + 3, y + 3 - yOffset, z + 1, Block3, 0, 3);
|
||||
world.setBlock(x + 4, y + 3 - yOffset, z + 1, Block1, 0, 3);
|
||||
world.setBlock(x + 5, y + 3 - yOffset, z + 1, Block1, 0, 3);
|
||||
world.setBlock(x + 6, y + 3 - yOffset, z + 1, Block1, 0, 3);
|
||||
world.setBlock(x + 7, y + 3 - yOffset, z + 1, Block3, 0, 3);
|
||||
world.setBlock(x + 3, y + 3 - yOffset, z + 2, Block1, 0, 3);
|
||||
world.setBlock(x + 7, y + 3 - yOffset, z + 2, Block1, 0, 3);
|
||||
world.setBlock(x + 3, y + 3 - yOffset, z + 3, Block1, 0, 3);
|
||||
world.setBlock(x + 7, y + 3 - yOffset, z + 3, Block1, 0, 3);
|
||||
world.setBlock(x + 7, y + 3 - yOffset, z + 4, Block4, 0, 3);
|
||||
world.setBlock(x + 2, y + 3 - yOffset, z + 5, Block4, 0, 3);
|
||||
world.setBlock(x + 7, y + 3 - yOffset, z + 5, Block4, 0, 3);
|
||||
world.setBlock(x + 4, y + 3 - yOffset, z + 6, Block1, 0, 3);
|
||||
world.setBlock(x + 5, y + 3 - yOffset, z + 6, Block1, 0, 3);
|
||||
world.setBlock(x + 6, y + 3 - yOffset, z + 6, Block1, 0, 3);
|
||||
world.setBlock(x + 4, y + 3 - yOffset, z + 7, Block1, 0, 3);
|
||||
world.setBlock(x + 5, y + 3 - yOffset, z + 7, Block1, 0, 3);
|
||||
world.setBlock(x + 6, y + 3 - yOffset, z + 7, Block1, 0, 3);
|
||||
world.setBlock(x + 5, y + 3 - yOffset, z + 9, Block2, 0, 3);
|
||||
world.setBlock(x + 4, y + 4 - yOffset, z + 1, Block1, 0, 3);
|
||||
world.setBlock(x + 5, y + 4 - yOffset, z + 1, Block1, 0, 3);
|
||||
world.setBlock(x + 6, y + 4 - yOffset, z + 1, Block1, 0, 3);
|
||||
world.setBlock(x + 3, y + 4 - yOffset, z + 2, Block3, 0, 3);
|
||||
world.setBlock(x + 3, y + 4 - yOffset, z + 3, Block1, 0, 3);
|
||||
world.setBlock(x + 7, y + 4 - yOffset, z + 3, Block1, 0, 3);
|
||||
world.setBlock(x + 7, y + 4 - yOffset, z + 5, Block4, 0, 3);
|
||||
world.setBlock(x + 2, y + 4 - yOffset, z + 6, Block4, 0, 3);
|
||||
world.setBlock(x + 3, y + 4 - yOffset, z + 6, Block1, 0, 3);
|
||||
world.setBlock(x + 7, y + 4 - yOffset, z + 6, Block1, 0, 3);
|
||||
world.setBlock(x + 2, y + 4 - yOffset, z + 7, Block4, 0, 3);
|
||||
world.setBlock(x + 3, y + 4 - yOffset, z + 7, Block1, 0, 3);
|
||||
world.setBlock(x + 6, y + 4 - yOffset, z + 7, Blocks.chest, 2, 3);
|
||||
if(world.getBlock(x + 6, y + 4 - yOffset, z + 7) == Blocks.chest)
|
||||
{
|
||||
WeightedRandomChestContent.generateChestContents(rand, ItemPool.getPool(ItemPoolsLegacy.POOL_VERTIBIRD), (TileEntityChest)world.getTileEntity(x + 6, y + 4 - yOffset, z + 7), 8);
|
||||
}
|
||||
world.setBlock(x + 7, y + 4 - yOffset, z + 7, Block1, 0, 3);
|
||||
world.setBlock(x + 4, y + 4 - yOffset, z + 8, Block1, 0, 3);
|
||||
world.setBlock(x + 5, y + 4 - yOffset, z + 8, Block1, 0, 3);
|
||||
world.setBlock(x + 6, y + 4 - yOffset, z + 8, Block1, 0, 3);
|
||||
world.setBlock(x + 4, y + 4 - yOffset, z + 9, Block1, 0, 3);
|
||||
world.setBlock(x + 5, y + 4 - yOffset, z + 9, Block1, 0, 3);
|
||||
world.setBlock(x + 6, y + 4 - yOffset, z + 9, Block1, 0, 3);
|
||||
world.setBlock(x + 6, y + 5 - yOffset, z + 1, Block2, 0, 3);
|
||||
world.setBlock(x + 4, y + 5 - yOffset, z + 2, Block1, 0, 3);
|
||||
world.setBlock(x + 5, y + 5 - yOffset, z + 2, Block1, 0, 3);
|
||||
world.setBlock(x + 6, y + 5 - yOffset, z + 2, Block1, 0, 3);
|
||||
world.setBlock(x + 4, y + 5 - yOffset, z + 3, Block1, 0, 3);
|
||||
world.setBlock(x + 5, y + 5 - yOffset, z + 3, Block1, 0, 3);
|
||||
world.setBlock(x + 6, y + 5 - yOffset, z + 3, Block1, 0, 3);
|
||||
world.setBlock(x + 7, y + 5 - yOffset, z + 3, Block1, 0, 3);
|
||||
world.setBlock(x + 3, y + 5 - yOffset, z + 4, Block1, 0, 3);
|
||||
world.setBlock(x + 7, y + 5 - yOffset, z + 4, Block1, 0, 3);
|
||||
world.setBlock(x + 3, y + 5 - yOffset, z + 5, Block1, 0, 3);
|
||||
world.setBlock(x + 7, y + 5 - yOffset, z + 5, Block1, 0, 3);
|
||||
world.setBlock(x + 2, y + 5 - yOffset, z + 6, Block4, 0, 3);
|
||||
world.setBlock(x + 3, y + 5 - yOffset, z + 6, Block1, 0, 3);
|
||||
world.setBlock(x + 7, y + 5 - yOffset, z + 6, Block1, 0, 3);
|
||||
world.setBlock(x + 2, y + 5 - yOffset, z + 7, Block4, 0, 3);
|
||||
world.setBlock(x + 3, y + 5 - yOffset, z + 7, Block1, 0, 3);
|
||||
world.setBlock(x + 7, y + 5 - yOffset, z + 7, Block1, 0, 3);
|
||||
world.setBlock(x + 4, y + 5 - yOffset, z + 8, Block1, 0, 3);
|
||||
world.setBlock(x + 5, y + 5 - yOffset, z + 8, Block1, 0, 3);
|
||||
world.setBlock(x + 6, y + 5 - yOffset, z + 8, Block1, 0, 3);
|
||||
world.setBlock(x + 4, y + 5 - yOffset, z + 9, Block1, 0, 3);
|
||||
world.setBlock(x + 5, y + 5 - yOffset, z + 9, Block4, 0, 3);
|
||||
world.setBlock(x + 6, y + 5 - yOffset, z + 9, Block1, 0, 3);
|
||||
world.setBlock(x + 5, y + 6 - yOffset, z + 3, Block1, 0, 3);
|
||||
world.setBlock(x + 6, y + 6 - yOffset, z + 3, Block1, 0, 3);
|
||||
world.setBlock(x + 4, y + 6 - yOffset, z + 4, Block1, 0, 3);
|
||||
world.setBlock(x + 5, y + 6 - yOffset, z + 4, Block1, 0, 3);
|
||||
world.setBlock(x + 6, y + 6 - yOffset, z + 4, Block1, 0, 3);
|
||||
world.setBlock(x + 7, y + 6 - yOffset, z + 4, Block1, 0, 3);
|
||||
world.setBlock(x + 14, y + 6 - yOffset, z + 4, Block1, 0, 3);
|
||||
world.setBlock(x + 0, y + 6 - yOffset, z + 5, Block1, 0, 3);
|
||||
world.setBlock(x + 1, y + 6 - yOffset, z + 5, Block1, 0, 3);
|
||||
world.setBlock(x + 2, y + 6 - yOffset, z + 5, Block1, 0, 3);
|
||||
world.setBlock(x + 3, y + 6 - yOffset, z + 5, Block1, 0, 3);
|
||||
world.setBlock(x + 4, y + 6 - yOffset, z + 5, Block1, 0, 3);
|
||||
world.setBlock(x + 5, y + 6 - yOffset, z + 5, Block1, 0, 3);
|
||||
world.setBlock(x + 6, y + 6 - yOffset, z + 5, Block1, 0, 3);
|
||||
world.setBlock(x + 7, y + 6 - yOffset, z + 5, Block1, 0, 3);
|
||||
world.setBlock(x + 8, y + 6 - yOffset, z + 5, Block1, 0, 3);
|
||||
world.setBlock(x + 9, y + 6 - yOffset, z + 5, Block1, 0, 3);
|
||||
world.setBlock(x + 10, y + 6 - yOffset, z + 5, Block1, 0, 3);
|
||||
world.setBlock(x + 13, y + 6 - yOffset, z + 5, Block1, 0, 3);
|
||||
world.setBlock(x + 3, y + 6 - yOffset, z + 6, Block1, 0, 3);
|
||||
world.setBlock(x + 4, y + 6 - yOffset, z + 6, Block1, 0, 3);
|
||||
world.setBlock(x + 6, y + 6 - yOffset, z + 6, Block1, 0, 3);
|
||||
world.setBlock(x + 7, y + 6 - yOffset, z + 6, Block1, 0, 3);
|
||||
world.setBlock(x + 3, y + 6 - yOffset, z + 7, Block1, 0, 3);
|
||||
world.setBlock(x + 4, y + 6 - yOffset, z + 7, Block1, 0, 3);
|
||||
world.setBlock(x + 5, y + 6 - yOffset, z + 7, Block1, 0, 3);
|
||||
world.setBlock(x + 6, y + 6 - yOffset, z + 7, Block1, 0, 3);
|
||||
world.setBlock(x + 7, y + 6 - yOffset, z + 7, Block1, 0, 3);
|
||||
world.setBlock(x + 4, y + 6 - yOffset, z + 8, Block1, 0, 3);
|
||||
world.setBlock(x + 5, y + 6 - yOffset, z + 8, ModBlocks.machine_battery, 2, 3);
|
||||
world.setBlock(x + 6, y + 6 - yOffset, z + 8, Block1, 0, 3);
|
||||
world.setBlock(x + 4, y + 6 - yOffset, z + 9, Block1, 0, 3);
|
||||
world.setBlock(x + 5, y + 6 - yOffset, z + 9, ModBlocks.red_wire_coated, 0, 3);
|
||||
world.setBlock(x + 6, y + 6 - yOffset, z + 9, Block1, 0, 3);
|
||||
world.setBlock(x + 4, y + 6 - yOffset, z + 10, Block1, 0, 3);
|
||||
world.setBlock(x + 5, y + 6 - yOffset, z + 10, Block1, 0, 3);
|
||||
world.setBlock(x + 6, y + 6 - yOffset, z + 10, Block1, 0, 3);
|
||||
world.setBlock(x + 5, y + 6 - yOffset, z + 11, Block1, 0, 3);
|
||||
world.setBlock(x + 6, y + 6 - yOffset, z + 11, Block1, 0, 3);
|
||||
world.setBlock(x + 4, y + 7 - yOffset, z + 4, Block1, 0, 3);
|
||||
world.setBlock(x + 5, y + 7 - yOffset, z + 4, Block1, 0, 3);
|
||||
world.setBlock(x + 6, y + 7 - yOffset, z + 4, Block1, 0, 3);
|
||||
world.setBlock(x + 7, y + 7 - yOffset, z + 4, Block1, 0, 3);
|
||||
world.setBlock(x + 14, y + 7 - yOffset, z + 4, Block1, 0, 3);
|
||||
world.setBlock(x + 1, y + 7 - yOffset, z + 5, Block1, 0, 3);
|
||||
world.setBlock(x + 2, y + 7 - yOffset, z + 5, Block1, 0, 3);
|
||||
world.setBlock(x + 3, y + 7 - yOffset, z + 5, Block1, 0, 3);
|
||||
world.setBlock(x + 4, y + 7 - yOffset, z + 5, Block1, 0, 3);
|
||||
world.setBlock(x + 5, y + 7 - yOffset, z + 5, Block1, 0, 3);
|
||||
world.setBlock(x + 6, y + 7 - yOffset, z + 5, Block1, 0, 3);
|
||||
world.setBlock(x + 7, y + 7 - yOffset, z + 5, Block1, 0, 3);
|
||||
world.setBlock(x + 8, y + 7 - yOffset, z + 5, Block1, 0, 3);
|
||||
world.setBlock(x + 9, y + 7 - yOffset, z + 5, Block1, 0, 3);
|
||||
world.setBlock(x + 10, y + 7 - yOffset, z + 5, Block1, 0, 3);
|
||||
world.setBlock(x + 11, y + 7 - yOffset, z + 5, Block1, 0, 3);
|
||||
world.setBlock(x + 12, y + 7 - yOffset, z + 5, Block1, 0, 3);
|
||||
world.setBlock(x + 13, y + 7 - yOffset, z + 5, Block1, 0, 3);
|
||||
world.setBlock(x + 14, y + 7 - yOffset, z + 5, Block2, 0, 3);
|
||||
world.setBlock(x + 3, y + 7 - yOffset, z + 6, Block1, 0, 3);
|
||||
world.setBlock(x + 4, y + 7 - yOffset, z + 6, Block1, 0, 3);
|
||||
world.setBlock(x + 5, y + 7 - yOffset, z + 6, Block1, 0, 3);
|
||||
world.setBlock(x + 6, y + 7 - yOffset, z + 6, Block1, 0, 3);
|
||||
world.setBlock(x + 7, y + 7 - yOffset, z + 6, Block1, 0, 3);
|
||||
world.setBlock(x + 14, y + 7 - yOffset, z + 6, Block1, 0, 3);
|
||||
world.setBlock(x + 3, y + 7 - yOffset, z + 7, Block1, 0, 3);
|
||||
world.setBlock(x + 4, y + 7 - yOffset, z + 7, Block1, 0, 3);
|
||||
world.setBlock(x + 5, y + 7 - yOffset, z + 7, Block1, 0, 3);
|
||||
world.setBlock(x + 6, y + 7 - yOffset, z + 7, Block1, 0, 3);
|
||||
world.setBlock(x + 7, y + 7 - yOffset, z + 7, Block1, 0, 3);
|
||||
world.setBlock(x + 3, y + 7 - yOffset, z + 8, Block1, 0, 3);
|
||||
world.setBlock(x + 4, y + 7 - yOffset, z + 8, Block1, 0, 3);
|
||||
world.setBlock(x + 5, y + 7 - yOffset, z + 8, Block1, 0, 3);
|
||||
world.setBlock(x + 6, y + 7 - yOffset, z + 8, Block1, 0, 3);
|
||||
world.setBlock(x + 7, y + 7 - yOffset, z + 8, Block1, 0, 3);
|
||||
world.setBlock(x + 3, y + 7 - yOffset, z + 9, Block1, 0, 3);
|
||||
world.setBlock(x + 4, y + 7 - yOffset, z + 9, ModBlocks.block_electrical_scrap, 0, 3);
|
||||
world.setBlock(x + 5, y + 7 - yOffset, z + 9, ModBlocks.red_wire_coated, 0, 3);
|
||||
world.setBlock(x + 6, y + 7 - yOffset, z + 9, ModBlocks.block_electrical_scrap, 0, 3);
|
||||
world.setBlock(x + 7, y + 7 - yOffset, z + 9, Block1, 0, 3);
|
||||
world.setBlock(x + 5, y + 7 - yOffset, z + 10, Block4, 0, 3);
|
||||
world.setBlock(x + 6, y + 7 - yOffset, z + 10, Block1, 0, 3);
|
||||
world.setBlock(x + 5, y + 7 - yOffset, z + 11, Block4, 0, 3);
|
||||
world.setBlock(x + 6, y + 7 - yOffset, z + 11, Block1, 0, 3);
|
||||
world.setBlock(x + 5, y + 8 - yOffset, z + 4, Block1, 0, 3);
|
||||
world.setBlock(x + 14, y + 8 - yOffset, z + 4, Block1, 0, 3);
|
||||
world.setBlock(x + 4, y + 8 - yOffset, z + 5, Block1, 0, 3);
|
||||
world.setBlock(x + 5, y + 8 - yOffset, z + 5, Block1, 0, 3);
|
||||
world.setBlock(x + 6, y + 8 - yOffset, z + 5, Block1, 0, 3);
|
||||
world.setBlock(x + 13, y + 8 - yOffset, z + 5, Block1, 0, 3);
|
||||
world.setBlock(x + 14, y + 8 - yOffset, z + 5, Block2, 0, 3);
|
||||
world.setBlock(x + 15, y + 8 - yOffset, z + 5, Block1, 0, 3);
|
||||
world.setBlock(x + 3, y + 8 - yOffset, z + 6, Block1, 0, 3);
|
||||
world.setBlock(x + 4, y + 8 - yOffset, z + 6, Block1, 0, 3);
|
||||
world.setBlock(x + 5, y + 8 - yOffset, z + 6, Blocks.chest, 2, 3);
|
||||
if(world.getBlock(x + 5, y + 8 - yOffset, z + 6) == Blocks.chest)
|
||||
{
|
||||
WeightedRandomChestContent.generateChestContents(rand, ItemPool.getPool(ItemPoolsLegacy.POOL_EXPENSIVE), (TileEntityChest)world.getTileEntity(x + 5, y + 8 - yOffset, z + 6), 8);
|
||||
}
|
||||
world.setBlock(x + 6, y + 8 - yOffset, z + 6, Block1, 0, 3);
|
||||
world.setBlock(x + 7, y + 8 - yOffset, z + 6, Block1, 0, 3);
|
||||
world.setBlock(x + 14, y + 8 - yOffset, z + 6, Block1, 0, 3);
|
||||
world.setBlock(x + 3, y + 8 - yOffset, z + 7, Block1, 0, 3);
|
||||
world.setBlock(x + 4, y + 8 - yOffset, z + 7, Block1, 0, 3);
|
||||
world.setBlock(x + 5, y + 8 - yOffset, z + 7, Block1, 0, 3);
|
||||
world.setBlock(x + 6, y + 8 - yOffset, z + 7, Block1, 0, 3);
|
||||
world.setBlock(x + 7, y + 8 - yOffset, z + 7, Block1, 0, 3);
|
||||
world.setBlock(x + 3, y + 8 - yOffset, z + 8, Block1, 0, 3);
|
||||
world.setBlock(x + 4, y + 8 - yOffset, z + 8, Block1, 0, 3);
|
||||
world.setBlock(x + 5, y + 8 - yOffset, z + 8, Block1, 0, 3);
|
||||
world.setBlock(x + 6, y + 8 - yOffset, z + 8, Block1, 0, 3);
|
||||
world.setBlock(x + 7, y + 8 - yOffset, z + 8, Block1, 0, 3);
|
||||
world.setBlock(x + 3, y + 8 - yOffset, z + 9, Block1, 0, 3);
|
||||
world.setBlock(x + 4, y + 8 - yOffset, z + 9, ModBlocks.block_electrical_scrap, 0, 3);
|
||||
world.setBlock(x + 5, y + 8 - yOffset, z + 9, ModBlocks.red_wire_coated, 0, 3);
|
||||
world.setBlock(x + 6, y + 8 - yOffset, z + 9, ModBlocks.block_electrical_scrap, 0, 3);
|
||||
world.setBlock(x + 7, y + 8 - yOffset, z + 9, Block1, 0, 3);
|
||||
world.setBlock(x + 4, y + 8 - yOffset, z + 10, ModBlocks.block_electrical_scrap, 0, 3);
|
||||
world.setBlock(x + 5, y + 8 - yOffset, z + 10, ModBlocks.red_wire_coated, 0, 3);
|
||||
world.setBlock(x + 6, y + 8 - yOffset, z + 10, ModBlocks.block_electrical_scrap, 0, 3);
|
||||
world.setBlock(x + 7, y + 8 - yOffset, z + 10, Block1, 0, 3);
|
||||
world.setBlock(x + 5, y + 8 - yOffset, z + 11, Block4, 0, 3);
|
||||
world.setBlock(x + 6, y + 8 - yOffset, z + 11, Block1, 0, 3);
|
||||
world.setBlock(x + 7, y + 8 - yOffset, z + 11, Block1, 0, 3);
|
||||
world.setBlock(x + 6, y + 8 - yOffset, z + 12, Block1, 0, 3);
|
||||
world.setBlock(x + 14, y + 9 - yOffset, z + 4, Block1, 0, 3);
|
||||
world.setBlock(x + 13, y + 9 - yOffset, z + 5, Block1, 0, 3);
|
||||
world.setBlock(x + 14, y + 9 - yOffset, z + 5, Block2, 0, 3);
|
||||
world.setBlock(x + 15, y + 9 - yOffset, z + 5, Block1, 0, 3);
|
||||
world.setBlock(x + 4, y + 9 - yOffset, z + 6, Block1, 0, 3);
|
||||
world.setBlock(x + 5, y + 9 - yOffset, z + 6, Block1, 0, 3);
|
||||
world.setBlock(x + 6, y + 9 - yOffset, z + 6, Block1, 0, 3);
|
||||
world.setBlock(x + 14, y + 9 - yOffset, z + 6, Block1, 0, 3);
|
||||
world.setBlock(x + 4, y + 9 - yOffset, z + 7, Block1, 0, 3);
|
||||
world.setBlock(x + 5, y + 9 - yOffset, z + 7, Block1, 0, 3);
|
||||
world.setBlock(x + 6, y + 9 - yOffset, z + 7, Block1, 0, 3);
|
||||
world.setBlock(x + 3, y + 9 - yOffset, z + 8, Block1, 0, 3);
|
||||
world.setBlock(x + 4, y + 9 - yOffset, z + 8, Block1, 0, 3);
|
||||
world.setBlock(x + 5, y + 9 - yOffset, z + 8, Block1, 0, 3);
|
||||
world.setBlock(x + 6, y + 9 - yOffset, z + 8, Block1, 0, 3);
|
||||
world.setBlock(x + 7, y + 9 - yOffset, z + 8, Block1, 0, 3);
|
||||
world.setBlock(x + 4, y + 9 - yOffset, z + 9, Block1, 0, 3);
|
||||
world.setBlock(x + 5, y + 9 - yOffset, z + 9, Block4, 0, 3);
|
||||
world.setBlock(x + 6, y + 9 - yOffset, z + 9, Block1, 0, 3);
|
||||
world.setBlock(x + 4, y + 9 - yOffset, z + 10, ModBlocks.block_electrical_scrap, 0, 3);
|
||||
world.setBlock(x + 5, y + 9 - yOffset, z + 10, ModBlocks.red_wire_coated, 0, 3);
|
||||
world.setBlock(x + 6, y + 9 - yOffset, z + 10, ModBlocks.block_electrical_scrap, 0, 3);
|
||||
world.setBlock(x + 7, y + 9 - yOffset, z + 10, Block1, 0, 3);
|
||||
world.setBlock(x + 5, y + 9 - yOffset, z + 11, ModBlocks.red_wire_coated, 0, 3);
|
||||
world.setBlock(x + 6, y + 9 - yOffset, z + 11, Block1, 0, 3);
|
||||
world.setBlock(x + 5, y + 9 - yOffset, z + 12, Block4, 0, 3);
|
||||
world.setBlock(x + 6, y + 9 - yOffset, z + 12, Block1, 0, 3);
|
||||
world.setBlock(x + 7, y + 9 - yOffset, z + 12, Block1, 0, 3);
|
||||
world.setBlock(x + 5, y + 9 - yOffset, z + 13, Block1, 0, 3);
|
||||
world.setBlock(x + 6, y + 9 - yOffset, z + 13, Block1, 0, 3);
|
||||
world.setBlock(x + 14, y + 10 - yOffset, z + 5, Block2, 0, 3);
|
||||
world.setBlock(x + 4, y + 10 - yOffset, z + 8, Block1, 0, 3);
|
||||
world.setBlock(x + 5, y + 10 - yOffset, z + 8, Block1, 0, 3);
|
||||
world.setBlock(x + 6, y + 10 - yOffset, z + 8, Block1, 0, 3);
|
||||
world.setBlock(x + 5, y + 10 - yOffset, z + 9, Block1, 0, 3);
|
||||
world.setBlock(x + 4, y + 10 - yOffset, z + 10, Block1, 0, 3);
|
||||
world.setBlock(x + 5, y + 10 - yOffset, z + 10, Block4, 0, 3);
|
||||
world.setBlock(x + 6, y + 10 - yOffset, z + 10, Block1, 0, 3);
|
||||
world.setBlock(x + 4, y + 10 - yOffset, z + 11, Block1, 0, 3);
|
||||
world.setBlock(x + 5, y + 10 - yOffset, z + 11, Block1, 0, 3);
|
||||
world.setBlock(x + 6, y + 10 - yOffset, z + 11, Block1, 0, 3);
|
||||
world.setBlock(x + 4, y + 10 - yOffset, z + 12, Block1, 0, 3);
|
||||
world.setBlock(x + 5, y + 10 - yOffset, z + 12, ModBlocks.red_wire_coated, 0, 3);
|
||||
world.setBlock(x + 6, y + 10 - yOffset, z + 12, Block1, 0, 3);
|
||||
world.setBlock(x + 4, y + 10 - yOffset, z + 13, Block1, 0, 3);
|
||||
world.setBlock(x + 5, y + 10 - yOffset, z + 13, ModBlocks.red_wire_coated, 0, 3);
|
||||
world.setBlock(x + 6, y + 10 - yOffset, z + 13, Block1, 0, 3);
|
||||
world.setBlock(x + 5, y + 10 - yOffset, z + 14, Block1, 0, 3);
|
||||
world.setBlock(x + 5, y + 10 - yOffset, z + 15, Block1, 0, 3);
|
||||
world.setBlock(x + 5, y + 10 - yOffset, z + 17, Block1, 0, 3);
|
||||
world.setBlock(x + 5, y + 10 - yOffset, z + 18, Block1, 0, 3);
|
||||
world.setBlock(x + 14, y + 11 - yOffset, z + 4, Block4, 0, 3);
|
||||
world.setBlock(x + 12, y + 11 - yOffset, z + 5, Block4, 0, 3);
|
||||
world.setBlock(x + 13, y + 11 - yOffset, z + 5, Block4, 0, 3);
|
||||
world.setBlock(x + 14, y + 11 - yOffset, z + 5, Block2, 0, 3);
|
||||
world.setBlock(x + 15, y + 11 - yOffset, z + 5, Block4, 0, 3);
|
||||
world.setBlock(x + 16, y + 11 - yOffset, z + 5, Block4, 0, 3);
|
||||
world.setBlock(x + 17, y + 11 - yOffset, z + 5, Block4, 0, 3);
|
||||
world.setBlock(x + 14, y + 11 - yOffset, z + 6, Block4, 0, 3);
|
||||
world.setBlock(x + 14, y + 11 - yOffset, z + 7, Block4, 0, 3);
|
||||
world.setBlock(x + 5, y + 11 - yOffset, z + 10, Block1, 0, 3);
|
||||
world.setBlock(x + 5, y + 11 - yOffset, z + 11, Block1, 0, 3);
|
||||
world.setBlock(x + 4, y + 11 - yOffset, z + 12, Block1, 0, 3);
|
||||
world.setBlock(x + 5, y + 11 - yOffset, z + 12, Block1, 0, 3);
|
||||
world.setBlock(x + 6, y + 11 - yOffset, z + 12, Block1, 0, 3);
|
||||
world.setBlock(x + 5, y + 11 - yOffset, z + 13, Block1, 0, 3);
|
||||
world.setBlock(x + 4, y + 11 - yOffset, z + 14, Block1, 0, 3);
|
||||
world.setBlock(x + 5, y + 11 - yOffset, z + 14, ModBlocks.red_wire_coated, 0, 3);
|
||||
world.setBlock(x + 6, y + 11 - yOffset, z + 14, Block1, 0, 3);
|
||||
world.setBlock(x + 4, y + 11 - yOffset, z + 15, Block1, 0, 3);
|
||||
world.setBlock(x + 5, y + 11 - yOffset, z + 15, ModBlocks.red_wire_coated, 0, 3);
|
||||
world.setBlock(x + 6, y + 11 - yOffset, z + 15, Block1, 0, 3);
|
||||
world.setBlock(x + 5, y + 11 - yOffset, z + 16, Block1, 0, 3);
|
||||
world.setBlock(x + 5, y + 11 - yOffset, z + 17, Block1, 0, 3);
|
||||
world.setBlock(x + 5, y + 11 - yOffset, z + 18, Block1, 0, 3);
|
||||
world.setBlock(x + 5, y + 12 - yOffset, z + 14, Block1, 0, 3);
|
||||
world.setBlock(x + 3, y + 12 - yOffset, z + 16, Block1, 0, 3);
|
||||
world.setBlock(x + 4, y + 12 - yOffset, z + 16, Block1, 0, 3);
|
||||
world.setBlock(x + 5, y + 12 - yOffset, z + 16, ModBlocks.red_wire_coated, 0, 3);
|
||||
world.setBlock(x + 6, y + 12 - yOffset, z + 16, Block1, 0, 3);
|
||||
world.setBlock(x + 7, y + 12 - yOffset, z + 16, Block1, 0, 3);
|
||||
world.setBlock(x + 8, y + 12 - yOffset, z + 16, Block1, 0, 3);
|
||||
world.setBlock(x + 9, y + 12 - yOffset, z + 16, Block1, 0, 3);
|
||||
world.setBlock(x + 4, y + 12 - yOffset, z + 17, Block1, 0, 3);
|
||||
world.setBlock(x + 5, y + 12 - yOffset, z + 17, ModBlocks.red_wire_coated, 0, 3);
|
||||
world.setBlock(x + 6, y + 12 - yOffset, z + 17, Block1, 0, 3);
|
||||
world.setBlock(x + 7, y + 12 - yOffset, z + 17, Block1, 0, 3);
|
||||
world.setBlock(x + 8, y + 12 - yOffset, z + 17, Block1, 0, 3);
|
||||
world.setBlock(x + 9, y + 12 - yOffset, z + 17, Block1, 0, 3);
|
||||
world.setBlock(x + 10, y + 12 - yOffset, z + 17, Block1, 0, 3);
|
||||
world.setBlock(x + 5, y + 13 - yOffset, z + 17, Block1, 0, 3);
|
||||
|
||||
generate_r02_last(world, rand, x, y, z, yOffset);
|
||||
return true;
|
||||
|
||||
}
|
||||
public boolean generate_r02_last(World world, Random rand, int x, int y, int z, int yOffset)
|
||||
{
|
||||
|
||||
world.setBlock(x + 4, y + 1 - yOffset, z + 1, Blocks.lever, 3, 3);
|
||||
world.setBlock(x + 6, y + 1 - yOffset, z + 1, Blocks.lever, 3, 3);
|
||||
if(GeneralConfig.enableDebugMode)
|
||||
System.out.print("[Debug] Successfully spawned crashed Vertibird at " + x + " " + y +" " + z + "\n");
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,514 +0,0 @@
|
||||
//Schematic to java Structure by jajo_11 | inspired by "MITHION'S .SCHEMATIC TO JAVA CONVERTINGTOOL"
|
||||
|
||||
package com.hbm.world.dungeon;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.config.GeneralConfig;
|
||||
import com.hbm.itempool.ItemPool;
|
||||
import com.hbm.itempool.ItemPoolsLegacy;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.tileentity.TileEntityChest;
|
||||
import net.minecraft.util.WeightedRandomChestContent;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.gen.feature.WorldGenerator;
|
||||
|
||||
public class Vertibird extends WorldGenerator
|
||||
{
|
||||
Block Block2 = ModBlocks.deco_steel;
|
||||
Block Block1 = ModBlocks.deco_tungsten;
|
||||
Block Block4 = ModBlocks.reinforced_glass;
|
||||
Block Block3 = ModBlocks.deco_titanium;
|
||||
|
||||
protected Block[] GetValidSpawnBlocks()
|
||||
{
|
||||
return new Block[]
|
||||
{
|
||||
Blocks.sand,
|
||||
Blocks.sandstone,
|
||||
};
|
||||
}
|
||||
|
||||
public boolean LocationIsValidSpawn(World world, int x, int y, int z)
|
||||
{
|
||||
|
||||
Block checkBlock = world.getBlock(x, y - 1, z);
|
||||
Block blockAbove = world.getBlock(x, y , z);
|
||||
Block blockBelow = world.getBlock(x, y - 2, z);
|
||||
|
||||
for (Block i : GetValidSpawnBlocks())
|
||||
{
|
||||
if (blockAbove != Blocks.air)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (checkBlock == i)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else if (checkBlock == Blocks.snow_layer && blockBelow == i)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else if (checkBlock.getMaterial() == Material.plants && blockBelow == i)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean generate(World world, Random rand, int x, int y, int z)
|
||||
{
|
||||
int i = rand.nextInt(1);
|
||||
|
||||
if(i == 0)
|
||||
{
|
||||
generate_r0(world, rand, x, y, z);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
public boolean generate_r0(World world, Random rand, int x, int y, int z)
|
||||
{
|
||||
int yOffset = 3 + rand.nextInt(4);
|
||||
|
||||
if(!LocationIsValidSpawn(world, x + 13, y, z + 10))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
world.setBlock(x + 13, y + 0 - yOffset, z + 2, Block1, 0, 3);
|
||||
world.setBlock(x + 12, y + 0 - yOffset, z + 7, Block1, 0, 3);
|
||||
world.setBlock(x + 14, y + 0 - yOffset, z + 7, Block1, 0, 3);
|
||||
world.setBlock(x + 13, y + 0 - yOffset, z + 9, Block1, 0, 3);
|
||||
world.setBlock(x + 12, y + 1 - yOffset, z + 1, Block2, 0, 3);
|
||||
world.setBlock(x + 13, y + 1 - yOffset, z + 1, Block2, 0, 3);
|
||||
world.setBlock(x + 14, y + 1 - yOffset, z + 1, Block2, 0, 3);
|
||||
world.setBlock(x + 12, y + 1 - yOffset, z + 2, Block2, 0, 3);
|
||||
world.setBlock(x + 13, y + 1 - yOffset, z + 2, Block2, 0, 3);
|
||||
world.setBlock(x + 14, y + 1 - yOffset, z + 2, Block2, 0, 3);
|
||||
world.setBlock(x + 11, y + 1 - yOffset, z + 3, Block1, 0, 3);
|
||||
world.setBlock(x + 12, y + 1 - yOffset, z + 3, Block2, 0, 3);
|
||||
world.setBlock(x + 13, y + 1 - yOffset, z + 3, Block2, 0, 3);
|
||||
world.setBlock(x + 14, y + 1 - yOffset, z + 3, Block2, 0, 3);
|
||||
world.setBlock(x + 15, y + 1 - yOffset, z + 3, Block1, 0, 3);
|
||||
world.setBlock(x + 11, y + 1 - yOffset, z + 4, Block1, 0, 3);
|
||||
world.setBlock(x + 12, y + 1 - yOffset, z + 4, Block2, 0, 3);
|
||||
world.setBlock(x + 13, y + 1 - yOffset, z + 4, Block2, 0, 3);
|
||||
world.setBlock(x + 14, y + 1 - yOffset, z + 4, Block2, 0, 3);
|
||||
world.setBlock(x + 15, y + 1 - yOffset, z + 4, Block1, 0, 3);
|
||||
world.setBlock(x + 11, y + 1 - yOffset, z + 5, Block1, 0, 3);
|
||||
world.setBlock(x + 12, y + 1 - yOffset, z + 5, Block2, 0, 3);
|
||||
world.setBlock(x + 13, y + 1 - yOffset, z + 5, Block2, 0, 3);
|
||||
world.setBlock(x + 14, y + 1 - yOffset, z + 5, Block2, 0, 3);
|
||||
world.setBlock(x + 15, y + 1 - yOffset, z + 5, Block1, 0, 3);
|
||||
world.setBlock(x + 12, y + 1 - yOffset, z + 6, Block2, 0, 3);
|
||||
world.setBlock(x + 13, y + 1 - yOffset, z + 6, Block2, 0, 3);
|
||||
world.setBlock(x + 14, y + 1 - yOffset, z + 6, Block2, 0, 3);
|
||||
world.setBlock(x + 12, y + 1 - yOffset, z + 7, Block2, 0, 3);
|
||||
world.setBlock(x + 13, y + 1 - yOffset, z + 7, Block2, 0, 3);
|
||||
world.setBlock(x + 14, y + 1 - yOffset, z + 7, Block2, 0, 3);
|
||||
world.setBlock(x + 12, y + 1 - yOffset, z + 8, Block2, 0, 3);
|
||||
world.setBlock(x + 13, y + 1 - yOffset, z + 8, Block2, 0, 3);
|
||||
world.setBlock(x + 14, y + 1 - yOffset, z + 8, Block2, 0, 3);
|
||||
world.setBlock(x + 12, y + 1 - yOffset, z + 9, Block2, 0, 3);
|
||||
world.setBlock(x + 13, y + 1 - yOffset, z + 9, Block2, 0, 3);
|
||||
world.setBlock(x + 14, y + 1 - yOffset, z + 9, Block2, 0, 3);
|
||||
world.setBlock(x + 12, y + 2 - yOffset, z + 0, Block2, 0, 3);
|
||||
world.setBlock(x + 13, y + 2 - yOffset, z + 0, Block2, 0, 3);
|
||||
world.setBlock(x + 14, y + 2 - yOffset, z + 0, Block2, 0, 3);
|
||||
world.setBlock(x + 11, y + 2 - yOffset, z + 1, Block2, 0, 3);
|
||||
world.setBlock(x + 15, y + 2 - yOffset, z + 1, Block2, 0, 3);
|
||||
world.setBlock(x + 11, y + 2 - yOffset, z + 2, Block2, 0, 3);
|
||||
world.setBlock(x + 12, y + 2 - yOffset, z + 2, Blocks.stone_stairs, 2, 3);
|
||||
world.setBlock(x + 14, y + 2 - yOffset, z + 2, Blocks.stone_stairs, 2, 3);
|
||||
world.setBlock(x + 15, y + 2 - yOffset, z + 2, Block2, 0, 3);
|
||||
world.setBlock(x + 15, y + 2 - yOffset, z + 3, Block3, 0, 3);
|
||||
world.setBlock(x + 15, y + 2 - yOffset, z + 4, Block3, 0, 3);
|
||||
world.setBlock(x + 10, y + 2 - yOffset, z + 5, Block3, 0, 3);
|
||||
world.setBlock(x + 15, y + 2 - yOffset, z + 5, Block3, 0, 3);
|
||||
world.setBlock(x + 10, y + 2 - yOffset, z + 6, Block3, 0, 3);
|
||||
world.setBlock(x + 11, y + 2 - yOffset, z + 6, Block2, 0, 3);
|
||||
world.setBlock(x + 15, y + 2 - yOffset, z + 6, Block2, 0, 3);
|
||||
world.setBlock(x + 10, y + 2 - yOffset, z + 7, Block3, 0, 3);
|
||||
world.setBlock(x + 11, y + 2 - yOffset, z + 7, Block2, 0, 3);
|
||||
world.setBlock(x + 14, y + 2 - yOffset, z + 7, Blocks.chest, 2, 3);
|
||||
if(world.getBlock(x + 14, y + 2 - yOffset, z + 7) == Blocks.chest)
|
||||
{
|
||||
WeightedRandomChestContent.generateChestContents(rand, ItemPool.getPool(ItemPoolsLegacy.POOL_VERTIBIRD), (TileEntityChest)world.getTileEntity(x + 14, y + 2 - yOffset, z + 7), 8);
|
||||
}
|
||||
world.setBlock(x + 15, y + 2 - yOffset, z + 7, Block2, 0, 3);
|
||||
world.setBlock(x + 12, y + 2 - yOffset, z + 8, Block2, 0, 3);
|
||||
world.setBlock(x + 13, y + 2 - yOffset, z + 8, Block2, 0, 3);
|
||||
world.setBlock(x + 14, y + 2 - yOffset, z + 8, Block2, 0, 3);
|
||||
world.setBlock(x + 12, y + 2 - yOffset, z + 9, Block2, 0, 3);
|
||||
world.setBlock(x + 13, y + 2 - yOffset, z + 9, Block3, 0, 3);
|
||||
world.setBlock(x + 14, y + 2 - yOffset, z + 9, Block2, 0, 3);
|
||||
world.setBlock(x + 12, y + 2 - yOffset, z + 10, Block2, 0, 3);
|
||||
world.setBlock(x + 13, y + 2 - yOffset, z + 10, Block2, 0, 3);
|
||||
world.setBlock(x + 14, y + 2 - yOffset, z + 10, Block2, 0, 3);
|
||||
world.setBlock(x + 12, y + 2 - yOffset, z + 11, Block2, 0, 3);
|
||||
world.setBlock(x + 13, y + 2 - yOffset, z + 11, Block2, 0, 3);
|
||||
world.setBlock(x + 14, y + 2 - yOffset, z + 11, Block2, 0, 3);
|
||||
world.setBlock(x + 13, y + 2 - yOffset, z + 18, Block2, 0, 3);
|
||||
world.setBlock(x + 12, y + 3 - yOffset, z + 0, Block4, 0, 3);
|
||||
world.setBlock(x + 13, y + 3 - yOffset, z + 0, Block4, 0, 3);
|
||||
world.setBlock(x + 14, y + 3 - yOffset, z + 0, Block4, 0, 3);
|
||||
world.setBlock(x + 11, y + 3 - yOffset, z + 1, Block4, 0, 3);
|
||||
world.setBlock(x + 15, y + 3 - yOffset, z + 1, Block4, 0, 3);
|
||||
world.setBlock(x + 11, y + 3 - yOffset, z + 2, Block2, 0, 3);
|
||||
world.setBlock(x + 15, y + 3 - yOffset, z + 2, Block2, 0, 3);
|
||||
world.setBlock(x + 11, y + 3 - yOffset, z + 3, Block2, 0, 3);
|
||||
world.setBlock(x + 15, y + 3 - yOffset, z + 3, Block2, 0, 3);
|
||||
world.setBlock(x + 15, y + 3 - yOffset, z + 4, Block3, 0, 3);
|
||||
world.setBlock(x + 15, y + 3 - yOffset, z + 5, Block3, 0, 3);
|
||||
world.setBlock(x + 10, y + 3 - yOffset, z + 6, Block3, 0, 3);
|
||||
world.setBlock(x + 11, y + 3 - yOffset, z + 6, Block2, 0, 3);
|
||||
world.setBlock(x + 15, y + 3 - yOffset, z + 6, Block2, 0, 3);
|
||||
world.setBlock(x + 10, y + 3 - yOffset, z + 7, Block3, 0, 3);
|
||||
world.setBlock(x + 11, y + 3 - yOffset, z + 7, Block2, 0, 3);
|
||||
world.setBlock(x + 15, y + 3 - yOffset, z + 7, Block2, 0, 3);
|
||||
world.setBlock(x + 12, y + 3 - yOffset, z + 8, Block2, 0, 3);
|
||||
world.setBlock(x + 13, y + 3 - yOffset, z + 8, ModBlocks.machine_battery, 2, 3);
|
||||
world.setBlock(x + 14, y + 3 - yOffset, z + 8, Block2, 0, 3);
|
||||
world.setBlock(x + 12, y + 3 - yOffset, z + 9, Block2, 0, 3);
|
||||
world.setBlock(x + 13, y + 3 - yOffset, z + 9, ModBlocks.red_wire_coated, 0, 3);
|
||||
world.setBlock(x + 14, y + 3 - yOffset, z + 9, Block2, 0, 3);
|
||||
world.setBlock(x + 12, y + 3 - yOffset, z + 10, Block2, 0, 3);
|
||||
world.setBlock(x + 13, y + 3 - yOffset, z + 10, Block3, 0, 3);
|
||||
world.setBlock(x + 14, y + 3 - yOffset, z + 10, Block2, 0, 3);
|
||||
world.setBlock(x + 12, y + 3 - yOffset, z + 11, Block2, 0, 3);
|
||||
world.setBlock(x + 13, y + 3 - yOffset, z + 11, Block3, 0, 3);
|
||||
world.setBlock(x + 14, y + 3 - yOffset, z + 11, Block2, 0, 3);
|
||||
world.setBlock(x + 12, y + 3 - yOffset, z + 12, Block2, 0, 3);
|
||||
world.setBlock(x + 13, y + 3 - yOffset, z + 12, Block2, 0, 3);
|
||||
world.setBlock(x + 14, y + 3 - yOffset, z + 12, Block2, 0, 3);
|
||||
world.setBlock(x + 13, y + 3 - yOffset, z + 17, Block2, 0, 3);
|
||||
world.setBlock(x + 13, y + 3 - yOffset, z + 18, Block2, 0, 3);
|
||||
world.setBlock(x + 12, y + 4 - yOffset, z + 0, Block2, 0, 3);
|
||||
world.setBlock(x + 13, y + 4 - yOffset, z + 0, Block2, 0, 3);
|
||||
world.setBlock(x + 14, y + 4 - yOffset, z + 0, Block2, 0, 3);
|
||||
world.setBlock(x + 11, y + 4 - yOffset, z + 1, Block4, 0, 3);
|
||||
world.setBlock(x + 12, y + 4 - yOffset, z + 1, Block2, 0, 3);
|
||||
world.setBlock(x + 13, y + 4 - yOffset, z + 1, Block2, 0, 3);
|
||||
world.setBlock(x + 14, y + 4 - yOffset, z + 1, Block2, 0, 3);
|
||||
world.setBlock(x + 15, y + 4 - yOffset, z + 1, Block4, 0, 3);
|
||||
world.setBlock(x + 11, y + 4 - yOffset, z + 2, Block4, 0, 3);
|
||||
world.setBlock(x + 15, y + 4 - yOffset, z + 2, Block4, 0, 3);
|
||||
world.setBlock(x + 11, y + 4 - yOffset, z + 3, Block2, 0, 3);
|
||||
world.setBlock(x + 15, y + 4 - yOffset, z + 3, Block2, 0, 3);
|
||||
world.setBlock(x + 11, y + 4 - yOffset, z + 4, Block2, 0, 3);
|
||||
world.setBlock(x + 15, y + 4 - yOffset, z + 4, Block2, 0, 3);
|
||||
world.setBlock(x + 4, y + 4 - yOffset, z + 5, Block1, 0, 3);
|
||||
world.setBlock(x + 11, y + 4 - yOffset, z + 5, Block2, 0, 3);
|
||||
world.setBlock(x + 15, y + 4 - yOffset, z + 5, Block2, 0, 3);
|
||||
world.setBlock(x + 22, y + 4 - yOffset, z + 5, Block1, 0, 3);
|
||||
world.setBlock(x + 11, y + 4 - yOffset, z + 6, Block2, 0, 3);
|
||||
world.setBlock(x + 12, y + 4 - yOffset, z + 6, Block2, 0, 3);
|
||||
world.setBlock(x + 14, y + 4 - yOffset, z + 6, Block2, 0, 3);
|
||||
world.setBlock(x + 15, y + 4 - yOffset, z + 6, Block2, 0, 3);
|
||||
world.setBlock(x + 11, y + 4 - yOffset, z + 7, Block2, 0, 3);
|
||||
world.setBlock(x + 12, y + 4 - yOffset, z + 7, Block2, 0, 3);
|
||||
world.setBlock(x + 13, y + 4 - yOffset, z + 7, Block2, 0, 3);
|
||||
world.setBlock(x + 14, y + 4 - yOffset, z + 7, Block2, 0, 3);
|
||||
world.setBlock(x + 15, y + 4 - yOffset, z + 7, Block2, 0, 3);
|
||||
world.setBlock(x + 11, y + 4 - yOffset, z + 8, Block2, 0, 3);
|
||||
world.setBlock(x + 12, y + 4 - yOffset, z + 8, Block2, 0, 3);
|
||||
world.setBlock(x + 13, y + 4 - yOffset, z + 8, Block2, 0, 3);
|
||||
world.setBlock(x + 14, y + 4 - yOffset, z + 8, Block2, 0, 3);
|
||||
world.setBlock(x + 15, y + 4 - yOffset, z + 8, Block2, 0, 3);
|
||||
world.setBlock(x + 11, y + 4 - yOffset, z + 9, Block2, 0, 3);
|
||||
world.setBlock(x + 12, y + 4 - yOffset, z + 9, ModBlocks.block_electrical_scrap, 0, 3);
|
||||
world.setBlock(x + 13, y + 4 - yOffset, z + 9, ModBlocks.red_wire_coated, 0, 3);
|
||||
world.setBlock(x + 14, y + 4 - yOffset, z + 9, ModBlocks.block_electrical_scrap, 0, 3);
|
||||
world.setBlock(x + 15, y + 4 - yOffset, z + 9, Block2, 0, 3);
|
||||
world.setBlock(x + 11, y + 4 - yOffset, z + 10, Block2, 0, 3);
|
||||
world.setBlock(x + 12, y + 4 - yOffset, z + 10, ModBlocks.block_electrical_scrap, 0, 3);
|
||||
world.setBlock(x + 13, y + 4 - yOffset, z + 10, ModBlocks.red_wire_coated, 0, 3);
|
||||
world.setBlock(x + 14, y + 4 - yOffset, z + 10, ModBlocks.block_electrical_scrap, 0, 3);
|
||||
world.setBlock(x + 15, y + 4 - yOffset, z + 10, Block2, 0, 3);
|
||||
world.setBlock(x + 11, y + 4 - yOffset, z + 11, Block2, 0, 3);
|
||||
world.setBlock(x + 12, y + 4 - yOffset, z + 11, Block2, 0, 3);
|
||||
world.setBlock(x + 13, y + 4 - yOffset, z + 11, Block3, 0, 3);
|
||||
world.setBlock(x + 14, y + 4 - yOffset, z + 11, Block2, 0, 3);
|
||||
world.setBlock(x + 15, y + 4 - yOffset, z + 11, Block2, 0, 3);
|
||||
world.setBlock(x + 11, y + 4 - yOffset, z + 12, Block2, 0, 3);
|
||||
world.setBlock(x + 12, y + 4 - yOffset, z + 12, Block2, 0, 3);
|
||||
world.setBlock(x + 13, y + 4 - yOffset, z + 12, Block3, 0, 3);
|
||||
world.setBlock(x + 14, y + 4 - yOffset, z + 12, Block2, 0, 3);
|
||||
world.setBlock(x + 15, y + 4 - yOffset, z + 12, Block2, 0, 3);
|
||||
world.setBlock(x + 12, y + 4 - yOffset, z + 13, Block2, 0, 3);
|
||||
world.setBlock(x + 13, y + 4 - yOffset, z + 13, Block2, 0, 3);
|
||||
world.setBlock(x + 14, y + 4 - yOffset, z + 13, Block2, 0, 3);
|
||||
world.setBlock(x + 13, y + 4 - yOffset, z + 14, Block2, 0, 3);
|
||||
world.setBlock(x + 13, y + 4 - yOffset, z + 15, Block2, 0, 3);
|
||||
world.setBlock(x + 13, y + 4 - yOffset, z + 16, Block2, 0, 3);
|
||||
world.setBlock(x + 13, y + 4 - yOffset, z + 17, Block2, 0, 3);
|
||||
world.setBlock(x + 13, y + 4 - yOffset, z + 18, Block2, 0, 3);
|
||||
world.setBlock(x + 12, y + 5 - yOffset, z + 1, Block2, 0, 3);
|
||||
world.setBlock(x + 13, y + 5 - yOffset, z + 1, Block2, 0, 3);
|
||||
world.setBlock(x + 14, y + 5 - yOffset, z + 1, Block2, 0, 3);
|
||||
world.setBlock(x + 12, y + 5 - yOffset, z + 2, Block2, 0, 3);
|
||||
world.setBlock(x + 13, y + 5 - yOffset, z + 2, Block2, 0, 3);
|
||||
world.setBlock(x + 14, y + 5 - yOffset, z + 2, Block2, 0, 3);
|
||||
world.setBlock(x + 11, y + 5 - yOffset, z + 3, Block2, 0, 3);
|
||||
world.setBlock(x + 12, y + 5 - yOffset, z + 3, Block2, 0, 3);
|
||||
world.setBlock(x + 13, y + 5 - yOffset, z + 3, Block2, 0, 3);
|
||||
world.setBlock(x + 14, y + 5 - yOffset, z + 3, Block2, 0, 3);
|
||||
world.setBlock(x + 15, y + 5 - yOffset, z + 3, Block2, 0, 3);
|
||||
world.setBlock(x + 4, y + 5 - yOffset, z + 4, Block2, 0, 3);
|
||||
world.setBlock(x + 11, y + 5 - yOffset, z + 4, Block2, 0, 3);
|
||||
world.setBlock(x + 12, y + 5 - yOffset, z + 4, Block2, 0, 3);
|
||||
world.setBlock(x + 13, y + 5 - yOffset, z + 4, Block2, 0, 3);
|
||||
world.setBlock(x + 14, y + 5 - yOffset, z + 4, Block2, 0, 3);
|
||||
world.setBlock(x + 15, y + 5 - yOffset, z + 4, Block2, 0, 3);
|
||||
world.setBlock(x + 22, y + 5 - yOffset, z + 4, Block2, 0, 3);
|
||||
world.setBlock(x + 3, y + 5 - yOffset, z + 5, Block2, 0, 3);
|
||||
world.setBlock(x + 4, y + 5 - yOffset, z + 5, Block1, 0, 3);
|
||||
world.setBlock(x + 5, y + 5 - yOffset, z + 5, Block2, 0, 3);
|
||||
world.setBlock(x + 8, y + 5 - yOffset, z + 5, Block2, 0, 3);
|
||||
world.setBlock(x + 9, y + 5 - yOffset, z + 5, Block2, 0, 3);
|
||||
world.setBlock(x + 10, y + 5 - yOffset, z + 5, Block2, 0, 3);
|
||||
world.setBlock(x + 11, y + 5 - yOffset, z + 5, Block2, 0, 3);
|
||||
world.setBlock(x + 12, y + 5 - yOffset, z + 5, Block2, 0, 3);
|
||||
world.setBlock(x + 13, y + 5 - yOffset, z + 5, Block2, 0, 3);
|
||||
world.setBlock(x + 14, y + 5 - yOffset, z + 5, Block2, 0, 3);
|
||||
world.setBlock(x + 15, y + 5 - yOffset, z + 5, Block2, 0, 3);
|
||||
world.setBlock(x + 16, y + 5 - yOffset, z + 5, Block2, 0, 3);
|
||||
world.setBlock(x + 17, y + 5 - yOffset, z + 5, Block2, 0, 3);
|
||||
world.setBlock(x + 18, y + 5 - yOffset, z + 5, Block2, 0, 3);
|
||||
world.setBlock(x + 21, y + 5 - yOffset, z + 5, Block2, 0, 3);
|
||||
world.setBlock(x + 22, y + 5 - yOffset, z + 5, Block1, 0, 3);
|
||||
world.setBlock(x + 23, y + 5 - yOffset, z + 5, Block2, 0, 3);
|
||||
world.setBlock(x + 4, y + 5 - yOffset, z + 6, Block2, 0, 3);
|
||||
world.setBlock(x + 11, y + 5 - yOffset, z + 6, Block2, 0, 3);
|
||||
world.setBlock(x + 12, y + 5 - yOffset, z + 6, Block2, 0, 3);
|
||||
world.setBlock(x + 13, y + 5 - yOffset, z + 6, Block2, 0, 3);
|
||||
world.setBlock(x + 14, y + 5 - yOffset, z + 6, Block2, 0, 3);
|
||||
world.setBlock(x + 15, y + 5 - yOffset, z + 6, Block2, 0, 3);
|
||||
world.setBlock(x + 22, y + 5 - yOffset, z + 6, Block2, 0, 3);
|
||||
world.setBlock(x + 11, y + 5 - yOffset, z + 7, Block2, 0, 3);
|
||||
world.setBlock(x + 12, y + 5 - yOffset, z + 7, Block2, 0, 3);
|
||||
world.setBlock(x + 13, y + 5 - yOffset, z + 7, Block2, 0, 3);
|
||||
world.setBlock(x + 14, y + 5 - yOffset, z + 7, Block2, 0, 3);
|
||||
world.setBlock(x + 15, y + 5 - yOffset, z + 7, Block2, 0, 3);
|
||||
world.setBlock(x + 11, y + 5 - yOffset, z + 8, Block2, 0, 3);
|
||||
world.setBlock(x + 12, y + 5 - yOffset, z + 8, Block2, 0, 3);
|
||||
world.setBlock(x + 13, y + 5 - yOffset, z + 8, Block2, 0, 3);
|
||||
world.setBlock(x + 14, y + 5 - yOffset, z + 8, Block2, 0, 3);
|
||||
world.setBlock(x + 15, y + 5 - yOffset, z + 8, Block2, 0, 3);
|
||||
world.setBlock(x + 11, y + 5 - yOffset, z + 9, Block2, 0, 3);
|
||||
world.setBlock(x + 12, y + 5 - yOffset, z + 9, ModBlocks.block_electrical_scrap, 0, 3);
|
||||
world.setBlock(x + 13, y + 5 - yOffset, z + 9, ModBlocks.red_wire_coated, 0, 3);
|
||||
world.setBlock(x + 14, y + 5 - yOffset, z + 9, ModBlocks.block_electrical_scrap, 0, 3);
|
||||
world.setBlock(x + 15, y + 5 - yOffset, z + 9, Block2, 0, 3);
|
||||
world.setBlock(x + 11, y + 5 - yOffset, z + 10, Block2, 0, 3);
|
||||
world.setBlock(x + 12, y + 5 - yOffset, z + 10, ModBlocks.block_electrical_scrap, 0, 3);
|
||||
world.setBlock(x + 13, y + 5 - yOffset, z + 10, ModBlocks.red_wire_coated, 0, 3);
|
||||
world.setBlock(x + 14, y + 5 - yOffset, z + 10, ModBlocks.block_electrical_scrap, 0, 3);
|
||||
world.setBlock(x + 15, y + 5 - yOffset, z + 10, Block2, 0, 3);
|
||||
world.setBlock(x + 12, y + 5 - yOffset, z + 11, Block2, 0, 3);
|
||||
world.setBlock(x + 13, y + 5 - yOffset, z + 11, ModBlocks.red_wire_coated, 0, 3);
|
||||
world.setBlock(x + 14, y + 5 - yOffset, z + 11, Block2, 0, 3);
|
||||
world.setBlock(x + 12, y + 5 - yOffset, z + 12, Block2, 0, 3);
|
||||
world.setBlock(x + 13, y + 5 - yOffset, z + 12, ModBlocks.red_wire_coated, 0, 3);
|
||||
world.setBlock(x + 14, y + 5 - yOffset, z + 12, Block2, 0, 3);
|
||||
world.setBlock(x + 12, y + 5 - yOffset, z + 13, Block2, 0, 3);
|
||||
world.setBlock(x + 13, y + 5 - yOffset, z + 13, ModBlocks.red_wire_coated, 0, 3);
|
||||
world.setBlock(x + 14, y + 5 - yOffset, z + 13, Block2, 0, 3);
|
||||
world.setBlock(x + 12, y + 5 - yOffset, z + 14, Block2, 0, 3);
|
||||
world.setBlock(x + 13, y + 5 - yOffset, z + 14, ModBlocks.red_wire_coated, 0, 3);
|
||||
world.setBlock(x + 14, y + 5 - yOffset, z + 14, Block2, 0, 3);
|
||||
world.setBlock(x + 12, y + 5 - yOffset, z + 15, Block2, 0, 3);
|
||||
world.setBlock(x + 13, y + 5 - yOffset, z + 15, ModBlocks.red_wire_coated, 0, 3);
|
||||
world.setBlock(x + 14, y + 5 - yOffset, z + 15, Block2, 0, 3);
|
||||
world.setBlock(x + 9, y + 5 - yOffset, z + 16, Block2, 0, 3);
|
||||
world.setBlock(x + 10, y + 5 - yOffset, z + 16, Block2, 0, 3);
|
||||
world.setBlock(x + 11, y + 5 - yOffset, z + 16, Block2, 0, 3);
|
||||
world.setBlock(x + 12, y + 5 - yOffset, z + 16, Block2, 0, 3);
|
||||
world.setBlock(x + 13, y + 5 - yOffset, z + 16, ModBlocks.red_wire_coated, 0, 3);
|
||||
world.setBlock(x + 14, y + 5 - yOffset, z + 16, Block2, 0, 3);
|
||||
world.setBlock(x + 15, y + 5 - yOffset, z + 16, Block2, 0, 3);
|
||||
world.setBlock(x + 16, y + 5 - yOffset, z + 16, Block2, 0, 3);
|
||||
world.setBlock(x + 17, y + 5 - yOffset, z + 16, Block2, 0, 3);
|
||||
world.setBlock(x + 8, y + 5 - yOffset, z + 17, Block2, 0, 3);
|
||||
world.setBlock(x + 9, y + 5 - yOffset, z + 17, Block2, 0, 3);
|
||||
world.setBlock(x + 10, y + 5 - yOffset, z + 17, Block2, 0, 3);
|
||||
world.setBlock(x + 11, y + 5 - yOffset, z + 17, Block2, 0, 3);
|
||||
world.setBlock(x + 12, y + 5 - yOffset, z + 17, Block2, 0, 3);
|
||||
world.setBlock(x + 13, y + 5 - yOffset, z + 17, ModBlocks.red_wire_coated, 0, 3);
|
||||
world.setBlock(x + 14, y + 5 - yOffset, z + 17, Block2, 0, 3);
|
||||
world.setBlock(x + 15, y + 5 - yOffset, z + 17, Block2, 0, 3);
|
||||
world.setBlock(x + 16, y + 5 - yOffset, z + 17, Block2, 0, 3);
|
||||
world.setBlock(x + 17, y + 5 - yOffset, z + 17, Block2, 0, 3);
|
||||
world.setBlock(x + 18, y + 5 - yOffset, z + 17, Block2, 0, 3);
|
||||
world.setBlock(x + 12, y + 5 - yOffset, z + 18, Block2, 0, 3);
|
||||
world.setBlock(x + 13, y + 5 - yOffset, z + 18, ModBlocks.red_wire_coated, 0, 3);
|
||||
world.setBlock(x + 14, y + 5 - yOffset, z + 18, Block2, 0, 3);
|
||||
world.setBlock(x + 13, y + 5 - yOffset, z + 19, Block1, 0, 3);
|
||||
world.setBlock(x + 12, y + 6 - yOffset, z + 1, Block1, 0, 3);
|
||||
world.setBlock(x + 14, y + 6 - yOffset, z + 1, Block1, 0, 3);
|
||||
world.setBlock(x + 12, y + 6 - yOffset, z + 3, Block2, 0, 3);
|
||||
world.setBlock(x + 13, y + 6 - yOffset, z + 3, Block2, 0, 3);
|
||||
world.setBlock(x + 14, y + 6 - yOffset, z + 3, Block2, 0, 3);
|
||||
world.setBlock(x + 4, y + 6 - yOffset, z + 4, Block2, 0, 3);
|
||||
world.setBlock(x + 11, y + 6 - yOffset, z + 4, Block2, 0, 3);
|
||||
world.setBlock(x + 12, y + 6 - yOffset, z + 4, Block2, 0, 3);
|
||||
world.setBlock(x + 13, y + 6 - yOffset, z + 4, Block2, 0, 3);
|
||||
world.setBlock(x + 14, y + 6 - yOffset, z + 4, Block2, 0, 3);
|
||||
world.setBlock(x + 15, y + 6 - yOffset, z + 4, Block2, 0, 3);
|
||||
world.setBlock(x + 22, y + 6 - yOffset, z + 4, Block2, 0, 3);
|
||||
world.setBlock(x + 3, y + 6 - yOffset, z + 5, Block2, 0, 3);
|
||||
world.setBlock(x + 4, y + 6 - yOffset, z + 5, Block1, 0, 3);
|
||||
world.setBlock(x + 5, y + 6 - yOffset, z + 5, Block2, 0, 3);
|
||||
world.setBlock(x + 6, y + 6 - yOffset, z + 5, Block2, 0, 3);
|
||||
world.setBlock(x + 7, y + 6 - yOffset, z + 5, Block2, 0, 3);
|
||||
world.setBlock(x + 8, y + 6 - yOffset, z + 5, Block2, 0, 3);
|
||||
world.setBlock(x + 9, y + 6 - yOffset, z + 5, Block2, 0, 3);
|
||||
world.setBlock(x + 10, y + 6 - yOffset, z + 5, Block2, 0, 3);
|
||||
world.setBlock(x + 11, y + 6 - yOffset, z + 5, Block2, 0, 3);
|
||||
world.setBlock(x + 12, y + 6 - yOffset, z + 5, Block2, 0, 3);
|
||||
world.setBlock(x + 13, y + 6 - yOffset, z + 5, Block2, 0, 3);
|
||||
world.setBlock(x + 14, y + 6 - yOffset, z + 5, Block2, 0, 3);
|
||||
world.setBlock(x + 15, y + 6 - yOffset, z + 5, Block2, 0, 3);
|
||||
world.setBlock(x + 16, y + 6 - yOffset, z + 5, Block2, 0, 3);
|
||||
world.setBlock(x + 17, y + 6 - yOffset, z + 5, Block2, 0, 3);
|
||||
world.setBlock(x + 18, y + 6 - yOffset, z + 5, Block2, 0, 3);
|
||||
world.setBlock(x + 19, y + 6 - yOffset, z + 5, Block2, 0, 3);
|
||||
world.setBlock(x + 20, y + 6 - yOffset, z + 5, Block2, 0, 3);
|
||||
world.setBlock(x + 21, y + 6 - yOffset, z + 5, Block2, 0, 3);
|
||||
world.setBlock(x + 22, y + 6 - yOffset, z + 5, Block1, 0, 3);
|
||||
world.setBlock(x + 23, y + 6 - yOffset, z + 5, Block2, 0, 3);
|
||||
world.setBlock(x + 4, y + 6 - yOffset, z + 6, Block2, 0, 3);
|
||||
world.setBlock(x + 11, y + 6 - yOffset, z + 6, Block2, 0, 3);
|
||||
world.setBlock(x + 12, y + 6 - yOffset, z + 6, Block2, 0, 3);
|
||||
world.setBlock(x + 13, y + 6 - yOffset, z + 6, Blocks.chest, 2, 3);
|
||||
if(world.getBlock(x + 13, y + 6 - yOffset, z + 6) == Blocks.chest)
|
||||
{
|
||||
WeightedRandomChestContent.generateChestContents(rand, ItemPool.getPool(ItemPoolsLegacy.POOL_VERTIBIRD), (TileEntityChest)world.getTileEntity(x + 13, y + 6 - yOffset, z + 6), 8);
|
||||
}
|
||||
world.setBlock(x + 14, y + 6 - yOffset, z + 6, Block2, 0, 3);
|
||||
world.setBlock(x + 15, y + 6 - yOffset, z + 6, Block2, 0, 3);
|
||||
world.setBlock(x + 22, y + 6 - yOffset, z + 6, Block2, 0, 3);
|
||||
world.setBlock(x + 11, y + 6 - yOffset, z + 7, Block2, 0, 3);
|
||||
world.setBlock(x + 12, y + 6 - yOffset, z + 7, Block2, 0, 3);
|
||||
world.setBlock(x + 13, y + 6 - yOffset, z + 7, Block2, 0, 3);
|
||||
world.setBlock(x + 14, y + 6 - yOffset, z + 7, Block2, 0, 3);
|
||||
world.setBlock(x + 15, y + 6 - yOffset, z + 7, Block2, 0, 3);
|
||||
world.setBlock(x + 11, y + 6 - yOffset, z + 8, Block2, 0, 3);
|
||||
world.setBlock(x + 12, y + 6 - yOffset, z + 8, Block2, 0, 3);
|
||||
world.setBlock(x + 13, y + 6 - yOffset, z + 8, Block2, 0, 3);
|
||||
world.setBlock(x + 14, y + 6 - yOffset, z + 8, Block2, 0, 3);
|
||||
world.setBlock(x + 15, y + 6 - yOffset, z + 8, Block2, 0, 3);
|
||||
world.setBlock(x + 12, y + 6 - yOffset, z + 9, Block2, 0, 3);
|
||||
world.setBlock(x + 13, y + 6 - yOffset, z + 9, Block3, 0, 3);
|
||||
world.setBlock(x + 14, y + 6 - yOffset, z + 9, Block2, 0, 3);
|
||||
world.setBlock(x + 12, y + 6 - yOffset, z + 10, Block2, 0, 3);
|
||||
world.setBlock(x + 13, y + 6 - yOffset, z + 10, Block3, 0, 3);
|
||||
world.setBlock(x + 14, y + 6 - yOffset, z + 10, Block2, 0, 3);
|
||||
world.setBlock(x + 12, y + 6 - yOffset, z + 11, Block2, 0, 3);
|
||||
world.setBlock(x + 13, y + 6 - yOffset, z + 11, Block2, 0, 3);
|
||||
world.setBlock(x + 14, y + 6 - yOffset, z + 11, Block2, 0, 3);
|
||||
world.setBlock(x + 12, y + 6 - yOffset, z + 12, Block2, 0, 3);
|
||||
world.setBlock(x + 13, y + 6 - yOffset, z + 12, Block2, 0, 3);
|
||||
world.setBlock(x + 14, y + 6 - yOffset, z + 12, Block2, 0, 3);
|
||||
world.setBlock(x + 13, y + 6 - yOffset, z + 13, Block2, 0, 3);
|
||||
world.setBlock(x + 13, y + 6 - yOffset, z + 14, Block2, 0, 3);
|
||||
world.setBlock(x + 13, y + 6 - yOffset, z + 17, Block2, 0, 3);
|
||||
world.setBlock(x + 13, y + 6 - yOffset, z + 18, Block2, 0, 3);
|
||||
world.setBlock(x + 4, y + 7 - yOffset, z + 4, Block2, 0, 3);
|
||||
world.setBlock(x + 13, y + 7 - yOffset, z + 4, Block2, 0, 3);
|
||||
world.setBlock(x + 22, y + 7 - yOffset, z + 4, Block2, 0, 3);
|
||||
world.setBlock(x + 3, y + 7 - yOffset, z + 5, Block2, 0, 3);
|
||||
world.setBlock(x + 4, y + 7 - yOffset, z + 5, Block1, 0, 3);
|
||||
world.setBlock(x + 5, y + 7 - yOffset, z + 5, Block2, 0, 3);
|
||||
world.setBlock(x + 12, y + 7 - yOffset, z + 5, Block2, 0, 3);
|
||||
world.setBlock(x + 13, y + 7 - yOffset, z + 5, Block2, 0, 3);
|
||||
world.setBlock(x + 14, y + 7 - yOffset, z + 5, Block2, 0, 3);
|
||||
world.setBlock(x + 21, y + 7 - yOffset, z + 5, Block2, 0, 3);
|
||||
world.setBlock(x + 22, y + 7 - yOffset, z + 5, Block1, 0, 3);
|
||||
world.setBlock(x + 23, y + 7 - yOffset, z + 5, Block2, 0, 3);
|
||||
world.setBlock(x + 4, y + 7 - yOffset, z + 6, Block2, 0, 3);
|
||||
world.setBlock(x + 12, y + 7 - yOffset, z + 6, Block2, 0, 3);
|
||||
world.setBlock(x + 13, y + 7 - yOffset, z + 6, Block2, 0, 3);
|
||||
world.setBlock(x + 14, y + 7 - yOffset, z + 6, Block2, 0, 3);
|
||||
world.setBlock(x + 22, y + 7 - yOffset, z + 6, Block2, 0, 3);
|
||||
world.setBlock(x + 12, y + 7 - yOffset, z + 7, Block2, 0, 3);
|
||||
world.setBlock(x + 13, y + 7 - yOffset, z + 7, Block2, 0, 3);
|
||||
world.setBlock(x + 14, y + 7 - yOffset, z + 7, Block2, 0, 3);
|
||||
world.setBlock(x + 12, y + 7 - yOffset, z + 8, Block2, 0, 3);
|
||||
world.setBlock(x + 13, y + 7 - yOffset, z + 8, Block2, 0, 3);
|
||||
world.setBlock(x + 14, y + 7 - yOffset, z + 8, Block2, 0, 3);
|
||||
world.setBlock(x + 13, y + 7 - yOffset, z + 9, Block2, 0, 3);
|
||||
world.setBlock(x + 13, y + 7 - yOffset, z + 10, Block2, 0, 3);
|
||||
world.setBlock(x + 13, y + 7 - yOffset, z + 11, Block2, 0, 3);
|
||||
world.setBlock(x + 4, y + 8 - yOffset, z + 4, Block2, 0, 3);
|
||||
world.setBlock(x + 22, y + 8 - yOffset, z + 4, Block2, 0, 3);
|
||||
world.setBlock(x + 3, y + 8 - yOffset, z + 5, Block2, 0, 3);
|
||||
world.setBlock(x + 4, y + 8 - yOffset, z + 5, Block1, 0, 3);
|
||||
world.setBlock(x + 5, y + 8 - yOffset, z + 5, Block2, 0, 3);
|
||||
world.setBlock(x + 21, y + 8 - yOffset, z + 5, Block2, 0, 3);
|
||||
world.setBlock(x + 22, y + 8 - yOffset, z + 5, Block1, 0, 3);
|
||||
world.setBlock(x + 23, y + 8 - yOffset, z + 5, Block2, 0, 3);
|
||||
world.setBlock(x + 4, y + 8 - yOffset, z + 6, Block2, 0, 3);
|
||||
world.setBlock(x + 22, y + 8 - yOffset, z + 6, Block2, 0, 3);
|
||||
world.setBlock(x + 4, y + 9 - yOffset, z + 5, Block1, 0, 3);
|
||||
world.setBlock(x + 22, y + 9 - yOffset, z + 5, Block1, 0, 3);
|
||||
world.setBlock(x + 4, y + 10 - yOffset, z + 1, Block3, 0, 3);
|
||||
world.setBlock(x + 22, y + 10 - yOffset, z + 1, Block3, 0, 3);
|
||||
world.setBlock(x + 4, y + 10 - yOffset, z + 2, Block3, 0, 3);
|
||||
world.setBlock(x + 22, y + 10 - yOffset, z + 2, Block3, 0, 3);
|
||||
world.setBlock(x + 4, y + 10 - yOffset, z + 3, Block3, 0, 3);
|
||||
world.setBlock(x + 22, y + 10 - yOffset, z + 3, Block3, 0, 3);
|
||||
world.setBlock(x + 4, y + 10 - yOffset, z + 4, Block3, 0, 3);
|
||||
world.setBlock(x + 22, y + 10 - yOffset, z + 4, Block3, 0, 3);
|
||||
world.setBlock(x + 0, y + 10 - yOffset, z + 5, Block3, 0, 3);
|
||||
world.setBlock(x + 1, y + 10 - yOffset, z + 5, Block3, 0, 3);
|
||||
world.setBlock(x + 2, y + 10 - yOffset, z + 5, Block3, 0, 3);
|
||||
world.setBlock(x + 3, y + 10 - yOffset, z + 5, Block3, 0, 3);
|
||||
world.setBlock(x + 4, y + 10 - yOffset, z + 5, Block1, 0, 3);
|
||||
world.setBlock(x + 5, y + 10 - yOffset, z + 5, Block3, 0, 3);
|
||||
world.setBlock(x + 6, y + 10 - yOffset, z + 5, Block3, 0, 3);
|
||||
world.setBlock(x + 7, y + 10 - yOffset, z + 5, Block3, 0, 3);
|
||||
world.setBlock(x + 8, y + 10 - yOffset, z + 5, Block3, 0, 3);
|
||||
world.setBlock(x + 18, y + 10 - yOffset, z + 5, Block3, 0, 3);
|
||||
world.setBlock(x + 19, y + 10 - yOffset, z + 5, Block3, 0, 3);
|
||||
world.setBlock(x + 20, y + 10 - yOffset, z + 5, Block3, 0, 3);
|
||||
world.setBlock(x + 21, y + 10 - yOffset, z + 5, Block3, 0, 3);
|
||||
world.setBlock(x + 22, y + 10 - yOffset, z + 5, Block1, 0, 3);
|
||||
world.setBlock(x + 23, y + 10 - yOffset, z + 5, Block3, 0, 3);
|
||||
world.setBlock(x + 24, y + 10 - yOffset, z + 5, Block3, 0, 3);
|
||||
world.setBlock(x + 25, y + 10 - yOffset, z + 5, Block3, 0, 3);
|
||||
world.setBlock(x + 26, y + 10 - yOffset, z + 5, Block3, 0, 3);
|
||||
world.setBlock(x + 4, y + 10 - yOffset, z + 6, Block3, 0, 3);
|
||||
world.setBlock(x + 22, y + 10 - yOffset, z + 6, Block3, 0, 3);
|
||||
world.setBlock(x + 4, y + 10 - yOffset, z + 7, Block3, 0, 3);
|
||||
world.setBlock(x + 22, y + 10 - yOffset, z + 7, Block3, 0, 3);
|
||||
world.setBlock(x + 4, y + 10 - yOffset, z + 8, Block3, 0, 3);
|
||||
world.setBlock(x + 22, y + 10 - yOffset, z + 8, Block3, 0, 3);
|
||||
world.setBlock(x + 4, y + 10 - yOffset, z + 9, Block3, 0, 3);
|
||||
world.setBlock(x + 22, y + 10 - yOffset, z + 9, Block3, 0, 3);
|
||||
|
||||
generate_r02_last(world, rand, x, y, z, yOffset);
|
||||
return true;
|
||||
|
||||
}
|
||||
public boolean generate_r02_last(World world, Random rand, int x, int y, int z, int yOffset)
|
||||
{
|
||||
|
||||
world.setBlock(x + 12, y + 2 - yOffset, z + 1, Blocks.lever, 3, 3);
|
||||
world.setBlock(x + 14, y + 2 - yOffset, z + 1, Blocks.lever, 3, 3);
|
||||
if(GeneralConfig.enableDebugMode)
|
||||
System.out.print("[Debug] Successfully spawned Vertibird at " + x + " " + y +" " + z + "\n");
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,14 @@
|
||||
package com.hbm.world.gen;
|
||||
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public interface INBTTileEntityTransformable {
|
||||
|
||||
/**
|
||||
* Like INBTTransformable but for TileEntities, like for randomizing bobbleheads
|
||||
*/
|
||||
|
||||
// Allows for the TE to modify itself when spawned in an NBT structure
|
||||
public void transformTE(World world, int coordBaseMode);
|
||||
|
||||
}
|
||||
161
src/main/java/com/hbm/world/gen/INBTTransformable.java
Normal file
161
src/main/java/com/hbm/world/gen/INBTTransformable.java
Normal file
@ -0,0 +1,161 @@
|
||||
package com.hbm.world.gen;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
|
||||
public interface INBTTransformable {
|
||||
|
||||
/**
|
||||
* Defines this block as something that has a rotation or some other blockstate
|
||||
* which needs transformations applied when building from an .nbt structure file
|
||||
*/
|
||||
|
||||
// Takes the block current meta and translates it into a rotated meta
|
||||
public int transformMeta(int meta, int coordBaseMode);
|
||||
|
||||
// Takes the block and turns it into a different block entirely, to turn off lights, shit like that
|
||||
public default Block transformBlock(Block block) {
|
||||
return block;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* A fair few blocks have generalized rotations so, since we have all this space, put em here
|
||||
*/
|
||||
|
||||
public static int transformMetaDeco(int meta, int coordBaseMode) {
|
||||
switch(coordBaseMode) {
|
||||
case 1: //West
|
||||
switch(meta) {
|
||||
case 2: return 5;
|
||||
case 3: return 4;
|
||||
case 4: return 2;
|
||||
case 5: return 3;
|
||||
}
|
||||
case 2: //North
|
||||
switch(meta) {
|
||||
case 2: return 3;
|
||||
case 3: return 2;
|
||||
case 4: return 5;
|
||||
case 5: return 4;
|
||||
}
|
||||
case 3: //East
|
||||
switch(meta) {
|
||||
case 2: return 4;
|
||||
case 3: return 5;
|
||||
case 4: return 3;
|
||||
case 5: return 2;
|
||||
}
|
||||
}
|
||||
return meta;
|
||||
}
|
||||
|
||||
public static int transformMetaDecoModel(int meta, int coordBaseMode) {
|
||||
int rot = (meta + coordBaseMode) % 4;
|
||||
int type = (meta / 4) * 4;
|
||||
|
||||
return rot | type;
|
||||
}
|
||||
|
||||
public static int transformMetaStairs(int meta, int coordBaseMode) {
|
||||
switch(coordBaseMode) {
|
||||
case 1: //West
|
||||
if((meta & 3) < 2) //Flip second bit for E/W
|
||||
meta = meta ^ 2;
|
||||
else
|
||||
meta = meta ^ 3; //Flip both bits for N/S
|
||||
break;
|
||||
case 2: //North
|
||||
meta = meta ^ 1; //Flip first bit
|
||||
break;
|
||||
case 3: //East
|
||||
if((meta & 3) < 2) //Flip both bits for E/W
|
||||
meta = meta ^ 3;
|
||||
else //Flip second bit for N/S
|
||||
meta = meta ^ 2;
|
||||
break;
|
||||
}
|
||||
|
||||
return meta;
|
||||
}
|
||||
|
||||
public static int transformMetaPillar(int meta, int coordBaseMode) {
|
||||
if(coordBaseMode == 2) return meta;
|
||||
int type = meta & 3;
|
||||
int rot = meta & 12;
|
||||
|
||||
if(rot == 4) return type | 8;
|
||||
if(rot == 8) return type | 4;
|
||||
|
||||
return meta;
|
||||
}
|
||||
|
||||
public static int transformMetaDirectional(int meta, int coordBaseMode) {
|
||||
int rot = meta & 3;
|
||||
int other = meta & 12;
|
||||
|
||||
switch(coordBaseMode) {
|
||||
default: //S
|
||||
break;
|
||||
case 1: //W
|
||||
rot = (rot + 1) % 4; break;
|
||||
case 2: //N
|
||||
rot ^= 2; break;
|
||||
case 3: //E
|
||||
rot = (rot + 3) % 4; break;
|
||||
}
|
||||
|
||||
return other | rot;
|
||||
}
|
||||
|
||||
public static int transformMetaTorch(int meta, int coordBaseMode) {
|
||||
switch(coordBaseMode) {
|
||||
case 1: //West
|
||||
switch(meta) {
|
||||
case 1: return 3;
|
||||
case 2: return 4;
|
||||
case 3: return 2;
|
||||
case 4: return 1;
|
||||
}
|
||||
case 2: //North
|
||||
switch(meta) {
|
||||
case 1: return 2;
|
||||
case 2: return 1;
|
||||
case 3: return 4;
|
||||
case 4: return 3;
|
||||
}
|
||||
case 3: //East
|
||||
switch(meta) {
|
||||
case 1: return 4;
|
||||
case 2: return 3;
|
||||
case 3: return 1;
|
||||
case 4: return 2;
|
||||
}
|
||||
}
|
||||
return meta;
|
||||
}
|
||||
|
||||
public static int transformMetaDoor(int meta, int coordBaseMode) {
|
||||
if(meta == 8 || meta == 9) return meta; // ignore top parts
|
||||
|
||||
return transformMetaDirectional(meta, coordBaseMode);
|
||||
}
|
||||
|
||||
public static int transformMetaLever(int meta, int coordBaseMode) {
|
||||
if(meta <= 0 || meta >= 7) { //levers suck ass
|
||||
switch(coordBaseMode) {
|
||||
case 1: case 3: //west / east
|
||||
meta ^= 0b111;
|
||||
}
|
||||
} else if(meta >= 5) {
|
||||
switch(coordBaseMode) {
|
||||
case 1: case 3: //west / east
|
||||
meta = (meta + 1) % 2 + 5;
|
||||
}
|
||||
} else {
|
||||
meta = transformMetaTorch(meta, coordBaseMode);
|
||||
}
|
||||
|
||||
return meta;
|
||||
}
|
||||
|
||||
}
|
||||
1167
src/main/java/com/hbm/world/gen/NBTStructure.java
Normal file
1167
src/main/java/com/hbm/world/gen/NBTStructure.java
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,8 +1,22 @@
|
||||
package com.hbm.world.gen;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.config.StructureConfig;
|
||||
import com.hbm.main.StructureManager;
|
||||
import com.hbm.world.gen.NBTStructure.JigsawPiece;
|
||||
import com.hbm.world.gen.NBTStructure.JigsawPool;
|
||||
import com.hbm.world.gen.NBTStructure.SpawnCondition;
|
||||
import com.hbm.world.gen.component.BunkerComponents.BunkerStart;
|
||||
import com.hbm.world.gen.component.Component.CrabSpawners;
|
||||
import com.hbm.world.gen.component.Component.GreenOoze;
|
||||
import com.hbm.world.gen.component.Component.MeteorBricks;
|
||||
import com.hbm.world.gen.component.Component.SupplyCrates;
|
||||
|
||||
import cpw.mods.fml.common.IWorldGenerator;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
@ -10,125 +24,181 @@ import net.minecraft.block.Block;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
import net.minecraft.world.chunk.IChunkProvider;
|
||||
import static net.minecraftforge.common.BiomeDictionary.*;
|
||||
import net.minecraft.world.gen.structure.StructureComponent.BlockSelector;
|
||||
import net.minecraftforge.event.terraingen.InitMapGenEvent.EventType;
|
||||
import net.minecraftforge.event.terraingen.PopulateChunkEvent;
|
||||
import static net.minecraftforge.event.terraingen.TerrainGen.*;
|
||||
import net.minecraftforge.event.terraingen.TerrainGen;
|
||||
import net.minecraftforge.event.world.WorldEvent;
|
||||
|
||||
public class NTMWorldGenerator implements IWorldGenerator {
|
||||
private MapGenNTMFeatures scatteredFeatureGen = new MapGenNTMFeatures();
|
||||
|
||||
|
||||
boolean regTest = false;
|
||||
|
||||
public NTMWorldGenerator() {
|
||||
final List<BiomeGenBase> invalidBiomes = Arrays.asList(new BiomeGenBase[] {BiomeGenBase.ocean, BiomeGenBase.river, BiomeGenBase.frozenOcean, BiomeGenBase.frozenRiver, BiomeGenBase.deepOcean});
|
||||
|
||||
NBTStructure.registerStructure(0, new SpawnCondition() {{
|
||||
canSpawn = biome -> !invalidBiomes.contains(biome);
|
||||
start = d -> new MapGenNTMFeatures.Start(d.getW(), d.getX(), d.getY(), d.getZ());
|
||||
spawnWeight = 14;
|
||||
}});
|
||||
|
||||
NBTStructure.registerStructure(0, new SpawnCondition() {{
|
||||
canSpawn = biome -> !invalidBiomes.contains(biome);
|
||||
start = d -> new BunkerStart(d.getW(), d.getX(), d.getY(), d.getZ());
|
||||
spawnWeight = 1;
|
||||
}});
|
||||
|
||||
NBTStructure.registerStructure(0, new SpawnCondition() {{
|
||||
canSpawn = biome -> !biome.canSpawnLightningBolt() && biome.temperature >= 2F;
|
||||
structure = new JigsawPiece("vertibird", StructureManager.vertibird);
|
||||
spawnWeight = 3;
|
||||
}});
|
||||
|
||||
NBTStructure.registerStructure(0, new SpawnCondition() {{
|
||||
canSpawn = biome -> !biome.canSpawnLightningBolt() && biome.temperature >= 2F;
|
||||
structure = new JigsawPiece("crashed_vertibird", StructureManager.crashed_vertibird);
|
||||
spawnWeight = 3;
|
||||
}});
|
||||
|
||||
Map<Block, BlockSelector> bricks = new HashMap<Block, BlockSelector>() {{
|
||||
put(ModBlocks.meteor_brick, new MeteorBricks());
|
||||
}};
|
||||
Map<Block, BlockSelector> crates = new HashMap<Block, BlockSelector>() {{
|
||||
put(ModBlocks.meteor_brick, new MeteorBricks());
|
||||
put(ModBlocks.crate, new SupplyCrates());
|
||||
put(ModBlocks.meteor_spawner, new CrabSpawners());
|
||||
}};
|
||||
Map<Block, BlockSelector> ooze = new HashMap<Block, BlockSelector>() {{
|
||||
put(ModBlocks.meteor_brick, new MeteorBricks());
|
||||
put(ModBlocks.concrete_colored, new GreenOoze());
|
||||
}};
|
||||
|
||||
NBTStructure.registerStructure(0, new SpawnCondition() {{
|
||||
minHeight = 32;
|
||||
maxHeight = 32;
|
||||
sizeLimit = 128;
|
||||
canSpawn = biome -> biome.rootHeight >= 0;
|
||||
startPool = "start";
|
||||
pools = new HashMap<String, NBTStructure.JigsawPool>() {{
|
||||
put("start", new JigsawPool() {{
|
||||
add(new JigsawPiece("meteor_core", StructureManager.meteor_core) {{ blockTable = bricks; }}, 1);
|
||||
}});
|
||||
put("spike", new JigsawPool() {{
|
||||
add(new JigsawPiece("meteor_spike", StructureManager.meteor_spike) {{ heightOffset = -3; conformToTerrain = true; }}, 1);
|
||||
}});
|
||||
put("default", new JigsawPool() {{
|
||||
add(new JigsawPiece("meteor_corner", StructureManager.meteor_corner) {{ blockTable = bricks; }}, 2);
|
||||
add(new JigsawPiece("meteor_t", StructureManager.meteor_t) {{ blockTable = bricks; }}, 3);
|
||||
add(new JigsawPiece("meteor_stairs", StructureManager.meteor_stairs) {{ blockTable = bricks; }}, 1);
|
||||
add(new JigsawPiece("meteor_room_base_thru", StructureManager.meteor_room_base_thru) {{ blockTable = bricks; }}, 3);
|
||||
add(new JigsawPiece("meteor_room_base_end", StructureManager.meteor_room_base_end) {{ blockTable = bricks; }}, 4);
|
||||
fallback = "fallback";
|
||||
}});
|
||||
put("10room", new JigsawPool() {{
|
||||
add(new JigsawPiece("meteor_room_basic", StructureManager.meteor_room_basic) {{ blockTable = bricks; }}, 1);
|
||||
add(new JigsawPiece("meteor_room_balcony", StructureManager.meteor_room_balcony) {{ blockTable = bricks; }}, 1);
|
||||
add(new JigsawPiece("meteor_room_dragon", StructureManager.meteor_room_dragon) {{ blockTable = bricks; }}, 1);
|
||||
add(new JigsawPiece("meteor_room_ladder", StructureManager.meteor_room_ladder) {{ blockTable = bricks; }}, 1);
|
||||
add(new JigsawPiece("meteor_room_ooze", StructureManager.meteor_room_ooze) {{ blockTable = ooze; }}, 1);
|
||||
add(new JigsawPiece("meteor_room_split", StructureManager.meteor_room_split) {{ blockTable = bricks; }}, 1);
|
||||
add(new JigsawPiece("meteor_room_stairs", StructureManager.meteor_room_stairs) {{ blockTable = bricks; }}, 1);
|
||||
add(new JigsawPiece("meteor_room_triple", StructureManager.meteor_room_triple) {{ blockTable = bricks; }}, 1);
|
||||
fallback = "roomback";
|
||||
}});
|
||||
put("3x3loot", new JigsawPool() {{
|
||||
add(new JigsawPiece("meteor_3_bale", StructureManager.meteor_3_bale), 1);
|
||||
add(new JigsawPiece("meteor_3_blank", StructureManager.meteor_3_blank), 1);
|
||||
add(new JigsawPiece("meteor_3_block", StructureManager.meteor_3_block), 1);
|
||||
add(new JigsawPiece("meteor_3_crab", StructureManager.meteor_3_crab), 1);
|
||||
add(new JigsawPiece("meteor_3_crab_tesla", StructureManager.meteor_3_crab_tesla), 1);
|
||||
add(new JigsawPiece("meteor_3_crate", StructureManager.meteor_3_crate), 1);
|
||||
add(new JigsawPiece("meteor_3_dirt", StructureManager.meteor_3_dirt), 1);
|
||||
add(new JigsawPiece("meteor_3_lead", StructureManager.meteor_3_lead), 1);
|
||||
add(new JigsawPiece("meteor_3_ooze", StructureManager.meteor_3_ooze), 1);
|
||||
add(new JigsawPiece("meteor_3_pillar", StructureManager.meteor_3_pillar), 1);
|
||||
add(new JigsawPiece("meteor_3_star", StructureManager.meteor_3_star), 1);
|
||||
add(new JigsawPiece("meteor_3_tesla", StructureManager.meteor_3_tesla), 1);
|
||||
add(new JigsawPiece("meteor_3_book", StructureManager.meteor_3_book), 1);
|
||||
add(new JigsawPiece("meteor_3_mku", StructureManager.meteor_3_mku), 1);
|
||||
add(new JigsawPiece("meteor_3_statue", StructureManager.meteor_3_statue), 1);
|
||||
add(new JigsawPiece("meteor_3_glow", StructureManager.meteor_3_glow), 1);
|
||||
fallback = "3x3loot"; // generate loot even if we're at the size limit
|
||||
}});
|
||||
put("headloot", new JigsawPool() {{
|
||||
add(new JigsawPiece("meteor_dragon_chest", StructureManager.meteor_dragon_chest) {{ blockTable = crates; }}, 1);
|
||||
add(new JigsawPiece("meteor_dragon_tesla", StructureManager.meteor_dragon_tesla) {{ blockTable = crates; }}, 1);
|
||||
add(new JigsawPiece("meteor_dragon_trap", StructureManager.meteor_dragon_trap) {{ blockTable = crates; }}, 1);
|
||||
add(new JigsawPiece("meteor_dragon_crate_crab", StructureManager.meteor_dragon_crate_crab) {{ blockTable = crates; }}, 1);
|
||||
fallback = "headback";
|
||||
}});
|
||||
put("fallback", new JigsawPool() {{
|
||||
add(new JigsawPiece("meteor_fallback", StructureManager.meteor_fallback) {{ blockTable = bricks; }}, 1);
|
||||
}});
|
||||
put("roomback", new JigsawPool() {{
|
||||
add(new JigsawPiece("meteor_room_fallback", StructureManager.meteor_room_fallback) {{ blockTable = bricks; }}, 1);
|
||||
}});
|
||||
put("headback", new JigsawPool() {{
|
||||
add(new JigsawPiece("meteor_loot_fallback", StructureManager.meteor_dragon_fallback) {{ blockTable = crates; }}, 1);
|
||||
}});
|
||||
}};
|
||||
}});
|
||||
}
|
||||
|
||||
private NBTStructure.GenStructure nbtGen = new NBTStructure.GenStructure();
|
||||
|
||||
private final Random rand = new Random(); //A central random, used to cleanly generate our stuff without affecting vanilla or modded seeds.
|
||||
|
||||
|
||||
/** Inits all MapGen upon the loading of a new world. Hopefully clears out structureMaps and structureData when a different world is loaded. */
|
||||
@SubscribeEvent
|
||||
public void onLoad(WorldEvent.Load event) {
|
||||
scatteredFeatureGen = (MapGenNTMFeatures) getModdedMapGen(new MapGenNTMFeatures(), EventType.CUSTOM);
|
||||
|
||||
nbtGen = (NBTStructure.GenStructure) TerrainGen.getModdedMapGen(new NBTStructure.GenStructure(), EventType.CUSTOM);
|
||||
|
||||
hasPopulationEvent = false;
|
||||
}
|
||||
|
||||
|
||||
/** Called upon the initial population of a chunk. Called in the pre-population event first; called again if pre-population didn't occur (flatland) */
|
||||
private void setRandomSeed(World world, int chunkX, int chunkZ) {
|
||||
rand.setSeed(world.getSeed());
|
||||
rand.setSeed(world.getSeed() + world.provider.dimensionId);
|
||||
final long i = rand.nextLong() / 2L * 2L + 1L;
|
||||
final long j = rand.nextLong() / 2L * 2L + 1L;
|
||||
rand.setSeed((long)chunkX * i + (long)chunkZ * j ^ world.getSeed());
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Pre-population Events / Structure Generation
|
||||
* Used to generate structures without unnecessary intrusion by biome decoration, like trees.
|
||||
*/
|
||||
|
||||
|
||||
private boolean hasPopulationEvent = false; // Does the given chunkGenerator have a population event? If not (flatlands), default to using generate.
|
||||
|
||||
|
||||
@SubscribeEvent
|
||||
public void generateStructures(PopulateChunkEvent.Pre event) {
|
||||
setRandomSeed(event.world, event.chunkX, event.chunkZ); //Set random for population down the line.
|
||||
hasPopulationEvent = true;
|
||||
|
||||
|
||||
if(StructureConfig.enableStructures == 0) return;
|
||||
if(StructureConfig.enableStructures == 2 && !event.world.getWorldInfo().isMapFeaturesEnabled()) return;
|
||||
|
||||
switch (event.world.provider.dimensionId) {
|
||||
case -1:
|
||||
break;
|
||||
case 0:
|
||||
generateOverworldStructures(event.world, event.chunkProvider, event.chunkX, event.chunkZ);
|
||||
break;
|
||||
case 1:
|
||||
break;
|
||||
}
|
||||
|
||||
setRandomSeed(event.world, event.chunkX, event.chunkZ); //Set random for population down the line.
|
||||
|
||||
nbtGen.generateStructures(event.world, rand, event.chunkProvider, event.chunkX, event.chunkZ);
|
||||
}
|
||||
|
||||
protected void generateOverworldStructures(World world, IChunkProvider chunkProvider, int chunkX, int chunkZ) {
|
||||
Block[] ablock = new Block[65536]; //ablock isn't actually used for anything in MapGenStructure
|
||||
|
||||
this.scatteredFeatureGen.func_151539_a(chunkProvider, world, chunkX, chunkZ, ablock);
|
||||
this.scatteredFeatureGen.generateStructuresInChunk(world, rand, chunkX, chunkZ);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Post-Vanilla / Modded Generation
|
||||
* Used to generate features that don't care about intrusions (ores, craters, caves, etc.)
|
||||
*/
|
||||
|
||||
|
||||
@Override
|
||||
public void generate(Random rand, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {
|
||||
|
||||
switch (world.provider.dimensionId) {
|
||||
case -1:
|
||||
generateNether(world, rand, chunkGenerator, chunkX, chunkZ); break;
|
||||
case 0:
|
||||
generateSurface(world, rand, chunkGenerator, chunkProvider, chunkX, chunkZ); break;
|
||||
case 1:
|
||||
generateEnd(world, rand, chunkGenerator, chunkX, chunkZ); break;
|
||||
}
|
||||
}
|
||||
|
||||
private void generateNether(World world, Random rand, IChunkProvider chunkGenerator, int chunkX, int chunkZ) { }
|
||||
|
||||
/* Overworld Generation */
|
||||
|
||||
private void generateSurface(World world, Random rand, IChunkProvider chunkGenerator, IChunkProvider chunkProvider, int chunkX, int chunkZ) {
|
||||
if(!hasPopulationEvent) { //If we've failed to generate any structures (flatlands)
|
||||
setRandomSeed(world, chunkX, chunkZ); //Reset the random seed to compensate
|
||||
|
||||
boolean enableStructures = world.getWorldInfo().isMapFeaturesEnabled();
|
||||
if(StructureConfig.enableStructures == 1) enableStructures = true;
|
||||
if(StructureConfig.enableStructures == 0) enableStructures = false;
|
||||
public void generate(Random unusedRandom, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {
|
||||
if(hasPopulationEvent) return; //If we've failed to generate any structures (flatlands)
|
||||
|
||||
if(enableStructures) generateOverworldStructures(world, chunkGenerator, chunkX, chunkZ); //Do it through the post-population generation directly
|
||||
}
|
||||
|
||||
/* biome dictionary my beloved <3
|
||||
* no check for tom here because the event handler already checks for decoration events, + this way they won't become permanently extinct.
|
||||
*/
|
||||
|
||||
/* Biome check, followed by chance, followed by event (for compat, both intra- and inter- (in the case of Tom). */
|
||||
|
||||
|
||||
if(StructureConfig.enableStructures == 0) return;
|
||||
if(StructureConfig.enableStructures == 2 && !world.getWorldInfo().isMapFeaturesEnabled()) return;
|
||||
|
||||
setRandomSeed(world, chunkX, chunkZ); //Reset the random seed to compensate
|
||||
|
||||
nbtGen.generateStructures(world, rand, chunkProvider, chunkX, chunkZ);
|
||||
}
|
||||
|
||||
private void generateEnd(World world, Random rand, IChunkProvider chunkGenerator, int chunkX, int chunkZ) { }
|
||||
|
||||
/** Utility method for biome checking multiple types exclusively. Not sure why it wasn't already present. */
|
||||
public static boolean isBiomeOfTypes(BiomeGenBase biome, Type... types) { //If new biomes are implemented, move this to any biome-related utility class.
|
||||
for(Type type : types) {
|
||||
if(!isBiomeOfType(biome, type)) return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/** utility method, same as above but inclusive. useful for catch-alls, like the dirty glass structures have */
|
||||
public static boolean doesBiomeHaveTypes(BiomeGenBase biome, Type... types) {
|
||||
for(Type type : types) {
|
||||
if(isBiomeOfType(biome, type)) return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@ -2,24 +2,12 @@ package com.hbm.world.generator;
|
||||
|
||||
import com.hbm.world.generator.room.*;
|
||||
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class CellularDungeonFactory {
|
||||
|
||||
public static CellularDungeon meteor;
|
||||
public static CellularDungeon jungle;
|
||||
|
||||
|
||||
public static void init() {
|
||||
|
||||
meteor = new TestDungeon(11, 7, 11, 11, 150, 3);
|
||||
meteor.rooms.add(new TestDungeonRoom1(meteor));
|
||||
meteor.rooms.add(new TestDungeonRoom2(meteor));
|
||||
meteor.rooms.add(new TestDungeonRoom3(meteor));
|
||||
meteor.rooms.add(new TestDungeonRoom4(meteor, new TestDungeonRoom5(meteor), ForgeDirection.NORTH));
|
||||
meteor.rooms.add(new TestDungeonRoom6(meteor));
|
||||
meteor.rooms.add(new TestDungeonRoom7(meteor));
|
||||
meteor.rooms.add(new TestDungeonRoom8(meteor));
|
||||
|
||||
|
||||
jungle = new JungleDungeon(5, 5, 25, 25, 700, 6);
|
||||
for(int i = 0; i < 10; i++) jungle.rooms.add(new JungleDungeonRoom(jungle));
|
||||
jungle.rooms.add(new JungleDungeonRoomArrow(jungle));
|
||||
|
||||
@ -1,19 +0,0 @@
|
||||
package com.hbm.world.generator;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.inventory.RecipesCommon.MetaBlock;
|
||||
|
||||
public class TestDungeon extends CellularDungeon {
|
||||
|
||||
public TestDungeon(int width, int height, int dimX, int dimZ, int tries, int branches) {
|
||||
super(width, height, dimX, dimZ, tries, branches);
|
||||
|
||||
this.floor.add(new MetaBlock(ModBlocks.meteor_polished));
|
||||
this.wall.add(new MetaBlock(ModBlocks.meteor_brick));
|
||||
this.wall.add(new MetaBlock(ModBlocks.meteor_brick));
|
||||
this.wall.add(new MetaBlock(ModBlocks.meteor_brick_mossy));
|
||||
this.wall.add(new MetaBlock(ModBlocks.meteor_brick_cracked));
|
||||
this.ceiling.add(new MetaBlock(ModBlocks.block_meteor_broken));
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,39 +0,0 @@
|
||||
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);
|
||||
|
||||
/*world.setBlock(x + parent.width / 2, y, z + parent.width / 2, Blocks.mob_spawner, 0, 2);
|
||||
TileEntityMobSpawner tileentitymobspawner2 = (TileEntityMobSpawner)world.getTileEntity(x + parent.width / 2, y, z + parent.width / 2);
|
||||
|
||||
if (tileentitymobspawner2 != null)
|
||||
{
|
||||
tileentitymobspawner2.func_145881_a().setEntityName("entity_cyber_crab");
|
||||
}*/
|
||||
}
|
||||
}
|
||||
@ -1,34 +0,0 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,33 +0,0 @@
|
||||
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("entity_cyber_crab");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,43 +0,0 @@
|
||||
package com.hbm.world.generator.room;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
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 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(new MetaBlock(Blocks.air)); add(new MetaBlock(Blocks.web)); }});
|
||||
|
||||
DungeonToolbox.generateBox(world, x + 1, y, z + 1, parent.width - 2, 1, parent.width - 2, new ArrayList() {{
|
||||
add(new MetaBlock(ModBlocks.meteor_polished));
|
||||
add(new MetaBlock(ModBlocks.meteor_polished));
|
||||
add(new MetaBlock(ModBlocks.meteor_polished));
|
||||
add(new MetaBlock(ModBlocks.meteor_polished));
|
||||
add(new MetaBlock(ModBlocks.meteor_polished));
|
||||
add(new MetaBlock(ModBlocks.meteor_spawner));
|
||||
}});
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
@ -1,40 +0,0 @@
|
||||
package com.hbm.world.generator.room;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
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 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(new MetaBlock(Blocks.air)); add(new MetaBlock(Blocks.web)); }});
|
||||
|
||||
DungeonToolbox.generateBox(world, x + 1, y, z + 1, parent.width - 2, 1, parent.width - 2, new ArrayList() {{
|
||||
add(new MetaBlock(ModBlocks.meteor_polished));
|
||||
add(new MetaBlock(ModBlocks.meteor_polished));
|
||||
add(new MetaBlock(ModBlocks.meteor_polished));
|
||||
add(new MetaBlock(ModBlocks.meteor_polished));
|
||||
add(new MetaBlock(ModBlocks.meteor_polished));
|
||||
add(new MetaBlock(ModBlocks.meteor_spawner)); }});
|
||||
}
|
||||
|
||||
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,54 +0,0 @@
|
||||
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.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TestDungeonRoom6 extends CellularDungeonRoom {
|
||||
|
||||
public TestDungeonRoom6(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 + 1, y, z + 1, parent.width - 2, 1, parent.width - 2, ModBlocks.toxic_block);
|
||||
DungeonToolbox.generateBox(world, x + parent.width / 2 - 1, y, z + parent.width / 2 - 1, 3, 1, 3, ModBlocks.meteor_brick_chiseled);
|
||||
world.setBlock(x + parent.width / 2, y, z + parent.width / 2, ModBlocks.meteor_polished);
|
||||
|
||||
world.setBlock(x + 1, y, z + parent.width / 2, ModBlocks.meteor_polished);
|
||||
world.setBlock(x + parent.width / 2, y, z + 1, ModBlocks.meteor_polished);
|
||||
|
||||
world.setBlock(x + parent.width - 2, y, z + parent.width / 2, ModBlocks.meteor_polished);
|
||||
world.setBlock(x + parent.width / 2, y, z + parent.width - 2, ModBlocks.meteor_polished);
|
||||
}
|
||||
|
||||
public void generateWall(World world, int x, int y, int z, ForgeDirection wall, boolean door) {
|
||||
|
||||
super.generateWall(world, x, y, z, wall, door);
|
||||
|
||||
if(!door)
|
||||
return;
|
||||
|
||||
if(wall == ForgeDirection.NORTH) {
|
||||
DungeonToolbox.generateBox(world, x + parent.width / 2, y, z + 1, 1, 1, parent.width / 2 - 2, ModBlocks.meteor_polished);
|
||||
}
|
||||
|
||||
if(wall == ForgeDirection.SOUTH) {
|
||||
DungeonToolbox.generateBox(world, x + parent.width / 2, y, z + parent.width / 2 + 2, 1, 1, parent.width / 2 - 2, ModBlocks.meteor_polished);
|
||||
}
|
||||
|
||||
if(wall == ForgeDirection.WEST) {
|
||||
DungeonToolbox.generateBox(world, x + 1, y, z + parent.width / 2, parent.width / 2 - 2, 1, 1, ModBlocks.meteor_polished);
|
||||
}
|
||||
|
||||
if(wall == ForgeDirection.EAST) {
|
||||
DungeonToolbox.generateBox(world, x + parent.width / 2 + 2, y, z + parent.width / 2, parent.width / 2 - 2, 1, 1, ModBlocks.meteor_polished);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,28 +0,0 @@
|
||||
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.world.World;
|
||||
|
||||
public class TestDungeonRoom7 extends CellularDungeonRoom {
|
||||
|
||||
public TestDungeonRoom7(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, z, parent.width, 1, parent.width, ModBlocks.meteor_polished);
|
||||
DungeonToolbox.generateBox(world, x + 2, y, z + 2, parent.width - 4, 1, parent.width - 4, ModBlocks.deco_red_copper);
|
||||
DungeonToolbox.generateBox(world, x + 3, y, z + 3, parent.width - 6, 1, parent.width - 6, ModBlocks.meteor_polished);
|
||||
DungeonToolbox.generateBox(world, x + 4, y, z + 4, parent.width - 8, 1, parent.width - 8, ModBlocks.deco_red_copper);
|
||||
|
||||
world.setBlock(x + parent.width / 2, y, z + parent.width / 2, ModBlocks.meteor_battery);
|
||||
world.setBlock(x + parent.width / 2, y + 1, z + parent.width / 2, ModBlocks.tesla);
|
||||
}
|
||||
}
|
||||
@ -1,225 +0,0 @@
|
||||
package com.hbm.world.generator.room;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.crafting.handlers.MKUCraftingHandler;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.special.ItemBookLore;
|
||||
import com.hbm.tileentity.machine.storage.TileEntitySafe;
|
||||
import com.hbm.world.generator.CellularDungeon;
|
||||
import com.hbm.world.generator.CellularDungeonRoom;
|
||||
import com.hbm.world.generator.DungeonToolbox;
|
||||
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class TestDungeonRoom8 extends CellularDungeonRoom {
|
||||
|
||||
public TestDungeonRoom8(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);
|
||||
|
||||
DungeonToolbox.generateBox(world, x + 4, y + 1, z + 4, parent.width - 8, 1, parent.width - 8, ModBlocks.meteor_polished);
|
||||
|
||||
int i = world.rand.nextInt(8);
|
||||
|
||||
switch(i) {
|
||||
case 0: world.setBlock(x + parent.width / 2, y + 2, z + parent.width / 2, ModBlocks.meteor_brick_chiseled, 0, 3); break;
|
||||
case 1: world.setBlock(x + parent.width / 2, y + 2, z + parent.width / 2, ModBlocks.ntm_dirt, 0, 3); break;
|
||||
case 2: world.setBlock(x + parent.width / 2, y + 2, z + parent.width / 2, ModBlocks.block_starmetal, 0, 3); break;
|
||||
case 3: world.setBlock(x + parent.width / 2, y + 2, z + parent.width / 2, ModBlocks.statue_elb_f, 0, 3); break;
|
||||
case 4: world.setBlock(x + parent.width / 2, y + 2, z + parent.width / 2, ModBlocks.crate_red, 0, 3); break;
|
||||
case 5: world.setBlock(x + parent.width / 2, y + 2, z + parent.width / 2, ModBlocks.balefire, 0, 3); break;
|
||||
case 6: world.setBlock(x + parent.width / 2, y + 2, z + parent.width / 2, ModBlocks.block_meteor, 0, 3); break;
|
||||
case 7:
|
||||
world.setBlock(x + parent.width / 2, y + 2, z + parent.width / 2, ModBlocks.safe, 0, 3);
|
||||
if(world.getTileEntity(x + parent.width / 2, y + 2, z + parent.width / 2) instanceof TileEntitySafe) {
|
||||
|
||||
int r = world.rand.nextInt(10);
|
||||
|
||||
if(r == 0) {
|
||||
((TileEntitySafe)world.getTileEntity(x + parent.width / 2, y + 2, z + parent.width / 2)).setInventorySlotContents(7, new ItemStack(ModItems.book_of_));
|
||||
} else if(r < 4) {
|
||||
TileEntitySafe safe = (TileEntitySafe) world.getTileEntity(x + parent.width / 2, y + 2, z + parent.width / 2);
|
||||
safe.setInventorySlotContents(5, generateBook(world));
|
||||
safe.setInventorySlotContents(7, new ItemStack(ModItems.stamp_book, 1, world.rand.nextInt(8)));
|
||||
safe.setInventorySlotContents(9, new ItemStack(ModItems.stamp_book, 1, world.rand.nextInt(8)));
|
||||
} else {
|
||||
TileEntitySafe safe = (TileEntitySafe) world.getTileEntity(x + parent.width / 2, y + 2, z + parent.width / 2);
|
||||
safe.setInventorySlotContents(5, new ItemStack(Items.book));
|
||||
safe.setInventorySlotContents(7, new ItemStack(ModItems.stamp_book, 1, world.rand.nextInt(8)));
|
||||
safe.setInventorySlotContents(9, new ItemStack(ModItems.stamp_book, 1, world.rand.nextInt(8)));
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public static ItemStack generateBook(World world) {
|
||||
MKUCraftingHandler.generateRecipe(world);
|
||||
ItemStack[] recipe = MKUCraftingHandler.MKURecipe;
|
||||
|
||||
if(recipe == null) return new ItemStack(ModItems.flame_pony);
|
||||
|
||||
String key;
|
||||
int pages;
|
||||
Item item;
|
||||
switch(world.rand.nextInt(6)) {
|
||||
case 0:
|
||||
key = "book_iodine"; pages = 3;
|
||||
item = ModItems.powder_iodine; break;
|
||||
case 1:
|
||||
key = "book_phosphorous"; pages = 2;
|
||||
item = ModItems.powder_fire; break;
|
||||
case 2:
|
||||
key = "book_dust"; pages = 3;
|
||||
item = ModItems.dust; break;
|
||||
case 3:
|
||||
key = "book_mercury"; pages = 2;
|
||||
item = ModItems.ingot_mercury; break;
|
||||
case 4:
|
||||
key = "book_flower"; pages = 2;
|
||||
item = ModItems.morning_glory; break;
|
||||
case 5:
|
||||
key = "book_syringe"; pages = 2;
|
||||
item = ModItems.syringe_metal_empty; break;
|
||||
default:
|
||||
return new ItemStack(ModItems.flame_pony);
|
||||
}
|
||||
|
||||
int s = 1;
|
||||
for(int i = 0; i < 9; i++) {
|
||||
if(recipe[i] != null && recipe[i].getItem() == item) {
|
||||
s = i + 1; break;
|
||||
}
|
||||
}
|
||||
|
||||
ItemStack book = ItemBookLore.createBook(key, pages, 0x271E44, 0xFBFFF4);
|
||||
ItemBookLore.addArgs(book, pages - 1, String.valueOf(s));
|
||||
|
||||
return book;
|
||||
}
|
||||
|
||||
/*public static ItemStack genetateMKU(World world) {
|
||||
|
||||
ItemStack book = new ItemStack(Items.written_book);
|
||||
book.stackTagCompound = new NBTTagCompound();
|
||||
book.stackTagCompound.setString("author", "Dave");
|
||||
book.stackTagCompound.setString("title", "Note");
|
||||
NBTTagList nbt = new NBTTagList();
|
||||
|
||||
String[] pages = generatePages(world);
|
||||
|
||||
for(String s : pages) {
|
||||
nbt.appendTag(new NBTTagString(s));
|
||||
}
|
||||
|
||||
book.stackTagCompound.setTag("pages", nbt);
|
||||
|
||||
return book;
|
||||
}
|
||||
|
||||
private static String[] bookIodine = new String[] {
|
||||
"alright you will not believe this, but old man weathervane finally managed to show up again since he left two weeks ago",
|
||||
"and what's more surprising is the fact that he actually decided to spill the beans on what they were doing in the canyon:",
|
||||
"apparently the morons form R&D discovered a compound that is mostly inorganic, pretty much like a toxin in nature, but get",
|
||||
"this: the dying cells will reproduce said toxin and excete it through the skin, creating an aerosol that is highly contageous.",
|
||||
"it's just like a virus, but not a virus. the composition is weird, you can mix it in any household bottle but you do have to",
|
||||
"get the order right. the doc told me that the first ingredient which is just powdered iodine crystals goes into slot #"
|
||||
};
|
||||
private static String[] bookPhosphorous = new String[] {
|
||||
"heyo, it's me again. i assume you got my last memo, the doc wasn't too happy about it. i'll have to do this quick, the",
|
||||
"dunderheads from R&D are currently moaning again, probably over money. again. anyway, doc weathervane found that the second",
|
||||
"ingredient is red phosphorous, whihc has to be mixed into slot #"
|
||||
};
|
||||
private static String[] bookDust = new String[] {
|
||||
"the doc was furious when he found out that the R&D dorks kept the one remaining sample, ranting about gross negligence this",
|
||||
"and a doomsday scenario that. i told him to chill for a minute, getting all worked up isn't good for his blood pressure, not",
|
||||
"that he has much blood left to begin with. one of the R&D morons slipped some more info into last week's circular, they call their",
|
||||
"little concoction \"MKU\" whatever that means, and that it contains actual household lint. can you believe that? one of the most",
|
||||
"dangerous inventions of theirs and it contains dust. strangely they also mentioned that it goes into slot #"
|
||||
};
|
||||
private static String[] bookMercury = new String[] {
|
||||
"well that settles that. not counting the vomitting blood part, the toxicological report mostly resembles that of mercury",
|
||||
"poisoning. why? because our little mix also contains mercury! i just wonder where all that stuff comes from when being",
|
||||
"replicated by the body? whatever, the mercury goes into slot #"
|
||||
};
|
||||
private static String[] bookFlower = new String[] {
|
||||
"remember when i mentioned in my first memo that the compound is mostly anorganic? well guess what, the old man shared the fourth",
|
||||
"ingredient: ipomoea nil, a genus of flower. morning glory! it might be due to its low sulfur content, whatever might be the case,",
|
||||
"it does not work with other flowers. the morning glory goes into slot #"
|
||||
};
|
||||
private static String[] bookSyringe = new String[] {
|
||||
"a little addendum to my fifth message, obviously you have to store this MKU stuff in a container. the R&D nuts used regular",
|
||||
"metal syringes that they got from medical. surplus ware i presume, they got thousands of needles just lying around. the metal",
|
||||
"syringe goes into slot #"
|
||||
};
|
||||
|
||||
public static String[] generatePages(World world) {
|
||||
|
||||
String[] orig;
|
||||
Item ingred;
|
||||
int r = world.rand.nextInt(6);
|
||||
|
||||
if(r == 0) {
|
||||
orig = bookIodine;
|
||||
ingred = ModItems.powder_iodine;
|
||||
} else if(r == 1) {
|
||||
orig = bookPhosphorous;
|
||||
ingred = ModItems.powder_fire;
|
||||
} else if(r == 2) {
|
||||
orig = bookDust;
|
||||
ingred = ModItems.dust;
|
||||
} else if(r == 3) {
|
||||
orig = bookMercury;
|
||||
ingred = ModItems.ingot_mercury;
|
||||
} else if(r == 4) {
|
||||
orig = bookFlower;
|
||||
ingred = ModItems.morning_glory;
|
||||
} else {
|
||||
orig = bookSyringe;
|
||||
ingred = ModItems.syringe_metal_empty;
|
||||
}
|
||||
|
||||
String[] copy = new String[orig.length];
|
||||
|
||||
for(int i = 0; i < orig.length; i++) {
|
||||
copy[i] = orig[i] + ""; //Strings are reference types and i'm really not counting on my luck here
|
||||
}
|
||||
|
||||
copy[copy.length - 1] += getSlot(world, ingred);
|
||||
|
||||
return copy;
|
||||
}
|
||||
|
||||
public static int getSlot(World world, Item item) {
|
||||
|
||||
MKUCraftingHandler.generateRecipe(world);
|
||||
ItemStack[] recipe = MKUCraftingHandler.MKURecipe;
|
||||
|
||||
if(recipe == null) //take no chances
|
||||
return -2;
|
||||
|
||||
for(int i = 0; i < 9; i++) {
|
||||
|
||||
if(recipe[i] != null && recipe[i].getItem() == item) {
|
||||
return i + 1;
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
}*/
|
||||
}
|
||||
@ -35,6 +35,9 @@ public net.minecraft.world.gen.ChunkProviderFlat field_82702_h # ha
|
||||
# ChunkProviderServer
|
||||
public net.minecraft.world.gen.ChunkProviderServer field_73248_b # chunksToUnload
|
||||
|
||||
# NBTTagList
|
||||
public net.minecraft.nbt.NBTTagList * # Mojang makes a format use LISTS of INTs, what the fuck
|
||||
|
||||
# ItemRenderer
|
||||
public net.minecraft.client.renderer.ItemRenderer field_78453_b # itemToRender
|
||||
|
||||
|
||||
@ -5336,6 +5336,7 @@ tile.deco_computer.ibm_300pl.name=IBM Personal Computer 300PL
|
||||
tile.deco_crt.name=Old CRT Screen
|
||||
tile.deco_emitter.name=Deco Light Emitter
|
||||
tile.deco_lead.name=Lead Deco Block
|
||||
tile.deco_loot.name=Loot Pile
|
||||
tile.deco_rbmk.name=RBMK Deco Block
|
||||
tile.deco_rbmk_smooth.name=Smooth RBMK Deco Block
|
||||
tile.deco_red_copper.name=Red Copper Deco Block
|
||||
@ -6015,6 +6016,7 @@ tile.red_pylon_medium_steel_transformer.name=Medium Steel Electricity Pylon with
|
||||
tile.red_pylon_medium_wood.name=Medium Wooden Electricity Pylon
|
||||
tile.red_pylon_medium_wood_transformer.name=Medium Wooden Electricity Pylon with Transformer
|
||||
tile.red_wire_coated.name=Coated Red Copper Cable
|
||||
tile.refueler.name=Refueling Station
|
||||
tile.reinforced_brick.name=Reinforced Stone
|
||||
tile.reinforced_brick_stairs.name=Reinforced Stone Stairs
|
||||
tile.reinforced_ducrete.name=Reinforced Ducrete
|
||||
@ -6157,6 +6159,9 @@ tile.vitrified_barrel.name=Vitrified Nuclear Waste Drum
|
||||
tile.volcanic_lava_block.name=Volcanic Lava
|
||||
tile.volcano_core.name=Volcano Core
|
||||
tile.volcano_rad_core.name=Rad Volcano Core
|
||||
tile.wand_air.name=Structure Wand Block (Air)
|
||||
tile.wand_loot.name=Structure Wand Block (Lootable)
|
||||
tile.wand_jigsaw.name=Structure Wand Block (Jigsaw)
|
||||
tile.waste_earth.name=Dead Grass
|
||||
tile.waste_leaves.name=Dead Leaves
|
||||
tile.waste_log.name=Charred Log
|
||||
|
||||
1100
src/main/resources/assets/hbm/models/blocks/refueler.obj
Normal file
1100
src/main/resources/assets/hbm/models/blocks/refueler.obj
Normal file
File diff suppressed because it is too large
Load Diff
BIN
src/main/resources/assets/hbm/structures/crashed-vertibird.nbt
Normal file
BIN
src/main/resources/assets/hbm/structures/crashed-vertibird.nbt
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
src/main/resources/assets/hbm/structures/meteor/meteor-core.nbt
Normal file
BIN
src/main/resources/assets/hbm/structures/meteor/meteor-core.nbt
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
src/main/resources/assets/hbm/structures/meteor/meteor-spike.nbt
Normal file
BIN
src/main/resources/assets/hbm/structures/meteor/meteor-spike.nbt
Normal file
Binary file not shown.
Binary file not shown.
BIN
src/main/resources/assets/hbm/structures/meteor/meteor-t.nbt
Normal file
BIN
src/main/resources/assets/hbm/structures/meteor/meteor-t.nbt
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user