net.minecraft.client.sound.PositionedSoundInstance Java Examples

The following examples show how to use net.minecraft.client.sound.PositionedSoundInstance. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: NavigatorFeatureScreen.java    From Wurst7 with GNU General Public License v3.0 5 votes vote down vote up
@Override
protected void onMouseClick(double x, double y, int button)
{
	// popups
	if(WurstClient.INSTANCE.getGui().handleNavigatorPopupClick(
		x - middleX + 154, y - 60 - scroll + 13, button))
		return;
	
	Rectangle area = new Rectangle(width / 2 - 154, 60, 308, height - 103);
	if(!area.contains(x, y))
		return;
	
	// buttons
	if(activeButton != null)
	{
		client.getSoundManager().play(
			PositionedSoundInstance.master(SoundEvents.UI_BUTTON_CLICK, 1));
		activeButton.press();
		WurstClient.INSTANCE.getNavigator()
			.addPreference(feature.getName());
		return;
	}
	
	// component settings
	WurstClient.INSTANCE.getGui().handleNavigatorMouseClick(
		x - middleX + 154, y - 60 - scroll - window.getY(), button, window);
}
 
Example #2
Source File: WToggleButton.java    From LibGui with MIT License 5 votes vote down vote up
@Environment(EnvType.CLIENT)
@Override
public void onClick(int x, int y, int button) {
	super.onClick(x, y, button);
	
	MinecraftClient.getInstance().getSoundManager().play(PositionedSoundInstance.master(SoundEvents.UI_BUTTON_CLICK, 1.0F));

	this.isOn = !this.isOn;
	onToggle(this.isOn);
}
 
Example #3
Source File: WButton.java    From LibGui with MIT License 5 votes vote down vote up
@Environment(EnvType.CLIENT)
@Override
public void onClick(int x, int y, int button) {
	super.onClick(x, y, button);
	
	if (enabled && isWithinBounds(x, y)) {
		MinecraftClient.getInstance().getSoundManager().play(PositionedSoundInstance.master(SoundEvents.UI_BUTTON_CLICK, 1.0F));

		if (onClick!=null) onClick.run();
	}
}
 
Example #4
Source File: NotebotUtils.java    From bleachhack-1.14 with GNU General Public License v3.0 5 votes vote down vote up
private static void play(SoundEvent sound, float pitch) {
	if (MinecraftClient.getInstance().world != null && MinecraftClient.getInstance().player != null) {
		MinecraftClient.getInstance().world.playSound(MinecraftClient.getInstance().player,
				MinecraftClient.getInstance().player.getBlockPos(), sound, SoundCategory.RECORDS, 3.0F, pitch);
	} else {
		MinecraftClient.getInstance().getSoundManager().play(
				new PositionedSoundInstance(sound, SoundCategory.RECORDS, 3.0F, pitch, 0F, 0F, 0F));
	}
}
 
Example #5
Source File: Window.java    From bleachhack-1.14 with GNU General Public License v3.0 5 votes vote down vote up
public void onMousePressed(int x, int y) {
	if (x > x1 + 2 && x < x2 - 2 && y > y1 + 2 && y < y1 + 12) {
		dragging = true;
		dragOffX = x - x1;
		dragOffY = y - y1;
	}
	
	for (WindowButton w: buttons) {
		if (x >= x1 + w.x1 && x <= x1 + w.x2 && y >= y1 + w.y1 && y <= y1 + w.y2) {
			w.action.run();
			MinecraftClient.getInstance().getSoundManager().play(PositionedSoundInstance.master(SoundEvents.UI_BUTTON_CLICK, 1.0F));
		}
	}
}
 
Example #6
Source File: Window.java    From bleachhack-1.14 with GNU General Public License v3.0 5 votes vote down vote up
public void onMousePressed(int x, int y) {
	if (x > x1 + 2 && x < x2 - 2 && y > y1 + 2 && y < y1 + 12) {
		dragging = true;
		dragOffX = x - x1;
		dragOffY = y - y1;
	}
	
	for (WindowButton w: buttons) {
		if (x >= x1 + w.x1 && x <= x1 + w.x2 && y >= y1 + w.y1 && y <= y1 + w.y2) {
			w.action.run();
			MinecraftClient.getInstance().getSoundManager().play(PositionedSoundInstance.master(SoundEvents.UI_BUTTON_CLICK, 1.0F));
		}
	}
}
 
Example #7
Source File: NotebotUtils.java    From bleachhack-1.14 with GNU General Public License v3.0 5 votes vote down vote up
private static void play(SoundEvent sound, float pitch) {
	if (MinecraftClient.getInstance().world != null && MinecraftClient.getInstance().player != null) {
		MinecraftClient.getInstance().world.playSound(MinecraftClient.getInstance().player,
				MinecraftClient.getInstance().player.getBlockPos(), sound, SoundCategory.RECORDS, 3.0F, pitch);
	} else {
		MinecraftClient.getInstance().getSoundManager().play(
				new PositionedSoundInstance(sound, SoundCategory.RECORDS, 3.0F, pitch, 0F, 0F, 0F));
	}
}
 
Example #8
Source File: Window.java    From bleachhack-1.14 with GNU General Public License v3.0 5 votes vote down vote up
public void onMousePressed(int x, int y) {
	if (x > x1 + 2 && x < x2 - 2 && y > y1 + 2 && y < y1 + 12) {
		dragging = true;
		dragOffX = x - x1;
		dragOffY = y - y1;
	}
	
	for (WindowButton w: buttons) {
		if (x >= x1 + w.x1 && x <= x1 + w.x2 && y >= y1 + w.y1 && y <= y1 + w.y2) {
			w.action.run();
			MinecraftClient.getInstance().getSoundManager().play(PositionedSoundInstance.master(SoundEvents.UI_BUTTON_CLICK, 1.0F));
		}
	}
}
 
Example #9
Source File: NotebotUtils.java    From bleachhack-1.14 with GNU General Public License v3.0 5 votes vote down vote up
private static void play(SoundEvent sound, float pitch) {
	if (MinecraftClient.getInstance().world != null && MinecraftClient.getInstance().player != null) {
		MinecraftClient.getInstance().world.playSound(MinecraftClient.getInstance().player,
				MinecraftClient.getInstance().player.getBlockPos(), sound, SoundCategory.RECORDS, 3.0F, pitch);
	} else {
		MinecraftClient.getInstance().getSoundManager().play(
				new PositionedSoundInstance(sound, SoundCategory.RECORDS, 3.0F, pitch, 0F, 0F, 0F));
	}
}
 
Example #10
Source File: BleachCheckbox.java    From bleachhack-1.14 with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void onPress() {
	MinecraftClient.getInstance().getSoundManager().play(PositionedSoundInstance.master(SoundEvents.UI_BUTTON_CLICK, 1.0F));
	checked = !checked;
}
 
Example #11
Source File: MachineHandledScreen.java    From Galacticraft-Rewoven with MIT License 4 votes vote down vote up
private void playButtonSound() {
    this.client.getSoundManager().play(PositionedSoundInstance.master(SoundEvents.UI_BUTTON_CLICK, 1.0F));
}
 
Example #12
Source File: ClickGuiScreen.java    From bleachhack-1.14 with GNU General Public License v3.0 4 votes vote down vote up
public void render(int mX, int mY, float float_1) {
	this.renderBackground();
	font.draw("BleachHack-1.15-" + BleachHack.VERSION, 3, 3, 0x305090);
	font.draw("BleachHack-1.15-" + BleachHack.VERSION, 2, 2, 0x6090d0);
	font.drawWithShadow("Hover over a bind setting and press a key to change a bind" , 2, height-10, 0xff9999);
	font.drawWithShadow("Use .guireset to reset the gui" , 2, height-20, 0x9999ff);
	
	super.render(mX, mY, float_1);
	
	mouseX = mX;
	mouseY = mY;
	
	len = Math.max(50, (int) Math.round(ModuleManager.getModule(ClickGui.class).getSettings().get(0).toSlider().getValue()));
	for (Window w: windows) {
		if (w instanceof ModuleWindow) {
			ModuleWindow mw = (ModuleWindow) w;
			
			int x = mw.x1 + 1;
			int y = mw.y1 + 13;
			mw.x2 = x + len + 1;
			
			if (rmDown && mouseOver(x, y-12, x+len, y)) {
				minecraft.getSoundManager().play(PositionedSoundInstance.master(SoundEvents.UI_BUTTON_CLICK, 1.0F));
				mw.hiding = !mw.hiding;
			}
			
			if (mw.hiding) {
				mw.y2 = y;
				continue;
			} else {
				mw.y2 = y + mw.getHeight();
			}
			
			int count = 0;
			for (Entry<Module, Boolean> m: new LinkedHashMap<>(mw.mods).entrySet()) {
				if (m.getValue()) fillReverseGrey(x, y+(count*12), x+len-1, y+12+(count*12));
				fill(x, y+(count*12), x+len, y+12+(count*12),
						mouseOver(x, y+(count*12), x+len, y+12+(count*12)) ? 0x70303070 : 0x00000000);
				
				font.drawWithShadow(cutText(m.getKey().getName(), len),
						x+2, y+2+(count*12), m.getKey().isToggled() ? 0x70efe0 : 0xc0c0c0);
				
				//fill(m.getValue() ? x+len-2 : x+len-1, y+(count*12), 
				//		x+len, y+12+(count*12), m.getValue() ? 0x9f70fff0 : 0x5f70fff0);
				
				/* Set which module settings show on */
				if (mouseOver(x, y+(count*12), x+len, y+12+(count*12))) {
					GL11.glTranslated(0, 0, 300);
					/* Match lines to end of words */
			        Matcher mat = Pattern.compile("\\b.{1,22}\\b\\W?").matcher(m.getKey().getDesc());

			        int c2 = 0;
			        int c3 = 0;
			        while(mat.find()) { c2++; } mat.reset();
			        
			        while(mat.find()) {
			        	fill(x+len+3, y-1+(count*12)-(c2 * 10)+(c3 * 10),
			        			x+len+6+font.getStringWidth(mat.group().trim()), y+(count*12)-(c2 * 10)+(c3 * 10)+9,
								0x90000000);
			        	font.drawWithShadow(mat.group(), x+len+5, y+(count*12)-(c2 * 10)+(c3 * 10), -1);
						c3++;
					}
					if (lmDown) m.getKey().toggle();
					if (rmDown) mw.mods.replace(m.getKey(), !m.getValue());
					if (lmDown || rmDown) minecraft.getSoundManager().play(PositionedSoundInstance.master(SoundEvents.UI_BUTTON_CLICK, 1.0F));
					GL11.glTranslated(0, 0, -300);
				}
				
				/* draw settings */
				if (m.getValue()) {
					for (SettingBase s: m.getKey().getSettings()) {
						count++;
						if (s instanceof SettingMode) drawModeSetting(s.toMode(), x, y+(count*12));
						if (s instanceof SettingToggle) drawToggleSetting(s.toToggle(), x, y+(count*12));
						if (s instanceof SettingSlider) drawSliderSetting(s.toSlider(), x, y+(count*12));
						//fill(x+len-1, y+(count*12), x+len, y+12+(count*12), 0x9f70fff0);
					}
					count++;
					drawBindSetting(m.getKey(), keyDown, x, y+(count*12));
					//fill(x+len-1, y+(count*12), x+len, y+12+(count*12), 0x9f70fff0);
				}
				count++;
			}
		}
	}
	
	lmDown = false;
	rmDown = false;
	keyDown = -1;
}
 
Example #13
Source File: BleachCheckbox.java    From bleachhack-1.14 with GNU General Public License v3.0 4 votes vote down vote up
public void onPress() {
	MinecraftClient.getInstance().getSoundManager().play(PositionedSoundInstance.master(SoundEvents.UI_BUTTON_CLICK, 1.0F));
	checked = !checked;
}
 
Example #14
Source File: ClickGuiScreen.java    From bleachhack-1.14 with GNU General Public License v3.0 4 votes vote down vote up
public void render(MatrixStack matrix, int mX, int mY, float float_1) {
	this.renderBackground(matrix);
	textRenderer.draw(matrix, "BleachHack-1.16-" + BleachHack.VERSION, 3, 3, 0x305090);
	textRenderer.draw(matrix, "BleachHack-1.16-" + BleachHack.VERSION, 2, 2, 0x6090d0);
	textRenderer.drawWithShadow(matrix, "Hover over a bind setting and press a key to change a bind" , 2, height-10, 0xff9999);
	textRenderer.drawWithShadow(matrix, "Use .guireset to reset the gui" , 2, height-20, 0x9999ff);
	
	super.render(matrix, mX, mY, float_1);
	
	mouseX = mX;
	mouseY = mY;
	
	len = Math.max(50, (int) Math.round(ModuleManager.getModule(ClickGui.class).getSettings().get(0).toSlider().getValue()));
	for (Window w: windows) {
		if (w instanceof ModuleWindow) {
			ModuleWindow mw = (ModuleWindow) w;
			
			int x = mw.x1 + 1;
			int y = mw.y1 + 13;
			mw.x2 = x + len + 1;
			
			if (rmDown && mouseOver(x, y-12, x+len, y)) {
				client.getSoundManager().play(PositionedSoundInstance.master(SoundEvents.UI_BUTTON_CLICK, 1.0F));
				mw.hiding = !mw.hiding;
			}
			
			if (mw.hiding) {
				mw.y2 = y;
				continue;
			} else {
				mw.y2 = y + mw.getHeight();
			}
			
			int count = 0;
			for (Entry<Module, Boolean> m: new LinkedHashMap<>(mw.mods).entrySet()) {
				if (m.getValue()) fillReverseGrey(matrix, x, y+(count*12), x+len-1, y+12+(count*12));
				fill(matrix, x, y+(count*12), x+len, y+12+(count*12),
						mouseOver(x, y+(count*12), x+len, y+12+(count*12)) ? 0x70303070 : 0x00000000);
				
				textRenderer.drawWithShadow(matrix, cutText(m.getKey().getName(), len),
						x+2, y+2+(count*12), m.getKey().isToggled() ? 0x70efe0 : 0xc0c0c0);
				
				//fill(m.getValue() ? x+len-2 : x+len-1, y+(count*12), 
				//		x+len, y+12+(count*12), m.getValue() ? 0x9f70fff0 : 0x5f70fff0);
				
				/* Set which module settings show on */
				if (mouseOver(x, y+(count*12), x+len, y+12+(count*12))) {
					GL11.glTranslated(0, 0, 300);
					/* Match lines to end of words */
			        Matcher mat = Pattern.compile("\\b.{1,22}\\b\\W?").matcher(m.getKey().getDesc());

			        int c2 = 0;
			        int c3 = 0;
			        while(mat.find()) { c2++; } mat.reset();
			        
			        while(mat.find()) {
			        	fill(matrix, x+len+3, y-1+(count*12)-(c2 * 10)+(c3 * 10),
			        			x+len+6+textRenderer.getWidth(mat.group().trim()), y+(count*12)-(c2 * 10)+(c3 * 10)+9,
								0x90000000);
			        	textRenderer.drawWithShadow(matrix, mat.group(), x+len+5, y+(count*12)-(c2 * 10)+(c3 * 10), -1);
						c3++;
					}
					if (lmDown) m.getKey().toggle();
					if (rmDown) mw.mods.replace(m.getKey(), !m.getValue());
					if (lmDown || rmDown) client.getSoundManager().play(PositionedSoundInstance.master(SoundEvents.UI_BUTTON_CLICK, 1.0F));
					GL11.glTranslated(0, 0, -300);
				}
				
				/* draw settings */
				if (m.getValue()) {
					for (SettingBase s: m.getKey().getSettings()) {
						count++;
						if (s instanceof SettingMode) drawModeSetting(matrix, s.toMode(), x, y+(count*12));
						if (s instanceof SettingToggle) drawToggleSetting(matrix, s.toToggle(), x, y+(count*12));
						if (s instanceof SettingSlider) drawSliderSetting(matrix, s.toSlider(), x, y+(count*12));
						//fill(x+len-1, y+(count*12), x+len, y+12+(count*12), 0x9f70fff0);
					}
					count++;
					drawBindSetting(matrix, m.getKey(), keyDown, x, y+(count*12));
					//fill(x+len-1, y+(count*12), x+len, y+12+(count*12), 0x9f70fff0);
				}
				count++;
			}
		}
	}
	
	lmDown = false;
	rmDown = false;
	keyDown = -1;
}
 
Example #15
Source File: ModuleWindowLight.java    From bleachhack-1.14 with GNU General Public License v3.0 4 votes vote down vote up
public void draw(int mX, int mY, int leng) {
	mouseX = mX; mouseY = mY; len = leng;
	font = MinecraftClient.getInstance().textRenderer;
	
	Screen.fill(posX, posY-10, posX+len, posY, 
			mouseOver(posX, posY-10, posX+len, posY) ? 0x704060cf : 0x704040ff);
	font.drawWithShadow(name, posX+(len/2)-(font.getStringWidth(name)/2), posY-9, 0xffaaff);
	
	/* window dragging */
	if (mouseOver(posX, posY-10, posX+len, posY)) {
		if (rmDown) hiding = !hiding;
		if (lmDown) dragging = true;
	}
	
	if (!lmHeld) dragging = false;
	if (dragging) {
		posX = mouseX-(prevmX - posX);
		posY = mouseY-(prevmY - posY);
	}
	
	prevmX = mouseX;
	prevmY = mouseY;
	
	/* Draw Modules */
	if (hiding) {
		font.drawWithShadow("-", posX+len-8, posY-9, 0xffaaff);
		return;
	} else font.drawWithShadow("+", posX+len-8, posY-9, 0xffaaff);
		
	int count = 0;
	for (Entry<Module, Boolean> m: new LinkedHashMap<>(mods).entrySet()) {
		Screen.fill(posX, posY+(count*12), posX+len, posY+12+(count*12),
				mouseOver(posX, posY+(count*12), posX+len, posY+12+(count*12)) ? 0x70303070 : 0x70000000);
		font.drawWithShadow(cutText(m.getKey().getName(), len),
				posX+2, posY+2+(count*12), m.getKey().isToggled() ? 0x6060ff : 0xffffff);
		
		Screen.fill(m.getValue() ? posX+len-2 : posX+len-1, posY+(count*12), 
				posX+len, posY+12+(count*12), m.getValue() ? 0x9fffffff : 0x5fffffff);
		
		/* Set which module settings show on */
		if (mouseOver(posX, posY+(count*12), posX+len, posY+12+(count*12))) {
			GL11.glTranslated(0, 0, 300);
			/* Match lines to end of words */
	        Matcher mat = Pattern.compile("\\b.{1,22}\\b\\W?").matcher(m.getKey().getDesc());

	        int c2 = 0;
	        int c3 = 0;
	        while(mat.find()) { c2++; } mat.reset();
	        
	        while(mat.find()) {
	        	Screen.fill(posX+len+3, posY-1+(count*12)-(c2 * 10)+(c3 * 10),
						posX+len+6+font.getStringWidth(mat.group().trim()), posY+(count*12)-(c2 * 10)+(c3 * 10)+9,
						0x90000000);
	        	font.drawWithShadow(mat.group(), posX+len+5, posY+(count*12)-(c2 * 10)+(c3 * 10), -1);
				c3++;
			}
			if (lmDown) m.getKey().toggle();
			if (rmDown) mods.replace(m.getKey(), !m.getValue());
			if (lmDown || rmDown) MinecraftClient.getInstance().getSoundManager().play(PositionedSoundInstance.master(SoundEvents.UI_BUTTON_CLICK, 1.0F));
			GL11.glTranslated(0, 0, -300);
		}
		
		/* draw settings */
		if (m.getValue()) {
			for (SettingBase s: m.getKey().getSettings()) {
				count++;
				if (s instanceof SettingMode) drawModeSetting(s.toMode(), posX, posY+(count*12));
				if (s instanceof SettingToggle) drawToggleSetting(s.toToggle(), posX, posY+(count*12));
				if (s instanceof SettingSlider) drawSliderSetting(s.toSlider(), posX, posY+(count*12));
				Screen.fill(posX+len-1, posY+(count*12), posX+len, posY+12+(count*12), 0x9fffffff);
			}
			count++;
			drawBindSetting(m.getKey(), keyDown, posX, posY+(count*12));
			Screen.fill(posX+len-1, posY+(count*12), posX+len, posY+12+(count*12), 0x9fffffff);
		}
		count++;
	}
	
	lmDown = false;
	rmDown = false;
	keyDown = -1;
}
 
Example #16
Source File: ModuleWindowFuture.java    From bleachhack-1.14 with GNU General Public License v3.0 4 votes vote down vote up
public void draw(int mX, int mY, int leng) {
	mouseX = mX; mouseY = mY; len = leng;
	font = MinecraftClient.getInstance().textRenderer;
	
	Screen.fill(posX, posY-12, posX+len, posY, 
			mouseOver(posX, posY-12, posX+len, posY) ? 0x70cf3030 : 0x70ff3030);
	font.drawWithShadow(name, posX+3, posY-10, -1);
	
	/* window dragging */
	if (mouseOver(posX, posY-12, posX+len, posY)) {
		if (rmDown) hiding = !hiding;
		if (lmDown) dragging = true;
	}
	
	if (!lmHeld) dragging = false;
	if (dragging) {
		posX = mouseX-(prevmX - posX);
		posY = mouseY-(prevmY - posY);
	}
	
	prevmX = mouseX;
	prevmY = mouseY;
	
	/* Draw Modules */
	if (hiding) {
		font.drawWithShadow("-", posX+len-8, posY-10, -1);
		return;
	} else font.drawWithShadow("+", posX+len-8, posY-10, -1);
		
	int count = 0;
	for (Entry<Module, Boolean> m: new LinkedHashMap<>(mods).entrySet()) {
		if (m.getKey().isToggled()) Screen.fill(posX, posY+(count*14), posX+len, posY+14+(count*14), 0xffff0000);
		Screen.fill(posX, posY+(count*14), posX+len, posY+14+(count*14),
				mouseOver(posX, posY+(count*14), posX+len, posY+14+(count*14)) ? 0x70303030 : 0x70000000);
		font.drawWithShadow(cutText(m.getKey().getName(), len),
				posX+2, posY+3+(count*14), 0xffffff);
		
		Screen.fill(posX+len-1, posY+(count*14), posX+len, posY+14+(count*14), m.getValue() ? 0xafffffff : 0x5fffffff);
		
		/* Set which module settings show on */
		if (mouseOver(posX, posY+(count*14), posX+len, posY+14+(count*14))) {
			GL11.glTranslated(0, 0, 300);
			/* Match lines to end of words */
	        Matcher mat = Pattern.compile("\\b.{1,22}\\b\\W?").matcher(m.getKey().getDesc());

	        int c2 = 0;
	        int c3 = 0;
	        while(mat.find()) { c2++; } mat.reset();
	        
	        while(mat.find()) {
	        	Screen.fill(posX+len+3, posY-1+(count*14)-(c2 * 10)+(c3 * 10),
						posX+len+6+font.getStringWidth(mat.group().trim()), posY+(count*14)-(c2 * 10)+(c3 * 10)+9,
						0x90000000);
	        	font.drawWithShadow(mat.group(), posX+len+5, posY+(count*14)-(c2 * 10)+(c3 * 10), -1);
				c3++;
			}
			if (lmDown) m.getKey().toggle();
			if (rmDown) mods.replace(m.getKey(), !m.getValue());
			if (lmDown || rmDown) MinecraftClient.getInstance().getSoundManager().play(PositionedSoundInstance.master(SoundEvents.UI_BUTTON_CLICK, 1.0F));
			GL11.glTranslated(0, 0, -300);
		}
		
		/* draw settings */
		if (m.getValue()) {
			for (SettingBase s: m.getKey().getSettings()) {
				count++;
				if (s instanceof SettingMode) drawModeSetting(s.toMode(), posX, posY+(count*14));
				if (s instanceof SettingToggle) drawToggleSetting(s.toToggle(), posX, posY+(count*14));
				if (s instanceof SettingSlider) drawSliderSetting(s.toSlider(), posX, posY+(count*14));
			}
			count++;
			drawBindSetting(m.getKey(), keyDown, posX, posY+(count*14));
		}
		count++;
	}
	
	lmDown = false;
	rmDown = false;
	keyDown = -1;
}
 
Example #17
Source File: ModuleWindowDark.java    From bleachhack-1.14 with GNU General Public License v3.0 4 votes vote down vote up
public void draw(int mX, int mY, int leng) {
	mouseX = mX; mouseY = mY; len = leng;
	font = MinecraftClient.getInstance().textRenderer;
	
	Screen.fill(posX, posY-10, posX+len, posY, 
			mouseOver(posX, posY-10, posX+len, posY) ? 0x90101010 : 0x90303030);
	font.drawWithShadow(name, posX+(len/2)-(font.getStringWidth(name)/2), posY-9, 0x70afa0);
	
	/* window dragging */
	if (mouseOver(posX, posY-10, posX+len, posY)) {
		if (rmDown) hiding = !hiding;
		if (lmDown) dragging = true;
	}
	
	if (!lmHeld) dragging = false;
	if (dragging) {
		posX = mouseX-(prevmX - posX);
		posY = mouseY-(prevmY - posY);
	}
	
	prevmX = mouseX;
	prevmY = mouseY;
	
	/* Draw Modules */
	if (hiding) {
		font.drawWithShadow("-", posX+len-8, posY-9, 0x70afa0);
		return;
	} else font.drawWithShadow("+", posX+len-8, posY-9, 0x70afa0);
		
	int count = 0;
	for (Entry<Module, Boolean> m: new LinkedHashMap<>(mods).entrySet()) {
		Screen.fill(posX, posY+(count*12), posX+len, posY+12+(count*12),
				mouseOver(posX, posY+(count*12), posX+len, posY+12+(count*12)) ? 0x70303070 : 0x70000000);
		font.drawWithShadow(cutText(m.getKey().getName(), len),
				posX+2, posY+2+(count*12), m.getKey().isToggled() ? 0x70efe0 : 0xc0c0c0);
		
		Screen.fill(m.getValue() ? posX+len-2 : posX+len-1, posY+(count*12), 
				posX+len, posY+12+(count*12), m.getValue() ? 0x9f70fff0 : 0x5f70fff0);
		
		/* Set which module settings show on */
		if (mouseOver(posX, posY+(count*12), posX+len, posY+12+(count*12))) {
			GL11.glTranslated(0, 0, 300);
			/* Match lines to end of words */
	        Matcher mat = Pattern.compile("\\b.{1,22}\\b\\W?").matcher(m.getKey().getDesc());

	        int c2 = 0;
	        int c3 = 0;
	        while(mat.find()) { c2++; } mat.reset();
	        
	        while(mat.find()) {
	        	Screen.fill(posX+len+3, posY-1+(count*12)-(c2 * 10)+(c3 * 10),
						posX+len+6+font.getStringWidth(mat.group().trim()), posY+(count*12)-(c2 * 10)+(c3 * 10)+9,
						0x90000000);
	        	font.drawWithShadow(mat.group(), posX+len+5, posY+(count*12)-(c2 * 10)+(c3 * 10), -1);
				c3++;
			}
			if (lmDown) m.getKey().toggle();
			if (rmDown) mods.replace(m.getKey(), !m.getValue());
			if (lmDown || rmDown) MinecraftClient.getInstance().getSoundManager().play(PositionedSoundInstance.master(SoundEvents.UI_BUTTON_CLICK, 1.0F));
			GL11.glTranslated(0, 0, -300);
		}
		
		/* draw settings */
		if (m.getValue()) {
			for (SettingBase s: m.getKey().getSettings()) {
				count++;
				if (s instanceof SettingMode) drawModeSetting(s.toMode(), posX, posY+(count*12));
				if (s instanceof SettingToggle) drawToggleSetting(s.toToggle(), posX, posY+(count*12));
				if (s instanceof SettingSlider) drawSliderSetting(s.toSlider(), posX, posY+(count*12));
				Screen.fill(posX+len-1, posY+(count*12), posX+len, posY+12+(count*12), 0x9f70fff0);
			}
			count++;
			drawBindSetting(m.getKey(), keyDown, posX, posY+(count*12));
			Screen.fill(posX+len-1, posY+(count*12), posX+len, posY+12+(count*12), 0x9f70fff0);
		}
		count++;
	}
	
	lmDown = false;
	rmDown = false;
	keyDown = -1;
}