Work on sacrifice altars, not too much left now

This commit is contained in:
Adubbz G 2013-06-15 18:46:50 +10:00
parent 27fcbc4de9
commit 3026bc0768
22 changed files with 160 additions and 40 deletions

View File

@ -19,11 +19,11 @@ import biomesoplenty.blocks.renderers.FoliageRenderer;
import biomesoplenty.blocks.renderers.PlantsRenderer;
import biomesoplenty.blocks.renderers.RenderUtils;
import biomesoplenty.blocks.renderers.SmallBlockRenderer;
import biomesoplenty.entities.EntityGlob;
import biomesoplenty.entities.RenderGlob;
import biomesoplenty.items.projectiles.EntityDart;
import biomesoplenty.items.projectiles.EntityMudball;
import biomesoplenty.items.projectiles.RenderDart;
import biomesoplenty.mobs.EntityGlob;
import biomesoplenty.mobs.RenderGlob;
import biomesoplenty.particles.EntityDandelionFX;
import biomesoplenty.particles.EntitySteamFX;
import cpw.mods.fml.client.registry.RenderingRegistry;

View File

@ -4,9 +4,9 @@ public class Entities {
public static Class Mudball = getClass("biomesoplenty.items.projectiles.EntityMudball");
public static Class Dart = getClass("biomesoplenty.items.projectiles.EntityDart");
public static Class JungleSpider = getClass("biomesoplenty.mobs.EntityJungleSpider");
public static Class Rosester = getClass("biomesoplenty.mobs.EntityRosester");
public static Class Glob = getClass("biomesoplenty.mobs.EntityGlob");
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 getClass(String inputstring)
{

View File

@ -8,10 +8,10 @@ import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.biome.SpawnListEntry;
import net.minecraft.world.gen.feature.WorldGenTallGrass;
import net.minecraft.world.gen.feature.WorldGenerator;
import biomesoplenty.mobs.EntityRosester;
import biomesoplenty.worldgen.WorldGenGiantFlowerRed;
import biomesoplenty.worldgen.WorldGenGiantFlowerYellow;
import biomesoplenty.api.Blocks;
import biomesoplenty.entities.EntityRosester;
public class BiomeGenGarden extends BiomeGenBase
{

View File

@ -14,8 +14,8 @@ import net.minecraft.world.gen.feature.WorldGenTallGrass;
import net.minecraft.world.gen.feature.WorldGenTrees;
import net.minecraft.world.gen.feature.WorldGenVines;
import net.minecraft.world.gen.feature.WorldGenerator;
import biomesoplenty.mobs.EntityJungleSpider;
import biomesoplenty.api.Blocks;
import biomesoplenty.entities.EntityJungleSpider;
public class BiomeGenJungleNew extends BiomeGenBase
{

View File

@ -9,9 +9,9 @@ import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.biome.SpawnListEntry;
import net.minecraft.world.gen.feature.WorldGenTallGrass;
import net.minecraft.world.gen.feature.WorldGenerator;
import biomesoplenty.mobs.EntityJungleSpider;
import biomesoplenty.worldgen.WorldGenRainforestTree1;
import biomesoplenty.api.Blocks;
import biomesoplenty.entities.EntityJungleSpider;
public class BiomeGenRainforest extends BiomeGenBase
{

View File

@ -10,7 +10,7 @@ import net.minecraft.world.biome.SpawnListEntry;
import net.minecraft.world.gen.feature.WorldGenShrub;
import net.minecraft.world.gen.feature.WorldGenerator;
import biomesoplenty.configuration.BOPConfiguration;
import biomesoplenty.mobs.EntityJungleSpider;
import biomesoplenty.entities.EntityJungleSpider;
import biomesoplenty.api.Blocks;
public class BiomeGenSacredSprings extends BiomeGenBase

View File

@ -10,7 +10,7 @@ import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.biome.SpawnListEntry;
import net.minecraft.world.gen.feature.WorldGenerator;
import biomesoplenty.configuration.BOPConfiguration;
import biomesoplenty.mobs.EntityJungleSpider;
import biomesoplenty.entities.EntityJungleSpider;
import biomesoplenty.worldgen.WorldGenRainforest1;
import biomesoplenty.worldgen.WorldGenRainforest2;
import biomesoplenty.api.Blocks;

View File

@ -9,7 +9,7 @@ import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.biome.SpawnListEntry;
import net.minecraft.world.gen.feature.WorldGenerator;
import biomesoplenty.configuration.BOPConfiguration;
import biomesoplenty.mobs.EntityJungleSpider;
import biomesoplenty.entities.EntityJungleSpider;
import biomesoplenty.worldgen.WorldGenPalmTree1;
import biomesoplenty.worldgen.WorldGenPalmTree3;
import biomesoplenty.api.Blocks;

View File

@ -4,6 +4,7 @@ import java.io.ByteArrayOutputStream;
import java.io.DataOutputStream;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import cpw.mods.fml.common.network.PacketDispatcher;
import cpw.mods.fml.common.network.Player;
@ -16,8 +17,10 @@ import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemPickaxe;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.network.INetworkManager;
@ -163,6 +166,22 @@ public class BlockAltar extends Block
{
int meta = world.getBlockMetadata(x, y, z);
Item item = Item.itemsList[par6EntityPlayer.getCurrentEquippedItem().itemID];
if (item instanceof ItemPickaxe)
{
if (!world.isRemote && world.getGameRules().getGameRuleBooleanValue("doTileDrops"))
{
float f = 0.7F;
double d0 = (double)(world.rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D;
double d1 = (double)(world.rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D;
double d2 = (double)(world.rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D;
EntityItem entityitem = new EntityItem(world, (double)x + d0, (double)y + d1, (double)z + d2, new ItemStack(Blocks.altar.get(), 1));
entityitem.delayBeforeCanPickup = 10;
world.spawnEntityInWorld(entityitem);
}
}
dropBlockAsItem(world, x, y, z, id, meta);
}
@ -191,8 +210,6 @@ public class BlockAltar extends Block
if (tileentityaltar.getPresent(15))
ret.add(new ItemStack(Items.miscItems.get(), 1, 15));
ret.add(new ItemStack(Blocks.altar.get().blockID, 1, 0));
}
return ret;

View File

@ -10,9 +10,12 @@ import net.minecraft.block.Block;
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.effect.EntityLightningBolt;
import net.minecraft.entity.passive.EntityVillager;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.Icon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
@ -23,7 +26,7 @@ import biomesoplenty.tileentity.TileEntityAltar;
public class BlockBOPGlass extends Block
{
private static final String[] glassTypes = new String[] {"celestiallens", "sacrificialFocus"};
private static final String[] glassTypes = new String[] {"celestiallens", "sacrificialFocus_empty", "sacrificialFocus_active"};
private Icon[] textures;
public BlockBOPGlass(int blockID)
@ -34,6 +37,40 @@ public class BlockBOPGlass extends Block
this.blockHardness = 0.37F;
}
@Override
public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z)
{
if (world.getBlockMetadata(x, y, z) == 2)
{
float var5 = 0.01F;
return AxisAlignedBB.getAABBPool().getAABB(x, y, z, x + 1, y + 1 - var5, z + 1);
}
else
return AxisAlignedBB.getAABBPool().getAABB(x, y, z, x + 1, y + 1, z + 1);
}
@Override
public void onEntityCollidedWithBlock(World world, int x, int y, int z, Entity entity)
{
if (world.getBlockMetadata(x, y, z) == 2)
{
if (checkAltarStructreIntegrity(world, x, y, z))
{
if (entity instanceof EntityVillager)
{
world.setBlockMetadataWithNotify(x, y, z, 1, 2);
world.spawnEntityInWorld(new EntityLightningBolt(world, x + 1, y + 2, z));
world.spawnEntityInWorld(new EntityLightningBolt(world, x -1, y + 2, z));
world.spawnEntityInWorld(new EntityLightningBolt(world, x, y + 2, z + 1));
world.spawnEntityInWorld(new EntityLightningBolt(world, x, y + 2, z - 1));
entity.setDead();
}
}
}
}
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int meta, float par7, float par8, float par9)
{
@ -41,11 +78,8 @@ public class BlockBOPGlass extends Block
if (equippedItem.itemID == Items.soulManipulator.get().itemID && equippedItem.getItemDamage() == 1)
{
TileEntityAltar tileentityaltar0 = (TileEntityAltar) world.getBlockTileEntity(x + 1, y, z);
TileEntityAltar tileentityaltar1 = (TileEntityAltar) world.getBlockTileEntity(x - 1, y, z);
TileEntityAltar tileentityaltar2 = (TileEntityAltar) world.getBlockTileEntity(x, y, z + 1);
TileEntityAltar tileentityaltar3 = (TileEntityAltar) world.getBlockTileEntity(x, y, z - 1);
if (world.getBlockMetadata(x, y, z) == 1)
{
if (checkAltarStructreIntegrity(world, x, y, z))
{
player.setCurrentItemOrArmor(0, new ItemStack(Items.soulManipulator.get(), 1, 0));
@ -55,9 +89,12 @@ public class BlockBOPGlass extends Block
world.spawnEntityInWorld(new EntityLightningBolt(world, x, y + 2, z + 1));
world.spawnEntityInWorld(new EntityLightningBolt(world, x, y + 2, z - 1));
world.setBlockMetadataWithNotify(x, y, z, 2, 2);
return true;
}
}
}
return false;
}
@ -69,6 +106,7 @@ public class BlockBOPGlass extends Block
TileEntityAltar tileentityaltar2 = (TileEntityAltar) world.getBlockTileEntity(x, y, z + 1);
TileEntityAltar tileentityaltar3 = (TileEntityAltar) world.getBlockTileEntity(x, y, z - 1);
if (tileentityaltar0 != null && tileentityaltar1 != null && tileentityaltar2 != null && tileentityaltar3 != null)
if (tileentityaltar0.getAllPresent() && tileentityaltar1.getAllPresent() && tileentityaltar2.getAllPresent() && tileentityaltar3.getAllPresent())
{
if (world.getBlockId(x + 1, y + 1, z) == Blocks.bones.get().blockID && world.getBlockId(x - 1, y + 1, z) == Blocks.bones.get().blockID && world.getBlockId(x, y + 1, z + 1) == Blocks.bones.get().blockID && world.getBlockId(x, y + 1, z - 1) == Blocks.bones.get().blockID)
@ -138,8 +176,11 @@ public class BlockBOPGlass extends Block
@Override
@SuppressWarnings({ "rawtypes", "unchecked" })
public void getSubBlocks(int blockID, CreativeTabs creativeTabs, List list) {
for (int i = 0; i < glassTypes.length; ++i) {
public void getSubBlocks(int blockID, CreativeTabs creativeTabs, List list)
{
for (int i = 0; i < glassTypes.length; ++i)
{
if (i != 2)
list.add(new ItemStack(blockID, 1, i));
}
}

View File

@ -6,12 +6,12 @@ import net.minecraft.entity.EntityList;
import net.minecraft.entity.EnumCreatureType;
import biomesoplenty.BiomesOPlenty;
import biomesoplenty.api.Biomes;
import biomesoplenty.entities.EntityGlob;
import biomesoplenty.entities.EntityJungleSpider;
import biomesoplenty.entities.EntityRosester;
import biomesoplenty.items.projectiles.EntityDart;
import biomesoplenty.items.projectiles.EntityMudball;
import biomesoplenty.items.projectiles.EntityPoisonDart;
import biomesoplenty.mobs.EntityGlob;
import biomesoplenty.mobs.EntityJungleSpider;
import biomesoplenty.mobs.EntityRosester;
import cpw.mods.fml.common.registry.EntityRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;

View File

@ -1,4 +1,4 @@
package biomesoplenty.mobs;
package biomesoplenty.entities;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.monster.IMob;

View File

@ -1,4 +1,4 @@
package biomesoplenty.mobs;
package biomesoplenty.entities;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;

View File

@ -1,4 +1,4 @@
package biomesoplenty.mobs;
package biomesoplenty.entities;
import net.minecraft.entity.EntityAgeable;
import net.minecraft.entity.ai.EntityAIFollowParent;

View File

@ -1,4 +1,4 @@
package biomesoplenty.mobs;
package biomesoplenty.entities;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.renderer.entity.RenderLiving;

View File

@ -1,4 +1,4 @@
package biomesoplenty.mobs.ai;
package biomesoplenty.entities.ai;
import net.minecraft.entity.EntityCreature;
import net.minecraft.entity.ai.EntityAIBase;

View File

@ -1,17 +1,21 @@
package biomesoplenty.helpers;
import net.minecraft.block.Block;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityCreature;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.effect.EntityLightningBolt;
import net.minecraft.entity.passive.EntityAnimal;
import net.minecraft.entity.passive.EntityChicken;
import net.minecraft.entity.passive.EntityCow;
import net.minecraft.entity.passive.EntityPig;
import net.minecraft.entity.passive.EntitySheep;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.DamageSource;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
import net.minecraftforge.event.Event.Result;
import net.minecraftforge.event.ForgeSubscribe;
import net.minecraftforge.event.entity.EntityJoinWorldEvent;
@ -20,7 +24,7 @@ import net.minecraftforge.event.entity.living.LivingSpawnEvent.CheckSpawn;
import biomesoplenty.api.Blocks;
import biomesoplenty.api.Items;
import biomesoplenty.configuration.BOPConfiguration;
import biomesoplenty.mobs.ai.EntityAITemptArmour;
import biomesoplenty.entities.ai.EntityAITemptArmour;
public class EntitiesHelper
{
@ -86,4 +90,52 @@ public class EntitiesHelper
}
}
}
@ForgeSubscribe
public void lightningStrike(LivingHurtEvent event)
{
if (event.source == DamageSource.inFire)
{
AxisAlignedBB axisalignedbb = AxisAlignedBB.getAABBPool().getAABB((double)event.entity.posX, (double)event.entity.posY, (double)event.entity.posZ, (double)(event.entity.posX + 1), (double)(event.entity.posY + 1), (double)(event.entity.posZ + 1)).expand(5, 5, 5);
if (!event.entity.worldObj.getEntitiesWithinAABB(EntityLightningBolt.class, axisalignedbb).isEmpty());
{
if (!event.entity.worldObj.getEntitiesWithinAABB(EntityPlayer.class, axisalignedbb).isEmpty());
{
if (isBlockInBB(event.entity.worldObj, axisalignedbb, Blocks.glass.get().blockID, 2))
{
event.setCanceled(true);
}
}
}
}
}
public boolean isBlockInBB(World world, AxisAlignedBB par1AxisAlignedBB, int blockID, int blockMeta)
{
int i = MathHelper.floor_double(par1AxisAlignedBB.minX);
int j = MathHelper.floor_double(par1AxisAlignedBB.maxX + 1.0D);
int k = MathHelper.floor_double(par1AxisAlignedBB.minY);
int l = MathHelper.floor_double(par1AxisAlignedBB.maxY + 1.0D);
int i1 = MathHelper.floor_double(par1AxisAlignedBB.minZ);
int j1 = MathHelper.floor_double(par1AxisAlignedBB.maxZ + 1.0D);
for (int k1 = i; k1 < j; ++k1)
{
for (int l1 = k; l1 < l; ++l1)
{
for (int i2 = i1; i2 < j1; ++i2)
{
Block block = Block.blocksList[world.getBlockId(k1, l1, i2)];
if (block != null && block.blockID == blockID && world.getBlockMetadata(k1, l1, i2) == blockMeta)
{
return true;
}
}
}
}
return false;
}
}

View File

@ -5,7 +5,7 @@ import net.minecraft.item.ItemStack;
public class ItemBOPGlass extends ItemBlock
{
private static final String[] glassTypes = new String[] {"celestialLens", "sacrificialFocus"};
private static final String[] glassTypes = new String[] {"celestialLens", "sacrificialFocus_empty", "sacrificialFocus_active"};
public ItemBOPGlass(int par1)
{

View File

@ -142,7 +142,8 @@
<entry key="tile.bop.bones.bones_large.name">Large Bone Segment</entry>
<entry key="tile.bop.glass.celestialLens.name">Celestial Lens</entry>
<entry key="tile.bop.glass.sacrificialFocus.name">Sacrificial Focus</entry>
<entry key="tile.bop.glass.sacrificialFocus_empty.name">Sacrificial Focus</entry>
<entry key="tile.bop.glass.sacrificialFocus_active.name">Sacrificial Focus</entry>
<entry key="tile.bop.altar.altarFrame.name">Altar Frame</entry>

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

View File

@ -0,0 +1,9 @@
0*20
1*1
2*1
3*1
4*6
3*1
2*1
1*1
0*20

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB