本文整理汇总了Java中me.ichun.mods.morph.api.MorphApi类的典型用法代码示例。如果您正苦于以下问题:Java MorphApi类的具体用法?Java MorphApi怎么用?Java MorphApi使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MorphApi类属于me.ichun.mods.morph.api包,在下文中一共展示了MorphApi类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getPatronInfo
import me.ichun.mods.morph.api.MorphApi; //导入依赖的package包/类
public static PatronInfo getPatronInfo(EntityPlayer player)
{
EntityPlayer oriPlayer = player;
if(iChunUtil.hasMorphMod())
{
EntityLivingBase ent = MorphApi.getApiImpl().getMorphEntity(player.getEntityWorld(), player.getName(), Side.CLIENT);
if(ent != null) //is morphed
{
if(!(ent instanceof EntityPlayer) || MorphApi.getApiImpl().morphProgress(player.getName(), Side.CLIENT) < 1.0F)
{
return null;
}
player = (EntityPlayer)ent;
}
}
PatronInfo info = null;
for(PatronInfo info1 : patrons)
{
if(info1.id.equals(player.getGameProfile().getId().toString().replaceAll("-", "")))
{
info = info1;
break;
}
}
return info;
}
开发者ID:iChun,项目名称:iChunUtil,代码行数:28,代码来源:PatronEffectRenderer.java
示例2: doRenderLayer
import me.ichun.mods.morph.api.MorphApi; //导入依赖的package包/类
@Override
//func_177093_a(entity, f8, f7, partialTicks, f5, f4, f9, 0.0625F);
public void doRenderLayer(EntityPlayer player, float f, float f1, float renderTick, float f2, float f3, float f4, float f5)
{
if(iChunUtil.hasMorphMod() && MorphApi.getApiImpl().hasMorph(player.getName(), Side.CLIENT) && (MorphApi.getApiImpl().morphProgress(player.getName(), Side.CLIENT) < 1.0F || !(MorphApi.getApiImpl().getMorphEntity(player.getEntityWorld(), player.getName(), Side.CLIENT) instanceof EntityPlayer)))
{
return;
}
if(!(player.isWearing(EnumPlayerModelParts.CAPE) && ((AbstractClientPlayer)player).getLocationCape() != null) && !player.isInvisible() && !player.isPlayerSleeping())
{
ItemStack is = BackTools.eventHandlerClient.playerTool.get(player.getName());
ItemStack heldItem = player.getHeldItem(EnumHand.MAIN_HAND);
if(!heldItem.isEmpty())
{
ItemStack is1 = heldItem.copy();
is1.setItemDamage(0);
heldItem = is1;
}
if(is != null && !is.isEmpty() && !ItemStack.areItemStacksEqual(is, heldItem))
{
GlStateManager.pushMatrix();
GlStateManager.translate(0.0f, 0.35F, 0.16F);
if(!player.inventory.armorItemInSlot(2).isEmpty())
{
GlStateManager.translate(0.0F, player.isSneaking() ? -0.1F : 0.0F, player.isSneaking() ? 0.025F : 0.06F);
}
if(player.isSneaking())
{
GlStateManager.translate(0F, 0.08F, 0.13F);
GlStateManager.rotate(28.8F, 1.0F, 0.0F, 0.0F);
}
GlStateManager.rotate((float)(BackTools.getOrientation(is.getItem().getClass()) - 1) * -90F, 0.0F, 0.0F, 1.0F);
GlStateManager.rotate(180F, 0.0F, 1.0F, 0.0F);
GlStateManager.enableBlend();
GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
IBakedModel model = Minecraft.getMinecraft().getRenderItem().getItemModelMesher().getItemModel(is);
RendererHelper.renderBakedModel(model, -1, is);
GlStateManager.disableBlend();
GlStateManager.enableLighting();
GlStateManager.enableAlpha();
GlStateManager.popMatrix();
}
}
}
开发者ID:iChun,项目名称:BackTools,代码行数:55,代码来源:LayerBackTool.java
示例3: doRender
import me.ichun.mods.morph.api.MorphApi; //导入依赖的package包/类
@Override
public void doRender(EntityBee bee, double d, double d1, double d2, float f, float f1)
{
GlStateManager.pushMatrix();
double offX = 0D;
double offY = 0D;
double offZ = 0D;
if(bee.getDataManager().get(EntityBee.SHOOTER_ID) == Minecraft.getMinecraft().getRenderViewEntity().getEntityId() && Minecraft.getMinecraft().getRenderViewEntity() instanceof EntityLivingBase && Minecraft.getMinecraft().gameSettings.thirdPersonView == 0)
{
EntityLivingBase player = (EntityLivingBase)Minecraft.getMinecraft().getRenderViewEntity();
EntityLivingBase renderedShooter = (EntityLivingBase)Minecraft.getMinecraft().getRenderViewEntity();
if(iChunUtil.hasMorphMod() && player instanceof EntityPlayer && MorphApi.getApiImpl().getMorphEntity(player.getEntityWorld(), player.getName(), Side.CLIENT) != null)
{
renderedShooter = MorphApi.getApiImpl().getMorphEntity(player.getEntityWorld(), player.getName(), Side.CLIENT);
}
Vec3d look = player.getLookVec();
Vec3d posTP = renderedShooter.getPositionVector().addVector(look.x * 1.3D - look.z * (renderedShooter.width * 0.2D), look.y * 1.3D + (renderedShooter.getEyeHeight() * 0.8D), look.z * 1.3D + look.x * (renderedShooter.width * 0.2D));
Vec3d posFP = renderedShooter.getPositionVector().addVector(look.x * 1.3D - look.z * 0.75D, look.y * 1.3D + 1.15D, look.z * 1.5D + look.x * 0.75D);
Vec3d offset = posTP.subtract(posFP);
float prog = 1F - MathHelper.clamp((bee.ticksExisted + f1) / 10F, 0F, 1F);
offY = offset.y * prog;
switch(ItemHandler.getHandSide(player, ItemHandler.getUsableDualHandedItem(player)))
{
case RIGHT:
{
offX = offset.x * prog;
offZ = offset.z * prog;
break;
}
case LEFT:
{
offX = -offset.x * prog;
offZ = -offset.z * prog;
break;
}
}
}
GlStateManager.translate((float)d - offX, (float)d1 - offY, (float)d2 - offZ);
GlStateManager.rotate(EntityHelper.interpolateRotation(bee.prevRotationPitch, bee.rotationPitch, f1), 0.0F, 0.0F, 1.0F);
GlStateManager.rotate(180f + f, 0.0F, 1.0F, 0.0F);
float scale = 0.8F;
GlStateManager.scale(scale, scale, scale);
this.bindEntityTexture(bee);
GlStateManager.scale(-1.0F, -1.0F, 1.0F);
modelBee.render(0.0625F);
GlStateManager.popMatrix();
}
开发者ID:iChun,项目名称:BeeBarker,代码行数:52,代码来源:RenderBee.java
示例4: EntityBee
import me.ichun.mods.morph.api.MorphApi; //导入依赖的package包/类
public EntityBee(World world, EntityLivingBase shooter)
{
this(world);
this.shooter = shooter;
EntityLivingBase renderedShooter = shooter;
if(iChunUtil.hasMorphMod() && shooter instanceof EntityPlayer && MorphApi.getApiImpl().getMorphEntity(shooter.getEntityWorld(), shooter.getName(), Side.SERVER) != null)
{
renderedShooter = MorphApi.getApiImpl().getMorphEntity(shooter.getEntityWorld(), shooter.getName(), Side.SERVER);
}
Vec3d look = shooter.getLookVec();
Vec3d pos = shooter.getPositionVector().addVector(look.x * 1.3D - look.z * (renderedShooter.width * 0.2D), look.y * 1.3D + (renderedShooter.getEyeHeight() * 0.8D), look.z * 1.3D + look.x * (renderedShooter.width * 0.2D));
double gausAmount = 0.02D;
double d0 = rand.nextGaussian() * gausAmount;
double d1 = rand.nextGaussian() * gausAmount;
double d2 = rand.nextGaussian() * gausAmount;
setPosition(pos.x, pos.y, pos.z);
double mag = shooter instanceof EntityWolf ? 0.15D : 0.4D;
motionX = look.x * mag + d0;
motionY = look.y * mag + d1;
motionZ = look.z * mag + d2;
float var20 = MathHelper.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ);
this.rotationYaw = (float)(Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI);
for (this.rotationPitch = (float)(Math.atan2(this.motionY, (double)var20) * 180.0D / Math.PI); this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F)
{
;
}
while (this.rotationPitch - this.prevRotationPitch >= 180.0F)
{
this.prevRotationPitch += 360.0F;
}
while (this.rotationYaw - this.prevRotationYaw < -180.0F)
{
this.prevRotationYaw -= 360.0F;
}
while (this.rotationYaw - this.prevRotationYaw >= 180.0F)
{
this.prevRotationYaw += 360.0F;
}
this.rotationPitch = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * 0.2F;
this.rotationYaw = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * 0.2F;
getDataManager().set(SHOOTER_ID, shooter.getEntityId());
}
开发者ID:iChun,项目名称:BeeBarker,代码行数:53,代码来源:EntityBee.java
示例5: onUpdate
import me.ichun.mods.morph.api.MorphApi; //导入依赖的package包/类
@Override
public void onUpdate()
{
renderingParent = parent;
render = true;
ticksExisted++;
if(reColour > 0)
{
reColour--;
}
if(parent == null || !parent.isEntityAlive() || parent.isChild())
{
setDead();
return;
}
if(iChunUtil.hasMorphMod() && parent instanceof EntityPlayer)
{
EntityPlayer player = (EntityPlayer)parent;
EntityLivingBase morphEnt = MorphApi.getApiImpl().getMorphEntity(player.getEntityWorld(), player.getName(), Side.CLIENT);
if(morphEnt != null)
{
renderingParent = morphEnt;
}
}
lastUpdate = world.getWorldTime();
validateHatInfo();
// if(!(parent instanceof EntityPlayer))
// {
// worldObj.spawnParticle("smoke", posX, posY, posZ, 1.0D, 0.0D, 0.0D);
// worldObj.spawnParticle("smoke", posX, posY, posZ, -1.0D, 0.0D, 0.0D);
// worldObj.spawnParticle("smoke", posX, posY, posZ, 0.0D, 1.0D, 0.0D);
// worldObj.spawnParticle("smoke", posX, posY, posZ, 0.0D, -1.0D, 0.0D);
// worldObj.spawnParticle("smoke", posX, posY, posZ, 0.0D, 0.0D, 1.0D);
// worldObj.spawnParticle("smoke", posX, posY, posZ, 0.0D, 0.0D, -1.0D);
// }
}
开发者ID:iChun,项目名称:Hats,代码行数:43,代码来源:EntityHat.java
示例6: track
import me.ichun.mods.morph.api.MorphApi; //导入依赖的package包/类
@Override
public void track(EntityTrackerRegistry.EntityInfo info)
{
if(info.tracked instanceof EntityPlayer)
{
EntityPlayer player = (EntityPlayer)info.tracked;
float speed = 7.5F;
pitchChange = player.getEntityWorld().rand.nextFloat() * (speed * 2F) - speed;
yawChange = player.getEntityWorld().rand.nextFloat() * (speed * 2F) - speed;
canRender = false;
for(PatronInfo info1 : PatronEffectRenderer.patrons)
{
if(info1.id.equals(player.getGameProfile().getId().toString().replaceAll("-", "")) && info1.effectType == PatronEffectRenderer.EnumEffect.VOXEL.getId())
{
canRender = true;
break;
}
}
txLocation = ((AbstractClientPlayer)player).getLocationSkin();
if(canRender && (player.isInvisible() || player.isPlayerSleeping()))
{
canRender = false;
}
if(canRender && iChunUtil.hasMorphMod())
{
if(MorphApi.getApiImpl().hasMorph(player.getName(), Side.CLIENT))
{
if(MorphApi.getApiImpl().morphProgress(player.getName(), Side.CLIENT) < 1.0F || !(MorphApi.getApiImpl().getMorphEntity(player.getEntityWorld(), player.getName(), Side.CLIENT) instanceof AbstractClientPlayer))
{
canRender = false;
}
if(MorphApi.getApiImpl().getMorphEntity(player.getEntityWorld(), player.getName(), Side.CLIENT) instanceof AbstractClientPlayer)
{
txLocation = ((AbstractClientPlayer)MorphApi.getApiImpl().getMorphEntity(player.getEntityWorld(), player.getName(), Side.CLIENT)).getLocationSkin();
}
}
}
float f = 0.2617994F;
float f1 = -0.2617994F;
if(player.isElytraFlying())
{
float f4 = 1.0F;
double motionX = player.posX - player.prevPosX;
double motionY = player.posY - player.prevPosY;
double motionZ = player.posZ - player.prevPosZ;
if(motionY < 0.0D)
{
Vec3d vec3d = (new Vec3d(motionX, motionY, motionZ)).normalize();
f4 = 1.0F - (float)Math.pow(-vec3d.y, 1.5D);
}
f = f4 * 0.34906584F + (1.0F - f4) * f;
f1 = f4 * -((float)Math.PI / 2F) + (1.0F - f4) * f1;
}
else if(player.isSneaking())
{
f = ((float)Math.PI * 2F / 9F);
f1 = -((float)Math.PI / 4F);
}
elytraX = f;
elytraZ = f1;
}
}
开发者ID:iChun,项目名称:iChunUtil,代码行数:69,代码来源:PatronTracker.java
注:本文中的me.ichun.mods.morph.api.MorphApi类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论