Fixed all cases of "spaces instead of tabs"

This commit is contained in:
chylex committed 2014-07-18 14:35:33 +02:00
1 parent 3d7a9bd2b9
commit 821137ff37
105 files changed
+1567 -1567

No files matched your search

@@ -136,8 +136,8 @@ public class BlockCorruptedEnergy extends Block{
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconRegister){}
public void registerBlockIcons(IIconRegister iconRegister){}
@Override
@SideOnly(Side.CLIENT)
public void randomDisplayTick(World world, int x, int y, int z, Random rand){
@@ -26,7 +26,7 @@ public class BlockEndFlower extends BlockFlower{
};
@SideOnly(Side.CLIENT)
private IIcon iconDeadFlower;
private IIcon iconDeadFlower;
protected BlockEndFlower(){
super(0);
@@ -87,7 +87,7 @@ public class BlockEnderGoo extends BlockFluidClassic{
}
@Override
public void velocityToAddToEntity(World world, int x, int y, int z, Entity entity, Vec3 vec){}
public void velocityToAddToEntity(World world, int x, int y, int z, Entity entity, Vec3 vec){}
private static final PotionEffect weakness = new PotionEffect(Potion.weakness.id,5,1,false),
miningFatigue = new PotionEffect(Potion.digSlowdown.id,5,1,false),
@@ -129,15 +129,15 @@ public class BlockEnderGoo extends BlockFluidClassic{
}
@Override
public float getFilledPercentage(World world, int x, int y, int z){
public float getFilledPercentage(World world, int x, int y, int z){
return 1F-super.getFilledPercentage(world,x,y,z);
}
@Override
@SideOnly(Side.CLIENT)
public void randomDisplayTick(World world, int x, int y, int z, Random rand){
public void randomDisplayTick(World world, int x, int y, int z, Random rand){
HardcoreEnderExpansion.fx.enderGoo(world,x,y,z);
}
}
@SubscribeEvent
public void onBucketFill(FillBucketEvent e){
@@ -24,7 +24,7 @@ public class BlockEndstoneTerrain extends Block implements IBlockSubtypes{
public static final byte metaInfested = 0, metaBurned = 1, metaEnchanted = 2;
@SideOnly(Side.CLIENT)
private IIcon[] iconTop,iconSide;
private IIcon[] iconTop,iconSide;
public BlockEndstoneTerrain(){
super(Material.rock);
@@ -44,7 +44,7 @@ public class BlockEnergyCluster extends BlockContainer{
public BlockEnergyCluster(){
super(Material.glass);
setBlockBounds(0.3F,0.3F,0.3F,0.7F,0.7F,0.7F);
setBlockBounds(0.3F,0.3F,0.3F,0.7F,0.7F,0.7F);
}
@Override
@@ -15,7 +15,7 @@ import cpw.mods.fml.relauncher.SideOnly;
public class BlockEnhancedBrewingStand extends BlockBrewingStand{
@SideOnly(Side.CLIENT)
private IIcon theIcon;
private IIcon theIcon;
public BlockEnhancedBrewingStand(){
super();
@@ -39,8 +39,8 @@ public class BlockEnhancedBrewingStand extends BlockBrewingStand{
@Override
public Item getItem(World world, int x, int y, int z){
return ItemList.enhanced_brewing_stand;
}
return ItemList.enhanced_brewing_stand;
}
@Override
@SideOnly(Side.CLIENT)
@@ -20,8 +20,8 @@ public class BlockEssenceAltar extends BlockContainer{
private static final float hitCenter1 = 0.09F, hitCenter2 = 0.9F, hitDist = 0.05F;
@SideOnly(Side.CLIENT)
private IIcon[] iconTop,iconSide,iconBottom;
private IIcon[] iconTop,iconSide,iconBottom;
public BlockEssenceAltar(){
super(Material.iron);
setBlockBounds(0.0F,0.0F,0.0F,1.0F,0.75F,1.0F);
@@ -30,8 +30,8 @@ public class BlockInfestationRemedyCauldron extends BlockCauldron{
@Override
public int getRenderType(){
return ModCommonProxy.renderIdInfestationRemedyCauldron;
}
return ModCommonProxy.renderIdInfestationRemedyCauldron;
}
@Override
public void updateTick(World world, int x, int y, int z, Random rand){
@@ -75,98 +75,98 @@ public class BlockInfestationRemedyCauldron extends BlockCauldron{
return true;
}
@Override
@Override
public void fillWithRain(World world, int x, int y, int z){}
@Override
@Override
@SideOnly(Side.CLIENT)
public void randomDisplayTick(World world, int x, int y, int z, Random rand){
world.markBlockRangeForRenderUpdate(x,y,z,x,y,z);
if (CauldronState.getByMeta(world.getBlockMetadata(x,y,z)).isCooking && world.getBlock(x,y-1,z) == Blocks.fire && rand.nextInt(3) == 0){
HardcoreEnderExpansion.fx.bubble(world,x+0.5D+(rand.nextFloat()-0.5D)*0.5D,y+0.5F+rand.nextFloat()*0.4F,z+0.5D+(rand.nextFloat()-0.5D)*0.5D,0D,0.03D,0D);
if (rand.nextInt(7) == 0)world.playSound(x+0.5D,y+0.8D,z+0.5D,"hardcoreenderexpansion:environment.random.bubble",1F,rand.nextFloat()*0.1F+0.95F,false);
}
world.markBlockRangeForRenderUpdate(x,y,z,x,y,z);
if (CauldronState.getByMeta(world.getBlockMetadata(x,y,z)).isCooking && world.getBlock(x,y-1,z) == Blocks.fire && rand.nextInt(3) == 0){
HardcoreEnderExpansion.fx.bubble(world,x+0.5D+(rand.nextFloat()-0.5D)*0.5D,y+0.5F+rand.nextFloat()*0.4F,z+0.5D+(rand.nextFloat()-0.5D)*0.5D,0D,0.03D,0D);
if (rand.nextInt(7) == 0)world.playSound(x+0.5D,y+0.8D,z+0.5D,"hardcoreenderexpansion:environment.random.bubble",1F,rand.nextFloat()*0.1F+0.95F,false);
}
}
@Override
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconRegister){
super.registerBlockIcons(iconRegister);
waterGray = iconRegister.registerIcon("hardcoreenderexpansion:cauldron_water_gray");
}
public static enum CauldronState{
HAS_SILVERFISH_BLOOD(0,true,false,false,false,false,new float[]{ 0.4063F,0.1484F,0.5039F }), // 104,38,129
HAS_BAT_WING(1,false,true,false,false,false,new float[]{ 0.2929F,0.2656F,0.3828F }), // 75,68,98
HAS_DRY_SPLINTER(2,false,false,true,false,false,new float[]{ 0.1523F,0.1328F,0.2852F }), // 39,34,73
HAS_SILVERFISH_BLOOD_AND_BAT_WING(3,true,true,false,false,false,new float[]{ 0.3711F,0.2109F,0.3516F }), // 95,54,90
HAS_SILVERFISH_BLOOD_AND_DRY_SPLINTER(4,true,false,true,false,false,new float[]{ 0.2109F,0.1094F,0.1758F }), // 54,28,45
HAS_BAT_WING_AND_DRY_SPLINTER(5,false,true,true,false,false,new float[]{ 0.1914F,0.1406F,0.0977F }), // 49,36,25
HAS_ALL_ITEMS(6,true,true,true,true,false,new float[]{ 0.2305F,0.1172F,0.0821F }), // 59,30,21
COOKING_1(7,true,true,true,true,false,new float[]{ 0.2891F,0.1367F,0.1094F }), // 74,35,28
COOKING_2(8,true,true,true,true,false,new float[]{ 0.3477F,0.1563F,0.1328F }), // 89,40,34
COOKING_3(9,true,true,true,true,false,new float[]{ 0.4063F,0.1758F,0.1602F }), // 104,45,41
COOKING_4(10,true,true,true,true,false,new float[]{ 0.4609F,0.1953F,0.1836F }), // 118,50,47
COOKING_5(11,true,true,true,true,false,new float[]{ 0.5195F,0.2148F,0.2109F }), // 133,55,54
FULL(12,true,true,true,false,true,new float[]{ 0.5781F,0.2344F,0.2344F }), // 148,60,60
ALMOST_FULL(13,true,true,true,false,true,new float[]{ 0.5781F,0.2344F,0.2344F }),
NEARLY_EMPTY(14,true,true,true,false,true,new float[]{ 0.5781F,0.2344F,0.2344F }),
EMPTY(15,false,false,false,false,false,new float[]{ 0.5781F,0.2344F,0.2344F });
public static CauldronState getByMeta(int meta){
return values()[Math.min(meta,values().length-1)];
}
public final byte metadata;
public final boolean hasSilverfishBlood;
public final boolean hasBatWing;
public final boolean hasDrySplinter;
public final boolean isCooking;
public final boolean canBeBottled;
public final float[] color;
public static enum CauldronState{
HAS_SILVERFISH_BLOOD(0,true,false,false,false,false,new float[]{ 0.4063F,0.1484F,0.5039F }), // 104,38,129
HAS_BAT_WING(1,false,true,false,false,false,new float[]{ 0.2929F,0.2656F,0.3828F }), // 75,68,98
HAS_DRY_SPLINTER(2,false,false,true,false,false,new float[]{ 0.1523F,0.1328F,0.2852F }), // 39,34,73
HAS_SILVERFISH_BLOOD_AND_BAT_WING(3,true,true,false,false,false,new float[]{ 0.3711F,0.2109F,0.3516F }), // 95,54,90
HAS_SILVERFISH_BLOOD_AND_DRY_SPLINTER(4,true,false,true,false,false,new float[]{ 0.2109F,0.1094F,0.1758F }), // 54,28,45
HAS_BAT_WING_AND_DRY_SPLINTER(5,false,true,true,false,false,new float[]{ 0.1914F,0.1406F,0.0977F }), // 49,36,25
HAS_ALL_ITEMS(6,true,true,true,true,false,new float[]{ 0.2305F,0.1172F,0.0821F }), // 59,30,21
COOKING_1(7,true,true,true,true,false,new float[]{ 0.2891F,0.1367F,0.1094F }), // 74,35,28
COOKING_2(8,true,true,true,true,false,new float[]{ 0.3477F,0.1563F,0.1328F }), // 89,40,34
COOKING_3(9,true,true,true,true,false,new float[]{ 0.4063F,0.1758F,0.1602F }), // 104,45,41
COOKING_4(10,true,true,true,true,false,new float[]{ 0.4609F,0.1953F,0.1836F }), // 118,50,47
COOKING_5(11,true,true,true,true,false,new float[]{ 0.5195F,0.2148F,0.2109F }), // 133,55,54
FULL(12,true,true,true,false,true,new float[]{ 0.5781F,0.2344F,0.2344F }), // 148,60,60
ALMOST_FULL(13,true,true,true,false,true,new float[]{ 0.5781F,0.2344F,0.2344F }),
NEARLY_EMPTY(14,true,true,true,false,true,new float[]{ 0.5781F,0.2344F,0.2344F }),
EMPTY(15,false,false,false,false,false,new float[]{ 0.5781F,0.2344F,0.2344F });
public static CauldronState getByMeta(int meta){
return values()[Math.min(meta,values().length-1)];
}
public final byte metadata;
public final boolean hasSilverfishBlood;
public final boolean hasBatWing;
public final boolean hasDrySplinter;
public final boolean isCooking;
public final boolean canBeBottled;
public final float[] color;
CauldronState(int metadata, boolean hasSilverfishBlood, boolean hasBatWing, boolean hasDrySplinter, boolean isCooking, boolean canBeBottled, float[] color){
this.metadata = (byte)metadata;
this.hasSilverfishBlood = hasSilverfishBlood;
this.hasBatWing = hasBatWing;
this.hasDrySplinter = hasDrySplinter;
this.isCooking = isCooking;
this.canBeBottled = canBeBottled;
this.color = color;
}
public int getLiquidAmount(){
return this == NEARLY_EMPTY?1:this == ALMOST_FULL?2:3;
}
public CauldronState tryAddItem(Item item){
if (hasSilverfishBlood && hasBatWing && hasDrySplinter)return null;
if (item == ItemList.silverfish_blood){
return hasSilverfishBlood?null:
hasBatWing && hasDrySplinter?HAS_ALL_ITEMS:
hasBatWing?HAS_SILVERFISH_BLOOD_AND_BAT_WING:
hasDrySplinter?HAS_SILVERFISH_BLOOD_AND_DRY_SPLINTER:
null;
}
else if (item == ItemList.infested_bat_wing){
return hasBatWing?null:
hasSilverfishBlood && hasDrySplinter?HAS_ALL_ITEMS:
hasSilverfishBlood?HAS_SILVERFISH_BLOOD_AND_BAT_WING:
hasDrySplinter?HAS_BAT_WING_AND_DRY_SPLINTER:
null;
}
else if (item == ItemList.dry_splinter){
return hasDrySplinter?null:
hasSilverfishBlood && hasBatWing?HAS_ALL_ITEMS:
hasSilverfishBlood?HAS_SILVERFISH_BLOOD_AND_DRY_SPLINTER:
hasBatWing?HAS_BAT_WING_AND_DRY_SPLINTER:
null;
}
return null;
}
}
CauldronState(int metadata, boolean hasSilverfishBlood, boolean hasBatWing, boolean hasDrySplinter, boolean isCooking, boolean canBeBottled, float[] color){
this.metadata = (byte)metadata;
this.hasSilverfishBlood = hasSilverfishBlood;
this.hasBatWing = hasBatWing;
this.hasDrySplinter = hasDrySplinter;
this.isCooking = isCooking;
this.canBeBottled = canBeBottled;
this.color = color;
}
public int getLiquidAmount(){
return this == NEARLY_EMPTY?1:this == ALMOST_FULL?2:3;
}
public CauldronState tryAddItem(Item item){
if (hasSilverfishBlood && hasBatWing && hasDrySplinter)return null;
if (item == ItemList.silverfish_blood){
return hasSilverfishBlood?null:
hasBatWing && hasDrySplinter?HAS_ALL_ITEMS:
hasBatWing?HAS_SILVERFISH_BLOOD_AND_BAT_WING:
hasDrySplinter?HAS_SILVERFISH_BLOOD_AND_DRY_SPLINTER:
null;
}
else if (item == ItemList.infested_bat_wing){
return hasBatWing?null:
hasSilverfishBlood && hasDrySplinter?HAS_ALL_ITEMS:
hasSilverfishBlood?HAS_SILVERFISH_BLOOD_AND_BAT_WING:
hasDrySplinter?HAS_BAT_WING_AND_DRY_SPLINTER:
null;
}
else if (item == ItemList.dry_splinter){
return hasDrySplinter?null:
hasSilverfishBlood && hasBatWing?HAS_ALL_ITEMS:
hasSilverfishBlood?HAS_SILVERFISH_BLOOD_AND_DRY_SPLINTER:
hasBatWing?HAS_BAT_WING_AND_DRY_SPLINTER:
null;
}
return null;
}
}
}
*/
@@ -70,7 +70,7 @@ public class BlockObsidianSpecial extends Block implements IBlockSubtypes{
else if (meta == 5)return new ItemStack(this,1,0);
else if (meta == 6)return new ItemStack(this,1,1);
else return super.createStackedBlock(meta);
}
}
@Override
public int getRenderType(){
@@ -84,7 +84,7 @@ public class BlockObsidianSpecial extends Block implements IBlockSubtypes{
case 1: return isGlowing ? "tile.obsidianSpecialGlowing.chiseled" : "tile.obsidianSpecial.chiseled";
case 2: return isGlowing ? "tile.obsidianSpecialGlowing.pillar" : "tile.obsidianSpecial.pillar";
}
}
}
@Override
@SideOnly(Side.CLIENT)
@@ -21,51 +21,51 @@ public class BlockReplaceHelper{
Field modifiersField = null;
Class<?>[] classTest = new Class<?>[3];
try{
modifiersField = Field.class.getDeclaredField("modifiers");
modifiersField.setAccessible(true);
for(Field blockField:Blocks.class.getDeclaredFields()){
if (Block.class.isAssignableFrom(blockField.getType())){
Block block = (Block)blockField.get(null);
if (block == toReplace){
String registryName = Block.blockRegistry.getNameForObject(block);
int id = Block.getIdFromBlock(block);
ItemBlock item = (ItemBlock)Item.getItemFromBlock(block);
DragonUtil.info("Replacing block - "+id+"/"+registryName);
Block newBlock = blockClass.newInstance();
FMLControlledNamespacedRegistry<Block> registry = GameData.getBlockRegistry();
Field map = RegistrySimple.class.getDeclaredFields()[1];
map.setAccessible(true);
((Map)map.get(registry)).put(registryName,newBlock);
map = RegistryNamespaced.class.getDeclaredFields()[0];
map.setAccessible(true);
((ObjectIntIdentityMap)map.get(registry)).func_148746_a(newBlock,id); // OBFUSCATED put object
blockField.setAccessible(true);
modifiersField.setInt(blockField,modifiersField.getInt(blockField) & ~Modifier.FINAL);
blockField.set(null,newBlock);
Field itemBlockField = ItemBlock.class.getDeclaredFields()[0];
itemBlockField.setAccessible(true);
modifiersField.setInt(itemBlockField,modifiersField.getInt(itemBlockField) & ~Modifier.FINAL);
itemBlockField.set(item,newBlock);
classTest[0] = blockField.get(null).getClass();
classTest[1] = Block.blockRegistry.getObjectById(id).getClass();
classTest[2] = ((ItemBlock)Item.getItemFromBlock(newBlock)).field_150939_a.getClass();
}
}
}
}catch(Exception e){
e.printStackTrace();
}
try{
modifiersField = Field.class.getDeclaredField("modifiers");
modifiersField.setAccessible(true);
for(Field blockField:Blocks.class.getDeclaredFields()){
if (Block.class.isAssignableFrom(blockField.getType())){
Block block = (Block)blockField.get(null);
if (block == toReplace){
String registryName = Block.blockRegistry.getNameForObject(block);
int id = Block.getIdFromBlock(block);
ItemBlock item = (ItemBlock)Item.getItemFromBlock(block);
DragonUtil.info("Replacing block - "+id+"/"+registryName);
Block newBlock = blockClass.newInstance();
FMLControlledNamespacedRegistry<Block> registry = GameData.getBlockRegistry();
Field map = RegistrySimple.class.getDeclaredFields()[1];
map.setAccessible(true);
((Map)map.get(registry)).put(registryName,newBlock);
map = RegistryNamespaced.class.getDeclaredFields()[0];
map.setAccessible(true);
((ObjectIntIdentityMap)map.get(registry)).func_148746_a(newBlock,id); // OBFUSCATED put object
blockField.setAccessible(true);
modifiersField.setInt(blockField,modifiersField.getInt(blockField) & ~Modifier.FINAL);
blockField.set(null,newBlock);
Field itemBlockField = ItemBlock.class.getDeclaredFields()[0];
itemBlockField.setAccessible(true);
modifiersField.setInt(itemBlockField,modifiersField.getInt(itemBlockField) & ~Modifier.FINAL);
itemBlockField.set(item,newBlock);
classTest[0] = blockField.get(null).getClass();
classTest[1] = Block.blockRegistry.getObjectById(id).getClass();
classTest[2] = ((ItemBlock)Item.getItemFromBlock(newBlock)).field_150939_a.getClass();
}
}
}
}catch(Exception e){
e.printStackTrace();
}
TimeMeasurement.finish("BlockReplace");
DragonUtil.info("Check field: "+classTest[0]);
DragonUtil.info("Check registry: "+classTest[1]);
DragonUtil.info("Check item: "+classTest[2]);
@@ -67,12 +67,12 @@ public class BlockStardustOre extends BlockAbstractOre{
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side){
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side){
int meta = world.getBlockMetadata(x,y,z);
if (meta == 0)return Blocks.end_stone.getIcon(world,x,y,z,side);
return iconArray[iconIndexes[side][meta]];
}
}
@Override
@SideOnly(Side.CLIENT)
@@ -9,6 +9,6 @@ public class MaterialEnderGoo extends MaterialLiquid{
@Override
public boolean blocksMovement(){
return true;
}
return true;
}
}
@@ -31,7 +31,7 @@ public class EntityBlockEnhancedTNTPrimed extends EntityTNTPrimed{
public EntityBlockEnhancedTNTPrimed(World world){
super(world);
fuse = 80;
yOffset = 0;
yOffset = 0;
}
public EntityBlockEnhancedTNTPrimed(World world, double x, double y, double z, EntityLivingBase igniter, List<Enum> enhancements){
@@ -95,11 +95,11 @@ public class EntityBlockEnhancedTNTPrimed extends EntityTNTPrimed{
private void explode(){
EnhancedTNTExplosion explosion = new EnhancedTNTExplosion(worldObj,this,posX,posY,posZ,tntEnhancements.contains(TNTEnhancements.EXTRA_POWER) ? 5F : 4F);
explosion.isFlaming = tntEnhancements.contains(TNTEnhancements.FIRE);
explosion.isSmoking = !tntEnhancements.contains(TNTEnhancements.NO_BLOCK_DAMAGE);
explosion.damageEntities = !tntEnhancements.contains(TNTEnhancements.NO_ENTITY_DAMAGE);
explosion.doExplosionA();
explosion.doExplosionB(true);
explosion.isFlaming = tntEnhancements.contains(TNTEnhancements.FIRE);
explosion.isSmoking = !tntEnhancements.contains(TNTEnhancements.NO_BLOCK_DAMAGE);
explosion.damageEntities = !tntEnhancements.contains(TNTEnhancements.NO_ENTITY_DAMAGE);
explosion.doExplosionA();
explosion.doExplosionB(true);
}
@Override
@@ -124,11 +124,11 @@ public class EntityBlockEnhancedTNTPrimed extends EntityTNTPrimed{
}
private static final class EnhancedTNTExplosion extends Explosion{
private final World worldObj;
private final int dist = 16;
private final Map<EntityPlayer,Vec3> hurtPlayers = new HashMap<>();
public boolean damageEntities = true;
private final World worldObj;
private final int dist = 16;
private final Map<EntityPlayer,Vec3> hurtPlayers = new HashMap<>();
public boolean damageEntities = true;
public EnhancedTNTExplosion(World world, Entity sourceEntity, double x, double y, double z, float power){
super(world,sourceEntity,x,y,z,power);
@@ -16,8 +16,8 @@ import chylex.hee.mechanics.knowledge.util.ObservationUtil;
public class EntityBlockFallingObsidian extends EntityFallingBlock{
public EntityBlockFallingObsidian(World world){
super(world);
}
super(world);
}
public EntityBlockFallingObsidian(World world, double x, double y, double z){
super(world,x,y,z,BlockList.obsidian_end);
@@ -80,7 +80,7 @@ public class EntityBlockFallingObsidian extends EntityFallingBlock{
}
}
}
}
}
@Override
public Block func_145805_f(){
@@ -21,8 +21,8 @@ public class EntityBlockTempleDragonEgg extends EntityFallingBlock{
@Override
public boolean canBeCollidedWith(){
return false;
}
return false;
}
@SuppressWarnings("unchecked")
@Override
@@ -38,17 +38,17 @@ public class EntityBlockTempleDragonEgg extends EntityFallingBlock{
return;
}
worldObj.setBlockToAir(xx,yy,zz);
for(int x = xx+2; x < xx+5; x++){
for(int z = zz-1; z <= zz+1; z++){
if (worldObj.getBlock(x,yy-1,z) == BlockList.temple_end_portal)worldObj.setBlockMetadataWithNotify(x,yy-1,z,1,2);
}
}
worldObj.setBlockToAir(xx,yy,zz);
for(int x = xx+2; x < xx+5; x++){
for(int z = zz-1; z <= zz+1; z++){
if (worldObj.getBlock(x,yy-1,z) == BlockList.temple_end_portal)worldObj.setBlockMetadataWithNotify(x,yy-1,z,1,2);
}
}
}
moveEntity(motionX,motionY,motionZ);
for(int y = 7; y >= 0; y--){
for(int a = 0; a < Math.min(10,field_145812_b/4F); a++){
worldObj.spawnParticle("portal",posX+rand.nextDouble()-0.5D,posY+y+rand.nextDouble()-0.3D,posZ+rand.nextDouble()-0.5D,0D,0D,0D);
@@ -88,7 +88,7 @@ public class EntityBlockTempleDragonEgg extends EntityFallingBlock{
}
}
}
}
}
@Override
protected void fall(float distance){}
@@ -272,7 +272,7 @@ public class EntityMiniBossEnderEye extends EntityFlying implements IBossDisplay
}
else target = null;
}
}
}
@Override
public boolean attackEntityFrom(DamageSource source, float amount){
@@ -53,29 +53,29 @@ public class EntityAltarOrbFX extends EntityFX{
@Override
public void onUpdate(){
prevPosX = posX;
prevPosY = posY;
prevPosZ = posZ;
prevPosY = posY;
prevPosZ = posZ;
trueX += movementVec.xCoord;
trueY += movementVec.yCoord;
trueZ += movementVec.zCoord;
posX = trueX+Math.cos(offsetAngle[0])*offsetDistance;
posY = trueY+Math.cos(offsetAngle[1])*offsetDistance;
posZ = trueZ+Math.cos(offsetAngle[2])*offsetDistance;
for(int a = 0; a < 3; a++){
if (rand.nextInt(18) == 0)offsetAngleMode[a] = (byte)(offsetAngleMode[a] == 1?-1:1);
offsetAngle[a] += offsetAngleMode[a]*0.0698131*rand.nextFloat()*0.2D;
}
double dist = Math.sqrt(MathUtil.square(trueX-targetX)+MathUtil.square(trueY-targetY)+MathUtil.square(trueZ-targetZ));
trueX += movementVec.xCoord;
trueY += movementVec.yCoord;
trueZ += movementVec.zCoord;
posX = trueX+Math.cos(offsetAngle[0])*offsetDistance;
posY = trueY+Math.cos(offsetAngle[1])*offsetDistance;
posZ = trueZ+Math.cos(offsetAngle[2])*offsetDistance;
for(int a = 0; a < 3; a++){
if (rand.nextInt(18) == 0)offsetAngleMode[a] = (byte)(offsetAngleMode[a] == 1?-1:1);
offsetAngle[a] += offsetAngleMode[a]*0.0698131*rand.nextFloat()*0.2D;
}
double dist = Math.sqrt(MathUtil.square(trueX-targetX)+MathUtil.square(trueY-targetY)+MathUtil.square(trueZ-targetZ));
if (++particleAge > 300 || dist < 0.06D){
setDead();
}
else if (particleAge > 8 && particleAge < 35)offsetDistance += 0.015F;
else if (dist < 1D && offsetDistance >= 0.015D)offsetDistance -= 0.015F;
if (++particleAge > 300 || dist < 0.06D){
setDead();
}
else if (particleAge > 8 && particleAge < 35)offsetDistance += 0.015F;
else if (dist < 1D && offsetDistance >= 0.015D)offsetDistance -= 0.015F;
}
@Override
@@ -14,12 +14,12 @@ public class EntityBigPortalFX extends EntityFX{
super(world,x,y,z,motionX,motionY,motionZ);
particleRed = particleGreen = particleBlue = 1F*rand.nextFloat()*0.6F+0.4F;
particleGreen *= 0.3F;
particleRed *= 0.9F;
particleGreen *= 0.3F;
particleRed *= 0.9F;
particleMaxAge = (int)(Math.random()*10D)+40;
noClip = false;
setParticleTextureIndex((int)(Math.random()*8D));
noClip = false;
setParticleTextureIndex((int)(Math.random()*8D));
particleScale = portalParticleScale = 2.75F+rand.nextFloat()*0.4F;
realParticleAge = (byte)(rand.nextInt(20)+35);
@@ -41,5 +41,5 @@ public class EntityRelicGlyphFX extends EntityFX{
moveBehavior.update(this);
if (++particleAge > particleMaxAge)setDead();
}
}
}
@@ -118,7 +118,7 @@ public class EntitySoulCharmFX extends EntityFX{
GL11.glDepthMask(false);
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_FOG);
GL11.glDisable(GL11.GL_ALPHA_TEST);
GL11.glDisable(GL11.GL_ALPHA_TEST);
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA,GL11.GL_ONE);
GL11.glColor4f(1F,1F,1F,1F);
@@ -136,7 +136,7 @@ public class EntitySoulCharmFX extends EntityFX{
GL11.glDisable(GL11.GL_BLEND);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glEnable(GL11.GL_ALPHA_TEST);
GL11.glEnable(GL11.GL_ALPHA_TEST);
GL11.glDepthMask(true);
GL11.glPopMatrix();
}
@@ -46,11 +46,11 @@ public class EntityMobAngryEnderman extends EntityMob{
@Override
protected void applyEntityAttributes(){
super.applyEntityAttributes();
getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(ModCommonProxy.opMobs?40D:32D); // maxHealth 40 => 32
getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.3D);
getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(ModCommonProxy.opMobs?9D:5D); // attackDamage 7 => 5
}
super.applyEntityAttributes();
getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(ModCommonProxy.opMobs?40D:32D); // maxHealth 40 => 32
getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.3D);
getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(ModCommonProxy.opMobs?9D:5D); // attackDamage 7 => 5
}
@Override
protected Entity findPlayerToAttack(){
@@ -53,16 +53,16 @@ public class EntityMobBabyEnderman extends EntityMob{
public EntityMobBabyEnderman(World world){
super(world);
setSize(0.5F,1.26F);
stepHeight = 1F;
for(ItemPriorityLevel level:ItemPriorityLevel.values())itemPriorities.add(level);
for(int a = 0,index1,index2,size = itemPriorities.size(); a < rand.nextInt(20); a++){
index1 = rand.nextInt(size);
index2 = rand.nextInt(size);
if (index1 == index2)continue;
Collections.swap(itemPriorities,index1,index2);
}
stepHeight = 1F;
for(ItemPriorityLevel level:ItemPriorityLevel.values())itemPriorities.add(level);
for(int a = 0,index1,index2,size = itemPriorities.size(); a < rand.nextInt(20); a++){
index1 = rand.nextInt(size);
index2 = rand.nextInt(size);
if (index1 == index2)continue;
Collections.swap(itemPriorities,index1,index2);
}
}
@Override
@@ -111,7 +111,7 @@ public class EntityMobCorporealMirage extends EntityLiving implements IEntityOwn
attackEntityFrom(DamageSource.magic,-1F);
hurtTimer = 0;
}
}
}
@Override
protected void onDeathUpdate(){
@@ -113,7 +113,7 @@ public class EntityMobEnderGuardian extends EntityMob{
attackPhase = 0;
explosionTimer = 10;
teleportTimer = 80;
if (rand.nextInt(30) == 0){
List players = worldObj.getEntitiesWithinAABB(EntityPlayer.class,boundingBox.expand(8D,3D,8D));
for(Object o:players){
@@ -30,7 +30,7 @@ public class EntityMobFireGolem extends EntityMob{
private static final AttributeModifier cancelMovement = (new AttributeModifier(cancelMovementModifierUUID,"Movement cancellation",-1,2)).setSaved(false);
private byte rangedStatus = -1, teleportCooldown = 0;
public EntityMobFireGolem(World world){
super(world);
setSize(0.9F,1.4F);
@@ -141,9 +141,9 @@ public class EntityMobMinion extends EntityFlying/* implements IEntityOwnable*/{
@Override
protected void onDeathUpdate(){
super.onDeathUpdate();
if (deathTime == 5)minionData.updateAbilitiesOnDeath();
}
super.onDeathUpdate();
if (deathTime == 5)minionData.updateAbilitiesOnDeath();
}
public MinionData getMinionData(){
return minionData;
@@ -58,18 +58,18 @@ public class EntityMobParalyzedEnderman extends EntityEnderman{
super.onLivingUpdate();
}
@Override
@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 short[]{ 0,1 });
}
if (rand.nextInt(3) == 0)dropItem(getDropItem(),1);
for(EntityPlayer observer:ObservationUtil.getAllObservers(this,6D))KnowledgeRegistrations.PARALYZED_ENDERMAN.tryUnlockFragment(observer,0.18F,new short[]{ 0,1 });
}
@Override
protected boolean teleportTo(double x, double y, double z){
if (rand.nextInt(10) == 0)return super.teleportTo(x,y,z);
return true;
}
}
@Override
public void writeEntityToNBT(NBTTagCompound nbt){
@@ -51,8 +51,8 @@ public class EntityMobVampiricBat extends EntityBat{
@Override
public boolean canBePushed(){
return true;
}
return true;
}
@Override
protected void collideWithNearbyEntities(){
@@ -66,7 +66,7 @@ public class EntityMobVampiricBat extends EntityBat{
}
@Override
protected void collideWithEntity(Entity entity){
protected void collideWithEntity(Entity entity){
entity.applyEntityCollision(this);
if (entity instanceof EntityPlayer){
@@ -50,10 +50,10 @@ public class EntityProjectileGolemFireball extends EntityLargeFireball{
ChunkPosition pos;
for(Iterator<?> iter = affectedBlockPositions.iterator(); iter.hasNext();){
pos = (ChunkPosition)iter.next();
if (worldObj.getBlock(pos.chunkPosX,pos.chunkPosY,pos.chunkPosZ).getMaterial() == Material.air &&
worldObj.getBlock(pos.chunkPosX,pos.chunkPosY,pos.chunkPosZ).func_149730_j() && // OBFUSCATED is block opaque
worldObj.rand.nextInt(5) == 0)worldObj.setBlock(pos.chunkPosX,pos.chunkPosY,pos.chunkPosZ,Blocks.fire);
}
if (worldObj.getBlock(pos.chunkPosX,pos.chunkPosY,pos.chunkPosZ).getMaterial() == Material.air &&
worldObj.getBlock(pos.chunkPosX,pos.chunkPosY,pos.chunkPosZ).func_149730_j() && // OBFUSCATED is block opaque
worldObj.rand.nextInt(5) == 0)worldObj.setBlock(pos.chunkPosX,pos.chunkPosY,pos.chunkPosZ,Blocks.fire);
}
}
}
}
@@ -12,14 +12,14 @@ import chylex.hee.mechanics.knowledge.KnowledgeRegistrations;
public class EntityProjectilePotionOfInstability extends EntityPotion{
public EntityProjectilePotionOfInstability(World world){
super(world);
}
super(world);
}
public EntityProjectilePotionOfInstability(World world, EntityLivingBase thrower){
super(world,thrower,new ItemStack(ItemList.potion_of_instability,1,1));
}
@Override
public EntityProjectilePotionOfInstability(World world, EntityLivingBase thrower){
super(world,thrower,new ItemStack(ItemList.potion_of_instability,1,1));
}
@Override
protected void onImpact(MovingObjectPosition mop){
if (!worldObj.isRemote){
for(Object o:worldObj.getEntitiesWithinAABB(EntityLivingBase.class,boundingBox.expand(4D,2D,4D))){
@@ -10,7 +10,7 @@ import chylex.hee.proxy.ModCommonProxy;
public class EntityWeatherLightningBoltDemon extends EntityLightningBolt{
private int lightningState;
private int boltLivingTime;
private int boltLivingTime;
private boolean isSafe;
public EntityWeatherLightningBoltDemon(World world, double x, double y, double z){
@@ -6,7 +6,7 @@ import net.minecraft.world.World;
public class EntityWeatherLightningBoltSafe extends EntityLightningBolt{
private int lightningState;
private int boltLivingTime;
private int boltLivingTime;
public EntityWeatherLightningBoltSafe(World world, double x, double y, double z){
super(world,x,y,z);
@@ -68,13 +68,13 @@ public class ContainerEndPowderEnhancements extends Container{
@Override
public void addCraftingToCrafters(ICrafting crafter){
super.addCraftingToCrafters(crafter);
if (crafter instanceof EntityPlayerMP){
if (owner != null)throw new IllegalArgumentException("Cannot add second player to End Powder Enhancement container!");
owner = (EntityPlayerMP)crafter;
}
}
super.addCraftingToCrafters(crafter);
if (crafter instanceof EntityPlayerMP){
if (owner != null)throw new IllegalArgumentException("Cannot add second player to End Powder Enhancement container!");
owner = (EntityPlayerMP)crafter;
}
}
@Override
public boolean canInteractWith(EntityPlayer player){
@@ -14,13 +14,13 @@ public class GuiDiaryBook extends GuiScreenBook{
private static final ResourceLocation resource = new ResourceLocation("hardcoreenderexpansion:textures/gui/diary_book.png");
private int bookImageWidth = 192;
private int bookImageHeight = 192;
private NBTTagList bookPages;
private int bookTotalPages = 1;
public int currPage;
private GuiButtonPageArrow buttonNextPage;
private GuiButtonPageArrow buttonPreviousPage;
private int bookImageHeight = 192;
private NBTTagList bookPages;
private int bookTotalPages = 1;
public int currPage;
private GuiButtonPageArrow buttonNextPage;
private GuiButtonPageArrow buttonPreviousPage;
public GuiDiaryBook(EntityPlayer player, ItemStack is){
super(player,is,false);
bookImageHeight = 217; // +23
@@ -85,9 +85,9 @@ public class GuiItemViewer extends GuiScreen{
else if (wheel > 0)yStart = Math.max(0,yStart-12);
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
RenderHelper.enableGUIStandardItemLighting();
RenderHelper.enableGUIStandardItemLighting();
GL11.glScalef(8F,8F,8F);
GL11.glScalef(8F,8F,8F);
for(int a = yStart,xx = 0,yy = 0; a < toRender.size(); a++){
drawRect(2+xx*17,2+yy*17,1+(xx+1)*17,1+(yy+1)*17,(255<<24)|(180<<16)|(180<<8)|180);
GuiItemRenderHelper.renderItemIntoGUI(mc.getTextureManager(),toRender.get(a),2+xx*17,2+yy*17);
@@ -97,7 +97,7 @@ public class GuiItemViewer extends GuiScreen{
}
}
RenderHelper.disableStandardItemLighting();
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
RenderHelper.disableStandardItemLighting();
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
}
}
+111 -111
View File
@@ -40,37 +40,37 @@ public class GuiKnowledgeBook extends GuiScreen implements ITooltipRenderer{
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 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);
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 FloatBuffer floatBuffer = GLAllocation.createDirectFloatBuffer(16);
private ItemStack bookItemStack;
private float offsetX = 0, offsetY = 0;
private float prevOffsetX = 0, prevOffsetY = 0;
private float startOffsetX = 0, startOffsetY = 0;
private float targetOffsetX = 0, targetOffsetY = 0;
private float time = 0;
private KnowledgeCategory highlightedCategory;
private KnowledgeRegistration highlightedRegistration;
private Map<KnowledgeFragment,Boolean> activeFragments = new LinkedHashMap<>();
private short pageIndex;
private Stack<Short> pageIndexPrev = new Stack<>();
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;
private FloatBuffer floatBuffer = GLAllocation.createDirectFloatBuffer(16);
private ItemStack bookItemStack;
private float offsetX = 0, offsetY = 0;
private float prevOffsetX = 0, prevOffsetY = 0;
private float startOffsetX = 0, startOffsetY = 0;
private float targetOffsetX = 0, targetOffsetY = 0;
private float time = 0;
private KnowledgeCategory highlightedCategory;
private KnowledgeRegistration highlightedRegistration;
private Map<KnowledgeFragment,Boolean> activeFragments = new LinkedHashMap<>();
private short pageIndex;
private Stack<Short> pageIndexPrev = new Stack<>();
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));
@@ -80,51 +80,51 @@ public class GuiKnowledgeBook extends GuiScreen implements ITooltipRenderer{
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");
short fid = tag.getShort("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.add(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");
}
NBTTagCompound tag = bookItemStack.stackTagCompound.getCompoundTag("knowledgeLast");
String catName = tag.getString("cat"),regName = tag.getString("reg");
short fid = tag.getShort("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.add(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
}
@Override
protected void actionPerformed(GuiButton button){
if (!(button.enabled && button.visible))return;
@@ -168,22 +168,22 @@ public class GuiKnowledgeBook extends GuiScreen implements ITooltipRenderer{
}
}
}
@Override
@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);
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){
@@ -201,12 +201,12 @@ public class GuiKnowledgeBook extends GuiScreen implements ITooltipRenderer{
}
}
@Override
@Override
public void updateScreen(){
prevOffsetX = offsetX;
prevOffsetY = offsetY;
if (offsetX != targetOffsetX || offsetY != targetOffsetY){
if (offsetX != targetOffsetX || offsetY != targetOffsetY){
if (time == 0){
startOffsetX = offsetX;
startOffsetY = offsetY;
@@ -222,15 +222,15 @@ public class GuiKnowledgeBook extends GuiScreen implements ITooltipRenderer{
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();
@@ -239,11 +239,11 @@ public class GuiKnowledgeBook extends GuiScreen implements ITooltipRenderer{
GL11.glTranslatef(0F,0F,-200F);
renderPortalBackground(partialTickTime);
GL11.glDepthFunc(GL11.GL_LEQUAL);
GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glEnable(GL11.GL_CULL_FACE);
renderScreen(mouseX,mouseY,partialTickTime);
GL11.glPopMatrix();
GL11.glDepthFunc(GL11.GL_LEQUAL);
GL11.glDisable(GL11.GL_DEPTH_TEST);
GL11.glDisable(GL11.GL_DEPTH_TEST);
super.drawScreen(mouseX,mouseY,partialTickTime);
GL11.glEnable(GL11.GL_DEPTH_TEST);
}
@@ -259,23 +259,23 @@ public class GuiKnowledgeBook extends GuiScreen implements ITooltipRenderer{
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);
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);
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.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;
@@ -333,8 +333,8 @@ public class GuiKnowledgeBook extends GuiScreen implements ITooltipRenderer{
if (highlightedRegistration != null){
GL11.glPushMatrix();
GL11.glColor4f(1F,1F,1F,1F);
GL11.glDepthFunc(GL11.GL_LEQUAL);
GL11.glDisable(GL11.GL_DEPTH_TEST);
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);
@@ -371,7 +371,7 @@ public class GuiKnowledgeBook extends GuiScreen implements ITooltipRenderer{
GL11.glDisable(GL11.GL_BLEND);
GL11.glEnable(GL11.GL_DEPTH_TEST);
GL11.glDepthFunc(GL11.GL_LEQUAL);
GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glPopMatrix();
}
else{
@@ -441,8 +441,8 @@ public class GuiKnowledgeBook extends GuiScreen implements ITooltipRenderer{
private void renderPortalBackground(float partialTickTime){
int hw = width>>1,hh = height>>1;
GL11.glDisable(GL11.GL_LIGHTING);
consistentRandom.setSeed(31100L);
GL11.glDisable(GL11.GL_LIGHTING);
consistentRandom.setSeed(31100L);
for(int layer = 0; layer < 16; ++layer){
GL11.glPushMatrix();
@@ -519,7 +519,7 @@ public class GuiKnowledgeBook extends GuiScreen implements ITooltipRenderer{
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);
GL11.glEnable(GL11.GL_LIGHTING);
}
private FloatBuffer insertIntoBufferAndFlip(float value1, float value2, float value3, float value4){
@@ -35,6 +35,6 @@ public class ItemAdventurersDiary extends Item{
@Override
public String getItemStackDisplayName(ItemStack is){
return super.getItemStackDisplayName(is)+(is.getItemDamage() > 0 ? " (page "+is.getItemDamage()+")" : "");
}
return super.getItemStackDisplayName(is)+(is.getItemDamage() > 0 ? " (page "+is.getItemDamage()+")" : "");
}
}
@@ -49,7 +49,7 @@ public class ItemEnderCompendium extends Item{
@SuppressWarnings("unchecked")
@Override
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack is, EntityPlayer player, List textLines, boolean showAdvancedInfo){
public void addInformation(ItemStack is, EntityPlayer player, List textLines, boolean showAdvancedInfo){
if (is.getItemDamage() == 1)textLines.add("Creative mode");
}
@@ -21,7 +21,7 @@ public class ItemEndermanHead extends Item{
@Override
public String getUnlocalizedName(ItemStack is){
return BlockList.enderman_head.getUnlocalizedName();
}
}
@Override
public ItemStack onItemRightClick(ItemStack is, World world, EntityPlayer player){
@@ -72,7 +72,7 @@ public class ItemEndermanHead extends Item{
@Override
public boolean isValidArmor(ItemStack stack, int armorType, Entity entity){
return armorType == 0;
}
}
private static final ResourceLocation tex = new ResourceLocation("hardcoreenderexpansion:textures/armor/enderman_head.png");
@@ -38,7 +38,7 @@ public class ItemEnhancedEnderPearl extends ItemEnderPearl{
@Override
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack is, EntityPlayer player, List textLines, boolean showAdvancedInfo){
public void addInformation(ItemStack is, EntityPlayer player, List textLines, boolean showAdvancedInfo){
EnhancementHandler.appendEnhancementNames(is,textLines);
}
}
@@ -22,7 +22,7 @@ public class ItemEssence extends Item{
}
@Override
@SideOnly(Side.CLIENT)
@SideOnly(Side.CLIENT)
public void getSubItems(Item item, CreativeTabs tab, List list){
for(EssenceType essenceType:EssenceType.values()){
if (essenceType == EssenceType.INVALID)continue;
@@ -34,7 +34,7 @@ public class ItemEssence extends Item{
public String getUnlocalizedName(ItemStack is){
EssenceType essenceType = EssenceType.getById(is.getItemDamage()+1);
return "item.essence."+(essenceType == null?"invalid":essenceType.essenceNameLowercase);
}
}
@Override
public boolean doesSneakBypassUse(World world, int x, int y, int z, EntityPlayer player){
@@ -55,7 +55,7 @@ public class ItemEssence extends Item{
@SideOnly(Side.CLIENT)
@Override
public void registerIcons(IIconRegister iconRegister){
public void registerIcons(IIconRegister iconRegister){
iconArray = new IIcon[EssenceType.values().length-1];
int index = -1;
@@ -23,26 +23,26 @@ public class ItemInfestationRemedy extends Item{
public int getMaxItemUseDuration(ItemStack is){
return 32;
}
@Override
@Override
public EnumAction getItemUseAction(ItemStack is){
return EnumAction.drink;
}
@Override
return EnumAction.drink;
}
@Override
public ItemStack onItemRightClick(ItemStack is, World world, EntityPlayer player){
player.setItemInUse(is,getMaxItemUseDuration(is));
player.setItemInUse(is,getMaxItemUseDuration(is));
return is;
}
@Override
@Override
public ItemStack onEaten(ItemStack is, World world, EntityPlayer player){
if (!player.capabilities.isCreativeMode)--is.stackSize;
Set<Integer> toRemove = new HashSet<>();
Map<PotionEffect,Short> newDurations = new HashMap<>();
for(Object o:player.getActivePotionEffects()){
if (!player.capabilities.isCreativeMode)--is.stackSize;
Set<Integer> toRemove = new HashSet<>();
Map<PotionEffect,Short> newDurations = new HashMap<>();
for(Object o:player.getActivePotionEffects()){
PotionEffect eff = (PotionEffect)o;
if (eff.getIsAmbient() && InfestationEvents.isValidPotionEffect(eff.getPotionID())){
int dur = eff.getDuration()-3000+world.rand.nextInt(600);
@@ -51,16 +51,16 @@ public class ItemInfestationRemedy extends Item{
else newDurations.put(eff,(short)dur);
}
}
for(Integer i:toRemove)player.removePotionEffect(i);
for(Entry<PotionEffect,Short> entry:newDurations.entrySet()){
PotionEffect oldEff = entry.getKey();
player.removePotionEffect(oldEff.getPotionID());
player.addPotionEffect(new PotionEffect(oldEff.getPotionID(),entry.getValue(),oldEff.getAmplifier(),oldEff.getIsAmbient()));
}
for(Integer i:toRemove)player.removePotionEffect(i);
for(Entry<PotionEffect,Short> entry:newDurations.entrySet()){
PotionEffect oldEff = entry.getKey();
player.removePotionEffect(oldEff.getPotionID());
player.addPotionEffect(new PotionEffect(oldEff.getPotionID(),entry.getValue(),oldEff.getAmplifier(),oldEff.getIsAmbient()));
}
if (is.stackSize <= 0)return new ItemStack(Items.glass_bottle);
player.inventory.addItemStackToInventory(new ItemStack(Items.glass_bottle));
return is;
}
return is;
}
}
@@ -73,7 +73,7 @@ public class ItemKnowledgeFragment extends Item{
@Override
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack is, EntityPlayer player, List textLines, boolean showAdvancedInfo){
public void addInformation(ItemStack is, EntityPlayer player, List textLines, boolean showAdvancedInfo){
String registration = is.stackTagCompound != null?is.stackTagCompound.getString("knowledgeRegistration"):null;
if (registration != null){
@@ -68,15 +68,15 @@ public class ItemMusicDisk extends ItemRecord{
@Override
@SideOnly(Side.CLIENT)
public IIcon getIconFromDamage(int damage){
return iconArray[Math.max(0,Math.min(iconArray.length-1,damage))];
}
public IIcon getIconFromDamage(int damage){
return iconArray[Math.max(0,Math.min(iconArray.length-1,damage))];
}
@Override
@SideOnly(Side.CLIENT)
public String getRecordNameLocal(){
return "qwertygiy - ";
}
public String getRecordNameLocal(){
return "qwertygiy - ";
}
@Override
@SideOnly(Side.CLIENT)
@@ -94,7 +94,7 @@ public class ItemMusicDisk extends ItemRecord{
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister){
public void registerIcons(IIconRegister iconRegister){
iconArray = new IIcon[musicNames.size()];
for(int index = 0; index < iconArray.length; index++){
@@ -104,9 +104,9 @@ public class ItemPotionOfInstability extends Item{
@Override
@SideOnly(Side.CLIENT)
public boolean requiresMultipleRenderPasses(){
return true;
}
public boolean requiresMultipleRenderPasses(){
return true;
}
@Override
@SideOnly(Side.CLIENT)
@@ -64,8 +64,8 @@ public class ItemScorchingPickaxe extends Item{
@Override
public boolean canHarvestBlock(Block block, ItemStack is){
return isBlockValid(block);
}
return isBlockValid(block);
}
@Override
public int getHarvestLevel(ItemStack is, String toolClass){
@@ -79,9 +79,9 @@ public class ItemScorchingPickaxe extends Item{
@Override
@SideOnly(Side.CLIENT)
public boolean isFull3D(){
return true;
}
public boolean isFull3D(){
return true;
}
@SubscribeEvent(priority = EventPriority.LOWEST)
public void onBlockDropItems(HarvestDropsEvent e){
@@ -118,9 +118,9 @@ public class ItemSpawnEggs extends ItemMonsterPlacer{
@Override
@SideOnly(Side.CLIENT)
public void getSubItems(Item item, CreativeTabs tab, List list){
public void getSubItems(Item item, CreativeTabs tab, List list){
for(int a = 0; a < eggTypes.length; a++)list.add(new ItemStack(item,1,a));
}
}
static class EggData{
private String entityName;
@@ -27,7 +27,7 @@ public class ItemSpecialEffects extends Item{
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister){
public void registerIcons(IIconRegister iconRegister){
icons = new IIcon[21+IslandBiomeBase.biomeList.size()];
for(int a = 0; a < 10; a++)icons[a] = iconRegister.registerIcon("hardcoreenderexpansion:"+a);
@@ -74,7 +74,7 @@ public class ItemSpectralWand extends Item{
@Override
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack is, EntityPlayer player, List textLines, boolean showAdvancedInfo){
public void addInformation(ItemStack is, EntityPlayer player, List textLines, boolean showAdvancedInfo){
if (is.stackTagCompound == null || !is.stackTagCompound.hasKey("cluster"))return;
textLines.add("Holding cluster with "+formatTwoPlaces.format(is.stackTagCompound.getCompoundTag("cluster").getShort("energyAmt")*0.01F)+" Energy");
}
@@ -71,7 +71,7 @@ public class ItemTempleCaller extends ItemAbstractEnergyAcceptor{
}
@Override
@SideOnly(Side.CLIENT)
@SideOnly(Side.CLIENT)
public void getSubItems(Item item, CreativeTabs tab, List list){
list.add(new ItemStack(item,1,0));
list.add(new ItemStack(item,1,getMaxDamage()));
@@ -113,7 +113,7 @@ public class ItemTransferenceGem extends ItemAbstractEnergyAcceptor{
@SuppressWarnings("unchecked")
@Override
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack is, EntityPlayer player, List textLines, boolean showAdvancedInfo){
public void addInformation(ItemStack is, EntityPlayer player, List textLines, boolean showAdvancedInfo){
GemData gemData = GemData.loadFromItemStack(is);
if (gemData.isLinked()){
@@ -138,13 +138,13 @@ public class ItemTransferenceGem extends ItemAbstractEnergyAcceptor{
@Override
@SideOnly(Side.CLIENT)
public IIcon getIconIndex(ItemStack is){
return iconArray[getIcon(is)];
}
public IIcon getIconIndex(ItemStack is){
return iconArray[getIcon(is)];
}
@SideOnly(Side.CLIENT)
@Override
public void registerIcons(IIconRegister iconRegister){
public void registerIcons(IIconRegister iconRegister){
iconArray = new IIcon[3];
for(int a = 0; a < iconArray.length; a++)iconArray[a] = iconRegister.registerIcon("hardcoreenderexpansion:transference_gem_"+(a+1));
}
@@ -29,7 +29,7 @@ public class ItemBlockEnhancedTNT extends ItemBlock{
@Override
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack is, EntityPlayer player, List textLines, boolean showAdvancedInfo){
public void addInformation(ItemStack is, EntityPlayer player, List textLines, boolean showAdvancedInfo){
EnhancementHandler.appendEnhancementNames(is,textLines);
}
}
@@ -23,7 +23,7 @@ public class ItemBlockEssenceAltar extends ItemBlock{
public String getUnlocalizedName(ItemStack is){
EssenceType essenceType = EssenceType.getById(is.getItemDamage());
return "tile.essenceAltar."+(essenceType == null?EssenceType.INVALID:essenceType).essenceNameLowercase;
}
}
@Override
public boolean placeBlockAt(ItemStack is, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ, int metadata){
@@ -41,7 +41,7 @@ public class ItemBlockSoulCharm extends ItemBlock{
case 0: return "tile.soulCharm";
case 1: return "tile.emptySoulCharm";
}
}
}
@Override
public int getMaxItemUseDuration(ItemStack is){
@@ -144,7 +144,7 @@ public class ItemBlockSoulCharm extends ItemBlock{
}
@Override
@SideOnly(Side.CLIENT)
@SideOnly(Side.CLIENT)
public IIcon getIconFromDamage(int damage){
return damage == 1?iconEmptySoulCharm:iconSoulCharm;
}
@@ -152,7 +152,7 @@ public class ItemBlockSoulCharm extends ItemBlock{
@SuppressWarnings("unchecked")
@Override
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack is, EntityPlayer player, List textLines, boolean showAdvancedInfo){
public void addInformation(ItemStack is, EntityPlayer player, List textLines, boolean showAdvancedInfo){
if (is.getItemDamage() != 0)return;
for(Entry<SoulCharmEnhancements,Byte> entry:SoulCharmEnhancements.getEnhancements(is).entrySet()){
@@ -29,7 +29,7 @@ public class ItemBlockWithSubtypes extends ItemBlock{
public String getUnlocalizedName(ItemStack is){
if (isIBlockSubtypes)return ((IBlockSubtypes)field_150939_a).getUnlocalizedName(is);
else return super.getUnlocalizedName(is);
}
}
public static interface IBlockSubtypes{
String getUnlocalizedName(ItemStack is);
@@ -117,18 +117,18 @@ public class DragonEssenceHandler extends AltarActionHandler{
if (Math.abs(xx-altar.xCoord) <= 1 && Math.abs(zz-altar.zCoord) <= 1)continue;
if (world.isAirBlock(xx,altar.yCoord+1,zz)&&
(world.isAirBlock(xx-1,altar.yCoord,zz) || !hasCollisionBox(altar,xx-1,altar.yCoord,zz)) &&
(world.isAirBlock(xx+1,altar.yCoord,zz) || !hasCollisionBox(altar,xx+1,altar.yCoord,zz)) &&
(world.isAirBlock(xx,altar.yCoord,zz-1) || !hasCollisionBox(altar,xx,altar.yCoord,zz-1)) &&
(world.isAirBlock(xx,altar.yCoord,zz+1) || !hasCollisionBox(altar,xx,altar.yCoord,zz+1)) &&
hasCollisionBox(altar,xx,altar.yCoord,zz)){
Block block = world.getBlock(xx,altar.yCoord,zz);
if (block.getMaterial() == Material.air)continue;
blocks[range+xx-altar.xCoord][range+zz-altar.zCoord] = block;
if (blockCounts.containsKey(block))blockCounts.put(block,(byte)(blockCounts.get(block)+1));
else blockCounts.put(block,(byte)1);
(world.isAirBlock(xx-1,altar.yCoord,zz) || !hasCollisionBox(altar,xx-1,altar.yCoord,zz)) &&
(world.isAirBlock(xx+1,altar.yCoord,zz) || !hasCollisionBox(altar,xx+1,altar.yCoord,zz)) &&
(world.isAirBlock(xx,altar.yCoord,zz-1) || !hasCollisionBox(altar,xx,altar.yCoord,zz-1)) &&
(world.isAirBlock(xx,altar.yCoord,zz+1) || !hasCollisionBox(altar,xx,altar.yCoord,zz+1)) &&
hasCollisionBox(altar,xx,altar.yCoord,zz)){
Block block = world.getBlock(xx,altar.yCoord,zz);
if (block.getMaterial() == Material.air)continue;
blocks[range+xx-altar.xCoord][range+zz-altar.zCoord] = block;
if (blockCounts.containsKey(block))blockCounts.put(block,(byte)(blockCounts.get(block)+1));
else blockCounts.put(block,(byte)1);
}
}
}
@@ -65,12 +65,12 @@ public final class FragmentWeightLists{
.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);
.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)
@@ -16,7 +16,7 @@ public abstract class CustomSpawnerLogic extends MobSpawnerBaseLogic{
protected short spawnCount = 4;
protected short maxNearbyEntities = 6;
protected short activatingRangeFromPlayer = 16;
protected Entity entityCache;
protected Entity entityCache;
protected CustomSpawnerLogic(TileEntityCustomSpawner spawnerTile){
this.spawnerTile = spawnerTile;
@@ -136,7 +136,7 @@ public class TowerEndermanSpawnerLogic extends CustomSpawnerLogic{
nbt.setInteger("minY",minY);
nbt.setInteger("maxY",maxY);
}
@Override
public void readFromNBT(NBTTagCompound nbt){
super.readFromNBT(nbt);
@@ -40,8 +40,8 @@ public final class TempleEvents{
}
/**
* Returns true if player was in temple, not if the temple was destroyed
*/
* Returns true if player was in temple, not if the temple was destroyed
*/
public static boolean attemptDestroyTemple(EntityPlayer player){
ServerSavefile save = BiomeDecoratorHardcoreEnd.getCache(player.worldObj);
List<String> playersInTemple = save.getPlayersInTemple();
@@ -40,7 +40,7 @@ public class PacketPipeline{
private EnumMap<Side,FMLEmbeddedChannel> channels;
private TByteObjectHashMap<Class<? extends AbstractPacket>> idToPacket = new TByteObjectHashMap<Class<? extends AbstractPacket>>();
private TObjectByteHashMap<Class<? extends AbstractPacket>> packetToId = new TObjectByteHashMap<Class<? extends AbstractPacket>>();
private TObjectByteHashMap<Class<? extends AbstractPacket>> packetToId = new TObjectByteHashMap<Class<? extends AbstractPacket>>();
private PacketPipeline(){}
@@ -166,5 +166,5 @@ public class PacketPipeline{
FMLEmbeddedChannel channel = instance.channels.get(Side.CLIENT);
channel.attr(FMLOutboundHandler.FML_MESSAGETARGET).set(OutboundTarget.TOSERVER);
channel.writeAndFlush(instance.writePacket(packet)).addListener(ChannelFutureListener.FIRE_EXCEPTION_ON_FAILURE);
}
}
}
@@ -182,8 +182,8 @@ public class FXClientProxy extends FXCommonProxy{
else{
spawn(new EntityBreakingFX(orb.worldObj,orb.posX,orb.posY+0.25D,orb.posZ,motX,motY,motZ,ItemList.instability_orb,0){{
particleGravity /= 3F;
particleScale /= 2.5F;
particleMaxAge = 80+rand.nextInt(30);
particleScale /= 2.5F;
particleMaxAge = 80+rand.nextInt(30);
}});
}
}
@@ -157,8 +157,8 @@ public class OverlayManager{
int scale = e.resolution.getScaleFactor();
double fontScale = scale == 1 ? 2D:
scale == 2 ? 1D:
scale == 3 ? 0.677D : 0.5D,
scale == 2 ? 1D:
scale == 3 ? 0.677D : 0.5D,
fontScale2 = 1D/fontScale;
GL11.glPushMatrix();
@@ -30,8 +30,8 @@ public class RenderBossEnderDemon extends RenderLiving{
public void doRender(EntityLiving entity, double x, double y, double z, float yaw, float partialTickTime){
BossStatus.setBossStatus((EntityBossEnderDemon)entity,true);
BossType.update(BossType.ENDER_DEMON);
super.doRender(entity,x,y,z,yaw,partialTickTime);
}
super.doRender(entity,x,y,z,yaw,partialTickTime);
}
@Override
protected ResourceLocation getEntityTexture(Entity entity){
@@ -16,11 +16,11 @@ import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class RenderMiniBossEnderEye extends RenderLiving{
private static final ResourceLocation texAwake = new ResourceLocation("hardcoreenderexpansion:textures/entity/ender_eye.png");
private static final ResourceLocation texAsleep = new ResourceLocation("hardcoreenderexpansion:textures/entity/ender_eye_asleep.png");
private static final ResourceLocation texAwake = new ResourceLocation("hardcoreenderexpansion:textures/entity/ender_eye.png");
private static final ResourceLocation texAsleep = new ResourceLocation("hardcoreenderexpansion:textures/entity/ender_eye_asleep.png");
private byte statusTick = 0;
private byte statusTick = 0;
public RenderMiniBossEnderEye(){
super(new ModelEnderEye(),0.75F);
}
@@ -56,8 +56,8 @@ public class RenderMiniBossEnderEye extends RenderLiving{
}
}
super.doRender(entity,x,y,z,yaw,partialTickTime);
}
super.doRender(entity,x,y,z,yaw,partialTickTime);
}
@Override
protected ResourceLocation getEntityTexture(Entity entity){
@@ -66,6 +66,6 @@ public class RenderMiniBossEnderEye extends RenderLiving{
@Override
protected boolean func_110813_b(EntityLiving entity){ // OBFUSCATED show mob name
return false;
}
return false;
}
}
@@ -32,8 +32,8 @@ public class RenderMiniBossFireFiend extends RenderLiving{
BossStatus.setBossStatus(fiend,true);
BossType.update(BossType.FIRE_FIEND);
}
super.doRender(entity,x,y,z,yaw,partialTickTime);
}
super.doRender(entity,x,y,z,yaw,partialTickTime);
}
@Override
protected ResourceLocation getEntityTexture(Entity entity){
@@ -42,6 +42,6 @@ public class RenderMiniBossFireFiend extends RenderLiving{
@Override
protected boolean func_110813_b(EntityLiving entity){ // OBFUSCATED show mob name
return false;
}
return false;
}
}
@@ -14,8 +14,8 @@ import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class RenderMobAngryEnderman extends RenderLiving{
private static final ResourceLocation texEndermanEyes = new ResourceLocation("textures/entity/enderman/enderman_eyes.png");
private static final ResourceLocation texEndermanBody = new ResourceLocation("textures/entity/enderman/enderman.png");
private static final ResourceLocation texEndermanEyes = new ResourceLocation("textures/entity/enderman/enderman_eyes.png");
private static final ResourceLocation texEndermanBody = new ResourceLocation("textures/entity/enderman/enderman.png");
private ModelEnderman endermanModel;
private Random rand = new Random();
@@ -20,8 +20,8 @@ import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class RenderMobBabyEnderman extends RenderLiving{
private static final ResourceLocation texEndermanEyes = new ResourceLocation("textures/entity/enderman/enderman_eyes.png");
private static final ResourceLocation texEndermanBody = new ResourceLocation("textures/entity/enderman/enderman.png");
private static final ResourceLocation texEndermanEyes = new ResourceLocation("textures/entity/enderman/enderman_eyes.png");
private static final ResourceLocation texEndermanBody = new ResourceLocation("textures/entity/enderman/enderman.png");
private ModelEnderman endermanModel;
@@ -10,8 +10,8 @@ import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class RenderMobInfestedBat extends RenderBat{
private static final ResourceLocation tex = new ResourceLocation("hardcoreenderexpansion:textures/entity/bat_infested.png");
private static final ResourceLocation tex = new ResourceLocation("hardcoreenderexpansion:textures/entity/bat_infested.png");
public RenderMobInfestedBat(){
super();
}
@@ -110,9 +110,9 @@ public class ModelEnderGuardian extends ModelBase{
rightHorn.rotateAngleY = leftHorn.rotateAngleY = head.rotateAngleY = MathUtil.toRad(rotationYaw);
rightHorn.rotateAngleX = leftHorn.rotateAngleX = head.rotateAngleX = MathUtil.toRad(rotationPitch);
float limbSwing1 = MathHelper.cos(limbSwing*0.6662F),
limbSwing2 = MathHelper.cos(limbSwing*0.6662F+(float)Math.PI);
float limbSwing1 = MathHelper.cos(limbSwing*0.6662F),
limbSwing2 = MathHelper.cos(limbSwing*0.6662F+(float)Math.PI);
rightArm.rotateAngleX = limbSwing2*2F*prevLimbSwing*0.5F;
leftArm.rotateAngleX = limbSwing1*2F*prevLimbSwing*0.5F;
@@ -19,12 +19,12 @@ public class ModelEndermanHeadBiped extends ModelBiped{
bipedHead.setRotationPoint(0F,0F,0F);
bipedHead.showModel = true;
bipedHeadwear.showModel = true;
bipedBody.showModel = false;
bipedRightArm.showModel = false;
bipedLeftArm.showModel = false;
bipedRightLeg.showModel = false;
bipedLeftLeg.showModel = false;
bipedHeadwear.showModel = true;
bipedBody.showModel = false;
bipedRightArm.showModel = false;
bipedLeftArm.showModel = false;
bipedRightLeg.showModel = false;
bipedLeftLeg.showModel = false;
}
@Override
@@ -14,7 +14,7 @@ public class ModelFireFiend extends ModelBase{
ModelRenderer rightArm1,rightArm2,leftArm1,leftArm2;
ModelRenderer rightLeg1,rightLeg2,rightLeg3,RHoof,RHoofIn,RHoofOut;
ModelRenderer leftLeg1,leftLeg2,leftLeg3,LHoof,LHoofIn,LHoofOut;
ModelRenderer leftWing1,leftWing2,rightWing1,rightWing2;
ModelRenderer leftWing1,leftWing2,rightWing1,rightWing2;
public ModelFireFiend(){
textureWidth = 64;
@@ -14,7 +14,7 @@ import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class RenderProjectilePotionOfInstability extends Render{
@Override
@Override
public void doRender(Entity entity, double x, double y, double z, float rotationYaw, float partialTickTime){
GL11.glPushMatrix();
GL11.glTranslated(x,y,z);
@@ -182,7 +182,7 @@ public class RenderTileEssenceAltar extends TileEntitySpecialRenderer{
GL11.glPopMatrix();
GL11.glPopMatrix();
}
}
}
private void startVerticalItem(){
GL11.glPushMatrix();
@@ -23,18 +23,18 @@ import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class CustomSoundManager extends SoundManager{
private static final Marker logMarker = MarkerManager.getMarker("SOUNDS");
private static final Logger logger = LogManager.getLogger();
private final SoundHandler soundHandler;
private final GameSettings gameSettings;
private int playTime = 0;
private Field fieldSndSystem;
private Map playingSounds;
private Map playingSoundPoolEntries;
private Multimap categorySounds;
private Map playingSoundsStopTime;
private static final Logger logger = LogManager.getLogger();
private final SoundHandler soundHandler;
private final GameSettings gameSettings;
private int playTime = 0;
private Field fieldSndSystem;
private Map playingSounds;
private Map playingSoundPoolEntries;
private Multimap categorySounds;
private Map playingSoundsStopTime;
public CustomSoundManager(SoundHandler soundHandler, GameSettings gameSettings){
super(soundHandler,gameSettings);
this.soundHandler = soundHandler;
@@ -20,29 +20,29 @@ public class DragonUtil{
public static int portalEffectX,portalEffectZ;
public static <K,V extends Comparable<? super V>> SortedSet<Entry<K,V>> sortMapByValueAscending(Map<K,V> map){
SortedSet<Entry<K,V>> sorted = new TreeSet<>(
new Comparator<Entry<K,V>>(){
@Override public int compare(Entry<K,V> e1, Entry<K,V> e2){
int r = e1.getValue().compareTo(e2.getValue());
return r == 0?1:r;
}
}
);
sorted.addAll(map.entrySet());
return sorted;
SortedSet<Entry<K,V>> sorted = new TreeSet<>(
new Comparator<Entry<K,V>>(){
@Override public int compare(Entry<K,V> e1, Entry<K,V> e2){
int r = e1.getValue().compareTo(e2.getValue());
return r == 0?1:r;
}
}
);
sorted.addAll(map.entrySet());
return sorted;
}
public static <K,V extends Comparable<? super V>> SortedSet<Entry<K,V>> sortMapByValueDescending(Map<K,V> map){
SortedSet<Entry<K,V>> sorted = new TreeSet<>(
new Comparator<Entry<K,V>>(){
@Override public int compare(Entry<K,V> e1, Entry<K,V> e2){
int r = e2.getValue().compareTo(e1.getValue());
return r == 0?1:r;
}
}
);
sorted.addAll(map.entrySet());
return sorted;
SortedSet<Entry<K,V>> sorted = new TreeSet<>(
new Comparator<Entry<K,V>>(){
@Override public int compare(Entry<K,V> e1, Entry<K,V> e2){
int r = e2.getValue().compareTo(e1.getValue());
return r == 0?1:r;
}
}
);
sorted.addAll(map.entrySet());
return sorted;
}
private static final double[] rayX = new double[]{ -1D, -1D, 1D, 1D },
@@ -22,17 +22,17 @@ public abstract class TileEntityAbstractSynchronized extends TileEntity{
public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity packet){
readTileFromNBT(packet.func_148857_g()); // OBFUSCATED get tag data
worldObj.markBlockRangeForRenderUpdate(xCoord,yCoord,zCoord,xCoord,yCoord,zCoord);
}
}
@Override
public void writeToNBT(NBTTagCompound nbt){
super.writeToNBT(nbt);
writeTileToNBT(nbt);
}
public void writeToNBT(NBTTagCompound nbt){
super.writeToNBT(nbt);
writeTileToNBT(nbt);
}
@Override
public void readFromNBT(NBTTagCompound nbt){
super.readFromNBT(nbt);
readTileFromNBT(nbt);
}
super.readFromNBT(nbt);
readTileFromNBT(nbt);
}
}
@@ -9,8 +9,8 @@ public class TileEntityEndermanHead extends TileEntityAbstractSynchronized{
@Override
public boolean canUpdate(){
return false;
}
return false;
}
@Override
public NBTTagCompound writeTileToNBT(NBTTagCompound nbt){
@@ -72,14 +72,14 @@ public class TileEntityEnergyCluster extends TileEntityAbstractSynchronized{
return colRgb;
}
@Override
@Override
public NBTTagCompound writeTileToNBT(NBTTagCompound nbt){
nbt.setFloat("colRed",colRgb[0]);
nbt.setFloat("colGreen",colRgb[1]);
nbt.setFloat("colBlue",colRgb[2]);
data.writeToNBT(nbt);
return nbt;
}
nbt.setFloat("colRed",colRgb[0]);
nbt.setFloat("colGreen",colRgb[1]);
nbt.setFloat("colBlue",colRgb[2]);
data.writeToNBT(nbt);
return nbt;
}
@Override
public void readTileFromNBT(NBTTagCompound nbt){
@@ -15,7 +15,7 @@ public class TileEntityEnhancedBrewingStand extends TileEntityBrewingStand imple
private static final int[] topSlots = new int[]{3},
sideSlots = new int[]{0,1,2},
bottomSlots = new int[]{4};
private ItemStack[] slotItems = new ItemStack[5];
private byte filledSlotsCache;
private short startBrewTime,brewTime,requiredPowder;
@@ -96,8 +96,8 @@ public class TileEntityEnhancedBrewingStand extends TileEntityBrewingStand imple
@Override
public int getSizeInventory(){
return slotItems.length;
}
return slotItems.length;
}
@Override
public boolean isItemValidForSlot(int slot, ItemStack is){
@@ -106,8 +106,8 @@ public class TileEntityEnhancedBrewingStand extends TileEntityBrewingStand imple
@Override
public ItemStack getStackInSlot(int slot){
return slot >= 0 && slot < slotItems.length?slotItems[slot]:null;
}
return slot >= 0 && slot < slotItems.length?slotItems[slot]:null;
}
@Override
public ItemStack decrStackSize(int slot, int amount){
@@ -161,8 +161,8 @@ public class TileEntityEnhancedBrewingStand extends TileEntityBrewingStand imple
@Override
public int getBrewTime(){
return brewTime;
}
return brewTime;
}
public int getStartBrewTime(){
return startBrewTime;
@@ -187,10 +187,10 @@ public class TileEntityEnhancedBrewingStand extends TileEntityBrewingStand imple
}
@Override
public void writeToNBT(NBTTagCompound nbt){
super.writeToNBT(nbt);
NBTTagList tagItemList = new NBTTagList();
public void writeToNBT(NBTTagCompound nbt){
super.writeToNBT(nbt);
NBTTagList tagItemList = new NBTTagList();
for(int i = 0; i < slotItems.length; ++i){
if (slotItems[i] != null){
NBTTagCompound tagSlot = new NBTTagCompound();
@@ -202,7 +202,7 @@ public class TileEntityEnhancedBrewingStand extends TileEntityBrewingStand imple
nbt.setTag("hedItems",tagItemList);
nbt.setShort("hedBrewTime",brewTime);
}
}
@Override
public void readFromNBT(NBTTagCompound nbt){
@@ -217,6 +217,6 @@ public class TileEntityEnhancedBrewingStand extends TileEntityBrewingStand imple
if (slotId >= 0 && slotId < slotItems.length)slotItems[slotId] = ItemStack.loadItemStackFromNBT(tagSlot);
}
brewTime = nbt.getShort("hedBrewTime");
brewTime = nbt.getShort("hedBrewTime");
}
}
@@ -21,18 +21,18 @@ public class TileEntityEnhancedTNT extends TileEntity{
@Override
public boolean canUpdate(){
return false;
}
return false;
}
@Override
public void writeToNBT(NBTTagCompound nbt){
super.writeToNBT(nbt);
nbt.setString("enhancements",EnhancementEnumHelper.serialize(tntEnhancements));
}
public void writeToNBT(NBTTagCompound nbt){
super.writeToNBT(nbt);
nbt.setString("enhancements",EnhancementEnumHelper.serialize(tntEnhancements));
}
@Override
public void readFromNBT(NBTTagCompound nbt){
super.readFromNBT(nbt);
tntEnhancements = EnhancementEnumHelper.deserialize(nbt.getString("enhancements"),TNTEnhancements.class);
}
super.readFromNBT(nbt);
tntEnhancements = EnhancementEnumHelper.deserialize(nbt.getString("enhancements"),TNTEnhancements.class);
}
}
@@ -38,12 +38,12 @@ public class TileEntityLaserBeam extends TileEntity{
}
@Override
public void writeToNBT(NBTTagCompound nbt){
super.writeToNBT(nbt);
public void writeToNBT(NBTTagCompound nbt){
super.writeToNBT(nbt);
nbt.setFloat("beamAng",beamAngle);
nbt.setInteger("ticksLeft",ticksLeft);
}
}
@Override
public void readFromNBT(NBTTagCompound nbt){
@@ -140,10 +140,10 @@ public class TileEntitySoulCharm extends TileEntity{
}
@Override
public void writeToNBT(NBTTagCompound nbt){
super.writeToNBT(nbt);
nbt.setTag("enhancements",enhancements);
}
public void writeToNBT(NBTTagCompound nbt){
super.writeToNBT(nbt);
nbt.setTag("enhancements",enhancements);
}
@Override
public void readFromNBT(NBTTagCompound nbt){
@@ -27,23 +27,23 @@ public final class DimensionOverride{
private static void overrideBiome(){
Field modifiersField = null;
try{
try{
BiomeGenBase sky = (new BiomeGenHardcoreEnd(9)).setColor(8421631).setBiomeName("Sky").setDisableRain();
BiomeGenBase.getBiomeGenArray()[9] = sky;
modifiersField = Field.class.getDeclaredField("modifiers");
modifiersField.setAccessible(true);
for(Field field:BiomeGenBase.class.getDeclaredFields()){
if (BiomeGenEnd.class.isAssignableFrom(field.getType())){
modifiersField = Field.class.getDeclaredField("modifiers");
modifiersField.setAccessible(true);
for(Field field:BiomeGenBase.class.getDeclaredFields()){
if (BiomeGenEnd.class.isAssignableFrom(field.getType())){
modifiersField.setInt(field,modifiersField.getInt(field) & ~Modifier.FINAL);
field.set(null,sky);
break;
}
}
}catch(Exception e){
throw new RuntimeException("Could not override the End biome!",e);
}
break;
}
}
}catch(Exception e){
throw new RuntimeException("Could not override the End biome!",e);
}
}
@SuppressWarnings("unchecked")
@@ -7,9 +7,9 @@ import net.minecraft.world.gen.structure.StructureBoundingBox;
import net.minecraft.world.gen.structure.StructureComponent;
public abstract class ComponentScatteredFeatureCustom extends StructureComponent{
protected int sizeX,sizeY,sizeZ;
public ComponentScatteredFeatureCustom(){}
protected int sizeX,sizeY,sizeZ;
public ComponentScatteredFeatureCustom(){}
protected ComponentScatteredFeatureCustom(Random rand, int x, int y, int z, int sizeX, int sizeY, int sizeZ){
super(0);
+4 -4
View File
@@ -8,10 +8,10 @@ public class ItemRunic extends Item implements IRunicArmor {
int charge;
public ItemRunic (int charge)
{
super();
this.charge = charge;
}
{
super();
this.charge = charge;
}
@Override
public int getRunicCharge(ItemStack itemstack) {
+24 -24
View File
@@ -156,11 +156,11 @@ public class ThaumcraftApi {
* @param recipe The recipe. Format is exactly the same as vanilla recipes. Input itemstacks are NBT sensitive.
*/
public static ShapedArcaneRecipe addArcaneCraftingRecipe(String research, ItemStack result, AspectList aspects, Object ... recipe)
{
{
ShapedArcaneRecipe r= new ShapedArcaneRecipe(research, result, aspects, recipe);
craftingRecipes.add(r);
craftingRecipes.add(r);
return r;
}
}
/**
* @param research the research key required for this recipe to work. Leave blank if it will work without research
@@ -169,11 +169,11 @@ public class ThaumcraftApi {
* @param recipe The recipe. Format is exactly the same as vanilla shapeless recipes. Input itemstacks are NBT sensitive.
*/
public static ShapelessArcaneRecipe addShapelessArcaneCraftingRecipe(String research, ItemStack result, AspectList aspects, Object ... recipe)
{
{
ShapelessArcaneRecipe r = new ShapelessArcaneRecipe(research, result, aspects, recipe);
craftingRecipes.add(r);
craftingRecipes.add(r);
return r;
}
}
/**
* @param research the research key required for this recipe to work. Leave blank if it will work without research
@@ -187,12 +187,12 @@ public class ThaumcraftApi {
*
*/
public static InfusionRecipe addInfusionCraftingRecipe(String research, Object result, int instability, AspectList aspects, ItemStack input,ItemStack[] recipe)
{
{
if (!(result instanceof ItemStack || result instanceof Object[])) return null;
InfusionRecipe r= new InfusionRecipe(research, result, instability, aspects, input, recipe);
craftingRecipes.add(r);
craftingRecipes.add(r);
return r;
}
}
/**
* @param research the research key required for this recipe to work. Leave blank if it will work without research
@@ -205,11 +205,11 @@ public class ThaumcraftApi {
*
*/
public static InfusionEnchantmentRecipe addInfusionEnchantmentRecipe(String research, Enchantment enchantment, int instability, AspectList aspects, ItemStack[] recipe)
{
{
InfusionEnchantmentRecipe r= new InfusionEnchantmentRecipe(research, enchantment, instability, aspects, recipe);
craftingRecipes.add(r);
craftingRecipes.add(r);
return r;
}
}
/**
* @param stack the recipe result
@@ -227,20 +227,20 @@ public class ThaumcraftApi {
return null;
}
/**
* @param key the research key required for this recipe to work.
* @param result the output result
* @param catalyst an itemstack of the catalyst or a string if it is an ore dictionary item
* @param cost the vis cost
* @param tags the aspects required to craft this
*/
public static CrucibleRecipe addCrucibleRecipe(String key, ItemStack result, Object catalyst, AspectList tags) {
CrucibleRecipe rc = new CrucibleRecipe(key, result, catalyst, tags);
getCraftingRecipes().add(rc);
/**
* @param key the research key required for this recipe to work.
* @param result the output result
* @param catalyst an itemstack of the catalyst or a string if it is an ore dictionary item
* @param cost the vis cost
* @param tags the aspects required to craft this
*/
public static CrucibleRecipe addCrucibleRecipe(String key, ItemStack result, Object catalyst, AspectList tags) {
CrucibleRecipe rc = new CrucibleRecipe(key, result, catalyst, tags);
getCraftingRecipes().add(rc);
return rc;
}
/**
* @param stack the recipe result
@@ -40,13 +40,13 @@ public class ThaumcraftApiHelper {
}
public static boolean areItemsEqual(ItemStack s1,ItemStack s2)
{
{
if (s1.isItemStackDamageable() && s2.isItemStackDamageable())
{
return s1.getItem() == s2.getItem();
} else
return s1.getItem() == s2.getItem() && s1.getItemDamage() == s2.getItemDamage();
}
}
static Method isResearchComplete;
static Method getObjectTags;
@@ -54,138 +54,138 @@ public class ThaumcraftApiHelper {
static Method generateTags;
public static boolean isResearchComplete(String username, String researchkey) {
boolean ot = false;
try {
if(isResearchComplete == null) {
Class fake = Class.forName("thaumcraft.common.lib.research.ResearchManager");
isResearchComplete = fake.getMethod("isResearchComplete", String.class, String.class);
}
ot = (Boolean) isResearchComplete.invoke(null, username, researchkey);
} catch(Exception ex) {
FMLLog.warning("[Thaumcraft API] Could not invoke thaumcraft.common.lib.research.ResearchManager method isResearchComplete");
}
try {
if(isResearchComplete == null) {
Class fake = Class.forName("thaumcraft.common.lib.research.ResearchManager");
isResearchComplete = fake.getMethod("isResearchComplete", String.class, String.class);
}
ot = (Boolean) isResearchComplete.invoke(null, username, researchkey);
} catch(Exception ex) {
FMLLog.warning("[Thaumcraft API] Could not invoke thaumcraft.common.lib.research.ResearchManager method isResearchComplete");
}
return ot;
}
public static ItemStack getStackInRowAndColumn(Object instance, int row, int column) {
ItemStack ot = null;
try {
Class fake = Class.forName("thaumcraft.common.tiles.TileMagicWorkbench");
Method getStackInRowAndColumn = fake.getMethod("getStackInRowAndColumn", int.class, int.class);
ot = (ItemStack) getStackInRowAndColumn.invoke(instance, row, column);
} catch(Exception ex) {
FMLLog.warning("[Thaumcraft API] Could not invoke thaumcraft.common.tiles.TileMagicWorkbench method getStackInRowAndColumn");
}
try {
Class fake = Class.forName("thaumcraft.common.tiles.TileMagicWorkbench");
Method getStackInRowAndColumn = fake.getMethod("getStackInRowAndColumn", int.class, int.class);
ot = (ItemStack) getStackInRowAndColumn.invoke(instance, row, column);
} catch(Exception ex) {
FMLLog.warning("[Thaumcraft API] Could not invoke thaumcraft.common.tiles.TileMagicWorkbench method getStackInRowAndColumn");
}
return ot;
}
public static AspectList getObjectAspects(ItemStack is) {
AspectList ot = null;
try {
if(getObjectTags == null) {
Class fake = Class.forName("thaumcraft.common.lib.crafting.ThaumcraftCraftingManager");
getObjectTags = fake.getMethod("getObjectTags", ItemStack.class);
}
ot = (AspectList) getObjectTags.invoke(null, is);
} catch(Exception ex) {
FMLLog.warning("[Thaumcraft API] Could not invoke thaumcraft.common.lib.crafting.ThaumcraftCraftingManager method getObjectTags");
}
try {
if(getObjectTags == null) {
Class fake = Class.forName("thaumcraft.common.lib.crafting.ThaumcraftCraftingManager");
getObjectTags = fake.getMethod("getObjectTags", ItemStack.class);
}
ot = (AspectList) getObjectTags.invoke(null, is);
} catch(Exception ex) {
FMLLog.warning("[Thaumcraft API] Could not invoke thaumcraft.common.lib.crafting.ThaumcraftCraftingManager method getObjectTags");
}
return ot;
}
public static AspectList getBonusObjectTags(ItemStack is,AspectList ot) {
try {
if(getBonusTags == null) {
Class fake = Class.forName("thaumcraft.common.lib.crafting.ThaumcraftCraftingManager");
getBonusTags = fake.getMethod("getBonusTags", ItemStack.class, AspectList.class);
}
ot = (AspectList) getBonusTags.invoke(null, is, ot);
} catch(Exception ex) {
FMLLog.warning("[Thaumcraft API] Could not invoke thaumcraft.common.lib.crafting.ThaumcraftCraftingManager method getBonusTags");
}
try {
if(getBonusTags == null) {
Class fake = Class.forName("thaumcraft.common.lib.crafting.ThaumcraftCraftingManager");
getBonusTags = fake.getMethod("getBonusTags", ItemStack.class, AspectList.class);
}
ot = (AspectList) getBonusTags.invoke(null, is, ot);
} catch(Exception ex) {
FMLLog.warning("[Thaumcraft API] Could not invoke thaumcraft.common.lib.crafting.ThaumcraftCraftingManager method getBonusTags");
}
return ot;
}
public static AspectList generateTags(Item item, int meta) {
try {
if(generateTags == null) {
Class fake = Class.forName("thaumcraft.common.lib.crafting.ThaumcraftCraftingManager");
generateTags = fake.getMethod("generateTags", Item.class, int.class);
}
return (AspectList) generateTags.invoke(null, item, meta);
} catch(Exception ex) {
FMLLog.warning("[Thaumcraft API] Could not invoke thaumcraft.common.lib.crafting.ThaumcraftCraftingManager method generateTags");
}
try {
if(generateTags == null) {
Class fake = Class.forName("thaumcraft.common.lib.crafting.ThaumcraftCraftingManager");
generateTags = fake.getMethod("generateTags", Item.class, int.class);
}
return (AspectList) generateTags.invoke(null, item, meta);
} catch(Exception ex) {
FMLLog.warning("[Thaumcraft API] Could not invoke thaumcraft.common.lib.crafting.ThaumcraftCraftingManager method generateTags");
}
return null;
}
public static boolean containsMatch(boolean strict, ItemStack[] inputs, ItemStack... targets)
{
for (ItemStack input : inputs)
{
for (ItemStack target : targets)
{
if (itemMatches(target, input, strict))
{
return true;
}
}
}
return false;
}
{
for (ItemStack input : inputs)
{
for (ItemStack target : targets)
{
if (itemMatches(target, input, strict))
{
return true;
}
}
}
return false;
}
public static boolean itemMatches(ItemStack target, ItemStack input, boolean strict)
{
if (input == null && target != null || input != null && target == null)
{
return false;
}
return (target.getItem() == input.getItem() && ((target.getItemDamage() == OreDictionary.WILDCARD_VALUE && !strict) || target.getItemDamage() == input.getItemDamage()));
}
public static TileEntity getConnectableTile(World world, int x, int y, int z, ForgeDirection face) {
public static boolean itemMatches(ItemStack target, ItemStack input, boolean strict)
{
if (input == null && target != null || input != null && target == null)
{
return false;
}
return (target.getItem() == input.getItem() && ((target.getItemDamage() == OreDictionary.WILDCARD_VALUE && !strict) || target.getItemDamage() == input.getItemDamage()));
}
public static TileEntity getConnectableTile(World world, int x, int y, int z, ForgeDirection face) {
TileEntity te = world.getTileEntity(x+face.offsetX, y+face.offsetY, z+face.offsetZ);
if (te instanceof IEssentiaTransport && ((IEssentiaTransport)te).isConnectable(face.getOpposite()))
return te;
else
return null;
}
public static TileEntity getConnectableTile(IBlockAccess world, int x, int y, int z, ForgeDirection face) {
public static TileEntity getConnectableTile(IBlockAccess world, int x, int y, int z, ForgeDirection face) {
TileEntity te = world.getTileEntity(x+face.offsetX, y+face.offsetY, z+face.offsetZ);
if (te instanceof IEssentiaTransport && ((IEssentiaTransport)te).isConnectable(face.getOpposite()))
return te;
else
return null;
}
private static HashMap<Integer, AspectList> allAspects= new HashMap<Integer, AspectList>();
private static HashMap<Integer, AspectList> allCompoundAspects= new HashMap<Integer, AspectList>();
public static AspectList getAllAspects(int amount) {
if (allAspects.get(amount) == null) {
AspectList al = new AspectList();
for (Aspect aspect:Aspect.aspects.values()) {
al.add(aspect, amount);
}
allAspects.put(amount, al);
}
return allAspects.get(amount);
}
public static AspectList getAllCompoundAspects(int amount) {
if (allCompoundAspects.get(amount) == null) {
AspectList al = new AspectList();
for (Aspect aspect:Aspect.getCompoundAspects()) {
al.add(aspect, amount);
}
allCompoundAspects.put(amount, al);
}
return allCompoundAspects.get(amount);
}
static Method consumeVisFromWand;
private static HashMap<Integer, AspectList> allAspects= new HashMap<Integer, AspectList>();
private static HashMap<Integer, AspectList> allCompoundAspects= new HashMap<Integer, AspectList>();
public static AspectList getAllAspects(int amount) {
if (allAspects.get(amount) == null) {
AspectList al = new AspectList();
for (Aspect aspect:Aspect.aspects.values()) {
al.add(aspect, amount);
}
allAspects.put(amount, al);
}
return allAspects.get(amount);
}
public static AspectList getAllCompoundAspects(int amount) {
if (allCompoundAspects.get(amount) == null) {
AspectList al = new AspectList();
for (Aspect aspect:Aspect.getCompoundAspects()) {
al.add(aspect, amount);
}
allCompoundAspects.put(amount, al);
}
return allCompoundAspects.get(amount);
}
static Method consumeVisFromWand;
/**
* Use to subtract vis from a wand for most operations
* Wands store vis differently so "real" vis costs need to be multiplied by 100 before calling this method
@@ -200,17 +200,17 @@ public class ThaumcraftApiHelper {
public static boolean consumeVisFromWand(ItemStack wand, EntityPlayer player,
AspectList cost, boolean doit, boolean crafting) {
boolean ot = false;
try {
if(consumeVisFromWand == null) {
Class fake = Class.forName("thaumcraft.common.items.wands.ItemWandCasting");
consumeVisFromWand = fake.getMethod("consumeAllVis",
ItemStack.class, EntityPlayer.class, AspectList.class, boolean.class, boolean.class);
}
ot = (Boolean) consumeVisFromWand.invoke(
consumeVisFromWand.getDeclaringClass().cast(wand.getItem()), wand, player, cost, doit, crafting);
} catch(Exception ex) {
FMLLog.warning("[Thaumcraft API] Could not invoke thaumcraft.common.items.wands.ItemWandCasting method consumeAllVis");
}
try {
if(consumeVisFromWand == null) {
Class fake = Class.forName("thaumcraft.common.items.wands.ItemWandCasting");
consumeVisFromWand = fake.getMethod("consumeAllVis",
ItemStack.class, EntityPlayer.class, AspectList.class, boolean.class, boolean.class);
}
ot = (Boolean) consumeVisFromWand.invoke(
consumeVisFromWand.getDeclaringClass().cast(wand.getItem()), wand, player, cost, doit, crafting);
} catch(Exception ex) {
FMLLog.warning("[Thaumcraft API] Could not invoke thaumcraft.common.items.wands.ItemWandCasting method consumeAllVis");
}
return ot;
}
@@ -228,17 +228,17 @@ public class ThaumcraftApiHelper {
public static boolean consumeVisFromWandCrafting(ItemStack wand, EntityPlayer player,
AspectList cost, boolean doit) {
boolean ot = false;
try {
if(consumeVisFromWandCrafting == null) {
Class fake = Class.forName("thaumcraft.common.items.wands.ItemWandCasting");
consumeVisFromWandCrafting = fake.getMethod("consumeAllVisCrafting",
ItemStack.class, EntityPlayer.class, AspectList.class, boolean.class);
}
ot = (Boolean) consumeVisFromWandCrafting.invoke(
consumeVisFromWandCrafting.getDeclaringClass().cast(wand.getItem()), wand, player, cost, doit);
} catch(Exception ex) {
FMLLog.warning("[Thaumcraft API] Could not invoke thaumcraft.common.items.wands.ItemWandCasting method consumeAllVisCrafting");
}
try {
if(consumeVisFromWandCrafting == null) {
Class fake = Class.forName("thaumcraft.common.items.wands.ItemWandCasting");
consumeVisFromWandCrafting = fake.getMethod("consumeAllVisCrafting",
ItemStack.class, EntityPlayer.class, AspectList.class, boolean.class);
}
ot = (Boolean) consumeVisFromWandCrafting.invoke(
consumeVisFromWandCrafting.getDeclaringClass().cast(wand.getItem()), wand, player, cost, doit);
} catch(Exception ex) {
FMLLog.warning("[Thaumcraft API] Could not invoke thaumcraft.common.items.wands.ItemWandCasting method consumeAllVisCrafting");
}
return ot;
}
@@ -253,16 +253,16 @@ public class ThaumcraftApiHelper {
*/
public static boolean consumeVisFromInventory(EntityPlayer player, AspectList cost) {
boolean ot = false;
try {
if(consumeVisFromInventory == null) {
Class fake = Class.forName("thaumcraft.common.items.wands.WandManager");
consumeVisFromInventory = fake.getMethod("consumeVisFromInventory",
EntityPlayer.class, AspectList.class);
}
ot = (Boolean) consumeVisFromInventory.invoke(null, player, cost);
} catch(Exception ex) {
FMLLog.warning("[Thaumcraft API] Could not invoke thaumcraft.common.items.wands.WandManager method consumeVisFromInventory");
}
try {
if(consumeVisFromInventory == null) {
Class fake = Class.forName("thaumcraft.common.items.wands.WandManager");
consumeVisFromInventory = fake.getMethod("consumeVisFromInventory",
EntityPlayer.class, AspectList.class);
}
ot = (Boolean) consumeVisFromInventory.invoke(null, player, cost);
} catch(Exception ex) {
FMLLog.warning("[Thaumcraft API] Could not invoke thaumcraft.common.items.wands.WandManager method consumeVisFromInventory");
}
return ot;
}
}
@@ -221,9 +221,9 @@ public class AspectList implements Serializable {
* @return
*/
public void readFromNBT(NBTTagCompound nbttagcompound)
{
aspects.clear();
NBTTagList tlist = nbttagcompound.getTagList("Aspects",(byte)10);
{
aspects.clear();
NBTTagList tlist = nbttagcompound.getTagList("Aspects",(byte)10);
for (int j = 0; j < tlist.tagCount(); j++) {
NBTTagCompound rs = tlist.getCompoundTagAt(j);
if (rs.hasKey("key")) {
@@ -231,7 +231,7 @@ public class AspectList implements Serializable {
rs.getInteger("amount"));
}
}
}
}
/**
* Writes the list of aspects to nbt
@@ -239,8 +239,8 @@ public class AspectList implements Serializable {
* @return
*/
public void writeToNBT(NBTTagCompound nbttagcompound)
{
NBTTagList tlist = new NBTTagList();
{
NBTTagList tlist = new NBTTagList();
nbttagcompound.setTag("Aspects", tlist);
for (Aspect aspect : getAspects())
if (aspect != null) {
@@ -249,7 +249,7 @@ public class AspectList implements Serializable {
f.setInteger("amount", getAmount(aspect));
tlist.appendTag(f);
}
}
}
@@ -22,15 +22,15 @@ public class AspectSourceHelper {
* @return boolean returns true if essentia was found and removed from a source.
*/
public static boolean drainEssentia(TileEntity tile, Aspect aspect, ForgeDirection direction, int range) {
try {
if(drainEssentia == null) {
Class fake = Class.forName("thaumcraft.common.lib.events.EssentiaHandler");
drainEssentia = fake.getMethod("drainEssentia", TileEntity.class, Aspect.class, ForgeDirection.class, int.class);
}
return (Boolean) drainEssentia.invoke(null, tile, aspect, direction, range);
} catch(Exception ex) {
FMLLog.warning("[Thaumcraft API] Could not invoke thaumcraft.common.lib.events.EssentiaHandler method drainEssentia");
}
try {
if(drainEssentia == null) {
Class fake = Class.forName("thaumcraft.common.lib.events.EssentiaHandler");
drainEssentia = fake.getMethod("drainEssentia", TileEntity.class, Aspect.class, ForgeDirection.class, int.class);
}
return (Boolean) drainEssentia.invoke(null, tile, aspect, direction, range);
} catch(Exception ex) {
FMLLog.warning("[Thaumcraft API] Could not invoke thaumcraft.common.lib.events.EssentiaHandler method drainEssentia");
}
return false;
}
@@ -44,15 +44,15 @@ public class AspectSourceHelper {
* @return boolean returns true if essentia was found and removed from a source.
*/
public static boolean findEssentia(TileEntity tile, Aspect aspect, ForgeDirection direction, int range) {
try {
if(findEssentia == null) {
Class fake = Class.forName("thaumcraft.common.lib.events.EssentiaHandler");
findEssentia = fake.getMethod("findEssentia", TileEntity.class, Aspect.class, ForgeDirection.class, int.class);
}
return (Boolean) findEssentia.invoke(null, tile, aspect, direction, range);
} catch(Exception ex) {
FMLLog.warning("[Thaumcraft API] Could not invoke thaumcraft.common.lib.events.EssentiaHandler method findEssentia");
}
try {
if(findEssentia == null) {
Class fake = Class.forName("thaumcraft.common.lib.events.EssentiaHandler");
findEssentia = fake.getMethod("findEssentia", TileEntity.class, Aspect.class, ForgeDirection.class, int.class);
}
return (Boolean) findEssentia.invoke(null, tile, aspect, direction, range);
} catch(Exception ex) {
FMLLog.warning("[Thaumcraft API] Could not invoke thaumcraft.common.lib.events.EssentiaHandler method findEssentia");
}
return false;
}
}
@@ -10,26 +10,26 @@ public interface IArcaneRecipe
{
/**
* Used to check if a recipe matches current crafting inventory
* @param player
*/
boolean matches(IInventory var1, World world, EntityPlayer player);
/**
* Used to check if a recipe matches current crafting inventory
* @param player
*/
boolean matches(IInventory var1, World world, EntityPlayer player);
/**
* Returns an Item that is the result of this recipe
*/
ItemStack getCraftingResult(IInventory var1);
/**
* Returns an Item that is the result of this recipe
*/
ItemStack getCraftingResult(IInventory var1);
/**
* Returns the size of the recipe area
*/
int getRecipeSize();
/**
* Returns the size of the recipe area
*/
int getRecipeSize();
ItemStack getRecipeOutput();
AspectList getAspects();
AspectList getAspects(IInventory var1);
String getResearch();
ItemStack getRecipeOutput();
AspectList getAspects();
AspectList getAspects(IInventory var1);
String getResearch();
}
@@ -34,13 +34,13 @@ public class InfusionEnchantmentRecipe
}
/**
* Used to check if a recipe matches current crafting inventory
* @param player
*/
* Used to check if a recipe matches current crafting inventory
* @param player
*/
public boolean matches(ArrayList<ItemStack> input, ItemStack central, World world, EntityPlayer player) {
if (research.length()>0 && !ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), research)) {
return false;
}
return false;
}
if (!enchantment.canApply(central) || !central.getItem().isItemTool(central)) {
return false;
@@ -48,19 +48,19 @@ public class InfusionEnchantmentRecipe
Map map1 = EnchantmentHelper.getEnchantments(central);
Iterator iterator = map1.keySet().iterator();
while (iterator.hasNext())
{
int j1 = ((Integer)iterator.next()).intValue();
Enchantment ench = Enchantment.enchantmentsList[j1];
if (j1 == enchantment.effectId &&
EnchantmentHelper.getEnchantmentLevel(j1, central) >= ench.getMaxLevel())
return false;
if (enchantment.effectId != ench.effectId &&
(!enchantment.canApplyTogether(ench) ||
!ench.canApplyTogether(enchantment))) {
return false;
}
}
while (iterator.hasNext())
{
int j1 = ((Integer)iterator.next()).intValue();
Enchantment ench = Enchantment.enchantmentsList[j1];
if (j1 == enchantment.effectId &&
EnchantmentHelper.getEnchantmentLevel(j1, central) >= ench.getMaxLevel())
return false;
if (enchantment.effectId != ench.effectId &&
(!enchantment.canApplyTogether(ench) ||
!ench.canApplyTogether(enchantment))) {
return false;
}
}
ItemStack i2 = null;
@@ -86,10 +86,10 @@ public class InfusionEnchantmentRecipe
}
// System.out.println(ii.size());
return ii.size() == 0?true:false;
}
}
private boolean areItemStacksEqual(ItemStack stack0, ItemStack stack1, boolean fuzzy)
{
{
if (stack0 == null && stack1 != null) return false;
if (stack0 != null && stack1 == null) return false;
if (stack0 == null && stack1 == null) return true;
@@ -105,34 +105,34 @@ public class InfusionEnchantmentRecipe
}
else
t1 = ItemStack.areItemStackTagsEqual(stack0, stack1);
return stack0.getItem() != stack1.getItem() ? false : (stack0.getItemDamage() != stack1.getItemDamage() ? false : (stack0.stackSize > stack0.getMaxStackSize() ? false : t1));
}
return stack0.getItem() != stack1.getItem() ? false : (stack0.getItemDamage() != stack1.getItemDamage() ? false : (stack0.stackSize > stack0.getMaxStackSize() ? false : t1));
}
public Enchantment getEnchantment() {
public Enchantment getEnchantment() {
return enchantment;
}
public AspectList getAspects() {
}
public AspectList getAspects() {
return aspects;
}
public String getResearch() {
}
public String getResearch() {
return research;
}
}
public int calcInstability(ItemStack recipeInput) {
int i = 0;
Map map1 = EnchantmentHelper.getEnchantments(recipeInput);
Iterator iterator = map1.keySet().iterator();
while (iterator.hasNext())
{
int j1 = ((Integer)iterator.next()).intValue();
i += EnchantmentHelper.getEnchantmentLevel(j1, recipeInput);
}
while (iterator.hasNext())
{
int j1 = ((Integer)iterator.next()).intValue();
i += EnchantmentHelper.getEnchantmentLevel(j1, recipeInput);
}
return (i/2) + instability;
}
@@ -144,12 +144,12 @@ public class InfusionEnchantmentRecipe
float mod = EnchantmentHelper.getEnchantmentLevel(enchantment.effectId, recipeInput);
Map map1 = EnchantmentHelper.getEnchantments(recipeInput);
Iterator iterator = map1.keySet().iterator();
while (iterator.hasNext())
{
int j1 = ((Integer)iterator.next()).intValue();
if (j1 != enchantment.effectId)
mod += EnchantmentHelper.getEnchantmentLevel(j1, recipeInput) * .1f;
}
while (iterator.hasNext())
{
int j1 = ((Integer)iterator.next()).intValue();
if (j1 != enchantment.effectId)
mod += EnchantmentHelper.getEnchantmentLevel(j1, recipeInput) * .1f;
}
return mod;
}
@@ -29,15 +29,15 @@ public class InfusionRecipe
}
/**
* Used to check if a recipe matches current crafting inventory
* @param player
*/
* Used to check if a recipe matches current crafting inventory
* @param player
*/
public boolean matches(ArrayList<ItemStack> input, ItemStack central, World world, EntityPlayer player) {
if (getRecipeInput() == null) return false;
if (research.length()>0 && !ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), research)) {
return false;
}
return false;
}
ItemStack i2 = central.copy();
if (getRecipeInput().getItemDamage() == OreDictionary.WILDCARD_VALUE) {
@@ -67,10 +67,10 @@ public class InfusionRecipe
if (!b) return false;
}
return ii.size() == 0?true:false;
}
}
protected boolean areItemStacksEqual(ItemStack stack0, ItemStack stack1, boolean fuzzy)
{
{
if (stack0 == null && stack1 != null) return false;
if (stack0 != null && stack1 == null) return false;
if (stack0 == null && stack1 == null) return true;
@@ -86,26 +86,26 @@ public class InfusionRecipe
}
else
t1 = ItemStack.areItemStackTagsEqual(stack0, stack1);
return stack0.getItem() != stack1.getItem() ? false : (stack0.getItemDamage() != stack1.getItemDamage() ? false : (stack0.stackSize > stack0.getMaxStackSize() ? false : t1));
}
return stack0.getItem() != stack1.getItem() ? false : (stack0.getItemDamage() != stack1.getItemDamage() ? false : (stack0.stackSize > stack0.getMaxStackSize() ? false : t1));
}
public Object getRecipeOutput() {
public Object getRecipeOutput() {
return getRecipeOutput(this.getRecipeInput());
}
public AspectList getAspects() {
}
public AspectList getAspects() {
return getAspects(this.getRecipeInput());
}
}
public int getInstability() {
public int getInstability() {
return getInstability(this.getRecipeInput());
}
public String getResearch() {
}
public String getResearch() {
return research;
}
}
public ItemStack getRecipeInput() {
return recipeInput;
}
@@ -116,13 +116,13 @@ public class InfusionRecipe
public Object getRecipeOutput(ItemStack input) {
return recipeOutput;
}
public AspectList getAspects(ItemStack input) {
}
public AspectList getAspects(ItemStack input) {
return aspects;
}
public int getInstability(ItemStack input) {
}
public int getInstability(ItemStack input) {
return instability;
}
}
}
@@ -15,241 +15,241 @@ import thaumcraft.api.aspects.AspectList;
public class ShapedArcaneRecipe implements IArcaneRecipe
{
//Added in for future ease of change, but hard coded for now.
private static final int MAX_CRAFT_GRID_WIDTH = 3;
private static final int MAX_CRAFT_GRID_HEIGHT = 3;
//Added in for future ease of change, but hard coded for now.
private static final int MAX_CRAFT_GRID_WIDTH = 3;
private static final int MAX_CRAFT_GRID_HEIGHT = 3;
public ItemStack output = null;
public Object[] input = null;
public AspectList aspects = null;
public String research;
public int width = 0;
public int height = 0;
private boolean mirrored = true;
public ItemStack output = null;
public Object[] input = null;
public AspectList aspects = null;
public String research;
public int width = 0;
public int height = 0;
private boolean mirrored = true;
public ShapedArcaneRecipe(String research, Block result, AspectList aspects, Object... recipe){ this(research, new ItemStack(result), aspects, recipe); }
public ShapedArcaneRecipe(String research, Item result, AspectList aspects, Object... recipe){ this(research, new ItemStack(result), aspects, recipe); }
public ShapedArcaneRecipe(String research, ItemStack result, AspectList aspects, Object... recipe)
{
output = result.copy();
this.research = research;
this.aspects = aspects;
String shape = "";
int idx = 0;
public ShapedArcaneRecipe(String research, Block result, AspectList aspects, Object... recipe){ this(research, new ItemStack(result), aspects, recipe); }
public ShapedArcaneRecipe(String research, Item result, AspectList aspects, Object... recipe){ this(research, new ItemStack(result), aspects, recipe); }
public ShapedArcaneRecipe(String research, ItemStack result, AspectList aspects, Object... recipe)
{
output = result.copy();
this.research = research;
this.aspects = aspects;
String shape = "";
int idx = 0;
if (recipe[idx] instanceof Boolean)
{
mirrored = (Boolean)recipe[idx];
if (recipe[idx+1] instanceof Object[])
{
recipe = (Object[])recipe[idx+1];
}
else
{
idx = 1;
}
}
if (recipe[idx] instanceof Boolean)
{
mirrored = (Boolean)recipe[idx];
if (recipe[idx+1] instanceof Object[])
{
recipe = (Object[])recipe[idx+1];
}
else
{
idx = 1;
}
}
if (recipe[idx] instanceof String[])
{
String[] parts = ((String[])recipe[idx++]);
if (recipe[idx] instanceof String[])
{
String[] parts = ((String[])recipe[idx++]);
for (String s : parts)
{
width = s.length();
shape += s;
}
for (String s : parts)
{
width = s.length();
shape += s;
}
height = parts.length;
}
else
{
while (recipe[idx] instanceof String)
{
String s = (String)recipe[idx++];
shape += s;
width = s.length();
height++;
}
}
height = parts.length;
}
else
{
while (recipe[idx] instanceof String)
{
String s = (String)recipe[idx++];
shape += s;
width = s.length();
height++;
}
}
if (width * height != shape.length())
{
String ret = "Invalid shaped ore recipe: ";
for (Object tmp : recipe)
{
ret += tmp + ", ";
}
ret += output;
throw new RuntimeException(ret);
}
if (width * height != shape.length())
{
String ret = "Invalid shaped ore recipe: ";
for (Object tmp : recipe)
{
ret += tmp + ", ";
}
ret += output;
throw new RuntimeException(ret);
}
HashMap<Character, Object> itemMap = new HashMap<Character, Object>();
HashMap<Character, Object> itemMap = new HashMap<Character, Object>();
for (; idx < recipe.length; idx += 2)
{
Character chr = (Character)recipe[idx];
Object in = recipe[idx + 1];
for (; idx < recipe.length; idx += 2)
{
Character chr = (Character)recipe[idx];
Object in = recipe[idx + 1];
if (in instanceof ItemStack)
{
itemMap.put(chr, ((ItemStack)in).copy());
}
else if (in instanceof Item)
{
itemMap.put(chr, new ItemStack((Item)in));
}
else if (in instanceof Block)
{
itemMap.put(chr, new ItemStack((Block)in, 1, OreDictionary.WILDCARD_VALUE));
}
else if (in instanceof String)
{
itemMap.put(chr, OreDictionary.getOres((String)in));
}
else
{
String ret = "Invalid shaped ore recipe: ";
for (Object tmp : recipe)
{
ret += tmp + ", ";
}
ret += output;
throw new RuntimeException(ret);
}
}
if (in instanceof ItemStack)
{
itemMap.put(chr, ((ItemStack)in).copy());
}
else if (in instanceof Item)
{
itemMap.put(chr, new ItemStack((Item)in));
}
else if (in instanceof Block)
{
itemMap.put(chr, new ItemStack((Block)in, 1, OreDictionary.WILDCARD_VALUE));
}
else if (in instanceof String)
{
itemMap.put(chr, OreDictionary.getOres((String)in));
}
else
{
String ret = "Invalid shaped ore recipe: ";
for (Object tmp : recipe)
{
ret += tmp + ", ";
}
ret += output;
throw new RuntimeException(ret);
}
}
input = new Object[width * height];
int x = 0;
for (char chr : shape.toCharArray())
{
input[x++] = itemMap.get(chr);
}
}
input = new Object[width * height];
int x = 0;
for (char chr : shape.toCharArray())
{
input[x++] = itemMap.get(chr);
}
}
@Override
public ItemStack getCraftingResult(IInventory var1){ return output.copy(); }
@Override
public ItemStack getCraftingResult(IInventory var1){ return output.copy(); }
@Override
public int getRecipeSize(){ return input.length; }
@Override
public int getRecipeSize(){ return input.length; }
@Override
public ItemStack getRecipeOutput(){ return output; }
@Override
public ItemStack getRecipeOutput(){ return output; }
@Override
public boolean matches(IInventory inv, World world, EntityPlayer player)
{
if (research.length()>0 && !ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), research)) {
return false;
}
for (int x = 0; x <= MAX_CRAFT_GRID_WIDTH - width; x++)
{
for (int y = 0; y <= MAX_CRAFT_GRID_HEIGHT - height; ++y)
{
if (checkMatch(inv, x, y, false))
{
return true;
}
@Override
public boolean matches(IInventory inv, World world, EntityPlayer player)
{
if (research.length()>0 && !ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), research)) {
return false;
}
for (int x = 0; x <= MAX_CRAFT_GRID_WIDTH - width; x++)
{
for (int y = 0; y <= MAX_CRAFT_GRID_HEIGHT - height; ++y)
{
if (checkMatch(inv, x, y, false))
{
return true;
}
if (mirrored && checkMatch(inv, x, y, true))
{
return true;
}
}
}
if (mirrored && checkMatch(inv, x, y, true))
{
return true;
}
}
}
return false;
}
return false;
}
private boolean checkMatch(IInventory inv, int startX, int startY, boolean mirror)
{
for (int x = 0; x < MAX_CRAFT_GRID_WIDTH; x++)
{
for (int y = 0; y < MAX_CRAFT_GRID_HEIGHT; y++)
{
int subX = x - startX;
int subY = y - startY;
Object target = null;
private boolean checkMatch(IInventory inv, int startX, int startY, boolean mirror)
{
for (int x = 0; x < MAX_CRAFT_GRID_WIDTH; x++)
{
for (int y = 0; y < MAX_CRAFT_GRID_HEIGHT; y++)
{
int subX = x - startX;
int subY = y - startY;
Object target = null;
if (subX >= 0 && subY >= 0 && subX < width && subY < height)
{
if (mirror)
{
target = input[width - subX - 1 + subY * width];
}
else
{
target = input[subX + subY * width];
}
}
if (subX >= 0 && subY >= 0 && subX < width && subY < height)
{
if (mirror)
{
target = input[width - subX - 1 + subY * width];
}
else
{
target = input[subX + subY * width];
}
}
ItemStack slot = ThaumcraftApiHelper.getStackInRowAndColumn(inv, x, y);
ItemStack slot = ThaumcraftApiHelper.getStackInRowAndColumn(inv, x, y);
if (target instanceof ItemStack)
{
if (!checkItemEquals((ItemStack)target, slot))
{
return false;
}
}
else if (target instanceof ArrayList)
{
boolean matched = false;
if (target instanceof ItemStack)
{
if (!checkItemEquals((ItemStack)target, slot))
{
return false;
}
}
else if (target instanceof ArrayList)
{
boolean matched = false;
for (ItemStack item : (ArrayList<ItemStack>)target)
{
matched = matched || checkItemEquals(item, slot);
}
for (ItemStack item : (ArrayList<ItemStack>)target)
{
matched = matched || checkItemEquals(item, slot);
}
if (!matched)
{
return false;
}
}
else if (target == null && slot != null)
{
return false;
}
}
}
if (!matched)
{
return false;
}
}
else if (target == null && slot != null)
{
return false;
}
}
}
return true;
}
return true;
}
private boolean checkItemEquals(ItemStack target, ItemStack input)
{
if (input == null && target != null || input != null && target == null)
{
return false;
}
return (target.getItem() == input.getItem() &&
(!target.hasTagCompound() || ItemStack.areItemStackTagsEqual(target, input)) &&
(target.getItemDamage() == OreDictionary.WILDCARD_VALUE|| target.getItemDamage() == input.getItemDamage()));
}
private boolean checkItemEquals(ItemStack target, ItemStack input)
{
if (input == null && target != null || input != null && target == null)
{
return false;
}
return (target.getItem() == input.getItem() &&
(!target.hasTagCompound() || ItemStack.areItemStackTagsEqual(target, input)) &&
(target.getItemDamage() == OreDictionary.WILDCARD_VALUE|| target.getItemDamage() == input.getItemDamage()));
}
public ShapedArcaneRecipe setMirrored(boolean mirror)
{
mirrored = mirror;
return this;
}
public ShapedArcaneRecipe setMirrored(boolean mirror)
{
mirrored = mirror;
return this;
}
/**
* Returns the input for this recipe, any mod accessing this value should never
* manipulate the values in this array as it will effect the recipe itself.
* @return The recipes input vales.
*/
public Object[] getInput()
{
return this.input;
}
@Override
/**
* Returns the input for this recipe, any mod accessing this value should never
* manipulate the values in this array as it will effect the recipe itself.
* @return The recipes input vales.
*/
public Object[] getInput()
{
return this.input;
}
@Override
public AspectList getAspects() {
return aspects;
}
@Override
@Override
public AspectList getAspects(IInventory inv) {
return aspects;
}
@@ -15,137 +15,137 @@ import thaumcraft.api.aspects.AspectList;
public class ShapelessArcaneRecipe implements IArcaneRecipe
{
private ItemStack output = null;
private ArrayList input = new ArrayList();
public AspectList aspects = null;
public String research;
private ItemStack output = null;
private ArrayList input = new ArrayList();
public AspectList aspects = null;
public String research;
public ShapelessArcaneRecipe(String research, Block result, AspectList aspects, Object... recipe){ this(research,new ItemStack(result),aspects, recipe); }
public ShapelessArcaneRecipe(String research, Item result, AspectList aspects, Object... recipe){ this(research,new ItemStack(result),aspects, recipe); }
public ShapelessArcaneRecipe(String research, Block result, AspectList aspects, Object... recipe){ this(research,new ItemStack(result),aspects, recipe); }
public ShapelessArcaneRecipe(String research, Item result, AspectList aspects, Object... recipe){ this(research,new ItemStack(result),aspects, recipe); }
public ShapelessArcaneRecipe(String research, ItemStack result, AspectList aspects, Object... recipe)
{
output = result.copy();
this.research = research;
this.aspects = aspects;
for (Object in : recipe)
{
if (in instanceof ItemStack)
{
input.add(((ItemStack)in).copy());
}
else if (in instanceof Item)
{
input.add(new ItemStack((Item)in));
}
else if (in instanceof Block)
{
input.add(new ItemStack((Block)in));
}
else if (in instanceof String)
{
input.add(OreDictionary.getOres((String)in));
}
else
{
String ret = "Invalid shapeless ore recipe: ";
for (Object tmp : recipe)
{
ret += tmp + ", ";
}
ret += output;
throw new RuntimeException(ret);
}
}
}
public ShapelessArcaneRecipe(String research, ItemStack result, AspectList aspects, Object... recipe)
{
output = result.copy();
this.research = research;
this.aspects = aspects;
for (Object in : recipe)
{
if (in instanceof ItemStack)
{
input.add(((ItemStack)in).copy());
}
else if (in instanceof Item)
{
input.add(new ItemStack((Item)in));
}
else if (in instanceof Block)
{
input.add(new ItemStack((Block)in));
}
else if (in instanceof String)
{
input.add(OreDictionary.getOres((String)in));
}
else
{
String ret = "Invalid shapeless ore recipe: ";
for (Object tmp : recipe)
{
ret += tmp + ", ";
}
ret += output;
throw new RuntimeException(ret);
}
}
}
@Override
public int getRecipeSize(){ return input.size(); }
@Override
public int getRecipeSize(){ return input.size(); }
@Override
public ItemStack getRecipeOutput(){ return output; }
@Override
public ItemStack getRecipeOutput(){ return output; }
@Override
public ItemStack getCraftingResult(IInventory var1){ return output.copy(); }
@Override
public ItemStack getCraftingResult(IInventory var1){ return output.copy(); }
@Override
public boolean matches(IInventory var1, World world, EntityPlayer player)
{
if (research.length()>0 && !ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), research)) {
return false;
}
ArrayList required = new ArrayList(input);
for (int x = 0; x < 9; x++)
{
ItemStack slot = var1.getStackInSlot(x);
@Override
public boolean matches(IInventory var1, World world, EntityPlayer player)
{
if (research.length()>0 && !ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), research)) {
return false;
}
ArrayList required = new ArrayList(input);
for (int x = 0; x < 9; x++)
{
ItemStack slot = var1.getStackInSlot(x);
if (slot != null)
{
boolean inRecipe = false;
Iterator req = required.iterator();
if (slot != null)
{
boolean inRecipe = false;
Iterator req = required.iterator();
while (req.hasNext())
{
boolean match = false;
while (req.hasNext())
{
boolean match = false;
Object next = req.next();
Object next = req.next();
if (next instanceof ItemStack)
{
match = checkItemEquals((ItemStack)next, slot);
}
else if (next instanceof ArrayList)
{
for (ItemStack item : (ArrayList<ItemStack>)next)
{
match = match || checkItemEquals(item, slot);
}
}
if (next instanceof ItemStack)
{
match = checkItemEquals((ItemStack)next, slot);
}
else if (next instanceof ArrayList)
{
for (ItemStack item : (ArrayList<ItemStack>)next)
{
match = match || checkItemEquals(item, slot);
}
}
if (match)
{
inRecipe = true;
required.remove(next);
break;
}
}
if (match)
{
inRecipe = true;
required.remove(next);
break;
}
}
if (!inRecipe)
{
return false;
}
}
}
return required.isEmpty();
}
if (!inRecipe)
{
return false;
}
}
}
return required.isEmpty();
}
private boolean checkItemEquals(ItemStack target, ItemStack input)
{
return (target.getItem() == input.getItem() &&
(!target.hasTagCompound() || ItemStack.areItemStackTagsEqual(target, input)) &&
(target.getItemDamage() == OreDictionary.WILDCARD_VALUE || target.getItemDamage() == input.getItemDamage()));
}
private boolean checkItemEquals(ItemStack target, ItemStack input)
{
return (target.getItem() == input.getItem() &&
(!target.hasTagCompound() || ItemStack.areItemStackTagsEqual(target, input)) &&
(target.getItemDamage() == OreDictionary.WILDCARD_VALUE || target.getItemDamage() == input.getItemDamage()));
}
/**
* Returns the input for this recipe, any mod accessing this value should never
* manipulate the values in this array as it will effect the recipe itself.
* @return The recipes input vales.
*/
public ArrayList getInput()
{
return this.input;
}
@Override
/**
* Returns the input for this recipe, any mod accessing this value should never
* manipulate the values in this array as it will effect the recipe itself.
* @return The recipes input vales.
*/
public ArrayList getInput()
{
return this.input;
}
@Override
public AspectList getAspects() {
return aspects;
}
@Override
@Override
public AspectList getAspects(IInventory inv) {
return aspects;
}
@@ -19,16 +19,16 @@ public class DamageSourceIndirectThaumcraftEntity extends EntityDamageSourceIndi
@Override
public DamageSource setFireDamage()
{
this.fireDamage = true;
return this;
}
{
this.fireDamage = true;
return this;
}
@Override
public DamageSource setDamageBypassesArmor()
{
this.isUnblockable = true;
this.hungerDamage = 0.0F;
return this;
}
{
this.isUnblockable = true;
this.hungerDamage = 0.0F;
return this;
}
}
@@ -6,41 +6,41 @@ import net.minecraft.util.EntityDamageSource;
public class DamageSourceThaumcraft extends DamageSource
{
public static DamageSource taint = new DamageSourceThaumcraft("taint").setDamageBypassesArmor().setMagicDamage();
public static DamageSource tentacle = new DamageSourceThaumcraft("tentacle");
public static DamageSource swarm = new DamageSourceThaumcraft("swarm");
protected DamageSourceThaumcraft(String par1Str) {
protected DamageSourceThaumcraft(String par1Str) {
super(par1Str);
}
/** This kind of damage can be blocked or not. */
private boolean isUnblockable = false;
private boolean isDamageAllowedInCreativeMode = false;
private float hungerDamage = 0.3F;
private boolean isUnblockable = false;
private boolean isDamageAllowedInCreativeMode = false;
private float hungerDamage = 0.3F;
/** This kind of damage is based on fire or not. */
private boolean fireDamage;
/** This kind of damage is based on fire or not. */
private boolean fireDamage;
/** This kind of damage is based on a projectile or not. */
private boolean projectile;
/** This kind of damage is based on a projectile or not. */
private boolean projectile;
/**
* Whether this damage source will have its damage amount scaled based on the current difficulty.
*/
private boolean difficultyScaled;
private boolean magicDamage = false;
private boolean explosion = false;
public static DamageSource causeSwarmDamage(EntityLivingBase par0EntityLiving)
{
return new EntityDamageSource("swarm", par0EntityLiving);
}
/**
* Whether this damage source will have its damage amount scaled based on the current difficulty.
*/
private boolean difficultyScaled;
private boolean magicDamage = false;
private boolean explosion = false;
public static DamageSource causeSwarmDamage(EntityLivingBase par0EntityLiving)
{
return new EntityDamageSource("swarm", par0EntityLiving);
}
public static DamageSource causeTentacleDamage(EntityLivingBase par0EntityLiving)
{
return new EntityDamageSource("tentacle", par0EntityLiving);
}
public static DamageSource causeTentacleDamage(EntityLivingBase par0EntityLiving)
{
return new EntityDamageSource("tentacle", par0EntityLiving);
}
}
@@ -2,5 +2,5 @@ package thaumcraft.api.nodes;
public enum NodeModifier
{
BRIGHT, PALE, FADING
BRIGHT, PALE, FADING
}
@@ -2,5 +2,5 @@ package thaumcraft.api.nodes;
public enum NodeType
{
NORMAL, UNSTABLE, DARK, TAINTED, HUNGRY, PURE
NORMAL, UNSTABLE, DARK, TAINTED, HUNGRY, PURE
}
@@ -12,22 +12,22 @@ import cpw.mods.fml.relauncher.SideOnly;
public class PotionFluxTaint extends Potion
{
public static PotionFluxTaint instance = null; // will be instantiated at runtime
private int statusIconIndex = -1;
public PotionFluxTaint(int par1, boolean par2, int par3)
{
super(par1,par2,par3);
setIconIndex(0, 0);
}
public static void init()
{
instance.setPotionName("potion.fluxtaint");
instance.setIconIndex(3, 1);
instance.setEffectiveness(0.25D);
}
public static PotionFluxTaint instance = null; // will be instantiated at runtime
private int statusIconIndex = -1;
public PotionFluxTaint(int par1, boolean par2, int par3)
{
super(par1,par2,par3);
setIconIndex(0, 0);
}
public static void init()
{
instance.setPotionName("potion.fluxtaint");
instance.setIconIndex(3, 1);
instance.setEffectiveness(0.25D);
}
@Override
public boolean isBadEffect() {
return true;
@@ -48,21 +48,21 @@ public class PotionFluxTaint extends Potion
target.heal(1);
} else
if (!target.isEntityUndead() && !(target instanceof EntityPlayer))
{
{
target.attackEntityFrom(DamageSourceThaumcraft.taint, 1);
}
}
else
if (!target.isEntityUndead() && (target.getMaxHealth() > 1 || (target instanceof EntityPlayer)))
{
{
target.attackEntityFrom(DamageSourceThaumcraft.taint, 1);
}
}
}
@Override
public boolean isReady(int par1, int par2)
{
{
int k = 40 >> par2;
return k > 0 ? par1 % k == 0 : true;
}
return k > 0 ? par1 % k == 0 : true;
}
}
Loaded 100 of 105 files, more files were not shown because too many files have changed in this diff. Show more