本文整理匯總了Java中net.minecraft.entity.monster.EntityEnderman.getHeldBlockState方法的典型用法代碼示例。如果您正苦於以下問題:Java EntityEnderman.getHeldBlockState方法的具體用法?Java EntityEnderman.getHeldBlockState怎麽用?Java EntityEnderman.getHeldBlockState使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類net.minecraft.entity.monster.EntityEnderman
的用法示例。
在下文中一共展示了EntityEnderman.getHeldBlockState方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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: 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();
}
}
示例3: 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);
}
示例4: 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);
}
示例5: onLivingDropsEvent
import net.minecraft.entity.monster.EntityEnderman; //導入方法依賴的package包/類
@SubscribeEvent
public void onLivingDropsEvent(LivingDropsEvent event) {
Entity entity = event.getEntity();
World world = entity.getEntityWorld();
if (nameTagDeath) {
if (entity.getCustomNameTag() != null && entity.getCustomNameTag() != "") {
// item stack NBT needs the name enchanted onto it
if (world.isRemote == false) {
ItemStack nameTag = UtilNBT.buildEnchantedNametag(entity.getCustomNameTag());
UtilItemStack.dropItemStackInWorld(world, entity.getPosition(), nameTag);
}
}
}
if (endermanDrop && entity instanceof EntityEnderman) {
EntityEnderman mob = (EntityEnderman) entity;
IBlockState bs = mob.getHeldBlockState();// mob.func_175489_ck();
if (bs != null && bs.getBlock() != null && world.isRemote == false) {
UtilItemStack.dropItemStackInWorld(world, mob.getPosition(), bs.getBlock());
}
}
}
示例6: entityDeathEvent
import net.minecraft.entity.monster.EntityEnderman; //導入方法依賴的package包/類
@SubscribeEvent
public static void entityDeathEvent(LivingDropsEvent event)
{
if (event.getEntityLiving() instanceof EntityPlayer && claysTortureMode)
{
event.setCanceled(true);
}
else if (event.getEntityLiving() instanceof EntityEnderman && EndermanGriefing.dropCarrying)
{
EntityEnderman entityEnderman = ((EntityEnderman) event.getEntityLiving());
IBlockState state = entityEnderman.getHeldBlockState();
if (state != null && state.getBlock() != Blocks.AIR)
{
ItemStack stack = new ItemStack(state.getBlock(), 1, state.getBlock().getMetaFromState(state));
event.getDrops().add(new EntityItem(entityEnderman.world, entityEnderman.posX, entityEnderman.posY, entityEnderman.posZ, stack));
}
}
}