use of net.minecraftforge.fml.common.eventhandler.SubscribeEvent in project Totemic by TeamTotemic.
the class GameOverlay method onFOVUpdate.
@SubscribeEvent
public void onFOVUpdate(FOVUpdateEvent event) {
EntityPlayer player = Minecraft.getMinecraft().player;
if (player.isHandActive() && player.getActiveItemStack().getItem() instanceof ItemBaykokBow) {
int bowTicks = player.getItemInUseMaxCount();
float modifier = bowTicks / 20.0F;
if (modifier > 1.0F)
modifier = 1.0F;
else
modifier = modifier * modifier;
event.setNewfov(event.getFov() * (1.0F - 0.15F * modifier));
}
}
use of net.minecraftforge.fml.common.eventhandler.SubscribeEvent in project Totemic by TeamTotemic.
the class PlayerRender method onPlayerRender.
@SubscribeEvent
public void onPlayerRender(RenderPlayerEvent.Post event) {
AbstractClientPlayer player = (AbstractClientPlayer) event.getEntityPlayer();
if (ljfaUUID.equals(player.getUniqueID()) && annaSkinId.equals(player.getLocationSkin().getResourcePath())) {
float yaw = player.prevRotationYawHead + (player.rotationYawHead - player.prevRotationYawHead) * event.getPartialRenderTick();
float pitch = player.prevRotationPitch + (player.rotationPitch - player.prevRotationPitch) * event.getPartialRenderTick();
float pitchZ = (float) Math.toDegrees(event.getRenderer().getMainModel().bipedHead.rotateAngleZ);
GlStateManager.pushMatrix();
if (player.isSneaking())
GlStateManager.translate(0, -0.25F, 0);
GlStateManager.translate(event.getX(), event.getY() + 1.501F * 0.9375F, event.getZ());
GlStateManager.rotate(pitchZ, 0, 0, 1);
GlStateManager.rotate(yaw - 90, 0, -1, 0);
GlStateManager.rotate(pitch + 180, 0, 0, 1);
if (!player.inventory.armorItemInSlot(3).isEmpty())
GlStateManager.translate(0.01F, -0.04F, 0);
if (annaHatDisplayList == 0)
createAnnaHatDisplayList();
GlStateManager.callList(annaHatDisplayList);
GlStateManager.popMatrix();
}
}
use of net.minecraftforge.fml.common.eventhandler.SubscribeEvent in project Totemic by TeamTotemic.
the class ModBlocks method setStateMappers.
@SubscribeEvent
@SideOnly(Side.CLIENT)
public static void setStateMappers(ModelRegistryEvent event) {
ModelLoader.setCustomStateMapper(cedar_sapling, new Builder().ignore(BlockCedarSapling.TYPE, BlockCedarSapling.STAGE).build());
ModelLoader.setCustomStateMapper(cedar_leaves, new Builder().ignore(BlockCedarLeaves.CHECK_DECAY, BlockCedarLeaves.DECAYABLE).build());
}
use of net.minecraftforge.fml.common.eventhandler.SubscribeEvent in project Totemic by TeamTotemic.
the class ModContent method createRegistries.
@SubscribeEvent
public static void createRegistries(RegistryEvent.NewRegistry event) {
// RegistryEvents are fired in alphabetic order.
// Instruments have to be registered before Ceremonies.
new RegistryBuilder<MusicInstrument>().setName(new ResourceLocation(Totemic.MOD_ID, "a_music_instruments")).setType(MusicInstrument.class).setMaxID(Byte.MAX_VALUE).disableSaving().create();
new RegistryBuilder<TotemEffect>().setName(new ResourceLocation(Totemic.MOD_ID, "b_totem_effects")).setType(TotemEffect.class).setMaxID(Byte.MAX_VALUE).disableSaving().create();
new RegistryBuilder<Ceremony>().setName(new ResourceLocation(Totemic.MOD_ID, "c_ceremonies")).setType(Ceremony.class).setMaxID(Byte.MAX_VALUE).disableSaving().create();
}
use of net.minecraftforge.fml.common.eventhandler.SubscribeEvent in project GregTech by GregTechCE.
the class CustomDataTileHandler method onChunkWatch.
@SubscribeEvent
public void onChunkWatch(ChunkWatchEvent.Watch event) {
ChunkPos chunkPos = event.getChunk();
EntityPlayerMP player = event.getPlayer();
Chunk chunk = player.world.getChunkFromChunkCoords(chunkPos.x, chunkPos.z);
for (TileEntity tileEntity : chunk.getTileEntityMap().values()) {
if (tileEntity instanceof ICustomDataTile) {
ICustomDataTile customDataTile = (ICustomDataTile) tileEntity;
customDataTile.onBeingWatched(player);
}
}
}
Aggregations