2017-05-29 09:10:40 +00:00
|
|
|
package net.minecraftforge.debug;
|
2016-02-16 13:52:41 +00:00
|
|
|
|
|
|
|
import net.minecraft.block.material.Material;
|
|
|
|
import net.minecraftforge.client.event.EntityViewRenderEvent;
|
|
|
|
import net.minecraftforge.common.MinecraftForge;
|
|
|
|
import net.minecraftforge.fml.common.Mod;
|
|
|
|
import net.minecraftforge.fml.common.Mod.EventHandler;
|
|
|
|
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
|
|
|
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
|
|
|
|
2017-05-29 09:10:40 +00:00
|
|
|
/**
|
|
|
|
* Simple mod to test fov modifier.
|
|
|
|
*/
|
|
|
|
@Mod(modid = "fovmodifiertest", name = "FOV Modifier Test", version = "0.0.0", clientSideOnly = true)
|
|
|
|
public class FOVModifierTest
|
|
|
|
{
|
2017-09-17 03:08:25 +00:00
|
|
|
static final boolean ENABLED = false;
|
2016-02-16 13:52:41 +00:00
|
|
|
|
|
|
|
@EventHandler
|
|
|
|
public void init(FMLInitializationEvent event)
|
|
|
|
{
|
2017-09-17 03:08:25 +00:00
|
|
|
if (ENABLED)
|
|
|
|
{
|
|
|
|
MinecraftForge.EVENT_BUS.register(this);
|
|
|
|
}
|
2016-02-16 13:52:41 +00:00
|
|
|
}
|
2016-05-18 12:11:56 +00:00
|
|
|
|
2016-02-16 13:52:41 +00:00
|
|
|
@SubscribeEvent
|
2017-05-29 09:10:40 +00:00
|
|
|
public void getFOVModifier(EntityViewRenderEvent.FOVModifier event)
|
|
|
|
{
|
|
|
|
if (event.getState().getMaterial() == Material.WATER)
|
|
|
|
{
|
2016-02-16 13:52:41 +00:00
|
|
|
event.setFOV(event.getFOV() / 60.0f * 50.0f);
|
2017-05-29 09:10:40 +00:00
|
|
|
}
|
2016-02-16 13:52:41 +00:00
|
|
|
}
|
|
|
|
}
|