本文整理汇总了Java中net.minecraft.entity.EntityLeashKnot类的典型用法代码示例。如果您正苦于以下问题:Java EntityLeashKnot类的具体用法?Java EntityLeashKnot怎么用?Java EntityLeashKnot使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
EntityLeashKnot类属于net.minecraft.entity包,在下文中一共展示了EntityLeashKnot类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: attachToFence
import net.minecraft.entity.EntityLeashKnot; //导入依赖的package包/类
public static boolean attachToFence(EntityPlayer player, World worldIn, BlockPos fence)
{
EntityLeashKnot entityleashknot = EntityLeashKnot.getKnotForPosition(worldIn, fence);
boolean flag = false;
double d0 = 7.0D;
int i = fence.getX();
int j = fence.getY();
int k = fence.getZ();
for (EntityLiving entityliving : worldIn.getEntitiesWithinAABB(EntityLiving.class, new AxisAlignedBB((double)i - d0, (double)j - d0, (double)k - d0, (double)i + d0, (double)j + d0, (double)k + d0)))
{
if (entityliving.getLeashed() && entityliving.getLeashedToEntity() == player)
{
if (entityleashknot == null)
{
entityleashknot = EntityLeashKnot.createKnot(worldIn, fence);
}
entityliving.setLeashedToEntity(entityleashknot, true);
flag = true;
}
}
return flag;
}
示例2: attachToFence
import net.minecraft.entity.EntityLeashKnot; //导入依赖的package包/类
public static boolean attachToFence(EntityPlayer player, World worldIn, BlockPos fence)
{
EntityLeashKnot entityleashknot = EntityLeashKnot.getKnotForPosition(worldIn, fence);
boolean flag = false;
double d0 = 7.0D;
int i = fence.getX();
int j = fence.getY();
int k = fence.getZ();
for (EntityLiving entityliving : worldIn.getEntitiesWithinAABB(EntityLiving.class, new AxisAlignedBB((double)i - 7.0D, (double)j - 7.0D, (double)k - 7.0D, (double)i + 7.0D, (double)j + 7.0D, (double)k + 7.0D)))
{
if (entityliving.getLeashed() && entityliving.getLeashedToEntity() == player)
{
if (entityleashknot == null)
{
entityleashknot = EntityLeashKnot.createKnot(worldIn, fence);
}
entityliving.setLeashedToEntity(entityleashknot, true);
flag = true;
}
}
return flag;
}
示例3: func_135066_a
import net.minecraft.entity.EntityLeashKnot; //导入依赖的package包/类
public static boolean func_135066_a(EntityPlayer p_135066_0_, World p_135066_1_, int p_135066_2_, int p_135066_3_, int p_135066_4_) {
EntityLeashKnot var5 = EntityLeashKnot.func_110130_b(p_135066_1_, p_135066_2_, p_135066_3_, p_135066_4_);
boolean var6 = false;
double var7 = 7.0D;
List var9 = p_135066_1_.func_72872_a(EntityLiving.class, AxisAlignedBB.func_72332_a().func_72299_a((double)p_135066_2_ - var7, (double)p_135066_3_ - var7, (double)p_135066_4_ - var7, (double)p_135066_2_ + var7, (double)p_135066_3_ + var7, (double)p_135066_4_ + var7));
if(var9 != null) {
Iterator var10 = var9.iterator();
while(var10.hasNext()) {
EntityLiving var11 = (EntityLiving)var10.next();
if(var11.func_110167_bD() && var11.func_110166_bE() == p_135066_0_) {
if(var5 == null) {
var5 = EntityLeashKnot.func_110129_a(p_135066_1_, p_135066_2_, p_135066_3_, p_135066_4_);
}
var11.func_110162_b(var5, true);
var6 = true;
}
}
}
return var6;
}
示例4: doRender
import net.minecraft.entity.EntityLeashKnot; //导入依赖的package包/类
/**
* Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
* handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
* (Render<T extends Entity>) and this method has signature public void doRender(T entity, double d, double d1,
* double d2, float f, float f1). But JAD is pre 1.5 so doe
*/
public void doRender(EntityLeashKnot entity, double x, double y, double z, float entityYaw, float partialTicks)
{
GlStateManager.pushMatrix();
GlStateManager.disableCull();
GlStateManager.translate((float)x, (float)y, (float)z);
float f = 0.0625F;
GlStateManager.enableRescaleNormal();
GlStateManager.scale(-1.0F, -1.0F, 1.0F);
GlStateManager.enableAlpha();
this.bindEntityTexture(entity);
this.leashKnotModel.render(entity, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, f);
GlStateManager.popMatrix();
super.doRender(entity, x, y, z, entityYaw, partialTicks);
}
示例5: doRender
import net.minecraft.entity.EntityLeashKnot; //导入依赖的package包/类
/**
* Renders the desired {@code T} type Entity.
*/
public void doRender(EntityLeashKnot entity, double x, double y, double z, float entityYaw, float partialTicks)
{
GlStateManager.pushMatrix();
GlStateManager.disableCull();
GlStateManager.translate((float)x, (float)y, (float)z);
float f = 0.0625F;
GlStateManager.enableRescaleNormal();
GlStateManager.scale(-1.0F, -1.0F, 1.0F);
GlStateManager.enableAlpha();
this.bindEntityTexture(entity);
if (this.renderOutlines)
{
GlStateManager.enableColorMaterial();
GlStateManager.enableOutlineMode(this.getTeamColor(entity));
}
this.leashKnotModel.render(entity, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F);
if (this.renderOutlines)
{
GlStateManager.disableOutlineMode();
GlStateManager.disableColorMaterial();
}
GlStateManager.popMatrix();
super.doRender(entity, x, y, z, entityYaw, partialTicks);
}
示例6: doTheZorroThing
import net.minecraft.entity.EntityLeashKnot; //导入依赖的package包/类
@SubscribeEvent
public void doTheZorroThing(EntityInteractEvent event) {
EntityPlayer player = event.entityPlayer;
if (player.worldObj.isRemote) return;
if (player.isRiding()) return;
if (!(event.target instanceof EntityHorse)) return;
EntityHorse horse = (EntityHorse) event.target;
if (player.fallDistance <= 2) return;
if (!horse.isHorseSaddled()) return;
if (horse.getLeashed()) {
if (!(horse.getLeashedToEntity() instanceof EntityLeashKnot)) return;
horse.getLeashedToEntity().interactFirst(player);
}
boolean awesome = false;
if (player.fallDistance > 5 && player.getHeldItem() != null) {
Item held = player.getHeldItem().getItem();
boolean has_baby = false;
if (player.riddenByEntity instanceof EntityAgeable) {
EntityAgeable ea = (EntityAgeable) player.riddenByEntity;
has_baby = ea.isChild();
}
awesome = held instanceof ItemSword || held instanceof ItemAxe || held instanceof ItemBow || player.riddenByEntity instanceof EntityPlayer || has_baby;
}
if (awesome) {
horse.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 20 * 40, 2, false, false));
horse.addPotionEffect(new PotionEffect(Potion.resistance.id, 20 * 40, 1, true, true));
horse.addPotionEffect(new PotionEffect(Potion.jump.id, 20 * 40, 1, true, true));
} else {
horse.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 20 * 8, 1, false, false));
}
horse.playLivingSound();
}
示例7: func_150909_a
import net.minecraft.entity.EntityLeashKnot; //导入依赖的package包/类
public static boolean func_150909_a(EntityPlayer p_150909_0_, World p_150909_1_, int p_150909_2_, int p_150909_3_, int p_150909_4_)
{
EntityLeashKnot var5 = EntityLeashKnot.getKnotForBlock(p_150909_1_, p_150909_2_, p_150909_3_, p_150909_4_);
boolean var6 = false;
double var7 = 7.0D;
List var9 = p_150909_1_.getEntitiesWithinAABB(EntityLiving.class, AxisAlignedBB.getAABBPool().getAABB((double)p_150909_2_ - var7, (double)p_150909_3_ - var7, (double)p_150909_4_ - var7, (double)p_150909_2_ + var7, (double)p_150909_3_ + var7, (double)p_150909_4_ + var7));
if (var9 != null)
{
Iterator var10 = var9.iterator();
while (var10.hasNext())
{
EntityLiving var11 = (EntityLiving)var10.next();
if (var11.getLeashed() && var11.getLeashedToEntity() == p_150909_0_)
{
if (var5 == null)
{
var5 = EntityLeashKnot.func_110129_a(p_150909_1_, p_150909_2_, p_150909_3_, p_150909_4_);
}
var11.setLeashedToEntity(var5, true);
var6 = true;
}
}
}
return var6;
}
示例8: doRender
import net.minecraft.entity.EntityLeashKnot; //导入依赖的package包/类
/**
* Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
* handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
* (Render<T extends Entity) and this method has signature public void doRender(T entity, double d, double d1,
* double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
*/
public void doRender(EntityLeashKnot par1EntityLeashKnot, double par2, double par4, double par6, float par8, float par9)
{
GL11.glPushMatrix();
GL11.glDisable(GL11.GL_CULL_FACE);
GL11.glTranslatef((float)par2, (float)par4, (float)par6);
float var10 = 0.0625F;
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
GL11.glScalef(-1.0F, -1.0F, 1.0F);
GL11.glEnable(GL11.GL_ALPHA_TEST);
this.bindEntityTexture(par1EntityLeashKnot);
this.leashKnotModel.render(par1EntityLeashKnot, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, var10);
GL11.glPopMatrix();
}
示例9: doRender
import net.minecraft.entity.EntityLeashKnot; //导入依赖的package包/类
public void doRender(EntityLeashKnot p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_)
{
GL11.glPushMatrix();
GL11.glDisable(GL11.GL_CULL_FACE);
GL11.glTranslatef((float)p_76986_2_, (float)p_76986_4_, (float)p_76986_6_);
float f2 = 0.0625F;
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
GL11.glScalef(-1.0F, -1.0F, 1.0F);
GL11.glEnable(GL11.GL_ALPHA_TEST);
this.bindEntityTexture(p_76986_1_);
this.leashKnotModel.render(p_76986_1_, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, f2);
GL11.glPopMatrix();
}
示例10: func_150909_a
import net.minecraft.entity.EntityLeashKnot; //导入依赖的package包/类
public static boolean func_150909_a(EntityPlayer p_150909_0_, World p_150909_1_, int p_150909_2_, int p_150909_3_, int p_150909_4_)
{
EntityLeashKnot entityleashknot = EntityLeashKnot.getKnotForBlock(p_150909_1_, p_150909_2_, p_150909_3_, p_150909_4_);
boolean flag = false;
double d0 = 7.0D;
List list = p_150909_1_.getEntitiesWithinAABB(EntityLiving.class, AxisAlignedBB.getBoundingBox((double)p_150909_2_ - d0, (double)p_150909_3_ - d0, (double)p_150909_4_ - d0, (double)p_150909_2_ + d0, (double)p_150909_3_ + d0, (double)p_150909_4_ + d0));
if (list != null)
{
Iterator iterator = list.iterator();
while (iterator.hasNext())
{
EntityLiving entityliving = (EntityLiving)iterator.next();
if (entityliving.getLeashed() && entityliving.getLeashedToEntity() == p_150909_0_)
{
if (entityleashknot == null)
{
entityleashknot = EntityLeashKnot.func_110129_a(p_150909_1_, p_150909_2_, p_150909_3_, p_150909_4_);
}
entityliving.setLeashedToEntity(entityleashknot, true);
flag = true;
}
}
}
return flag;
}
示例11: func_110165_bF
import net.minecraft.entity.EntityLeashKnot; //导入依赖的package包/类
private void func_110165_bF() {
if(this.field_110169_bv && this.field_110170_bx != null) {
if(this.field_110170_bx.func_74764_b("UUIDMost") && this.field_110170_bx.func_74764_b("UUIDLeast")) {
UUID var5 = new UUID(this.field_110170_bx.func_74763_f("UUIDMost"), this.field_110170_bx.func_74763_f("UUIDLeast"));
List var6 = this.field_70170_p.func_72872_a(EntityLivingBase.class, this.field_70121_D.func_72314_b(10.0D, 10.0D, 10.0D));
Iterator var7 = var6.iterator();
while(var7.hasNext()) {
EntityLivingBase var8 = (EntityLivingBase)var7.next();
if(var8.func_110124_au().equals(var5)) {
this.field_110168_bw = var8;
break;
}
}
} else if(this.field_110170_bx.func_74764_b("X") && this.field_110170_bx.func_74764_b("Y") && this.field_110170_bx.func_74764_b("Z")) {
int var1 = this.field_110170_bx.func_74762_e("X");
int var2 = this.field_110170_bx.func_74762_e("Y");
int var3 = this.field_110170_bx.func_74762_e("Z");
EntityLeashKnot var4 = EntityLeashKnot.func_110130_b(this.field_70170_p, var1, var2, var3);
if(var4 == null) {
var4 = EntityLeashKnot.func_110129_a(this.field_70170_p, var1, var2, var3);
}
this.field_110168_bw = var4;
} else {
this.func_110160_i(false, true);
}
}
this.field_110170_bx = null;
}
示例12: func_110799_a
import net.minecraft.entity.EntityLeashKnot; //导入依赖的package包/类
public void func_110799_a(EntityLeashKnot p_110799_1_, double p_110799_2_, double p_110799_4_, double p_110799_6_, float p_110799_8_, float p_110799_9_) {
GL11.glPushMatrix();
GL11.glDisable(2884);
GL11.glTranslatef((float)p_110799_2_, (float)p_110799_4_, (float)p_110799_6_);
float var10 = 0.0625F;
GL11.glEnable('\u803a');
GL11.glScalef(-1.0F, -1.0F, 1.0F);
GL11.glEnable(3008);
this.func_110777_b(p_110799_1_);
this.field_110801_f.func_78088_a(p_110799_1_, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, var10);
GL11.glPopMatrix();
}
示例13: func_135066_a
import net.minecraft.entity.EntityLeashKnot; //导入依赖的package包/类
public static boolean func_135066_a(EntityPlayer par0EntityPlayer, World par1World, int par2, int par3, int par4)
{
EntityLeashKnot entityleashknot = EntityLeashKnot.getKnotForBlock(par1World, par2, par3, par4);
boolean flag = false;
double d0 = 7.0D;
List list = par1World.getEntitiesWithinAABB(EntityLiving.class, AxisAlignedBB.getAABBPool().getAABB((double)par2 - d0, (double)par3 - d0, (double)par4 - d0, (double)par2 + d0, (double)par3 + d0, (double)par4 + d0));
if (list != null)
{
Iterator iterator = list.iterator();
while (iterator.hasNext())
{
EntityLiving entityliving = (EntityLiving)iterator.next();
if (entityliving.getLeashed() && entityliving.getLeashedToEntity() == par0EntityPlayer)
{
if (entityleashknot == null)
{
entityleashknot = EntityLeashKnot.func_110129_a(par1World, par2, par3, par4);
}
entityliving.setLeashedToEntity(entityleashknot, true);
flag = true;
}
}
}
return flag;
}
示例14: func_110799_a
import net.minecraft.entity.EntityLeashKnot; //导入依赖的package包/类
public void func_110799_a(EntityLeashKnot par1EntityLeashKnot, double par2, double par4, double par6, float par8, float par9)
{
GL11.glPushMatrix();
GL11.glDisable(GL11.GL_CULL_FACE);
GL11.glTranslatef((float)par2, (float)par4, (float)par6);
float f2 = 0.0625F;
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
GL11.glScalef(-1.0F, -1.0F, 1.0F);
GL11.glEnable(GL11.GL_ALPHA_TEST);
this.bindEntityTexture(par1EntityLeashKnot);
this.leashKnotModel.render(par1EntityLeashKnot, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, f2);
GL11.glPopMatrix();
}
示例15: RenderManager
import net.minecraft.entity.EntityLeashKnot; //导入依赖的package包/类
public RenderManager(TextureManager renderEngineIn, RenderItem itemRendererIn)
{
this.renderEngine = renderEngineIn;
this.entityRenderMap.put(EntityCaveSpider.class, new RenderCaveSpider(this));
this.entityRenderMap.put(EntitySpider.class, new RenderSpider(this));
this.entityRenderMap.put(EntityPig.class, new RenderPig(this, new ModelPig(), 0.7F));
this.entityRenderMap.put(EntitySheep.class, new RenderSheep(this, new ModelSheep2(), 0.7F));
this.entityRenderMap.put(EntityCow.class, new RenderCow(this, new ModelCow(), 0.7F));
this.entityRenderMap.put(EntityMooshroom.class, new RenderMooshroom(this, new ModelCow(), 0.7F));
this.entityRenderMap.put(EntityWolf.class, new RenderWolf(this, new ModelWolf(), 0.5F));
this.entityRenderMap.put(EntityChicken.class, new RenderChicken(this, new ModelChicken(), 0.3F));
this.entityRenderMap.put(EntityOcelot.class, new RenderOcelot(this, new ModelOcelot(), 0.4F));
this.entityRenderMap.put(EntityRabbit.class, new RenderRabbit(this, new ModelRabbit(), 0.3F));
this.entityRenderMap.put(EntitySilverfish.class, new RenderSilverfish(this));
this.entityRenderMap.put(EntityEndermite.class, new RenderEndermite(this));
this.entityRenderMap.put(EntityCreeper.class, new RenderCreeper(this));
this.entityRenderMap.put(EntityEnderman.class, new RenderEnderman(this));
this.entityRenderMap.put(EntitySnowman.class, new RenderSnowMan(this));
this.entityRenderMap.put(EntitySkeleton.class, new RenderSkeleton(this));
this.entityRenderMap.put(EntityWitch.class, new RenderWitch(this));
this.entityRenderMap.put(EntityBlaze.class, new RenderBlaze(this));
this.entityRenderMap.put(EntityPigZombie.class, new RenderPigZombie(this));
this.entityRenderMap.put(EntityZombie.class, new RenderZombie(this));
this.entityRenderMap.put(EntitySlime.class, new RenderSlime(this, new ModelSlime(16), 0.25F));
this.entityRenderMap.put(EntityMagmaCube.class, new RenderMagmaCube(this));
this.entityRenderMap.put(EntityGiantZombie.class, new RenderGiantZombie(this, new ModelZombie(), 0.5F, 6.0F));
this.entityRenderMap.put(EntityGhast.class, new RenderGhast(this));
this.entityRenderMap.put(EntitySquid.class, new RenderSquid(this, new ModelSquid(), 0.7F));
this.entityRenderMap.put(EntityVillager.class, new RenderVillager(this));
this.entityRenderMap.put(EntityIronGolem.class, new RenderIronGolem(this));
this.entityRenderMap.put(EntityBat.class, new RenderBat(this));
this.entityRenderMap.put(EntityGuardian.class, new RenderGuardian(this));
this.entityRenderMap.put(EntityDragon.class, new RenderDragon(this));
this.entityRenderMap.put(EntityEnderCrystal.class, new RenderEnderCrystal(this));
this.entityRenderMap.put(EntityWither.class, new RenderWither(this));
this.entityRenderMap.put(Entity.class, new RenderEntity(this));
this.entityRenderMap.put(EntityPainting.class, new RenderPainting(this));
this.entityRenderMap.put(EntityItemFrame.class, new RenderItemFrame(this, itemRendererIn));
this.entityRenderMap.put(EntityLeashKnot.class, new RenderLeashKnot(this));
this.entityRenderMap.put(EntityArrow.class, new RenderArrow(this));
this.entityRenderMap.put(EntitySnowball.class, new RenderSnowball(this, Items.snowball, itemRendererIn));
this.entityRenderMap.put(EntityEnderPearl.class, new RenderSnowball(this, Items.ender_pearl, itemRendererIn));
this.entityRenderMap.put(EntityEnderEye.class, new RenderSnowball(this, Items.ender_eye, itemRendererIn));
this.entityRenderMap.put(EntityEgg.class, new RenderSnowball(this, Items.egg, itemRendererIn));
this.entityRenderMap.put(EntityPotion.class, new RenderPotion(this, itemRendererIn));
this.entityRenderMap.put(EntityExpBottle.class, new RenderSnowball(this, Items.experience_bottle, itemRendererIn));
this.entityRenderMap.put(EntityFireworkRocket.class, new RenderSnowball(this, Items.fireworks, itemRendererIn));
this.entityRenderMap.put(EntityLargeFireball.class, new RenderFireball(this, 2.0F));
this.entityRenderMap.put(EntitySmallFireball.class, new RenderFireball(this, 0.5F));
this.entityRenderMap.put(EntityWitherSkull.class, new RenderWitherSkull(this));
this.entityRenderMap.put(EntityItem.class, new RenderEntityItem(this, itemRendererIn));
this.entityRenderMap.put(EntityXPOrb.class, new RenderXPOrb(this));
this.entityRenderMap.put(EntityTNTPrimed.class, new RenderTNTPrimed(this));
this.entityRenderMap.put(EntityFallingBlock.class, new RenderFallingBlock(this));
this.entityRenderMap.put(EntityArmorStand.class, new ArmorStandRenderer(this));
this.entityRenderMap.put(EntityMinecartTNT.class, new RenderTntMinecart(this));
this.entityRenderMap.put(EntityMinecartMobSpawner.class, new RenderMinecartMobSpawner(this));
this.entityRenderMap.put(EntityMinecart.class, new RenderMinecart(this));
this.entityRenderMap.put(EntityBoat.class, new RenderBoat(this));
this.entityRenderMap.put(EntityFishHook.class, new RenderFish(this));
this.entityRenderMap.put(EntityHorse.class, new RenderHorse(this, new ModelHorse(), 0.75F));
this.entityRenderMap.put(EntityLightningBolt.class, new RenderLightningBolt(this));
this.playerRenderer = new RenderPlayer(this);
this.skinMap.put("default", this.playerRenderer);
this.skinMap.put("slim", new RenderPlayer(this, true));
}