diff --git a/src/main/java/malte0811/industrialWires/IWPotions.java b/src/main/java/malte0811/industrialWires/IWPotions.java index 2b0e535..36dff05 100644 --- a/src/main/java/malte0811/industrialWires/IWPotions.java +++ b/src/main/java/malte0811/industrialWires/IWPotions.java @@ -23,6 +23,8 @@ import net.minecraft.entity.EntityLivingBase; import net.minecraft.potion.Potion; import net.minecraft.util.ResourceLocation; import net.minecraftforge.fml.common.registry.ForgeRegistries; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import javax.annotation.Nonnull; @@ -32,8 +34,10 @@ public class IWPotions { tinnitus = new PotionTinnitus(); } static class PotionTinnitus extends Potion { + ResourceLocation tex = new ResourceLocation(IndustrialWires.MODID,"textures/gui/tinnitus.png"); protected PotionTinnitus() { super(true, 0xffff0000); + setIconIndex(0, 0); this.setRegistryName(new ResourceLocation(IndustrialWires.MODID, "tinnitus")); ForgeRegistries.POTIONS.register(this); } @@ -52,5 +56,13 @@ public class IWPotions { } } } + + @Override + @SideOnly(Side.CLIENT) + public int getStatusIconIndex() + { + Minecraft.getMinecraft().getTextureManager().bindTexture(tex); + return super.getStatusIconIndex(); + } } } diff --git a/src/main/java/malte0811/industrialWires/blocks/hv/TileEntityMarx.java b/src/main/java/malte0811/industrialWires/blocks/hv/TileEntityMarx.java index 1dd1c3d..f4c57dc 100644 --- a/src/main/java/malte0811/industrialWires/blocks/hv/TileEntityMarx.java +++ b/src/main/java/malte0811/industrialWires/blocks/hv/TileEntityMarx.java @@ -292,7 +292,7 @@ public class TileEntityMarx extends TileEntityIWMultiblock implements ITickable, net.updateValues(); NBTTagCompound data = new NBTTagCompound(); if (failed) { - energyStored = -1; + energyStored = -energyStored; } else { int seed = Utils.RAND.nextInt(); genDischarge((float) energyStored, seed);//TODO test on a dedicated server @@ -422,7 +422,7 @@ public class TileEntityMarx extends TileEntityIWMultiblock implements ITickable, if (dischargeData==null) { dischargeData = new Discharge(stageCount); } - dischargeData.energy = -1; + dischargeData.energy = energy; } } diff --git a/src/main/java/malte0811/industrialWires/client/ClientProxy.java b/src/main/java/malte0811/industrialWires/client/ClientProxy.java index a515e13..6cde3fb 100644 --- a/src/main/java/malte0811/industrialWires/client/ClientProxy.java +++ b/src/main/java/malte0811/industrialWires/client/ClientProxy.java @@ -280,6 +280,7 @@ public class ClientProxy extends CommonProxy { private static ResourceLocation jacobsMiddle = new ResourceLocation(IndustrialWires.MODID, "jacobs_ladder_middle"); private static ResourceLocation jacobsEnd = new ResourceLocation(IndustrialWires.MODID, "jacobs_ladder_end");//~210 ms ~= 4 ticks private static ResourceLocation marxBang = new ResourceLocation(IndustrialWires.MODID, "marx_bang"); + private static ResourceLocation marxPop = new ResourceLocation(IndustrialWires.MODID, "marx_pop"); @Override public void playJacobsLadderSound(TileEntityJacobsLadder te, int phase, Vec3d soundPos) { @@ -308,10 +309,12 @@ public class ClientProxy extends CommonProxy { @Override public void playMarxBang(TileEntityMarx te, Vec3d pos, float energy) { + ResourceLocation soundLoc = marxBang; if (energy<0) { - energy = .05F; + energy = -energy; + soundLoc = marxPop; } - PositionedSoundRecord sound = new PositionedSoundRecord(marxBang, SoundCategory.BLOCKS, 5*energy, 1, false, 0, ISound.AttenuationType.LINEAR, (float) pos.x, (float) pos.y, (float) pos.z); + PositionedSoundRecord sound = new PositionedSoundRecord(soundLoc, SoundCategory.BLOCKS, 5*energy, 1, false, 0, ISound.AttenuationType.LINEAR, (float) pos.x, (float) pos.y, (float) pos.z); ClientUtils.mc().getSoundHandler().playSound(sound); playingSounds.put(te.getPos(), sound); } diff --git a/src/main/resources/assets/industrialwires/lang/en_US.lang b/src/main/resources/assets/industrialwires/lang/en_US.lang index dbee9b7..2c3ac91 100644 --- a/src/main/resources/assets/industrialwires/lang/en_US.lang +++ b/src/main/resources/assets/industrialwires/lang/en_US.lang @@ -46,7 +46,7 @@ item.industrialwires.key.key_ring.name=Key Ring industrialwires.subtitle.tinnitus=You have a tinnitus industrialwires.subtitle.jacobs_ladder=Jacob's ladder hums industrialwires.subtitle.marx_bang=Marx generator discharges - +industrialwires.subtitle.marx_pop=Marx generator misfires industrialwires.desc.wireLength=Wire length: %1s block(s) industrialwires.desc.recipe=Please check the Engineer's manual for recipe details diff --git a/src/main/resources/assets/industrialwires/sounds.json b/src/main/resources/assets/industrialwires/sounds.json index bba18be..a33966f 100644 --- a/src/main/resources/assets/industrialwires/sounds.json +++ b/src/main/resources/assets/industrialwires/sounds.json @@ -33,5 +33,12 @@ "sounds": [ "industrialwires:marx_bang" ] + }, + "marx_pop": { + "category": "block", + "subtitle": "industrialwires.subtitle.marx_pop", + "sounds": [ + "industrialwires:marx_pop" + ] } } diff --git a/src/main/resources/assets/industrialwires/sounds/marx_pop.ogg b/src/main/resources/assets/industrialwires/sounds/marx_pop.ogg new file mode 100644 index 0000000..c51a764 Binary files /dev/null and b/src/main/resources/assets/industrialwires/sounds/marx_pop.ogg differ diff --git a/src/main/resources/assets/industrialwires/textures/gui/tinnitus.png b/src/main/resources/assets/industrialwires/textures/gui/tinnitus.png new file mode 100644 index 0000000..131e5c4 Binary files /dev/null and b/src/main/resources/assets/industrialwires/textures/gui/tinnitus.png differ