Hbm-s-Nuclear-Tech-GIT/com/hbm/main/ModEventHandlerClient.java
HbmMods 5525318475 Merge branch 'master' of https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT
# Conflicts:
#	assets/hbm/lang/de_DE.lang
#	assets/hbm/lang/en_US.lang
#	assets/hbm/textures/armor/hazmat_paa_1.png
#	assets/hbm/textures/armor/paa_1.png
#	com/hbm/blocks/BlockCrate.java
#	com/hbm/blocks/ModBlocks.java
#	com/hbm/explosion/ExplosionNukeGeneric.java
#	com/hbm/handler/FuelHandler.java
#	com/hbm/items/GunMP.java
#	com/hbm/items/GunRevolver.java
#	com/hbm/items/ItemStarterKit.java
#	com/hbm/items/ModArmor.java
#	com/hbm/items/ModItems.java
#	com/hbm/lib/Library.java
#	com/hbm/lib/RefStrings.java
#	com/hbm/main/ClientProxy.java
#	com/hbm/main/CraftingManager.java
#	com/hbm/main/MainRegistry.java
#	com/hbm/main/ModEventHandlerClient.java
#	com/hbm/sound/MovingSoundPlayerLoop.java
#	com/hbm/sound/MovingSoundXVL1456.java
2016-10-30 20:38:35 +01:00

102 lines
4.6 KiB
Java

package com.hbm.main;
<<<<<<< HEAD
import java.util.ArrayList;
import java.util.List;
=======
>>>>>>> 540fb3d256a0f4ae6a8b1db586f8e9cfd6ed7372
import com.hbm.entity.EntityChopperMine;
import com.hbm.entity.EntityHunterChopper;
import com.hbm.lib.Library;
import com.hbm.sound.MovingSoundChopper;
import com.hbm.sound.MovingSoundChopperMine;
import com.hbm.sound.MovingSoundCrashing;
import com.hbm.sound.MovingSoundPlayerLoop;
import com.hbm.sound.MovingSoundXVL1456;
import com.hbm.sound.MovingSoundPlayerLoop.EnumHbmSound;
import codechicken.lib.render.IFaceRenderer;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import net.minecraft.client.Minecraft;
import net.minecraft.client.audio.PositionedSound;
import net.minecraft.client.multiplayer.WorldClient;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.event.sound.PlaySoundEvent17;
<<<<<<< HEAD
import net.minecraftforge.event.entity.EntityJoinWorldEvent;
=======
>>>>>>> 540fb3d256a0f4ae6a8b1db586f8e9cfd6ed7372
public class ModEventHandlerClient {
@SubscribeEvent
public void onPlaySound(PlaySoundEvent17 e) {
ResourceLocation r = e.sound.getPositionedSoundLocation();
WorldClient wc = Minecraft.getMinecraft().theWorld;
<<<<<<< HEAD
//Alright, alright, I give the fuck up, you've wasted my time enough with this bullshit. You win.
//A winner is you.
//Conglaturations.
//Fuck you.
=======
>>>>>>> 540fb3d256a0f4ae6a8b1db586f8e9cfd6ed7372
if(r.toString().equals("hbm:misc.nullTau") && Library.getClosestPlayerForSound(wc, e.sound.getXPosF(), e.sound.getYPosF(), e.sound.getZPosF(), 2) != null)
{
EntityPlayer ent = Library.getClosestPlayerForSound(wc, e.sound.getXPosF(), e.sound.getYPosF(), e.sound.getZPosF(), 2);
if(MovingSoundPlayerLoop.getSoundByPlayer(ent, EnumHbmSound.soundTauLoop) == null) {
MovingSoundPlayerLoop.globalSoundList.add(new MovingSoundXVL1456(new ResourceLocation("hbm:weapon.tauChargeLoop2"), ent, EnumHbmSound.soundTauLoop));
MovingSoundPlayerLoop.getSoundByPlayer(ent, EnumHbmSound.soundTauLoop).setPitch(0.5F);
} else {
if(MovingSoundPlayerLoop.getSoundByPlayer(ent, EnumHbmSound.soundTauLoop).getPitch() < 1.5F)
MovingSoundPlayerLoop.getSoundByPlayer(ent, EnumHbmSound.soundTauLoop).setPitch(MovingSoundPlayerLoop.getSoundByPlayer(ent, EnumHbmSound.soundTauLoop).getPitch() + 0.01F);
}
}
if(r.toString().equals("hbm:misc.nullChopper") && Library.getClosestChopperForSound(wc, e.sound.getXPosF(), e.sound.getYPosF(), e.sound.getZPosF(), 2) != null)
{
EntityHunterChopper ent = Library.getClosestChopperForSound(wc, e.sound.getXPosF(), e.sound.getYPosF(), e.sound.getZPosF(), 2);
if(MovingSoundPlayerLoop.getSoundByPlayer(ent, EnumHbmSound.soundChopperLoop) == null) {
MovingSoundPlayerLoop.globalSoundList.add(new MovingSoundChopper(new ResourceLocation("hbm:entity.chopperFlyingLoop"), ent, EnumHbmSound.soundChopperLoop));
MovingSoundPlayerLoop.getSoundByPlayer(ent, EnumHbmSound.soundChopperLoop).setVolume(10.0F);
}
}
if(r.toString().equals("hbm:misc.nullCrashing") && Library.getClosestChopperForSound(wc, e.sound.getXPosF(), e.sound.getYPosF(), e.sound.getZPosF(), 2) != null)
{
EntityHunterChopper ent = Library.getClosestChopperForSound(wc, e.sound.getXPosF(), e.sound.getYPosF(), e.sound.getZPosF(), 2);
if(MovingSoundPlayerLoop.getSoundByPlayer(ent, EnumHbmSound.soundCrashingLoop) == null) {
MovingSoundPlayerLoop.globalSoundList.add(new MovingSoundCrashing(new ResourceLocation("hbm:entity.chopperCrashingLoop"), ent, EnumHbmSound.soundCrashingLoop));
MovingSoundPlayerLoop.getSoundByPlayer(ent, EnumHbmSound.soundCrashingLoop).setVolume(10.0F);
}
}
if(r.toString().equals("hbm:misc.nullMine") && Library.getClosestMineForSound(wc, e.sound.getXPosF(), e.sound.getYPosF(), e.sound.getZPosF(), 2) != null)
{
EntityChopperMine ent = Library.getClosestMineForSound(wc, e.sound.getXPosF(), e.sound.getYPosF(), e.sound.getZPosF(), 2);
if(MovingSoundPlayerLoop.getSoundByPlayer(ent, EnumHbmSound.soundMineLoop) == null) {
MovingSoundPlayerLoop.globalSoundList.add(new MovingSoundChopperMine(new ResourceLocation("hbm:entity.chopperMineLoop"), ent, EnumHbmSound.soundMineLoop));
MovingSoundPlayerLoop.getSoundByPlayer(ent, EnumHbmSound.soundMineLoop).setVolume(10.0F);
}
}
for(MovingSoundPlayerLoop sounds : MovingSoundPlayerLoop.globalSoundList)
{
if(!sounds.init || sounds.isDonePlaying()) {
sounds.init = true;
sounds.setDone(false);
Minecraft.getMinecraft().getSoundHandler().playSound(sounds);
}
}
}
}