Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ENTITYREDSLIME CODE:
- package net.minecraft.src;
- import java.util.List;
- import java.util.Random;
- public class EntityRedSlime extends EntitySlime
- {
- public EntityRedSlime(World par1World)
- {
- super(par1World);
- texture = "/mob/redslime.png";
- isImmuneToFire = false;
- landMovementFactor = 0.8F;
- }
- /**
- * Checks if the entity's current position is a valid location to spawn this entity.
- */
- public boolean getCanSpawnHere()
- {
- return worldObj.difficultySetting > 0 && worldObj.checkIfAABBIsClear(boundingBox) && worldObj.getCollidingBoundingBoxes(this, boundingBox).size() == 0 && !worldObj.isAnyLiquid(boundingBox);
- }
- /**
- * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue
- */
- public int getTotalArmorValue()
- {
- return getSlimeSize() * 3;
- }
- public int getBrightnessForRender(float par1)
- {
- return 0xf000f0;
- }
- /**
- * Gets how bright this entity is.
- */
- public float getBrightness(float par1)
- {
- return 1.0F;
- }
- protected EntitySlime createInstance()
- {
- return new EntityRedSlime(worldObj);
- }
- /**
- * Returns the item ID for the item the mob drops on death.
- */
- protected int getDropItemId()
- {
- return mod_tutorial.RedSlimeBall.shiftedIndex;
- }
- /**
- * Drop 0-2 items of this living's type
- */
- protected void dropFewItems(boolean par1, int par2)
- {
- int i = getDropItemId();
- if (i > 0 && getSlimeSize() > 1)
- {
- int j = rand.nextInt(4) - 2;
- if (par2 > 0)
- {
- j += rand.nextInt(par2 + 1);
- }
- for (int k = 0; k < j; k++)
- {
- dropItem(i, 1);
- }
- }
- }
- /**
- * Returns true if the entity is on fire. Used by render to add the fire effect on rendering.
- */
- public boolean isBurning()
- {
- return false;
- }
- protected int func_40131_af()
- {
- return super.func_40131_af() * 4;
- }
- protected void func_40136_ag()
- {
- field_40139_a = field_40139_a * 0.9F;
- }
- /**
- * jump, Causes this entity to do an upwards motion (jumping)
- */
- protected void jump()
- {
- motionY = 0.42F + (float)getSlimeSize() * 0.1F;
- isAirBorne = true;
- }
- /**
- * Called when the mob is falling. Calculates and applies fall damage.
- */
- protected void fall(float f)
- {
- }
- protected boolean func_40137_ah()
- {
- return true;
- }
- protected int func_40130_ai()
- {
- return super.func_40130_ai() + 2;
- }
- /**
- * Returns the sound this mob makes when it is hurt.
- */
- protected String getHurtSound()
- {
- return "mob.slime";
- }
- /**
- * Returns the sound this mob makes on death.
- */
- protected String getDeathSound()
- {
- return "mob.slime";
- }
- protected String func_40138_aj()
- {
- if (getSlimeSize() > 1)
- {
- return "mob.magmacube.big";
- }
- else
- {
- return "mob.magmacube.small";
- }
- }
- /**
- * Whether or not the current entity is in lava
- */
- public boolean handleLavaMovement()
- {
- return false;
- }
- protected boolean func_40134_ak()
- {
- return true;
- }
- }
- SPAWNING OF RED SLIME IN SWAMP BIOME:
- package net.minecraft.src;
- import java.util.Random;
- public class BiomeGenSwamp extends BiomeGenBase
- {
- protected BiomeGenSwamp(int par1)
- {
- super(par1);
- biomeDecorator.treesPerChunk = 2;
- biomeDecorator.flowersPerChunk = -999;
- biomeDecorator.deadBushPerChunk = 1;
- biomeDecorator.mushroomsPerChunk = 8;
- biomeDecorator.reedsPerChunk = 10;
- biomeDecorator.clayPerChunk = 1;
- biomeDecorator.waterlilyPerChunk = 4;
- waterColorMultiplier = 0xe0ffae;
- spawnableMonsterList.clear();
- spawnableMonsterList.add(new SpawnListEntry(net.minecraft.src.EntityRedSlime.class, 15, 1, 5));
- }
- /**
- * Gets a WorldGen appropriate for this biome.
- */
- public WorldGenerator getRandomWorldGenForTrees(Random par1Random)
- {
- return worldGenSwamp;
- }
- /**
- * Provides the basic grass color based on the biome temperature and rainfall
- */
- public int getBiomeGrassColor()
- {
- double d = getFloatTemperature();
- double d1 = getFloatRainfall();
- return ((ColorizerGrass.getGrassColor(d, d1) & 0xfefefe) + 0x4e0e4e) / 2;
- }
- /**
- * Provides the basic foliage color based on the biome temperature and rainfall
- */
- public int getBiomeFoliageColor()
- {
- double d = getFloatTemperature();
- double d1 = getFloatRainfall();
- return ((ColorizerFoliage.getFoliageColor(d, d1) & 0xfefefe) + 0x4e0e4e) / 2;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement