本文整理汇总了Java中cpw.mods.fml.common.gameevent.TickEvent.RenderTickEvent类的典型用法代码示例。如果您正苦于以下问题:Java RenderTickEvent类的具体用法?Java RenderTickEvent怎么用?Java RenderTickEvent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
RenderTickEvent类属于cpw.mods.fml.common.gameevent.TickEvent包,在下文中一共展示了RenderTickEvent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onRenderTick
import cpw.mods.fml.common.gameevent.TickEvent.RenderTickEvent; //导入依赖的package包/类
@SubscribeEvent
public void onRenderTick(RenderTickEvent event) {
b = b + 0.01F;
e = e + 0.07F;
a = a + 0.01F;
// System.out.println(b + " / " + e + " / " + a);
if (b >= 180F) {
b = -180F;
}
if (e >= 180F) {
e = -180F;
}
if (a >= 180F) {
a = -180F;
}
}
示例2: TickEvent
import cpw.mods.fml.common.gameevent.TickEvent.RenderTickEvent; //导入依赖的package包/类
@SubscribeEvent
public void TickEvent(RenderTickEvent event) {
config = new Configuration(new File( "." + "/config/", DefaultProps.configDirectory
+ DefaultProps.defaultConfigFile));
config.load();
displayBossHealth = config.get("mob controls", "Display PZBoss HealthBar", this.displayBossHealth).getBoolean(displayBossHealth);
config.save();
if (event.phase == Phase.END && displayBossHealth) {
if (validTargetPresent(targetBoss) && Minecraft.getMinecraft().thePlayer != null) {
renderBossHealthBar(targetBoss, targetBoss.getDefaultEntityName() + " Health");
}
}
}
示例3: onRenderTick
import cpw.mods.fml.common.gameevent.TickEvent.RenderTickEvent; //导入依赖的package包/类
@SubscribeEvent
public void onRenderTick(RenderTickEvent event) {
if(event.phase == Phase.END) {
Minecraft mc = Minecraft.getMinecraft();
if(mc.currentScreen instanceof net.minecraft.client.gui.GuiMainMenu && !(mc.currentScreen instanceof GuiMainMenu)) {
mc.displayGuiScreen(new GuiMainMenu());
}
if(!(mc.ingameGUI instanceof GuiInGame)) {
mc.ingameGUI = new GuiInGame(mc);
}
if(GuiTechTreeComponent.instance == null) {
GuiTechTreeComponent.instance = new GuiTechTreeComponent();
}
GuiTechTreeComponent.instance.updateTechTreeWindow();
}
}
示例4: RenderTickEvent
import cpw.mods.fml.common.gameevent.TickEvent.RenderTickEvent; //导入依赖的package包/类
@SubscribeEvent
public void RenderTickEvent(RenderTickEvent event) {
if ((event.type == Type.RENDER || event.type == Type.CLIENT) && event.phase == Phase.END) {
Minecraft mc = Minecraft.getMinecraft();
if (!ticked && mc.ingameGUI != null) {
mc.ingameGUI = new GuiAdvancedHUD(mc);
ticked = true;
}
if (firstload && mc != null) {
if (!SaveController.loadConfig("config")) {
HUDRegistry.checkForResize();
HUDRegistry.resetAllDefaults();
SaveController.saveConfig("config");
}
firstload = false;
}
// TODO Add notification on main menu when an update for advancedhud is available :)
// if (mc.currentScreen instanceof GuiMainMenu) {
// int mouseX = Mouse.getX() * mc.currentScreen.width / mc.displayWidth;
// int mouseY = mc.currentScreen.height - Mouse.getY() * mc.currentScreen.height / mc.displayHeight - 1;
// RenderAssist.drawCircle(mouseX, mouseY, 3, 24, 0xFFFFFFFF);
// RenderAssist.drawRect(1, 1, 70, 11, 0x608f3eff);
// mc.currentScreen.drawString(mc.fontRenderer, "AdvancedHUD!", 2, 2, 0x48dce9);
// }
}
}
示例5: invoke
import cpw.mods.fml.common.gameevent.TickEvent.RenderTickEvent; //导入依赖的package包/类
@Override
public void invoke(Event event) {
if (event instanceof RenderTickEvent)
new sl.steeldood.bit.client.event.impl.RenderTickEvent().call();
else
new ClientTickEvent().call();
}
示例6: onRenderTick
import cpw.mods.fml.common.gameevent.TickEvent.RenderTickEvent; //导入依赖的package包/类
@SubscribeEvent
public void onRenderTick(RenderTickEvent event) {
if (!addRenderTick.isEmpty()) {
hRenderTick.addAll(addRenderTick);
addRenderTick.clear();
}
for (Iterator<LIHandler> it = hRenderTick.iterator(); it.hasNext(); ) {
LIHandler handler = it.next();
if (handler.isDead())
it.remove();
else
handler.trigger(event);
}
}
示例7: tickEnd
import cpw.mods.fml.common.gameevent.TickEvent.RenderTickEvent; //导入依赖的package包/类
@SubscribeEvent
public void tickEnd( RenderTickEvent event )
{
if ( !event.phase.equals( TickEvent.Phase.END ) )
{
return;
}
Minecraft mc = FMLClientHandler.instance().getClient();
if ( mc.currentScreen != null || renderObj == null || renderMethod == null )
{
return;
}
EntityPlayer player = mc.thePlayer;
ItemStack chestplate = player.getCurrentArmor( 2 );
if ( chestplate == null || chestplate.getItem() != ComponentEquipment.items.chestplate )
{
return;
}
ArmorItem armor = ( ArmorItem ) chestplate.getItem();
if ( armor.armor.getModifierLevel( chestplate, "hoverHarness" ) <= 0 )
{
return;
}
ItemStack harnessStack = ItemApi.getItem( "itemHoverHarness", 0 );
harnessStack.setTagCompound( chestplate.getTagCompound() );
try
{
renderMethod.invoke( renderObj, ( Float ) event.renderTickTime, player, System.currentTimeMillis(), harnessStack );
}
catch ( Exception exception )
{
exception.printStackTrace();
}
}
示例8: renderTick
import cpw.mods.fml.common.gameevent.TickEvent.RenderTickEvent; //导入依赖的package包/类
@SubscribeEvent
public void renderTick(RenderTickEvent tick) {
if (tick.phase == TickEvent.Phase.END) {
Minecraft mc = Minecraft.getMinecraft();
if (mc.inGameHasFocus) {
boolean renderMana = false;
ItemStack hand = mc.thePlayer.getCurrentEquippedItem();
IPlayerSession session;
if (Rings.proxy.manaHandler.playerHasSession(mc.thePlayer)) {
session = Rings.proxy.manaHandler.getPlayerSession(mc.thePlayer);
if (SimpleUtil.displayHud(mc.thePlayer))
renderMana = SimpleUtil.displayHud(mc.thePlayer);
if (hand != null && !renderMana) {
if (hand.getItem() instanceof ItemMagicRing) {
if (hand.getTagCompound() != null) {
NBTTagCompound handtag = hand.getTagCompound().hasKey(ModLibs.RING_TAG) ? hand.getTagCompound().getCompoundTag(ModLibs.RING_TAG) : null;
if (handtag != null && handtag.hasKey(ModLibs.SPELL_ID))
renderMana = true;
}
}
}
if (renderMana) {
String mpInfo = StatCollector.translateToLocal(ModLibs.MANA) + ": " + session.getMana() + " / " + session.getMaxMana();
mc.fontRenderer.drawString(mpInfo, ModLibs.DISPLAY_X + 1, ModLibs.DISPLAY_Y + 1, 0x000000);
mc.fontRenderer.drawString(mpInfo, ModLibs.DISPLAY_X, ModLibs.DISPLAY_Y, 0x00C4C4);
}
}
}
}
}
示例9: TickEvent
import cpw.mods.fml.common.gameevent.TickEvent.RenderTickEvent; //导入依赖的package包/类
@SubscribeEvent
public void TickEvent(RenderTickEvent event) {
if (event.phase == Phase.END) {
if (validTargetPresent(targetBoss) && Minecraft.getMinecraft().thePlayer != null) {
renderBossHealthBar(targetBoss, "Pharaoh Health");
}
}
}
示例10: onRenderStart
import cpw.mods.fml.common.gameevent.TickEvent.RenderTickEvent; //导入依赖的package包/类
@SubscribeEvent
public void onRenderStart(RenderTickEvent event) {
if(event.phase == Phase.START) {
float ctime = (float) Math.floor(time) + event.renderTickTime;
delta = (ctime - time) * 50;
time = ctime;
EmoteHandler.clearPlayerList();
}
}
示例11: tick
import cpw.mods.fml.common.gameevent.TickEvent.RenderTickEvent; //导入依赖的package包/类
@SideOnly(Side.CLIENT)
@SubscribeEvent
public void tick(RenderTickEvent event)
{
Minecraft mc = Minecraft.getMinecraft();
if(event.phase == Phase.END && mc.thePlayer != null && mc.inGameHasFocus)
{
boolean hasBattery = false;
int maxpower = 0;
int power = 0;
RandomItemBattery heighest = null;
for (int i = 0; i < mc.thePlayer.inventory.mainInventory.length; i++) {
RandomItem item = RandomItem.getRandomItem(mc.thePlayer.inventory.mainInventory[i]);
if(item instanceof RandomItemBattery)
{
maxpower += ((RandomItemBattery) item).maxDamage;
if(heighest == null || ((RandomItemBattery) item).maxDamage > heighest.maxDamage)
heighest = (RandomItemBattery) item;
power += ((RandomItemBattery) item).getPower(mc.thePlayer.inventory.mainInventory[i]);
hasBattery = true;
}
}
if(hasBattery)
{
//RenderHelper2D.renderIcon(Blocks.iron_block.getBlockTextureFromSide(0), 3, 3, 1, true, 0, 100, 20);
GL11.glDisable(GL11.GL_LIGHTING);
mc.fontRenderer.drawString(power + "/" + maxpower + " RA", 23, 10, 16777215);
RenderHelper2D.renderItem(heighest.getItemStack(), 5, 5);
}
}
}
示例12: onRenderEvent
import cpw.mods.fml.common.gameevent.TickEvent.RenderTickEvent; //导入依赖的package包/类
@SubscribeEvent
public void onRenderEvent(RenderTickEvent event) {
if (event.phase == TickEvent.Phase.START) {
EntityPlayer entityplayer = mc.thePlayer;
World world = mc.theWorld;
if (entityplayer != null && world != null) {
this.onRenderTick(entityplayer,
world);
}
}
}
示例13: onSensorRenderTick
import cpw.mods.fml.common.gameevent.TickEvent.RenderTickEvent; //导入依赖的package包/类
@SubscribeEvent
public void onSensorRenderTick(RenderTickEvent event) {
EntityPlayer entityplayer = mc.thePlayer;
World world = mc.theWorld;
GuiScreen guiScreen = this.mc.currentScreen;
if (guiScreen == null) onRenderTick(entityplayer);
}
示例14: nullify
import cpw.mods.fml.common.gameevent.TickEvent.RenderTickEvent; //导入依赖的package包/类
@Override
public void nullify() {
unregister(this, FMLCommonHandler.instance().bus(), RenderTickEvent.class);
unregister(this, FMLCommonHandler.instance().bus(), TickEvent.ClientTickEvent.class);
}
示例15: TickEventDispatcher
import cpw.mods.fml.common.gameevent.TickEvent.RenderTickEvent; //导入依赖的package包/类
public TickEventDispatcher() {
register(this, FMLCommonHandler.instance().bus(), RenderTickEvent.class);
register(this, FMLCommonHandler.instance().bus(), TickEvent.ClientTickEvent.class);
}