Skip to content

Commit

Permalink
burned old textures, better sludge
Browse files Browse the repository at this point in the history
  • Loading branch information
HbmMods committed Mar 4, 2025
1 parent 5a9b650 commit ed4421b
Show file tree
Hide file tree
Showing 144 changed files with 211 additions and 374 deletions.
12 changes: 11 additions & 1 deletion changelog
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,16 @@
* Fat mines now have a base damage of exactly 100, being identical to demolition mini nukes
* Fat mines now gib affected entities
* IV bags now use `setHealth` operations instead of dealing damage, preventing health duplication by just avoiding the damage
* The settings tool can now copy and paste the "paint" from paintable cables and fluid ducts
* Changed the way taint works
* Instead of neon purple vines, taint is bow a greyish sludge
* Taint now actively replaces blocks instead of growing along them
* Taint is still limited in spread, however taint spread is lower underground, taint decays three times faster in intensity if the block is not exposed to air, making taint spread more along the surface
* Taint has a 25% chance of splashing down when replacing a block with no supports, causing structures to collapse and taint to spread faster
* Similar to soil sand, entities will sink in taint and get slowed down
* The sludge consumeth

## Fixed
* Fixed animation error on the MAS-36
* Fixed animation error on the MAS-36
* Fixed drone docks, requester and provider crates not dropping their contents when broken
* Fixed all missing texture errors that appear in the startup log
6 changes: 3 additions & 3 deletions src/main/java/com/hbm/blocks/ModBlocks.java
Original file line number Diff line number Diff line change
Expand Up @@ -2177,7 +2177,7 @@ private static void initializeBlock() {
mass_storage = new BlockMassStorage().setBlockName("mass_storage").setStepSound(Block.soundTypeMetal).setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);

boxcar = new DecoBlock(Material.iron).setBlockName("boxcar").setStepSound(Block.soundTypeMetal).setHardness(10.0F).setResistance(10.0F).setCreativeTab(MainRegistry.blockTab).setBlockTextureName(RefStrings.MODID + ":boxcar");
boat = new DecoBlock(Material.iron).setBlockName("boat").setStepSound(Block.soundTypeMetal).setHardness(10.0F).setResistance(10.0F).setCreativeTab(MainRegistry.blockTab).setBlockTextureName(RefStrings.MODID + ":boat");
boat = new DecoBlock(Material.iron).setBlockName("boat").setStepSound(Block.soundTypeMetal).setHardness(10.0F).setResistance(10.0F).setCreativeTab(MainRegistry.blockTab).setBlockTextureName(RefStrings.MODID + ":asphalt");

machine_well = new MachineOilWell().setBlockName("machine_well").setHardness(5.0F).setResistance(20.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_well");
machine_pumpjack = new MachinePumpjack().setBlockName("machine_pumpjack").setHardness(5.0F).setResistance(20.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_pumpjack");
Expand Down Expand Up @@ -2279,7 +2279,7 @@ private static void initializeBlock() {
crystal_virus = new CrystalVirus(Material.iron).setBlockName("crystal_virus").setHardness(15.0F).setResistance(Float.POSITIVE_INFINITY).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":crystal_virus");
crystal_hardened = new BlockGeneric(Material.iron).setBlockName("crystal_hardened").setHardness(15.0F).setResistance(Float.POSITIVE_INFINITY).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":crystal_hardened");
crystal_pulsar = new CrystalPulsar(Material.iron).setBlockName("crystal_pulsar").setHardness(15.0F).setResistance(Float.POSITIVE_INFINITY).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":crystal_pulsar");
taint = new BlockTaint(Material.iron).setBlockName("taint").setHardness(15.0F).setResistance(10.0F).setCreativeTab(null);
taint = new BlockTaint(Material.iron).setBlockName("taint").setHardness(15.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":taint");

vent_chlorine = new BlockVent(Material.iron).setBlockName("vent_chlorine").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":vent_chlorine");
vent_cloud = new BlockVent(Material.iron).setBlockName("vent_cloud").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":vent_cloud");
Expand Down Expand Up @@ -3476,7 +3476,7 @@ private static void registerBlock() {
GameRegistry.registerBlock(crystal_virus, crystal_virus.getUnlocalizedName());
GameRegistry.registerBlock(crystal_hardened, crystal_hardened.getUnlocalizedName());
GameRegistry.registerBlock(crystal_pulsar, crystal_pulsar.getUnlocalizedName());
GameRegistry.registerBlock(taint, ItemTaintBlock.class, taint.getUnlocalizedName());
register(taint);
GameRegistry.registerBlock(cheater_virus, cheater_virus.getUnlocalizedName());
GameRegistry.registerBlock(cheater_virus_seed, cheater_virus_seed.getUnlocalizedName());
GameRegistry.registerBlock(ntm_dirt, ntm_dirt.getUnlocalizedName());
Expand Down
247 changes: 78 additions & 169 deletions src/main/java/com/hbm/blocks/bomb/BlockTaint.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,206 +4,115 @@
import java.util.List;
import java.util.Random;

import com.hbm.blocks.ModBlocks;
import com.hbm.blocks.ITooltipProvider;
import com.hbm.entity.mob.EntityTaintCrab;
import com.hbm.entity.mob.EntityCreeperTainted;
import com.hbm.entity.mob.EntityTeslaCrab;
import com.hbm.potion.HbmPotion;

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.BlockFalling;
import net.minecraft.block.material.MapColor;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.item.EntityFallingBlock;
import net.minecraft.entity.monster.EntityCreeper;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.potion.PotionEffect;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;

public class BlockTaint extends Block/*Container*/ {

@SideOnly(Side.CLIENT)
private IIcon[] icons;
public class BlockTaint extends Block implements ITooltipProvider {

public BlockTaint(Material p_i45386_1_) {
super(p_i45386_1_);
this.setTickRandomly(true);
public BlockTaint(Material mat) {
super(mat);
this.setTickRandomly(true);
}

/*@Override
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
return new TileEntityTaint();
}*/

@SideOnly(Side.CLIENT)
public IIcon getIcon(int p_149691_1_, int meta)
{
return this.icons[meta % this.icons.length];
}

public int damageDropped(int meta)
{
return 0;
}

public static int func_150032_b(int p_150032_0_)
{
return func_150031_c(p_150032_0_);
}

public static int func_150031_c(int p_150031_0_)
{
return p_150031_0_ & 15;
}

@SideOnly(Side.CLIENT)
public void getSubBlocks(Item p_149666_1_, CreativeTabs p_149666_2_, List p_149666_3_)
{
for (int i = 0; i < 16; ++i)
{
p_149666_3_.add(new ItemStack(p_149666_1_, 1, i));
}
}

@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister p_149651_1_)
{
this.icons = new IIcon[16];

for (int i = 0; i < this.icons.length; ++i)
{
this.icons[i] = p_149651_1_.registerIcon("hbm:taint_" + i);
}
}

public MapColor getMapColor(int p_149728_1_)
{
return MapColor.purpleColor;
}

public static int renderID = RenderingRegistry.getNextAvailableRenderId();

@Override
public int getRenderType(){
return renderID;
}
@Override public MapColor getMapColor(int meta) { return MapColor.grayColor; }
@Override public Item getItemDropped(int i, Random rand, int j) { return null; }

@Override
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_)
{
return null;
}

@Override
public boolean isOpaqueCube() {
return false;
}

@Override
public boolean renderAsNormalBlock() {
return false;
}

public void onNeighborBlockChange(World world, int x, int y, int z, Block b)
{
if(!hasPosNeightbour(world, x, y, z) && !world.isRemote)
world.setBlockToAir(x, y, z);
}

public void updateTick(World world, int x, int y, int z, Random rand)
{
int meta = world.getBlockMetadata(x, y, z);
if(!world.isRemote && meta < 15) {

for(int i = 0; i < 15; i++) {
int a = rand.nextInt(11) + x - 5;
int b = rand.nextInt(11) + y - 5;
int c = rand.nextInt(11) + z - 5;
if(world.getBlock(a, b, c).isReplaceable(world, a, b, c) && hasPosNeightbour(world, a, b, c))
world.setBlock(a, b, c, ModBlocks.taint, meta + 1, 2);
}

for(int i = 0; i < 85; i++) {
int a = rand.nextInt(7) + x - 3;
int b = rand.nextInt(7) + y - 3;
int c = rand.nextInt(7) + z - 3;
if(world.getBlock(a, b, c).isReplaceable(world, a, b, c) && hasPosNeightbour(world, a, b, c))
world.setBlock(a, b, c, ModBlocks.taint, meta + 1, 2);
}
}
}

public static boolean hasPosNeightbour(World world, int x, int y, int z) {
Block b0 = world.getBlock(x + 1, y, z);
Block b1 = world.getBlock(x, y + 1, z);
Block b2 = world.getBlock(x, y, z + 1);
Block b3 = world.getBlock(x - 1, y, z);
Block b4 = world.getBlock(x, y - 1, z);
Block b5 = world.getBlock(x, y, z - 1);
boolean b = (b0.renderAsNormalBlock() && b0.getMaterial().isOpaque()) ||
(b1.renderAsNormalBlock() && b1.getMaterial().isOpaque()) ||
(b2.renderAsNormalBlock() && b2.getMaterial().isOpaque()) ||
(b3.renderAsNormalBlock() && b3.getMaterial().isOpaque()) ||
(b4.renderAsNormalBlock() && b4.getMaterial().isOpaque()) ||
(b5.renderAsNormalBlock() && b5.getMaterial().isOpaque());
return b;
}

@Override
public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4)
{
return null;
public void updateTick(World world, int x, int y, int z, Random rand) {

int meta = world.getBlockMetadata(x, y, z);
if(meta >= 15) return;

for(int i = -3; i <= 3; i++) for(int j = -3; j <= 3; j++) for(int k = -3; k <= 3; k++) {
if(Math.abs(i) + Math.abs(j) + Math.abs(k) > 4) continue;
if(rand.nextFloat() > 0.25F) continue;
Block b = world.getBlock(x + i, y + j, z + k);
if(!b.isNormalCube() || b.isAir(world, x + i, y + j, z + k)) continue;
int targetMeta = meta + 1;
boolean hasAir = false;
for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
if(world.getBlock(x + i + dir.offsetX, y + j + dir.offsetY, z + k + dir.offsetZ).isAir(world, x + i + dir.offsetX, y + j + dir.offsetY, z + k + dir.offsetZ)) {
hasAir = true;
break;
}
}
if(!hasAir) targetMeta = meta + 3;
if(targetMeta > 15) continue;
if(b == this && world.getBlockMetadata(x + i, y + j, z + k) >= targetMeta) continue;
world.setBlock(x + i, y + j, z + k, this, targetMeta, 3);
if(rand.nextFloat() < 0.25F && BlockFalling.func_149831_e(world, x + i, y + j - 1, z + k)) {
EntityFallingBlock falling = new EntityFallingBlock(world, x + i + 0.5, y + j + 0.5, z + k + 0.5, this, targetMeta);
world.spawnEntityInWorld(falling);
}
}
}

@Override
public AxisAlignedBB getSelectedBoundingBoxFromPool(World par1World, int par2, int par3, int par4)
{
return AxisAlignedBB.getBoundingBox(par2, par3, par4, par2, par3, par4);
public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z) {
return AxisAlignedBB.getBoundingBox(x, y, z, x + 1, y + 0.75, z + 1);
}

@Override
public void onEntityCollidedWithBlock(World world, int x, int y, int z, Entity entity) {

int meta = world.getBlockMetadata(x, y, z);
int level = 15 - meta;

List<ItemStack> list = new ArrayList<ItemStack>();
PotionEffect effect = new PotionEffect(HbmPotion.taint.id, 15 * 20, level);
effect.setCurativeItems(list);

if(entity instanceof EntityLivingBase) {
if(world.rand.nextInt(50) == 0) {
((EntityLivingBase)entity).addPotionEffect(effect);
}
}

if(entity != null && entity.getClass().equals(EntityCreeper.class)) {
EntityCreeperTainted creep = new EntityCreeperTainted(world);
creep.setLocationAndAngles(entity.posX, entity.posY, entity.posZ, entity.rotationYaw, entity.rotationPitch);

if(!world.isRemote) {
entity.setDead();
world.spawnEntityInWorld(creep);
}
}

if(entity instanceof EntityTeslaCrab) {
EntityTaintCrab crab = new EntityTaintCrab(world);
crab.setLocationAndAngles(entity.posX, entity.posY, entity.posZ, entity.rotationYaw, entity.rotationPitch);

if(!world.isRemote) {
entity.setDead();
world.spawnEntityInWorld(crab);
}
}

entity.motionX *= 0.6;
entity.motionZ *= 0.6;

List<ItemStack> list = new ArrayList<ItemStack>();
PotionEffect effect = new PotionEffect(HbmPotion.taint.id, 15 * 20, level);
effect.setCurativeItems(list);

if(entity instanceof EntityLivingBase) {
if(world.rand.nextInt(50) == 0) {
((EntityLivingBase) entity).addPotionEffect(effect);
}
}

if(entity != null && entity.getClass().equals(EntityCreeper.class)) {
EntityCreeperTainted creep = new EntityCreeperTainted(world);
creep.setLocationAndAngles(entity.posX, entity.posY, entity.posZ, entity.rotationYaw, entity.rotationPitch);

if(!world.isRemote) {
entity.setDead();
world.spawnEntityInWorld(creep);
}
}

if(entity instanceof EntityTeslaCrab) {
EntityTaintCrab crab = new EntityTaintCrab(world);
crab.setLocationAndAngles(entity.posX, entity.posY, entity.posZ, entity.rotationYaw, entity.rotationPitch);

if(!world.isRemote) {
entity.setDead();
world.spawnEntityInWorld(crab);
}
}
}

@Override
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean ext) {
list.add("DO NOT TOUCH, BREATHE OR STARE AT.");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ public BlockGenericStairs(Block block, int meta) {

recipeGen.add(new Object[] {block, meta, this});

this.setBlockTextureName(RefStrings.MODID + ":concrete_smooth");
this.setBlockTextureName(RefStrings.MODID + ":concrete");
}
}
2 changes: 1 addition & 1 deletion src/main/java/com/hbm/blocks/generic/BlockMultiSlab.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public BlockMultiSlab(Block single, Material mat, Block... slabMaterials) {
}
}

this.setBlockTextureName(RefStrings.MODID + ":concrete_smooth");
this.setBlockTextureName(RefStrings.MODID + ":concrete");
}

@Override
Expand Down
5 changes: 3 additions & 2 deletions src/main/java/com/hbm/blocks/generic/RedBarrel.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@

import com.hbm.blocks.ModBlocks;
import com.hbm.blocks.bomb.BlockDetonatable;
import com.hbm.blocks.bomb.BlockTaint;
import com.hbm.blocks.machine.BlockFluidBarrel;
import com.hbm.entity.item.EntityTNTPrimedBase;
import com.hbm.explosion.ExplosionThermo;

import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.MathHelper;
Expand Down Expand Up @@ -68,7 +68,8 @@ public void explodeEntity(World world, double x, double y, double z, EntityTNTPr
int a = rand.nextInt(9) - 4 + ix;
int b = rand.nextInt(9) - 4 + iy;
int c = rand.nextInt(9) - 4 + iz;
if(world.getBlock(a, b, c).isReplaceable(world, a, b, c) && BlockTaint.hasPosNeightbour(world, a, b, c)) {
Block block = world.getBlock(a, b, c);
if(block.isNormalCube() && !block.isAir(world, a, b, c)) {
world.setBlock(a, b, c, ModBlocks.taint, rand.nextInt(3) + 4, 2);
}
}
Expand Down
Loading

0 comments on commit ed4421b

Please sign in to comment.