Merge remote-tracking branch 'origin/master'

Conflicts:
	src/main/java/techreborn/compat/recipes/RecipesIC2.java
This commit is contained in:
Tntrololol 2015-06-07 23:24:13 -05:00
commit 1774848aed
13 changed files with 641 additions and 429 deletions

View file

@ -0,0 +1,75 @@
package techreborn.blocks;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.MathHelper;
import techreborn.init.ModBlocks;
import techreborn.config.ConfigTechReborn;
public class OreDrop
{
public OreDrop(ItemStack drop)
{
this.drop = drop;
this.count = drop.stackSize;
this.baseChance = 100;
}
public OreDrop(ItemStack drop, Integer baseChance)
{
this.drop = drop;
this.count = drop.stackSize;
this.baseChance = baseChance;
}
public ItemStack getDrops(int fortuneLevel, Random random)
{
int count;
if (baseChance == 100) //This always drops. Use vanilla fortune rules.
{
count = calculateFortuneMulti(fortuneLevel, random);
} else if (calculateFortuneSingle(fortuneLevel, random)) //This has a chance to drop. Increase that chance with fortune.
{
count = this.count;
}
else
{
count = 0;
}
return new ItemStack(drop.getItem(), count, drop.getItemDamage());
}
//Refer to http://minecraft.gamepedia.com/Enchanting#Fortune
private int calculateFortuneMulti(int level, Random random)
{
int chanceOfEachBonus = 100 / (level + 2);
int roll = random.nextInt(100);
if (roll <= chanceOfEachBonus * level) //If level = 0, this is always false
{
return (roll / chanceOfEachBonus) + 2;
}
else
{
return 1;
}
}
//Each fortune level increases probability by 50% of base, up to a limit of 100%.
//So, if base is 5% and we have Fortune III, chance is 5% + (3 * 2.5%) = 12.5%
private boolean calculateFortuneSingle(int level, Random random)
{
double modifier = ConfigTechReborn.FortuneSecondaryOreMultiplierPerLevel * level;
double total = baseChance + (baseChance * modifier);
int roll = random.nextInt(100);
return roll <= total;
}
public ItemStack drop;
public Integer baseChance;
public Integer count;
}

View file

@ -0,0 +1,37 @@
package techreborn.blocks;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.MathHelper;
import techreborn.init.ModBlocks;
import techreborn.config.ConfigTechReborn;
import net.minecraft.block.Block;
public class OreDropSet
{
public OreDropSet(OreDrop primary, OreDrop... secondaries)
{
this.primary = primary;
this.secondaries = secondaries;
}
public ArrayList<ItemStack> drop(int fortune, Random random)
{
ArrayList<ItemStack> drops = new ArrayList<ItemStack>();
for (OreDrop drop : secondaries)
{
drops.add(drop.getDrops(fortune, random));
}
drops.add(primary.getDrops(fortune, random));
return drops;
}
public OreDrop primary;
public OreDrop[] secondaries;
}

File diff suppressed because it is too large Load diff

View file

@ -61,6 +61,8 @@ public class ConfigTechReborn {
public static boolean SodaliteOreTrue;
public static int SodaliteOreRare;
public static double FortuneSecondaryOreMultiplierPerLevel;
// Power
public static int ThermalGenertaorOutput;
public static int CentrifugeInputTick;
@ -438,6 +440,15 @@ public class ConfigTechReborn {
.translateToLocal("config.techreborn.silverOre.rare.tooltip"))
.getInt();
FortuneSecondaryOreMultiplierPerLevel = config
.get(CATEGORY_WORLD,
StatCollector
.translateToLocal("config.techreborn.fortuneSecondaryOreMultiplierPerLevel"),
0.5,
StatCollector
.translateToLocal("config.techreborn.fortuneSecondaryOreMultiplierPerLevel.tooltip"))
.getDouble();
// Power
ThermalGenertaorOutput = config
.get(CATEGORY_POWER,

View file

@ -105,14 +105,14 @@ public class TileAlloySmelter extends TileMachineBase implements IWrenchable, IE
super.onChunkUnload();
}
@Override
public void addWailaInfo(List<String> info){
super.addWailaInfo(info);
info.add("Power Stored " + energy.getEnergyStored() + "/" + energy.getCapacity() +" EU");
if(crafter.currentRecipe !=null){
info.add("Power Usage " + crafter.currentRecipe.euPerTick() + " EU/t");
}
}
// @Override
// public void addWailaInfo(List<String> info){
// super.addWailaInfo(info);
// info.add("Power Stored " + energy.getEnergyStored() + "/" + energy.getCapacity() +" EU");
// if(crafter.currentRecipe !=null){
// info.add("Power Usage " + crafter.currentRecipe.euPerTick() + " EU/t");
// }
// }
@Override
public int getSizeInventory() {

View file

@ -115,14 +115,14 @@ public class TileAssemblingMachine extends TileMachineBase implements IWrenchabl
super.onChunkUnload();
}
@Override
public void addWailaInfo(List<String> info)
{
super.addWailaInfo(info);
info.add("Power Stored " + energy.getEnergyStored() +" EU");
if(crafter.currentRecipe !=null){
info.add("Power Usage " + crafter.currentRecipe.euPerTick() + " EU/t");
}
}
// @Override
// public void addWailaInfo(List<String> info)
// {
// super.addWailaInfo(info);
// info.add("Power Stored " + energy.getEnergyStored() +" EU");
// if(crafter.currentRecipe !=null){
// info.add("Power Usage " + crafter.currentRecipe.euPerTick() + " EU/t");
// }
// }
}

View file

@ -127,10 +127,10 @@ public class TileCentrifuge extends TileMachineBase implements IWrenchable, IEn
public void addWailaInfo(List<String> info)
{
super.addWailaInfo(info);
info.add("Power Stored " + energy.getEnergyStored() +" EU");
if(crafter.currentRecipe !=null){
info.add("Power Usage " + crafter.currentRecipe.euPerTick() + " EU/t");
}
// info.add("Power Stored " + energy.getEnergyStored() +" EU");
// if(crafter.currentRecipe !=null){
// info.add("Power Usage " + crafter.currentRecipe.euPerTick() + " EU/t");
// }
info.add("Round and round it goes");
}

View file

@ -115,14 +115,14 @@ public class TileChemicalReactor extends TileMachineBase implements IWrenchable,
super.onChunkUnload();
}
@Override
public void addWailaInfo(List<String> info)
{
super.addWailaInfo(info);
info.add("Power Stored " + energy.getEnergyStored() +" EU");
if(crafter.currentRecipe !=null){
info.add("Power Usage " + crafter.currentRecipe.euPerTick() + " EU/t");
}
}
// @Override
// public void addWailaInfo(List<String> info)
// {
// super.addWailaInfo(info);
// info.add("Power Stored " + energy.getEnergyStored() +" EU");
// if(crafter.currentRecipe !=null){
// info.add("Power Usage " + crafter.currentRecipe.euPerTick() + " EU/t");
// }
// }
}

View file

@ -125,12 +125,12 @@ public class TileHeatGenerator extends TileMachineBase implements IWrenchable, I
energy.writeToNBT(tagCompound);
}
@Override
public void addWailaInfo(List<String> info)
{
super.addWailaInfo(info);
info.add("Power Generarating " + euTick +" EU/t");
}
// @Override
// public void addWailaInfo(List<String> info)
// {
// super.addWailaInfo(info);
// info.add("Power Generarating " + euTick +" EU/t");
//
// }
}

View file

@ -96,15 +96,15 @@ public class TileImplosionCompressor extends TileMachineBase implements IWrencha
crafter.writeToNBT(tagCompound);
}
@Override
public void addWailaInfo(List<String> info)
{
super.addWailaInfo(info);
info.add("Power Stored " + energy.getEnergyStored() +" EU");
if(crafter.currentRecipe !=null){
info.add("Power Usage " + crafter.currentRecipe.euPerTick() + " EU/t");
}
}
// @Override
// public void addWailaInfo(List<String> info)
// {
// super.addWailaInfo(info);
// info.add("Power Stored " + energy.getEnergyStored() +" EU");
// if(crafter.currentRecipe !=null){
// info.add("Power Usage " + crafter.currentRecipe.euPerTick() + " EU/t");
// }
// }
@Override
public void invalidate()

View file

@ -114,14 +114,14 @@ public class TileLathe extends TileMachineBase implements IWrenchable, IEnergyTi
super.onChunkUnload();
}
@Override
public void addWailaInfo(List<String> info)
{
super.addWailaInfo(info);
info.add("Power Stored " + energy.getEnergyStored() +" EU");
if(crafter.currentRecipe !=null){
info.add("Power Usage " + crafter.currentRecipe.euPerTick() + " EU/t");
}
}
// @Override
// public void addWailaInfo(List<String> info)
// {
// super.addWailaInfo(info);
// info.add("Power Stored " + energy.getEnergyStored() +" EU");
// if(crafter.currentRecipe !=null){
// info.add("Power Usage " + crafter.currentRecipe.euPerTick() + " EU/t");
// }
// }
}

View file

@ -101,15 +101,15 @@ public class TilePlateCuttingMachine extends TileMachineBase implements IWrencha
crafter.writeToNBT(tagCompound);
}
@Override
public void addWailaInfo(List<String> info)
{
super.addWailaInfo(info);
info.add("Power Stored " + energy.getEnergyStored() +" EU");
if(crafter.currentRecipe !=null){
info.add("Power Usage " + crafter.currentRecipe.euPerTick() + " EU/t");
}
}
// @Override
// public void addWailaInfo(List<String> info)
// {
// super.addWailaInfo(info);
// info.add("Power Stored " + energy.getEnergyStored() +" EU");
// if(crafter.currentRecipe !=null){
// info.add("Power Usage " + crafter.currentRecipe.euPerTick() + " EU/t");
// }
// }
@Override
public void invalidate()

View file

@ -710,6 +710,9 @@ config.techreborn.allow.olivineOre.tooltip=Decide whether Olivine Ore spawns or
config.techreborn.allow.sodaliteOre=Allow Sodalite Ore
config.techreborn.allow.sodaliteOre.tooltip=Decide whether Sodalite Ore spawns or not
config.techreborn.fortuneSecondaryOreMultiplierPerLevel=Fortune's Effect on Secondaries
config.techreborn.fortuneSecondaryOreMultiplierPerLevel.tooltip=How much of an increase should each level of fortune have on secondary ore drops?
config.techreborn.allowExpensiveMacerator=Allow Expensive Macerator
config.techreborn.allowExpensiveMacerator.tooltip=
config.techreborn.allowExpensiveDrill=Allow Expensive Drill