本文整理汇总了Java中net.minecraft.entity.passive.EntityWolf.isTamed方法的典型用法代码示例。如果您正苦于以下问题:Java EntityWolf.isTamed方法的具体用法?Java EntityWolf.isTamed怎么用?Java EntityWolf.isTamed使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.entity.passive.EntityWolf
的用法示例。
在下文中一共展示了EntityWolf.isTamed方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: doRenderLayer
import net.minecraft.entity.passive.EntityWolf; //导入方法依赖的package包/类
public void doRenderLayer(EntityWolf entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
if (entitylivingbaseIn.isTamed() && !entitylivingbaseIn.isInvisible())
{
this.wolfRenderer.bindTexture(WOLF_COLLAR);
float[] afloat = EntitySheep.getDyeRgb(entitylivingbaseIn.getCollarColor());
if (Config.isCustomColors())
{
afloat = CustomColors.getWolfCollarColors(entitylivingbaseIn.getCollarColor(), afloat);
}
GlStateManager.color(afloat[0], afloat[1], afloat[2]);
this.wolfRenderer.getMainModel().render(entitylivingbaseIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale);
}
}
示例2: shouldAttackEntity
import net.minecraft.entity.passive.EntityWolf; //导入方法依赖的package包/类
public boolean shouldAttackEntity(EntityLivingBase target){
EntityLivingBase owner = getOwner();
if (ConfigValues.HUNTCREEPERS || !(target instanceof EntityCreeper)) {
if (target instanceof EntityWolf) {
EntityWolf entitywolf = (EntityWolf) target;
if (entitywolf.isTamed() && entitywolf.getOwner() == owner || Alliances.getInstance().isAlliedTo(entitywolf.getOwnerId(), getOwnerId()))
return false;
}
if (target instanceof EntityArmyMember)
if ((getAttackMode() < 2 && Enemies.getInstance().isNotEnemiesWith(((EntityArmyMember) target).getOwnerId(), getOwnerId())) || ((EntityArmyMember) target).getOwnerId().equals(getOwnerId()) || Alliances.getInstance().isAlliedTo(((EntityArmyMember) target).getOwnerId(), getOwnerId()))
return false;
return !(target instanceof EntityPlayer && owner instanceof EntityPlayer && !((EntityPlayer) owner).canAttackPlayer((EntityPlayer) target)) && (!(target instanceof EntityHorse) || !((EntityHorse) target).isTame());
} else
return false;
}
示例3: shouldRenderPass
import net.minecraft.entity.passive.EntityWolf; //导入方法依赖的package包/类
/**
* Queries whether should render the specified pass or not.
*/
protected int shouldRenderPass(EntityWolf par1EntityWolf, int par2, float par3)
{
if (par2 == 0 && par1EntityWolf.getWolfShaking())
{
float var5 = par1EntityWolf.getBrightness(par3) * par1EntityWolf.getShadingWhileShaking(par3);
this.bindTexture(wolfTextures);
GL11.glColor3f(var5, var5, var5);
return 1;
}
else if (par2 == 1 && par1EntityWolf.isTamed())
{
this.bindTexture(wolfCollarTextures);
int var4 = par1EntityWolf.getCollarColor();
GL11.glColor3f(EntitySheep.fleeceColorTable[var4][0], EntitySheep.fleeceColorTable[var4][1], EntitySheep.fleeceColorTable[var4][2]);
return 1;
}
else
{
return -1;
}
}
示例4: shouldRenderPass
import net.minecraft.entity.passive.EntityWolf; //导入方法依赖的package包/类
protected int shouldRenderPass(EntityWolf p_77032_1_, int p_77032_2_, float p_77032_3_)
{
if (p_77032_2_ == 0 && p_77032_1_.getWolfShaking())
{
float f1 = p_77032_1_.getBrightness(p_77032_3_) * p_77032_1_.getShadingWhileShaking(p_77032_3_);
this.bindTexture(wolfTextures);
GL11.glColor3f(f1, f1, f1);
return 1;
}
else if (p_77032_2_ == 1 && p_77032_1_.isTamed())
{
this.bindTexture(wolfCollarTextures);
int j = p_77032_1_.getCollarColor();
GL11.glColor3f(EntitySheep.fleeceColorTable[j][0], EntitySheep.fleeceColorTable[j][1], EntitySheep.fleeceColorTable[j][2]);
return 1;
}
else
{
return -1;
}
}
示例5: func_82447_a
import net.minecraft.entity.passive.EntityWolf; //导入方法依赖的package包/类
protected int func_82447_a(EntityWolf par1EntityWolf, int par2, float par3)
{
float f1;
if (par2 == 0 && par1EntityWolf.getWolfShaking())
{
f1 = par1EntityWolf.getBrightness(par3) * par1EntityWolf.getShadingWhileShaking(par3);
this.bindTexture(wolfTextures);
GL11.glColor3f(f1, f1, f1);
return 1;
}
else if (par2 == 1 && par1EntityWolf.isTamed())
{
this.bindTexture(wolfCollarTextures);
f1 = 1.0F;
int j = par1EntityWolf.getCollarColor();
GL11.glColor3f(f1 * EntitySheep.fleeceColorTable[j][0], f1 * EntitySheep.fleeceColorTable[j][1], f1 * EntitySheep.fleeceColorTable[j][2]);
return 1;
}
else
{
return -1;
}
}
示例6: doRenderLayer
import net.minecraft.entity.passive.EntityWolf; //导入方法依赖的package包/类
public void doRenderLayer(EntityWolf entitylivingbaseIn, float p_177141_2_, float p_177141_3_, float partialTicks, float p_177141_5_, float p_177141_6_, float p_177141_7_, float scale)
{
if (entitylivingbaseIn.isTamed() && !entitylivingbaseIn.isInvisible())
{
this.wolfRenderer.bindTexture(WOLF_COLLAR);
EnumDyeColor enumdyecolor = EnumDyeColor.byMetadata(entitylivingbaseIn.getCollarColor().getMetadata());
float[] afloat = EntitySheep.func_175513_a(enumdyecolor);
GlStateManager.color(afloat[0], afloat[1], afloat[2]);
this.wolfRenderer.getMainModel().render(entitylivingbaseIn, p_177141_2_, p_177141_3_, p_177141_5_, p_177141_6_, p_177141_7_, scale);
}
}
示例7: doRenderLayer
import net.minecraft.entity.passive.EntityWolf; //导入方法依赖的package包/类
public void doRenderLayer(EntityWolf entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
if (entitylivingbaseIn.isTamed() && !entitylivingbaseIn.isInvisible())
{
this.wolfRenderer.bindTexture(WOLF_COLLAR);
EnumDyeColor enumdyecolor = EnumDyeColor.byMetadata(entitylivingbaseIn.getCollarColor().getMetadata());
float[] afloat = EntitySheep.getDyeRgb(enumdyecolor);
GlStateManager.color(afloat[0], afloat[1], afloat[2]);
this.wolfRenderer.getMainModel().render(entitylivingbaseIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale);
}
}
示例8: dispenseWolfArmor
import net.minecraft.entity.passive.EntityWolf; //导入方法依赖的package包/类
/**
* Helper method for dispensing item stacks
*
* @param source The block source
* @param stack The dispensing stack
* @return An item stack to dispense, or null if default dispense should occur.
*/
@Nonnull
private static ItemStack dispenseWolfArmor(@Nonnull IBlockSource source, @Nonnull ItemStack stack) {
BlockPos blockPos = source.getBlockPos().offset(source.getBlockState().getValue(BlockDispenser.FACING));
List<EntityWolf> wolves = source.getWorld().getEntitiesWithinAABB(EntityWolf.class, new AxisAlignedBB(blockPos));
if (!wolves.isEmpty()) {
EntityWolf wolf = null;
for (EntityWolf entity : wolves) {
if (entity.isTamed() && !entity.isChild()) {
wolf = entity;
break;
}
}
if (wolf != null) {
ItemStack copyStack = stack.copy();
copyStack.setCount(1);
IWolfArmorCapability wolfArmor = wolf.getCapability(CapabilityWolfArmor.WOLF_ARMOR_CAPABILITY, null);
if (wolfArmor == null || !wolfArmor.canEquipItem(copyStack)) {
return stack;
}
wolfArmor.equipArmor(copyStack);
stack.shrink(1);
}
}
return stack;
}
示例9: alertPlayerWolves
import net.minecraft.entity.passive.EntityWolf; //导入方法依赖的package包/类
static void alertPlayerWolves (EntityPlayer player, EntityLiving living, boolean par2)
{
if (!(living instanceof EntityCreeper) && !(living instanceof EntityGhast))
{
if (living instanceof EntityWolf)
{
EntityWolf var3 = (EntityWolf) living;
if (var3.isTamed() && player.username.equals(var3.getOwnerName()))
{
return;
}
}
if (!(living instanceof EntityPlayer) || player.func_96122_a((EntityPlayer) living))
{
List var6 = player.worldObj.getEntitiesWithinAABB(EntityWolf.class,
AxisAlignedBB.getAABBPool().getAABB(player.posX, player.posY, player.posZ, player.posX + 1.0D, player.posY + 1.0D, player.posZ + 1.0D).expand(16.0D, 4.0D, 16.0D));
Iterator var4 = var6.iterator();
while (var4.hasNext())
{
EntityWolf var5 = (EntityWolf) var4.next();
if (var5.isTamed() && var5.getEntityToAttack() == null && player.username.equals(var5.getOwnerName()) && (!par2 || !var5.isSitting()))
{
var5.setSitting(false);
var5.setTarget(living);
}
}
}
}
}
示例10: itemInteractionForEntity
import net.minecraft.entity.passive.EntityWolf; //导入方法依赖的package包/类
/**
* Returns true if the item can be used on the given entity, e.g. shears on sheep.
*/
@Override
public boolean itemInteractionForEntity(ItemStack stack, EntityPlayer player, EntityLivingBase entity, EnumHand hand) {
if (!player.world.isRemote && entity instanceof EntityWolf && !(entity instanceof ISophisticatedWolf)) {
EntityWolf wolf = (EntityWolf) entity;
if (wolf.isTamed()) {
EntitySophisticatedWolf sWolf = new EntitySophisticatedWolf(player.world);
sWolf.copyLocationAndAnglesFrom(wolf);
sWolf.setCustomNameTag(wolf.getCustomNameTag());
sWolf.setCollarColor(wolf.getCollarColor());
sWolf.setTamed(true);
sWolf.setOwnerId(wolf.getOwnerId());
sWolf.setCustomNameTag(wolf.getCustomNameTag());
sWolf.setHealth(wolf.getHealth());
if (Compatibility.IS_WOLF_ARMOR_INSTALLED) {
CompatibilityWolfArmor.copyWolfItems(wolf, sWolf);
}
wolf.setDead();
player.world.spawnEntity(sWolf);
player.world.playSound((player), new BlockPos(sWolf.posX, sWolf.posY, sWolf.posZ), null, null, 1016, 0);
stack.shrink(1);
return true;
}
return false;
} else {
return super.itemInteractionForEntity(stack, player, entity, hand);
}
}
示例11: onItemRightClick
import net.minecraft.entity.passive.EntityWolf; //导入方法依赖的package包/类
@Override
public ActionResult<ItemStack> onItemRightClick(World world, EntityPlayer player, EnumHand hand) {
if (world.isRemote) {
world.playSound(player, player.getPosition(), player.isSneaking() ? SWSound.WHISTLE_LONG : SWSound.WHISTLE_SHORT, SoundCategory.PLAYERS, 1, 1);
} else {
List<EntityWolf> wolvesList = world.getEntitiesWithinAABB(EntityWolf.class,
new AxisAlignedBB(player.posX - 35, player.posY - 35, player.posZ - 35,
player.posX + 35, player.posY + 35, player.posZ + 35));
if (!wolvesList.isEmpty()) {
int xPos = MathHelper.floor(player.posX) - 2;
int yPos = MathHelper.floor(player.getEntityBoundingBox().minY);
int zPos = MathHelper.floor(player.posZ) - 2;
for (EntityWolf wolf : wolvesList) {
if (wolf.isTamed() && wolf.isOwner(player) && (!wolf.isSitting() || player.isSneaking())) {
for (int x = -2; x <= 2; ++x) {
for (int z = -2; z <= 2; ++z) {
BlockPos wolfPos = new BlockPos(xPos + x, yPos, zPos + z);
IBlockState state = world.getBlockState(wolfPos);
if (state.getBlock().isAir(state, world, wolfPos)) {
wolf.setSitting(false);
wolf.getAISit().setSitting(false);
wolf.setLocationAndAngles(xPos + x + 0.5, yPos, zPos + z + 0.5, wolf.rotationYaw, wolf.rotationPitch);
wolf.getNavigator().clearPath();
wolf.setAttackTarget(null);
}
}
}
}
}
}
}
return new ActionResult(EnumActionResult.SUCCESS, player.getHeldItem(hand));
}
示例12: getEyeScale
import net.minecraft.entity.passive.EntityWolf; //导入方法依赖的package包/类
@Override
public float getEyeScale(EntityWolf living, float partialTick, int eye)
{
if(living.isTamed())
{
return 0.75F;
}
return eyeScale;
}
示例13: getEyeOffsetFromJoint
import net.minecraft.entity.passive.EntityWolf; //导入方法依赖的package包/类
@Override
public float[] getEyeOffsetFromJoint(EntityWolf living, float partialTick, int eye)
{
if(living.isTamed())
{
return eyeOffsetTame;
}
return eyeOffset;
}
示例14: alertPlayerWolves
import net.minecraft.entity.passive.EntityWolf; //导入方法依赖的package包/类
static void alertPlayerWolves (EntityPlayer player, EntityLivingBase living, boolean par2)
{
if (!(living instanceof EntityCreeper) && !(living instanceof EntityGhast))
{
if (living instanceof EntityWolf)
{
EntityWolf var3 = (EntityWolf) living;
if (var3.isTamed() && player.getDisplayName().equals(var3.getCommandSenderName()))
{
return;
}
}
if (!(living instanceof EntityPlayer) || player.canAttackPlayer((EntityPlayer) living))
{
List var6 = player.worldObj.getEntitiesWithinAABB(EntityWolf.class,
AxisAlignedBB.getBoundingBox(player.posX, player.posY, player.posZ, player.posX + 1.0D, player.posY + 1.0D, player.posZ + 1.0D).expand(16.0D, 4.0D, 16.0D));
Iterator var4 = var6.iterator();
while (var4.hasNext())
{
EntityWolf var5 = (EntityWolf) var4.next();
if (var5.isTamed() && var5.getEntityToAttack() == null && player.getDisplayName().equals(var5.getCommandSenderName()) && (!par2 || !var5.isSitting()))
{
var5.setSitting(false);
var5.setTarget(living);
}
}
}
}
}
示例15: getEntityTexture
import net.minecraft.entity.passive.EntityWolf; //导入方法依赖的package包/类
/**
* Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
*/
protected ResourceLocation getEntityTexture(EntityWolf entity)
{
return entity.isTamed() ? tamedWolfTextures : (entity.isAngry() ? anrgyWolfTextures : wolfTextures);
}