mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
fixed chemplant accepting fluids in output, some new sound stuff
This commit is contained in:
parent
ca72f41ba8
commit
d4af867832
17
src/main/java/com/hbm/sound/nt/ISoundSourceTE.java
Normal file
17
src/main/java/com/hbm/sound/nt/ISoundSourceTE.java
Normal file
@ -0,0 +1,17 @@
|
||||
package com.hbm.sound.nt;
|
||||
|
||||
import net.minecraft.util.Vec3;
|
||||
|
||||
public interface ISoundSourceTE {
|
||||
|
||||
public Vec3 getSoundLocation();
|
||||
public boolean isPlaying();
|
||||
|
||||
public default float getVolume() {
|
||||
return 1F;
|
||||
}
|
||||
|
||||
public default float getPitch() {
|
||||
return 1F;
|
||||
}
|
||||
}
|
||||
90
src/main/java/com/hbm/sound/nt/SoundTE.java
Normal file
90
src/main/java/com/hbm/sound/nt/SoundTE.java
Normal file
@ -0,0 +1,90 @@
|
||||
package com.hbm.sound.nt;
|
||||
|
||||
import net.minecraft.client.audio.ITickableSound;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.Vec3;
|
||||
|
||||
public class SoundTE implements ITickableSound {
|
||||
|
||||
ISoundSourceTE source;
|
||||
|
||||
private ResourceLocation sound;
|
||||
private boolean canRepeat = true;
|
||||
private int repeatDelay = 0;
|
||||
private boolean donePlaying = true;
|
||||
private float soundX;
|
||||
private float soundY;
|
||||
private float soundZ;
|
||||
private float volume;
|
||||
private float pitch;
|
||||
|
||||
public SoundTE(String sound) {
|
||||
this.sound = new ResourceLocation(sound);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResourceLocation getPositionedSoundLocation() {
|
||||
return this.sound;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canRepeat() {
|
||||
return this.canRepeat;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRepeatDelay() {
|
||||
return this.repeatDelay;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getVolume() {
|
||||
return this.volume;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getPitch() {
|
||||
return this.pitch;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getXPosF() {
|
||||
return this.soundX;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getYPosF() {
|
||||
return this.soundY;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getZPosF() {
|
||||
return this.soundZ;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AttenuationType getAttenuationType() {
|
||||
return AttenuationType.LINEAR;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
|
||||
if(this.source == null)
|
||||
return;
|
||||
|
||||
this.volume = this.source.getVolume();
|
||||
this.pitch = this.source.getPitch();
|
||||
|
||||
Vec3 pos = this.source.getSoundLocation();
|
||||
this.soundX = (float) pos.xCoord;
|
||||
this.soundY = (float) pos.yCoord;
|
||||
this.soundZ = (float) pos.zCoord;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDonePlaying() {
|
||||
return this.donePlaying;
|
||||
}
|
||||
}
|
||||
@ -411,10 +411,9 @@ public class TileEntityMachineChemplant extends TileEntityMachineBase implements
|
||||
@Override
|
||||
public int getMaxFluidFill(FluidType type) {
|
||||
|
||||
for(FluidTank tank : tanks) {
|
||||
if(tank.getTankType() == type) {
|
||||
|
||||
return tank.getMaxFill();
|
||||
for(int i = 0; i < 2; i++) {
|
||||
if(tanks[i].getTankType() == type) {
|
||||
return tanks[i].getMaxFill();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
BIN
src/main/resources/assets/hbm/textures/armor/wings_black.png
Normal file
BIN
src/main/resources/assets/hbm/textures/armor/wings_black.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 346 B |
Loading…
x
Reference in New Issue
Block a user