Merge branch '1.7.10' into 1.8.9

Conflicts:
	build.gradle
	src/main/java/techreborn/blocks/BlockOre.java
	src/main/java/techreborn/items/ItemCells.java
This commit is contained in:
modmuss50 2016-02-16 13:49:25 +00:00
commit 9a585bcfb2
9 changed files with 81 additions and 8 deletions

View file

@ -10,6 +10,12 @@ The current main maintainer is @gigabit101 if you need any help please contact u
@modmuss50 is a past maintainer of the mod(see http://techreborn.ninja/?p=20).
[![Build Status](http://modmuss50.me:8080/buildStatus/icon?job=TechReborn)](http://modmuss50.me:8080/job/TechReborn/)
1.7.10:
[![Build Status](http://modmuss50.me:8080/job/TechReborn-1.7.10/badge/icon)](http://modmuss50.me:8080/job/TechReborn-1.7.10/)
1.8.9:
[![Build Status](http://modmuss50.me:8080/job/TechReborn-1.8.9/badge/icon)](http://modmuss50.me:8080/job/TechReborn-1.8.9/)
REMOVED ALL THE JUNK FROM OTHER VERSION 2.78 ONLY

View file

@ -862,8 +862,8 @@ public class RecipesIC2 implements ICompatModule {
//Chemical Reactor
RecipeHandler.addRecipe(new ChemicalReactorRecipe(ItemDusts.getDustByName("calcite", 1), ItemDusts.getDustByName("phosphorous", 1), new ItemStack(IC2Items.getItem("fertilizer").getItem(), 3), 100, 30));
RecipeHandler.addRecipe(new ChemicalReactorRecipe(ItemDusts.getDustByName("calcite", 1), null, new ItemStack(IC2Items.getItem("fertilizer").getItem(), 1), 100, 30));
RecipeHandler.addRecipe(new ChemicalReactorRecipe(ItemDusts.getDustByName("calcite", 1), ItemDusts.getDustByName("phosphorous", 1), new ItemStack(IC2Items.getItem("fertilizer").getItem(), 3), 100, 30));
RecipeHandler.addRecipe(new ChemicalReactorRecipe(ItemCells.getCellByName("sodiumSulfide", 1), IC2Items.getItem("airCell"), ItemCells.getCellByName("sodiumPersulfate", 2), 2000, 30));
RecipeHandler.addRecipe(new ChemicalReactorRecipe(ItemCells.getCellByName("nitrocarbon", 1), IC2Items.getItem("waterCell"), ItemCells.getCellByName("glyceryl", 2), 580, 30));
RecipeHandler.addRecipe(new ChemicalReactorRecipe(ItemDusts.getDustByName("calcite", 1), ItemDusts.getDustByName("sulfur", 1), new ItemStack(IC2Items.getItem("fertilizer").getItem(), 2), 100, 30));

View file

@ -73,7 +73,7 @@ public class BlockOre extends BaseBlock implements ITexturedBlock {
this.setDefaultState(this.blockState.getBaseState().withProperty(METADATA, 0));
}
@Deprecated
public ArrayList<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune) {

View file

@ -11,7 +11,7 @@ import techreborn.tiles.TileQuantumTank;
public class GuiQuantumTank extends GuiContainer {
private static final ResourceLocation texture = new ResourceLocation(
"techreborn", "textures/gui/ThermalGenerator.png");
"techreborn", "textures/gui/thermal_generator.png");
TileQuantumTank tile;

View file

@ -11,7 +11,7 @@ import techreborn.tiles.TileThermalGenerator;
public class GuiThermalGenerator extends GuiContainer {
private static final ResourceLocation texture = new ResourceLocation(
"techreborn", "textures/gui/ThermalGenerator.png");
"techreborn", "textures/gui/thermal_generator.png");
TileThermalGenerator tile;

View file

@ -96,6 +96,11 @@ public class ModItems {
GameRegistry.registerItem(parts, "part");
cells = new ItemCells();
GameRegistry.registerItem(cells, "cell");
for (int i = 0; i < ItemCells.types.length; i++) {
if(FluidRegistry.getFluid("fluid" + ItemCells.types[i].toLowerCase()) != null){
FluidContainerRegistry.registerFluidContainer(FluidRegistry.getFluid("fluid" + ItemCells.types[i].toLowerCase()), ItemCells.getCellByName(ItemCells.types[i]));
}
}
rockCutter = PoweredItem.createItem(ItemRockCutter.class);
GameRegistry.registerItem(rockCutter, "rockCutter");
lithiumBatpack = PoweredItem.createItem(ItemLithiumBatpack.class);

View file

@ -3,16 +3,20 @@ package techreborn.items;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.IFluidContainerItem;
import reborncore.api.IListInfoProvider;
import techreborn.Core;
import techreborn.client.TechRebornCreativeTab;
import techreborn.init.ModItems;
import techreborn.lib.ModInfo;
import java.util.List;
public class ItemCells extends ItemTextureBase {
public class ItemCells extends ItemTextureBase implements IFluidContainerItem {
public static ItemStack getCellByName(String name, int count) {
return getCellByName(name, count, true);
@ -79,10 +83,68 @@ public class ItemCells extends ItemTextureBase {
// Adds Dusts SubItems To Creative Tab
public void getSubItems(Item item, CreativeTabs creativeTabs, List list) {
for (int meta = 0; meta < types.length; ++meta) {
list.add(new ItemStack(item, 1, meta));
ItemStack stack = new ItemStack(item, 1, meta);
if(FluidRegistry.getFluid("fluid" +types[meta].toLowerCase()) != null){
this.fill(stack, new FluidStack(FluidRegistry.getFluid("fluid" +types[meta].toLowerCase()), getCapacity(stack)), true);
}
list.add(stack);
}
}
@Override
public FluidStack getFluid(ItemStack container) {
return FluidStack.loadFluidStackFromNBT(container.getTagCompound());
}
@Override
public int getCapacity(ItemStack container) {
return 1000;
}
@Override
public int fill(ItemStack container, FluidStack resource, boolean doFill) {
if (container.stackSize != 1) {
return 0;
}
if (resource == null || resource.amount != getCapacity(container)) {
return 0;
}
if(FluidRegistry.getFluid("fluid" +types[container.getItemDamage()].toLowerCase()) == null){
return 0;
}
if (doFill)
{
NBTTagCompound tag = container.getTagCompound();
if (tag == null)
{
tag = new NBTTagCompound();
}
resource.writeToNBT(tag);
container.setTagCompound(tag);
}
return getCapacity(container);
}
@Override
public FluidStack drain(ItemStack container, int maxDrain, boolean doDrain) {
if (maxDrain < getCapacity(container)) {
return null;
}
FluidStack fluidStack = getFluid(container);
if (doDrain && fluidStack != null) {
ItemStack empty = ItemCells.getCellByName("empty");
if(empty != null) {
container.setItemDamage(empty.getItemDamage());
container.setTagCompound(empty.getTagCompound());
}
else {
container.stackSize = 0;
}
}
return fluidStack;
}
@Override
public String getTextureName(int damage) {
return ModInfo.MOD_ID + ":items/cells/" + types[damage] + "Cell";

Binary file not shown.

Before

Width:  |  Height:  |  Size: 587 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 16 KiB