This commit is contained in:
Adubbz 2013-11-08 16:26:27 +11:00
commit 7279aee3dc
21 changed files with 612 additions and 5 deletions

View File

@ -16,6 +16,7 @@ import biomesoplenty.blocks.renderers.PuddleRender;
import biomesoplenty.blocks.renderers.RenderUtils;
import biomesoplenty.blocks.renderers.SmallBlockRenderer;
import biomesoplenty.configuration.configfile.BOPConfigurationIDs;
import biomesoplenty.entities.EntityBird;
import biomesoplenty.entities.EntityGlob;
import biomesoplenty.entities.EntityJungleSpider;
import biomesoplenty.entities.EntityPhantom;
@ -23,6 +24,7 @@ import biomesoplenty.entities.EntityRosester;
import biomesoplenty.entities.EntityWasp;
import biomesoplenty.entities.projectiles.EntityDart;
import biomesoplenty.entities.projectiles.EntityMudball;
import biomesoplenty.entities.render.RenderBird;
import biomesoplenty.entities.render.RenderDart;
import biomesoplenty.entities.render.RenderGlob;
import biomesoplenty.entities.render.RenderJungleSpider;
@ -76,6 +78,11 @@ public class ClientProxy extends CommonProxy {
{
RenderingRegistry.registerEntityRenderingHandler(EntityWasp.class, new RenderWasp());
}
if (BOPConfigurationIDs.birdID > 0)
{
RenderingRegistry.registerEntityRenderingHandler(EntityBird.class, new RenderBird());
}
RenderingRegistry.registerBlockHandler(new FoliageRenderer());
RenderingRegistry.registerBlockHandler(new PlantsRenderer());

View File

@ -204,6 +204,9 @@ public class BlockReferences {
bluebells (Blocks.flowers2, 5),
minersdelight (Blocks.flowers2, 6),
icyiris (Blocks.flowers2, 7),
stalagmite (Blocks.stoneFormations, 0),
stalactite (Blocks.stoneFormations, 1),
;
public Optional<? extends Block> block;

View File

@ -87,6 +87,7 @@ public class Blocks
public static Optional<? extends Block> cloud = Optional.absent();
public static Optional<? extends Block> hive = Optional.absent();
public static Optional<? extends Block> honeyBlock = Optional.absent();
public static Optional<? extends Block> stoneFormations = Optional.absent();
//Nether
public static Optional<? extends Block> bones = Optional.absent();

View File

@ -7,6 +7,8 @@ public class Entities {
public static Class JungleSpider = getClass("biomesoplenty.entities.EntityJungleSpider");
public static Class Rosester = getClass("biomesoplenty.entities.EntityRosester");
public static Class Glob = getClass("biomesoplenty.entities.EntityGlob");
public static Class Wasp = getClass("biomesoplenty.entities.EntityWasp");
public static Class Bird = getClass("biomesoplenty.entities.EntityBird");
public static Class getClass(String inputstring)
{

View File

@ -243,6 +243,8 @@ public class BiomeDecoratorBOP extends BiomeDecorator
public WorldGenerator koruGen;
public WorldGenerator waspHiveGen;
public WorldGenerator rootGen;
public WorldGenerator stalagmiteGen;
public WorldGenerator stalactiteGen;
public WorldGenerator boneSpineGen;
public WorldGenerator boneSpine2Gen;
@ -344,6 +346,8 @@ public class BiomeDecoratorBOP extends BiomeDecorator
public int koruPerChunk;
public int waspHivesPerChunk;
public int rootsPerChunk;
public int stalagmitesPerChunk;
public int stalactitesPerChunk;
public int boneSpinesPerChunk;
public int boneSpines2PerChunk;
@ -555,6 +559,8 @@ public class BiomeDecoratorBOP extends BiomeDecorator
redwoodShrubGen = new WorldGenRedwoodShrub(0,0);
koruGen = new WorldGenTallGrass(Blocks.foliage.get().blockID, 12);
rootGen = new WorldGenBOPTallGrass(Blocks.plants.get().blockID, 15);
stalagmiteGen = new WorldGenBOPTallGrass(Blocks.stoneFormations.get().blockID, 0);
stalactiteGen = new WorldGenBOPTallGrass(Blocks.stoneFormations.get().blockID, 1);
pitGen = new WorldGenPit(Blocks.ash.get().blockID);
waterlilyPerChunk = 0;
lilyflowersPerChunk = 0;
@ -650,7 +656,9 @@ public class BiomeDecoratorBOP extends BiomeDecorator
redwoodShrubsPerChunk = 0;
koruPerChunk = 0;
waspHivesPerChunk = 0;
rootsPerChunk = 7;
rootsPerChunk = 9;
stalagmitesPerChunk = 3;
stalactitesPerChunk = 6;
generateLakes = true;
generateAsh = false;
generateMycelium = false;
@ -1341,6 +1349,22 @@ public class BiomeDecoratorBOP extends BiomeDecorator
rootGen.generate(currentWorld, randomGenerator, var3, var4, var5);
}
for (var2 = 0; var2 < stalagmitesPerChunk; ++var2)
{
var3 = chunk_X + randomGenerator.nextInt(16) + 8;
var4 = randomGenerator.nextInt(64);
var5 = chunk_Z + randomGenerator.nextInt(16) + 8;
stalagmiteGen.generate(currentWorld, randomGenerator, var3, var4, var5);
}
for (var2 = 0; var2 < stalactitesPerChunk; ++var2)
{
var3 = chunk_X + randomGenerator.nextInt(16) + 8;
var4 = randomGenerator.nextInt(64);
var5 = chunk_Z + randomGenerator.nextInt(16) + 8;
stalactiteGen.generate(currentWorld, randomGenerator, var3, var4, var5);
}
for (var2 = 0; var2 < waspHivesPerChunk; ++var2)
{
int var420 = randomGenerator.nextInt(4);

View File

@ -26,6 +26,9 @@ public class BiomeGenOriginValley extends BiomeGenBase
customBiomeDecorator.sandPerChunk2 = 0;
customBiomeDecorator.clayPerChunk = 0;
customBiomeDecorator.rootsPerChunk = -999;
customBiomeDecorator.stalagmitesPerChunk = -999;
customBiomeDecorator.stalactitesPerChunk = -999;
customBiomeDecorator.minersDelightPerChunk = -999;
}
/**

View File

@ -54,7 +54,9 @@ public class BlockBOPGrass extends Block
@Override
public Icon getIcon(int side, int meta)
{
if (side < 0 || side >= blockIcon[meta].length)
if (meta < 0 || meta >= blockIcon.length)
meta = 1;
if (side < 0 || side >= blockIcon[meta].length)
side = 1;
return blockIcon[meta][side];

View File

@ -0,0 +1,173 @@
package biomesoplenty.blocks;
import java.util.List;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.BlockFlower;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Icon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import biomesoplenty.BiomesOPlenty;
import biomesoplenty.api.Blocks;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BlockStoneFormations extends BlockFlower
{
private static final String[] forms = new String[] {"stalagmite", "stalactite"};
private Icon[] textures;
protected BlockStoneFormations(int blockID, Material material)
{
super(blockID, material);
this.setTickRandomly(true);
float var4 = 0.2F;
this.setBlockBounds(0.5F - var4, 0.0F, 0.5F - var4, 0.5F + var4, var4 * 3.0F, 0.5F + var4);
this.setCreativeTab(BiomesOPlenty.tabBiomesOPlenty);
}
public BlockStoneFormations(int blockID)
{
this(blockID, Material.rock);
}
@Override
public void registerIcons(IconRegister iconRegister)
{
textures = new Icon[forms.length];
for (int i = 0; i < forms.length; ++i) {
textures[i] = iconRegister.registerIcon("biomesoplenty:" + forms[i]);
}
}
@Override
public Icon getIcon(int side, int meta)
{
if (meta < 0 || meta >= textures.length) {
meta = 0;
}
return textures[meta];
}
@Override
public int getRenderType()
{
return 1;
}
@Override
public void setBlockBoundsBasedOnState(IBlockAccess world, int par2, int par3, int par4)
{
int meta = world.getBlockMetadata(par2, par3, par4);
switch (meta)
{
default:
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
break;
}
}
@Override
@SideOnly(Side.CLIENT)
@SuppressWarnings({ "rawtypes", "unchecked" })
public void getSubBlocks(int blockID, CreativeTabs creativeTabs, List list) {
for (int i = 0; i < forms.length; ++i)
{
list.add(new ItemStack(blockID, 1, i));
}
}
@Override
protected boolean canThisPlantGrowOnThisBlockID(int id)
{
return id == Block.stone.blockID;
}
protected boolean canThisPlantGrowOnThisBlockID(int id, int metadata)
{
return id == Block.stone.blockID;
}
@Override
public boolean canPlaceBlockOnSide(World world, int x, int y, int z, int side, ItemStack itemStack)
{
int idbottom = world.getBlockId(x, y - 1, z);
int idtop = world.getBlockId(x, y + 1, z);
int meta = itemStack.getItemDamage();
//boolean sky = world.getFullBlockLightValue(x, y, z) >= 8 || world.canBlockSeeTheSky(x, y, z);
if (itemStack.itemID == blockID) {
switch (meta)
{
case 0: // Stalagmite
return idbottom == Block.stone.blockID;
case 1: // Stalactite
return idtop == Block.stone.blockID;
default:
return idbottom == Block.stone.blockID;
}
} else
return this.canPlaceBlockOnSide(world, x, y, z, side);
}
@Override
public void onNeighborBlockChange(World world, int x, int y, int z, int neighborID)
{
//super.onNeighborBlockChange(world, x, y, z, neighborID);
this.checkFlowerChange(world, x, y, z);
}
@Override
public int getDamageValue(World world, int x, int y, int z)
{
int meta = world.getBlockMetadata(x, y, z);
return meta;
}
@Override
public int damageDropped(int meta)
{
return meta & 15;
}
@Override
public boolean canBlockStay(World world, int x, int y, int z)
{
int meta = world.getBlockMetadata(x, y, z);
if (world.getBlockId(x, y, z) != blockID)
{
if (meta == 1)
return this.canThisPlantGrowOnThisBlockID(world.getBlockId(x, y + 1, z));
else
return this.canThisPlantGrowOnThisBlockID(world.getBlockId(x, y - 1, z));
}
else
{
if (meta == 1)
return this.canThisPlantGrowOnThisBlockID(world.getBlockId(x, y + 1, z), world.getBlockMetadata(x, y, z));
else
return this.canThisPlantGrowOnThisBlockID(world.getBlockId(x, y - 1, z), world.getBlockMetadata(x, y, z));
}
}
@Override
public boolean isBlockReplaceable(World world, int x, int y, int z)
{
return true;
}
}

View File

@ -49,6 +49,7 @@ import biomesoplenty.blocks.BlockMud;
import biomesoplenty.blocks.BlockOriginGrass;
import biomesoplenty.blocks.BlockPromisedPortal;
import biomesoplenty.blocks.BlockPuddle;
import biomesoplenty.blocks.BlockStoneFormations;
import biomesoplenty.blocks.BlockTreeMoss;
import biomesoplenty.blocks.BlockWillow;
import biomesoplenty.configuration.configfile.BOPConfigurationIDs;
@ -79,6 +80,7 @@ import biomesoplenty.itemblocks.ItemBlockRedRock;
import biomesoplenty.itemblocks.ItemBlockSapling;
import biomesoplenty.itemblocks.ItemBlockSkystone;
import biomesoplenty.itemblocks.ItemBlockSlab;
import biomesoplenty.itemblocks.ItemBlockStoneFormations;
import biomesoplenty.items.ItemBOPAmethyst;
import biomesoplenty.items.ItemBOPIvy;
import biomesoplenty.items.ItemBOPWillow;
@ -136,6 +138,7 @@ public class BOPBlocks
Blocks.plants = Optional.of((new BlockBOPPlant(BOPConfigurationIDs.plantsID)).setUnlocalizedName("bop.plants"));
Blocks.flowers = Optional.of((new BlockBOPFlower(BOPConfigurationIDs.flowersID)).setHardness(0.0F).setStepSound(Block.soundGrassFootstep).setUnlocalizedName("bop.flowers"));
Blocks.flowers2 = Optional.of((new BlockBOPFlower2(BOPConfigurationIDs.flowers2ID)).setHardness(0.0F).setStepSound(Block.soundGrassFootstep).setUnlocalizedName("bop.flowers2"));
Blocks.stoneFormations = Optional.of((new BlockStoneFormations(BOPConfigurationIDs.stoneFormationsID)).setHardness(0.5F).setStepSound(Block.soundStoneFootstep).setUnlocalizedName("bop.stoneFormations"));
Blocks.mushrooms = Optional.of((new BlockBOPMushroom(BOPConfigurationIDs.mushroomsID)).setHardness(0.0F).setStepSound(Block.soundGrassFootstep).setUnlocalizedName("bop.mushrooms"));
Blocks.coral = Optional.of((new BlockBOPCoral(BOPConfigurationIDs.coralID)).setHardness(0.0F).setStepSound(Block.soundGrassFootstep).setUnlocalizedName("bop.coral"));
Blocks.willow = Optional.of((new BlockWillow(BOPConfigurationIDs.willowID)).setHardness(0.2F).setStepSound(Block.soundGrassFootstep).setUnlocalizedName("bop.willow"));
@ -228,6 +231,7 @@ public class BOPBlocks
GameRegistry.registerBlock(Blocks.plants.get(), ItemBlockPlant.class, "bop.plants");
GameRegistry.registerBlock(Blocks.flowers.get(), ItemBlockFlower.class, "bop.flowers");
GameRegistry.registerBlock(Blocks.flowers2.get(), ItemBlockFlower2.class, "bop.flowers2");
GameRegistry.registerBlock(Blocks.stoneFormations.get(), ItemBlockStoneFormations.class, "bop.stoneFormations");
GameRegistry.registerBlock(Blocks.mushrooms.get(), ItemBlockMushroom.class, "bop.mushrooms");
GameRegistry.registerBlock(Blocks.coral.get(), ItemBlockCoral.class, "bop.coral");
GameRegistry.registerBlock(Blocks.willow.get(), ItemBOPWillow.class, "bop.willow");

View File

@ -7,6 +7,7 @@ import net.minecraft.entity.EnumCreatureType;
import biomesoplenty.BiomesOPlenty;
import biomesoplenty.api.Biomes;
import biomesoplenty.configuration.configfile.BOPConfigurationIDs;
import biomesoplenty.entities.EntityBird;
import biomesoplenty.entities.EntityGlob;
import biomesoplenty.entities.EntityJungleSpider;
import biomesoplenty.entities.EntityPhantom;
@ -98,5 +99,17 @@ public class BOPEntities {
registerEntityEgg(EntityWasp.class, 16434729, 2500135);
}
if (BOPConfigurationIDs.birdID > 0)
{
EntityRegistry.registerModEntity(EntityBird.class, "Bird", BOPConfigurationIDs.birdID, BiomesOPlenty.instance, 80, 3, true);
registerEntityEgg(EntityBird.class, 16434729, 2500135);
if (Biomes.promisedLandForest.isPresent() && Biomes.promisedLandSwamp.isPresent() && Biomes.promisedLandPlains.isPresent())
{
EntityRegistry.addSpawn(EntityBird.class, 8, 1, 1, EnumCreatureType.ambient, Biomes.promisedLandForest.get(), Biomes.promisedLandSwamp.get(), Biomes.promisedLandPlains.get());
}
}
}
}

View File

@ -98,7 +98,8 @@ public class BOPConfigurationIDs
public static int cloudID;
public static int hiveID;
public static int honeyBlockID;
public static int stoneFormationsID;
public static int bonesID;
public static int glassID;
public static int altarID;
@ -297,6 +298,7 @@ public class BOPConfigurationIDs
public static int globID;
public static int phantomID;
public static int waspID;
public static int birdID;
public static void init(File configFile)
{
@ -418,6 +420,7 @@ public class BOPConfigurationIDs
honeyStillID = config.get("Liquid IDs", "Honey Still ID (ID before this must be free!)", 1989, null).getInt();
honeyBlockID = config.getBlock("Honey Block ID", 1991, null).getInt();
stoneFormationsID = config.getBlock("Stone Formations ID", 1992, null).getInt();
// Get Item ID's
foodID = config.getItem("Food ID", 21003, null).getInt();
@ -476,6 +479,7 @@ public class BOPConfigurationIDs
globID = config.get("Mob IDs", "Glob ID", 106, null).getInt();
phantomID = config.get("Mob IDs", "Phantom ID", 107, null).getInt();
waspID = config.get("Mob IDs", "Wasp ID", 108, null).getInt();
birdID = config.get("Mob IDs", "Bird ID", 109, null).getInt();
//Projectile IDs
entityMudballID = config.get("Entity IDs", "Mudball ID", 103, null).getInt();;

View File

@ -0,0 +1,94 @@
package biomesoplenty.entities;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
public class EntityBird extends EntityFlyingMob
{
public int courseChangeCooldown;
public double waypointX;
public double waypointY;
public double waypointZ;
public EntityBird(World world)
{
super(world);
this.setSize(1.0F, 1.0F);
}
@Override
protected void updateEntityActionState()
{
double d0 = this.waypointX - this.posX;
double d1 = this.waypointY - this.posY;
double d2 = this.waypointZ - this.posZ;
double d3 = d0 * d0 + d1 * d1 + d2 * d2;
if (d3 < 1.0D || d3 > 3600.0D)
{
this.waypointX = this.posX + (double)((this.rand.nextFloat() * 2.0F - 1.0F) * 4.0F);
this.waypointY = this.posY + (double)((this.rand.nextFloat() * 2.0F - 1.0F) * 4.0F);
this.waypointZ = this.posZ + (double)((this.rand.nextFloat() * 2.0F - 1.0F) * 4.0F);
}
if (this.courseChangeCooldown-- <= 0)
{
this.courseChangeCooldown += this.rand.nextInt(2) + 2;
d3 = (double)MathHelper.sqrt_double(d3);
if (this.isCourseTraversable(this.waypointX, this.waypointY, this.waypointZ, d3))
{
this.motionX += d0 / d3 * 0.1D;
this.motionY += d1 / d3 * 0.1D;
this.motionZ += d2 / d3 * 0.1D;
}
else
{
this.waypointX = this.posX;
this.waypointY = this.posY;
this.waypointZ = this.posZ;
}
}
this.renderYawOffset = this.rotationYaw = -((float)Math.atan2(this.motionX, this.motionZ)) * 180.0F / (float)Math.PI;
}
private boolean isCourseTraversable(double par1, double par3, double par5, double par7)
{
double d4 = (this.waypointX - this.posX) / par7;
double d5 = (this.waypointY - this.posY) / par7;
double d6 = (this.waypointZ - this.posZ) / par7;
AxisAlignedBB axisalignedbb = this.boundingBox.copy();
for (int i = 1; (double)i < par7; ++i)
{
axisalignedbb.offset(d4, d5, d6);
if (!this.worldObj.getCollidingBoundingBoxes(this, axisalignedbb).isEmpty())
{
return false;
}
}
return true;
}
@Override
protected String getLivingSound()
{
return "biomesoplenty:mob.wasp.say";
}
@Override
protected String getHurtSound()
{
return "biomesoplenty:mob.wasp.hurt";
}
@Override
protected String getDeathSound()
{
return "biomesoplenty:mob.wasp.hurt";
}
}

View File

@ -0,0 +1,127 @@
package biomesoplenty.entities.models;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity;
import net.minecraft.util.MathHelper;
public class ModelBird extends ModelBase
{
//fields
ModelRenderer Body;
ModelRenderer Stomach;
ModelRenderer Head;
ModelRenderer Beak;
ModelRenderer TuftBottom;
ModelRenderer TuftTop;
ModelRenderer Tail;
ModelRenderer WingRight;
ModelRenderer WingLeft;
ModelRenderer LegLeft;
ModelRenderer LegRight;
public ModelBird()
{
textureWidth = 64;
textureHeight = 32;
Body = new ModelRenderer(this, 0, 0);
Body.addBox(0F, 0F, 0F, 6, 3, 10);
Body.setRotationPoint(-3F, 20F, -5F);
Body.setTextureSize(64, 32);
Body.mirror = true;
setRotation(Body, 0F, 0F, 0F);
Stomach = new ModelRenderer(this, 0, 13);
Stomach.addBox(0F, 0F, 0F, 4, 1, 8);
Stomach.setRotationPoint(-2F, 23F, -4F);
Stomach.setTextureSize(64, 32);
Stomach.mirror = true;
setRotation(Stomach, 0F, 0F, 0F);
Head = new ModelRenderer(this, 0, 22);
Head.addBox(0F, 0F, 0F, 4, 3, 4);
Head.setRotationPoint(-2F, 19F, -9F);
Head.setTextureSize(64, 32);
Head.mirror = true;
setRotation(Head, 0F, 0F, 0F);
Beak = new ModelRenderer(this, 0, 29);
Beak.addBox(0F, 0F, 0F, 2, 1, 1);
Beak.setRotationPoint(-1F, 21F, -10F);
Beak.setTextureSize(64, 32);
Beak.mirror = true;
setRotation(Beak, 0F, 0F, 0F);
TuftBottom = new ModelRenderer(this, 28, 23);
TuftBottom.addBox(0F, 0F, 0F, 2, 1, 3);
TuftBottom.setRotationPoint(-1F, 18F, -7F);
TuftBottom.setTextureSize(64, 32);
TuftBottom.mirror = true;
setRotation(TuftBottom, 0F, 0F, 0F);
TuftTop = new ModelRenderer(this, 20, 27);
TuftTop.addBox(0F, 0F, 0F, 4, 0, 5);
TuftTop.setRotationPoint(-2F, 18F, -5F);
TuftTop.setTextureSize(64, 32);
TuftTop.mirror = true;
setRotation(TuftTop, 0F, 0F, 0F);
Tail = new ModelRenderer(this, 42, 0);
Tail.addBox(0F, 0F, 0F, 4, 0, 7);
Tail.setRotationPoint(-2F, 21F, 5F);
Tail.setTextureSize(64, 32);
Tail.mirror = true;
setRotation(Tail, 0F, 0F, 0F);
WingRight = new ModelRenderer(this, 36, 7);
WingRight.addBox(0F, 0F, 0F, 8, 0, 6);
WingRight.setRotationPoint(-11F, 20F, -4F);
WingRight.setTextureSize(64, 32);
WingRight.mirror = true;
setRotation(WingRight, 0F, 0F, 0F);
WingLeft = new ModelRenderer(this, 36, 13);
WingLeft.addBox(0F, 0F, 0F, 8, 0, 6);
WingLeft.setRotationPoint(3F, 20F, -4F);
WingLeft.setTextureSize(64, 32);
WingLeft.mirror = true;
setRotation(WingLeft, 0F, 0F, 0F);
LegLeft = new ModelRenderer(this, 33, 0);
LegLeft.addBox(0F, 0F, 0F, 1, 1, 3);
LegLeft.setRotationPoint(2F, 23F, 0F);
LegLeft.setTextureSize(64, 32);
LegLeft.mirror = true;
setRotation(LegLeft, 0F, 0F, 0F);
LegRight = new ModelRenderer(this, 33, 0);
LegRight.addBox(0F, 0F, 0F, 1, 1, 3);
LegRight.setRotationPoint(-3F, 23F, 0F);
LegRight.setTextureSize(64, 32);
LegRight.mirror = true;
setRotation(LegRight, 0F, 0F, 0F);
}
@Override
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5)
{
super.render(entity, f, f1, f2, f3, f4, f5);
setRotationAngles(f, f1, f2, f3, f4, f5, entity);
Body.render(f5);
Stomach.render(f5);
Head.render(f5);
Beak.render(f5);
TuftBottom.render(f5);
TuftTop.render(f5);
Tail.render(f5);
WingRight.render(f5);
WingLeft.render(f5);
LegLeft.render(f5);
LegRight.render(f5);
}
private void setRotation(ModelRenderer model, float x, float y, float z)
{
model.rotateAngleX = x;
model.rotateAngleY = y;
model.rotateAngleZ = z;
}
@Override
public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity)
{
super.setRotationAngles(f, f1, f2, f3, f4, f5, entity);
}
}

View File

@ -0,0 +1,28 @@
package biomesoplenty.entities.render;
import net.minecraft.client.renderer.entity.RenderLiving;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
import biomesoplenty.entities.models.ModelBird;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class RenderBird extends RenderLiving
{
public RenderBird()
{
super(new ModelBird(), 0.25F);
this.shadowSize = 0.0F;
}
@Override
protected ResourceLocation getEntityTexture(Entity entity)
{
return new ResourceLocation("biomesoplenty:textures/mobs/bird.png");
}
}

View File

@ -0,0 +1,118 @@
package biomesoplenty.itemblocks;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumAction;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Icon;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
import biomesoplenty.BiomesOPlenty;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class ItemBlockStoneFormations extends ItemBlock
{
private static final String[] forms = new String[] {"stalagmite", "stalactite"};
@SideOnly(Side.CLIENT)
private Icon[] textures;
public ItemBlockStoneFormations(int par1)
{
super(par1);
setMaxDamage(0);
setHasSubtypes(true);
}
@Override
public String getUnlocalizedName(ItemStack itemStack)
{
int meta = itemStack.getItemDamage();
if (meta < 0 || meta >= forms.length) {
meta = 0;
}
return super.getUnlocalizedName() + "." + forms[meta];
}
@Override
public Icon getIconFromDamage(int meta)
{
return Block.blocksList[itemID].getIcon(0, meta);
}
@Override
@SideOnly(Side.CLIENT)
public boolean isFull3D()
{
return true;
}
@Override
public boolean onItemUse(ItemStack itemStack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ)
{
int id = world.getBlockId(x, y, z);
if (id == Block.snow.blockID && (world.getBlockMetadata(x, y, z) & 7) < 1) {
side = 1;
} else if (!Block.blocksList[id].isBlockReplaceable(world, x, y, z))
{
if (side == 0) {
--y;
}
if (side == 1) {
++y;
}
if (side == 2) {
--z;
}
if (side == 3) {
++z;
}
if (side == 4) {
--x;
}
if (side == 5) {
++x;
}
}
if (!player.canPlayerEdit(x, y, z, side, itemStack))
return false;
else if (itemStack.stackSize == 0)
return false;
else
{
if (world.canPlaceEntityOnSide(this.getBlockID(), x, y, z, false, side, (Entity)null, itemStack))
{
Block block = Block.blocksList[this.getBlockID()];
int j1 = block.onBlockPlaced(world, x, y, z, side, hitX, hitY, hitZ, 0);
if (world.setBlock(x, y, z, this.getBlockID(), itemStack.getItemDamage(), 3))
{
if (world.getBlockId(x, y, z) == this.getBlockID())
{
Block.blocksList[this.getBlockID()].onBlockPlacedBy(world, x, y, z, player, itemStack);
Block.blocksList[this.getBlockID()].onPostBlockPlaced(world, x, y, z, j1);
}
world.playSoundEffect(x + 0.5F, y + 0.5F, z + 0.5F, block.stepSound.getPlaceSound(), (block.stepSound.getVolume() + 1.0F) / 2.0F, block.stepSound.getPitch() * 0.8F);
--itemStack.stackSize;
}
}
return true;
}
}
}

View File

@ -20,11 +20,12 @@ public class WorldGenWaterReeds extends WorldGenerator
if (par1World.isAirBlock(var7, var8, var9) && par1World.getBlockId(var7, var8 - 1, var9) == Block.waterStill.blockID)
{
for (int var900 = 5; var900 > -5; --var900)
for (int var900 = 2; var900 > -2; --var900)
{
if (par1World.getBlockId(var7 - var900, var8 - 1, var9 - var900) != Block.waterStill.blockID && par1World.getBlockId(var7 - var900, var8 - 1, var9 - var900) != Block.waterMoving.blockID)
{
par1World.setBlock(var7, var8, var9, Blocks.plants.get().blockID, 14, 2);
par1World.setBlock(var7, var8, var9, Blocks.plants.get().blockID, 14, 2);
}
}
}

View File

@ -60,6 +60,9 @@ tile.bop.flowers2.bluebells.name=Bluebells
tile.bop.flowers2.minersdelight.name=Miner's Delight
tile.bop.flowers2.icyiris.name=Icy Iris
tile.bop.stoneFormations.stalagmite.name=Stalagmite
tile.bop.stoneFormations.stalactite.name=Stalactite
tile.bop.foliage.algae.name=Algae
tile.bop.foliage.shortgrass.name=Short Grass
tile.bop.foliage.mediumgrass.name=Medium Grass

Binary file not shown.

Before

Width:  |  Height:  |  Size: 728 B

After

Width:  |  Height:  |  Size: 769 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 382 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 389 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB