本文整理匯總了Java中net.minecraft.entity.monster.EntityEnderman類的典型用法代碼示例。如果您正苦於以下問題:Java EntityEnderman類的具體用法?Java EntityEnderman怎麽用?Java EntityEnderman使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
EntityEnderman類屬於net.minecraft.entity.monster包,在下文中一共展示了EntityEnderman類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: doRenderLayer
import net.minecraft.entity.monster.EntityEnderman; //導入依賴的package包/類
public void doRenderLayer(EntityEnderman entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
IBlockState iblockstate = entitylivingbaseIn.getHeldBlockState();
if (iblockstate != null)
{
BlockRendererDispatcher blockrendererdispatcher = Minecraft.getMinecraft().getBlockRendererDispatcher();
GlStateManager.enableRescaleNormal();
GlStateManager.pushMatrix();
GlStateManager.translate(0.0F, 0.6875F, -0.75F);
GlStateManager.rotate(20.0F, 1.0F, 0.0F, 0.0F);
GlStateManager.rotate(45.0F, 0.0F, 1.0F, 0.0F);
GlStateManager.translate(0.25F, 0.1875F, 0.25F);
float f = 0.5F;
GlStateManager.scale(-0.5F, -0.5F, 0.5F);
int i = entitylivingbaseIn.getBrightnessForRender(partialTicks);
int j = i % 65536;
int k = i / 65536;
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)j, (float)k);
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.endermanRenderer.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
blockrendererdispatcher.renderBlockBrightness(iblockstate, 1.0F);
GlStateManager.popMatrix();
GlStateManager.disableRescaleNormal();
}
}
示例2: addCollisionBoxToList
import net.minecraft.entity.monster.EntityEnderman; //導入依賴的package包/類
@SuppressWarnings("deprecation")
@Override
public void addCollisionBoxToList(IBlockState state, World worldIn, BlockPos pos, AxisAlignedBB entityBox, List<AxisAlignedBB> collidingBoxes, @Nullable Entity entityIn, boolean p_185477_7_) {
if (entityIn instanceof EntityLivingBase && (((EntityLivingBase) entityIn).getCreatureAttribute() == EnumCreatureAttribute.UNDEAD)) {
collidingBoxes.add(new AxisAlignedBB(pos).expand(0, 255, 0));
}
if (entityIn instanceof EntityLivingBase && (((EntityLivingBase) entityIn).getCreatureAttribute() == EnumCreatureAttribute.ARTHROPOD)) {
entityIn.attackEntityFrom(DamageSource.MAGIC, 1);
}
if (entityIn instanceof EntityBlaze) {
collidingBoxes.add(new AxisAlignedBB(pos).expand(0, 255, 0));
}
if (entityIn instanceof EntityEnderman) {
collidingBoxes.add(new AxisAlignedBB(pos).expand(0, 255, 0));
}
if (entityIn instanceof EntityGhast) {
collidingBoxes.add(new AxisAlignedBB(pos).expand(0, 255, 0));
}
if (entityIn instanceof EntityVex) {
collidingBoxes.add(new AxisAlignedBB(pos).expand(0, 255, 0));
}
}
示例3: isMobAggressive
import net.minecraft.entity.monster.EntityEnderman; //導入依賴的package包/類
/**
* Checks if the mob could be possibly hostile towards us (we can't detect their attack target easily)
* Current entities:
* PigZombie: Aggressive if arms are raised, when arms are put down a internal timer is slowly ticked down from 400
* Wolf: Aggressive if the owner isn't the local player and the wolf is angry
* Enderman: Aggressive if making screaming sounds
*/
public static boolean isMobAggressive(Entity entity) {
if(entity instanceof EntityPigZombie) {
// arms raised = aggressive, angry = either game or we have set the anger cooldown
if(((EntityPigZombie) entity).isArmsRaised() || ((EntityPigZombie) entity).isAngry()) {
if(!((EntityPigZombie) entity).isAngry()) {
// set pigmens anger to 400 if it hasn't been angered already
FastReflection.Fields.EntityPigZombie_angerLevel.set((EntityPigZombie)entity, 400);
}
return true;
}
} else if(entity instanceof EntityWolf) {
return ((EntityWolf) entity).isAngry() &&
!MC.player.equals(((EntityWolf) entity).getOwner());
} else if(entity instanceof EntityEnderman) {
return ((EntityEnderman) entity).isScreaming();
}
return false;
}
示例4: doRenderLayer
import net.minecraft.entity.monster.EntityEnderman; //導入依賴的package包/類
public void doRenderLayer(EntityEnderman 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)
{
IBlockState iblockstate = entitylivingbaseIn.getHeldBlockState();
if (iblockstate.getBlock().getMaterial() != Material.air)
{
BlockRendererDispatcher blockrendererdispatcher = Minecraft.getMinecraft().getBlockRendererDispatcher();
GlStateManager.enableRescaleNormal();
GlStateManager.pushMatrix();
GlStateManager.translate(0.0F, 0.6875F, -0.75F);
GlStateManager.rotate(20.0F, 1.0F, 0.0F, 0.0F);
GlStateManager.rotate(45.0F, 0.0F, 1.0F, 0.0F);
GlStateManager.translate(0.25F, 0.1875F, 0.25F);
float f = 0.5F;
GlStateManager.scale(-f, -f, f);
int i = entitylivingbaseIn.getBrightnessForRender(partialTicks);
int j = i % 65536;
int k = i / 65536;
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)j / 1.0F, (float)k / 1.0F);
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.endermanRenderer.bindTexture(TextureMap.locationBlocksTexture);
blockrendererdispatcher.renderBlockBrightness(iblockstate, 1.0F);
GlStateManager.popMatrix();
GlStateManager.disableRescaleNormal();
}
}
示例5: doRenderLayer
import net.minecraft.entity.monster.EntityEnderman; //導入依賴的package包/類
public void doRenderLayer(EntityEnderman 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)
{
this.endermanRenderer.bindTexture(field_177203_a);
GlStateManager.enableBlend();
GlStateManager.disableAlpha();
GlStateManager.blendFunc(1, 1);
GlStateManager.disableLighting();
GlStateManager.depthMask(!entitylivingbaseIn.isInvisible());
int i = 61680;
int j = i % 65536;
int k = i / 65536;
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)j / 1.0F, (float)k / 1.0F);
GlStateManager.enableLighting();
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.endermanRenderer.getMainModel().render(entitylivingbaseIn, p_177141_2_, p_177141_3_, p_177141_5_, p_177141_6_, p_177141_7_, scale);
this.endermanRenderer.func_177105_a(entitylivingbaseIn, partialTicks);
GlStateManager.depthMask(true);
GlStateManager.disableBlend();
GlStateManager.enableAlpha();
}
示例6: loadEntityShader
import net.minecraft.entity.monster.EntityEnderman; //導入依賴的package包/類
/**
* What shader to use when spectating this entity
*/
public void loadEntityShader(Entity entityIn)
{
if (OpenGlHelper.shadersSupported)
{
if (this.theShaderGroup != null)
{
this.theShaderGroup.deleteShaderGroup();
}
this.theShaderGroup = null;
if (entityIn instanceof EntityCreeper)
{
this.loadShader(new ResourceLocation("shaders/post/creeper.json"));
}
else if (entityIn instanceof EntitySpider)
{
this.loadShader(new ResourceLocation("shaders/post/spider.json"));
}
else if (entityIn instanceof EntityEnderman)
{
this.loadShader(new ResourceLocation("shaders/post/invert.json"));
}
}
}
示例7: loadEntityShader
import net.minecraft.entity.monster.EntityEnderman; //導入依賴的package包/類
/**
* What shader to use when spectating this entity
*/
public void loadEntityShader(Entity entityIn) {
if (OpenGlHelper.shadersSupported) {
if (this.theShaderGroup != null) {
this.theShaderGroup.deleteShaderGroup();
}
this.theShaderGroup = null;
if (entityIn instanceof EntityCreeper) {
this.loadShader(new ResourceLocation("shaders/post/creeper.json"));
} else if (entityIn instanceof EntitySpider) {
this.loadShader(new ResourceLocation("shaders/post/spider.json"));
} else if (entityIn instanceof EntityEnderman) {
this.loadShader(new ResourceLocation("shaders/post/invert.json"));
}
}
}
示例8: onTargetSelect
import net.minecraft.entity.monster.EntityEnderman; //導入依賴的package包/類
@SubscribeEvent
public void onTargetSelect(LivingSetAttackTargetEvent e) {
if (e.getEntityLiving() instanceof EntityEnderman && e.getTarget() instanceof EntityPlayer) {
EntityPlayer player = (EntityPlayer) e.getTarget();
ItemStack stack = player.inventory.armorInventory.get(3);
boolean stopAttack = false;
if (!stack.isEmpty() && stack.getItem() instanceof ItemSkullBase) {
ItemSkullBase skull = (ItemSkullBase) stack.getItem();
if (skull.isEndermanSkull()) {
stopAttack = true;
}
}
if (stopAttack) {
((EntityLiving) e.getEntityLiving()).setAttackTarget(null);
}
}
}
示例9: doRender
import net.minecraft.entity.monster.EntityEnderman; //導入依賴的package包/類
/**
* Renders the desired {@code T} type Entity.
*/
public void doRender(EntityEnderman entity, double x, double y, double z, float entityYaw, float partialTicks)
{
IBlockState iblockstate = entity.getHeldBlockState();
ModelEnderman modelenderman = this.getMainModel();
modelenderman.isCarrying = iblockstate != null;
modelenderman.isAttacking = entity.isScreaming();
if (entity.isScreaming())
{
double d0 = 0.02D;
x += this.rnd.nextGaussian() * 0.02D;
z += this.rnd.nextGaussian() * 0.02D;
}
super.doRender(entity, x, y, z, entityYaw, partialTicks);
}
示例10: doRender
import net.minecraft.entity.monster.EntityEnderman; //導入依賴的package包/類
/**
* Renders the desired {@code T} type Entity.
*/
public void doRender(EntityEnderman entity, double x, double y, double z, float entityYaw, float partialTicks)
{
IBlockState iblockstate = entity.getHeldBlockState();
this.endermanModel.isCarrying = iblockstate != null;
this.endermanModel.isAttacking = entity.isScreaming();
if (entity.isScreaming())
{
double d0 = 0.02D;
x += this.rnd.nextGaussian() * 0.02D;
z += this.rnd.nextGaussian() * 0.02D;
}
super.doRender(entity, x, y, z, entityYaw, partialTicks);
}
示例11: doRenderLayer
import net.minecraft.entity.monster.EntityEnderman; //導入依賴的package包/類
public void doRenderLayer(EntityEnderman entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
this.endermanRenderer.bindTexture(RES_ENDERMAN_EYES);
GlStateManager.enableBlend();
GlStateManager.disableAlpha();
GlStateManager.blendFunc(GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ONE);
GlStateManager.disableLighting();
GlStateManager.depthMask(!entitylivingbaseIn.isInvisible());
int i = 61680;
int j = 61680;
int k = 0;
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 61680.0F, 0.0F);
GlStateManager.enableLighting();
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.endermanRenderer.getMainModel().render(entitylivingbaseIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale);
this.endermanRenderer.setLightmap(entitylivingbaseIn, partialTicks);
GlStateManager.depthMask(true);
GlStateManager.disableBlend();
GlStateManager.enableAlpha();
}
示例12: magnumTorchDenyTeleport
import net.minecraft.entity.monster.EntityEnderman; //導入依賴的package包/類
@SubscribeEvent
public void magnumTorchDenyTeleport(final EnderTeleportEvent event) {
if (event.entityLiving instanceof EntityEnderman && !((EntityEnderman)event.entityLiving).isScreaming()) {
for (final int[] coord : EventHandlerServer.magnumTorchRegistry) {
if (coord[0] == event.entity.worldObj.provider.dimensionId && event.entity.worldObj.blockExists(coord[1], coord[2], coord[3]) && event.entity.worldObj.getTileEntity(coord[1], coord[2], coord[3]) instanceof IAntiMobTorch) {
final TileEntity tile = event.entity.worldObj.getTileEntity(coord[1], coord[2], coord[3]);
final double dx = tile.xCoord + 0.5f - event.targetX;
final double dy = tile.yCoord + 0.5f - event.targetY;
final double dz = tile.zCoord + 0.5f - event.targetZ;
if ((dx * dx + dz * dz) / ((IAntiMobTorch)tile).getHorizontalTorchRangeSquared() + dy * dy / ((IAntiMobTorch)tile).getVerticalTorchRangeSquared() > 1.0) {
continue;
}
final double dx2 = tile.xCoord + 0.5f - event.entity.posX;
final double dy2 = tile.yCoord + 0.5f - event.entity.posY;
final double dz2 = tile.zCoord + 0.5f - event.entity.posZ;
if (dx * dx + dy * dy + dz * dz >= dx2 * dx2 + dy2 * dy2 + dz2 * dz2) {
continue;
}
event.setCanceled(true);
}
}
}
}
示例13: onEntityCollidedWithBlock
import net.minecraft.entity.monster.EntityEnderman; //導入依賴的package包/類
public void onEntityCollidedWithBlock(final World par1World, final int par2, final int par3, final int par4, final Entity par5Entity) {
if (par1World.getBlockMetadata(par2, par3, par4) >= 3) {
if (par5Entity instanceof EntityItem) {
final ItemStack item = ((EntityItem)par5Entity).getEntityItem();
if (item != null && (item.getItem() == this.getSeedItem() || item.getItem() == this.getCropItem())) {
return;
}
if (par1World.isRemote) {
par1World.spawnParticle("crit", par5Entity.posX, par5Entity.posY, par5Entity.posZ, 0.0, 0.0, 0.0);
}
}
if (par5Entity instanceof EntityEnderman) {
return;
}
par5Entity.attackEntityFrom(DamageSource.cactus, 0.1f);
}
}
示例14: getPossibleCreatures
import net.minecraft.entity.monster.EntityEnderman; //導入依賴的package包/類
@SuppressWarnings({ "unchecked", "rawtypes" })
@Override
public List getPossibleCreatures(EnumCreatureType par1EnumCreatureType, int i, int j, int k)
{
if (par1EnumCreatureType == EnumCreatureType.monster)
{
final List monsters = new ArrayList();
monsters.add(new SpawnListEntry(EntityEvolvedZombie.class, 3000, 1, 3));
monsters.add(new SpawnListEntry(EntityEvolvedSpider.class, 2000, 1, 2));
monsters.add(new SpawnListEntry(EntityEvolvedSkeleton.class, 1500, 1, 1));
monsters.add(new SpawnListEntry(EntityEvolvedCreeper.class, 2000, 1, 1));
if (ConfigManagerCore.challengeMode) monsters.add(new SpawnListEntry(EntityEnderman.class, 250, 1, 1));
return monsters;
}
else
{
return null;
}
}
示例15: postInit
import net.minecraft.entity.monster.EntityEnderman; //導入依賴的package包/類
public static void postInit(){
addToBiomes(EntityCrystalPigZombie.class, 50, 1, 4, EnumCreatureType.MONSTER, getBiomesThatCanSpawn(EntityPigZombie.class, EnumCreatureType.MONSTER));
addToBiomes(EntityCrystalCow.class, 6, 1, 4, EnumCreatureType.CREATURE, getBiomesThatCanSpawn(EntityCow.class, EnumCreatureType.CREATURE));
addToBiomes(EntityCrystalEnderman.class, 8, 1, 4, EnumCreatureType.MONSTER, getBiomesThatCanSpawn(EntityEnderman.class, EnumCreatureType.MONSTER));
List<Biome> angelBiomeList = getBiomesThatCanSpawn(EntityEnderman.class, EnumCreatureType.MONSTER);
Biome hell = Biome.REGISTRY.getObject(new ResourceLocation("hell"));
Biome sky = Biome.REGISTRY.getObject(new ResourceLocation("sky"));
if(sky !=null){
angelBiomeList.remove(sky);
}
if(hell !=null){
angelBiomeList.remove(hell);
List<Biome> listHell = Lists.newArrayList(hell);
addToBiomes(EntityAngel.class, 50, 4, 4, EnumCreatureType.MONSTER, listHell);
addToBiomes(EntityDevil.class, 50, 4, 4, EnumCreatureType.MONSTER, listHell);
}
addToBiomes(EntityAngel.class, 8, 1, 4, EnumCreatureType.MONSTER, angelBiomeList);
addToBiomes(EntityDevil.class, 8, 1, 4, EnumCreatureType.MONSTER, angelBiomeList);
}