本文整理汇总了Java中net.minecraft.entity.passive.EntityRabbit类的典型用法代码示例。如果您正苦于以下问题:Java EntityRabbit类的具体用法?Java EntityRabbit怎么用?Java EntityRabbit使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
EntityRabbit类属于net.minecraft.entity.passive包,在下文中一共展示了EntityRabbit类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: LayerFancyLlama
import net.minecraft.entity.passive.EntityRabbit; //导入依赖的package包/类
public LayerFancyLlama(RenderLlama renderer)
{
this.renderer = renderer;
this.rand = new Random();
this.modelFancy = new ModelFancy();
Calendar calendar = Calendar.getInstance();
calendar.setTimeInMillis(System.currentTimeMillis());
isAFDay = calendar.get(Calendar.MONTH) == Calendar.APRIL && calendar.get(Calendar.DAY_OF_MONTH) == 1;
if(isAFDay)
{
modelRabbit = new ModelRabbit();
modelRabbit.isChild = false;
rabbitInstance = new EntityRabbit(null);
if(renderer.mainModel instanceof ModelLlama)
{
((ModelLlama)renderer.mainModel).head = new ModelRenderer(renderer.mainModel, 33, 4);
((ModelLlama)renderer.mainModel).head.addBox(-4.0F, -9.0F, -6.0F, 8, 11, 6, 0);
((ModelLlama)renderer.mainModel).head.setRotationPoint(0.0F, 7.0F, -6.0F);
}
}
}
示例2: BiomeTundra
import net.minecraft.entity.passive.EntityRabbit; //导入依赖的package包/类
public BiomeTundra() {
super(new BiomeProperties("Tundra")
.setBaseHeight(0.325f)
.setHeightVariation(0.05f)
.setTemperature(0.2f) // 0.25f
.setRainfall(0.45f)
);
this.setRegistryName(Ref.MODID+":steppe");
this.decorator.treesPerChunk = 1;
this.decorator.grassPerChunk = 10;
this.decorator.flowersPerChunk = 2;
this.decorator.reedsPerChunk = -999;
this.decorator.cactiPerChunk = -999;
this.spawnableCreatureList.clear();
this.spawnableCreatureList.add(new Biome.SpawnListEntry(EntityRabbit.class, 10, 2, 3));
this.spawnableCreatureList.add(new Biome.SpawnListEntry(EntitySheep.class, 12, 1, 5));
Ref.BIOMES.add(this);
}
示例3: BiomeScrubland
import net.minecraft.entity.passive.EntityRabbit; //导入依赖的package包/类
public BiomeScrubland() {
super(new BiomeProperties("Scrubland")
.setBaseHeight(0.125f)
.setHeightVariation(0.05f)
.setTemperature(1.60f)
.setRainfall(0.00f)
.setRainDisabled()
);
this.setRegistryName(Ref.MODID+":scrubland");
this.decorator.treesPerChunk = -999;
this.decorator.deadBushPerChunk = 50;
this.decorator.reedsPerChunk = 10;
this.decorator.cactiPerChunk = 4;
this.decorator.flowersPerChunk = 2;
this.decorator.grassPerChunk = 4;
this.spawnableCreatureList.clear();
this.spawnableCreatureList.add(new Biome.SpawnListEntry(EntityCow.class, 6, 4, 4));
this.spawnableCreatureList.add(new Biome.SpawnListEntry(EntityRabbit.class, 4, 2, 3));
Ref.BIOMES.add(this);
}
示例4: BiomeForest
import net.minecraft.entity.passive.EntityRabbit; //导入依赖的package包/类
public BiomeForest(BiomeForest.Type typeIn, Biome.BiomeProperties properties)
{
super(properties);
this.type = typeIn;
this.theBiomeDecorator.treesPerChunk = 10;
this.theBiomeDecorator.grassPerChunk = 2;
if (this.type == BiomeForest.Type.FLOWER)
{
this.theBiomeDecorator.treesPerChunk = 6;
this.theBiomeDecorator.flowersPerChunk = 100;
this.theBiomeDecorator.grassPerChunk = 1;
this.spawnableCreatureList.add(new Biome.SpawnListEntry(EntityRabbit.class, 4, 2, 3));
}
if (this.type == BiomeForest.Type.NORMAL)
{
this.spawnableCreatureList.add(new Biome.SpawnListEntry(EntityWolf.class, 5, 4, 4));
}
if (this.type == BiomeForest.Type.ROOFED)
{
this.theBiomeDecorator.treesPerChunk = -999;
}
}
示例5: BiomeTaiga
import net.minecraft.entity.passive.EntityRabbit; //导入依赖的package包/类
public BiomeTaiga(BiomeTaiga.Type typeIn, Biome.BiomeProperties properties)
{
super(properties);
this.type = typeIn;
this.spawnableCreatureList.add(new Biome.SpawnListEntry(EntityWolf.class, 8, 4, 4));
this.spawnableCreatureList.add(new Biome.SpawnListEntry(EntityRabbit.class, 4, 2, 3));
this.theBiomeDecorator.treesPerChunk = 10;
if (typeIn != BiomeTaiga.Type.MEGA && typeIn != BiomeTaiga.Type.MEGA_SPRUCE)
{
this.theBiomeDecorator.grassPerChunk = 1;
this.theBiomeDecorator.mushroomsPerChunk = 1;
}
else
{
this.theBiomeDecorator.grassPerChunk = 7;
this.theBiomeDecorator.deadBushPerChunk = 1;
this.theBiomeDecorator.mushroomsPerChunk = 3;
}
}
示例6: setRotationAngles
import net.minecraft.entity.passive.EntityRabbit; //导入依赖的package包/类
/**
* Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms
* and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how
* "far" arms and legs can swing at most.
*/
public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn)
{
float f = ageInTicks - (float)entityIn.ticksExisted;
EntityRabbit entityrabbit = (EntityRabbit)entityIn;
this.rabbitNose.rotateAngleX = headPitch * 0.017453292F;
this.rabbitHead.rotateAngleX = headPitch * 0.017453292F;
this.rabbitRightEar.rotateAngleX = headPitch * 0.017453292F;
this.rabbitLeftEar.rotateAngleX = headPitch * 0.017453292F;
this.rabbitNose.rotateAngleY = netHeadYaw * 0.017453292F;
this.rabbitHead.rotateAngleY = netHeadYaw * 0.017453292F;
this.rabbitRightEar.rotateAngleY = this.rabbitNose.rotateAngleY - 0.2617994F;
this.rabbitLeftEar.rotateAngleY = this.rabbitNose.rotateAngleY + 0.2617994F;
this.jumpRotation = MathHelper.sin(entityrabbit.setJumpCompletion(f) * (float)Math.PI);
this.rabbitLeftThigh.rotateAngleX = (this.jumpRotation * 50.0F - 21.0F) * 0.017453292F;
this.rabbitRightThigh.rotateAngleX = (this.jumpRotation * 50.0F - 21.0F) * 0.017453292F;
this.rabbitLeftFoot.rotateAngleX = this.jumpRotation * 50.0F * 0.017453292F;
this.rabbitRightFoot.rotateAngleX = this.jumpRotation * 50.0F * 0.017453292F;
this.rabbitLeftArm.rotateAngleX = (this.jumpRotation * -40.0F - 11.0F) * 0.017453292F;
this.rabbitRightArm.rotateAngleX = (this.jumpRotation * -40.0F - 11.0F) * 0.017453292F;
}
示例7: onInitGuiPost
import net.minecraft.entity.passive.EntityRabbit; //导入依赖的package包/类
@SubscribeEvent(priority = EventPriority.HIGHEST)
public void onInitGuiPost(GuiScreenEvent.InitGuiEvent.Post event)
{
if(!hasShownFirstGui)
{
hasShownFirstGui = true;
//Add the layer renderers
Render renderer = Minecraft.getMinecraft().getRenderManager().getEntityClassRenderObject(EntityRabbit.class);
if(renderer instanceof RenderRabbit)
{
RenderRabbit renderRabbit = (RenderRabbit)renderer;
renderRabbit.addLayer(new LayerFancyBunny(renderRabbit));
}
}
}
示例8: onUpdate
import net.minecraft.entity.passive.EntityRabbit; //导入依赖的package包/类
@Override
public void onUpdate(PossessivePlayer possessivePlayer, EntityPlayer player) {
EntityRabbit rabbit = (EntityRabbit) possessivePlayer.getPossessing();
double speedX = player.posX - player.prevPosX;
double speedZ = player.posZ - player.prevPosZ;
double speed = speedX * speedX + speedZ * speedZ;
if (player.onGround && (speed > 0.01 || speed < -0.01)) {
player.jump();
rabbit.startJumping();
int x = MathHelper.floor_double(player.posX);
int y = MathHelper.floor_double(player.posY - 0.20000000298023224D);
int z = MathHelper.floor_double(player.posZ);
IBlockState state = player.worldObj.getBlockState(new BlockPos(x, y, z));
if (state.getRenderType() != EnumBlockRenderType.INVISIBLE) {
for (int i = 0; i < 3; i++) {
player.worldObj.spawnParticle(EnumParticleTypes.BLOCK_CRACK, player.posX + (player.getRNG().nextFloat() - 0.5D) * player.width, player.getEntityBoundingBox().minY + 0.1D, player.posZ + (player.getRNG().nextFloat() - 0.5D) * player.width, -player.motionX * 4.0D, 1.5D, -player.motionZ * 4.0D, Block.getStateId(state));
}
}
}
}
示例9: EntityIceZertum
import net.minecraft.entity.passive.EntityRabbit; //导入依赖的package包/类
public EntityIceZertum(World worldIn) {
super(worldIn);
this.tasks.removeTask(this.aiLeap);
this.tasks.addTask(3, new EntityAICustomLeapAtTarget(this, 0.4F));
this.tasks.addTask(4, new EntityAIIceAttack(this, 1.0D, 10, 30, 15.0F));
this.targetTasks.addTask(4, new EntityAITargetNonTamed(this, EntityAnimal.class, false, new Predicate() {
public boolean isApplicable(Entity entityIn) {
return entityIn instanceof EntitySheep || entityIn instanceof EntityRabbit;
}
@Override
public boolean apply(Object p_apply_1_) {
return this.isApplicable((Entity) p_apply_1_);
}
}));
}
示例10: EntityMegalania
import net.minecraft.entity.passive.EntityRabbit; //导入依赖的package包/类
public EntityMegalania(World world) {
super(world);
float scaleFactor = 2.5f;
setSize(1.0F * scaleFactor, 0.6F * scaleFactor);
setPathPriority(PathNodeType.WATER, 0.0f);
setHealth(60.0f);
tasks.addTask(0, new EntityAISwimming(this));
tasks.addTask(1, new EntityAILeapAtTarget(this, 0.4F));
tasks.addTask(2, new EntityAIAttackMelee(this, 1.0D, true));
tasks.addTask(3, new EntityAIWander(this, 0.9));
tasks.addTask(4, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
tasks.addTask(5, new EntityAILookIdle(this));
targetTasks.addTask(1, new EntityAIHurtByTarget(this, true));
targetTasks.addTask(2, new EntityAINearestAttackableTarget<>(this, EntityChicken.class, true));
targetTasks.addTask(3, new EntityAINearestAttackableTarget<>(this, EntityPig.class, true));
targetTasks.addTask(4, new EntityAINearestAttackableTarget<>(this, EntityPlayer.class, true));
targetTasks.addTask(5, new EntityAINearestAttackableTarget<>(this, EntitySheep.class, true));
targetTasks.addTask(6, new EntityAINearestAttackableTarget<>(this, EntityCow.class, true));
targetTasks.addTask(7, new EntityAINearestAttackableTarget<>(this, EntitySkeleton.class, true));
targetTasks.addTask(8, new EntityAINearestAttackableTarget<>(this, EntityRabbit.class, true));
}
示例11: getHeadJointOffset
import net.minecraft.entity.passive.EntityRabbit; //导入依赖的package包/类
@Override
public float[] getHeadJointOffset(EntityRabbit living, float partialTick, int eye)
{
float scale = 0.0625F;
if(living.isChild())
{
GlStateManager.scale(0.56666666F, 0.56666666F, 0.56666666F);
GlStateManager.translate(0.0F, 22.0F * scale, 2.0F * scale);
}
else
{
GlStateManager.scale(0.6F, 0.6F, 0.6F);
GlStateManager.translate(0.0F, 16.0F * scale, 0.0F);
}
return super.getHeadJointOffset(living, partialTick, eye);
}
示例12: render
import net.minecraft.entity.passive.EntityRabbit; //导入依赖的package包/类
@Override
public void render(Entity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
EntityRabbit rabbit = (EntityRabbit)entityIn;
renderHeadParts(true, true, true, false, scale);
renderBody(rabbit, false, ageInTicks, scale);
renderHeadParts(true, true, true, true, scale);
renderBody(rabbit, true, ageInTicks, scale);
}
示例13: renderBody
import net.minecraft.entity.passive.EntityRabbit; //导入依赖的package包/类
public void renderBody(EntityRabbit rabbit, boolean color, float ageInTicks, float f5)
{
if(!color)
{
float f = ageInTicks - (float)rabbit.ticksExisted;
float jumpRotation = MathHelper.sin(rabbit.setJumpCompletion(f) * (float)Math.PI);
frontLegRightTux.rotateAngleX = (jumpRotation * -40.0F - 11.0F) * 0.017453292F;
frontLegLeftTux.rotateAngleX = (jumpRotation * -40.0F - 11.0F) * 0.017453292F;
bodyTuxTail1.rotateAngleX = (-1.108972F + jumpRotation * 0.8F);
bodyTuxTail2.rotateAngleX = (-1.108972F + jumpRotation * 0.8F);
frontLegRightTux.renderWithRotation(f5);
frontLegLeftTux.renderWithRotation(f5);
bodyTuxTail1.renderWithRotation(f5);
bodyTuxTail2.renderWithRotation(f5);
bodyTux.renderWithRotation(f5);
}
else
{
bowtie5.renderWithRotation(f5);
bowtie3.renderWithRotation(f5);
bowtie4.renderWithRotation(f5);
bowtie1.renderWithRotation(f5);
bowtie2.renderWithRotation(f5);
bodyTux.renderWithRotation(f5);
}
}
示例14: BiomeGenBase
import net.minecraft.entity.passive.EntityRabbit; //导入依赖的package包/类
protected BiomeGenBase(int id)
{
this.minHeight = height_Default.rootHeight;
this.maxHeight = height_Default.variation;
this.temperature = 0.5F;
this.rainfall = 0.5F;
this.waterColorMultiplier = 16777215;
this.spawnableMonsterList = Lists.<BiomeGenBase.SpawnListEntry>newArrayList();
this.spawnableCreatureList = Lists.<BiomeGenBase.SpawnListEntry>newArrayList();
this.spawnableWaterCreatureList = Lists.<BiomeGenBase.SpawnListEntry>newArrayList();
this.spawnableCaveCreatureList = Lists.<BiomeGenBase.SpawnListEntry>newArrayList();
this.enableRain = true;
this.worldGeneratorTrees = new WorldGenTrees(false);
this.worldGeneratorBigTree = new WorldGenBigTree(false);
this.worldGeneratorSwamp = new WorldGenSwamp();
this.biomeID = id;
biomeList[id] = this;
this.theBiomeDecorator = this.createBiomeDecorator();
this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntitySheep.class, 12, 4, 4));
this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityRabbit.class, 10, 3, 3));
this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityPig.class, 10, 4, 4));
this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityChicken.class, 10, 4, 4));
this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityCow.class, 8, 4, 4));
this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntitySpider.class, 100, 4, 4));
this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityZombie.class, 100, 4, 4));
this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntitySkeleton.class, 100, 4, 4));
this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityCreeper.class, 100, 4, 4));
this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntitySlime.class, 100, 4, 4));
this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityEnderman.class, 10, 1, 4));
this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityWitch.class, 5, 1, 1));
this.spawnableWaterCreatureList.add(new BiomeGenBase.SpawnListEntry(EntitySquid.class, 10, 4, 4));
this.spawnableCaveCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityBat.class, 10, 8, 8));
}
示例15: getEntityTexture
import net.minecraft.entity.passive.EntityRabbit; //导入依赖的package包/类
/**
* Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
*/
protected ResourceLocation getEntityTexture(EntityRabbit entity)
{
String s = EnumChatFormatting.getTextWithoutFormattingCodes(entity.getName());
if (s != null && s.equals("Toast"))
{
return TOAST;
}
else
{
switch (entity.getRabbitType())
{
case 0:
default:
return BROWN;
case 1:
return WHITE;
case 2:
return BLACK;
case 3:
return WHITE_SPLOTCHED;
case 4:
return GOLD;
case 5:
return SALT;
case 99:
return CAERBANNOG;
}
}
}