本文整理汇总了Java中net.minecraftforge.event.EventPriority类的典型用法代码示例。如果您正苦于以下问题:Java EventPriority类的具体用法?Java EventPriority怎么用?Java EventPriority使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
EventPriority类属于net.minecraftforge.event包,在下文中一共展示了EventPriority类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: miniPre
import net.minecraftforge.event.EventPriority; //导入依赖的package包/类
@SideOnly(Side.CLIENT)
@ForgeSubscribe(priority = EventPriority.HIGHEST)
public void miniPre(RenderPlayerEvent.Pre event){
if(((EntityLivingBase) event.entity).isPotionActive(FCraftPotions.miniPot)){
GL11.glPushMatrix();
GL11.glScalef(0.2F, 0.2F, 0.2F);
//GL11.glTranslatef(0, -6.5F, 0);
if(event.entity instanceof EntityPlayer){
EntityPlayer player = (EntityPlayer) event.entity;
player.height = 0.5F;
player.yOffset = 0.55F;
mc.thePlayer.eyeHeight = 0.02F;
player.boundingBox.setBounds(player.posX - (double)player.width/2.0F, player.posY - (double)player.yOffset + (double)player.ySize, player.posZ - (double)player.width/2.0F, player.posX + (double)player.width/2.0F, player.posY - (double)player.yOffset + (double)player.ySize + (double)player.height, player.posZ + (double)player.width/2.0F);
}
}
}
开发者ID:Unrelentless,项目名称:FantasyCraft-Mod,代码行数:17,代码来源:FCraftEffectsHandler.java
示例2: deathEvent
import net.minecraftforge.event.EventPriority; //导入依赖的package包/类
/**
* For deaths
*/
@ForgeSubscribe(priority = EventPriority.HIGHEST)
public void deathEvent(PlayerDropsEvent event)
{
World world = event.entityPlayer.getEntityWorld();
if (world.isRemote) return;
event.setCanceled(GraveHandler.onDeath(event.entityPlayer.worldObj, event.entityPlayer, event.drops));
}
开发者ID:CCM-Modding,项目名称:CcmBurialServicesInc,代码行数:11,代码来源:EventHandler.java
示例3: miniPost
import net.minecraftforge.event.EventPriority; //导入依赖的package包/类
@SideOnly(Side.CLIENT)
@ForgeSubscribe(priority = EventPriority.HIGHEST)
public void miniPost(RenderPlayerEvent.Post event){
if(((EntityLivingBase) event.entity).isPotionActive(FCraftPotions.miniPot)){
GL11.glPopMatrix();
if(event.entity instanceof EntityPlayer){
EntityPlayer player = (EntityPlayer) event.entity;
/* player.yOffset = 1.62F;
player.ySize = 0.0F;*/
}
}
}
开发者ID:Unrelentless,项目名称:FantasyCraft-Mod,代码行数:13,代码来源:FCraftEffectsHandler.java
示例4: onPostTextureStitch
import net.minecraftforge.event.EventPriority; //导入依赖的package包/类
@ForgeSubscribe(priority = EventPriority.NORMAL)
public void onPostTextureStitch(TextureStitchEvent.Post event)
{
if (ModHarvestCraftWaila.hasHarvestCraft)
{
if (PamHarvestCraft.pamCrop != null && ((BlockPamCrop) PamHarvestCraft.pamCrop).iconArray != null)
{
setBlockIcon(PamHarvestCraft.pamCrop, ((BlockPamCrop) PamHarvestCraft.pamCrop).iconArray[0][0]);
}
}
if (ModHarvestCraftWaila.hasWeeeFlowers)
{
if (PamWeeeFlowers.pamFlower != null && ((BlockPamFlower) PamWeeeFlowers.pamFlower).icons != null)
{
setBlockIcon(PamWeeeFlowers.pamFlower, ((BlockPamFlower) PamWeeeFlowers.pamFlower).icons[0]);
}
if (PamWeeeFlowers.pamflowerCrop != null && ((BlockPamFlowerCrop) PamWeeeFlowers.pamflowerCrop).iconArray != null)
{
setBlockIcon(PamWeeeFlowers.pamflowerCrop, ((BlockPamFlowerCrop) PamWeeeFlowers.pamflowerCrop).iconArray[0][0]);
}
if (PamWeeeFlowers.pammoonFlower != null && ((BlockPamMoonFlower) PamWeeeFlowers.pammoonFlower).icons != null)
{
setBlockIcon(PamWeeeFlowers.pammoonFlower, ((BlockPamMoonFlower) PamWeeeFlowers.pammoonFlower).icons[0]);
}
}
}
开发者ID:squeek502,项目名称:HarvestCraftWaila,代码行数:30,代码来源:IconFixer.java
示例5: onLivingDeath
import net.minecraftforge.event.EventPriority; //导入依赖的package包/类
@ForgeSubscribe(priority=EventPriority.LOWEST)
public void onLivingDeath(LivingDeathEvent event) {
if (!event.isCanceled() && !(event.entityLiving instanceof EntityPlayer)) {
Map<EntityLivingBase, EntityStats> entityStats = getEntityStatsMap(getSide(event.entityLiving));
entityStats.remove(event.entityLiving);
}
}
开发者ID:Hunternif,项目名称:Dota2Items,代码行数:8,代码来源:StatsTracker.java
示例6: onRenderExperienceBar
import net.minecraftforge.event.EventPriority; //导入依赖的package包/类
@ForgeSubscribe(priority = EventPriority.NORMAL)
public void onRenderExperienceBar(RenderGameOverlayEvent event)
{
EntityClientPlayerMP player = FMLClientHandler.instance().getClient().thePlayer;
// int playerX=(int) player.posX;
// int playerY=(int) player.posY;
// int playerZ=(int) player.posZ;
// int halfSize= (int)(SEARCH_RADIUS/2);
// AxisAlignedBB bb = AxisAlignedBB.getBoundingBox(playerX-halfSize,
// playerY-halfSize, playerZ-halfSize, playerX+halfSize,
// playerY+halfSize, playerZ+halfSize);
// player.worldObj.selectEntitiesWithinAABB(par1Class, bb, new IEntity)
List tes = player.worldObj.loadedTileEntityList;
LaunchControlLogic logic = null;
for (int i = 0; i < tes.size(); i++)
{
if (tes.get(i) instanceof LaunchControlLogic)
{
if (((LaunchControlLogic) tes.get(i)).RocketLogic != null)
{
logic = ((LaunchControlLogic) tes.get(i));
break;
}
}
}
if (event.isCancelable() || event.type != ElementType.EXPERIENCE || logic == null) return;
// GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
// GuiOverlay.GL11.glDisable(GL11.GL_LIGHTING);
FontRenderer fRender = Minecraft.getMinecraft().fontRenderer;
fRender.drawString("Rocket Stats:", START_X, START_Y, 0);
fRender.drawString("VelY: " + logic.RocketLogic.velY, START_X + 3, START_Y + fRender.FONT_HEIGHT + 2, 0);
fRender.drawString("Current Power: " + logic.RocketLogic.currentPower, START_X + 3, START_Y + (fRender.FONT_HEIGHT + 2) * 2, 0);
fRender.drawString("Weight: " + logic.RocketLogic.totalWeight, START_X + 3, START_Y + (fRender.FONT_HEIGHT + 2) * 3, 0);
// GL11.glEnable(GL11.GL_LIGHTING);
}
开发者ID:allout58,项目名称:MinecraftSpaceAgency,代码行数:36,代码来源:GuiOverlay.java
示例7: FillBucket
import net.minecraftforge.event.EventPriority; //导入依赖的package包/类
@ForgeSubscribe(priority = EventPriority.NORMAL)
public void FillBucket(FillBucketEvent event) {
ItemStack result = attemptFill(event.world, event.target);
if (result != null) {
event.result = result;
event.setResult(Result.ALLOW);
}
}
开发者ID:PaleoCrafter,项目名称:PowerGrid,代码行数:9,代码来源:ItemEnergonBucket.java
示例8: FillBucket
import net.minecraftforge.event.EventPriority; //导入依赖的package包/类
@ForgeSubscribe(priority = EventPriority.NORMAL)
public void FillBucket(FillBucketEvent event)
{
ItemStack result = attemptFill(event.world, event.target);
if (result != null) {
event.result = result;
event.setResult(Result.ALLOW);
}
}
开发者ID:mrgregfinch,项目名称:powell.cellarium,代码行数:10,代码来源:BucketOfBoilingBlood.java
示例9: onEntityJoinWorld
import net.minecraftforge.event.EventPriority; //导入依赖的package包/类
@ForgeSubscribe(priority = EventPriority.LOWEST)
public void onEntityJoinWorld(EntityJoinWorldEvent event) {
if (event.entity instanceof EntityItem) {
for (ItemConsumer consumer : itemConsumers) consumer.onItem((EntityItem) event.entity);
}
}
开发者ID:austinv11,项目名称:PeripheralsPlusPlus,代码行数:7,代码来源:EventHandler.java
示例10: onRenderExperienceBar
import net.minecraftforge.event.EventPriority; //导入依赖的package包/类
@ForgeSubscribe(priority = EventPriority.NORMAL)
public void onRenderExperienceBar(RenderGameOverlayEvent event)
{
if (event.isCancelable() || event.type != ElementType.EXPERIENCE)
{
return;
}
// Get our extended player properties and assign it locally so we can easily access it
FCraftJobCore props = FCraftJobCore.get(this.mc.thePlayer);
//Texture Size
int xTextSize = 90;
int yTextSize = 17;
int xNumberSize = 16;
int yNumberSize = 18;
// The center of the screen can be gotten like this during this event:
int xPos = event.resolution.getScaledWidth() - xTextSize - 10;
int yPos = event.resolution.getScaledHeight() - yTextSize;
int xNumberPos = event.resolution.getScaledWidth() - xTextSize - xNumberSize*3 - 10;
int yNumberPos = event.resolution.getScaledHeight() - yNumberSize;
// Somewhere in Minecraft vanilla code it says to do this because of a lighting bug
GL11.glDisable(GL11.GL_LIGHTING);
//Getting the ones, tens, hundreds values.
int ones = props.getChainLevel()%10;
int tens = props.getChainLevel()/10%10;
int hundreds = props.getChainLevel()/100%10;
GL11.glEnable(GL11.GL_BLEND);
GL11.glDisable(GL11.GL_DEPTH_TEST);
GL11.glDepthMask(false);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GL11.glColor4f(2.0F, 1.0F, 2.0F, 1.0F);
GL11.glDisable(GL11.GL_ALPHA_TEST);
// Bind your texture to the render engine
this.mc.getTextureManager().bindTexture(textureLoc);
// First draw the background layer.
this.drawTexturedModalRect(xPos, yPos, 38, 0, xTextSize, yTextSize); //Chain Name
this.drawTexturedModalRect(xNumberPos+32, yNumberPos, 38, 18*ones+yNumberSize, xNumberSize, yNumberSize); //Ones
if(props.getChainLevel() >= 10){
this.drawTexturedModalRect(xNumberPos+16, yNumberPos, 38, 18*tens+yNumberSize, xNumberSize, yNumberSize); //Tens
}else if(props.getChainLevel() >= 100){
this.drawTexturedModalRect(xNumberPos, yNumberPos, 38, 18*hundreds+yNumberSize, xNumberSize, yNumberSize); //Hundreds
}
GL11.glDisable(GL11.GL_BLEND);
GL11.glEnable(GL11.GL_DEPTH_TEST);
GL11.glDepthMask(true);
}
开发者ID:Unrelentless,项目名称:FantasyCraft-Mod,代码行数:57,代码来源:GuiChain.java
示例11: onRenderExperienceBar
import net.minecraftforge.event.EventPriority; //导入依赖的package包/类
@ForgeSubscribe(priority = EventPriority.NORMAL)
public void onRenderExperienceBar(RenderGameOverlayEvent event)
{
if (event.isCancelable() || event.type != ElementType.EXPERIENCE)
{
return;
}
// Get our extended player properties and assign it locally so we can easily access it
FCraftJobCore props = FCraftJobCore.get(this.mc.thePlayer);
//Texture Size
int xSize = 7;
int ySize = 256;
// The center of the screen can be gotten like this during this event:
int xPos = 1;
int yPos = event.resolution.getScaledHeight()/2 - ySize/2;
// However, we want the length to be based on current exp, so we need a new variable:
//int expWidth = (int)(((float) props.getCurrentExperience() / props.getMaxExperience()) * 182);
int expHeight = (int)(this.mc.thePlayer.getDataWatcher().getWatchableObjectFloat(props.EXP_WATCHER)/props.getMaxExperience() * (float)(251));
int percentComplete = (int) (this.mc.thePlayer.experience*100);
// Somewhere in Minecraft vanilla code it says to do this because of a lighting bug
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glEnable(GL11.GL_BLEND);
GL11.glDisable(GL11.GL_DEPTH_TEST);
GL11.glDepthMask(false);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
GL11.glDisable(GL11.GL_ALPHA_TEST);
// Bind your texture to the render engine
this.mc.getTextureManager().bindTexture(textureLoc);
// First draw the background layer.
this.drawTexturedModalRect(xPos, yPos, 0, 0, xSize, ySize);
this.drawTexturedModalRect(xPos, yPos+(ySize-expHeight), 7, ySize-expHeight, xSize, expHeight);
this.drawTexturedModalRect(xPos+1, yPos+(ySize-expHeight)-7, 14, 0, 5, 7);
//this.mc.fontRenderer.drawString(""+percentComplete+"%", 1, event.resolution.getScaledHeight()/2, 0xFFFFFF);
GL11.glDisable(GL11.GL_BLEND);
GL11.glEnable(GL11.GL_DEPTH_TEST);
GL11.glDepthMask(true);
}
开发者ID:Unrelentless,项目名称:FantasyCraft-Mod,代码行数:47,代码来源:GuiExp.java
示例12: onRenderExperienceBar
import net.minecraftforge.event.EventPriority; //导入依赖的package包/类
@ForgeSubscribe(priority = EventPriority.NORMAL)
public void onRenderExperienceBar(RenderGameOverlayEvent event)
{
if (event.isCancelable() || event.type != ElementType.EXPERIENCE)
{
return;
}
// Get our extended player properties and assign it locally so we can easily access it
FCraftJobCore props = FCraftJobCore.get(this.mc.thePlayer);
//Texture Size
int xSize = 7;
int ySize = 256;
// The center of the screen can be gotten like this during this event:
int xPos = event.resolution.getScaledWidth() - 8;
int yPos = event.resolution.getScaledHeight()/2 - ySize/2;
// Somewhere in Minecraft vanilla code it says to do this because of a lighting bug
GL11.glDisable(GL11.GL_LIGHTING);
// However, we want the length to be based on current exp, so we need a new variable:
//int expWidth = (int)(((float) props.getCurrentExperience() / props.getMaxExperience()) * 182);
int manaHeight = (int) (props.getCurrentMana()/props.getMaxMana()*247);
GL11.glEnable(GL11.GL_BLEND);
GL11.glDisable(GL11.GL_DEPTH_TEST);
GL11.glDepthMask(false);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GL11.glColor4f(2.0F, 1.0F, 2.0F, 1.0F);
GL11.glDisable(GL11.GL_ALPHA_TEST);
// Bind your texture to the render engine
this.mc.getTextureManager().bindTexture(textureLoc);
// First draw the background layer.
this.drawTexturedModalRect(xPos, yPos, 19, 0, xSize, ySize);
this.drawTexturedModalRect(xPos, yPos+(ySize-manaHeight), 26, ySize-manaHeight, xSize, manaHeight);
this.drawTexturedModalRect(xPos+1, yPos+(ySize-manaHeight)-7, 33, 0, 5, 7);
//this.mc.fontRenderer.drawString(""+percentComplete+"%", 1, event.resolution.getScaledHeight()/2, 0xFFFFFF);
GL11.glDisable(GL11.GL_BLEND);
GL11.glEnable(GL11.GL_DEPTH_TEST);
GL11.glDepthMask(true);
}
开发者ID:Unrelentless,项目名称:FantasyCraft-Mod,代码行数:48,代码来源:GuiMana.java
注:本文中的net.minecraftforge.event.EventPriority类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论