Simplified block clearing and decoration.

This commit is contained in:
DangerousMilk 2025-10-17 20:41:28 +02:00
parent 2f7c013423
commit f2e733679c
2 changed files with 20 additions and 16 deletions

View File

@ -93,20 +93,7 @@ public class EntityMeteor extends Entity {
return false;
}
public boolean clearMeteorPath(World world, int x, int y, int z) {
boolean foundSolidBlock = false;
for (int[] blockPos : getBlocksInRadius(world, x, y, z, 5))
{
if(damageOrDestroyBlock(worldObj, blockPos[0], blockPos[1], blockPos[2])) {
foundSolidBlock = true;
}
}
return foundSolidBlock;
}
public void decorateCrater(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))
{
damageOrDestroyBlock(worldObj, blockPos[0], blockPos[1], blockPos[2]);
@ -131,7 +118,8 @@ public class EntityMeteor extends Entity {
this.moveEntity(motionX, motionY, motionZ);
if(!this.worldObj.isRemote && this.posY < 260) {
if(clearMeteorPath(worldObj, (int)this.posX, (int)this.posY, (int)this.posZ) && this.onGround) {
clearMeteorPath(worldObj, (int)this.posX, (int)this.posY, (int)this.posZ);
if(this.onGround) {
worldObj.createExplosion(this, this.posX, this.posY, this.posZ, 5 + rand.nextFloat(), !safe);
if(WorldConfig.enableMeteorTails) {
@ -150,7 +138,7 @@ public class EntityMeteor extends Entity {
int spawnPosZ = (int) (Math.round(this.posZ - 0.5D) + (safe ? 0 : (this.motionZ * 5)));
(new Meteorite()).generate(worldObj, rand, spawnPosX, spawnPosY, spawnPosZ, safe, true, true);
decorateCrater(worldObj, spawnPosX, spawnPosY, spawnPosZ);
clearMeteorPath(worldObj, spawnPosX, spawnPosY, spawnPosZ);
// Sound
if(this.audioFly != null) this.audioFly.stopSound();

16
vlc-log.txt Normal file
View File

@ -0,0 +1,16 @@
-- logger module started --
main: Running vlc with the default interface. Use 'cvlc' to use vlc without interface.
glconv_vaapi_x11 error: vaInitialize: unknown libva error
glconv_vaapi_drm error: vaInitialize: unknown libva error
glconv_vaapi_drm error: vaInitialize: operation failed
avcodec: Using NVIDIA VDPAU Driver Shared Library 580.95.05 Tue Sep 23 09:39:47 UTC 2025 for hardware decoding
main error: Timestamp conversion failed for 7671001: no reference clock
main error: Could not convert timestamp 0 for FFmpeg
-- logger module stopped --
-- logger module started --
main: Running vlc with the default interface. Use 'cvlc' to use vlc without interface.
glconv_vaapi_x11 error: vaInitialize: unknown libva error
glconv_vaapi_drm error: vaInitialize: unknown libva error
glconv_vaapi_drm error: vaInitialize: operation failed
avcodec: Using NVIDIA VDPAU Driver Shared Library 580.95.05 Tue Sep 23 09:39:47 UTC 2025 for hardware decoding
-- logger module stopped --