當前位置: 首頁>>代碼示例>>Java>>正文


Java ElementType.CHAT屬性代碼示例

本文整理匯總了Java中net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType.CHAT屬性的典型用法代碼示例。如果您正苦於以下問題:Java ElementType.CHAT屬性的具體用法?Java ElementType.CHAT怎麽用?Java ElementType.CHAT使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType的用法示例。


在下文中一共展示了ElementType.CHAT屬性的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onDraw

@CoreEvent
public void onDraw(final @Nonnull RenderGameOverlayEvent.Post event) {
	if (event.resolution==null)
		return;
	if (event.type==ElementType.CHAT&&Client.mc.currentScreen==null)
		if (!isDelegated()) {
			setWidth(event.resolution.getScaledWidth());
			setHeight(event.resolution.getScaledHeight());
			drawScreen(event.mouseX, event.mouseY, event.partialTicks);
		}
}
 
開發者ID:Team-Fruit,項目名稱:SignPicture,代碼行數:11,代碼來源:OverlayFrame.java

示例2: displayEntityStatus

@SubscribeEvent
public void displayEntityStatus(RenderGameOverlayEvent.Pre event) {
	if (event.getType() != ElementType.CHAT) {
		return;
	}
	ToroHealthMod.proxy.setEntityInCrosshairs();
}
 
開發者ID:ToroCraft,項目名稱:ToroHealth,代碼行數:7,代碼來源:Events.java

示例3: drawHealthBar

@SubscribeEvent
public void drawHealthBar(RenderGameOverlayEvent.Pre event) {
	if (!showHealthBar || event.getType() != ElementType.CHAT) {
		return;
	}
	updateGuiAge();
	updatePositions();
	drawSkin();
	draw();
}
 
開發者ID:ToroCraft,項目名稱:ToroHealth,代碼行數:10,代碼來源:GuiEntityStatus.java

示例4: onDraw

@SubscribeEvent
public void onDraw(final RenderGameOverlayEvent.Post event) {
	if (event.type==ElementType.CHAT&&FMLClientHandler.instance().getClient().currentScreen==null)
		if (!isDelegated()) {
			setWidth(event.resolution.getScaledWidth());
			setHeight(event.resolution.getScaledHeight());
			drawScreen(event.mouseX, event.mouseY, event.partialTicks);
		}
}
 
開發者ID:Team-Fruit,項目名稱:EEWReciever,代碼行數:9,代碼來源:OverlayFrame.java

示例5: overlayRender

@SubscribeEvent(priority = EventPriority.LOWEST)
   public void overlayRender(RenderGameOverlayEvent.Pre event) {
	
	EntityPlayer player = Minecraft.getMinecraft().thePlayer;
	
	ItemStack stack = player.inventory.getCurrentItem();
	
	HUDRenderer hud = new HUDRenderer();
	
	if (Minecraft.getMinecraft().gameSettings.thirdPersonView == 0) {
		
		if (!FWConfig.disableScopeHUD) {
			
			if (stack != null && stack.getItem() == InitItems.fusion_sniper_rifle) {
				
				GunData data = new GunData(stack);
				
				if (data.scope > 0) hud.renderTexture("scope_hud.png", 0, 0, 0, 0, 100, hud.width, hud.height * 2, hud.width, hud.height);
			}			
		}
	
		if (!FWConfig.disableScubaHUD && event.type == ElementType.CHAT) {
		
			for (ItemStack armor : player.inventory.armorInventory) {
		
				if (armor != null && armor.getItem() == InitItems.scuba_helmet) {
			
					hud.renderTexture("scuba_hud.png", 0, 0, 0, 0, -100, hud.width, hud.height * 2, hud.width, hud.height);
					
					int water = 0;
					
					if (player.isInsideOfMaterial(Material.water)) {
						
						if (timer.isDoneAndReset()) if (growWidth > 0) growWidth--;
										
						for (int i = 1; i <= 60; i++) {
							
							if (player.worldObj.getBlock((int)(player.posX - 1F), (int)player.posY + i, (int)(player.posZ - 1F)).getMaterial() == Material.water) {								
								water++;
							}
							
							else break;
						}
					}	
											
					else {
						if (timer.isDoneAndReset()) if (growWidth < 30) growWidth++;							
					}	
					
					hud.renderTexture("scuba_hud.png", 0 - growWidth, (hud.height / 2) - (85 / 2), 0, 128, 0, 256, 256, 31, 85);
					hud.renderTexture("scuba_hud.png", 2 - growWidth, ((hud.height / 2) - 21) + water, 0, 128, 0, 256, 256, 7, 1);
				}		
			}
		}	
	}	
}
 
開發者ID:TeamMonumental,項目名稱:FusionWarfare,代碼行數:56,代碼來源:HUDEvent.java


注:本文中的net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType.CHAT屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。