more fluidAPI, sulfuric acid, asbestos caves
11
src/main/java/api/hbm/fluid/IFluidConnectorBlock.java
Normal file
@ -0,0 +1,11 @@
|
||||
package api.hbm.fluid;
|
||||
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public interface IFluidConnectorBlock {
|
||||
|
||||
public boolean canConnect(FluidType type, IBlockAccess world, int x, int y, int z, ForgeDirection dir);
|
||||
}
|
||||
@ -1,13 +1,65 @@
|
||||
package api.hbm.fluid;
|
||||
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.packet.AuxParticlePacketNT;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public interface IFluidUser extends IFluidConnector {
|
||||
|
||||
/*public default void updateStandardPipes(World world, int x, int y, int z) {
|
||||
public default void sendFluid(FluidType type, World world, int x, int y, int z, ForgeDirection dir) {
|
||||
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
boolean wasSubscribed = false;
|
||||
boolean red = false;
|
||||
|
||||
if(te instanceof IFluidConductor) {
|
||||
IFluidConductor con = (IFluidConductor) te;
|
||||
|
||||
if(con.getPipeNet(type) != null && con.getPipeNet(type).isSubscribed(this)) {
|
||||
con.getPipeNet(type).unsubscribe(this);
|
||||
wasSubscribed = true;
|
||||
}
|
||||
}
|
||||
|
||||
if(te instanceof IFluidConnector) {
|
||||
IFluidConnector con = (IFluidConnector) te;
|
||||
|
||||
if(con.canConnect(type, dir.getOpposite())) {
|
||||
long toSend = this.getTotalFluidForSend(type);
|
||||
long transfer = toSend - con.transferFluid(type, toSend);
|
||||
this.removeFluidForTransfer(type, transfer);
|
||||
red = true;
|
||||
}
|
||||
}
|
||||
|
||||
if(wasSubscribed && te instanceof IFluidConductor) {
|
||||
IFluidConductor con = (IFluidConductor) te;
|
||||
|
||||
if(con.getPipeNet(type) != null && !con.getPipeNet(type).isSubscribed(this)) {
|
||||
con.getPipeNet(type).subscribe(this);
|
||||
}
|
||||
}
|
||||
|
||||
if(particleDebug) {
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
data.setString("type", "vanillaExt");
|
||||
data.setString("mode", red ? "reddust" : "greendust");
|
||||
PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(data, x + world.rand.nextDouble(), y + world.rand.nextDouble(), z + world.rand.nextDouble()), new TargetPoint(world.provider.dimensionId, x + 0.5, y + 0.5, z + 0.5, 25));
|
||||
}
|
||||
}
|
||||
|
||||
public long getTotalFluidForSend(FluidType type);
|
||||
public void removeFluidForTransfer(FluidType type, long amount);
|
||||
|
||||
public default void updateStandardPipes(FluidType type, World world, int x, int y, int z) {
|
||||
|
||||
for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS)
|
||||
this.trySubscribe(world, x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ, dir);
|
||||
}*/
|
||||
this.trySubscribe(type, world, x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ, dir);
|
||||
}
|
||||
}
|
||||
|
||||
@ -3,6 +3,7 @@ package com.hbm.blocks;
|
||||
public class BlockEnums {
|
||||
|
||||
public static enum EnumStoneType {
|
||||
SULFUR
|
||||
SULFUR,
|
||||
ASBESTOS
|
||||
}
|
||||
}
|
||||
|
||||
@ -21,9 +21,12 @@ import com.hbm.main.MainRegistry;
|
||||
import com.hbm.tileentity.DoorDecl;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockFalling;
|
||||
import net.minecraft.block.material.*;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
@ -1183,6 +1186,9 @@ public class ModBlocks {
|
||||
public static Fluid volcanic_lava_fluid;
|
||||
public static final Material fluidvolcanic = (new MaterialLiquid(MapColor.redColor));
|
||||
|
||||
public static Block sulfuric_acid_block;
|
||||
public static Fluid sulfuric_acid_fluid;
|
||||
|
||||
public static Block volcano_core;
|
||||
|
||||
public static Block dummy_block_flare;
|
||||
@ -1346,7 +1352,7 @@ public class ModBlocks {
|
||||
ore_depth_nether_neodymium = new BlockDepthOre().setBlockName("ore_depth_nether_neodymium").setCreativeTab(MainRegistry.blockTab).setBlockTextureName(RefStrings.MODID + ":ore_depth_nether_neodymium");
|
||||
|
||||
stone_porous = new BlockPorous().setBlockName("stone_porous").setCreativeTab(MainRegistry.blockTab).setBlockTextureName(RefStrings.MODID + ":stone_porous");
|
||||
stone_resource = new BlockEnumMulti(Material.rock, BlockEnums.EnumStoneType.class, true, true).setBlockName("stone_resource").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(10.0F);
|
||||
stone_resource = new BlockResourceStone().setBlockName("stone_resource").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(10.0F);
|
||||
stalagmite = new BlockStalagmite().setBlockName("stalagmite").setCreativeTab(MainRegistry.blockTab).setHardness(0.5F).setResistance(2.0F);
|
||||
stalactite = new BlockStalagmite().setBlockName("stalactite").setCreativeTab(MainRegistry.blockTab).setHardness(0.5F).setResistance(2.0F);
|
||||
|
||||
@ -2212,6 +2218,17 @@ public class ModBlocks {
|
||||
FluidRegistry.registerFluid(volcanic_lava_fluid);
|
||||
volcanic_lava_block = new VolcanicBlock(volcanic_lava_fluid, Material.lava).setBlockName("volcanic_lava_block").setResistance(500F);
|
||||
|
||||
sulfuric_acid_fluid = new SchrabidicFluid().setDensity(1840).setViscosity(1000).setTemperature(273).setUnlocalizedName("sulfuric_acid_fluid");
|
||||
FluidRegistry.registerFluid(sulfuric_acid_fluid);
|
||||
sulfuric_acid_block = new SchrabidicBlock(sulfuric_acid_fluid, Material.water, ModDamageSource.acid) { //TODO: make a new block class
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister register) {
|
||||
stillIcon = register.registerIcon(RefStrings.MODID + ":sulfuric_acid_still");
|
||||
flowingIcon = register.registerIcon(RefStrings.MODID + ":sulfuric_acid_flowing");
|
||||
}
|
||||
}.setBlockName("sulfuric_acid_block").setResistance(500F);
|
||||
|
||||
dummy_block_flare = new DummyBlockFlare(Material.iron, false).setBlockName("dummy_block_flare").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_aluminium");
|
||||
dummy_port_flare = new DummyBlockFlare(Material.iron, true).setBlockName("dummy_port_flare").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_aluminium");
|
||||
dummy_block_drill = new DummyBlockDrill(Material.iron, false).setBlockName("dummy_block_drill").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_lead");
|
||||
@ -3201,6 +3218,7 @@ public class ModBlocks {
|
||||
GameRegistry.registerBlock(schrabidic_block, schrabidic_block.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(corium_block, corium_block.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(volcanic_lava_block, volcanic_lava_block.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(sulfuric_acid_block, sulfuric_acid_block.getUnlocalizedName());
|
||||
|
||||
//Multiblock Dummy Blocks
|
||||
GameRegistry.registerBlock(dummy_block_flare, dummy_block_flare.getUnlocalizedName());
|
||||
|
||||
@ -11,21 +11,25 @@ public class AcidFluid extends Fluid {
|
||||
super("acid_fluid");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon() {
|
||||
return getStillIcon();
|
||||
}
|
||||
public AcidFluid(String name) {
|
||||
super(name);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getStillIcon() {
|
||||
return AcidBlock.stillIcon;
|
||||
}
|
||||
public IIcon getIcon() {
|
||||
return getStillIcon();
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getFlowingIcon() {
|
||||
return AcidBlock.flowingIcon;
|
||||
}
|
||||
public IIcon getStillIcon() {
|
||||
return AcidBlock.stillIcon;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getFlowingIcon() {
|
||||
return AcidBlock.flowingIcon;
|
||||
}
|
||||
}
|
||||
|
||||
25
src/main/java/com/hbm/blocks/generic/BlockResourceStone.java
Normal file
@ -0,0 +1,25 @@
|
||||
package com.hbm.blocks.generic;
|
||||
|
||||
import com.hbm.blocks.BlockEnumMulti;
|
||||
import com.hbm.blocks.BlockEnums;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockResourceStone extends BlockEnumMulti {
|
||||
|
||||
public BlockResourceStone() {
|
||||
super(Material.rock, BlockEnums.EnumStoneType.class, true, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dropBlockAsItemWithChance(World world, int x, int y, int z, int meta, float chance, int fortune) {
|
||||
|
||||
if(meta == BlockEnums.EnumStoneType.ASBESTOS.ordinal()) {
|
||||
world.setBlock(x, y, z, ModBlocks.gas_asbestos);
|
||||
}
|
||||
|
||||
super.dropBlockAsItemWithChance(world, x, y, z, meta, chance, fortune);
|
||||
}
|
||||
}
|
||||
@ -40,6 +40,7 @@ public class BlockStalagmite extends BlockEnumMulti {
|
||||
|
||||
switch(meta) {
|
||||
case 0: return ModItems.sulfur;
|
||||
case 1: return ModItems.powder_asbestos;
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
@ -344,7 +344,7 @@ public class OreDictManager {
|
||||
EUPH .nugget(nugget_euphemium) .ingot(ingot_euphemium) .dust(powder_euphemium) .block(block_euphemium);
|
||||
DNT .nugget(nugget_dineutronium) .ingot(ingot_dineutronium) .dust(powder_dineutronium) .block(block_dineutronium);
|
||||
FIBER .ingot(ingot_fiberglass) .block(block_fiberglass);
|
||||
ASBESTOS .asbestos(1F) .ingot(ingot_asbestos) .dust(powder_asbestos) .block(block_asbestos) .ore(ore_asbestos, ore_gneiss_asbestos, basalt_asbestos);
|
||||
ASBESTOS .asbestos(1F) .ingot(ingot_asbestos) .dust(powder_asbestos) .block(block_asbestos) .ore(ore_asbestos, ore_gneiss_asbestos, basalt_asbestos, DictFrame.fromOne(stone_resource, EnumStoneType.ASBESTOS));
|
||||
OSMIRIDIUM .nugget(nugget_osmiridium) .ingot(ingot_osmiridium);
|
||||
|
||||
/*
|
||||
|
||||
@ -974,8 +974,9 @@ public class MainRegistry {
|
||||
|
||||
//expand for the largest entity we have (currently Quackos who is 17.5m in diameter, that's one fat duck)
|
||||
World.MAX_ENTITY_RADIUS = Math.max(World.MAX_ENTITY_RADIUS, 8.75);
|
||||
|
||||
new OreCave(ModBlocks.stone_resource, 0).setThreshold(1.5D).setRangeMult(20).setYLevel(30).setMaxRange(20);
|
||||
|
||||
new OreCave(ModBlocks.stone_resource, 0).setThreshold(1.5D).setRangeMult(20).setYLevel(30).setMaxRange(20); //sulfur
|
||||
new OreCave(ModBlocks.stone_resource, 1).setThreshold(1.75D).setRangeMult(20).setYLevel(25).setMaxRange(20); //asbestos
|
||||
//new OreLayer(Blocks.coal_ore, 0.2F).setThreshold(4).setRangeMult(3).setYLevel(70);
|
||||
}
|
||||
|
||||
|
||||
|
After Width: | Height: | Size: 260 B |
|
After Width: | Height: | Size: 244 B |
BIN
src/main/resources/assets/hbm/textures/blocks/stone_gems.png
Normal file
|
After Width: | Height: | Size: 768 B |
|
After Width: | Height: | Size: 320 B |
BIN
src/main/resources/assets/hbm/textures/blocks/sulfuric_flow.png
Normal file
|
After Width: | Height: | Size: 9.6 KiB |
@ -0,0 +1,3 @@
|
||||
{
|
||||
"animation": {}
|
||||
}
|
||||
BIN
src/main/resources/assets/hbm/textures/blocks/sulfuric_still.png
Normal file
|
After Width: | Height: | Size: 14 KiB |
@ -0,0 +1,5 @@
|
||||
{
|
||||
"animation": {
|
||||
"frametime": 2
|
||||
}
|
||||
}
|
||||
BIN
src/main/resources/assets/hbm/textures/blocks/water_flow.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
@ -0,0 +1,3 @@
|
||||
{
|
||||
"animation": {}
|
||||
}
|
||||
BIN
src/main/resources/assets/hbm/textures/blocks/water_still.png
Normal file
|
After Width: | Height: | Size: 14 KiB |
@ -0,0 +1,5 @@
|
||||
{
|
||||
"animation": {
|
||||
"frametime": 2
|
||||
}
|
||||
}
|
||||