net.minecraft.client.options.GameOptions Java Examples

The following examples show how to use net.minecraft.client.options.GameOptions. 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: FullbrightHack.java    From Wurst7 with GNU General Public License v3.0 6 votes vote down vote up
private void approachGamma(double target)
{
	GameOptions options = MC.options;
	boolean doFade =
		fade.isChecked() && method.getSelected() == Method.GAMMA;
	
	if(!doFade || Math.abs(options.gamma - target) <= 0.5)
	{
		options.gamma = target;
		return;
	}
	
	if(options.gamma < target)
		options.gamma += 0.5;
	else
		options.gamma -= 0.5;
}
 
Example #2
Source File: FreecamHack.java    From Wurst7 with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void onEnable()
{
	EVENTS.add(UpdateListener.class, this);
	EVENTS.add(PacketOutputListener.class, this);
	EVENTS.add(IsPlayerInWaterListener.class, this);
	EVENTS.add(PlayerMoveListener.class, this);
	EVENTS.add(CameraTransformViewBobbingListener.class, this);
	EVENTS.add(IsNormalCubeListener.class, this);
	EVENTS.add(SetOpaqueCubeListener.class, this);
	EVENTS.add(RenderListener.class, this);
	
	fakePlayer = new FakePlayerEntity();
	
	GameOptions gs = MC.options;
	KeyBinding[] bindings = {gs.keyForward, gs.keyBack, gs.keyLeft,
		gs.keyRight, gs.keyJump, gs.keySneak};
	
	for(KeyBinding binding : bindings)
		binding.setPressed(((IKeyBinding)binding).isActallyPressed());
	
	playerBox = GL11.glGenLists(1);
	GL11.glNewList(playerBox, GL11.GL_COMPILE);
	Box bb = new Box(-0.5, 0, -0.5, 0.5, 1, 0.5);
	RenderUtils.drawOutlinedBox(bb);
	GL11.glEndList();
}
 
Example #3
Source File: TunnellerHack.java    From Wurst7 with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void onUpdate()
{
	HackList hax = WURST.getHax();
	Hack[] incompatibleHax = {hax.autoToolHack, hax.autoWalkHack,
		hax.blinkHack, hax.flightHack, hax.nukerHack,
		// TODO:
		// hax.nukerLegitHack,
		// hax.speedNukerHack,
		hax.sneakHack};
	for(Hack hack : incompatibleHax)
		hack.setEnabled(false);
	
	if(hax.freecamHack.isEnabled())
		return;
	
	GameOptions gs = MC.options;
	KeyBinding[] bindings = {gs.keyForward, gs.keyBack, gs.keyLeft,
		gs.keyRight, gs.keyJump, gs.keySneak};
	for(KeyBinding binding : bindings)
		binding.setPressed(false);
	
	for(Task task : tasks)
	{
		if(!task.canRun())
			continue;
		
		task.run();
		break;
	}
}
 
Example #4
Source File: ZoomOtf.java    From Wurst7 with GNU General Public License v3.0 5 votes vote down vote up
public double changeFovBasedOnZoom(double fov)
{
	GameOptions gameOptions = WurstClient.MC.options;
	
	if(currentLevel == null)
		currentLevel = level.getValue();
	
	if(!WURST.getZoomKey().isPressed())
	{
		currentLevel = level.getValue();
		
		if(defaultMouseSensitivity != null)
		{
			gameOptions.mouseSensitivity = defaultMouseSensitivity;
			defaultMouseSensitivity = null;
		}
		
		return fov;
	}
	
	if(defaultMouseSensitivity == null)
		defaultMouseSensitivity = gameOptions.mouseSensitivity;
		
	// Adjust mouse sensitivity in relation to zoom level.
	// (fov / currentLevel) / fov is a value between 0.02 (50x zoom)
	// and 1 (no zoom).
	gameOptions.mouseSensitivity =
		defaultMouseSensitivity * (fov / currentLevel / fov);
	
	return fov / currentLevel;
}
 
Example #5
Source File: GameRendererMixin.java    From Wurst7 with GNU General Public License v3.0 5 votes vote down vote up
@Redirect(
	at = @At(value = "FIELD",
		target = "Lnet/minecraft/client/options/GameOptions;fov:D",
		opcode = Opcodes.GETFIELD,
		ordinal = 0),
	method = {"getFov(Lnet/minecraft/client/render/Camera;FZ)D"})
private double getFov(GameOptions options)
{
	return WurstClient.INSTANCE.getOtfs().zoomOtf
		.changeFovBasedOnZoom(options.fov);
}