Skip to content

Commit

Permalink
d(err)ick
Browse files Browse the repository at this point in the history
  • Loading branch information
HbmMods committed Aug 18, 2024
1 parent 8597eda commit 1caeec5
Show file tree
Hide file tree
Showing 23 changed files with 8,626 additions and 1,890 deletions.
6 changes: 5 additions & 1 deletion changelog
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
* Soldering stations will no longer work if the recipe requires no input fluid while fluid is present
* While this does complicate using the soldering station manually, as switching from milgrade to standard ICs requires emptying the solderer with a siphon, it does make automating easier, since soldering stations will no longer treat incomplete milgrade circuits as ICs
* Cement is now edible
* Derricks have been remodeled, the port configuration has changed so existing derricks need to be replaced
* Derricks no longer spawn oil spills
* Metal deco blocks are now crafted in batches of 4, as well as recycled in batches of 4. Each block is therefore still worth 25% of an ingot, but recycling your own deco blocks is no longer lossy

## Fixed
* Fixed some machines not sending fluid gauge syncs properly
* Fixed some machines not sending fluid gauge syncs properly
* Fixed refinery GUI crashing when invalid input is used
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
mod_version=1.0.27
# Empty build number makes a release type
mod_build_number=5057
mod_build_number=5061

credits=HbMinecraft,\
\ rodolphito (explosion algorithms),\
Expand Down
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 @@ -2152,9 +2152,9 @@ private static void initializeBlock() {
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");

machine_well = new MachineOilWell().setBlockName("machine_well").setHardness(5.0F).setResistance(60.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_well");
machine_pumpjack = new MachinePumpjack().setBlockName("machine_pumpjack").setHardness(5.0F).setResistance(60.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_pumpjack");
machine_fracking_tower = new MachineFrackingTower().setBlockName("machine_fracking_tower").setHardness(5.0F).setResistance(60.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
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");
machine_fracking_tower = new MachineFrackingTower().setBlockName("machine_fracking_tower").setHardness(5.0F).setResistance(20.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
oil_pipe = new BlockNoDrop(Material.iron).setBlockName("oil_pipe").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":oil_pipe");
machine_flare = new MachineGasFlare(Material.iron).setBlockName("machine_flare").setHardness(5.0F).setResistance(100.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
chimney_brick = new MachineChimneyBrick(Material.iron).setBlockName("chimney_brick").setHardness(5.0F).setResistance(100.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":brick_fire");
Expand Down
61 changes: 52 additions & 9 deletions src/main/java/com/hbm/blocks/machine/MachineOilWell.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,17 @@

import com.hbm.blocks.BlockDummyable;
import com.hbm.blocks.IPersistentInfoProvider;
import com.hbm.explosion.vanillant.ExplosionVNT;
import com.hbm.explosion.vanillant.standard.BlockAllocatorStandard;
import com.hbm.explosion.vanillant.standard.BlockProcessorStandard;
import com.hbm.explosion.vanillant.standard.EntityProcessorStandard;
import com.hbm.explosion.vanillant.standard.PlayerProcessorStandard;
import com.hbm.handler.MultiblockHandlerXR;
import com.hbm.inventory.fluid.Fluids;
import com.hbm.inventory.fluid.tank.FluidTank;
import com.hbm.main.MainRegistry;
import com.hbm.particle.helper.ExplosionCreator;
import com.hbm.tileentity.IPersistentNBT;
import com.hbm.tileentity.TileEntityProxyCombo;
import com.hbm.tileentity.machine.oil.TileEntityMachineOilWell;
import com.hbm.util.BobMathUtil;

Expand All @@ -20,6 +26,7 @@
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.world.Explosion;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;

Expand All @@ -31,29 +38,38 @@ public MachineOilWell() {

@Override
public TileEntity createNewTileEntity(World world, int meta) {

if(meta >= 12) return new TileEntityMachineOilWell();
if(meta >= 6) return new TileEntityProxyCombo(false, true, true);
return null;
}

@Override
public int[] getDimensions() {
return new int[] {5, 0, 1, 1, 1, 1};
return new int[] {9, 0, 1, 1, 1, 1};
}

@Override
public int getOffset() {
return 0;
}

@Override
protected boolean checkRequirement(World world, int x, int y, int z, ForgeDirection dir, int o) {
return MultiblockHandlerXR.checkSpace(world, x, y, z, new int[] {1, -1, 0, 0, 0, 0}, x, y, z, dir) &&
MultiblockHandlerXR.checkSpace(world, x, y + 1, z, new int[] {8, 0, 1, 1, 1, 1}, x, y, z, dir) &&
MultiblockHandlerXR.checkSpace(world, x + 1, y + 1, z + 1, new int[] {-1, 1, 0, 0, 0, 0}, x, y, z, dir) &&
MultiblockHandlerXR.checkSpace(world, x + 1, y + 1, z - 1, new int[] {-1, 1, 0, 0, 0, 0}, x, y, z, dir) &&
MultiblockHandlerXR.checkSpace(world, x - 1, y + 1, z + 1, new int[] {-1, 1, 0, 0, 0, 0}, x, y, z, dir) &&
MultiblockHandlerXR.checkSpace(world, x - 1, y + 1, z - 1, new int[] {-1, 1, 0, 0, 0, 0}, x, y, z, dir);
}

@Override
public void fillSpace(World world, int x, int y, int z, ForgeDirection dir, int o) {
super.fillSpace(world, x, y, z, dir, o);
this.makeExtra(world, x + dir.offsetX * o + 1, y, z + dir.offsetZ * o);
this.makeExtra(world, x + dir.offsetX * o - 1, y, z + dir.offsetZ * o);
this.makeExtra(world, x + dir.offsetX * o, y, z + dir.offsetZ * o + 1);
this.makeExtra(world, x + dir.offsetX * o, y, z + dir.offsetZ * o - 1);
MultiblockHandlerXR.fillSpace(world, x, y, z, new int[] {1, -1, 0, 0, 0, 0}, this, dir);
MultiblockHandlerXR.fillSpace(world, x, y + 1, z, new int[] {8, 0, 1, 1, 1, 1}, this, dir);
MultiblockHandlerXR.fillSpace(world, x + 1, y + 1, z + 1, new int[] {-1, 1, 0, 0, 0, 0}, this, dir);
MultiblockHandlerXR.fillSpace(world, x + 1, y + 1, z - 1, new int[] {-1, 1, 0, 0, 0, 0}, this, dir);
MultiblockHandlerXR.fillSpace(world, x - 1, y + 1, z + 1, new int[] {-1, 1, 0, 0, 0, 0}, this, dir);
MultiblockHandlerXR.fillSpace(world, x - 1, y + 1, z - 1, new int[] {-1, 1, 0, 0, 0, 0}, this, dir);
}

@Override
Expand Down Expand Up @@ -89,4 +105,31 @@ public void addInformation(ItemStack stack, NBTTagCompound persistentTag, Entity
list.add(EnumChatFormatting.YELLOW + "" + tank.getFill() + "/" + tank.getMaxFill() + "mB " + tank.getTankType().getLocalizedName());
}
}

@Override
public void onBlockExploded(World world, int x, int y, int z, Explosion explosion) {

int[] pos = this.findCore(world, x, y, z);
if(pos == null) return;
TileEntity core = world.getTileEntity(pos[0], pos[1], pos[2]);
if(!(core instanceof TileEntityMachineOilWell)) return;

world.setBlockToAir(x, y, z);
onBlockDestroyedByExplosion(world, x, y, z, explosion);

TileEntityMachineOilWell well = (TileEntityMachineOilWell) core;
if(well.tanks[0].getFill() > 0 || well.tanks[1].getFill() > 0) {
well.tanks[0].setFill(0);
well.tanks[1].setFill(0);

ExplosionVNT xnt = new ExplosionVNT(world, pos[0] + 0.5, pos[1] + 0.5, pos[2] + 0.5, 15F);
xnt.setBlockAllocator(new BlockAllocatorStandard(24));
xnt.setBlockProcessor(new BlockProcessorStandard().setNoDrop());
xnt.setEntityProcessor(new EntityProcessorStandard());
xnt.setPlayerProcessor(new PlayerProcessorStandard());
xnt.explode();

ExplosionCreator.composeEffect(world, pos[0] + 0.5, pos[1] + 0.5, pos[2] + 0.5, 10, 2F, 0.5F, 25F, 5, 8, 20, 0.75F, 1F, -2F, 150);
}
}
}
3 changes: 0 additions & 3 deletions src/main/java/com/hbm/entity/EntityMappings.java
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,6 @@ public static void writeMappings() {
addEntity(EntityGrenadeShrapnel.class, "entity_grenade_shrapnel", 250);
addEntity(EntityBlackHole.class, "entity_black_hole", 250);
addEntity(EntityGrenadeBlackHole.class, "entity_grenade_black_hole", 250);
addEntity(EntityOilSpillFX.class, "entity_spill_fx", 1000);
addEntity(EntityOilSpill.class, "entity_oil_spill", 1000);
addEntity(EntityGasFX.class, "entity_spill_fx", 1000);
addEntity(EntityMinecartTest.class, "entity_minecart_test", 1000);
addEntity(EntitySparkBeam.class, "entity_spark_beam", 1000);
addEntity(EntityMissileDoomsday.class, "entity_missile_doomsday", 1000);
Expand Down
79 changes: 0 additions & 79 deletions src/main/java/com/hbm/entity/particle/EntityGasFX.java

This file was deleted.

74 changes: 0 additions & 74 deletions src/main/java/com/hbm/entity/particle/EntityOilSpillFX.java

This file was deleted.

56 changes: 0 additions & 56 deletions src/main/java/com/hbm/entity/projectile/EntityOilSpill.java

This file was deleted.

15 changes: 0 additions & 15 deletions src/main/java/com/hbm/explosion/ExplosionLarge.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import java.util.List;
import java.util.Random;

import com.hbm.entity.projectile.EntityOilSpill;
import com.hbm.entity.projectile.EntityRubble;
import com.hbm.entity.projectile.EntityShrapnel;
import com.hbm.packet.AuxParticlePacketNT;
Expand Down Expand Up @@ -154,20 +153,6 @@ public static void spawnMissileDebris(World world, double x, double y, double z,
}
}

public static void spawnOilSpills(World world, double x, double y, double z, int count) {

for(int i = 0; i < count; i++) {
EntityOilSpill shrapnel = new EntityOilSpill(world);
shrapnel.posX = x;
shrapnel.posY = y;
shrapnel.posZ = z;
shrapnel.motionY = ((rand.nextFloat() * 0.5) + 0.5) * (1 + (count / (15 + rand.nextInt(21)))) + (rand.nextFloat() / 50 * count) * 0.25F;
shrapnel.motionX = rand.nextGaussian() * 1 * (1 + (count / 50)) * 0.15F;
shrapnel.motionZ = rand.nextGaussian() * 1 * (1 + (count / 50)) * 0.15F;
world.spawnEntityInWorld(shrapnel);
}
}

public static void explode(World world, double x, double y, double z, float strength, boolean cloud, boolean rubble, boolean shrapnel, Entity exploder) {
world.createExplosion(exploder, x, y, z, strength, true);
if(cloud)
Expand Down
Loading

0 comments on commit 1caeec5

Please sign in to comment.