This commit is contained in:
modmuss50 2015-06-14 19:11:42 +01:00
commit 4ea5c0f8b0
5 changed files with 27 additions and 222 deletions

View file

@ -97,7 +97,7 @@ public class BlockGrinder extends BlockMachineBase{
return metadata == 0 && side == 3 ? this.iconFront return metadata == 0 && side == 3 ? this.iconFront
: side == 1 ? this.iconTop : : side == 1 ? this.iconTop :
side == 0 ? this.iconBottom: (side == 0 ? this.iconTop side == 0 ? this.iconBottom: (side == 0 ? this.iconTop
: (side == metadata ? this.iconFront : this.iconFront)); : (side == metadata ? this.iconFront : this.blockIcon));
} }

View file

@ -24,7 +24,6 @@ import techreborn.items.ItemRods;
import techreborn.items.ItemUUmatter; import techreborn.items.ItemUUmatter;
import techreborn.items.ItemLapotronicOrb; import techreborn.items.ItemLapotronicOrb;
import techreborn.items.ItemUpgrade; import techreborn.items.ItemUpgrade;
import techreborn.items.armor.ItemGravityChest;
import techreborn.items.armor.ItemLapotronPack; import techreborn.items.armor.ItemLapotronPack;
import techreborn.items.armor.ItemLithiumBatpack; import techreborn.items.armor.ItemLithiumBatpack;
import techreborn.items.tools.ItemAdvancedDrill; import techreborn.items.tools.ItemAdvancedDrill;
@ -50,7 +49,6 @@ public class ModItems {
public static Item rockCutter; public static Item rockCutter;
public static Item lithiumBatpack; public static Item lithiumBatpack;
public static Item lapotronpack; public static Item lapotronpack;
public static Item gravityChest;
public static Item omniTool; public static Item omniTool;
public static Item advancedDrill; public static Item advancedDrill;
public static Item lapotronicOrb; public static Item lapotronicOrb;
@ -129,8 +127,6 @@ public class ModItems {
GameRegistry.registerItem(omniTool, "omniTool"); GameRegistry.registerItem(omniTool, "omniTool");
advancedDrill = new ItemAdvancedDrill(); advancedDrill = new ItemAdvancedDrill();
GameRegistry.registerItem(advancedDrill, "advancedDrill"); GameRegistry.registerItem(advancedDrill, "advancedDrill");
gravityChest = new ItemGravityChest(ArmorMaterial.DIAMOND, 7, 1);
GameRegistry.registerItem(gravityChest, "gravitychestplate");
manuel = new ItemTechPda(); manuel = new ItemTechPda();
GameRegistry.registerItem(manuel, "techmanuel"); GameRegistry.registerItem(manuel, "techmanuel");
uuMatter = new ItemUUmatter(); uuMatter = new ItemUUmatter();

View file

@ -32,7 +32,6 @@ public class ModRecipes {
addShaplessRecipes(); addShaplessRecipes();
addShappedRecipes(); addShappedRecipes();
addSmeltingRecipes(); addSmeltingRecipes();
addMachineRecipes();
addAlloySmelterRecipes(); addAlloySmelterRecipes();
addLatheRecipes(); addLatheRecipes();
addPlateCuttingMachineRecipes(); addPlateCuttingMachineRecipes();
@ -144,33 +143,9 @@ public class ModRecipes {
LogHelper.info("Smelting Recipes Added"); LogHelper.info("Smelting Recipes Added");
} }
public static void addMachineRecipes() {
TechRebornAPI.addRollingMachinceRecipe(new ItemStack(Blocks.furnace, 4), "ccc", "c c", "ccc", 'c', Blocks.cobblestone);
TechRebornAPI.registerBlastFurnaceRecipe(new BlastFurnaceRecipe(new ItemStack(Items.apple), new ItemStack(Items.ender_pearl), new ItemStack(Items.golden_apple), new ItemStack(Items.diamond), 120, 1000));
RecipeHandler.addRecipe(new ImplosionCompressorRecipe(new ItemStack(Blocks.netherrack, 4), new ItemStack(Blocks.diamond_block, 1), new ItemStack(ModItems.bucketTritium), null, 120, 5));
RecipeHandler.addRecipe(new AssemblingMachineRecipe(new ItemStack(Items.coal), new ItemStack(Blocks.sand), new ItemStack(Items.diamond), 120, 5));
RecipeHandler.addRecipe(new LatheRecipe(new ItemStack(Items.coal), new ItemStack(Items.diamond), 120, 5));
RecipeHandler.addRecipe(new PlateCuttingMachineRecipe(new ItemStack(Items.coal), new ItemStack(Items.diamond), 120, 5));
//TODO
RecipeHandler.addRecipe(new ChemicalReactorRecipe(new ItemStack(Items.coal), new ItemStack(Blocks.sand), new ItemStack(Items.diamond), 120, 5));
RecipeHandler.addRecipe(new GrinderRecipe(new ItemStack(ModBlocks.ore, 1, 1), null, new FluidStack(ModFluids.fluidMercury, 500), IC2Items.getItem("iridiumOre"), new ItemStack(ModItems.smallDusts, 6, 39), new ItemStack(ModItems.dusts, 6, 58), null, 400, 5));
RecipeHandler.addRecipe(new GrinderRecipe(new ItemStack(ModBlocks.ore, 1, 1), new ItemStack(ModItems.cells, 1, 16), null, IC2Items.getItem("iridiumOre"), new ItemStack(ModItems.smallDusts, 6, 39), new ItemStack(ModItems.dusts, 6, 58), IC2Items.getItem("cell"), 400, 5));
RecipeHandler.addRecipe(new CentrifugeRecipe(new ItemStack(Items.coal), null, new ItemStack(Items.diamond), new ItemStack(Items.emerald), new ItemStack(Items.apple), new ItemStack(Items.arrow), 1, 10));
LogHelper.info("Machine Recipes Added");
}
public static void addHammerRecipes(){ public static void addHammerRecipes(){
ItemStack hammerIron = new ItemStack(ModItems.hammerIron, 1, OreDictionary.WILDCARD_VALUE); ItemStack hammerIron = new ItemStack(ModItems.hammerIron, 1, OreDictionary.WILDCARD_VALUE);
ItemStack hammerDiamond = new ItemStack(ModItems.hammerDiamond, 1, OreDictionary.WILDCARD_VALUE); ItemStack hammerDiamond = new ItemStack(ModItems.hammerDiamond, 1, OreDictionary.WILDCARD_VALUE);
// :( I cant do this
// List<ItemStack> anyhammer = Arrays.asList(hammerIron, hammerDiamond);
GameRegistry.addShapelessRecipe(new ItemStack(ModItems.plate, 1, 13), hammerIron, new ItemStack(Items.iron_ingot)); GameRegistry.addShapelessRecipe(new ItemStack(ModItems.plate, 1, 13), hammerIron, new ItemStack(Items.iron_ingot));

View file

@ -1,165 +0,0 @@
package techreborn.items.armor;
import ic2.api.item.ElectricItem;
import ic2.api.item.IElectricItem;
import java.util.List;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemStack;
import net.minecraft.util.DamageSource;
import net.minecraft.world.World;
import net.minecraftforge.common.ISpecialArmor;
import techreborn.client.TechRebornCreativeTab;
import techreborn.config.ConfigTechReborn;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class ItemGravityChest extends ItemArmor implements IElectricItem,
ISpecialArmor {
public static int maxCharge = ConfigTechReborn.GravityCharge;
public int tier = 3;
public int cost = 100;
public double transferLimit = 1000;
public int energyPerDamage = 100;
public ItemGravityChest(ArmorMaterial material, int par3, int par4){
super(material, par3, par4);
setCreativeTab(TechRebornCreativeTab.instance);
setUnlocalizedName("techreborn.gravitychestplate");
setMaxStackSize(1);
setMaxDamage(120);
}
@SideOnly(Side.CLIENT)
@Override
public void registerIcons(IIconRegister iconRegister){
this.itemIcon = iconRegister.registerIcon("techreborn:" + "items/gravitychestplate");
}
@Override
@SideOnly(Side.CLIENT)
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type){
return "techreborn:" + "textures/models/gravitychestplate.png";
}
@SuppressWarnings(
{ "rawtypes", "unchecked" })
@SideOnly(Side.CLIENT)
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList){
ItemStack itemStack = new ItemStack(this, 1);
if (getChargedItem(itemStack) == this){
ItemStack charged = new ItemStack(this, 1);
ElectricItem.manager.charge(charged, 2147483647, 2147483647, true,
false);
itemList.add(charged);
}
if (getEmptyItem(itemStack) == this){
itemList.add(new ItemStack(this, 1, getMaxDamage()));
}
}
@Override
public void onArmorTick(World world, EntityPlayer player, ItemStack stack){
if (world.isRemote)
;
if (ElectricItem.manager.canUse(stack, cost)){
player.capabilities.allowFlying = true;
if (player.fallDistance > 0.0F)
player.fallDistance = 0;
if (player.capabilities.allowFlying == true & !player.onGround)
ElectricItem.manager.discharge(stack, cost, tier, false, true,
false);
if (!ElectricItem.manager.canUse(stack, cost))
player.capabilities.allowFlying = false;
}
if (player.fallDistance > 0.0F)
player.fallDistance = 0;
}
@Override
public boolean canProvideEnergy(ItemStack itemStack){
return true;
}
@Override
public Item getChargedItem(ItemStack itemStack){
return this;
}
@Override
public Item getEmptyItem(ItemStack itemStack){
return this;
}
@Override
public double getMaxCharge(ItemStack itemStack){
return maxCharge;
}
@Override
public int getTier(ItemStack itemStack){
return tier;
}
@Override
public double getTransferLimit(ItemStack itemStack){
return transferLimit;
}
public int getEnergyPerDamage(){
return energyPerDamage;
}
@Override
public ArmorProperties getProperties(EntityLivingBase player, ItemStack armor, DamageSource source, double damage, int slot){
if (source.isUnblockable()){
return new net.minecraftforge.common.ISpecialArmor.ArmorProperties(
0, 0.0D, 3);
} else {
double absorptionRatio = getBaseAbsorptionRatio()
* getDamageAbsorptionRatio();
int energyPerDamage = getEnergyPerDamage();
double damageLimit = energyPerDamage <= 0 ? 0
: (25 * ElectricItem.manager.getCharge(armor))
/ energyPerDamage;
return new net.minecraftforge.common.ISpecialArmor.ArmorProperties(
3, absorptionRatio, (int) damageLimit);
}
}
@Override
public int getArmorDisplay(EntityPlayer player, ItemStack armor, int slot){
if (ElectricItem.manager.getCharge(armor) >= getEnergyPerDamage()){
return (int) Math.round(20D * getBaseAbsorptionRatio()
* getDamageAbsorptionRatio());
} else{
return 0;
}
}
@Override
public void damageArmor(EntityLivingBase entity, ItemStack stack, DamageSource source, int damage, int slot){
ElectricItem.manager.discharge(stack, damage * getEnergyPerDamage(), 0x7fffffff, true, false, false);
}
public double getDamageAbsorptionRatio(){
return 1.1000000000000001D;
}
private double getBaseAbsorptionRatio(){
return 0.14999999999999999D;
}
}

View file

@ -78,46 +78,45 @@ public class TROreGen implements IWorldGenerator {
} }
void generateUndergroundOres(Random random, int xChunk, int zChunk, void generateUndergroundOres(Random random, int xChunk, int zChunk, World world)
World world)
{ {
int xPos, yPos, zPos; int xPos, yPos, zPos;
if (config.GalenaOreTrue){ if (config.GalenaOreTrue){
for (int i = 0; i <= 16; i++){ for (int i = 0; i <= 16; i++){
xPos = xChunk + random.nextInt(16); xPos = xChunk + random.nextInt(16);
yPos = 60 + random.nextInt(60 - 20); yPos = 10 + random.nextInt(60 - 10);
zPos = zChunk + random.nextInt(16); zPos = zChunk + random.nextInt(16);
oreGalena.generate(world, random, xPos, yPos, zPos); oreGalena.generate(world, random, xPos, yPos, zPos);
} }
} }
if (config.IridiumOreTrue){ if (config.IridiumOreTrue){
for (int i = 0; i <= 16; i++){ for (int i = 0; i <= 1; i++){
xPos = xChunk + random.nextInt(16); xPos = xChunk + random.nextInt(16);
yPos = 60 + random.nextInt(60 - 20); yPos = 10 + random.nextInt(60 - 10);
zPos = zChunk + random.nextInt(16); zPos = zChunk + random.nextInt(1);
oreIridium.generate(world, random, xPos, yPos, zPos); oreIridium.generate(world, random, xPos, yPos, zPos);
} }
} }
if (config.RubyOreTrue){ if (config.RubyOreTrue){
for (int i = 0; i <= 16; i++){ for (int i = 0; i <= 3; i++){
xPos = xChunk + random.nextInt(16); xPos = xChunk + random.nextInt(16);
yPos = 60 + random.nextInt(60 - 20); yPos = 10 + random.nextInt(60 - 10);
zPos = zChunk + random.nextInt(16); zPos = zChunk + random.nextInt(16);
oreRuby.generate(world, random, xPos, yPos, zPos); oreRuby.generate(world, random, xPos, yPos, zPos);
} }
} }
if (config.SapphireOreTrue){ if (config.SapphireOreTrue){
for (int i = 0; i <= 16; i++){ for (int i = 0; i <= 3; i++){
xPos = xChunk + random.nextInt(16); xPos = xChunk + random.nextInt(16);
yPos = 60 + random.nextInt(60 - 20); yPos = 10 + random.nextInt(60 - 10);
zPos = zChunk + random.nextInt(16); zPos = zChunk + random.nextInt(16);
oreSapphire.generate(world, random, xPos, yPos, zPos); oreSapphire.generate(world, random, xPos, yPos, zPos);
} }
} }
if (config.BauxiteOreTrue){ if (config.BauxiteOreTrue){
for (int i = 0; i <= 16; i++){ for (int i = 0; i <= 10; i++){
xPos = xChunk + random.nextInt(16); xPos = xChunk + random.nextInt(16);
yPos = 60 + random.nextInt(60 - 20); yPos = 10 + random.nextInt(60 - 10);
zPos = zChunk + random.nextInt(16); zPos = zChunk + random.nextInt(16);
oreBauxite.generate(world, random, xPos, yPos, zPos); oreBauxite.generate(world, random, xPos, yPos, zPos);
} }
@ -125,7 +124,7 @@ public class TROreGen implements IWorldGenerator {
if (config.TetrahedriteOreTrue){ if (config.TetrahedriteOreTrue){
for (int i = 0; i <= 16; i++){ for (int i = 0; i <= 16; i++){
xPos = xChunk + random.nextInt(16); xPos = xChunk + random.nextInt(16);
yPos = 60 + random.nextInt(60 - 20); yPos = 10 + random.nextInt(60 - 10);
zPos = zChunk + random.nextInt(16); zPos = zChunk + random.nextInt(16);
oreTetrahedrite.generate(world, random, xPos, yPos, zPos); oreTetrahedrite.generate(world, random, xPos, yPos, zPos);
} }
@ -133,7 +132,7 @@ public class TROreGen implements IWorldGenerator {
if (config.CassiteriteOreTrue){ if (config.CassiteriteOreTrue){
for (int i = 0; i <= 16; i++){ for (int i = 0; i <= 16; i++){
xPos = xChunk + random.nextInt(16); xPos = xChunk + random.nextInt(16);
yPos = 60 + random.nextInt(60 - 20); yPos = 10 + random.nextInt(60 - 20);
zPos = zChunk + random.nextInt(16); zPos = zChunk + random.nextInt(16);
oreCassiterite.generate(world, random, xPos, yPos, zPos); oreCassiterite.generate(world, random, xPos, yPos, zPos);
} }
@ -141,7 +140,7 @@ public class TROreGen implements IWorldGenerator {
if (config.LeadOreTrue){ if (config.LeadOreTrue){
for (int i = 0; i <= 16; i++){ for (int i = 0; i <= 16; i++){
xPos = xChunk + random.nextInt(16); xPos = xChunk + random.nextInt(16);
yPos = 60 + random.nextInt(60 - 20); yPos = 10 + random.nextInt(60 - 20);
zPos = zChunk + random.nextInt(16); zPos = zChunk + random.nextInt(16);
oreLead.generate(world, random, xPos, yPos, zPos); oreLead.generate(world, random, xPos, yPos, zPos);
} }
@ -149,7 +148,7 @@ public class TROreGen implements IWorldGenerator {
if (config.SilverOreTrue){ if (config.SilverOreTrue){
for (int i = 0; i <= 16; i++){ for (int i = 0; i <= 16; i++){
xPos = xChunk + random.nextInt(16); xPos = xChunk + random.nextInt(16);
yPos = 60 + random.nextInt(60 - 20); yPos = 10 + random.nextInt(60 - 20);
zPos = zChunk + random.nextInt(16); zPos = zChunk + random.nextInt(16);
oreSilver.generate(world, random, xPos, yPos, zPos); oreSilver.generate(world, random, xPos, yPos, zPos);
} }
@ -161,7 +160,7 @@ public class TROreGen implements IWorldGenerator {
if (config.PyriteOreTrue){ if (config.PyriteOreTrue){
for (int i = 0; i <= 16; i++){ for (int i = 0; i <= 16; i++){
xPos = xChunk + random.nextInt(16); xPos = xChunk + random.nextInt(16);
yPos = 60 + random.nextInt(60 - 20); yPos = 10 + random.nextInt(60 - 10);
zPos = zChunk + random.nextInt(16); zPos = zChunk + random.nextInt(16);
orePyrite.generate(world, random, xPos, yPos, zPos); orePyrite.generate(world, random, xPos, yPos, zPos);
} }
@ -169,7 +168,7 @@ public class TROreGen implements IWorldGenerator {
if (config.CinnabarOreTrue){ if (config.CinnabarOreTrue){
for (int i = 0; i <= 16; i++){ for (int i = 0; i <= 16; i++){
xPos = xChunk + random.nextInt(16); xPos = xChunk + random.nextInt(16);
yPos = 60 + random.nextInt(60 - 20); yPos = 10 + random.nextInt(60 - 10);
zPos = zChunk + random.nextInt(16); zPos = zChunk + random.nextInt(16);
oreCinnabar.generate(world, random, xPos, yPos, zPos); oreCinnabar.generate(world, random, xPos, yPos, zPos);
} }
@ -177,7 +176,7 @@ public class TROreGen implements IWorldGenerator {
if (config.SphaleriteOreTrue){ if (config.SphaleriteOreTrue){
for (int i = 0; i <= 16; i++){ for (int i = 0; i <= 16; i++){
xPos = xChunk + random.nextInt(16); xPos = xChunk + random.nextInt(16);
yPos = 60 + random.nextInt(60 - 20); yPos = 10 + random.nextInt(60 - 10);
zPos = zChunk + random.nextInt(16); zPos = zChunk + random.nextInt(16);
oreSphalerite.generate(world, random, xPos, yPos, zPos); oreSphalerite.generate(world, random, xPos, yPos, zPos);
} }
@ -187,33 +186,33 @@ public class TROreGen implements IWorldGenerator {
void generateEndOres(Random random, int xChunk, int zChunk, World world){ void generateEndOres(Random random, int xChunk, int zChunk, World world){
int xPos, yPos, zPos; int xPos, yPos, zPos;
if (config.TungstenOreTrue){ if (config.TungstenOreTrue){
for (int i = 0; i <= 16; i++){ for (int i = 0; i <= 2; i++){
xPos = xChunk + random.nextInt(16); xPos = xChunk + random.nextInt(16);
yPos = 60 + random.nextInt(60 - 20); yPos = 10 + random.nextInt(60 - 10);
zPos = zChunk + random.nextInt(16); zPos = zChunk + random.nextInt(16);
oreTungston.generate(world, random, xPos, yPos, zPos); oreTungston.generate(world, random, xPos, yPos, zPos);
} }
} }
if (config.SheldoniteOreTrue){ if (config.SheldoniteOreTrue){
for (int i = 0; i <= 16; i++){ for (int i = 0; i <= 3; i++){
xPos = xChunk + random.nextInt(16); xPos = xChunk + random.nextInt(16);
yPos = 60 + random.nextInt(60 - 20); yPos = 10 + random.nextInt(60 - 10);
zPos = zChunk + random.nextInt(16); zPos = zChunk + random.nextInt(16);
oreSheldonite.generate(world, random, xPos, yPos, zPos); oreSheldonite.generate(world, random, xPos, yPos, zPos);
} }
} }
if (config.PeridotOreTrue){ if (config.PeridotOreTrue){
for (int i = 0; i <= 16; i++){ for (int i = 0; i <= 3; i++){
xPos = xChunk + random.nextInt(16); xPos = xChunk + random.nextInt(16);
yPos = 60 + random.nextInt(60 - 20); yPos = 10 + random.nextInt(60 - 10);
zPos = zChunk + random.nextInt(16); zPos = zChunk + random.nextInt(16);
orePeridot.generate(world, random, xPos, yPos, zPos); orePeridot.generate(world, random, xPos, yPos, zPos);
} }
} }
if (config.SodaliteOreTrue){ if (config.SodaliteOreTrue){
for (int i = 0; i <= 16; i++){ for (int i = 0; i <= 3; i++){
xPos = xChunk + random.nextInt(16); xPos = xChunk + random.nextInt(16);
yPos = 60 + random.nextInt(60 - 20); yPos = 10 + random.nextInt(60 - 10);
zPos = zChunk + random.nextInt(16); zPos = zChunk + random.nextInt(16);
oreSodalite.generate(world, random, xPos, yPos, zPos); oreSodalite.generate(world, random, xPos, yPos, zPos);
} }