From d4af86783256df398436d551b05148f73e8d95f7 Mon Sep 17 00:00:00 2001 From: Boblet Date: Mon, 28 Feb 2022 16:58:24 +0100 Subject: [PATCH] fixed chemplant accepting fluids in output, some new sound stuff --- .../java/com/hbm/sound/nt/ISoundSourceTE.java | 17 ++++ src/main/java/com/hbm/sound/nt/SoundTE.java | 90 ++++++++++++++++++ .../machine/TileEntityMachineChemplant.java | 7 +- .../assets/hbm/textures/armor/wings_black.png | Bin 0 -> 346 bytes 4 files changed, 110 insertions(+), 4 deletions(-) create mode 100644 src/main/java/com/hbm/sound/nt/ISoundSourceTE.java create mode 100644 src/main/java/com/hbm/sound/nt/SoundTE.java create mode 100644 src/main/resources/assets/hbm/textures/armor/wings_black.png diff --git a/src/main/java/com/hbm/sound/nt/ISoundSourceTE.java b/src/main/java/com/hbm/sound/nt/ISoundSourceTE.java new file mode 100644 index 000000000..a3aa01260 --- /dev/null +++ b/src/main/java/com/hbm/sound/nt/ISoundSourceTE.java @@ -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; + } +} diff --git a/src/main/java/com/hbm/sound/nt/SoundTE.java b/src/main/java/com/hbm/sound/nt/SoundTE.java new file mode 100644 index 000000000..d6cc4b345 --- /dev/null +++ b/src/main/java/com/hbm/sound/nt/SoundTE.java @@ -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; + } +} diff --git a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineChemplant.java b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineChemplant.java index 24a59581e..17beab8fc 100644 --- a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineChemplant.java +++ b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineChemplant.java @@ -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(); } } diff --git a/src/main/resources/assets/hbm/textures/armor/wings_black.png b/src/main/resources/assets/hbm/textures/armor/wings_black.png new file mode 100644 index 0000000000000000000000000000000000000000..134a08b53592cdb162256ce0cd2c97c6b56ede11 GIT binary patch literal 346 zcmV-g0j2(lP)mcT(NHM?^$k$C22r4)*yI6O>9s;WX=*ZA8ih!O7zIXuM|kw__{7T}Tq zn9H&RaJ?qR7)U9R=Xuy<2cxxyG3MGswANk$u}INcFW*m_>WyEQaxVjTL5REH*Vz;j zn+)Jih`ae1WdQ%LOz05bL<~P>zCAu=vxg87i0HjIf$95xSG`vVV+=$D#uzx~9|;zU zw}qr>x`?=qGt)H9uKJabEXy8bFvdO>?hJTOh!6sta|j_Igb0x<7%L%N*I}9_SZiUe s#V`yZas^{0q-|S_