let's see if this does anything

This commit is contained in:
Boblet 2024-02-12 10:10:53 +01:00
parent a6ccd25119
commit 6ca2fc463a
11 changed files with 68 additions and 20 deletions

View File

@ -47,6 +47,7 @@
* Fallout rain now uses the same variable length code that the MK5 uses for optimal tick utilization, making it a lot faster
* Lighter sellafite variants should no longer replace darker ones in overlapping craters, making bombed-out landscapes look more natural
* Fallout's range-based effects now have a more natural gradient instead of creating smooth rings
* Fallout has been made significantly darker and less saturated to blend in with the crater more
## Fixed
* Fixed dupe caused by shift-clicking ashes out of the bricked furnace

View File

@ -4,13 +4,14 @@ import com.hbm.inventory.fluid.FluidType;
import com.hbm.packet.AuxParticlePacketNT;
import com.hbm.packet.PacketDispatcher;
import api.hbm.energy.ILoadedTile;
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 IFluidConnector {
public interface IFluidConnector extends ILoadedTile {
/**
* Returns the amount of fluid that remains

View File

@ -90,9 +90,9 @@ public class PipeNet implements IPipeNet {
@Override
public long transferFluid(long fill, int pressure) {
this.subscribers.removeIf(x ->
x == null || !(x instanceof TileEntity) || ((TileEntity)x).isInvalid()
subscribers.removeIf(x ->
x == null || !(x instanceof TileEntity) || ((TileEntity)x).isInvalid() || !x.isLoaded()
);
if(this.subscribers.isEmpty())

View File

@ -316,5 +316,18 @@ public class BlockPWR extends BlockContainer implements IBlockCT {
return false;
}
public boolean isLoaded = true;
@Override
public boolean isLoaded() {
return isLoaded;
}
@Override
public void onChunkUnload() {
super.onChunkUnload();
this.isLoaded = false;
}
}
}

View File

@ -38,6 +38,8 @@ public class Spotlight extends Block implements ISpotlight {
this.beamLength = beamLength;
this.type = type;
this.isOn = isOn;
this.setHardness(1F);
if(isOn) setLightLevel(1.0F);
}
@ -291,23 +293,17 @@ public class Spotlight extends Block implements ISpotlight {
}
protected Block getOff() {
if(this == ModBlocks.spotlight_incandescent)
return ModBlocks.spotlight_incandescent_off;
if(this == ModBlocks.spotlight_fluoro)
return ModBlocks.spotlight_fluoro_off;
if(this == ModBlocks.spotlight_halogen)
return ModBlocks.spotlight_halogen_off;
if(this == ModBlocks.spotlight_incandescent) return ModBlocks.spotlight_incandescent_off;
if(this == ModBlocks.spotlight_fluoro) return ModBlocks.spotlight_fluoro_off;
if(this == ModBlocks.spotlight_halogen) return ModBlocks.spotlight_halogen_off;
return this;
}
protected Block getOn() {
if(this == ModBlocks.spotlight_incandescent_off)
return ModBlocks.spotlight_incandescent;
if(this == ModBlocks.spotlight_fluoro_off)
return ModBlocks.spotlight_fluoro;
if(this == ModBlocks.spotlight_halogen_off)
return ModBlocks.spotlight_halogen;
if(this == ModBlocks.spotlight_incandescent_off) return ModBlocks.spotlight_incandescent;
if(this == ModBlocks.spotlight_fluoro_off) return ModBlocks.spotlight_fluoro;
if(this == ModBlocks.spotlight_halogen_off) return ModBlocks.spotlight_halogen;
return this;
}

View File

@ -72,8 +72,10 @@ public class AudioWrapperClient extends AudioWrapper {
@Override
public void stopSound() {
if(sound != null)
if(sound != null) {
sound.stop();
sound.setKeepAlive(0);
}
}
@Override

View File

@ -271,7 +271,6 @@ public class TileEntityDoorGeneric extends TileEntityLockableBase implements IAn
if(this.state == 1 && state == 2){ // Door transitioning to closed
if(audio != null) {
audio.stopSound();
audio.setKeepAlive(0);
}
if(doorType.getCloseSoundLoop() != null){
@ -294,12 +293,10 @@ public class TileEntityDoorGeneric extends TileEntityLockableBase implements IAn
if(state == 1 || state == 0){ // Door finished any transition
if(audio != null){
audio.stopSound();
audio.setKeepAlive(0);
audio = null;
}
if(audio2 != null){
audio2.stopSound();
audio.setKeepAlive(0);
audio2 = null;
}
}

View File

@ -325,4 +325,16 @@ public class TileEntityMachineStrandCaster extends TileEntityFoundryCastingBase
return bb;
}
public boolean isLoaded = true;
@Override
public boolean isLoaded() {
return isLoaded;
}
@Override
public void onChunkUnload() {
super.onChunkUnload();
this.isLoaded = false;
}
}

View File

@ -153,4 +153,17 @@ public class TileEntityPipeBaseNT extends TileEntity implements IFluidConductor
super.writeToNBT(nbt);
nbt.setInteger("type", this.type.getID());
}
public boolean isLoaded = true;
@Override
public boolean isLoaded() {
return isLoaded;
}
@Override
public void onChunkUnload() {
super.onChunkUnload();
this.isLoaded = false;
}
}

View File

@ -112,4 +112,17 @@ public class TileEntityPipeExhaust extends TileEntity implements IFluidConductor
if(type == Fluids.SMOKE_LEADED) nets[1] = network;
if(type == Fluids.SMOKE_POISON) nets[2] = network;
}
public boolean isLoaded = true;
@Override
public boolean isLoaded() {
return isLoaded;
}
@Override
public void onChunkUnload() {
super.onChunkUnload();
this.isLoaded = false;
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 718 B

After

Width:  |  Height:  |  Size: 745 B