mirror of
https://github.com/GTNewHorizons/Hardcore-Ender-Expansion.git
synced 2026-10-26 14:24:03 +00:00
Removed old Compendium from most places (errors)
This commit is contained in:
1 parent
4aeebe1b80
commit
ac49327ba5
113 files changed
+125
-2331
No files matched your search
@@ -48,9 +48,9 @@ import chylex.hee.gui.core.GuiHandler;
|
||||
import chylex.hee.item.ItemList;
|
||||
import chylex.hee.mechanics.MiscEvents;
|
||||
import chylex.hee.mechanics.charms.handler.CharmPouchHandler;
|
||||
import chylex.hee.mechanics.compendium.content.KnowledgeRegistrations;
|
||||
import chylex.hee.mechanics.compendium.events.CompendiumEvents;
|
||||
import chylex.hee.mechanics.infestation.InfestationEvents;
|
||||
import chylex.hee.mechanics.knowledge.KnowledgeRegistrations;
|
||||
import chylex.hee.mechanics.orb.OrbAcquirableItems;
|
||||
import chylex.hee.mechanics.orb.OrbSpawnableMobs;
|
||||
import chylex.hee.mechanics.temple.TempleEvents;
|
||||
@@ -250,7 +250,6 @@ public class HardcoreEnderExpansion{
|
||||
WorldLoot.registerWorldLoot();
|
||||
|
||||
KnowledgeRegistrations.initialize();
|
||||
chylex.hee.mechanics.compendium.content.KnowledgeRegistrations.initialize();
|
||||
|
||||
Stopwatch.finish("InitEvent");
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import net.minecraft.stats.StatList;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.event.ForgeEventFactory;
|
||||
|
||||
public abstract class BlockAbstractOre extends BlockOre{
|
||||
public abstract class BlockAbstractOre extends BlockOre{ // TODO redundant?
|
||||
protected BlockAbstractOre(){}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -7,7 +7,6 @@ import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -21,8 +20,6 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.IShearable;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import chylex.hee.item.block.ItemBlockWithSubtypes.IBlockSubtypes;
|
||||
import chylex.hee.mechanics.knowledge.KnowledgeRegistrations;
|
||||
import chylex.hee.mechanics.knowledge.util.ObservationUtil;
|
||||
import chylex.hee.proxy.ModCommonProxy;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@@ -56,13 +53,6 @@ public class BlockCrossedDecoration extends BlockFlower implements IShearable, I
|
||||
return block == Blocks.end_stone || block == BlockList.end_terrain || super.canPlaceBlockOn(block);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void harvestBlock(World world, EntityPlayer player, int x, int y, int z, int meta){
|
||||
super.harvestBlock(world,player,x,y,z,meta);
|
||||
|
||||
if (meta == dataLilyFire)KnowledgeRegistrations.LILYFIRE.tryUnlockFragment(player,1F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int meta, int fortune){
|
||||
ArrayList<ItemStack> ret = new ArrayList<>();
|
||||
@@ -98,12 +88,9 @@ public class BlockCrossedDecoration extends BlockFlower implements IShearable, I
|
||||
public void onEntityCollidedWithBlock(World world, int x, int y, int z, Entity entity){
|
||||
if (world.getBlockMetadata(x,y,z) == dataThornBush){
|
||||
entity.attackEntityFrom(DamageSource.generic,1F);
|
||||
if (world.rand.nextInt(80) == 0 && entity instanceof EntityLivingBase){
|
||||
((EntityLivingBase)entity).addPotionEffect(new PotionEffect(Potion.poison.id,30+world.rand.nextInt(40),1,true));
|
||||
}
|
||||
|
||||
if (world.rand.nextInt(66) == 0){
|
||||
for(EntityPlayer observer:ObservationUtil.getAllObservers(entity,8D))KnowledgeRegistrations.INFESTED_FOREST_BIOME.tryUnlockFragment(observer,0.3F,new byte[]{ 1 });
|
||||
if (world.rand.nextInt(80) == 0 && entity instanceof EntityLivingBase && !((EntityLivingBase)entity).isPotionActive(Potion.poison)){
|
||||
((EntityLivingBase)entity).addPotionEffect(new PotionEffect(Potion.poison.id,30+world.rand.nextInt(40),1,true));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,15 +1,12 @@
|
||||
package chylex.hee.block;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockMobSpawner;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import chylex.hee.mechanics.knowledge.KnowledgeRegistrations;
|
||||
import chylex.hee.tileentity.TileEntityCustomSpawner;
|
||||
|
||||
public class BlockCustomSpawner extends BlockMobSpawner{
|
||||
public BlockCustomSpawner(){
|
||||
super();
|
||||
disableStats();
|
||||
}
|
||||
|
||||
@@ -27,13 +24,4 @@ public class BlockCustomSpawner extends BlockMobSpawner{
|
||||
|
||||
super.breakBlock(world,x,y,z,oldBlock,oldMeta);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void harvestBlock(World world, EntityPlayer player, int x, int y, int z, int meta){
|
||||
super.harvestBlock(world,player,x,y,z,meta);
|
||||
|
||||
if (meta == 0){
|
||||
KnowledgeRegistrations.DUNGEON_TOWER.tryUnlockFragment(player,0.1F,new byte[]{ 0,1,2,3 });
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -15,8 +15,6 @@ import net.minecraft.world.World;
|
||||
import chylex.hee.entity.block.EntityBlockFallingDragonEgg;
|
||||
import chylex.hee.entity.block.EntityBlockTempleDragonEgg;
|
||||
import chylex.hee.entity.fx.FXType;
|
||||
import chylex.hee.mechanics.knowledge.KnowledgeRegistrations;
|
||||
import chylex.hee.mechanics.knowledge.util.ObservationUtil;
|
||||
import chylex.hee.packets.PacketPipeline;
|
||||
import chylex.hee.packets.client.C22EffectLine;
|
||||
import chylex.hee.system.achievements.AchievementManager;
|
||||
@@ -25,7 +23,6 @@ import chylex.hee.system.savedata.types.DragonSavefile;
|
||||
|
||||
public class BlockDragonEggCustom extends BlockDragonEgg{
|
||||
public BlockDragonEggCustom(){
|
||||
super();
|
||||
setBlockUnbreakable().setResistance(2000F).setStepSound(Block.soundTypeStone).setLightLevel(0.125F).setBlockName("dragonEgg").setBlockTextureName("dragon_egg");
|
||||
}
|
||||
|
||||
@@ -117,8 +114,6 @@ public class BlockDragonEggCustom extends BlockDragonEgg{
|
||||
world.setBlockToAir(x,y,z);
|
||||
|
||||
PacketPipeline.sendToAllAround(world.provider.dimensionId,x,y,z,64D,new C22EffectLine(FXType.Line.DRAGON_EGG_TELEPORT,x+0.5D,y+0.5D,z+0.5D,xx+0.5D,yy+0.5D,zz+0.5D));
|
||||
for(EntityPlayer observer:ObservationUtil.getAllObservers(world,x+0.5D,y+0.5D,z+0.5D,12D))KnowledgeRegistrations.ENDER_DRAGON.tryUnlockFragment(observer,0.25F,new byte[]{ 16,17 });
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,8 +15,6 @@ import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import chylex.hee.entity.mob.EntityMobAngryEnderman;
|
||||
import chylex.hee.item.ItemList;
|
||||
import chylex.hee.mechanics.knowledge.KnowledgeRegistrations;
|
||||
import chylex.hee.mechanics.knowledge.util.ObservationUtil;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@@ -54,12 +52,7 @@ public class BlockEndFlower extends BlockFlower{
|
||||
EntityMobAngryEnderman enderman = new EntityMobAngryEnderman(world);
|
||||
enderman.setCanDespawn(false);
|
||||
enderman.setPosition(px+rand.nextFloat(),py+0.01F,pz+rand.nextFloat());
|
||||
world.spawnEntityInWorld(enderman);
|
||||
|
||||
if (++spawned == 1){
|
||||
for(EntityPlayer observer:ObservationUtil.getAllObservers(enderman,20D))KnowledgeRegistrations.DEATH_FLOWER.tryUnlockFragment(observer,0.7F,new byte[]{ 0,1,2,3,4,6,7 });
|
||||
}
|
||||
|
||||
world.spawnEntityInWorld(enderman);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -109,8 +102,6 @@ public class BlockEndFlower extends BlockFlower{
|
||||
}
|
||||
}
|
||||
|
||||
boolean spawned = false;
|
||||
|
||||
for(int a = 0; a < 6; a++){
|
||||
int xx = x+rand.nextInt(8)-4,zz = z+rand.nextInt(8)-4,yy;
|
||||
for(int b = 0; b < yOffsets.length; b++){
|
||||
@@ -119,13 +110,7 @@ public class BlockEndFlower extends BlockFlower{
|
||||
EntityMobAngryEnderman enderman = new EntityMobAngryEnderman(world);
|
||||
enderman.setPosition(xx+rand.nextFloat(),yy+0.01F,zz+rand.nextFloat());
|
||||
enderman.setCanDespawn(false);
|
||||
world.spawnEntityInWorld(enderman);
|
||||
|
||||
if (!spawned){
|
||||
spawned = true;
|
||||
for(EntityPlayer observer:ObservationUtil.getAllObservers(enderman,32D))KnowledgeRegistrations.DEATH_FLOWER.tryUnlockFragment(observer,1F,new byte[]{ 0,1,2,3,4,6,7 });
|
||||
}
|
||||
|
||||
world.spawnEntityInWorld(enderman);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -157,12 +142,8 @@ public class BlockEndFlower extends BlockFlower{
|
||||
if (!player.capabilities.isCreativeMode)--is.stackSize;
|
||||
world.playAuxSFX(2005,x,y,z,0);
|
||||
}
|
||||
|
||||
for(int a = 0; a < 3; a++)world.spawnParticle("portal",x+world.rand.nextFloat(),y+world.rand.nextFloat(),z+world.rand.nextFloat(),0D,0D,0D);
|
||||
|
||||
KnowledgeRegistrations.DEATH_FLOWER.tryUnlockFragment(player,0.18F,new byte[]{ 0,1,2,3,4,6,7 });
|
||||
EntityPlayer observer = ObservationUtil.getRandomObserver(player,6D);
|
||||
if (observer != player)KnowledgeRegistrations.DEATH_FLOWER.tryUnlockFragment(observer,0.16F,new byte[]{ 0,1,2,3,4,6,7 });
|
||||
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
@@ -11,7 +11,6 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockEndFlowerPot extends BlockFlowerPot{
|
||||
public BlockEndFlowerPot(){
|
||||
super();
|
||||
setTickRandomly(true);
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,6 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
import chylex.hee.item.ItemList;
|
||||
import chylex.hee.mechanics.knowledge.KnowledgeRegistrations;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@@ -29,19 +28,7 @@ public class BlockEndPowderOre extends BlockAbstractOre{
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onOreMined(EntityPlayer player, ArrayList<ItemStack> drops, int x, int y, int z, int meta, int fortune){
|
||||
if (KnowledgeRegistrations.END_POWDER_ORE.tryUnlockFragment(player,0.1F).stopTrying)return;
|
||||
if (KnowledgeRegistrations.END_POWDER.tryUnlockFragment(player,0.1F).stopTrying)return;
|
||||
|
||||
if (KnowledgeRegistrations.END_POWDER.hasSomeFragments(player)){
|
||||
switch(player.worldObj.rand.nextInt(4)){
|
||||
case 0: KnowledgeRegistrations.ENDER_PEARLS_ENH.tryUnlockFragment(player,0.05F); break;
|
||||
case 1: KnowledgeRegistrations.TRANSFERENCE_GEM_ENH.tryUnlockFragment(player,0.05F); break;
|
||||
case 2: KnowledgeRegistrations.TNT_ENH.tryUnlockFragment(player,0.05F); break;
|
||||
case 3: KnowledgeRegistrations.SOUL_CHARM_ENH.tryUnlockFragment(player,0.05F); break;
|
||||
}
|
||||
}
|
||||
}
|
||||
protected void onOreMined(EntityPlayer player, ArrayList<ItemStack> drops, int x, int y, int z, int meta, int fortune){}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
|
||||
@@ -9,7 +9,6 @@ import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.monster.EntityEnderman;
|
||||
import net.minecraft.entity.monster.EntitySilverfish;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.potion.Potion;
|
||||
@@ -28,8 +27,6 @@ import chylex.hee.entity.mob.EntityMobBabyEnderman;
|
||||
import chylex.hee.entity.mob.EntityMobEnderGuardian;
|
||||
import chylex.hee.entity.mob.EntityMobLouse;
|
||||
import chylex.hee.item.ItemList;
|
||||
import chylex.hee.mechanics.knowledge.KnowledgeRegistrations;
|
||||
import chylex.hee.mechanics.knowledge.util.ObservationUtil;
|
||||
import cpw.mods.fml.common.eventhandler.Event.Result;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
@@ -60,7 +57,6 @@ public class BlockEnderGoo extends BlockFluidClassic{
|
||||
|
||||
if (shouldBattleWater){
|
||||
int meta = world.getBlockMetadata(x,y,z);
|
||||
boolean observed = false;
|
||||
|
||||
for(int a = 0; a < 6; a++){
|
||||
if (world.getBlock(x+xOff[a],y+yOff[a],z+zOff[a]).getMaterial() != Material.water)continue;
|
||||
@@ -68,11 +64,6 @@ public class BlockEnderGoo extends BlockFluidClassic{
|
||||
if ((rand.nextInt(Math.max(1,10-meta-(world.provider.dimensionId == 1?7:0)+(a == 2 || a == 3?2:0))) == 0)){
|
||||
world.setBlock(x+xOff[a],y+yOff[a],z+zOff[a],this,Math.max(2,world.getBlockMetadata(x,y,z)),3);
|
||||
if (rand.nextInt(6-meta) == 0)world.setBlockToAir(x,y,z);
|
||||
|
||||
if (!observed){
|
||||
observed = true;
|
||||
for(EntityPlayer observer:ObservationUtil.getAllObservers(world,x+0.5D,y+0.5D,z+0.5D,16D))KnowledgeRegistrations.ENDER_GOO.tryUnlockFragment(observer,0.04F);
|
||||
}
|
||||
}
|
||||
else if (world.provider.dimensionId != 1 && rand.nextInt(4) != 0){
|
||||
world.setBlock(x,y,z,Blocks.flowing_water,2,3);
|
||||
@@ -124,10 +115,6 @@ public class BlockEnderGoo extends BlockFluidClassic{
|
||||
entity.motionX *= 0.25D;
|
||||
entity.motionY *= 0.45D;
|
||||
entity.motionZ *= 0.25D;
|
||||
|
||||
if (e.ticksExisted%20 == 0){
|
||||
for(EntityPlayer observer:ObservationUtil.getAllObservers(entity,6D))KnowledgeRegistrations.ENDER_GOO.tryUnlockFragment(observer,0.2F);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -143,8 +130,6 @@ public class BlockEnderGoo extends BlockFluidClassic{
|
||||
e.world.setBlockToAir(e.target.blockX,e.target.blockY,e.target.blockZ);
|
||||
e.result = new ItemStack(ItemList.bucket_ender_goo);
|
||||
e.setResult(Result.ALLOW);
|
||||
|
||||
KnowledgeRegistrations.ENDER_GOO.tryUnlockFragment(e.entityPlayer,0.08F);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -15,8 +15,6 @@ import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
import chylex.hee.entity.fx.EntityEnergyClusterFX;
|
||||
import chylex.hee.item.ItemList;
|
||||
import chylex.hee.mechanics.knowledge.KnowledgeRegistrations;
|
||||
import chylex.hee.mechanics.knowledge.util.ObservationUtil;
|
||||
import chylex.hee.mechanics.misc.EnergyClusterData;
|
||||
import chylex.hee.system.util.DragonUtil;
|
||||
import chylex.hee.system.util.MathUtil;
|
||||
@@ -72,12 +70,6 @@ public class BlockEnergyCluster extends BlockContainer{
|
||||
}
|
||||
else return false;
|
||||
|
||||
if (world.rand.nextInt(3) == 0){
|
||||
for(EntityPlayer observer:ObservationUtil.getAllObservers(world,x+0.5D,y+0.5D,z+0.5D,6D)){
|
||||
KnowledgeRegistrations.ENERGY_CLUSTER.tryUnlockFragment(observer,0.37F,new byte[]{ 2,3,4 });
|
||||
}
|
||||
}
|
||||
|
||||
tile.synchronize();
|
||||
if (!world.isRemote && !player.capabilities.isCreativeMode)--is.stackSize;
|
||||
|
||||
@@ -104,10 +96,6 @@ public class BlockEnergyCluster extends BlockContainer{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for(EntityPlayer observer:ObservationUtil.getAllObservers(world,x+0.5D,y+0.5D,z+0.5D,8D)){
|
||||
KnowledgeRegistrations.ENERGY_CLUSTER.tryUnlockFragment(observer,0.37F,new byte[]{ 0,1 });
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -17,10 +17,6 @@ public class BlockEnhancedBrewingStand extends BlockBrewingStand{
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon theIcon;
|
||||
|
||||
public BlockEnhancedBrewingStand(){
|
||||
super();
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta){
|
||||
return new TileEntityEnhancedBrewingStand();
|
||||
|
||||
@@ -7,15 +7,10 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
import chylex.hee.item.ItemList;
|
||||
import chylex.hee.mechanics.knowledge.KnowledgeRegistrations;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockIgneousRockOre extends BlockAbstractOre{
|
||||
public BlockIgneousRockOre(){
|
||||
super();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(int meta, Random rand, int fortune){
|
||||
return ItemList.igneous_rock;
|
||||
@@ -33,10 +28,7 @@ public class BlockIgneousRockOre extends BlockAbstractOre{
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onOreMined(EntityPlayer player, ArrayList<ItemStack> drops, int x, int y, int z, int meta, int fortune){
|
||||
if (KnowledgeRegistrations.IGNEOUS_ROCK_ORE.tryUnlockFragment(player,0.08F).stopTrying)return;
|
||||
KnowledgeRegistrations.IGNEOUS_ROCK.tryUnlockFragment(player,0.06F,new byte[]{ 0,1,2 });
|
||||
}
|
||||
protected void onOreMined(EntityPlayer player, ArrayList<ItemStack> drops, int x, int y, int z, int meta, int fortune){}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
|
||||
@@ -6,7 +6,6 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
import chylex.hee.item.ItemList;
|
||||
import chylex.hee.mechanics.knowledge.KnowledgeRegistrations;
|
||||
import chylex.hee.packets.PacketPipeline;
|
||||
import chylex.hee.packets.client.C08PlaySound;
|
||||
|
||||
@@ -37,10 +36,5 @@ public class BlockInstabilityOrbOre extends BlockAbstractOre{
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onOreMined(EntityPlayer player, ArrayList<ItemStack> drops, int x, int y, int z, int meta, int fortune){
|
||||
if (KnowledgeRegistrations.INSTABILITY_ORB_ORE.tryUnlockFragment(player,0.12F).stopTrying)return;
|
||||
if (KnowledgeRegistrations.INSTABILITY_ORB.tryUnlockFragment(player,0.07F,new byte[]{ 0,2 }).stopTrying)return;
|
||||
if (player.worldObj.rand.nextInt(3) != 0)KnowledgeRegistrations.ENHANCED_BREWING_STAND.tryUnlockFragment(player,0.1F,new byte[]{ 3 });
|
||||
else KnowledgeRegistrations.ENERGY_EXTRACTION_TABLE.tryUnlockFragment(player,0.15F,new byte[]{ 6 });
|
||||
}
|
||||
protected void onOreMined(EntityPlayer player, ArrayList<ItemStack> drops, int x, int y, int z, int meta, int fortune){}
|
||||
}
|
||||
@@ -3,19 +3,12 @@ import java.util.Random;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockFalling;
|
||||
import net.minecraft.block.BlockStone;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.world.World;
|
||||
import chylex.hee.entity.block.EntityBlockFallingObsidian;
|
||||
import chylex.hee.mechanics.knowledge.KnowledgeRegistrations;
|
||||
import chylex.hee.mechanics.knowledge.util.ObservationUtil;
|
||||
|
||||
public class BlockObsidianEnd extends BlockStone{
|
||||
public BlockObsidianEnd(){
|
||||
super();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockAdded(World world, int x, int y, int z){
|
||||
world.scheduleBlockUpdate(x,y,z,this,tickRate(world));
|
||||
@@ -51,10 +44,4 @@ public class BlockObsidianEnd extends BlockStone{
|
||||
public int quantityDropped(Random rand){
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dropBlockAsItemWithChance(World world, int x, int y, int z, int meta, float chance, int fortune){
|
||||
super.dropBlockAsItemWithChance(world,x,y,z,meta,chance,fortune);
|
||||
for(EntityPlayer observer:ObservationUtil.getAllObservers(world,x+0.5D,y+0.5D,z+0.5D,6D))KnowledgeRegistrations.FALLING_OBSIDIAN.tryUnlockFragment(observer,1F,new byte[]{ 2,3 });
|
||||
}
|
||||
}
|
||||
@@ -5,14 +5,11 @@ import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import chylex.hee.item.block.ItemBlockWithSubtypes.IBlockSubtypes;
|
||||
import chylex.hee.mechanics.knowledge.KnowledgeRegistrations;
|
||||
import chylex.hee.mechanics.knowledge.util.ObservationUtil;
|
||||
import chylex.hee.proxy.ModCommonProxy;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@@ -52,12 +49,6 @@ public class BlockObsidianSpecial extends Block implements IBlockSubtypes{
|
||||
return (meta == 2) ? (side == 0 || side == 1 ? 2 : side == 2 || side == 3 ? 4 : side == 4 || side == 5 ? 3 : meta) : meta;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dropBlockAsItemWithChance(World world, int x, int y, int z, int meta, float chance, int fortune){
|
||||
super.dropBlockAsItemWithChance(world,x,y,z,meta,chance,fortune);
|
||||
for(EntityPlayer observer:ObservationUtil.getAllObservers(world,x+0.5D,y+0.5D,z+0.5D,6D))KnowledgeRegistrations.OBSIDIAN_VARIATIONS.tryUnlockFragment(observer,0.4F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(int meta){
|
||||
return meta == 6 ? 1 : meta == 5 ? 0 : meta == 3 || meta == 4 ? 2 : meta;
|
||||
|
||||
@@ -5,14 +5,12 @@ import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import chylex.hee.item.ItemList;
|
||||
import chylex.hee.item.block.ItemBlockWithSubtypes.IBlockSubtypes;
|
||||
import chylex.hee.mechanics.knowledge.KnowledgeRegistrations;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@@ -23,12 +21,6 @@ public class BlockSphalerite extends Block implements IBlockSubtypes{
|
||||
public BlockSphalerite(){
|
||||
super(Material.rock);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void harvestBlock(World world, EntityPlayer player, int x, int y, int z, int meta){
|
||||
super.harvestBlock(world,player,x,y,z,meta);
|
||||
KnowledgeRegistrations.SPHALERITE.tryUnlockFragment(player,meta == 1 ? 0.2F : 0.04F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int meta, int fortune){
|
||||
|
||||
@@ -18,9 +18,6 @@ import net.minecraft.world.World;
|
||||
import chylex.hee.entity.fx.FXType;
|
||||
import chylex.hee.entity.mob.EntityMobForestGhost;
|
||||
import chylex.hee.item.ItemList;
|
||||
import chylex.hee.mechanics.knowledge.KnowledgeRegistrations;
|
||||
import chylex.hee.mechanics.knowledge.data.UnlockResult;
|
||||
import chylex.hee.mechanics.knowledge.util.ObservationUtil;
|
||||
import chylex.hee.packets.PacketPipeline;
|
||||
import chylex.hee.packets.client.C08PlaySound;
|
||||
import chylex.hee.packets.client.C20Effect;
|
||||
@@ -77,17 +74,6 @@ public class BlockSpookyLog extends Block{
|
||||
|
||||
PacketPipeline.sendToPlayer(closest,new C08PlaySound(C08PlaySound.GHOST_DEATH,closest.posX,closest.posY,closest.posZ,1.8F,0.9F+world.rand.nextFloat()*0.3F));
|
||||
|
||||
for(EntityPlayer observer:ObservationUtil.getAllObservers(closest,6D)){
|
||||
if (KnowledgeRegistrations.GHOST_AMULET.tryUnlockFragment(observer,0.18F).stopTrying)continue;
|
||||
if (KnowledgeRegistrations.ECTOPLASM.tryUnlockFragment(observer,0.1F).stopTrying)continue;
|
||||
|
||||
switch(world.rand.nextInt(3)){
|
||||
case 0: KnowledgeRegistrations.CORPOREAL_MIRAGE_ORB.tryUnlockFragment(observer,0.05F,new byte[]{ 0 }); break;
|
||||
case 1: KnowledgeRegistrations.SOUL_CHARM.tryUnlockFragment(observer,0.07F,new byte[]{ 0,1 }); break;
|
||||
case 2: KnowledgeRegistrations.SPECTRAL_WAND.tryUnlockFragment(observer,0.1F); break;
|
||||
}
|
||||
}
|
||||
|
||||
foundAmulet = true;
|
||||
break;
|
||||
}
|
||||
@@ -104,21 +90,7 @@ public class BlockSpookyLog extends Block{
|
||||
}
|
||||
}
|
||||
|
||||
if (!world.isRemote && world.rand.nextInt(8) == 0){
|
||||
dropBlockAsItem(world,x,y,z,new ItemStack(ItemList.dry_splinter));
|
||||
for(EntityPlayer observer:ObservationUtil.getAllObservers(world,x+0.5D,y+0.5D,z+0.5D,14D)){
|
||||
if (KnowledgeRegistrations.DRY_SPLINTER.tryUnlockFragment(observer,0.5F) == UnlockResult.NOTHING_TO_UNLOCK){
|
||||
KnowledgeRegistrations.INFESTATION_REMEDY.tryUnlockFragment(observer,0.23F);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!world.isRemote){
|
||||
for(EntityPlayer observer:ObservationUtil.getAllObservers(world,x+0.5D,y+0.5D,z+0.5D,14D)){
|
||||
if (KnowledgeRegistrations.SPOOKY_TREES.tryUnlockFragment(observer,0.1F).stopTrying)continue;
|
||||
KnowledgeRegistrations.GHOST_AMULET.tryUnlockFragment(observer,0.04F);
|
||||
}
|
||||
}
|
||||
if (!world.isRemote && world.rand.nextInt(8) == 0)dropBlockAsItem(world,x,y,z,new ItemStack(ItemList.dry_splinter));
|
||||
|
||||
if (world.getBlock(x,y+1,z) == this){
|
||||
dropBlockAsItemWithChance(world,x,y+1,z,world.getBlockMetadata(x,y+1,z),chance,fortune);
|
||||
|
||||
@@ -11,8 +11,6 @@ import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import chylex.hee.item.ItemList;
|
||||
import chylex.hee.mechanics.knowledge.KnowledgeRegistrations;
|
||||
import chylex.hee.mechanics.knowledge.data.UnlockResult;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@@ -57,13 +55,7 @@ public class BlockStardustOre extends BlockAbstractOre{
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onOreMined(EntityPlayer player, ArrayList<ItemStack> drops, int x, int y, int z, int meta, int fortune){
|
||||
if (KnowledgeRegistrations.STARDUST_ORE.tryUnlockFragment(player,0.05F).stopTrying)return;
|
||||
if (KnowledgeRegistrations.STARDUST.tryUnlockFragment(player,0.04F,new byte[]{ 0 }) == UnlockResult.NOTHING_TO_UNLOCK){
|
||||
if (player.worldObj.rand.nextBoolean())KnowledgeRegistrations.DECOMPOSITION_TABLE.tryUnlockFragment(player,0.03F,new byte[]{ 0,1 });
|
||||
else KnowledgeRegistrations.ENERGY_EXTRACTION_TABLE.tryUnlockFragment(player,0.03F,new byte[]{ 0,1 });
|
||||
}
|
||||
}
|
||||
protected void onOreMined(EntityPlayer player, ArrayList<ItemStack> drops, int x, int y, int z, int meta, int fortune){}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
|
||||
@@ -10,7 +10,6 @@ import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.world.World;
|
||||
import chylex.hee.block.BlockList;
|
||||
import chylex.hee.mechanics.knowledge.KnowledgeRegistrations;
|
||||
import chylex.hee.system.savedata.WorldDataHandler;
|
||||
import chylex.hee.system.savedata.types.DragonSavefile;
|
||||
import chylex.hee.system.util.DragonUtil;
|
||||
@@ -102,14 +101,6 @@ public class EntityBlockEnderCrystal extends EntityEnderCrystal{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (tar instanceof EntityPlayer){
|
||||
EntityPlayer player = (EntityPlayer)tar;
|
||||
|
||||
if (!KnowledgeRegistrations.DRAGON_LAIR.tryUnlockFragment(player,0.25F).stopTrying){
|
||||
KnowledgeRegistrations.ENDER_DRAGON.tryUnlockFragment(player,0.16F,new byte[]{ 1,4 });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
@@ -4,15 +4,12 @@ import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.boss.EntityDragon;
|
||||
import net.minecraft.entity.item.EntityFallingBlock;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
import chylex.hee.block.BlockList;
|
||||
import chylex.hee.mechanics.knowledge.KnowledgeRegistrations;
|
||||
import chylex.hee.mechanics.knowledge.util.ObservationUtil;
|
||||
|
||||
public class EntityBlockFallingObsidian extends EntityFallingBlock{
|
||||
public EntityBlockFallingObsidian(World world){
|
||||
@@ -52,10 +49,7 @@ public class EntityBlockFallingObsidian extends EntityFallingBlock{
|
||||
motionY *= -0.5D;
|
||||
|
||||
if (field_145812_b > 5 && worldObj.getBlock(ix,iy,iz) != Blocks.piston_extension && worldObj.getEntitiesWithinAABB(EntityDragon.class,this.boundingBox.expand(1,1,1)).isEmpty()){
|
||||
if (worldObj.setBlock(ix,iy,iz,func_145805_f())){
|
||||
for(EntityPlayer observer:ObservationUtil.getAllObservers(worldObj,ix+0.5D,iy+0.5D,iz+0.5D,8D))KnowledgeRegistrations.FALLING_OBSIDIAN.tryUnlockFragment(observer,1F,new byte[]{ 0,1 });
|
||||
setDead();
|
||||
}
|
||||
if (worldObj.setBlock(ix,iy,iz,func_145805_f()))setDead();
|
||||
}
|
||||
}
|
||||
else if (!worldObj.isRemote && ((field_145812_b > 100 && (iy < 1 || iy > 256)) || field_145812_b > 600)){
|
||||
@@ -69,15 +63,8 @@ public class EntityBlockFallingObsidian extends EntityFallingBlock{
|
||||
int i = MathHelper.ceiling_float_int(distance-1F);
|
||||
|
||||
if (i > 0){
|
||||
boolean hurt = false;
|
||||
|
||||
for(Object o:worldObj.getEntitiesWithinAABBExcludingEntity(this,boundingBox)){
|
||||
((Entity)o).attackEntityFrom(DamageSource.fallingBlock,Math.min(MathHelper.floor_float(i*5F),60));
|
||||
|
||||
if (!hurt){
|
||||
for(EntityPlayer observer:ObservationUtil.getAllObservers((Entity)o,8D))KnowledgeRegistrations.FALLING_OBSIDIAN.tryUnlockFragment(observer,1F,new byte[]{ 0,1 });
|
||||
hurt = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,8 +51,6 @@ import chylex.hee.entity.boss.dragon.managers.DragonRewardManager;
|
||||
import chylex.hee.entity.boss.dragon.managers.DragonShotManager;
|
||||
import chylex.hee.entity.mob.EntityMobAngryEnderman;
|
||||
import chylex.hee.entity.weather.EntityWeatherLightningBoltSafe;
|
||||
import chylex.hee.mechanics.knowledge.KnowledgeRegistrations;
|
||||
import chylex.hee.mechanics.knowledge.util.ObservationUtil;
|
||||
import chylex.hee.packets.PacketPipeline;
|
||||
import chylex.hee.packets.client.C01ParticleEndPortalCreation;
|
||||
import chylex.hee.packets.client.C06SetPlayerVelocity;
|
||||
@@ -266,13 +264,6 @@ public class EntityBossDragon extends EntityLiving implements IBossDisplayData,I
|
||||
worldObj.spawnEntityInWorld(buddy);
|
||||
}
|
||||
|
||||
if (rand.nextInt(60) == 0){
|
||||
for(EntityPlayer observer:ObservationUtil.getAllObservers(this,250D)){
|
||||
if (KnowledgeRegistrations.ENDER_DRAGON.tryUnlockFragment(observer,0.36F,new byte[]{ 0,1,2,3 }).stopTrying)continue;
|
||||
if (isAngry())KnowledgeRegistrations.ENDER_DRAGON.tryUnlockFragment(observer,0.29F,new byte[]{ 4,5,6,7 });
|
||||
}
|
||||
}
|
||||
|
||||
lastUpdate = System.currentTimeMillis();
|
||||
}
|
||||
}
|
||||
@@ -529,12 +520,7 @@ public class EntityBossDragon extends EntityLiving implements IBossDisplayData,I
|
||||
event.collidedEntity.motionY = event.velocityY;
|
||||
event.collidedEntity.motionZ = event.velocityZ;
|
||||
|
||||
if (entity instanceof EntityPlayer){
|
||||
PacketPipeline.sendToPlayer((EntityPlayer)entity,new C06SetPlayerVelocity(event.velocityX,event.velocityY,event.velocityZ));
|
||||
if (rand.nextInt(13) == 0){
|
||||
for(EntityPlayer observer:ObservationUtil.getAllObservers(entity,100D))KnowledgeRegistrations.ENDER_DRAGON.tryUnlockFragment(observer,0.33F,new byte[]{ 0,2,5,6 });
|
||||
}
|
||||
}
|
||||
if (entity instanceof EntityPlayer)PacketPipeline.sendToPlayer((EntityPlayer)entity,new C06SetPlayerVelocity(event.velocityX,event.velocityY,event.velocityZ));
|
||||
}
|
||||
// END
|
||||
}
|
||||
@@ -707,13 +693,6 @@ public class EntityBossDragon extends EntityLiving implements IBossDisplayData,I
|
||||
else if (deathTicks == 200)DragonUtil.spawnXP(this,4000);
|
||||
|
||||
if (deathTicks > 40 && deathTicks < 140)rewards.spawnEssence(worldObj,(int)posX,(int)posZ);
|
||||
|
||||
if (deathTicks > 20 && deathTicks < 110 && deathTicks%15 == 0){
|
||||
for(EntityPlayer observer:ObservationUtil.getAllObservers(this,250D)){
|
||||
if (KnowledgeRegistrations.ENDER_DRAGON.tryUnlockFragment(observer,0.4F,new byte[]{ 15 }).stopTrying)continue;
|
||||
KnowledgeRegistrations.ALTAR_NEXUS.tryUnlockFragment(observer,0.7F,new byte[]{ 0,1 });
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (deathTicks > 20){
|
||||
int amount = 1+deathTicks/40,xx = DragonUtil.portalEffectX,zz = DragonUtil.portalEffectZ;
|
||||
|
||||
@@ -19,8 +19,6 @@ import chylex.hee.entity.mob.EntityMobAngryEnderman;
|
||||
import chylex.hee.entity.mob.util.DamageSourceMobUnscaled;
|
||||
import chylex.hee.entity.weather.EntityWeatherLightningBoltDemon;
|
||||
import chylex.hee.item.ItemList;
|
||||
import chylex.hee.mechanics.knowledge.KnowledgeRegistrations;
|
||||
import chylex.hee.mechanics.knowledge.util.ObservationUtil;
|
||||
import chylex.hee.packets.PacketPipeline;
|
||||
import chylex.hee.packets.client.C05CustomWeather;
|
||||
import chylex.hee.proxy.ModCommonProxy;
|
||||
@@ -82,7 +80,6 @@ public class EntityBossEnderDemon extends EntityFlying implements IBossDisplayDa
|
||||
zz = lightningTarget.posZ+(rand.nextDouble()-0.5D)*1.5D;
|
||||
|
||||
lightningTarget.attackEntityFrom(new DamageSourceMobUnscaled(this),ModCommonProxy.opMobs?7F:4F);
|
||||
KnowledgeRegistrations.ENDER_DEMON.tryUnlockFragment(lightningTarget,0.1F,new byte[]{ 3,4 });
|
||||
|
||||
EntityWeatherEffect bolt = new EntityWeatherLightningBoltDemon(worldObj,xx,yy,zz,this,false);
|
||||
worldObj.weatherEffects.add(bolt);
|
||||
@@ -119,9 +116,6 @@ public class EntityBossEnderDemon extends EntityFlying implements IBossDisplayDa
|
||||
EntityWeatherEffect bolt = new EntityWeatherLightningBoltDemon(worldObj,ix+0.5D,iy,iz+0.5D,this,false);
|
||||
worldObj.addWeatherEffect(bolt);
|
||||
PacketPipeline.sendToAllAround(bolt,512D,new C05CustomWeather(bolt,(byte)0));
|
||||
|
||||
for(EntityPlayer observer:ObservationUtil.getAllObservers(this,120D))KnowledgeRegistrations.ENDER_DEMON.tryUnlockFragment(observer,0.22F,new byte[]{ 0,1,2 });
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -146,10 +140,7 @@ public class EntityBossEnderDemon extends EntityFlying implements IBossDisplayDa
|
||||
++placed;
|
||||
}
|
||||
|
||||
if (placed > 5 && rand.nextInt(15) <= 1){
|
||||
for(EntityPlayer observer:ObservationUtil.getAllObservers(this,120D))KnowledgeRegistrations.ENDER_DEMON.tryUnlockFragment(observer,0.25F,new byte[]{ 0,1,2 });
|
||||
break;
|
||||
}
|
||||
if (placed > 5 && rand.nextInt(15) <= 1)break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -204,10 +195,6 @@ public class EntityBossEnderDemon extends EntityFlying implements IBossDisplayDa
|
||||
if (source.getEntity() instanceof EntityPlayerMP)lastAttacker = (EntityPlayerMP)source.getEntity();
|
||||
if (lightningTarget == null)lightningStartCounter -= (int)amount;
|
||||
|
||||
if (rand.nextInt(5) == 0){
|
||||
for(EntityPlayer observer:ObservationUtil.getAllObservers(this,120D))KnowledgeRegistrations.ENDER_DEMON.tryUnlockFragment(observer,0.33F,new byte[]{ 0,1,2,3,4 });
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
else return false;
|
||||
@@ -237,12 +224,6 @@ public class EntityBossEnderDemon extends EntityFlying implements IBossDisplayDa
|
||||
EntityWeatherEffect bolt = new EntityWeatherLightningBoltDemon(worldObj,posX,posY,posZ,this,false);
|
||||
worldObj.weatherEffects.add(bolt);
|
||||
PacketPipeline.sendToAllAround(bolt,512D,new C05CustomWeather(bolt,(byte)0));
|
||||
|
||||
|
||||
for(EntityPlayer observer:ObservationUtil.getAllObservers(this,120D)){
|
||||
if (KnowledgeRegistrations.ENDER_DEMON.tryUnlockFragment(observer,0.2F,new byte[]{ 5 }).stopTrying)continue;
|
||||
KnowledgeRegistrations.ENDERMAN_RELIC.tryUnlockFragment(observer,0.13F,new byte[]{ 0,1,2,3,4,5 });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -20,8 +20,6 @@ import chylex.hee.block.BlockList;
|
||||
import chylex.hee.entity.RandomNameGenerator;
|
||||
import chylex.hee.entity.mob.util.DamageSourceMobUnscaled;
|
||||
import chylex.hee.item.ItemList;
|
||||
import chylex.hee.mechanics.knowledge.KnowledgeRegistrations;
|
||||
import chylex.hee.mechanics.knowledge.util.ObservationUtil;
|
||||
import chylex.hee.packets.PacketPipeline;
|
||||
import chylex.hee.packets.client.C07AddPlayerVelocity;
|
||||
import chylex.hee.packets.client.C08PlaySound;
|
||||
@@ -79,6 +77,7 @@ public class EntityMiniBossEnderEye extends EntityFlying implements IBossDisplay
|
||||
sleepTimer = 0;
|
||||
motionX = motionY = motionZ = 0D;
|
||||
|
||||
/*// TODO discovery of dungeon tower
|
||||
if (rand.nextBoolean() && ticksExisted%80 == 0){
|
||||
for(Object o:worldObj.playerEntities){
|
||||
EntityPlayer player = (EntityPlayer)o;
|
||||
@@ -96,7 +95,7 @@ public class EntityMiniBossEnderEye extends EntityFlying implements IBossDisplay
|
||||
KnowledgeRegistrations.DUNGEON_TOWER.tryUnlockFragment(player,0.3F);
|
||||
}
|
||||
}
|
||||
}
|
||||
}*/
|
||||
}
|
||||
else{
|
||||
if (target == null){
|
||||
@@ -183,8 +182,6 @@ public class EntityMiniBossEnderEye extends EntityFlying implements IBossDisplay
|
||||
player.motionZ += vec[1];
|
||||
|
||||
player.attackEntityFrom(new DamageSourceMobUnscaled(this),ModCommonProxy.opMobs ? 6F : 3F);
|
||||
|
||||
KnowledgeRegistrations.ENDER_EYE.tryUnlockFragment(player,0.2F,new byte[]{ 0,1,2,4 });
|
||||
}
|
||||
|
||||
PacketPipeline.sendToAllAround(this,64D,new C08PlaySound(C08PlaySound.ENDEREYE_ATTACK_POOF,posX,posY,posZ,1F,rand.nextFloat()*0.2F+0.9F));
|
||||
@@ -208,7 +205,6 @@ public class EntityMiniBossEnderEye extends EntityFlying implements IBossDisplay
|
||||
EntityPlayer player = (EntityPlayer)o;
|
||||
player.addPotionEffect(effBlind);
|
||||
player.addPotionEffect(effSlow);
|
||||
KnowledgeRegistrations.ENDER_EYE.tryUnlockFragment(player,0.2F,new byte[]{ 0,1,2,4 });
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -252,8 +248,6 @@ public class EntityMiniBossEnderEye extends EntityFlying implements IBossDisplay
|
||||
else if (attackAnim == 102){
|
||||
laserTopY = 0;
|
||||
PacketPipeline.sendToAllAround(this,64D,new C08PlaySound(C08PlaySound.ENDEREYE_ATTACK_LASER_END,posX,posY,posZ,1F,rand.nextFloat()*0.2F+0.9F));
|
||||
|
||||
for(EntityPlayer observer:ObservationUtil.getAllObservers(this,12D))KnowledgeRegistrations.ENDER_EYE.tryUnlockFragment(observer,0.2F,new byte[]{ 0,1,2,4 });
|
||||
}
|
||||
}
|
||||
/*
|
||||
@@ -302,9 +296,6 @@ public class EntityMiniBossEnderEye extends EntityFlying implements IBossDisplay
|
||||
}
|
||||
}
|
||||
|
||||
Entity damager = source.getEntity();
|
||||
if (damager instanceof EntityPlayer)KnowledgeRegistrations.ENDER_EYE.tryUnlockFragment((EntityPlayer)damager,0.04F,new byte[]{ 0,1,2,3 });
|
||||
|
||||
if (amount < 7F)return true;
|
||||
|
||||
amount = 7F+Math.min((amount-7F)*0.5F,5F);
|
||||
@@ -343,11 +334,6 @@ public class EntityMiniBossEnderEye extends EntityFlying implements IBossDisplay
|
||||
dropItem(Items.ender_eye,1);
|
||||
dropItem(Item.getItemFromBlock(Blocks.obsidian),rand.nextInt(4+looting)+3);
|
||||
dropItem(ItemList.spatial_dash_gem,1);
|
||||
|
||||
for(EntityPlayer observer:ObservationUtil.getAllObservers(this,6D)){
|
||||
if (KnowledgeRegistrations.ENDER_EYE.tryUnlockFragment(observer,0.7F,new byte[]{ 5 }).stopTrying)return;
|
||||
KnowledgeRegistrations.SPATIAL_DASH_GEM.tryUnlockFragment(observer,0.42F,new byte[]{ 0,1 });
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -24,8 +24,6 @@ import chylex.hee.entity.mob.util.DamageSourceMobUnscaled;
|
||||
import chylex.hee.entity.projectile.EntityProjectileGolemFireball;
|
||||
import chylex.hee.item.ItemList;
|
||||
import chylex.hee.mechanics.essence.EssenceType;
|
||||
import chylex.hee.mechanics.knowledge.KnowledgeRegistrations;
|
||||
import chylex.hee.mechanics.knowledge.util.ObservationUtil;
|
||||
import chylex.hee.packets.PacketPipeline;
|
||||
import chylex.hee.packets.client.C12ParticleFireFiendFlames;
|
||||
import chylex.hee.proxy.ModCommonProxy;
|
||||
@@ -121,8 +119,6 @@ public class EntityMiniBossFireFiend extends EntityFlying implements IBossDispla
|
||||
spawnTimer = 0;
|
||||
motionY += 0.4D;
|
||||
}
|
||||
|
||||
for(EntityPlayer observer:ObservationUtil.getAllObservers(this,20D))KnowledgeRegistrations.FIRE_FIEND.tryUnlockFragment(observer,1F,new byte[]{ 0,1 });
|
||||
}
|
||||
}
|
||||
|
||||
@@ -159,10 +155,6 @@ public class EntityMiniBossFireFiend extends EntityFlying implements IBossDispla
|
||||
fireballAttackTimer = (byte)(23-worldObj.difficultySetting.getDifficultyId()*2);
|
||||
EntityPlayer target = players.get(rand.nextInt(players.size()));
|
||||
worldObj.spawnEntityInWorld(new EntityProjectileGolemFireball(worldObj,this,posX,posY-0.2D,posZ,target.posX-posX,target.posY-posY,target.posZ-posZ));
|
||||
|
||||
if (rand.nextBoolean() && rand.nextBoolean()){
|
||||
for(EntityPlayer observer:ObservationUtil.getAllObservers(this,60D))KnowledgeRegistrations.FIRE_FIEND.tryUnlockFragment(observer,0.67F,new byte[]{ 0,1,2 });
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
@@ -206,10 +198,6 @@ public class EntityMiniBossFireFiend extends EntityFlying implements IBossDispla
|
||||
}
|
||||
else if (attackStage == STAGE_CREATING){
|
||||
if (--fireballAttackTimer < 0)attackStage = STAGE_SHOOTING;
|
||||
|
||||
if (rand.nextInt(18) == 0){
|
||||
for(EntityPlayer observer:ObservationUtil.getAllObservers(this,60D))KnowledgeRegistrations.FIRE_FIEND.tryUnlockFragment(observer,0.15F,new byte[]{ 0,1,2,3 });
|
||||
}
|
||||
}
|
||||
else if (attackStage == STAGE_SHOOTING){
|
||||
if (--fireballAttackTimer < 0){
|
||||
@@ -220,10 +208,6 @@ public class EntityMiniBossFireFiend extends EntityFlying implements IBossDispla
|
||||
double ballX = target.posX+offset[0],ballY = target.posY+offset[1]+1.5D,ballZ = target.posZ+offset[2];
|
||||
worldObj.spawnEntityInWorld(new EntityProjectileGolemFireball(worldObj,this,ballX,ballY,ballZ,target.posX-ballX,target.boundingBox.minY+target.height*0.5F-ballY,target.posZ-ballZ));
|
||||
|
||||
if (rand.nextInt(10) == 0){
|
||||
for(EntityPlayer observer:ObservationUtil.getAllObservers(this,60D))KnowledgeRegistrations.FIRE_FIEND.tryUnlockFragment(observer,0.3F,new byte[]{ 0,1,2,3,4 });
|
||||
}
|
||||
|
||||
iter.remove();
|
||||
fireballAttackTimer = (byte)(10+rand.nextInt(10)-worldObj.difficultySetting.getDifficultyId()*2);
|
||||
}
|
||||
@@ -255,10 +239,6 @@ public class EntityMiniBossFireFiend extends EntityFlying implements IBossDispla
|
||||
e.setFire(2+rand.nextInt(3));
|
||||
e.attackEntityFrom(new DamageSourceMobUnscaled(this),ModCommonProxy.opMobs?9F:5F);
|
||||
++damageInflicted;
|
||||
|
||||
if (e instanceof EntityPlayer && rand.nextInt(15) == 0){
|
||||
KnowledgeRegistrations.FIRE_FIEND.tryUnlockFragment((EntityPlayer)e,0.1F,new byte[]{ 0,1,2,3,4 });
|
||||
}
|
||||
}
|
||||
|
||||
moveForward *= 0.6F;
|
||||
@@ -289,8 +269,6 @@ public class EntityMiniBossFireFiend extends EntityFlying implements IBossDispla
|
||||
@Override
|
||||
protected void dropFewItems(boolean recentlyHit, int looting){
|
||||
for(int a = 0; a < 60; a++)entityDropItem(new ItemStack(ItemList.essence,2,EssenceType.FIERY.getItemDamage()),rand.nextFloat()*height);
|
||||
|
||||
for(EntityPlayer observer:ObservationUtil.getAllObservers(this,60D))KnowledgeRegistrations.FIRE_FIEND.tryUnlockFragment(observer,1F,new byte[]{ 5,6 });
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+1
-7
@@ -1,8 +1,6 @@
|
||||
package chylex.hee.entity.boss.dragon.attacks.passive;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import chylex.hee.entity.boss.EntityBossDragon;
|
||||
import chylex.hee.entity.boss.dragon.managers.DragonShotManager.ShotType;
|
||||
import chylex.hee.mechanics.knowledge.KnowledgeRegistrations;
|
||||
|
||||
public class DragonAttackFireball extends DragonPassiveAttackBase{
|
||||
public DragonAttackFireball(EntityBossDragon dragon, int attackId){
|
||||
@@ -12,11 +10,7 @@ public class DragonAttackFireball extends DragonPassiveAttackBase{
|
||||
@Override
|
||||
public void update(){
|
||||
if (dragon.target != null && dragon.ticksExisted%(24-(dragon.getWorldDifficulty()*4)+(dragon.angryStatus?10:30)-((100-dragon.attacks.getHealthPercentage())>>3)) == 0){
|
||||
double dist = dragon.target.getDistanceSqToEntity(dragon.dragonPartHead);
|
||||
if (dist > 400D){
|
||||
dragon.initShot().setType(ShotType.FIREBALL).setTarget(dragon.target).shoot();
|
||||
if (dragon.target instanceof EntityPlayer)KnowledgeRegistrations.ENDER_DRAGON.tryUnlockFragment((EntityPlayer)dragon.target,0.15F,new byte[]{ 0,2 });
|
||||
}
|
||||
if (dragon.target.getDistanceSqToEntity(dragon.dragonPartHead) > 400D)dragon.initShot().setType(ShotType.FIREBALL).setTarget(dragon.target).shoot();
|
||||
}
|
||||
}
|
||||
}
|
||||
-3
@@ -1,10 +1,8 @@
|
||||
package chylex.hee.entity.boss.dragon.attacks.passive;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.item.EntityTNTPrimed;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import chylex.hee.entity.boss.EntityBossDragon;
|
||||
import chylex.hee.entity.boss.dragon.managers.DragonShotManager.ShotType;
|
||||
import chylex.hee.mechanics.knowledge.KnowledgeRegistrations;
|
||||
|
||||
public class DragonAttackFreezeball extends DragonPassiveAttackBase{
|
||||
public DragonAttackFreezeball(EntityBossDragon dragon, int attackId){
|
||||
@@ -20,7 +18,6 @@ public class DragonAttackFreezeball extends DragonPassiveAttackBase{
|
||||
if (e != null && !dragon.worldObj.getEntitiesWithinAABB(EntityTNTPrimed.class,e.boundingBox.expand(8D,60D,8D)).isEmpty()){
|
||||
dragon.trySetTarget(e);
|
||||
dragon.initShot().setType(ShotType.FREEZEBALL).setTarget(e).setRandom().shoot();
|
||||
if (e instanceof EntityPlayer)KnowledgeRegistrations.ENDER_DRAGON.tryUnlockFragment((EntityPlayer)e,0.2F,new byte[]{ 0,2 });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-4
@@ -1,12 +1,10 @@
|
||||
package chylex.hee.entity.boss.dragon.attacks.special;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import chylex.hee.entity.boss.EntityBossDragon;
|
||||
import chylex.hee.entity.boss.dragon.attacks.special.event.CollisionEvent;
|
||||
import chylex.hee.entity.boss.dragon.attacks.special.event.DamageTakenEvent;
|
||||
import chylex.hee.entity.boss.dragon.attacks.special.event.TargetPositionSetEvent;
|
||||
import chylex.hee.entity.boss.dragon.attacks.special.event.TargetSetEvent;
|
||||
import chylex.hee.mechanics.knowledge.KnowledgeRegistrations;
|
||||
|
||||
public class DragonAttackBitemadness extends DragonSpecialAttackBase{
|
||||
private EntityLivingBase target;
|
||||
@@ -28,8 +26,7 @@ public class DragonAttackBitemadness extends DragonSpecialAttackBase{
|
||||
|
||||
if (target != null){
|
||||
if (dragon.target != null && biteCooldown == 0){
|
||||
biteCooldown = (byte)(dragon.attacks.biteClosePlayer()?6:3);
|
||||
if (dragon.target instanceof EntityPlayer)KnowledgeRegistrations.ENDER_DRAGON.tryUnlockFragment((EntityPlayer)dragon.target,0.14F,new byte[]{ 7,10 });
|
||||
biteCooldown = (byte)(dragon.attacks.biteClosePlayer() ? 6 : 3);
|
||||
}
|
||||
if (biteCooldown > 0)--biteCooldown;
|
||||
}
|
||||
|
||||
@@ -11,7 +11,6 @@ import chylex.hee.entity.boss.dragon.attacks.special.event.TargetPositionSetEven
|
||||
import chylex.hee.entity.boss.dragon.attacks.special.event.TargetSetEvent;
|
||||
import chylex.hee.entity.fx.FXType;
|
||||
import chylex.hee.entity.mob.EntityMobVampiricBat;
|
||||
import chylex.hee.mechanics.knowledge.KnowledgeRegistrations;
|
||||
import chylex.hee.packets.PacketPipeline;
|
||||
import chylex.hee.packets.client.C20Effect;
|
||||
import chylex.hee.system.util.DragonUtil;
|
||||
@@ -104,8 +103,6 @@ public class DragonAttackBloodlust extends DragonSpecialAttackBase{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
KnowledgeRegistrations.ENDER_DRAGON.tryUnlockFragment(player,0.32F,new byte[]{ 7,14 });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,8 +7,6 @@ import chylex.hee.entity.boss.dragon.attacks.special.event.MotionUpdateEvent;
|
||||
import chylex.hee.entity.boss.dragon.attacks.special.event.TargetPositionSetEvent;
|
||||
import chylex.hee.entity.boss.dragon.attacks.special.event.TargetSetEvent;
|
||||
import chylex.hee.entity.boss.dragon.managers.DragonAttackManager;
|
||||
import chylex.hee.mechanics.knowledge.KnowledgeRegistrations;
|
||||
import chylex.hee.mechanics.knowledge.util.ObservationUtil;
|
||||
import chylex.hee.system.util.MathUtil;
|
||||
|
||||
public class DragonAttackDivebomb extends DragonSpecialAttackBase{
|
||||
@@ -68,8 +66,6 @@ public class DragonAttackDivebomb extends DragonSpecialAttackBase{
|
||||
tick = 0;
|
||||
phase = 1;
|
||||
tmpTarget = null;
|
||||
|
||||
for(EntityPlayer observer:ObservationUtil.getAllObservers(dragon,250D))KnowledgeRegistrations.ENDER_DRAGON.tryUnlockFragment(observer,1F,new byte[]{ 7,8 });
|
||||
}
|
||||
}
|
||||
else if (phase == 1){
|
||||
|
||||
+3
-7
@@ -1,12 +1,9 @@
|
||||
package chylex.hee.entity.boss.dragon.attacks.special;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import chylex.hee.entity.boss.EntityBossDragon;
|
||||
import chylex.hee.entity.boss.dragon.attacks.special.event.TargetPositionSetEvent;
|
||||
import chylex.hee.entity.boss.dragon.attacks.special.event.TargetSetEvent;
|
||||
import chylex.hee.entity.boss.dragon.managers.DragonShotManager.ShotType;
|
||||
import chylex.hee.mechanics.knowledge.KnowledgeRegistrations;
|
||||
import chylex.hee.mechanics.knowledge.util.ObservationUtil;
|
||||
|
||||
public class DragonAttackFreezer extends DragonSpecialAttackBase{
|
||||
private EntityLivingBase target;
|
||||
@@ -33,13 +30,12 @@ public class DragonAttackFreezer extends DragonSpecialAttackBase{
|
||||
else if (phase == 1){
|
||||
if (target == null)target = dragon.attacks.getWeakPlayer();
|
||||
if (target != null){
|
||||
if (shootTimer++>16){
|
||||
if (shootTimer++ > 16){
|
||||
dragon.initShot().setType(ShotType.FREEZEBALL).setTarget(target).shoot();
|
||||
shootTimer = 0;
|
||||
for(EntityPlayer observer:ObservationUtil.getAllObservers(dragon,250D))KnowledgeRegistrations.ENDER_DRAGON.tryUnlockFragment(observer,0.3F,new byte[]{ 7,12 });
|
||||
}
|
||||
double dist = target.getDistanceSqToEntity(dragon.dragonPartHead);
|
||||
if (dist < 105D)phase = 2;
|
||||
|
||||
if (target.getDistanceSqToEntity(dragon.dragonPartHead) < 105D)phase = 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,10 @@
|
||||
package chylex.hee.entity.boss.dragon.attacks.special;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import chylex.hee.entity.boss.EntityBossDragon;
|
||||
import chylex.hee.entity.boss.dragon.attacks.special.event.CollisionEvent;
|
||||
import chylex.hee.entity.boss.dragon.attacks.special.event.TargetPositionSetEvent;
|
||||
import chylex.hee.entity.boss.dragon.attacks.special.event.TargetSetEvent;
|
||||
import chylex.hee.mechanics.knowledge.KnowledgeRegistrations;
|
||||
import chylex.hee.mechanics.knowledge.util.ObservationUtil;
|
||||
import chylex.hee.system.util.MathUtil;
|
||||
|
||||
public class DragonAttackPunch extends DragonSpecialAttackBase{
|
||||
@@ -53,12 +50,9 @@ public class DragonAttackPunch extends DragonSpecialAttackBase{
|
||||
if (target != null){
|
||||
if (tick > 20)speed = 4F;
|
||||
|
||||
double dist = dragon.dragonPartHead.getDistanceSqToEntity(tempTarget);
|
||||
if (dist < 35D){
|
||||
if (dragon.dragonPartHead.getDistanceSqToEntity(tempTarget) < 35D){
|
||||
target.attackEntityFrom(DamageSource.causeMobDamage(dragon),2+dragon.getWorldDifficulty());
|
||||
ended = true;
|
||||
|
||||
for(EntityPlayer observer:ObservationUtil.getAllObservers(dragon,100D))KnowledgeRegistrations.ENDER_DRAGON.tryUnlockFragment(observer,0.3F,new byte[]{ 7,11 });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-8
@@ -1,13 +1,10 @@
|
||||
package chylex.hee.entity.boss.dragon.attacks.special;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import chylex.hee.entity.boss.EntityBossDragon;
|
||||
import chylex.hee.entity.boss.dragon.attacks.special.event.MotionUpdateEvent;
|
||||
import chylex.hee.entity.boss.dragon.attacks.special.event.TargetPositionSetEvent;
|
||||
import chylex.hee.entity.boss.dragon.attacks.special.event.TargetSetEvent;
|
||||
import chylex.hee.entity.boss.dragon.managers.DragonShotManager.ShotType;
|
||||
import chylex.hee.mechanics.knowledge.KnowledgeRegistrations;
|
||||
import chylex.hee.mechanics.knowledge.util.ObservationUtil;
|
||||
import chylex.hee.proxy.ModCommonProxy;
|
||||
|
||||
public class DragonAttackStaynfire extends DragonSpecialAttackBase{
|
||||
@@ -44,11 +41,7 @@ public class DragonAttackStaynfire extends DragonSpecialAttackBase{
|
||||
if (tick > 29-(dragon.getWorldDifficulty()*2)-(ModCommonProxy.opMobs?5:0)){
|
||||
tick = 0;
|
||||
dragon.initShot().setType(ShotType.FIREBALL).setTarget(target).shoot();
|
||||
if (shootTimer++>rand.nextInt(15)+26-damageTaken*2 || (shootTimer > 25 && rand.nextInt(5) == 0) || damageTaken > 13)ended = true;
|
||||
|
||||
if (rand.nextBoolean() && rand.nextBoolean()){
|
||||
for(EntityPlayer observer:ObservationUtil.getAllObservers(dragon,250D))KnowledgeRegistrations.ENDER_DRAGON.tryUnlockFragment(observer,0.16F,new byte[]{ 7,9 });
|
||||
}
|
||||
if (shootTimer++ > rand.nextInt(15)+26-damageTaken*2 || (shootTimer > 25 && rand.nextInt(5) == 0) || damageTaken > 13)ended = true;
|
||||
}
|
||||
|
||||
dragon.targetX = target.posX;
|
||||
|
||||
@@ -10,8 +10,6 @@ import chylex.hee.entity.boss.dragon.attacks.special.event.TargetPositionSetEven
|
||||
import chylex.hee.entity.boss.dragon.attacks.special.event.TargetSetEvent;
|
||||
import chylex.hee.entity.mob.EntityMobAngryEnderman;
|
||||
import chylex.hee.entity.weather.EntityWeatherLightningBoltSafe;
|
||||
import chylex.hee.mechanics.knowledge.KnowledgeRegistrations;
|
||||
import chylex.hee.mechanics.knowledge.util.ObservationUtil;
|
||||
import chylex.hee.system.util.DragonUtil;
|
||||
|
||||
public class DragonAttackSummon extends DragonSpecialAttackBase{
|
||||
@@ -59,7 +57,7 @@ public class DragonAttackSummon extends DragonSpecialAttackBase{
|
||||
}
|
||||
else if (phase == 2){
|
||||
if (summonTimer-- < 0){
|
||||
int rageDiff = dragon.getWorldDifficulty(),amount = 0;
|
||||
int rageDiff = dragon.getWorldDifficulty(), amount = 0;
|
||||
summonTimer = 114-rageDiff*8;
|
||||
if ((rageDiff > 2 && rand.nextInt(4) == 0) || (rageDiff > 1 && rand.nextInt(6) == 0))amount = 1;
|
||||
|
||||
@@ -77,11 +75,7 @@ public class DragonAttackSummon extends DragonSpecialAttackBase{
|
||||
dragon.worldObj.spawnEntityInWorld(buddy);
|
||||
}
|
||||
|
||||
summoned++;
|
||||
|
||||
if (rand.nextBoolean()){
|
||||
for(EntityPlayer observer:ObservationUtil.getAllObservers(dragon,250D))KnowledgeRegistrations.ENDER_DRAGON.tryUnlockFragment(observer,0.41F,new byte[]{ 7,13 });
|
||||
}
|
||||
++summoned;
|
||||
}
|
||||
if ((summoned > 4 && rand.nextInt(12)+6 < damageTaken) || summoned > 13)ended = true;
|
||||
}
|
||||
|
||||
@@ -16,7 +16,6 @@ import net.minecraft.util.DamageSource;
|
||||
import chylex.hee.entity.boss.EntityBossDragon;
|
||||
import chylex.hee.entity.boss.dragon.attacks.passive.DragonPassiveAttackBase;
|
||||
import chylex.hee.entity.boss.dragon.attacks.special.DragonSpecialAttackBase;
|
||||
import chylex.hee.mechanics.knowledge.KnowledgeRegistrations;
|
||||
import chylex.hee.proxy.ModCommonProxy;
|
||||
import chylex.hee.system.util.DragonUtil;
|
||||
import chylex.hee.system.weight.ObjectWeightPair;
|
||||
@@ -93,8 +92,6 @@ public class DragonAttackManager{
|
||||
}
|
||||
}
|
||||
|
||||
KnowledgeRegistrations.ENDER_DRAGON.tryUnlockFragment(player,0.1F,new byte[]{ 0,3 });
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -16,8 +16,6 @@ import chylex.hee.HardcoreEnderExpansion;
|
||||
import chylex.hee.block.BlockDungeonPuzzle;
|
||||
import chylex.hee.block.BlockList;
|
||||
import chylex.hee.entity.fx.FXType;
|
||||
import chylex.hee.mechanics.knowledge.KnowledgeRegistrations;
|
||||
import chylex.hee.mechanics.knowledge.util.ObservationUtil;
|
||||
import chylex.hee.packets.PacketPipeline;
|
||||
import chylex.hee.packets.client.C20Effect;
|
||||
|
||||
@@ -125,10 +123,6 @@ public class EntityItemIgneousRock extends EntityItem{
|
||||
}
|
||||
}
|
||||
|
||||
if (!worldObj.isRemote && ticksExisted%65 == 0){
|
||||
for(EntityPlayer observer:ObservationUtil.getAllObservers(this,16D))KnowledgeRegistrations.IGNEOUS_ROCK.tryUnlockFragment(observer,0.15F);
|
||||
}
|
||||
|
||||
if (rand.nextInt(30) == 0){
|
||||
for(int a = 0; a < 2; a++)worldObj.spawnParticle("lava",posX+0.2F*(rand.nextFloat()-0.5F),posY+0.2F*(rand.nextFloat()-0.5F),posZ+0.2F*(rand.nextFloat()-0.5F),0D,0D,0D);
|
||||
}
|
||||
|
||||
@@ -3,15 +3,12 @@ import java.util.Iterator;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.item.EntityTNTPrimed;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.world.World;
|
||||
import chylex.hee.HardcoreEnderExpansion;
|
||||
import chylex.hee.entity.fx.FXType;
|
||||
import chylex.hee.mechanics.knowledge.KnowledgeRegistrations;
|
||||
import chylex.hee.mechanics.knowledge.util.ObservationUtil;
|
||||
import chylex.hee.mechanics.orb.OrbAcquirableItems;
|
||||
import chylex.hee.mechanics.orb.OrbSpawnableMobs;
|
||||
import chylex.hee.mechanics.orb.WeightedItem;
|
||||
@@ -54,21 +51,11 @@ public class EntityItemInstabilityOrb extends EntityItem{
|
||||
EntityTNTPrimed tnt = (EntityTNTPrimed)o;
|
||||
|
||||
if (tnt.fuse < 6 && getDistance(tnt.posX,tnt.posY,tnt.posZ)/4D <= 1D){ // 4 = strength of TNT
|
||||
isTntNearby = true;
|
||||
|
||||
for(EntityPlayer observer:ObservationUtil.getAllObservers(this,16D)){
|
||||
KnowledgeRegistrations.INSTABILITY_ORB.tryUnlockFragment(observer,0.6F,new byte[]{ 5 });
|
||||
}
|
||||
|
||||
isTntNearby = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (ticksExisted%90 == 0){
|
||||
EntityPlayer observer = ObservationUtil.getRandomObserver(this,16D);
|
||||
if (observer != null)KnowledgeRegistrations.INSTABILITY_ORB.tryUnlockFragment(observer,0.12F);
|
||||
}
|
||||
}
|
||||
else{
|
||||
int chance = age/17-7;
|
||||
@@ -117,8 +104,6 @@ public class EntityItemInstabilityOrb extends EntityItem{
|
||||
PacketPipeline.sendToAllAround(this,64D,new C21EffectEntity(FXType.Entity.ORB_TRANSFORMATION,posX,posY,posZ,0.25F,0.4F));
|
||||
}
|
||||
|
||||
for(EntityPlayer observer:ObservationUtil.getAllObservers(this,16D))KnowledgeRegistrations.INSTABILITY_ORB.tryUnlockFragment(observer,0.35F);
|
||||
|
||||
setDead();
|
||||
}
|
||||
|
||||
|
||||
@@ -15,8 +15,6 @@ import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
import chylex.hee.mechanics.knowledge.KnowledgeRegistrations;
|
||||
import chylex.hee.mechanics.knowledge.util.ObservationUtil;
|
||||
import chylex.hee.proxy.ModCommonProxy;
|
||||
|
||||
public class EntityMobAngryEnderman extends EntityMob{
|
||||
@@ -197,13 +195,7 @@ public class EntityMobAngryEnderman extends EntityMob{
|
||||
Item item = getDropItem();
|
||||
|
||||
if (item != null){
|
||||
int amount = rand.nextInt(2+looting);
|
||||
|
||||
for(int a = 0; a < amount; ++a){
|
||||
dropItem(item,1);
|
||||
}
|
||||
|
||||
for(EntityPlayer observer:ObservationUtil.getAllObservers(this,8D))KnowledgeRegistrations.ANGRY_ENDERMAN.tryUnlockFragment(observer,0.06F);
|
||||
for(int a = 0, amount = rand.nextInt(2+looting); a < amount; a++)dropItem(item,1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -222,25 +214,9 @@ public class EntityMobAngryEnderman extends EntityMob{
|
||||
|
||||
return false;
|
||||
}
|
||||
else{
|
||||
if (super.attackEntityFrom(source,damage)){
|
||||
if (source.getEntity() instanceof EntityPlayer)KnowledgeRegistrations.ANGRY_ENDERMAN.tryUnlockFragment((EntityPlayer)source.getEntity(),0.04F);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
else return super.attackEntityFrom(source,damage);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean attackEntityAsMob(Entity target){
|
||||
if (super.attackEntityAsMob(target)){
|
||||
if (target instanceof EntityPlayer)KnowledgeRegistrations.ANGRY_ENDERMAN.tryUnlockFragment((EntityPlayer)target,0.06F);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean isScreaming(){
|
||||
return dataWatcher.getWatchableObjectByte(18) > 0;
|
||||
|
||||
@@ -36,8 +36,6 @@ import net.minecraftforge.common.util.Constants;
|
||||
import chylex.hee.block.BlockCrossedDecoration;
|
||||
import chylex.hee.block.BlockList;
|
||||
import chylex.hee.item.ItemList;
|
||||
import chylex.hee.mechanics.knowledge.KnowledgeRegistrations;
|
||||
import chylex.hee.mechanics.knowledge.util.ObservationUtil;
|
||||
import chylex.hee.packets.PacketPipeline;
|
||||
import chylex.hee.packets.client.C00ClearInventorySlot;
|
||||
import chylex.hee.proxy.ModCommonProxy;
|
||||
@@ -140,8 +138,6 @@ public class EntityMobBabyEnderman extends EntityMob{
|
||||
|
||||
setCarriedItemStack(is);
|
||||
item.setDead();
|
||||
|
||||
for(EntityPlayer observer:ObservationUtil.getAllObservers(this,8D))KnowledgeRegistrations.BABY_ENDERMAN.tryUnlockFragment(observer,0.6F);
|
||||
}
|
||||
|
||||
break;
|
||||
@@ -170,8 +166,6 @@ public class EntityMobBabyEnderman extends EntityMob{
|
||||
PacketPipeline.sendToPlayer(target,new C00ClearInventorySlot(slot));
|
||||
}
|
||||
|
||||
for(EntityPlayer observer:ObservationUtil.getAllObservers(this,6D))KnowledgeRegistrations.BABY_ENDERMAN.tryUnlockFragment(observer,0.5F);
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -225,8 +219,6 @@ public class EntityMobBabyEnderman extends EntityMob{
|
||||
}
|
||||
|
||||
isFamilyChosen = isScared = true;
|
||||
|
||||
for(EntityPlayer observer:ObservationUtil.getAllObservers(this,8D))KnowledgeRegistrations.BABY_ENDERMAN.tryUnlockFragment(observer,0.5F);
|
||||
}
|
||||
|
||||
entityToAttack = null;
|
||||
|
||||
@@ -18,8 +18,6 @@ import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.World;
|
||||
import chylex.hee.HardcoreEnderExpansion;
|
||||
import chylex.hee.item.ItemList;
|
||||
import chylex.hee.mechanics.knowledge.KnowledgeRegistrations;
|
||||
import chylex.hee.mechanics.knowledge.util.ObservationUtil;
|
||||
import chylex.hee.system.ReflectionPublicizer;
|
||||
import chylex.hee.system.util.MathUtil;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
@@ -84,8 +82,6 @@ public class EntityMobCorporealMirage extends EntityLiving implements IEntityOwn
|
||||
e.setAttackTarget(this);
|
||||
e.attackEntityFrom(DamageSource.causeMobDamage(this),0F);
|
||||
faceEntity(e,360F,360F);
|
||||
|
||||
for(EntityPlayer observer:ObservationUtil.getAllObservers(this,12D))KnowledgeRegistrations.CORPOREAL_MIRAGE_ORB.tryUnlockFragment(observer,0.1F);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -96,8 +92,6 @@ public class EntityMobCorporealMirage extends EntityLiving implements IEntityOwn
|
||||
if (target instanceof EntityPlayer && ((EntityPlayer)target).getCommandSenderName().equals(name)){
|
||||
ReflectionPublicizer.set(ReflectionPublicizer.entityGhastTarget,e,this);
|
||||
faceEntity(e,360F,360F);
|
||||
|
||||
for(EntityPlayer observer:ObservationUtil.getAllObservers(this,12D))KnowledgeRegistrations.CORPOREAL_MIRAGE_ORB.tryUnlockFragment(observer,0.1F);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -126,14 +120,8 @@ public class EntityMobCorporealMirage extends EntityLiving implements IEntityOwn
|
||||
|
||||
@Override
|
||||
public boolean attackEntityFrom(DamageSource source, float amount){
|
||||
if (source == DamageSource.drown || source == DamageSource.fallingBlock||
|
||||
source == DamageSource.inWall)return false;
|
||||
|
||||
if (super.attackEntityFrom(source,MathUtil.floatEquals(amount,-1F) ? 1F : 2F)){
|
||||
for(EntityPlayer observer:ObservationUtil.getAllObservers(this,12D))KnowledgeRegistrations.CORPOREAL_MIRAGE_ORB.tryUnlockFragment(observer,0.15F);
|
||||
return true;
|
||||
}
|
||||
else return false;
|
||||
if (source == DamageSource.drown || source == DamageSource.fallingBlock|| source == DamageSource.inWall)return false;
|
||||
else return super.attackEntityFrom(source,MathUtil.floatEquals(amount,-1F) ? 1F : 2F);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -15,8 +15,6 @@ import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import chylex.hee.entity.fx.FXType;
|
||||
import chylex.hee.item.ItemList;
|
||||
import chylex.hee.mechanics.knowledge.KnowledgeRegistrations;
|
||||
import chylex.hee.mechanics.knowledge.util.ObservationUtil;
|
||||
import chylex.hee.packets.PacketPipeline;
|
||||
import chylex.hee.packets.client.C20Effect;
|
||||
import chylex.hee.proxy.ModCommonProxy;
|
||||
@@ -64,8 +62,6 @@ public class EntityMobEnderGuardian extends EntityMob{
|
||||
DragonUtil.createExplosion(this,entityToAttack.posX+(rand.nextDouble()-0.5D)*0.8D,entityToAttack.posY+0.1D,entityToAttack.posZ+(rand.nextDouble()-0.5D)*0.8D,1.1F+rand.nextFloat()*0.1F,false);
|
||||
attackPhase = 1;
|
||||
explosionTimer = 10;
|
||||
|
||||
for(EntityPlayer observer:ObservationUtil.getAllObservers(entityToAttack,12D))KnowledgeRegistrations.ENDER_GUARDIAN.tryUnlockFragment(observer,0.6F,new byte[]{ 0,1,2 });
|
||||
}
|
||||
else if (explosionTimer == 8)playSound("mob.endermen.portal",3.8F,3.4F+rand.nextFloat()*0.2F);
|
||||
|
||||
@@ -123,7 +119,6 @@ public class EntityMobEnderGuardian extends EntityMob{
|
||||
ItemStack is = player.inventory.getStackInSlot(a);
|
||||
if (is != null && is.getItem() == ItemList.enderman_relic){
|
||||
entityToAttack = player;
|
||||
KnowledgeRegistrations.ENDER_GUARDIAN.tryUnlockFragment(player,1F,new byte[]{ 1 });
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -142,8 +137,6 @@ public class EntityMobEnderGuardian extends EntityMob{
|
||||
|
||||
amount = 1+rand.nextInt(3+(looting>>1));
|
||||
for(int a = 0; a < amount; a++)dropItem(Item.getItemFromBlock(Blocks.obsidian),1);
|
||||
|
||||
for(EntityPlayer observer:ObservationUtil.getAllObservers(this,8D))KnowledgeRegistrations.ENDER_GUARDIAN.tryUnlockFragment(observer,0.42F,new byte[]{ 3,4 });
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -18,8 +18,6 @@ import chylex.hee.HardcoreEnderExpansion;
|
||||
import chylex.hee.entity.projectile.EntityProjectileGolemFireball;
|
||||
import chylex.hee.item.ItemList;
|
||||
import chylex.hee.mechanics.essence.EssenceType;
|
||||
import chylex.hee.mechanics.knowledge.KnowledgeRegistrations;
|
||||
import chylex.hee.mechanics.knowledge.util.ObservationUtil;
|
||||
import chylex.hee.packets.PacketPipeline;
|
||||
import chylex.hee.packets.client.C08PlaySound;
|
||||
import chylex.hee.proxy.ModCommonProxy;
|
||||
@@ -102,8 +100,6 @@ public class EntityMobFireGolem extends EntityMob{
|
||||
);
|
||||
|
||||
PacketPipeline.sendToAllAround(this,64D,new C08PlaySound(C08PlaySound.SPAWN_FIREBALL,posX,posY,posZ,1.5F,0.85F+rand.nextFloat()*0.1F));
|
||||
|
||||
for(EntityPlayer observer:ObservationUtil.getAllObservers(this,12D))KnowledgeRegistrations.FIRE_GOLEM.tryUnlockFragment(observer,0.09F,new byte[]{ 0,1,2,3 });
|
||||
}
|
||||
|
||||
if (dataWatcher.getWatchableObjectByte(16) != flameParticleAmountNew)dataWatcher.updateObject(16,Byte.valueOf(flameParticleAmountNew));
|
||||
@@ -151,10 +147,6 @@ public class EntityMobFireGolem extends EntityMob{
|
||||
playSound("mob.endermen.portal",1.0F,1.1F);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (source.getEntity() instanceof EntityPlayer){
|
||||
KnowledgeRegistrations.FIRE_GOLEM.tryUnlockFragment((EntityPlayer)source.getEntity(),0.08F,new byte[]{ 0,1,2,3 });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -169,8 +161,6 @@ public class EntityMobFireGolem extends EntityMob{
|
||||
protected void dropFewItems(boolean recentlyHit, int looting){
|
||||
dropItem(Items.fire_charge,rand.nextInt(2));
|
||||
if (recentlyHit)entityDropItem(new ItemStack(ItemList.essence,rand.nextInt(4+looting)+1,EssenceType.FIERY.getItemDamage()),0F);
|
||||
|
||||
for(EntityPlayer observer:ObservationUtil.getAllObservers(this,6D))KnowledgeRegistrations.FIRE_GOLEM.tryUnlockFragment(observer,0.25F,new byte[]{ 4,5 });
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
package chylex.hee.entity.mob;
|
||||
import net.minecraft.entity.passive.EntityBat;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import chylex.hee.mechanics.knowledge.KnowledgeRegistrations;
|
||||
import chylex.hee.mechanics.knowledge.util.ObservationUtil;
|
||||
|
||||
public class EntityMobInfestedBat extends EntityBat{
|
||||
public EntityMobInfestedBat(World world){
|
||||
@@ -18,15 +15,6 @@ public class EntityMobInfestedBat extends EntityBat{
|
||||
dataWatcher.addObject(17,0.35F+rand.nextFloat()*0.35F);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void dropFewItems(boolean recentlyHit, int looting){
|
||||
for(EntityPlayer observer:ObservationUtil.getAllObservers(this,8D)){
|
||||
if (KnowledgeRegistrations.INFESTED_BAT.tryUnlockFragment(observer,0.3F,new byte[]{ 0,1 }).stopTrying)continue;
|
||||
if (rand.nextInt(3) == 0)KnowledgeRegistrations.ENHANCED_BREWING_STAND.tryUnlockFragment(observer,0.3F,new byte[]{ 4 });
|
||||
else KnowledgeRegistrations.INFESTATION_REMEDY.tryUnlockFragment(observer,0.4F);
|
||||
}
|
||||
}
|
||||
|
||||
public float getScale(){
|
||||
return dataWatcher.getWatchableObjectFloat(17);
|
||||
}
|
||||
|
||||
@@ -7,8 +7,6 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import chylex.hee.mechanics.knowledge.KnowledgeRegistrations;
|
||||
import chylex.hee.mechanics.knowledge.util.ObservationUtil;
|
||||
|
||||
public class EntityMobParalyzedEnderman extends EntityEnderman{
|
||||
private byte newTargetTimer = 0;
|
||||
@@ -34,9 +32,6 @@ public class EntityMobParalyzedEnderman extends EntityEnderman{
|
||||
if (!nearby.isEmpty()){
|
||||
entityToAttack = nearby.get(rand.nextInt(nearby.size()));
|
||||
if (!canEntityBeSeen(entityToAttack))entityToAttack = null;
|
||||
else{
|
||||
for(EntityPlayer observer:ObservationUtil.getAllObservers(this,8D))KnowledgeRegistrations.PARALYZED_ENDERMAN.tryUnlockFragment(observer,0.3F,new byte[]{ 0,2 });
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -52,8 +47,6 @@ public class EntityMobParalyzedEnderman extends EntityEnderman{
|
||||
worldObj.spawnEntityInWorld(enderman);
|
||||
setDead();
|
||||
}
|
||||
|
||||
for(EntityPlayer observer:ObservationUtil.getAllObservers(this,7D))KnowledgeRegistrations.PARALYZED_ENDERMAN.tryUnlockFragment(observer,0.45F,new byte[]{ 0,3 });
|
||||
}
|
||||
|
||||
super.onLivingUpdate();
|
||||
@@ -62,8 +55,6 @@ public class EntityMobParalyzedEnderman extends EntityEnderman{
|
||||
@Override
|
||||
protected void dropFewItems(boolean recentlyHit, int looting){
|
||||
if (rand.nextInt(3) == 0)dropItem(getDropItem(),1);
|
||||
|
||||
for(EntityPlayer observer:ObservationUtil.getAllObservers(this,6D))KnowledgeRegistrations.PARALYZED_ENDERMAN.tryUnlockFragment(observer,0.18F,new byte[]{ 0,1 });
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -12,8 +12,6 @@ import net.minecraft.world.World;
|
||||
import chylex.hee.entity.projectile.EntityProjectileFlamingBall;
|
||||
import chylex.hee.item.ItemList;
|
||||
import chylex.hee.mechanics.essence.EssenceType;
|
||||
import chylex.hee.mechanics.knowledge.KnowledgeRegistrations;
|
||||
import chylex.hee.mechanics.knowledge.util.ObservationUtil;
|
||||
import chylex.hee.proxy.ModCommonProxy;
|
||||
|
||||
public class EntityMobScorchingLens extends EntityMob{
|
||||
@@ -49,10 +47,6 @@ public class EntityMobScorchingLens extends EntityMob{
|
||||
worldObj,this,posX+look.xCoord,posY+look.yCoord+0.5D,posZ+look.zCoord,
|
||||
entityToAttack.posX-posX,entityToAttack.posY-posY+rand.nextDouble()*0.4D,entityToAttack.posZ-posZ
|
||||
));
|
||||
|
||||
if (rand.nextInt(8) == 0){
|
||||
for(EntityPlayer observer:ObservationUtil.getAllObservers(this,6D))KnowledgeRegistrations.SCORCHING_LENS.tryUnlockFragment(observer,0.2F,new byte[]{ 0,1,2 });
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -75,8 +69,6 @@ public class EntityMobScorchingLens extends EntityMob{
|
||||
protected void dropFewItems(boolean recentlyHit, int looting){
|
||||
dropItem(ItemList.igneous_rock,rand.nextInt(2)+rand.nextInt(2));
|
||||
if (recentlyHit)entityDropItem(new ItemStack(ItemList.essence,rand.nextInt(5+looting),EssenceType.FIERY.getItemDamage()),0F);
|
||||
|
||||
for(EntityPlayer observer:ObservationUtil.getAllObservers(this,6D))KnowledgeRegistrations.SCORCHING_LENS.tryUnlockFragment(observer,0.25F,new byte[]{ 3,4 });
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -9,8 +9,6 @@ import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import chylex.hee.entity.boss.EntityBossDragon;
|
||||
import chylex.hee.entity.weather.EntityWeatherLightningBoltSafe;
|
||||
import chylex.hee.mechanics.knowledge.KnowledgeRegistrations;
|
||||
import chylex.hee.mechanics.knowledge.util.ObservationUtil;
|
||||
import chylex.hee.proxy.ModCommonProxy;
|
||||
|
||||
public class EntityMobVampiricBat extends EntityBat{
|
||||
@@ -72,10 +70,7 @@ public class EntityMobVampiricBat extends EntityBat{
|
||||
if (entity instanceof EntityPlayer){
|
||||
if (!worldObj.isRemote){
|
||||
EntityPlayer player = (EntityPlayer)entity;
|
||||
player.attackEntityFrom(DamageSource.causeMobDamage(this),ModCommonProxy.opMobs?4F:2F);
|
||||
|
||||
KnowledgeRegistrations.VAMPIRIC_BAT.tryUnlockFragment(player,0.65F);
|
||||
for(EntityPlayer observer:ObservationUtil.getAllObservers(player,10D))KnowledgeRegistrations.VAMPIRIC_BAT.tryUnlockFragment(observer,0.25F);
|
||||
player.attackEntityFrom(DamageSource.causeMobDamage(this),ModCommonProxy.opMobs ? 4F : 2F);
|
||||
|
||||
for(Object o:worldObj.loadedEntityList){
|
||||
if (o instanceof EntityBossDragon){
|
||||
@@ -98,15 +93,13 @@ public class EntityMobVampiricBat extends EntityBat{
|
||||
|
||||
@Override
|
||||
public boolean attackEntityFrom(DamageSource source, float amount){
|
||||
if (!worldObj.isRemote){
|
||||
for(EntityPlayer observer:ObservationUtil.getAllObservers(this,10D))KnowledgeRegistrations.VAMPIRIC_BAT.tryUnlockFragment(observer,0.14F);
|
||||
setDead();
|
||||
}
|
||||
if (!worldObj.isRemote)setDead();
|
||||
|
||||
for(int a = 0; a < 6; a++){
|
||||
worldObj.spawnParticle("largesmoke",posX,posY+0.4D,posZ,0D,0D,0D);
|
||||
worldObj.spawnParticle("smoke",posX,posY+0.4D,posZ,0D,0D,0D);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package chylex.hee.entity.projectile;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.projectile.EntityPotion;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
@@ -8,7 +7,6 @@ import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
import chylex.hee.item.ItemList;
|
||||
import chylex.hee.item.ItemPotionOfInstability;
|
||||
import chylex.hee.mechanics.knowledge.KnowledgeRegistrations;
|
||||
|
||||
public class EntityProjectilePotionOfInstability extends EntityPotion{
|
||||
public EntityProjectilePotionOfInstability(World world){
|
||||
@@ -29,10 +27,8 @@ public class EntityProjectilePotionOfInstability extends EntityPotion{
|
||||
if (dist < 16D){
|
||||
PotionEffect eff = ItemPotionOfInstability.getRandomPotionEffect(rand);
|
||||
int dur = (int)(((entity == mop.entityHit?1D:(1D-Math.sqrt(dist)/4D)))*eff.getDuration()+0.5D);
|
||||
if (dur > 20){
|
||||
entity.addPotionEffect(new PotionEffect(eff.getPotionID(),dur,eff.getAmplifier(),eff.getIsAmbient()));
|
||||
if (entity instanceof EntityPlayer)KnowledgeRegistrations.INSTABILITY_POTION.tryUnlockFragment((EntityPlayer)entity,0.38F);
|
||||
}
|
||||
|
||||
if (dur > 20)entity.addPotionEffect(new PotionEffect(eff.getPotionID(),dur,eff.getAmplifier(),eff.getIsAmbient()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ class GuiButtonPageArrow extends GuiButton{
|
||||
public void drawButton(Minecraft mc, int mouseX, int mouseY){
|
||||
if (visible){
|
||||
GL11.glColor4f(1F,1F,1F,1F);
|
||||
mc.getTextureManager().bindTexture(GuiKnowledgeBook.texPage);
|
||||
mc.getTextureManager().bindTexture(GuiEnderCompendium.texPage);
|
||||
drawTexturedModalRect(xPosition,yPosition,mouseX >= xPosition && mouseY >= yPosition && mouseX < xPosition+width && mouseY < yPosition+height?23:0,231+(!isRightArrow?13:0),23,13);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,7 +25,6 @@ public class GuiItemViewer extends GuiScreen{
|
||||
private int yStart;
|
||||
|
||||
public GuiItemViewer(){
|
||||
super();
|
||||
mc = Minecraft.getMinecraft();
|
||||
prevGuiScale = mc.gameSettings.guiScale;
|
||||
mc.gameSettings.guiScale = 1;
|
||||
|
||||
@@ -1,548 +0,0 @@
|
||||
package chylex.hee.gui;
|
||||
import gnu.trove.stack.array.TShortArrayStack;
|
||||
import java.nio.FloatBuffer;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Random;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.client.renderer.GLAllocation;
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.entity.RenderItem;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.lwjgl.input.Mouse;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
import chylex.hee.gui.helpers.GuiItemRenderHelper;
|
||||
import chylex.hee.gui.helpers.GuiItemRenderHelper.ITooltipRenderer;
|
||||
import chylex.hee.mechanics.knowledge.KnowledgeRegistrations;
|
||||
import chylex.hee.mechanics.knowledge.data.KnowledgeCategory;
|
||||
import chylex.hee.mechanics.knowledge.data.KnowledgeRegistration;
|
||||
import chylex.hee.mechanics.knowledge.fragment.KnowledgeFragment;
|
||||
import chylex.hee.mechanics.knowledge.fragment.TextKnowledgeFragment;
|
||||
import chylex.hee.mechanics.knowledge.util.IGuiItemStackRenderer;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class GuiKnowledgeBook extends GuiScreen implements ITooltipRenderer{
|
||||
public static final int guiWidth = 256, guiHeight = 256, guiTopOffset = -14;
|
||||
public static final int guiPageTexWidth = 152, guiPageTexHeight = 226;
|
||||
public static final int guiPageWidth = 126, guiPageHeight = 176, guiLeft = 18, guiTop = 20;
|
||||
|
||||
public static int mouseX,mouseY;
|
||||
|
||||
public static final ResourceLocation texPage = new ResourceLocation("hardcoreenderexpansion:textures/gui/knowledge_book.png");
|
||||
private static final ResourceLocation texBack = new ResourceLocation("hardcoreenderexpansion:textures/gui/knowledge_book_back.png");
|
||||
private static final ResourceLocation texPortalSky = new ResourceLocation("textures/environment/end_sky.png");
|
||||
private static final ResourceLocation texPortal = new ResourceLocation("textures/entity/end_portal.png");
|
||||
private static final Random consistentRandom = new Random(31100L);
|
||||
public static final RenderItem renderItem = new RenderItem();
|
||||
|
||||
private final FloatBuffer floatBuffer = GLAllocation.createDirectFloatBuffer(16);
|
||||
|
||||
private final ItemStack bookItemStack;
|
||||
private float offsetX, offsetY;
|
||||
private float prevOffsetX, prevOffsetY;
|
||||
private float startOffsetX, startOffsetY;
|
||||
private float targetOffsetX, targetOffsetY;
|
||||
private float time;
|
||||
|
||||
private KnowledgeCategory highlightedCategory;
|
||||
private KnowledgeRegistration highlightedRegistration;
|
||||
private Map<KnowledgeFragment,Boolean> activeFragments = new LinkedHashMap<>();
|
||||
private short pageIndex;
|
||||
private TShortArrayStack pageIndexPrev = new TShortArrayStack();
|
||||
private GuiButton[] pageArrows = new GuiButton[2];
|
||||
private GuiButton helpButton;
|
||||
|
||||
public GuiKnowledgeBook(ItemStack bookItemStack){
|
||||
this.bookItemStack = bookItemStack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initGui(){
|
||||
int pageLeft = (width-guiPageTexWidth)>>1,top = ((height-guiHeight)>>1)+guiTopOffset;
|
||||
|
||||
buttonList.add(new GuiButton(0,(width>>1)-100,top+guiHeight+20,98,20,I18n.format("gui.back")));
|
||||
buttonList.add(new GuiButton(4,(width>>1)+2,top+guiHeight+20,98,20,I18n.format("gui.done")));
|
||||
buttonList.add(pageArrows[0] = new GuiButtonPageArrow(1,pageLeft+18,top+guiPageTexHeight-18,false));
|
||||
buttonList.add(pageArrows[1] = new GuiButtonPageArrow(2,pageLeft+guiPageTexWidth-23-18,top+guiPageTexHeight-18,true));
|
||||
buttonList.add(helpButton = new GuiButton(3,(width>>1)-10,(height>>1)-10+guiTopOffset,20,20,"?"));
|
||||
for(int a = 0; a < 2; a++)pageArrows[a].visible = false;
|
||||
helpButton.visible = false;
|
||||
|
||||
if (bookItemStack.stackTagCompound != null && bookItemStack.stackTagCompound.hasKey("knowledgeLast")){
|
||||
NBTTagCompound tag = bookItemStack.stackTagCompound.getCompoundTag("knowledgeLast");
|
||||
String catName = tag.getString("cat"),regName = tag.getString("reg");
|
||||
byte fid = tag.getByte("fid");
|
||||
|
||||
for(KnowledgeCategory category:KnowledgeCategory.categories){
|
||||
if (category.identifier.equals(catName)){
|
||||
for(KnowledgeRegistration registration:category.registrations){
|
||||
if (registration.identifier.equals(regName)){
|
||||
highlightedCategory = category;
|
||||
prevOffsetX = offsetX = targetOffsetX = -category.getTargetOffsetX();
|
||||
prevOffsetY = offsetY = targetOffsetY = -category.getTargetOffsetY();
|
||||
openRegistration(registration);
|
||||
|
||||
int index = 0, yy = 0, fragmentHeight;
|
||||
top = guiTop+((height-guiPageTexHeight)>>1);
|
||||
|
||||
for(Entry<KnowledgeFragment,Boolean> entry:activeFragments.entrySet()){
|
||||
if (top+yy+(fragmentHeight = entry.getKey().getHeight(mc,entry.getValue())+10) > top+guiPageHeight){
|
||||
pageIndexPrev.push(pageIndex);
|
||||
pageIndex = (short)index;
|
||||
top = guiTop+((height-guiPageTexHeight)>>1);
|
||||
break;
|
||||
}
|
||||
|
||||
++index;
|
||||
if (entry.getKey().id >= fid)break;
|
||||
yy += fragmentHeight;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
bookItemStack.stackTagCompound.removeTag("knowledgeLast");
|
||||
}
|
||||
else if (bookItemStack.stackTagCompound != null){
|
||||
MovingObjectPosition mop = mc.objectMouseOver;
|
||||
// TODO stuff
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void actionPerformed(GuiButton button){
|
||||
if (!(button.enabled && button.visible))return;
|
||||
|
||||
if (button.id == 0){
|
||||
if (highlightedRegistration != null)highlightedRegistration = null;
|
||||
else if (highlightedCategory != null){
|
||||
if ((targetOffsetX == 0 && targetOffsetY == 0) || (offsetX == targetOffsetX && offsetY == targetOffsetY)){
|
||||
targetOffsetX = targetOffsetY = 0;
|
||||
if (time > 0F && time < 0.5F)time = Math.min(time+0.3F,0.5F);
|
||||
}
|
||||
}
|
||||
else{
|
||||
mc.displayGuiScreen((GuiScreen)null);
|
||||
mc.setIngameFocus();
|
||||
}
|
||||
}
|
||||
else if (button.id == 4){
|
||||
mc.displayGuiScreen((GuiScreen)null);
|
||||
mc.setIngameFocus();
|
||||
}
|
||||
else if (button.id == 1)pageIndex = pageIndexPrev.size() == 0 ? 0 : pageIndexPrev.pop();
|
||||
else if (button.id == 2){
|
||||
pageIndexPrev.push(pageIndex);
|
||||
|
||||
int top = guiTop+((height-guiPageTexHeight)>>1)+guiTopOffset, yy = 0, index = 0, fragmentHeight;
|
||||
|
||||
for(Entry<KnowledgeFragment,Boolean> entry:activeFragments.entrySet()){
|
||||
if (++index < pageIndex)continue;
|
||||
|
||||
if (top+yy+(fragmentHeight = entry.getKey().getHeight(mc,entry.getValue())+10) > top+guiPageHeight)break;
|
||||
yy += fragmentHeight;
|
||||
}
|
||||
|
||||
pageIndex = (short)index;
|
||||
}
|
||||
else if (button.id == 3){
|
||||
highlightedRegistration = KnowledgeRegistrations.HELP;
|
||||
activeFragments.clear();
|
||||
for(KnowledgeFragment fragment:KnowledgeRegistrations.HELP.fragmentSet.getAllFragments()){
|
||||
activeFragments.put(fragment,true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void mouseClicked(int mouseX, int mouseY, int buttonId){
|
||||
if (buttonId == 1){
|
||||
actionPerformed((GuiButton)buttonList.get(0));
|
||||
}
|
||||
else if (!((GuiButton)buttonList.get(1)).mousePressed(mc,mouseX,mouseY) && highlightedRegistration != null){
|
||||
if (mouseX < ((width-guiPageTexWidth)>>1) || mouseX > ((width+guiPageTexWidth)>>1) || mouseY < ((height-guiPageTexHeight)>>1) || mouseY > ((height+guiPageTexHeight)>>1)){
|
||||
highlightedRegistration = null;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
super.mouseClicked(mouseX,mouseY,buttonId);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void keyTyped(char key, int keyCode){
|
||||
if (keyCode == 1){
|
||||
if (highlightedRegistration != null)highlightedRegistration = null;
|
||||
else if (highlightedCategory != null){
|
||||
if ((targetOffsetX == 0 && targetOffsetY == 0) || (offsetX == targetOffsetX && offsetY == targetOffsetY)){
|
||||
targetOffsetX = targetOffsetY = 0;
|
||||
if (time > 0F && time < 0.5F)time = Math.min(time+0.3F,0.5F);
|
||||
}
|
||||
}
|
||||
else{
|
||||
mc.displayGuiScreen(null);
|
||||
mc.setIngameFocus();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateScreen(){
|
||||
prevOffsetX = offsetX;
|
||||
prevOffsetY = offsetY;
|
||||
|
||||
if (offsetX != targetOffsetX || offsetY != targetOffsetY){
|
||||
if (time == 0){
|
||||
startOffsetX = offsetX;
|
||||
startOffsetY = offsetY;
|
||||
}
|
||||
|
||||
offsetX = cubicEase(time,startOffsetX,targetOffsetX-startOffsetX,0.65F);
|
||||
offsetY = cubicEase(time,startOffsetY,targetOffsetY-startOffsetY,0.65F);
|
||||
|
||||
if ((time += 0.05F) >= 0.65F){
|
||||
offsetX = targetOffsetX;
|
||||
offsetY = targetOffsetY;
|
||||
time = 0;
|
||||
|
||||
if (offsetX == 0 && offsetY == 0)highlightedCategory = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private float cubicEase(float time, float startValue, float step, float duration){
|
||||
if ((time /= duration/2F) < 1)return step/2F*time*time*time+startValue;
|
||||
time -= 2F;
|
||||
return step/2F*(time*time*time+2F)+startValue;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawScreen(int mouseX, int mouseY, float partialTickTime){
|
||||
drawDefaultBackground();
|
||||
GL11.glDepthFunc(GL11.GL_GEQUAL);
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef(0F,0F,-200F);
|
||||
renderPortalBackground(partialTickTime);
|
||||
GL11.glDepthFunc(GL11.GL_LEQUAL);
|
||||
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||
renderScreen(mouseX,mouseY,partialTickTime);
|
||||
GL11.glPopMatrix();
|
||||
GL11.glDepthFunc(GL11.GL_LEQUAL);
|
||||
GL11.glDisable(GL11.GL_DEPTH_TEST);
|
||||
super.drawScreen(mouseX,mouseY,partialTickTime);
|
||||
GL11.glEnable(GL11.GL_DEPTH_TEST);
|
||||
}
|
||||
|
||||
private void renderScreen(int mouseX, int mouseY, float partialTickTime){
|
||||
GL11.glPushMatrix();
|
||||
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
|
||||
GL11.glColor4f(1F,1F,1F,1F);
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
|
||||
GL11.glDisable(GL11.GL_DEPTH_TEST);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA,GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
mc.getTextureManager().bindTexture(texBack);
|
||||
int l = (width-guiWidth)>>1,t = ((height-guiHeight)>>1)+guiTopOffset;
|
||||
drawTexturedModalRect(l-16,t-16,0,0,24,24);
|
||||
drawTexturedModalRect(l+256-8,t-16,25,0,24,24);
|
||||
drawTexturedModalRect(l-16,t+256-8,0,25,24,24);
|
||||
drawTexturedModalRect(l+256-8,t+256-8,25,25,24,24);
|
||||
for(int a = 0; a < 2; a++){
|
||||
drawTexturedModalRect(l+8+120*a,t-16,50,0,120,24);
|
||||
drawTexturedModalRect(l+256-8,t+8+120*a,232,0,24,120);
|
||||
drawTexturedModalRect(l+8+120*a,t+256-8,50,25,120,24);
|
||||
drawTexturedModalRect(l-16,t+8+120*a,206,0,24,120);
|
||||
}
|
||||
GL11.glEnable(GL11.GL_DEPTH_TEST);
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef(prevOffsetX+(offsetX-prevOffsetX)*partialTickTime,prevOffsetY+(offsetY-prevOffsetY)*partialTickTime,0F);
|
||||
helpButton.visible = true;
|
||||
helpButton.xPosition = (width>>1)-10;
|
||||
helpButton.yPosition = (height>>1)-10+guiTopOffset;
|
||||
helpButton.drawButton(mc,mouseX,mouseY);
|
||||
if (helpButton.mousePressed(mc,mouseX,mouseY) && Mouse.isButtonDown(0) && highlightedRegistration == null && highlightedCategory == null){
|
||||
highlightedRegistration = KnowledgeRegistrations.HELP;
|
||||
activeFragments.clear();
|
||||
for(KnowledgeFragment fragment:KnowledgeRegistrations.HELP.fragmentSet.getAllFragments()){
|
||||
activeFragments.put(fragment,true);
|
||||
}
|
||||
}
|
||||
helpButton.visible = false;
|
||||
GL11.glPopMatrix();
|
||||
|
||||
RenderHelper.enableGUIStandardItemLighting();
|
||||
GL11.glColor4f(1F,1F,1F,1F);
|
||||
GL11.glTranslatef((width>>1)-11,(height>>1)-11,0F);
|
||||
GL11.glTranslatef(prevOffsetX+(offsetX-prevOffsetX)*partialTickTime,prevOffsetY+(offsetY-prevOffsetY)*partialTickTime,0F);
|
||||
|
||||
for(KnowledgeCategory category:KnowledgeCategory.categories)renderIcon(category);
|
||||
|
||||
if (highlightedCategory != null){
|
||||
for(KnowledgeRegistration registration:highlightedCategory.registrations){
|
||||
renderRegistration(registration);
|
||||
}
|
||||
}
|
||||
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
|
||||
GL11.glPopMatrix();
|
||||
|
||||
for(KnowledgeCategory category:KnowledgeCategory.categories){
|
||||
int cx = correctX((int)(category.getX()*1.5F),partialTickTime),cy = correctY((int)(category.getY()*1.5F),partialTickTime);
|
||||
|
||||
if (mouseX >= cx-18 && mouseX <= cx+19 && mouseY >= cy-18 && mouseY <= cy+18 && highlightedRegistration == null){
|
||||
GuiItemRenderHelper.drawTooltip(this,fontRendererObj,mouseX,mouseY,category.getTooltip());
|
||||
|
||||
if (Mouse.isButtonDown(0) && time == 0){
|
||||
targetOffsetX = -category.getTargetOffsetX();
|
||||
targetOffsetY = -category.getTargetOffsetY();
|
||||
highlightedCategory = category;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (highlightedCategory != null){
|
||||
for(KnowledgeRegistration registration:highlightedCategory.registrations){
|
||||
int cx = correctX(registration.getX(),partialTickTime),cy = correctY(registration.getY(),partialTickTime);
|
||||
|
||||
if (checkRegistrationHover(registration,mouseX,mouseY,cx,cy) && highlightedRegistration == null){
|
||||
GuiItemRenderHelper.drawTooltip(this,fontRendererObj,mouseX,mouseY,registration.getRenderer().getTooltip());
|
||||
|
||||
if (Mouse.isButtonDown(0) && time == 0)openRegistration(registration);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (highlightedRegistration != null){
|
||||
GL11.glPushMatrix();
|
||||
GL11.glColor4f(1F,1F,1F,1F);
|
||||
GL11.glDepthFunc(GL11.GL_LEQUAL);
|
||||
GL11.glDisable(GL11.GL_DEPTH_TEST);
|
||||
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA,GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
|
||||
mc.getTextureManager().bindTexture(texPage);
|
||||
int left = (width-guiPageTexWidth)>>1,top = ((height-guiPageTexHeight)>>1)+guiTopOffset;
|
||||
drawTexturedModalRect(left,top,0,0,guiPageTexWidth,guiPageTexHeight);
|
||||
|
||||
left += guiLeft;
|
||||
top += guiTop;
|
||||
|
||||
int index = 0,yy = 0;
|
||||
boolean hasNextPage = false;
|
||||
int fragmentHeight;
|
||||
|
||||
GuiKnowledgeBook.mouseX = mouseX;
|
||||
GuiKnowledgeBook.mouseY = mouseY;
|
||||
|
||||
for(Entry<KnowledgeFragment,Boolean> entry:activeFragments.entrySet()){
|
||||
if (++index < pageIndex)continue;
|
||||
|
||||
if (top+yy+(fragmentHeight = entry.getKey().getHeight(mc,entry.getValue())+10) > top+guiPageHeight){
|
||||
hasNextPage = true;
|
||||
break;
|
||||
}
|
||||
|
||||
entry.getKey().render(left,top+yy,mc,entry.getValue());
|
||||
yy += fragmentHeight;
|
||||
}
|
||||
|
||||
pageArrows[0].visible = pageIndex > 0;
|
||||
pageArrows[1].visible = hasNextPage;
|
||||
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glEnable(GL11.GL_DEPTH_TEST);
|
||||
GL11.glDepthFunc(GL11.GL_LEQUAL);
|
||||
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
else{
|
||||
for(int a = 0; a < 2; a++)pageArrows[a].visible = false;
|
||||
}
|
||||
}
|
||||
|
||||
private void openRegistration(KnowledgeRegistration registration){
|
||||
highlightedRegistration = registration;
|
||||
activeFragments.clear();
|
||||
|
||||
int[] unlocked = registration.fragmentSet.getUnlockedFragments(bookItemStack);
|
||||
for(KnowledgeFragment fragment:registration.fragmentSet.getAllFragments()){
|
||||
if (fragment.canShow(unlocked))activeFragments.put(fragment,ArrayUtils.contains(unlocked,fragment.id));
|
||||
}
|
||||
|
||||
if (activeFragments.isEmpty()){
|
||||
activeFragments.put(new TextKnowledgeFragment(-1).setLocalizedText("(no available knowledge)"),true);
|
||||
}
|
||||
|
||||
pageIndex = 0;
|
||||
pageIndexPrev.clear();
|
||||
}
|
||||
|
||||
private int correctX(int x, float partialTickTime){
|
||||
return (width>>1)+x+(int)(prevOffsetX+(offsetX-prevOffsetX)*partialTickTime);
|
||||
}
|
||||
|
||||
private int correctY(int y, float partialTickTime){
|
||||
return (height>>1)+y+(int)(prevOffsetY+(offsetX-prevOffsetX)*partialTickTime)+guiTopOffset;
|
||||
}
|
||||
|
||||
private void renderIcon(IGuiItemStackRenderer guiItemStackRenderer){
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
mc.getTextureManager().bindTexture(texBack);
|
||||
drawTexturedModalRect((int)((guiItemStackRenderer.getX()-5)*1.5F)-1,(int)((guiItemStackRenderer.getY()-6)*1.5F)+guiTopOffset,23,50,40,40);
|
||||
RenderHelper.enableGUIStandardItemLighting();
|
||||
GL11.glPushMatrix();
|
||||
GL11.glScalef(1.5F,1.5F,1F);
|
||||
renderItem.renderItemIntoGUI(mc.fontRenderer,mc.getTextureManager(),guiItemStackRenderer.getItemStack(),guiItemStackRenderer.getX(),(int)(guiItemStackRenderer.getY()-1+guiTopOffset/1.5));
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
private void renderRegistration(KnowledgeRegistration registration){
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
mc.getTextureManager().bindTexture(texBack);
|
||||
switch(registration.getBackgroundTextureIndex()){
|
||||
case 0: drawTexturedModalRect(registration.getX(),registration.getY()-3+guiTopOffset,0,50,22,22); break;
|
||||
case 1: drawTexturedModalRect(registration.getX(),registration.getY()-26+guiTopOffset,64,50,22,47); break;
|
||||
case 2: drawTexturedModalRect(registration.getX()-9,registration.getY()-22+guiTopOffset,87,50,40,49); break;
|
||||
case 3: drawTexturedModalRect(registration.getX()-85,registration.getY()-31+guiTopOffset,0,99,192,51); break;
|
||||
}
|
||||
RenderHelper.enableGUIStandardItemLighting();
|
||||
registration.getRenderer().render(mc,registration.getX()+3,registration.getY()+guiTopOffset);
|
||||
}
|
||||
|
||||
private boolean checkRegistrationHover(KnowledgeRegistration registration, int mouseX, int mouseY, int cx, int cy){
|
||||
switch(registration.getBackgroundTextureIndex()){
|
||||
case 0: return mouseX >= cx-10 && mouseX <= cx+10 && mouseY >= cy-14 && mouseY <= cy+8;
|
||||
case 1: return mouseX >= cx-10 && mouseX <= cx+10 && mouseY >= cy-35 && mouseY <= cy+10;
|
||||
case 2: return mouseX >= cx-18 && mouseX <= cx+16 && mouseY >= cy-32 && mouseY <= cy+14;
|
||||
case 3: return mouseX >= cx-96 && mouseX <= cx+94 && mouseY >= cy-40 && mouseY <= cy+10;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private void renderPortalBackground(float partialTickTime){
|
||||
int hw = width>>1,hh = height>>1;
|
||||
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
consistentRandom.setSeed(31100L);
|
||||
|
||||
for(int layer = 0; layer < 16; ++layer){
|
||||
GL11.glPushMatrix();
|
||||
|
||||
float revLayer = (16-layer), scale = 0.09625F, colorMultiplier = 1F/(revLayer+1F);
|
||||
|
||||
if (layer == 0){
|
||||
mc.getTextureManager().bindTexture(texPortalSky);
|
||||
colorMultiplier = 0.1F;
|
||||
revLayer = 15F;
|
||||
scale = 1.125F;
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA,GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
}
|
||||
|
||||
if (layer >= 1){
|
||||
mc.getTextureManager().bindTexture(texPortal);
|
||||
|
||||
if (layer == 1){
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_ONE,GL11.GL_ONE);
|
||||
scale = 0.2F;
|
||||
}
|
||||
}
|
||||
|
||||
// magic stuff
|
||||
GL11.glTranslatef(0,revLayer*1000,0);
|
||||
GL11.glRotatef(120F,1F,0F,1F);
|
||||
GL11.glTranslatef(0F,5500F,0F);
|
||||
GL11.glScalef(100F,100F,100F);
|
||||
// end of magic stuff
|
||||
GL11.glTexGeni(GL11.GL_S,GL11.GL_TEXTURE_GEN_MODE,GL11.GL_EYE_LINEAR);
|
||||
GL11.glTexGeni(GL11.GL_T,GL11.GL_TEXTURE_GEN_MODE,GL11.GL_EYE_LINEAR);
|
||||
GL11.glTexGeni(GL11.GL_R,GL11.GL_TEXTURE_GEN_MODE,GL11.GL_EYE_LINEAR);
|
||||
GL11.glTexGeni(GL11.GL_Q,GL11.GL_TEXTURE_GEN_MODE,GL11.GL_EYE_LINEAR);
|
||||
GL11.glTexGen(GL11.GL_S,GL11.GL_OBJECT_PLANE,insertIntoBufferAndFlip(1F,0F,0F,0F));
|
||||
GL11.glTexGen(GL11.GL_T,GL11.GL_OBJECT_PLANE,insertIntoBufferAndFlip(0F,0F,1F,0F));
|
||||
GL11.glTexGen(GL11.GL_R,GL11.GL_OBJECT_PLANE,insertIntoBufferAndFlip(0F,0F,0F,1F));
|
||||
GL11.glTexGen(GL11.GL_Q,GL11.GL_EYE_PLANE,insertIntoBufferAndFlip(0F,1F,0F,0F));
|
||||
GL11.glEnable(GL11.GL_TEXTURE_GEN_S);
|
||||
GL11.glEnable(GL11.GL_TEXTURE_GEN_T);
|
||||
GL11.glEnable(GL11.GL_TEXTURE_GEN_R);
|
||||
GL11.glEnable(GL11.GL_TEXTURE_GEN_Q);
|
||||
GL11.glPopMatrix();
|
||||
GL11.glMatrixMode(GL11.GL_TEXTURE);
|
||||
GL11.glPushMatrix();
|
||||
GL11.glLoadIdentity();
|
||||
GL11.glTranslatef(0F,(Minecraft.getSystemTime()%200000L)/200000F,0F);
|
||||
GL11.glScalef(scale,scale,scale);
|
||||
GL11.glTranslatef(0.5F,0.5F,0F);
|
||||
GL11.glRotatef((layer*layer*4321+layer*9)*4F,0F,0F,1F);
|
||||
GL11.glTranslatef(-0.5F,-0.5F,0.0F);
|
||||
GL11.glTranslatef((prevOffsetX+(offsetX-prevOffsetX)*partialTickTime)*0.015F,(prevOffsetY+(offsetY-prevOffsetY)*partialTickTime)*0.015F,0F); // TRANSLATE
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
tessellator.startDrawingQuads();
|
||||
|
||||
float red = consistentRandom.nextFloat()*0.5F+0.1F;
|
||||
float green = consistentRandom.nextFloat()*0.5F+0.4F;
|
||||
float blue = consistentRandom.nextFloat()*0.5F+0.5F;
|
||||
if (layer == 0)red = green = blue = 1F;
|
||||
|
||||
tessellator.setColorRGBA_F(red*colorMultiplier,green*colorMultiplier,blue*colorMultiplier,1F);
|
||||
tessellator.addVertexWithUV(hw-guiWidth/2,hh+guiHeight/2+guiTopOffset,0D,0D,1D);
|
||||
tessellator.addVertexWithUV(hw+guiWidth/2,hh+guiHeight/2+guiTopOffset,0D,1D,1D);
|
||||
tessellator.addVertexWithUV(hw+guiWidth/2,hh-guiHeight/2+guiTopOffset,0D,1D,0D);
|
||||
tessellator.addVertexWithUV(hw-guiWidth/2,hh-guiHeight/2+guiTopOffset,0D,0D,0D);
|
||||
tessellator.draw();
|
||||
GL11.glPopMatrix();
|
||||
GL11.glMatrixMode(GL11.GL_MODELVIEW);
|
||||
}
|
||||
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glDisable(GL11.GL_TEXTURE_GEN_S);
|
||||
GL11.glDisable(GL11.GL_TEXTURE_GEN_T);
|
||||
GL11.glDisable(GL11.GL_TEXTURE_GEN_R);
|
||||
GL11.glDisable(GL11.GL_TEXTURE_GEN_Q);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
}
|
||||
|
||||
private FloatBuffer insertIntoBufferAndFlip(float value1, float value2, float value3, float value4){
|
||||
floatBuffer.clear();
|
||||
floatBuffer.put(value1).put(value2).put(value3).put(value4);
|
||||
floatBuffer.flip();
|
||||
return floatBuffer;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean doesGuiPauseGame(){
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setZLevel(float newZLevel){
|
||||
this.zLevel = newZLevel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void callDrawGradientRect(int x1, int y1, int x2, int y2, int color1, int color2){
|
||||
drawGradientRect(x1,y1,x2,y2,color1,color2);
|
||||
}
|
||||
}
|
||||
@@ -7,7 +7,6 @@ import net.minecraft.item.ItemPotion;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.stats.AchievementList;
|
||||
import chylex.hee.item.ItemList;
|
||||
import chylex.hee.mechanics.knowledge.KnowledgeRegistrations;
|
||||
|
||||
class SlotBrewingStandPotion extends Slot{
|
||||
public SlotBrewingStandPotion(IInventory inv, int id, int x, int z){
|
||||
@@ -28,10 +27,7 @@ class SlotBrewingStandPotion extends Slot{
|
||||
public void onPickupFromSlot(EntityPlayer player, ItemStack is){
|
||||
if (is.getItem() instanceof ItemPotion && is.getItemDamage() > 0){
|
||||
player.addStat(AchievementList.potion,1);
|
||||
if (is.stackTagCompound != null && is.stackTagCompound.hasKey("hasPotionChanged")){
|
||||
KnowledgeRegistrations.ENHANCED_BREWING_STAND.tryUnlockFragment(player,0.36F,new byte[]{ 0,1,2 });
|
||||
is.stackTagCompound.removeTag("hasPotionChanged");
|
||||
}
|
||||
if (is.stackTagCompound != null && is.stackTagCompound.hasKey("hasPotionChanged"))is.stackTagCompound.removeTag("hasPotionChanged");
|
||||
}
|
||||
|
||||
super.onPickupFromSlot(player,is);
|
||||
|
||||
@@ -11,7 +11,6 @@ import chylex.hee.gui.GuiDecompositionTable;
|
||||
import chylex.hee.gui.GuiEndPowderEnhancements;
|
||||
import chylex.hee.gui.GuiEnergyExtractionTable;
|
||||
import chylex.hee.gui.GuiEnhancedBrewingStand;
|
||||
import chylex.hee.gui.GuiKnowledgeBook;
|
||||
import chylex.hee.tileentity.TileEntityDecompositionTable;
|
||||
import chylex.hee.tileentity.TileEntityEnergyExtractionTable;
|
||||
import chylex.hee.tileentity.TileEntityEnhancedBrewingStand;
|
||||
@@ -37,7 +36,6 @@ public final class GuiHandler implements IGuiHandler{
|
||||
public Object getClientGuiElement(int id, EntityPlayer player, World world, int x, int y, int z){
|
||||
switch(id){
|
||||
case 0: return new GuiEnhancedBrewingStand(player.inventory,(TileEntityEnhancedBrewingStand)world.getTileEntity(x,y,z));
|
||||
case 1: return new GuiKnowledgeBook(player.inventory.getCurrentItem());
|
||||
case 2: return new GuiDecompositionTable(player.inventory,(TileEntityDecompositionTable)world.getTileEntity(x,y,z));
|
||||
case 3: return new GuiEnergyExtractionTable(player.inventory,(TileEntityEnergyExtractionTable)world.getTileEntity(x,y,z));
|
||||
case 4: return new GuiEndPowderEnhancements(player.inventory);
|
||||
|
||||
@@ -3,7 +3,6 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import chylex.hee.mechanics.knowledge.KnowledgeRegistrations;
|
||||
import chylex.hee.packets.PacketPipeline;
|
||||
import chylex.hee.packets.client.C04OpenAdventurersDiary;
|
||||
import chylex.hee.system.savedata.WorldDataHandler;
|
||||
@@ -24,7 +23,6 @@ public class ItemAdventurersDiary extends Item{
|
||||
else file.unlockPage(player,is.getItemDamage());
|
||||
|
||||
PacketPipeline.sendToPlayer(player,new C04OpenAdventurersDiary(file.getUnlockedPages(player)));
|
||||
KnowledgeRegistrations.ADVENTURERS_DIARY.tryUnlockFragment(player,1F);
|
||||
}
|
||||
|
||||
return is;
|
||||
|
||||
@@ -13,7 +13,6 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.ChunkCoordinates;
|
||||
import net.minecraft.world.World;
|
||||
import chylex.hee.mechanics.knowledge.KnowledgeRegistrations;
|
||||
import chylex.hee.render.texture.TextureBiomeCompass;
|
||||
import chylex.hee.system.logging.Log;
|
||||
import chylex.hee.system.savedata.WorldDataHandler;
|
||||
@@ -60,10 +59,6 @@ public class ItemBiomeCompass extends Item{
|
||||
is.stackTagCompound.setLong("seed1",world.getSeed());
|
||||
is.stackTagCompound.setShort("seed2",(short)(1+WorldDataHandler.<DragonSavefile>get(DragonSavefile.class).getDragonDeathAmount()));
|
||||
}
|
||||
|
||||
if (isHeld && world.rand.nextInt(70) == 0 && entity instanceof EntityPlayer){
|
||||
KnowledgeRegistrations.BIOME_COMPASS.tryUnlockFragment((EntityPlayer)entity,1F,new byte[]{ 1 });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -6,10 +6,6 @@ import net.minecraft.world.World;
|
||||
import chylex.hee.entity.projectile.EntityProjectileCorporealMirageOrb;
|
||||
|
||||
public class ItemCorporealMirageOrb extends Item{
|
||||
public ItemCorporealMirageOrb(){
|
||||
super();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack is, World world, EntityPlayer player){
|
||||
world.playSoundAtEntity(player,"random.bow",0.5F,0.4F/(itemRand.nextFloat()*0.4F+0.8F));
|
||||
|
||||
@@ -1,69 +0,0 @@
|
||||
package chylex.hee.item;
|
||||
import java.util.List;
|
||||
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.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
import chylex.hee.HardcoreEnderExpansion;
|
||||
import chylex.hee.mechanics.knowledge.KnowledgeRegistrations;
|
||||
import chylex.hee.mechanics.knowledge.data.KnowledgeCategory;
|
||||
import chylex.hee.mechanics.knowledge.data.KnowledgeRegistration;
|
||||
import chylex.hee.system.achievements.AchievementManager;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemEnderCompendium extends Item{
|
||||
public ItemEnderCompendium(){
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack is, World world, EntityPlayer player){
|
||||
player.openGui(HardcoreEnderExpansion.instance,1,world,0,0,0);
|
||||
KnowledgeRegistrations.KNOWLEDGE_FRAGMENT.tryUnlockFragment(player,1F);
|
||||
if (!world.isRemote && is.stackTagCompound != null)is.stackTagCompound.removeTag("knowledgeLast");
|
||||
return is;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate(ItemStack is, World world, Entity entity, int slot, boolean isHeld){
|
||||
if (!world.isRemote && is.stackTagCompound != null && is.stackTagCompound.hasKey("knowledgeLast")){
|
||||
NBTTagCompound tag = is.stackTagCompound.getCompoundTag("knowledgeLast");
|
||||
|
||||
if (tag.hasKey("time")){
|
||||
int s = tag.getShort("time");
|
||||
if (--s <= 0)is.stackTagCompound.removeTag("knowledgeLast");
|
||||
else tag.setShort("time",(short)s);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreated(ItemStack is, World world, EntityPlayer player){
|
||||
player.addStat(AchievementManager.THE_MORE_YOU_KNOW,1);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack is, EntityPlayer player, List textLines, boolean showAdvancedInfo){
|
||||
if (is.getItemDamage() == 1)textLines.add("Creative mode");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs tab, List list){
|
||||
list.add(new ItemStack(item,1,0));
|
||||
|
||||
ItemStack fullCompendium = new ItemStack(item,1,1);
|
||||
for(KnowledgeCategory category:KnowledgeCategory.categories){
|
||||
for(KnowledgeRegistration registration:category.registrations){
|
||||
registration.fragmentSet.unlockAllFragments(fullCompendium);
|
||||
}
|
||||
}
|
||||
list.add(fullCompendium);
|
||||
}
|
||||
}
|
||||
@@ -13,8 +13,6 @@ import net.minecraft.world.World;
|
||||
import chylex.hee.entity.mob.EntityMobAngryEnderman;
|
||||
import chylex.hee.entity.mob.EntityMobParalyzedEnderman;
|
||||
import chylex.hee.entity.weather.EntityWeatherLightningBoltDemon;
|
||||
import chylex.hee.mechanics.knowledge.KnowledgeRegistrations;
|
||||
import chylex.hee.mechanics.knowledge.util.ObservationUtil;
|
||||
import chylex.hee.packets.PacketPipeline;
|
||||
import chylex.hee.packets.client.C05CustomWeather;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
@@ -77,11 +75,6 @@ public class ItemEndermanRelic extends ItemAbstractEnergyAcceptor{
|
||||
|
||||
is.damageItem(1,(EntityPlayer)owner);
|
||||
|
||||
for(EntityPlayer observer:ObservationUtil.getAllObservers(owner,12D)){
|
||||
if (KnowledgeRegistrations.ENDERMAN_RELIC.tryUnlockFragment(observer,0.6F).stopTrying)continue;
|
||||
KnowledgeRegistrations.PARALYZED_ENDERMAN.tryUnlockFragment(observer,0.3F,new byte[]{ 0 });
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
package chylex.hee.item;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import chylex.hee.entity.item.EntityItemIgneousRock;
|
||||
import chylex.hee.mechanics.knowledge.KnowledgeRegistrations;
|
||||
import cpw.mods.fml.common.IFuelHandler;
|
||||
|
||||
public class ItemIgneousRock extends ItemAbstractCustomEntity implements IFuelHandler{
|
||||
@@ -16,7 +14,6 @@ public class ItemIgneousRock extends ItemAbstractCustomEntity implements IFuelHa
|
||||
|
||||
if (is != null && is.getItem() == ItemList.igneous_rock){
|
||||
entity.setFire((int)Math.ceil(mp*(world.rand.nextInt(4)+3+Math.max(1,is.stackSize/10))));
|
||||
if (entity instanceof EntityPlayer)KnowledgeRegistrations.IGNEOUS_ROCK.tryUnlockFragment((EntityPlayer)entity,0.2F,new byte[]{ 0,1,2,3,4 });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -14,11 +14,6 @@ import net.minecraft.world.World;
|
||||
import chylex.hee.mechanics.infestation.InfestationEvents;
|
||||
|
||||
public class ItemInfestationRemedy extends Item{
|
||||
public ItemInfestationRemedy(){
|
||||
super();
|
||||
setMaxStackSize(1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxItemUseDuration(ItemStack is){
|
||||
return 32;
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
package chylex.hee.item;
|
||||
/*import net.minecraft.entity.Entity;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import chylex.hee.entity.item.EntityItemInfestationCauldron;
|
||||
|
||||
public class ItemInfestationRemedyIngredient extends Item{
|
||||
public ItemInfestationRemedyIngredient(){
|
||||
super();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasCustomEntity(ItemStack is){
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Entity createEntity(World world, Entity originalEntity, ItemStack is){
|
||||
EntityItemInfestationCauldron newEntity = new EntityItemInfestationCauldron(world,originalEntity.posX,originalEntity.posY,originalEntity.posZ,is);
|
||||
newEntity.delayBeforeCanPickup = 10;
|
||||
|
||||
newEntity.copyLocationAndAnglesFrom(originalEntity);
|
||||
newEntity.motionX = newEntity.motionY = newEntity.motionZ = 0D;
|
||||
newEntity.addVelocity(originalEntity.motionX,originalEntity.motionY,originalEntity.motionZ);
|
||||
return newEntity;
|
||||
}
|
||||
}
|
||||
*/
|
||||
@@ -18,7 +18,6 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemKnowledgeFragment extends Item{
|
||||
public ItemKnowledgeFragment(){
|
||||
super();
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
@@ -26,7 +25,7 @@ public class ItemKnowledgeFragment extends Item{
|
||||
public ItemStack onItemRightClick(ItemStack is, World world, EntityPlayer player){
|
||||
if (world.isRemote)return is;
|
||||
|
||||
for(int a = 0; a < player.inventory.mainInventory.length; a++){
|
||||
/*for(int a = 0; a < player.inventory.mainInventory.length; a++){
|
||||
ItemStack invIS = player.inventory.mainInventory[a];
|
||||
if (invIS == null || invIS.getItem() != ItemList.ender_compendium)continue;
|
||||
|
||||
@@ -67,25 +66,18 @@ public class ItemKnowledgeFragment extends Item{
|
||||
return is;
|
||||
}
|
||||
|
||||
PacketPipeline.sendToPlayer(player,new C03KnowledgeRegistrationNotification(-2));
|
||||
PacketPipeline.sendToPlayer(player,new C03KnowledgeRegistrationNotification(-2));*/
|
||||
return is;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack is, EntityPlayer player, List textLines, boolean showAdvancedInfo){
|
||||
String registration = is.stackTagCompound != null ? is.stackTagCompound.getString("knowledgeRegistration") : null;
|
||||
/*String registration = is.stackTagCompound != null ? is.stackTagCompound.getString("knowledgeRegistration") : null;
|
||||
|
||||
if (registration != null){
|
||||
KnowledgeRegistration reg = KnowledgeRegistration.lookup.get(registration);
|
||||
if (reg != null)textLines.add(reg.getRenderer().getTooltip());
|
||||
}
|
||||
}
|
||||
|
||||
public static ItemStack setRandomRegistration(ItemStack is, FragmentWeightList weightedList, Random rand){
|
||||
NBTTagCompound tag = is.stackTagCompound == null?new NBTTagCompound():is.stackTagCompound;
|
||||
tag.setString("knowledgeRegistration",weightedList.getRandomRegistration(rand).identifier);
|
||||
is.stackTagCompound = tag;
|
||||
return is;
|
||||
}*/
|
||||
}
|
||||
}
|
||||
@@ -17,10 +17,9 @@ public final class ItemList{
|
||||
items.put(itemIdentifier,item);
|
||||
}
|
||||
|
||||
// COMPENDIUM
|
||||
// LORE
|
||||
|
||||
public static Item adventurers_diary;
|
||||
public static Item ender_compendium;
|
||||
public static Item knowledge_fragment;
|
||||
|
||||
// BASIC MATERIALS
|
||||
@@ -73,7 +72,6 @@ public final class ItemList{
|
||||
|
||||
public static void loadItems(){
|
||||
register("adventurers_diary", adventurers_diary = new ItemAdventurersDiary().setMaxStackSize(1).setUnlocalizedName("lorePage").setTextureName("hardcoreenderexpansion:lore_page"));
|
||||
register("ender_compendium", ender_compendium = new ItemEnderCompendium().setMaxStackSize(1).setUnlocalizedName("enderCompendium").setTextureName("hardcoreenderexpansion:ender_compendium"));
|
||||
register("knowledge_fragment", knowledge_fragment = new ItemKnowledgeFragment().setMaxStackSize(1).setUnlocalizedName("knowledgeFragment").setTextureName("hardcoreenderexpansion:knowledge_fragment"));
|
||||
|
||||
register("end_powder", end_powder = new ItemEndPowder().setUnlocalizedName("endPowder").setTextureName("hardcoreenderexpansion:end_powder"));
|
||||
@@ -93,7 +91,7 @@ public final class ItemList{
|
||||
|
||||
register("silverfish_blood", silverfish_blood = new Item().setUnlocalizedName("silverfishBlood").setTextureName("hardcoreenderexpansion:silverfish_blood"));
|
||||
register("dry_splinter", dry_splinter = new Item().setUnlocalizedName("drySplinter").setTextureName("hardcoreenderexpansion:dry_splinter"));
|
||||
register("infestation_remedy", infestation_remedy = new ItemInfestationRemedy().setUnlocalizedName("infestationRemedy").setTextureName("hardcoreenderexpansion:infestation_remedy"));
|
||||
register("infestation_remedy", infestation_remedy = new ItemInfestationRemedy().setMaxStackSize(1).setUnlocalizedName("infestationRemedy").setTextureName("hardcoreenderexpansion:infestation_remedy"));
|
||||
register("ghost_amulet", ghost_amulet = new Item().setUnlocalizedName("ghostAmulet").setTextureName("hardcoreenderexpansion:ghost_amulet"));
|
||||
register("endoplasm", ectoplasm = new Item().setUnlocalizedName("endoplasm").setTextureName("hardcoreenderexpansion:endoplasm"));
|
||||
register("charm_pouch", charm_pouch = new ItemCharmPouch().setMaxStackSize(1).setUnlocalizedName("charmPouch").setTextureName("hardcoreenderexpansion:charm_pouch"));
|
||||
@@ -123,7 +121,7 @@ public final class ItemList{
|
||||
).addItems(
|
||||
spectral_wand,fire_shard,scorching_pickaxe,enderman_relic,
|
||||
enderman_head,bucket_ender_goo,music_disk,
|
||||
ender_compendium,knowledge_fragment,
|
||||
knowledge_fragment,
|
||||
spawn_eggs
|
||||
);
|
||||
}
|
||||
|
||||
@@ -12,7 +12,6 @@ import net.minecraft.item.ItemRecord;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import chylex.hee.mechanics.knowledge.KnowledgeRegistrations;
|
||||
import chylex.hee.packets.PacketPipeline;
|
||||
import chylex.hee.packets.client.C02PlayRecord;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
@@ -58,8 +57,6 @@ public class ItemMusicDisk extends ItemRecord{
|
||||
PacketPipeline.sendToDimension(world.provider.dimensionId,new C02PlayRecord(x,y,z,(byte)is.getItemDamage()));
|
||||
--is.stackSize;
|
||||
|
||||
KnowledgeRegistrations.MUSIC_DISCS.tryUnlockFragment(player,1F);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,6 @@ import chylex.hee.entity.projectile.EntityProjectilePotionOfInstability;
|
||||
import chylex.hee.mechanics.brewing.AbstractPotionData;
|
||||
import chylex.hee.mechanics.brewing.PotionTypes;
|
||||
import chylex.hee.mechanics.brewing.TimedPotion;
|
||||
import chylex.hee.mechanics.knowledge.KnowledgeRegistrations;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@@ -35,17 +34,10 @@ public class ItemPotionOfInstability extends Item{
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon iconBottleNormal,iconBottleSplash;
|
||||
|
||||
public ItemPotionOfInstability(){
|
||||
super();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onEaten(ItemStack is, World world, EntityPlayer player){
|
||||
if (!world.isRemote){
|
||||
player.addPotionEffect(getRandomPotionEffect(world.rand));
|
||||
KnowledgeRegistrations.INSTABILITY_POTION.tryUnlockFragment(player,0.45F);
|
||||
}
|
||||
if (!world.isRemote)player.addPotionEffect(getRandomPotionEffect(world.rand));
|
||||
|
||||
if (!player.capabilities.isCreativeMode){
|
||||
if (--is.stackSize <= 0)return new ItemStack(Items.glass_bottle);
|
||||
|
||||
@@ -3,8 +3,6 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import chylex.hee.entity.projectile.EntityProjectileSpatialDash;
|
||||
import chylex.hee.mechanics.knowledge.KnowledgeRegistrations;
|
||||
import chylex.hee.mechanics.knowledge.util.ObservationUtil;
|
||||
|
||||
public class ItemSpatialDashGem extends ItemAbstractEnergyAcceptor{
|
||||
@Override
|
||||
@@ -23,10 +21,6 @@ public class ItemSpatialDashGem extends ItemAbstractEnergyAcceptor{
|
||||
if (!world.isRemote){
|
||||
is.setItemDamage(is.getItemDamage()+1);
|
||||
world.spawnEntityInWorld(new EntityProjectileSpatialDash(world,player));
|
||||
|
||||
for(EntityPlayer observer:ObservationUtil.getAllObservers(player,8D)){
|
||||
KnowledgeRegistrations.SPATIAL_DASH_GEM.tryUnlockFragment(observer,0.1F);
|
||||
}
|
||||
}
|
||||
else world.playSound(player.posX,player.posY,player.posZ,"hardcoreenderexpansion:player.random.spatialdash",0.8F,0.9F,false);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
package chylex.hee.item;
|
||||
import chylex.hee.world.structure.island.biome.IslandBiomeBase;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.util.IIcon;
|
||||
@@ -11,6 +10,9 @@ public class ItemSpecialEffects extends Item{
|
||||
public static final byte questionMark = 18;
|
||||
public static final byte achievementLorePageIcon = 19;
|
||||
public static final byte biomePointStart = 20;
|
||||
public static final byte biomePointEnd = 22;
|
||||
public static final byte achievementCompendiumIcon = 23;
|
||||
public static final byte totalIcons = 24;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon[] icons;
|
||||
@@ -24,14 +26,15 @@ public class ItemSpecialEffects extends Item{
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister){
|
||||
icons = new IIcon[21+IslandBiomeBase.biomeList.size()];
|
||||
icons = new IIcon[totalIcons];
|
||||
|
||||
for(int a = 0; a < 10; a++)icons[a] = iconRegister.registerIcon("hardcoreenderexpansion:"+a);
|
||||
char c = 'a';
|
||||
for(int a = 10; a < 18; a++)icons[a] = iconRegister.registerIcon("hardcoreenderexpansion:altar_glyph_"+(c++));
|
||||
icons[18] = iconRegister.registerIcon("hardcoreenderexpansion:question_mark");
|
||||
icons[19] = iconRegister.registerIcon("hardcoreenderexpansion:achievement_lore_pages");
|
||||
for(int a = 20; a < 20+IslandBiomeBase.biomeList.size(); a++)icons[a] = iconRegister.registerIcon("hardcoreenderexpansion:biome_"+(a-20));
|
||||
for(int a = 20; a < biomePointEnd; a++)icons[a] = iconRegister.registerIcon("hardcoreenderexpansion:biome_"+(a-20));
|
||||
icons[23] = iconRegister.registerIcon("hardcoreenderexpansion:ender_compendium");
|
||||
itemIcon = icons[0];
|
||||
}
|
||||
}
|
||||
@@ -7,7 +7,6 @@ import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.world.World;
|
||||
import chylex.hee.mechanics.knowledge.KnowledgeRegistrations;
|
||||
import chylex.hee.mechanics.temple.TeleportParticleTickEvent;
|
||||
import chylex.hee.system.savedata.WorldDataHandler;
|
||||
import chylex.hee.system.savedata.types.DragonSavefile;
|
||||
@@ -52,8 +51,6 @@ public class ItemTempleCaller extends ItemAbstractEnergyAcceptor{
|
||||
player.setLocationAndAngles(templeX+1.5D,templeY+1,templeZ+6.5D,-90F,0F);
|
||||
player.setPositionAndUpdate(templeX+1.5D,templeY+1,templeZ+6.5D);
|
||||
WorldDataHandler.<DragonSavefile>get(DragonSavefile.class).setPlayerIsInTemple(player,true);
|
||||
|
||||
KnowledgeRegistrations.TEMPLE_CALLER.tryUnlockFragment(player,1F);
|
||||
}
|
||||
else TeleportParticleTickEvent.startSmokeEffect();
|
||||
}
|
||||
|
||||
@@ -16,9 +16,6 @@ import chylex.hee.mechanics.enhancements.EnhancementHandler;
|
||||
import chylex.hee.mechanics.enhancements.types.TransferenceGemEnhancements;
|
||||
import chylex.hee.mechanics.gem.GemData;
|
||||
import chylex.hee.mechanics.gem.GemSideEffects;
|
||||
import chylex.hee.mechanics.knowledge.KnowledgeRegistrations;
|
||||
import chylex.hee.mechanics.knowledge.data.UnlockResult;
|
||||
import chylex.hee.mechanics.knowledge.util.ObservationUtil;
|
||||
import chylex.hee.packets.PacketPipeline;
|
||||
import chylex.hee.packets.client.C20Effect;
|
||||
import chylex.hee.packets.client.C21EffectEntity;
|
||||
@@ -78,7 +75,6 @@ public class ItemTransferenceGem extends ItemAbstractEnergyAcceptor{
|
||||
float percBroken = itemDamage/(float)is.getMaxDamage();
|
||||
if (percBroken > 0.66F && entity.worldObj.rand.nextFloat()*1.4F < percBroken){
|
||||
GemSideEffects.performRandomEffect(entity,percBroken);
|
||||
if (entity == player)KnowledgeRegistrations.TRANSFERENCE_GEM.tryUnlockFragment((EntityPlayer)entity,0.26F);
|
||||
}
|
||||
|
||||
if (EnhancementHandler.hasEnhancement(is,TransferenceGemEnhancements.HEAL) && isLiving){
|
||||
@@ -89,13 +85,6 @@ public class ItemTransferenceGem extends ItemAbstractEnergyAcceptor{
|
||||
}
|
||||
|
||||
PacketPipeline.sendToAllAround(entity,64D,new C20Effect(FXType.Basic.GEM_TELEPORT_TO,entity));
|
||||
|
||||
if (!KnowledgeRegistrations.TRANSFERENCE_GEM.tryUnlockFragment(player,0.15F).stopTrying &&
|
||||
KnowledgeRegistrations.TRANSFERENCE_GEM.tryUnlockFragment(player,0.1F,new byte[]{ 7 }) == UnlockResult.NOTHING_TO_UNLOCK){
|
||||
KnowledgeRegistrations.TRANSFERENCE_GEM_ENH.tryUnlockFragment(player,1F);
|
||||
}
|
||||
|
||||
for(EntityPlayer observer:ObservationUtil.getAllObservers(entity,10D))KnowledgeRegistrations.TRANSFERENCE_GEM.tryUnlockFragment(observer,0.13F);
|
||||
}
|
||||
|
||||
return is;
|
||||
|
||||
@@ -12,17 +12,10 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.event.entity.living.LivingDropsEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingHurtEvent;
|
||||
import net.minecraftforge.event.entity.player.EntityInteractEvent;
|
||||
import net.minecraftforge.event.entity.player.EntityItemPickupEvent;
|
||||
import chylex.hee.entity.item.EntityItemAltar;
|
||||
import chylex.hee.item.ItemList;
|
||||
import chylex.hee.item.ItemTransferenceGem;
|
||||
import chylex.hee.mechanics.enhancements.EnhancementHandler;
|
||||
import chylex.hee.mechanics.enhancements.types.TransferenceGemEnhancements;
|
||||
import chylex.hee.mechanics.essence.EssenceType;
|
||||
import chylex.hee.mechanics.knowledge.KnowledgeRegistrations;
|
||||
import chylex.hee.mechanics.knowledge.data.UnlockResult;
|
||||
import chylex.hee.mechanics.knowledge.util.ObservationUtil;
|
||||
import cpw.mods.fml.common.eventhandler.EventPriority;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
|
||||
public class MiscEvents{
|
||||
@@ -51,7 +44,6 @@ public class MiscEvents{
|
||||
|
||||
if (rand.nextInt(Math.max(1,40-e.lootingLevel)) == 0 && e.entity instanceof EntityEnderman){
|
||||
is = new ItemStack(ItemList.enderman_head);
|
||||
for(EntityPlayer observer:ObservationUtil.getAllObservers(e.entityLiving,8D))KnowledgeRegistrations.ENDERMAN_HEAD.tryUnlockFragment(observer,1F);
|
||||
}
|
||||
else if (rand.nextInt(14-Math.min(e.lootingLevel,4)) == 0 && e.entity instanceof EntitySilverfish){
|
||||
boolean drop = rand.nextInt(4) == 0;
|
||||
@@ -62,22 +54,7 @@ public class MiscEvents{
|
||||
if (held != null && held.getItem() == Items.golden_sword)drop = true;
|
||||
}
|
||||
|
||||
if (drop){
|
||||
is = new ItemStack(ItemList.silverfish_blood);
|
||||
for(EntityPlayer observer:ObservationUtil.getAllObservers(e.entity,8D)){
|
||||
if (KnowledgeRegistrations.SILVERFISH_BLOOD.tryUnlockFragment(observer,0.8F) == UnlockResult.NOTHING_TO_UNLOCK &&
|
||||
!KnowledgeRegistrations.INFESTATION_REMEDY.tryUnlockFragment(observer,0.5F).stopTrying){
|
||||
KnowledgeRegistrations.ENHANCED_BREWING_STAND.tryUnlockFragment(observer,0.4F,new byte[]{ 4 });
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (isPlayer && KnowledgeRegistrations.SILVERFISH_BLOOD.tryUnlockFragment((EntityPlayer)e.source.getEntity(),0.65F) == UnlockResult.NOTHING_TO_UNLOCK){
|
||||
EntityPlayer player = (EntityPlayer)e.source.getEntity();
|
||||
|
||||
if (!KnowledgeRegistrations.INFESTATION_REMEDY.tryUnlockFragment(player,0.5F).stopTrying){
|
||||
KnowledgeRegistrations.ENHANCED_BREWING_STAND.tryUnlockFragment(player,0.2F,new byte[]{ 4 });
|
||||
}
|
||||
}
|
||||
if (drop)is = new ItemStack(ItemList.silverfish_blood);
|
||||
}
|
||||
|
||||
if (is != null){
|
||||
@@ -114,18 +91,4 @@ public class MiscEvents{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Knowledge from picking up transformed items
|
||||
*/
|
||||
@SubscribeEvent(priority = EventPriority.LOWEST)
|
||||
public void onItemPickup(EntityItemPickupEvent e){
|
||||
if (e.item.getClass() == EntityItemAltar.class){
|
||||
EntityItemAltar altarItem = (EntityItemAltar)e.item;
|
||||
if (altarItem.hasChanged && altarItem.essenceType == EssenceType.DRAGON.id)KnowledgeRegistrations.DRAGON_ESSENCE_ALTAR.tryUnlockFragment(e.entityPlayer,0.3F);
|
||||
}
|
||||
else if (e.item.getEntityItem().getItem() == ItemList.biome_compass){
|
||||
KnowledgeRegistrations.BIOME_COMPASS.tryUnlockFragment(e.entityPlayer,1F,new byte[]{ 0 }); // TODO wtf?
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
package chylex.hee.mechanics.compendium.content;
|
||||
import net.minecraft.init.Blocks;
|
||||
import chylex.hee.mechanics.compendium.content.objects.ObjectBlock;
|
||||
import chylex.hee.item.ItemList;
|
||||
import chylex.hee.mechanics.compendium.content.objects.ObjectDummy;
|
||||
import chylex.hee.mechanics.compendium.content.objects.ObjectItem;
|
||||
import chylex.hee.mechanics.compendium.content.type.KnowledgeFragment;
|
||||
import chylex.hee.mechanics.compendium.content.type.KnowledgeFragmentText;
|
||||
import chylex.hee.mechanics.compendium.content.type.KnowledgeObject;
|
||||
@@ -10,8 +10,10 @@ public final class KnowledgeRegistrations{
|
||||
public static final KnowledgeObject<ObjectDummy>
|
||||
HELP = new KnowledgeObject<>(new ObjectDummy());
|
||||
|
||||
public static final KnowledgeObject<ObjectBlock>
|
||||
TEST_OBJECT = new KnowledgeObject<>(new ObjectBlock(Blocks.bedrock));
|
||||
public static final KnowledgeObject<?>
|
||||
ADVENTURERS_DIARY = new KnowledgeObject<>(new ObjectItem(ItemList.adventurers_diary)),
|
||||
ENDERMAN_HEAD = new KnowledgeObject<>(new ObjectItem(ItemList.enderman_head)),
|
||||
MUSIC_DISKS = new KnowledgeObject<>(new ObjectItem(ItemList.music_disk));
|
||||
|
||||
public static void initialize(){
|
||||
HELP.setFragments(new KnowledgeFragment[]{
|
||||
@@ -25,13 +27,13 @@ public final class KnowledgeRegistrations{
|
||||
});
|
||||
|
||||
KnowledgeCategories.OVERWORLD.addKnowledgeObjects(new KnowledgeObject[]{
|
||||
TEST_OBJECT.setPos(0,0).setUnlockPrice(20).setFragments(new KnowledgeFragment[]{
|
||||
/*TEST_OBJECT.setPos(0,0).setUnlockPrice(20).setFragments(new KnowledgeFragment[]{
|
||||
new KnowledgeFragmentText(1000).setContents("Test fragment").setPrice(5).setUnlockOnDiscovery(),
|
||||
new KnowledgeFragmentText(1001).setContents("Test fragment 2 Test fragment 2 Test fragment 2 Test fragment 2 Test fragment 2").setPrice(10),
|
||||
new KnowledgeFragmentText(1002).setContents("Test fragment 2 Test fragment 2 Test fragment 2 Test fragment 2 Test fragment 2").setPrice(100),
|
||||
new KnowledgeFragmentText(1003).setContents("Test fragment 2 Test fragment 2 Test fragment 2 Test fragment 2 Test fragment 2").setPrice(400),
|
||||
new KnowledgeFragmentText(1004).setContents("Test fragment 2 Test fragment 2 Test fragment 2 Test fragment 2 Test fragment 2").setPrice(5000)
|
||||
})
|
||||
})*/
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -41,5 +41,20 @@ public class ObjectBlock implements IKnowledgeObjectInstance<BlockMetaWrapper>{
|
||||
this.block = block;
|
||||
this.metadata = (byte)metadata;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o){
|
||||
return o.getClass() == BlockMetaWrapper.class && ((BlockMetaWrapper)o).block == block;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode(){
|
||||
return block.hashCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString(){
|
||||
return block+"/"+metadata;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,7 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import chylex.hee.mechanics.knowledge.util.IGuiItemStackRenderer;
|
||||
import chylex.hee.mechanics.compendium.util.IGuiItemStackRenderer;
|
||||
|
||||
public class KnowledgeCategory implements IGuiItemStackRenderer{
|
||||
public static final byte iconSize = 44;
|
||||
|
||||
+3
-3
@@ -1,7 +1,7 @@
|
||||
package chylex.hee.mechanics.compendium.content.type;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import chylex.hee.gui.GuiKnowledgeBook;
|
||||
import chylex.hee.gui.GuiEnderCompendium;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@@ -23,7 +23,7 @@ public class KnowledgeFragmentText extends KnowledgeFragment{
|
||||
public int getHeight(Minecraft mc, boolean isUnlocked){
|
||||
boolean origFont = mc.fontRenderer.getUnicodeFlag();
|
||||
mc.fontRenderer.setUnicodeFlag(true);
|
||||
int h = mc.fontRenderer.listFormattedStringToWidth(getString(isUnlocked),GuiKnowledgeBook.guiPageWidth-10).size()*mc.fontRenderer.FONT_HEIGHT;
|
||||
int h = mc.fontRenderer.listFormattedStringToWidth(getString(isUnlocked),GuiEnderCompendium.guiPageWidth-10).size()*mc.fontRenderer.FONT_HEIGHT;
|
||||
mc.fontRenderer.setUnicodeFlag(origFont);
|
||||
return h;
|
||||
}
|
||||
@@ -33,7 +33,7 @@ public class KnowledgeFragmentText extends KnowledgeFragment{
|
||||
public void render(int x, int y, Minecraft mc, boolean isUnlocked){
|
||||
boolean origFont = mc.fontRenderer.getUnicodeFlag();
|
||||
mc.fontRenderer.setUnicodeFlag(true);
|
||||
mc.fontRenderer.drawSplitString(getString(isUnlocked),x+1,y,GuiKnowledgeBook.guiPageWidth-10,255<<24);
|
||||
mc.fontRenderer.drawSplitString(getString(isUnlocked),x+1,y,GuiEnderCompendium.guiPageWidth-10,255<<24);
|
||||
mc.fontRenderer.setUnicodeFlag(origFont);
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import java.util.LinkedHashSet;
|
||||
import java.util.Set;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import chylex.hee.mechanics.compendium.content.objects.IKnowledgeObjectInstance;
|
||||
import chylex.hee.mechanics.knowledge.util.IGuiItemStackRenderer;
|
||||
import chylex.hee.mechanics.compendium.util.IGuiItemStackRenderer;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
|
||||
|
||||
@@ -71,7 +71,7 @@ public class PlayerCompendiumData implements IExtendedEntityProperties{
|
||||
else return false;
|
||||
}
|
||||
|
||||
public boolean tryDiscoverBlock(KnowledgeObject<ObjectBlock> block, boolean addReward){
|
||||
public boolean tryDiscoverBlock(KnowledgeObject<ObjectBlock> block, boolean addReward){ System.out.println("discover block "+block.getObject().getUnderlyingObject());
|
||||
if (discoveredBlocks.addObject(block.getObject())){
|
||||
onDiscover(block,addReward);
|
||||
return true;
|
||||
@@ -83,7 +83,7 @@ public class PlayerCompendiumData implements IExtendedEntityProperties{
|
||||
return discoveredBlocks.hasDiscoveredObject(block.getObject());
|
||||
}
|
||||
|
||||
public boolean tryDiscoverItem(KnowledgeObject<ObjectItem> item, boolean addReward){
|
||||
public boolean tryDiscoverItem(KnowledgeObject<ObjectItem> item, boolean addReward){ System.out.println("discover item "+item.getObject().getUnderlyingObject());
|
||||
if (discoveredItems.addObject(item.getObject())){
|
||||
onDiscover(item,addReward);
|
||||
return true;
|
||||
@@ -95,7 +95,7 @@ public class PlayerCompendiumData implements IExtendedEntityProperties{
|
||||
return discoveredItems.hasDiscoveredObject(item.getObject());
|
||||
}
|
||||
|
||||
public boolean tryDiscoverMob(KnowledgeObject<ObjectMob> mob, boolean addReward){
|
||||
public boolean tryDiscoverMob(KnowledgeObject<ObjectMob> mob, boolean addReward){ System.out.println("discover mob "+mob.getObject().getUnderlyingObject().getSimpleName());
|
||||
if (discoveryMobs.addObject(mob.getObject())){
|
||||
onDiscover(mob,addReward);
|
||||
return true;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package chylex.hee.mechanics.knowledge.util;
|
||||
package chylex.hee.mechanics.compendium.util;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public interface IGuiItemStackRenderer{
|
||||
@@ -1,7 +1,6 @@
|
||||
package chylex.hee.mechanics.enhancements;
|
||||
import net.minecraft.item.Item;
|
||||
import chylex.hee.mechanics.enhancements.SlotList.SlotType;
|
||||
import chylex.hee.mechanics.knowledge.data.KnowledgeRegistration;
|
||||
|
||||
class EnhancementData{
|
||||
final Class<? extends Enum> clsEnum;
|
||||
@@ -10,11 +9,10 @@ class EnhancementData{
|
||||
final Class<? extends IEnhancementEnum> clsInterface;
|
||||
final IEnhancementEnum[] valuesInterface;
|
||||
|
||||
final KnowledgeRegistration knowledgeRegistration;
|
||||
final Item newItem;
|
||||
final SlotList slots;
|
||||
|
||||
EnhancementData(Class<? extends Enum> cls, KnowledgeRegistration knowledgeRegistration, Item newItem, SlotType...slotTypes){
|
||||
EnhancementData(Class<? extends Enum> cls, Item newItem, SlotType...slotTypes){
|
||||
this.clsEnum = cls;
|
||||
this.valuesEnum = cls.getEnumConstants();
|
||||
|
||||
@@ -22,7 +20,6 @@ class EnhancementData{
|
||||
this.valuesInterface = new IEnhancementEnum[valuesEnum.length];
|
||||
for(int a = 0; a < valuesEnum.length; a++)valuesInterface[a] = (IEnhancementEnum)valuesEnum[a];
|
||||
|
||||
this.knowledgeRegistration = knowledgeRegistration;
|
||||
this.newItem = newItem;
|
||||
this.slots = new SlotList(slotTypes);
|
||||
}
|
||||
|
||||
@@ -1,13 +1,6 @@
|
||||
package chylex.hee.mechanics.enhancements;
|
||||
import gnu.trove.set.hash.TShortHashSet;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import chylex.hee.item.ItemList;
|
||||
import chylex.hee.mechanics.knowledge.data.KnowledgeRegistration;
|
||||
import chylex.hee.mechanics.knowledge.data.UnlockResult;
|
||||
import chylex.hee.mechanics.compendium.content.type.KnowledgeFragment;
|
||||
import chylex.hee.mechanics.knowledge.fragment.EnhancementKnowledgeFragment;
|
||||
import chylex.hee.mechanics.knowledge.fragment.KnowledgeFragment;
|
||||
|
||||
public final class EnhancementFragmentUtil{
|
||||
public static KnowledgeFragment[] getEnhancementFragments(Class<? extends Enum> enhancementEnum){
|
||||
@@ -17,33 +10,5 @@ public final class EnhancementFragmentUtil{
|
||||
return fragments;
|
||||
}
|
||||
|
||||
public static TShortHashSet getUnlockedEnhancements(KnowledgeRegistration registration, EntityPlayer player){
|
||||
InventoryPlayer inv = player.inventory;
|
||||
|
||||
for(int a = 0; a < inv.mainInventory.length; a++){
|
||||
ItemStack is = inv.mainInventory[a];
|
||||
if (is == null || is.getItem() != ItemList.ender_compendium || is.stackTagCompound == null)continue;
|
||||
|
||||
TShortHashSet unlockedEnhancements = new TShortHashSet(8);
|
||||
for(int id:registration.fragmentSet.getUnlockedFragments(is))unlockedEnhancements.add((short)id);
|
||||
return unlockedEnhancements;
|
||||
}
|
||||
|
||||
return new TShortHashSet(0);
|
||||
}
|
||||
|
||||
public static boolean unlockEnhancement(KnowledgeRegistration registration, Enum enhancement, EntityPlayer player){
|
||||
InventoryPlayer inv = player.inventory;
|
||||
|
||||
for(int a = 0; a < inv.mainInventory.length; a++){
|
||||
ItemStack is = inv.mainInventory[a];
|
||||
if (is == null || is.getItem() != ItemList.ender_compendium || is.stackTagCompound == null)continue;
|
||||
|
||||
return registration.tryUnlockFragment(player,1F,new byte[]{ (byte)enhancement.ordinal() }) == UnlockResult.SUCCESSFUL;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private EnhancementFragmentUtil(){}
|
||||
}
|
||||
@@ -17,8 +17,6 @@ import chylex.hee.mechanics.enhancements.SlotList.SlotType;
|
||||
import chylex.hee.mechanics.enhancements.types.EnderPearlEnhancements;
|
||||
import chylex.hee.mechanics.enhancements.types.TNTEnhancements;
|
||||
import chylex.hee.mechanics.enhancements.types.TransferenceGemEnhancements;
|
||||
import chylex.hee.mechanics.knowledge.KnowledgeRegistrations;
|
||||
import chylex.hee.mechanics.knowledge.data.KnowledgeRegistration;
|
||||
|
||||
public final class EnhancementHandler{
|
||||
private static final IdentityHashMap<Item, EnhancementData> itemMap = new IdentityHashMap<>(8);
|
||||
@@ -28,27 +26,27 @@ public final class EnhancementHandler{
|
||||
|
||||
itemMap.put(
|
||||
Items.ender_pearl,
|
||||
new EnhancementData(EnderPearlEnhancements.class, KnowledgeRegistrations.ENDER_PEARLS_ENH, ItemList.enhanced_ender_pearl, p, i, p)
|
||||
new EnhancementData(EnderPearlEnhancements.class, ItemList.enhanced_ender_pearl, p, i, p)
|
||||
);
|
||||
|
||||
itemMap.put(
|
||||
ItemList.enhanced_ender_pearl,
|
||||
new EnhancementData(EnderPearlEnhancements.class, KnowledgeRegistrations.ENDER_PEARLS_ENH, ItemList.enhanced_ender_pearl, p, i, p)
|
||||
new EnhancementData(EnderPearlEnhancements.class, ItemList.enhanced_ender_pearl, p, i, p)
|
||||
);
|
||||
|
||||
itemMap.put(
|
||||
ItemList.transference_gem,
|
||||
new EnhancementData(TransferenceGemEnhancements.class, KnowledgeRegistrations.TRANSFERENCE_GEM_ENH, ItemList.transference_gem, p, p, p, i, p, p, p)
|
||||
new EnhancementData(TransferenceGemEnhancements.class, ItemList.transference_gem, p, p, p, i, p, p, p)
|
||||
);
|
||||
|
||||
itemMap.put(
|
||||
Item.getItemFromBlock(Blocks.tnt),
|
||||
new EnhancementData(TNTEnhancements.class, KnowledgeRegistrations.TNT_ENH, Item.getItemFromBlock(BlockList.enhanced_tnt), p, p, i, i, p, p)
|
||||
new EnhancementData(TNTEnhancements.class, Item.getItemFromBlock(BlockList.enhanced_tnt), p, p, i, i, p, p)
|
||||
);
|
||||
|
||||
itemMap.put(
|
||||
Item.getItemFromBlock(BlockList.enhanced_tnt),
|
||||
new EnhancementData(TNTEnhancements.class, KnowledgeRegistrations.TNT_ENH, Item.getItemFromBlock(BlockList.enhanced_tnt), p, p, i, i, p, p)
|
||||
new EnhancementData(TNTEnhancements.class, Item.getItemFromBlock(BlockList.enhanced_tnt), p, p, i, i, p, p)
|
||||
);
|
||||
|
||||
//itemMap.put(Item.getItemFromBlock(BlockList.soul_charm), new EnhancementData(SoulCharmEnhancements.class));
|
||||
@@ -66,10 +64,6 @@ public final class EnhancementHandler{
|
||||
return canEnhanceItem(item) ? itemMap.get(item).slots : new SlotList();
|
||||
}
|
||||
|
||||
public static KnowledgeRegistration getEnhancementKnowledgeRegistrationForItem(Item item){
|
||||
return canEnhanceItem(item) ? itemMap.get(item).knowledgeRegistration : null;
|
||||
}
|
||||
|
||||
public static List<Enum> getEnhancements(ItemStack is){
|
||||
List<Enum> enhancements = new ArrayList<>();
|
||||
|
||||
|
||||
@@ -7,8 +7,6 @@ import chylex.hee.item.ItemList;
|
||||
import chylex.hee.mechanics.essence.handler.AltarActionHandler;
|
||||
import chylex.hee.mechanics.essence.handler.DragonEssenceHandler;
|
||||
import chylex.hee.mechanics.essence.handler.FieryEssenceHandler;
|
||||
import chylex.hee.mechanics.knowledge.KnowledgeRegistrations;
|
||||
import chylex.hee.mechanics.knowledge.data.KnowledgeRegistration;
|
||||
import chylex.hee.system.util.IItemSelector;
|
||||
|
||||
public enum EssenceType{
|
||||
@@ -77,24 +75,6 @@ public enum EssenceType{
|
||||
return (byte)(id-1);
|
||||
}
|
||||
|
||||
public KnowledgeRegistration getAltarRegistration(){
|
||||
switch(this){
|
||||
case DRAGON: return KnowledgeRegistrations.DRAGON_ESSENCE_ALTAR;
|
||||
case FIERY: return KnowledgeRegistrations.FIERY_ESSENCE_ALTAR;
|
||||
case SPECTRAL: return KnowledgeRegistrations.SPECTRAL_ESSENCE_ALTAR;
|
||||
default: return KnowledgeRegistrations.BASIC_ESSENCE_ALTAR;
|
||||
}
|
||||
}
|
||||
|
||||
public KnowledgeRegistration getEssenceRegistration(){
|
||||
switch(this){
|
||||
case DRAGON: return KnowledgeRegistrations.DRAGON_ESSENCE;
|
||||
case FIERY: return KnowledgeRegistrations.FIERY_ESSENCE;
|
||||
case SPECTRAL: return KnowledgeRegistrations.SPECTRAL_ESSENCE;
|
||||
default: return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static EssenceType getById(int id){
|
||||
for(EssenceType type:values()){
|
||||
if (type.id == id)return type;
|
||||
|
||||
@@ -12,7 +12,6 @@ import net.minecraft.enchantment.Enchantment;
|
||||
import net.minecraft.enchantment.EnchantmentData;
|
||||
import net.minecraft.enchantment.EnchantmentHelper;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
@@ -23,8 +22,6 @@ import chylex.hee.entity.item.EntityItemAltar;
|
||||
import chylex.hee.item.ItemList;
|
||||
import chylex.hee.mechanics.essence.EssenceType;
|
||||
import chylex.hee.mechanics.essence.handler.dragon.AltarItemRecipe;
|
||||
import chylex.hee.mechanics.knowledge.KnowledgeRegistrations;
|
||||
import chylex.hee.mechanics.knowledge.util.ObservationUtil;
|
||||
import chylex.hee.packets.PacketPipeline;
|
||||
import chylex.hee.packets.client.C11ParticleAltarOrb;
|
||||
import chylex.hee.system.util.DragonUtil;
|
||||
@@ -315,7 +312,6 @@ public class DragonEssenceHandler extends AltarActionHandler{
|
||||
|
||||
recipe.doTransaction(item);
|
||||
item.hasChanged = true;
|
||||
for(EntityPlayer observer:ObservationUtil.getAllObservers(item,8D))KnowledgeRegistrations.DRAGON_ESSENCE_ALTAR.tryUnlockFragment(observer,0.3F);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package chylex.hee.mechanics.essence.handler;
|
||||
import static chylex.hee.mechanics.essence.SocketManager.*;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.FurnaceRecipes;
|
||||
@@ -10,9 +9,6 @@ import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.tileentity.TileEntityBrewingStand;
|
||||
import net.minecraft.tileentity.TileEntityFurnace;
|
||||
import chylex.hee.api.interfaces.IAcceptFieryEssence;
|
||||
import chylex.hee.block.BlockList;
|
||||
import chylex.hee.mechanics.essence.EssenceType;
|
||||
import chylex.hee.mechanics.knowledge.util.ObservationUtil;
|
||||
import chylex.hee.packets.PacketPipeline;
|
||||
import chylex.hee.packets.client.C11ParticleAltarOrb;
|
||||
import chylex.hee.tileentity.TileEntityEssenceAltar;
|
||||
@@ -112,12 +108,6 @@ public class FieryEssenceHandler extends AltarActionHandler{
|
||||
|
||||
private void createOrbParticle(int targetX, int targetY, int targetZ){
|
||||
PacketPipeline.sendToAllAround(altar,64D,new C11ParticleAltarOrb(altar,targetX+0.5D,targetY+0.5D,targetZ+0.5D));
|
||||
|
||||
if (rand.nextInt(17) == 0){
|
||||
for(EntityPlayer observer:ObservationUtil.getAllObservers(altar.getWorldObj(),altar.xCoord+0.5D,altar.yCoord+0.5D,altar.zCoord+0.5D,16D)){
|
||||
EssenceType.FIERY.getAltarRegistration().tryUnlockFragment(observer,0.15F);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,124 +1,6 @@
|
||||
package chylex.hee.mechanics.knowledge;
|
||||
import static chylex.hee.mechanics.knowledge.data.KnowledgeCategory.*;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.boss.EntityDragon;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import chylex.hee.block.BlockCrossedDecoration;
|
||||
import chylex.hee.block.BlockEndstoneTerrain;
|
||||
import chylex.hee.block.BlockList;
|
||||
import chylex.hee.entity.boss.EntityBossEnderDemon;
|
||||
import chylex.hee.entity.boss.EntityMiniBossEnderEye;
|
||||
import chylex.hee.entity.boss.EntityMiniBossFireFiend;
|
||||
import chylex.hee.entity.mob.EntityMobAngryEnderman;
|
||||
import chylex.hee.entity.mob.EntityMobBabyEnderman;
|
||||
import chylex.hee.entity.mob.EntityMobEnderGuardian;
|
||||
import chylex.hee.entity.mob.EntityMobFireGolem;
|
||||
import chylex.hee.entity.mob.EntityMobInfestedBat;
|
||||
import chylex.hee.entity.mob.EntityMobParalyzedEnderman;
|
||||
import chylex.hee.entity.mob.EntityMobScorchingLens;
|
||||
import chylex.hee.entity.mob.EntityMobVampiricBat;
|
||||
import chylex.hee.item.ItemList;
|
||||
import chylex.hee.mechanics.enhancements.EnhancementFragmentUtil;
|
||||
import chylex.hee.mechanics.enhancements.types.EnderPearlEnhancements;
|
||||
import chylex.hee.mechanics.enhancements.types.SoulCharmEnhancements;
|
||||
import chylex.hee.mechanics.enhancements.types.TNTEnhancements;
|
||||
import chylex.hee.mechanics.enhancements.types.TransferenceGemEnhancements;
|
||||
import chylex.hee.mechanics.essence.EssenceType;
|
||||
import chylex.hee.mechanics.knowledge.data.KnowledgeRegistration;
|
||||
import chylex.hee.mechanics.knowledge.data.renderer.EntityRenderer;
|
||||
import chylex.hee.mechanics.knowledge.data.renderer.EntityRenderer.IEntityInitializer;
|
||||
import chylex.hee.mechanics.knowledge.data.renderer.ItemStackRenderer;
|
||||
import chylex.hee.mechanics.knowledge.fragment.CraftingKnowledgeFragment;
|
||||
import chylex.hee.mechanics.knowledge.fragment.IFragmentUnlockAction;
|
||||
import chylex.hee.mechanics.knowledge.fragment.KnowledgeFragment;
|
||||
import chylex.hee.mechanics.knowledge.fragment.TextKnowledgeFragment;
|
||||
import chylex.hee.system.logging.Stopwatch;
|
||||
|
||||
/*
|
||||
public final class KnowledgeRegistrations{
|
||||
private static final int dist = 28, hdist = dist/2;
|
||||
|
||||
public static final KnowledgeRegistration
|
||||
HELP = new KnowledgeRegistration(null,null),
|
||||
|
||||
ALTAR_NEXUS = new KnowledgeRegistration(ALTARS_AND_ESSENCES, "altarNexus"), //
|
||||
BASIC_ESSENCE_ALTAR = new KnowledgeRegistration(ALTARS_AND_ESSENCES, "basicEssenceAltar"), //
|
||||
DRAGON_ESSENCE = new KnowledgeRegistration(ALTARS_AND_ESSENCES, "dragonEssence"), //
|
||||
DRAGON_ESSENCE_ALTAR = new KnowledgeRegistration(ALTARS_AND_ESSENCES, "dragonEssenceAltar"), //
|
||||
FIERY_ESSENCE = new KnowledgeRegistration(ALTARS_AND_ESSENCES, "fieryEssence"), //
|
||||
FIERY_ESSENCE_ALTAR = new KnowledgeRegistration(ALTARS_AND_ESSENCES, "fieryEssenceAltar"), //
|
||||
SPECTRAL_ESSENCE = new KnowledgeRegistration(ALTARS_AND_ESSENCES, "spectralEssence"),
|
||||
SPECTRAL_ESSENCE_ALTAR = new KnowledgeRegistration(ALTARS_AND_ESSENCES, "spectralEssenceAltar"),
|
||||
DECOMPOSITION_TABLE = new KnowledgeRegistration(ALTARS_AND_ESSENCES, "decompositionTable"), //
|
||||
ENERGY_EXTRACTION_TABLE = new KnowledgeRegistration(ALTARS_AND_ESSENCES, "energyExtractionTable"), //
|
||||
|
||||
ENDER_PEARLS_ENH = new KnowledgeRegistration(ENHANCEMENTS, "enderPearlsEnh"), //
|
||||
TRANSFERENCE_GEM_ENH = new KnowledgeRegistration(ENHANCEMENTS, "transferenceGemEnh"), //
|
||||
TNT_ENH = new KnowledgeRegistration(ENHANCEMENTS, "tntEnh"), //
|
||||
SOUL_CHARM_ENH = new KnowledgeRegistration(ENHANCEMENTS, "soulCharmEnh"), //
|
||||
ENHANCED_BREWING_STAND = new KnowledgeRegistration(ENHANCEMENTS, "enhancedBrewingStand"), //
|
||||
INSTABILITY_POTION = new KnowledgeRegistration(ENHANCEMENTS, "instabilityPotion"), //
|
||||
|
||||
BIOME_COMPASS = new KnowledgeRegistration(ENDER_DEXTERITY, "biomeCompass"), //
|
||||
SPATIAL_DASH_GEM = new KnowledgeRegistration(ENDER_DEXTERITY, "spatialDashGem"), //
|
||||
TRANSFERENCE_GEM = new KnowledgeRegistration(ENDER_DEXTERITY, "transferenceGem"),
|
||||
TEMPLE_CALLER = new KnowledgeRegistration(ENDER_DEXTERITY, "templeCaller"), //
|
||||
ENDERMAN_RELIC = new KnowledgeRegistration(ENDER_DEXTERITY, "endermanRelic"), // UPD removed all
|
||||
ENERGY_CLUSTER = new KnowledgeRegistration(ENDER_DEXTERITY, "energyCluster"), //
|
||||
|
||||
FALLING_OBSIDIAN = new KnowledgeRegistration(BLOCKS_AND_ORES, "fallingObsidian"), //
|
||||
OBSIDIAN_VARIATIONS = new KnowledgeRegistration(BLOCKS_AND_ORES, "specialObsidian"), //
|
||||
SPHALERITE = new KnowledgeRegistration(BLOCKS_AND_ORES, "sphalerite"), //
|
||||
END_POWDER_ORE = new KnowledgeRegistration(BLOCKS_AND_ORES, "endPowderOre"), //
|
||||
STARDUST_ORE = new KnowledgeRegistration(BLOCKS_AND_ORES, "stardustOre"), //
|
||||
IGNEOUS_ROCK_ORE = new KnowledgeRegistration(BLOCKS_AND_ORES, "igneousRockOre"), //
|
||||
INSTABILITY_ORB_ORE = new KnowledgeRegistration(BLOCKS_AND_ORES, "instabilityOrbOre"), //
|
||||
END_POWDER = new KnowledgeRegistration(BLOCKS_AND_ORES, "endPowder"), //
|
||||
STARDUST = new KnowledgeRegistration(BLOCKS_AND_ORES, "stardust"), //
|
||||
IGNEOUS_ROCK = new KnowledgeRegistration(BLOCKS_AND_ORES, "igneousRock"), //
|
||||
INSTABILITY_ORB = new KnowledgeRegistration(BLOCKS_AND_ORES, "instabilityOrb"), //
|
||||
|
||||
ENDER_DRAGON = new KnowledgeRegistration(CREATURES, "enderDragon"), //
|
||||
ENDER_EYE = new KnowledgeRegistration(CREATURES, "enderEye"), //
|
||||
FIRE_FIEND = new KnowledgeRegistration(CREATURES, "fireFiend"), //
|
||||
ENDER_DEMON = new KnowledgeRegistration(CREATURES, "enderDemon"), // UPD removed all
|
||||
ANGRY_ENDERMAN = new KnowledgeRegistration(CREATURES, "angryEnderman"), //
|
||||
BABY_ENDERMAN = new KnowledgeRegistration(CREATURES, "babyEnderman"), //
|
||||
PARALYZED_ENDERMAN = new KnowledgeRegistration(CREATURES, "paralyzedEnderman"), //
|
||||
ENDER_GUARDIAN = new KnowledgeRegistration(CREATURES, "enderGuardian"), //
|
||||
VAMPIRIC_BAT = new KnowledgeRegistration(CREATURES, "vampiricBat"), //
|
||||
INFESTED_BAT = new KnowledgeRegistration(CREATURES, "infestedBat"), //
|
||||
FIRE_GOLEM = new KnowledgeRegistration(CREATURES, "fireGolem"), //
|
||||
SCORCHING_LENS = new KnowledgeRegistration(CREATURES, "scorchingLens"), //
|
||||
|
||||
SILVERFISH_BLOOD = new KnowledgeRegistration(ETHEREAL_COGNITION, "silverfishBlood"), //
|
||||
DRY_SPLINTER = new KnowledgeRegistration(ETHEREAL_COGNITION, "drySplinter"), //
|
||||
INFESTATION_REMEDY = new KnowledgeRegistration(ETHEREAL_COGNITION, "infestationRemedy"), //
|
||||
SPOOKY_TREES = new KnowledgeRegistration(ETHEREAL_COGNITION, "spookyTrees"), //
|
||||
GHOST_AMULET = new KnowledgeRegistration(ETHEREAL_COGNITION, "ghostAmulet"), //
|
||||
ECTOPLASM = new KnowledgeRegistration(ETHEREAL_COGNITION, "endoplasm"), //
|
||||
CORPOREAL_MIRAGE_ORB = new KnowledgeRegistration(ETHEREAL_COGNITION, "corporealMirageOrb"), //
|
||||
SOUL_CHARM = new KnowledgeRegistration(ETHEREAL_COGNITION, "soulCharm"), //
|
||||
SPECTRAL_WAND = new KnowledgeRegistration(ETHEREAL_COGNITION, "spectralWand"), //
|
||||
|
||||
DRAGON_LAIR = new KnowledgeRegistration(ENVIRONMENT_STRUCTURES, "dragonLair"), //
|
||||
ENDSTONE_BLOB = new KnowledgeRegistration(ENVIRONMENT_STRUCTURES, "endstoneBlob"), //
|
||||
DUNGEON_TOWER = new KnowledgeRegistration(ENVIRONMENT_STRUCTURES, "dungeonTower"), //
|
||||
METEOROID = new KnowledgeRegistration(ENVIRONMENT_STRUCTURES, "meteoroid"), //
|
||||
INFESTED_FOREST_BIOME = new KnowledgeRegistration(ENVIRONMENT_STRUCTURES, "infestedForestBiome"), //
|
||||
BURNING_MOUNTAINS_BIOME = new KnowledgeRegistration(ENVIRONMENT_STRUCTURES, "burningMountainsBiome"), //
|
||||
ENCHANTED_ISLAND_BIOME = new KnowledgeRegistration(ENVIRONMENT_STRUCTURES, "enchantedIslandBiome"), //
|
||||
|
||||
KNOWLEDGE_FRAGMENT = new KnowledgeRegistration(MISCELLANEOUS, "knowledgeFragment"), //
|
||||
ADVENTURERS_DIARY = new KnowledgeRegistration(MISCELLANEOUS, "adventurersDiary"), //
|
||||
ENDER_GOO = new KnowledgeRegistration(MISCELLANEOUS, "enderGoo"), //
|
||||
DEATH_FLOWER = new KnowledgeRegistration(MISCELLANEOUS, "deathFlower"), //
|
||||
LILYFIRE = new KnowledgeRegistration(MISCELLANEOUS, "lilyfire"), //
|
||||
ENDERMAN_HEAD = new KnowledgeRegistration(MISCELLANEOUS, "endermanHead"), //
|
||||
MUSIC_DISCS = new KnowledgeRegistration(MISCELLANEOUS, "musicDiscs"); //
|
||||
|
||||
public static void initialize(){
|
||||
Stopwatch.time("KnowledgeRegistrations");
|
||||
|
||||
@@ -130,10 +12,6 @@ public final class KnowledgeRegistrations{
|
||||
new TextKnowledgeFragment(3).setLocalizedText("Some fragments may not be fully researched at first, and another fragment will have to be unlocked to clarify it.")
|
||||
});
|
||||
|
||||
/*
|
||||
* ALTARS AND ESSENCES
|
||||
*/
|
||||
|
||||
ALTAR_NEXUS
|
||||
.setPosition(0,dist*3-hdist)
|
||||
.setRenderer(new ItemStackRenderer(ItemList.altar_nexus))
|
||||
@@ -230,10 +108,6 @@ public final class KnowledgeRegistrations{
|
||||
new TextKnowledgeFragment(6).setLocalizedText("Leaking can be massively suppressed by placing Instability Orbs into the Table.").setUnlockRequirements(5)
|
||||
});
|
||||
|
||||
/*
|
||||
* ENHANCEMENTS
|
||||
*/
|
||||
|
||||
ENDER_PEARLS_ENH
|
||||
.setPosition(-dist,-hdist)
|
||||
.setRenderer(new ItemStackRenderer(Items.ender_pearl).setTooltip("Ender Pearl Enhancements"))
|
||||
@@ -282,10 +156,6 @@ public final class KnowledgeRegistrations{
|
||||
new TextKnowledgeFragment(1).setLocalizedText("Splash potion will give everybody a different effect.").setUnlockRequirements(0)
|
||||
});
|
||||
|
||||
/*
|
||||
* ENDER DEXTERITY
|
||||
*/
|
||||
|
||||
BIOME_COMPASS
|
||||
.setPosition(-dist-hdist,0)
|
||||
.setRenderer(new ItemStackRenderer(ItemList.biome_compass))
|
||||
@@ -341,7 +211,7 @@ public final class KnowledgeRegistrations{
|
||||
new CraftingKnowledgeFragment(5).setRecipeFromRegistry(new ItemStack(ItemList.enderman_relic)).setUnlockRequirements(4),
|
||||
new TextKnowledgeFragment(6).setLocalizedText("Repaired relic will drain all powers from Endermen, which attack the owner, turn them into Paralyzed Endermen, and damage the relic in the process.").setUnlockRequirements(5),
|
||||
new TextKnowledgeFragment(7).setLocalizedText("The relic can be repaired using energy from Energy Clusters.").setUnlockRequirements(6)*/
|
||||
});
|
||||
/*});
|
||||
|
||||
ENERGY_CLUSTER
|
||||
.setPosition(0,0)
|
||||
@@ -356,10 +226,6 @@ public final class KnowledgeRegistrations{
|
||||
new TextKnowledgeFragment(6).setLocalizedText("Spectral Wand can move the clusters, one at a time.").setUnlockRequirements(0)
|
||||
});
|
||||
|
||||
/*
|
||||
* BLOCKS AND ORES
|
||||
*/
|
||||
|
||||
FALLING_OBSIDIAN
|
||||
.setPosition(-hdist,-dist)
|
||||
.setRenderer(new ItemStackRenderer(BlockList.obsidian_falling))
|
||||
@@ -485,10 +351,6 @@ public final class KnowledgeRegistrations{
|
||||
new TextKnowledgeFragment(4).setLocalizedText("Inside an Energy Extraction Table, it stabilizes the stored Energy and prevents it from leaking into the world.")
|
||||
});
|
||||
|
||||
/*
|
||||
* CREATURES
|
||||
*/
|
||||
|
||||
ENDER_DRAGON
|
||||
.setPosition(0,-dist*3+hdist)
|
||||
.setRenderer(new EntityRenderer(EntityDragon.class,0.95F).setRotation(-127F).setTooltip("Ender Dragon"))
|
||||
@@ -552,7 +414,7 @@ public final class KnowledgeRegistrations{
|
||||
new TextKnowledgeFragment(3).setLocalizedText("When enough damage has been dealt, it will quickly strike purple lightning, which causes massive amount of damage to the demon if it hits ?????.").setReplacedBy(4).setUnlockRequirements(1,2),
|
||||
new TextKnowledgeFragment(4).setLocalizedText("When enough damage has been dealt, it will quickly strike purple lightning, which causes massive amount of damage to the demon if it hits water.").setReplacementFor(3).setUnlockRequirements(3),
|
||||
new TextKnowledgeFragment(5).setLocalizedText("Death is followed by lightning strikes, and the demon drops second piece of Shattered Enderman Relic.").setUnlockRequirements(4)*/
|
||||
});
|
||||
/*});
|
||||
|
||||
ANGRY_ENDERMAN
|
||||
.setPosition(-dist*3,dist*2)
|
||||
@@ -643,10 +505,6 @@ public final class KnowledgeRegistrations{
|
||||
new TextKnowledgeFragment(4).setLocalizedText("Drops 0-2 Igneous Rock and 1-2 Fiery Essence.").setReplacementFor(3).setUnlockRequirements(3)
|
||||
});
|
||||
|
||||
/*
|
||||
* ETHEREAL COGNITION
|
||||
*/
|
||||
|
||||
SILVERFISH_BLOOD
|
||||
.setPosition(-dist*3,-dist)
|
||||
.setRenderer(new ItemStackRenderer(ItemList.silverfish_blood))
|
||||
@@ -738,10 +596,6 @@ public final class KnowledgeRegistrations{
|
||||
new TextKnowledgeFragment(2).setLocalizedText("Releasing a captured Energy Cluster will weaken it and halve its energy.").setUnlockRequirements(1)
|
||||
});
|
||||
|
||||
/*
|
||||
* ENVIRONMENT STRUCTURES
|
||||
*/
|
||||
|
||||
DRAGON_LAIR
|
||||
.setPosition(dist*2+hdist,0)
|
||||
.setRenderer(new ItemStackRenderer(Blocks.dragon_egg).setTooltip("Dragon Lair"))
|
||||
@@ -820,10 +674,6 @@ public final class KnowledgeRegistrations{
|
||||
new TextKnowledgeFragment(4).setLocalizedText("Inside the terrain can be found Block Stashes, which are rectangular rooms with piles of blocks stolen by Endermen.").setUnlockRequirements(1,2)
|
||||
});
|
||||
|
||||
/*
|
||||
* MISCELLANEOUS
|
||||
*/
|
||||
|
||||
KNOWLEDGE_FRAGMENT
|
||||
.setPosition(dist,-dist*2)
|
||||
.setRenderer(new ItemStackRenderer(ItemList.knowledge_fragment))
|
||||
@@ -890,4 +740,4 @@ public final class KnowledgeRegistrations{
|
||||
}
|
||||
|
||||
private KnowledgeRegistrations(){}
|
||||
}
|
||||
}*/
|
||||
@@ -1,72 +0,0 @@
|
||||
package chylex.hee.mechanics.knowledge.data;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import chylex.hee.block.BlockEndstoneTerrain;
|
||||
import chylex.hee.block.BlockList;
|
||||
import chylex.hee.item.ItemList;
|
||||
import chylex.hee.mechanics.essence.EssenceType;
|
||||
import chylex.hee.mechanics.knowledge.util.IGuiItemStackRenderer;
|
||||
|
||||
public class KnowledgeCategory implements IGuiItemStackRenderer{
|
||||
public static final KnowledgeCategory ALTARS_AND_ESSENCES, ENHANCEMENTS, CREATURES, ENVIRONMENT_STRUCTURES,
|
||||
ETHEREAL_COGNITION, BLOCKS_AND_ORES, ENDER_DEXTERITY, MISCELLANEOUS;
|
||||
|
||||
public static final KnowledgeCategory[] categories = new KnowledgeCategory[]{
|
||||
ALTARS_AND_ESSENCES = new KnowledgeCategory("essences", 0, -60, "Altars and Tables", new ItemStack(BlockList.essence_altar, 1, EssenceType.DRAGON.id)),
|
||||
ENHANCEMENTS = new KnowledgeCategory("enhancements", 45, -45, "Enhancements", new ItemStack(Items.ender_pearl)),
|
||||
ENDER_DEXTERITY = new KnowledgeCategory("enderpowers", 60, 0, "Ender Dexterity", new ItemStack(ItemList.transference_gem)),
|
||||
BLOCKS_AND_ORES = new KnowledgeCategory("ores", 45, 45, "Blocks and Ores", new ItemStack(BlockList.end_powder_ore)),
|
||||
CREATURES = new KnowledgeCategory("creatures", 0, 60, "Creatures", new ItemStack(ItemList.enderman_head)),
|
||||
ETHEREAL_COGNITION = new KnowledgeCategory("ghoststuff", -45, 45, "Ethereal cognition", new ItemStack(ItemList.ectoplasm)),
|
||||
ENVIRONMENT_STRUCTURES = new KnowledgeCategory("worldstructures", -60, 0, "Environment structures", new ItemStack(BlockList.end_terrain, 1, BlockEndstoneTerrain.metaEnchanted)),
|
||||
MISCELLANEOUS = new KnowledgeCategory("miscellaneous", -45, -45, "Miscellaneous", new ItemStack(ItemList.music_disk)),
|
||||
};
|
||||
|
||||
public final String identifier;
|
||||
private final int x,y;
|
||||
private final int targetOffsetX,targetOffsetY;
|
||||
private final String tooltip;
|
||||
private final ItemStack is;
|
||||
public final List<KnowledgeRegistration> registrations;
|
||||
|
||||
KnowledgeCategory(String identifier, int x, int y, String tooltip, ItemStack is){
|
||||
this.identifier = identifier;
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.targetOffsetX = (int)Math.round(x*5.8333D);
|
||||
this.targetOffsetY = (int)Math.round(y*5.8333D);
|
||||
this.tooltip = tooltip;
|
||||
this.is = is;
|
||||
this.registrations = new ArrayList<KnowledgeRegistration>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getX(){
|
||||
return x;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getY(){
|
||||
return y;
|
||||
}
|
||||
|
||||
public int getTargetOffsetX(){
|
||||
return targetOffsetX;
|
||||
}
|
||||
|
||||
public int getTargetOffsetY(){
|
||||
return targetOffsetY;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTooltip(){
|
||||
return tooltip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getItemStack(){
|
||||
return is;
|
||||
}
|
||||
}
|
||||
@@ -1,141 +0,0 @@
|
||||
package chylex.hee.mechanics.knowledge.data;
|
||||
import gnu.trove.map.hash.TObjectByteHashMap;
|
||||
import java.util.HashMap;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import chylex.hee.item.ItemList;
|
||||
import chylex.hee.mechanics.knowledge.data.renderer.DummyRenderer;
|
||||
import chylex.hee.mechanics.knowledge.data.renderer.IRegistrationRenderer;
|
||||
import chylex.hee.mechanics.knowledge.fragment.KnowledgeFragment;
|
||||
import chylex.hee.packets.PacketPipeline;
|
||||
import chylex.hee.packets.client.C03KnowledgeRegistrationNotification;
|
||||
import chylex.hee.system.logging.Log;
|
||||
|
||||
public class KnowledgeRegistration{
|
||||
public static final HashMap<String,KnowledgeRegistration> lookup = new HashMap<>();
|
||||
private static final TObjectByteHashMap<String> compendiumSlotCache = new TObjectByteHashMap<>();
|
||||
private static final DummyRenderer dummyRenderer = new DummyRenderer();
|
||||
|
||||
public final KnowledgeCategory category;
|
||||
public final ObjectFragmentSet fragmentSet;
|
||||
private IRegistrationRenderer renderer;
|
||||
public final String identifier;
|
||||
private int x,y;
|
||||
private byte textureIndex;
|
||||
|
||||
public KnowledgeRegistration(KnowledgeCategory category, String identifier){
|
||||
if (category != null)(this.category = category).registrations.add(this);
|
||||
else this.category = null;
|
||||
|
||||
lookup.put(identifier,this);
|
||||
|
||||
this.fragmentSet = new ObjectFragmentSet(this);
|
||||
this.identifier = identifier;
|
||||
}
|
||||
|
||||
public KnowledgeRegistration setPosition(int x, int y){
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
return this;
|
||||
}
|
||||
|
||||
public KnowledgeRegistration setRenderer(IRegistrationRenderer renderer){
|
||||
this.renderer = renderer;
|
||||
return this;
|
||||
}
|
||||
|
||||
public KnowledgeRegistration setBackgroundTextureIndex(int index){
|
||||
this.textureIndex = (byte)index;
|
||||
return this;
|
||||
}
|
||||
|
||||
public KnowledgeRegistration setFragments(KnowledgeFragment[] fragments){
|
||||
for(KnowledgeFragment fragment:fragments)this.fragmentSet.addFragment(fragment);
|
||||
return this;
|
||||
}
|
||||
|
||||
public int getX(){
|
||||
return category.getTargetOffsetX()+x;
|
||||
}
|
||||
|
||||
public int getY(){
|
||||
return category.getTargetOffsetY()+y;
|
||||
}
|
||||
|
||||
public IRegistrationRenderer getRenderer(){
|
||||
return renderer == null?dummyRenderer:renderer;
|
||||
}
|
||||
|
||||
public int getBackgroundTextureIndex(){
|
||||
return textureIndex;
|
||||
}
|
||||
|
||||
public boolean hasSomeFragments(EntityPlayer player){
|
||||
byte cache = compendiumSlotCache.get(player.getCommandSenderName());
|
||||
if (cache != compendiumSlotCache.getNoEntryValue()){
|
||||
ItemStack invIS = player.inventory.mainInventory[cache];
|
||||
|
||||
if (invIS != null && invIS.getItem() == ItemList.ender_compendium)return fragmentSet.getUnlockedFragments(invIS).length > 0;
|
||||
else compendiumSlotCache.remove(player.getCommandSenderName());
|
||||
}
|
||||
|
||||
for(int a = 0; a < player.inventory.mainInventory.length; a++){
|
||||
ItemStack invIS = player.inventory.mainInventory[a];
|
||||
if (invIS == null || invIS.getItem() != ItemList.ender_compendium)continue;
|
||||
|
||||
compendiumSlotCache.put(player.getCommandSenderName(),(byte)a);
|
||||
return fragmentSet.getUnlockedFragments(invIS).length > 0;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public UnlockResult tryUnlockFragment(EntityPlayer player, float chance){
|
||||
return tryUnlockFragment(player,chance,null);
|
||||
}
|
||||
|
||||
public UnlockResult tryUnlockFragment(EntityPlayer player, float chance, byte[] unlockableFragments){
|
||||
if (player == null){
|
||||
Thread.dumpStack();
|
||||
Log.error("Player is null when unlocking knowledge fragment!");
|
||||
return UnlockResult.BAD_LUCK;
|
||||
}
|
||||
|
||||
if (player.getRNG().nextFloat() >= chance)return UnlockResult.BAD_LUCK;
|
||||
|
||||
int compendiumSlot = -1,paperSlot = -1;
|
||||
ItemStack[] inv = player.inventory.mainInventory;
|
||||
|
||||
byte cache = compendiumSlotCache.get(player.getCommandSenderName());
|
||||
if (cache != compendiumSlotCache.getNoEntryValue()){
|
||||
ItemStack invIS = inv[cache];
|
||||
|
||||
if (invIS != null && invIS.getItem() == ItemList.ender_compendium)compendiumSlot = cache;
|
||||
else compendiumSlotCache.remove(player.getCommandSenderName());
|
||||
}
|
||||
|
||||
for(int a = 0; a < inv.length && (compendiumSlot == -1 || paperSlot == -1); a++){
|
||||
ItemStack invIS = inv[a];
|
||||
|
||||
if (invIS == null)continue;
|
||||
if (compendiumSlot == -1 && invIS.getItem() == ItemList.ender_compendium)compendiumSlotCache.put(player.getCommandSenderName(),(byte)(compendiumSlot = a));
|
||||
if (paperSlot == -1 && invIS.getItem() == Items.paper)paperSlot = a;
|
||||
}
|
||||
|
||||
if (compendiumSlot == -1)return UnlockResult.NO_COMPENDIUM;
|
||||
|
||||
if (paperSlot == -1){
|
||||
PacketPipeline.sendToPlayer(player,new C03KnowledgeRegistrationNotification(-1));
|
||||
return UnlockResult.NO_PAPER;
|
||||
}
|
||||
|
||||
if (fragmentSet.unlockRandomFragment(player,inv[compendiumSlot],unlockableFragments)){
|
||||
if (--inv[paperSlot].stackSize == 0)inv[paperSlot] = null;
|
||||
player.inventoryContainer.detectAndSendChanges();
|
||||
return UnlockResult.SUCCESSFUL;
|
||||
}
|
||||
|
||||
return UnlockResult.NOTHING_TO_UNLOCK;
|
||||
}
|
||||
}
|
||||
@@ -1,121 +0,0 @@
|
||||
package chylex.hee.mechanics.knowledge.data;
|
||||
import gnu.trove.list.array.TByteArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.Set;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import chylex.hee.mechanics.knowledge.fragment.KnowledgeFragment;
|
||||
import chylex.hee.packets.PacketPipeline;
|
||||
import chylex.hee.packets.client.C03KnowledgeRegistrationNotification;
|
||||
|
||||
public class ObjectFragmentSet{
|
||||
private final KnowledgeRegistration registration;
|
||||
private final Set<KnowledgeFragment> fragments;
|
||||
|
||||
public ObjectFragmentSet(KnowledgeRegistration registration){
|
||||
this.registration = registration;
|
||||
this.fragments = new LinkedHashSet<KnowledgeFragment>();
|
||||
}
|
||||
|
||||
public void addFragment(KnowledgeFragment fragment){
|
||||
fragments.add(fragment);
|
||||
}
|
||||
|
||||
public KnowledgeFragment getFragmentById(int id){
|
||||
for(KnowledgeFragment fragment:fragments){
|
||||
if (fragment.id == id)return fragment;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public Set<KnowledgeFragment> getAllFragments(){
|
||||
return Collections.unmodifiableSet(fragments);
|
||||
}
|
||||
|
||||
// ITEMSTACK METHODS
|
||||
|
||||
public int[] getUnlockedFragments(ItemStack is){
|
||||
if (is.stackTagCompound == null)return ArrayUtils.EMPTY_INT_ARRAY;
|
||||
return is.stackTagCompound.getCompoundTag("knowledge").getCompoundTag(registration.category.identifier).getIntArray(registration.identifier);
|
||||
}
|
||||
|
||||
public boolean checkUnlockRequirements(ItemStack is, int fragmentId){
|
||||
int[] unlocked = getUnlockedFragments(is);
|
||||
|
||||
for(int requirement:getFragmentById(fragmentId).getUnlockRequirements()){
|
||||
if (!ArrayUtils.contains(unlocked,requirement))return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public void unlockAllFragments(ItemStack is){
|
||||
if (is.stackTagCompound == null)is.stackTagCompound = new NBTTagCompound();
|
||||
|
||||
NBTTagCompound knowledgeData = is.stackTagCompound.getCompoundTag("knowledge");
|
||||
NBTTagCompound category = knowledgeData.getCompoundTag(registration.category.identifier);
|
||||
|
||||
int[] fragments = new int[this.fragments.size()];
|
||||
int a = 0;
|
||||
for(KnowledgeFragment fragment:this.fragments)fragments[a++] = fragment.id;
|
||||
|
||||
category.setIntArray(registration.identifier,fragments);
|
||||
knowledgeData.setTag(registration.category.identifier,category);
|
||||
is.stackTagCompound.setTag("knowledge",knowledgeData);
|
||||
}
|
||||
|
||||
public boolean unlockFragment(EntityPlayer player, ItemStack is, byte fragmentId){
|
||||
if (is.stackTagCompound == null)is.stackTagCompound = new NBTTagCompound();
|
||||
|
||||
NBTTagCompound knowledgeData = is.stackTagCompound.getCompoundTag("knowledge");
|
||||
NBTTagCompound category = knowledgeData.getCompoundTag(registration.category.identifier);
|
||||
|
||||
if (category.hasKey(registration.identifier)){
|
||||
int[] unlocked = category.getIntArray(registration.identifier);
|
||||
if (ArrayUtils.contains(unlocked,fragmentId))return false;
|
||||
|
||||
registration.fragmentSet.getFragmentById(fragmentId).onUnlocked(unlocked,player);
|
||||
|
||||
int[] newUnlocked = Arrays.copyOf(unlocked,unlocked.length+1);
|
||||
newUnlocked[unlocked.length] = fragmentId;
|
||||
Arrays.sort(newUnlocked);
|
||||
|
||||
category.setIntArray(registration.identifier,newUnlocked);
|
||||
}
|
||||
else category.setIntArray(registration.identifier,new int[]{ fragmentId });
|
||||
|
||||
knowledgeData.setTag(registration.category.identifier,category);
|
||||
is.stackTagCompound.setTag("knowledge",knowledgeData);
|
||||
|
||||
NBTTagCompound lastUnlock = new NBTTagCompound();
|
||||
lastUnlock.setShort("time",(short)200);
|
||||
lastUnlock.setString("cat",registration.category.identifier);
|
||||
lastUnlock.setString("reg",registration.identifier);
|
||||
lastUnlock.setByte("fid",fragmentId);
|
||||
is.stackTagCompound.setTag("knowledgeLast",lastUnlock);
|
||||
|
||||
if (player != null){
|
||||
PacketPipeline.sendToPlayer(player,new C03KnowledgeRegistrationNotification(registration.identifier));
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean unlockRandomFragment(EntityPlayer player, ItemStack is, byte[] unlockableFragments){
|
||||
TByteArrayList canUnlock = new TByteArrayList(10);
|
||||
|
||||
int[] unlocked = is.stackTagCompound == null ? null : is.stackTagCompound.getCompoundTag("knowledge").getCompoundTag(registration.category.identifier).getIntArray(registration.identifier);
|
||||
|
||||
for(KnowledgeFragment fragment:fragments){
|
||||
if (checkUnlockRequirements(is,fragment.id) && (unlocked == null || !ArrayUtils.contains(unlocked,fragment.id)) && (unlockableFragments == null || ArrayUtils.contains(unlockableFragments,fragment.id))){
|
||||
canUnlock.add(fragment.id);
|
||||
}
|
||||
}
|
||||
|
||||
return canUnlock.isEmpty() ? false : unlockFragment(player,is,canUnlock.get(player.getRNG().nextInt(canUnlock.size())));
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
package chylex.hee.mechanics.knowledge.data;
|
||||
|
||||
public enum UnlockResult{
|
||||
BAD_LUCK, NO_COMPENDIUM, NO_PAPER, NOTHING_TO_UNLOCK(false), SUCCESSFUL;
|
||||
|
||||
public final boolean stopTrying;
|
||||
|
||||
UnlockResult(){
|
||||
stopTrying = true;
|
||||
}
|
||||
|
||||
UnlockResult(boolean stopTrying){
|
||||
this.stopTrying = stopTrying;
|
||||
}
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
package chylex.hee.mechanics.knowledge.data.renderer;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public final class DummyRenderer implements IRegistrationRenderer{
|
||||
private String customTooltip;
|
||||
|
||||
@Override
|
||||
public IRegistrationRenderer setTooltip(String tooltip){
|
||||
customTooltip = tooltip;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTooltip(){
|
||||
return customTooltip == null ? "DummyRenderer" : customTooltip;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void render(Minecraft mc, int x, int y){}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
package chylex.hee.mechanics.knowledge.data.renderer;
|
||||
import net.minecraft.client.Minecraft;
|
||||
/*import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.OpenGlHelper;
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
@@ -102,4 +102,4 @@ public class EntityRenderer implements IRegistrationRenderer{
|
||||
public static interface IEntityInitializer{
|
||||
void spawnEntity(EntityLivingBase entity);
|
||||
}
|
||||
}
|
||||
}*/
|
||||
@@ -1,11 +0,0 @@
|
||||
package chylex.hee.mechanics.knowledge.data.renderer;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public interface IRegistrationRenderer{
|
||||
IRegistrationRenderer setTooltip(String tooltip);
|
||||
String getTooltip();
|
||||
@SideOnly(Side.CLIENT)
|
||||
void render(Minecraft mc, int x, int y);
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
package chylex.hee.mechanics.knowledge.data.renderer;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import chylex.hee.gui.GuiKnowledgeBook;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemStackRenderer implements IRegistrationRenderer{
|
||||
private ItemStack isToShow;
|
||||
private String customTooltip;
|
||||
|
||||
public ItemStackRenderer(Block block){
|
||||
this.isToShow = new ItemStack(block);
|
||||
}
|
||||
|
||||
public ItemStackRenderer(Block block, int metadata){
|
||||
this.isToShow = new ItemStack(block,1,metadata);
|
||||
}
|
||||
|
||||
public ItemStackRenderer(Item item){
|
||||
this.isToShow = new ItemStack(item);
|
||||
}
|
||||
|
||||
public ItemStackRenderer(Item item, int damage){
|
||||
this.isToShow = new ItemStack(item,1,damage);
|
||||
}
|
||||
|
||||
public ItemStackRenderer(ItemStack isToShow){
|
||||
this.isToShow = isToShow;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IRegistrationRenderer setTooltip(String tooltip){
|
||||
this.customTooltip = tooltip;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTooltip(){
|
||||
return customTooltip == null?isToShow.getDisplayName():customTooltip;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void render(Minecraft mc, int x, int y){
|
||||
GuiKnowledgeBook.renderItem.renderItemIntoGUI(mc.fontRenderer,mc.getTextureManager(),isToShow,x,y);
|
||||
}
|
||||
}
|
||||
+3
-3
@@ -10,7 +10,7 @@ import net.minecraft.item.crafting.ShapelessRecipes;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
import chylex.hee.gui.GuiKnowledgeBook;
|
||||
import chylex.hee.gui.GuiEnderCompendium;
|
||||
import chylex.hee.gui.helpers.GuiItemRenderHelper;
|
||||
import chylex.hee.item.ItemList;
|
||||
import chylex.hee.item.ItemSpecialEffects;
|
||||
@@ -109,11 +109,11 @@ public class CraftingKnowledgeFragment extends KnowledgeFragment{
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
|
||||
}
|
||||
else if (isUnlocked && GuiKnowledgeBook.mouseX > xx+1 && GuiKnowledgeBook.mouseX < xx+18 && GuiKnowledgeBook.mouseY >= yy+1 && GuiKnowledgeBook.mouseY <= yy+18){
|
||||
else if (isUnlocked && GuiEnderCompendium.mouseX > xx+1 && GuiEnderCompendium.mouseX < xx+18 && GuiEnderCompendium.mouseY >= yy+1 && GuiEnderCompendium.mouseY <= yy+18){
|
||||
StringBuilder build = new StringBuilder();
|
||||
List<String> tooltip = is.getTooltip(mc.thePlayer,false);
|
||||
for(String line:tooltip)build.append(line).append("\n");
|
||||
GuiItemRenderHelper.drawTooltip((GuiKnowledgeBook)mc.currentScreen,mc.fontRenderer,GuiKnowledgeBook.mouseX,GuiKnowledgeBook.mouseY,build.toString());
|
||||
GuiItemRenderHelper.drawTooltip((GuiEnderCompendium)mc.currentScreen,mc.fontRenderer,GuiEnderCompendium.mouseX,GuiEnderCompendium.mouseY,build.toString());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
package chylex.hee.mechanics.knowledge.fragment;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
||||
public interface IFragmentUnlockAction{
|
||||
void trigger(EntityPlayer player);
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
package chylex.hee.mechanics.knowledge.fragment;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public abstract class KnowledgeFragment{
|
||||
public final byte id;
|
||||
private int[] requirements = new int[0];
|
||||
private IFragmentUnlockAction unlockAction;
|
||||
|
||||
protected KnowledgeFragment(int id){
|
||||
this.id = (byte)id;
|
||||
}
|
||||
|
||||
public KnowledgeFragment setUnlockRequirements(int...unlockRequirementIds){
|
||||
requirements = unlockRequirementIds;
|
||||
return this;
|
||||
}
|
||||
|
||||
public KnowledgeFragment setUnlockAction(IFragmentUnlockAction action){
|
||||
this.unlockAction = action;
|
||||
return this;
|
||||
}
|
||||
|
||||
public int[] getUnlockRequirements(){
|
||||
return requirements;
|
||||
}
|
||||
|
||||
public boolean canShow(int[] unlockedFragments){
|
||||
return true;
|
||||
}
|
||||
|
||||
public void onUnlocked(int[] unlockedFragments, EntityPlayer player){
|
||||
if (unlockAction != null)unlockAction.trigger(player);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public abstract int getHeight(Minecraft mc, boolean isUnlocked);
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public abstract void render(int x, int y, Minecraft mc, boolean isUnlocked);
|
||||
|
||||
@Override
|
||||
public final boolean equals(Object o){
|
||||
return (o instanceof KnowledgeFragment)?((KnowledgeFragment)o).id == id:false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final int hashCode(){
|
||||
return id;
|
||||
}
|
||||
}
|
||||
@@ -1,80 +0,0 @@
|
||||
package chylex.hee.mechanics.knowledge.fragment;
|
||||
import java.util.Arrays;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import chylex.hee.gui.GuiKnowledgeBook;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class TextKnowledgeFragment extends KnowledgeFragment{
|
||||
private String name;
|
||||
private boolean useAssets;
|
||||
private short replacedBy = -1;
|
||||
private short replacementFor = -1;
|
||||
|
||||
public TextKnowledgeFragment(int id){
|
||||
super(id);
|
||||
}
|
||||
|
||||
public TextKnowledgeFragment setUnlocalizedName(String unlocalizedName){
|
||||
this.name = unlocalizedName;
|
||||
this.useAssets = true;
|
||||
return this;
|
||||
}
|
||||
|
||||
public TextKnowledgeFragment setLocalizedText(String localizedText){
|
||||
this.name = localizedText;
|
||||
this.useAssets = false;
|
||||
return this;
|
||||
}
|
||||
|
||||
public TextKnowledgeFragment setReplacedBy(int replacedById){
|
||||
this.replacedBy = (short)replacedById;
|
||||
return this;
|
||||
}
|
||||
|
||||
public TextKnowledgeFragment setReplacementFor(int replacementForId){
|
||||
this.replacementFor = (short)replacementForId;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canShow(int[] unlockedFragments){
|
||||
return (replacedBy == -1 || !ArrayUtils.contains(unlockedFragments,replacedBy)) &&
|
||||
(replacementFor == -1 || (ArrayUtils.contains(unlockedFragments,replacementFor) && ArrayUtils.contains(unlockedFragments,id)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUnlocked(int[] unlockedFragments, EntityPlayer player){
|
||||
if (replacementFor != -1 && !ArrayUtils.contains(unlockedFragments,replacementFor)){
|
||||
ArrayUtils.add(unlockedFragments,replacementFor);
|
||||
Arrays.sort(unlockedFragments);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getHeight(Minecraft mc, boolean isUnlocked){
|
||||
boolean origFont = mc.fontRenderer.getUnicodeFlag();
|
||||
mc.fontRenderer.setUnicodeFlag(true);
|
||||
int h = mc.fontRenderer.listFormattedStringToWidth(getString(isUnlocked),GuiKnowledgeBook.guiPageWidth-10).size()*mc.fontRenderer.FONT_HEIGHT;
|
||||
mc.fontRenderer.setUnicodeFlag(origFont);
|
||||
return h;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void render(int x, int y, Minecraft mc, boolean isUnlocked){
|
||||
boolean origFont = mc.fontRenderer.getUnicodeFlag();
|
||||
mc.fontRenderer.setUnicodeFlag(true);
|
||||
mc.fontRenderer.drawSplitString(getString(isUnlocked),x+1,y,GuiKnowledgeBook.guiPageWidth-10,255<<24);
|
||||
mc.fontRenderer.setUnicodeFlag(origFont);
|
||||
}
|
||||
|
||||
protected String getString(boolean isUnlocked){
|
||||
return isUnlocked ? (useAssets ? I18n.format(name) : name) : StringUtils.repeat('?',(useAssets ? I18n.format(name) : name).length());
|
||||
}
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
package chylex.hee.mechanics.knowledge.fragment;
|
||||
import net.minecraft.client.Minecraft;
|
||||
|
||||
public class TriggerKnowledgeFragment extends KnowledgeFragment{
|
||||
public TriggerKnowledgeFragment(int id){
|
||||
super(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canShow(int[] unlockedFragments){
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getHeight(Minecraft mc, boolean isUnlocked){
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(int x, int y, Minecraft mc, boolean isUnlocked){}
|
||||
}
|
||||
@@ -1,100 +0,0 @@
|
||||
package chylex.hee.mechanics.knowledge.util;
|
||||
import static chylex.hee.mechanics.knowledge.KnowledgeRegistrations.*;
|
||||
import java.util.Random;
|
||||
import chylex.hee.mechanics.knowledge.data.KnowledgeCategory;
|
||||
import chylex.hee.mechanics.knowledge.data.KnowledgeRegistration;
|
||||
import chylex.hee.system.weight.WeightedList;
|
||||
|
||||
public final class FragmentWeightLists{
|
||||
public static final FragmentWeightList overworldGeneral = new FragmentWeightList(),
|
||||
overworldMineshaft = new FragmentWeightList(),
|
||||
overworldStronghold = new FragmentWeightList(),
|
||||
villagerTrades = new FragmentWeightList(),
|
||||
endTower = new FragmentWeightList(),
|
||||
endSilverfishDungeons = new FragmentWeightList();
|
||||
|
||||
static{
|
||||
overworldMineshaft.add(ENDER_DRAGON,8)
|
||||
.add(DRAGON_LAIR,5)
|
||||
.add(ANGRY_ENDERMAN,4)
|
||||
.add(BASIC_ESSENCE_ALTAR,4)
|
||||
.add(FALLING_OBSIDIAN,3)
|
||||
.add(ALTAR_NEXUS,2)
|
||||
.add(DRAGON_ESSENCE,1)
|
||||
.add(VAMPIRIC_BAT,1);
|
||||
|
||||
overworldStronghold.add(ENDER_DRAGON,9)
|
||||
.add(DRAGON_LAIR,7)
|
||||
.add(ALTAR_NEXUS,6)
|
||||
.add(BASIC_ESSENCE_ALTAR,5)
|
||||
.add(DRAGON_ESSENCE,4)
|
||||
.add(DRAGON_ESSENCE_ALTAR,3)
|
||||
.add(TEMPLE_CALLER,3);
|
||||
|
||||
overworldGeneral.add(END_POWDER_ORE,7)
|
||||
.add(STARDUST_ORE,7)
|
||||
.add(DRAGON_LAIR,6)
|
||||
.add(ENDSTONE_BLOB,6)
|
||||
.add(END_POWDER,5)
|
||||
.add(IGNEOUS_ROCK_ORE,5)
|
||||
.add(STARDUST,4)
|
||||
.add(ENDER_PEARLS_ENH,4)
|
||||
.add(IGNEOUS_ROCK,3)
|
||||
.add(DEATH_FLOWER,3)
|
||||
.add(DUNGEON_TOWER,2);
|
||||
|
||||
villagerTrades.add(DRAGON_LAIR,8)
|
||||
.add(DUNGEON_TOWER,8)
|
||||
.add(ENDSTONE_BLOB,7)
|
||||
.add(ENDER_GOO,6)
|
||||
.add(INFESTED_FOREST_BIOME,5)
|
||||
.add(BURNING_MOUNTAINS_BIOME,5)
|
||||
.add(ENCHANTED_ISLAND_BIOME,5)
|
||||
.add(INSTABILITY_ORB_ORE,4)
|
||||
.add(ENDER_EYE,4)
|
||||
.add(ENDER_GUARDIAN,4)
|
||||
.add(BABY_ENDERMAN,4)
|
||||
.add(SCORCHING_LENS,4)
|
||||
.add(FIRE_GOLEM,4)
|
||||
.add(METEOROID,3)
|
||||
.add(SPATIAL_DASH_GEM,3)
|
||||
.add(TRANSFERENCE_GEM,3)
|
||||
.add(TEMPLE_CALLER,3);
|
||||
|
||||
endTower.add(ENDSTONE_BLOB,7)
|
||||
.add(TRANSFERENCE_GEM,6)
|
||||
.add(TEMPLE_CALLER,6)
|
||||
.add(INFESTED_FOREST_BIOME,6)
|
||||
.add(BURNING_MOUNTAINS_BIOME,6)
|
||||
.add(ENCHANTED_ISLAND_BIOME,6)
|
||||
.add(ENDER_EYE,5)
|
||||
.add(DEATH_FLOWER,4)
|
||||
.add(TRANSFERENCE_GEM_ENH,4)
|
||||
.add(OBSIDIAN_VARIATIONS,3);
|
||||
|
||||
endSilverfishDungeons.add(GHOST_AMULET,5)
|
||||
.add(SPOOKY_TREES,5)
|
||||
.add(ECTOPLASM,3)
|
||||
.add(SILVERFISH_BLOOD,3)
|
||||
.add(SPECTRAL_WAND,3)
|
||||
.add(DRY_SPLINTER,3)
|
||||
.add(INFESTATION_REMEDY,2)
|
||||
.add(INFESTED_BAT,1);
|
||||
}
|
||||
|
||||
public static class FragmentWeightList extends WeightedList<WeightedRegistrationWrapper>{
|
||||
private FragmentWeightList add(KnowledgeRegistration registration, int weight){
|
||||
this.add(new WeightedRegistrationWrapper(registration,weight));
|
||||
return this;
|
||||
}
|
||||
|
||||
private FragmentWeightList addCategory(KnowledgeCategory category, int weight){
|
||||
for(KnowledgeRegistration registration:category.registrations)this.add(new WeightedRegistrationWrapper(registration,weight));
|
||||
return this;
|
||||
}
|
||||
|
||||
public KnowledgeRegistration getRandomRegistration(Random rand){
|
||||
return super.getRandomItem(rand).getRegistration();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
package chylex.hee.mechanics.knowledge.util;
|
||||
import java.util.ArrayList;
|
||||
/*import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import net.minecraft.entity.Entity;
|
||||
@@ -57,4 +57,4 @@ public class ObservationUtil{
|
||||
MovingObjectPosition mop = player.worldObj.rayTraceBlocks(Vec3.createVectorHelper(player.posX,player.posY+player.getEyeHeight(),player.posZ),Vec3.createVectorHelper(x,y,z));
|
||||
return mop == null || (Math.abs(x-mop.blockX) < 1 && Math.abs(y-mop.blockY) < 1 && Math.abs(z-mop.blockZ) < 1);
|
||||
}
|
||||
}
|
||||
}*/
|
||||
@@ -1,22 +0,0 @@
|
||||
package chylex.hee.mechanics.knowledge.util;
|
||||
import chylex.hee.mechanics.knowledge.data.KnowledgeRegistration;
|
||||
import chylex.hee.system.weight.IWeightProvider;
|
||||
|
||||
public class WeightedRegistrationWrapper implements IWeightProvider{
|
||||
private final KnowledgeRegistration registration;
|
||||
private final byte weight;
|
||||
|
||||
WeightedRegistrationWrapper(KnowledgeRegistration registration, int weight){
|
||||
this.registration = registration;
|
||||
this.weight = (byte)weight;
|
||||
}
|
||||
|
||||
public KnowledgeRegistration getRegistration(){
|
||||
return registration;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getWeight(){
|
||||
return weight;
|
||||
}
|
||||
}
|
||||
@@ -29,12 +29,6 @@ public final class RecipeList{
|
||||
'X',ItemList.enderman_head
|
||||
);
|
||||
|
||||
GameRegistry.addShapedRecipe(new ItemStack(ItemList.ender_compendium),
|
||||
"PPP", "PEP", "PPP",
|
||||
'P',Items.paper,
|
||||
'E',Items.ender_eye
|
||||
);
|
||||
|
||||
GameRegistry.addShapedRecipe(new ItemStack(BlockList.decomposition_table),
|
||||
"PBP", "SRS", "III",
|
||||
'P', ItemList.end_powder,
|
||||
|
||||
@@ -10,7 +10,6 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class ModelEndermanHeadBiped extends ModelBiped{
|
||||
public ModelEndermanHeadBiped(){
|
||||
super();
|
||||
textureWidth = 64;
|
||||
textureHeight = 32;
|
||||
|
||||
|
||||
Loaded 100 of 113 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user