This commit is contained in:
Boblet 2025-10-23 12:02:55 +02:00
parent b3aa9ab637
commit f9baf88f3c
3 changed files with 66 additions and 99 deletions

View File

@ -1,12 +1,6 @@
## Changed ## Changed
* Fortune on a drillbit now affects the quality of mined bedrock ore, each level of fortune adds 10% of the value to the item * Updated meteors
* The arc furnace now has a five slot input queue which accepts full stacks * Meteors will now punch through weak blocks like leaves instead of getting stuck on trees
* This removes the need for weird, hacky, buggy special implementations for inserters to work at a reasonable speed * Meteor impacts now have new visuals
* This also means that pneumatic tubes and other mods' automation systems can now insert into the arc furnace with little issue * Falling meteors will produce a sound instead of stealthily blowing people up
* Should the mode change and items in the input queue no longer be usable, they automatically become ejectable via automation * Fallen meteors will now be placed deeper into the actual crater instead of hovering awkwardly over the hole
* The input queue slots are always accessible, not just when the lid is open
* Removed all the NTM sand mix blocks and replaced them with a single block that uses metadata
* Removed all tiers of the deprecated PA power plugs except one, leaving the old PAs just barely operational
## Fixed
* Fixed a potential crash caused by inserters connected to multiblocks that don't have a core tile

View File

@ -9,13 +9,13 @@ import com.hbm.world.feature.Meteorite;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks; import net.minecraft.init.Blocks;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World; import net.minecraft.world.World;
import com.hbm.sound.AudioWrapper; import com.hbm.sound.AudioWrapper;
import com.hbm.util.fauxpointtwelve.BlockPos;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@ -25,24 +25,25 @@ public class EntityMeteor extends Entity {
public boolean safe = false; public boolean safe = false;
private AudioWrapper audioFly; private AudioWrapper audioFly;
public EntityMeteor(World p_i1582_1_) { public EntityMeteor(World world) {
super(p_i1582_1_); super(world);
this.ignoreFrustumCheck = true; this.ignoreFrustumCheck = true;
this.isImmuneToFire = true; this.isImmuneToFire = true;
this.setSize(4F, 4F); this.setSize(4F, 4F);
if(worldObj.isRemote) this.audioFly = MainRegistry.proxy.getLoopedSound("hbm:entity.meteoriteFallingLoop", 0, 0, 0, 1F, 100F, 0.9F + this.rand.nextFloat() * 0.2F, 0); if(worldObj.isRemote)
this.audioFly = MainRegistry.proxy.getLoopedSound("hbm:entity.meteoriteFallingLoop", 0, 0, 0, 1F, 100F, 0.9F + this.rand.nextFloat() * 0.2F, 0);
} }
public List<int[]> getBlocksInRadius(World world, int x, int y, int z, int radius) { public List<BlockPos> getBlocksInRadius(World world, int x, int y, int z, int radius) {
List<int[]> foundBlocks = new ArrayList<>(); List<BlockPos> foundBlocks = new ArrayList();
int rSq = radius * radius; int rSq = radius * radius;
for (int dx = -radius; dx <= radius; dx++) { for(int dx = -radius; dx <= radius; dx++) {
for (int dy = -radius; dy <= radius; dy++) { for(int dy = -radius; dy <= radius; dy++) {
for (int dz = -radius; dz <= radius; dz++) { for(int dz = -radius; dz <= radius; dz++) {
// Check if point (dx, dy, dz) lies inside the sphere // Check if point (dx, dy, dz) lies inside the sphere
if (dx * dx + dy * dy + dz * dz <= rSq) { if(dx * dx + dy * dy + dz * dz <= rSq) {
foundBlocks.add(new int[]{x + dx, y + dy, z + dz}); foundBlocks.add(new BlockPos(x + dx, y + dy, z + dz));
} }
} }
} }
@ -50,40 +51,35 @@ public class EntityMeteor extends Entity {
return foundBlocks; return foundBlocks;
} }
public void damageOrDestroyBlock(World world, int blockX, int blockY, int blockZ) public void damageOrDestroyBlock(World world, int blockX, int blockY, int blockZ) {
{
if(safe) return; if(safe) return;
// Get current block info // Get current block info
Block block = world.getBlock(blockX, blockY, blockZ); Block block = world.getBlock(blockX, blockY, blockZ);
if (block == null) return; if(block == null) return;
float hardness = block.getBlockHardness(world, blockX, blockY, blockZ); float hardness = block.getBlockHardness(world, blockX, blockY, blockZ);
// Check if the block is weak and can be destroyed // Check if the block is weak and can be destroyed
if (block == Blocks.leaves || block == Blocks.log || (hardness >= 0 && hardness <= 0.3F)) { if(block == Blocks.leaves || block == Blocks.log || (hardness >= 0 && hardness <= 0.3F)) {
// Destroy the block // Destroy the block
world.setBlockToAir(blockX, blockY, blockZ); world.setBlockToAir(blockX, blockY, blockZ);
} } else {
else {
// Found solid block // Found solid block
if(hardness < 0 || hardness > 5F) return; if(hardness < 0 || hardness > 5F) return;
if(rand.nextInt(6) == 1){
if(rand.nextInt(6) == 1) {
// Turn blocks into damaged variants // Turn blocks into damaged variants
if(block == Blocks.dirt) { if(block == Blocks.dirt) {
world.setBlock(blockX, blockY, blockZ, ModBlocks.dirt_dead); world.setBlock(blockX, blockY, blockZ, ModBlocks.dirt_dead);
} } else if(block == Blocks.sand) {
else if(block == Blocks.sand) {
if(rand.nextInt(2) == 1) { if(rand.nextInt(2) == 1) {
world.setBlock(blockX, blockY, blockZ, Blocks.sandstone); world.setBlock(blockX, blockY, blockZ, Blocks.sandstone);
} } else {
else {
world.setBlock(blockX, blockY, blockZ, Blocks.glass); world.setBlock(blockX, blockY, blockZ, Blocks.glass);
} }
} } else if(block == Blocks.stone) {
else if(block == Blocks.stone) {
world.setBlock(blockX, blockY, blockZ, Blocks.cobblestone); world.setBlock(blockX, blockY, blockZ, Blocks.cobblestone);
} } else if(block == Blocks.grass) {
else if(block == Blocks.grass) {
world.setBlock(blockX, blockY, blockZ, ModBlocks.waste_earth); world.setBlock(blockX, blockY, blockZ, ModBlocks.waste_earth);
} }
} }
@ -91,9 +87,8 @@ public class EntityMeteor extends Entity {
} }
public void clearMeteorPath(World world, int x, int y, int z) { public void clearMeteorPath(World world, int x, int y, int z) {
for (int[] blockPos : getBlocksInRadius(world, x, y, z, 5)) for(BlockPos blockPos : getBlocksInRadius(world, x, y, z, 5)) {
{ damageOrDestroyBlock(worldObj, blockPos.getX(), blockPos.getY(), blockPos.getZ());
damageOrDestroyBlock(worldObj, blockPos[0], blockPos[1], blockPos[2]);
} }
} }
@ -109,13 +104,12 @@ public class EntityMeteor extends Entity {
this.prevPosZ = this.posZ; this.prevPosZ = this.posZ;
this.motionY -= 0.03; this.motionY -= 0.03;
if(motionY < -2.5) if(motionY < -2.5) motionY = -2.5;
motionY = -2.5;
this.moveEntity(motionX, motionY, motionZ); this.moveEntity(motionX, motionY, motionZ);
if(!this.worldObj.isRemote && this.posY < 260) { if(!this.worldObj.isRemote && this.posY < 260) {
clearMeteorPath(worldObj, (int)this.posX, (int)this.posY, (int)this.posZ); clearMeteorPath(worldObj, (int) this.posX, (int) this.posY, (int) this.posZ);
if(this.onGround) { if(this.onGround) {
worldObj.createExplosion(this, this.posX, this.posY, this.posZ, 5 + rand.nextFloat(), !safe); worldObj.createExplosion(this, this.posX, this.posY, this.posZ, 5 + rand.nextFloat(), !safe);
@ -144,70 +138,49 @@ public class EntityMeteor extends Entity {
} }
// Sound // Sound
if(worldObj.isRemote){ if(worldObj.isRemote) {
if(this.isDead) { if(this.isDead) {
if(this.audioFly != null) this.audioFly.stopSound(); if(this.audioFly != null) this.audioFly.stopSound();
}
} else {
if(this.audioFly.isPlaying()) {
// Update sound if(this.audioFly.isPlaying()) {
this.audioFly.keepAlive(); // Update sound
this.audioFly.updateVolume(1F); this.audioFly.keepAlive();
this.audioFly.updatePosition((int)this.posX, (int)this.posY, (int)this.posZ); this.audioFly.updateVolume(1F);
} this.audioFly.updatePosition((int) this.posX, (int) this.posY, (int) this.posZ);
else } else {
{ // Start playing the sound
// Start playing the sound EntityPlayer player = MainRegistry.proxy.me();
EntityPlayer player = Minecraft.getMinecraft().thePlayer; double distance = player.getDistanceSq(this.posX, this.posY, this.posZ);
double distance = player.getDistanceSq(this.posX, this.posY, this.posZ); if(distance < 110 * 110) {
if (distance < 110 * 110) { this.audioFly.startSound();
this.audioFly.startSound(); }
} }
} }
}
if(WorldConfig.enableMeteorTails && worldObj.isRemote) { if(WorldConfig.enableMeteorTails) {
NBTTagCompound data = new NBTTagCompound(); NBTTagCompound data = new NBTTagCompound();
data.setString("type", "exhaust"); data.setString("type", "exhaust");
data.setString("mode", "meteor"); data.setString("mode", "meteor");
data.setInteger("count", 10); data.setInteger("count", 10);
data.setDouble("width", 1); data.setDouble("width", 1);
data.setDouble("posX", posX - motionX); data.setDouble("posX", posX - motionX);
data.setDouble("posY", posY - motionY); data.setDouble("posY", posY - motionY);
data.setDouble("posZ", posZ - motionZ); data.setDouble("posZ", posZ - motionZ);
MainRegistry.proxy.effectNT(data); MainRegistry.proxy.effectNT(data);
}
} }
} }
@Override @Override @SideOnly(Side.CLIENT) public boolean isInRangeToRenderDist(double distance) { return true; }
@SideOnly(Side.CLIENT) @Override @SideOnly(Side.CLIENT) public int getBrightnessForRender(float f) { return 15728880; }
public boolean isInRangeToRenderDist(double distance) { @Override public float getBrightness(float f) { return 1.0F; }
return true;
} @Override protected void entityInit() { }
@Override protected void readEntityFromNBT(NBTTagCompound nbt) { this.safe = nbt.getBoolean("safe"); }
@Override @Override protected void writeEntityToNBT(NBTTagCompound nbt) { nbt.setBoolean("safe", safe); }
@SideOnly(Side.CLIENT)
public int getBrightnessForRender(float p_70070_1_) {
return 15728880;
}
@Override
public float getBrightness(float p_70013_1_) {
return 1.0F;
}
@Override
protected void entityInit() { }
@Override
protected void readEntityFromNBT(NBTTagCompound nbt) {
this.safe = nbt.getBoolean("safe");
}
@Override
protected void writeEntityToNBT(NBTTagCompound nbt) {
nbt.setBoolean("safe", safe);
}
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 323 B