More fluid stuff
This commit is contained in:
parent
1ae5a20517
commit
55656c13a5
6 changed files with 41 additions and 14 deletions
|
@ -54,10 +54,10 @@ public class Core {
|
|||
{
|
||||
// Register ModBlocks
|
||||
ModBlocks.init();
|
||||
// Register ModItems
|
||||
ModItems.init();
|
||||
// Register Fluids
|
||||
ModFluids.init();
|
||||
// Register ModItems
|
||||
ModItems.init();
|
||||
// Recipes
|
||||
ModRecipes.init();
|
||||
//Client only init, needs to be done before parts system
|
||||
|
|
|
@ -8,6 +8,7 @@ import net.minecraft.world.World;
|
|||
import net.minecraftforge.fluids.BlockFluidClassic;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import techreborn.client.TechRebornCreativeTabMisc;
|
||||
import techreborn.init.ModFluids;
|
||||
import techreborn.lib.ModInfo;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
|
|
@ -49,8 +49,5 @@ public class ModFluids {
|
|||
GameRegistry.registerBlock(BlockFluidChlorite, ModInfo.MOD_ID + "_" + BlockFluidChlorite.getUnlocalizedName().substring(5));
|
||||
fluidChlorite.setUnlocalizedName(BlockFluidChlorite.getUnlocalizedName());
|
||||
|
||||
//TODO
|
||||
BucketHandler.INSTANCE.buckets.put(ModFluids.BlockFluidBerylium, ModItems.cells);
|
||||
MinecraftForge.EVENT_BUS.register(BucketHandler.INSTANCE);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,9 +1,13 @@
|
|||
package techreborn.init;
|
||||
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.Item.ToolMaterial;
|
||||
import net.minecraft.item.ItemArmor.ArmorMaterial;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.fluids.FluidContainerRegistry;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import techreborn.items.ItemCells;
|
||||
import techreborn.items.ItemCrushedOre;
|
||||
|
@ -26,6 +30,7 @@ import techreborn.items.tools.ItemFluidbucket;
|
|||
import techreborn.items.tools.ItemOmniTool;
|
||||
import techreborn.items.tools.ItemRockCutter;
|
||||
import techreborn.items.tools.ItemTechPda;
|
||||
import techreborn.util.BucketHandler;
|
||||
import techreborn.util.LogHelper;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
|
@ -51,7 +56,8 @@ public class ModItems {
|
|||
public static Item rods;
|
||||
public static Item crushedOre;
|
||||
public static Item purifiedCrushedOre;
|
||||
public static Item fluidBucket;
|
||||
|
||||
public static Item bucketBerylium;
|
||||
|
||||
public static void init()
|
||||
{
|
||||
|
@ -95,8 +101,16 @@ public class ModItems {
|
|||
GameRegistry.registerItem(manuel, "techmanuel");
|
||||
uuMatter = new ItemUUmatter();
|
||||
GameRegistry.registerItem(uuMatter, "uumatter");
|
||||
fluidBucket = new ItemFluidbucket(ModFluids.BlockFluidBerylium);
|
||||
GameRegistry.registerItem(fluidBucket, "fluidbucket");
|
||||
|
||||
// buckets
|
||||
bucketBerylium = new ItemFluidbucket(ModFluids.BlockFluidBerylium);
|
||||
bucketBerylium.setUnlocalizedName("bucketBerylium").setContainerItem(Items.bucket);
|
||||
GameRegistry.registerItem(bucketBerylium, "bucketBerylium");
|
||||
FluidContainerRegistry.registerFluidContainer(FluidRegistry.getFluidStack("fluidberylium", FluidContainerRegistry.BUCKET_VOLUME), new ItemStack(bucketBerylium), new ItemStack(Items.bucket));
|
||||
BucketHandler.INSTANCE.buckets.put(ModFluids.BlockFluidBerylium, bucketBerylium);
|
||||
|
||||
MinecraftForge.EVENT_BUS.register(BucketHandler.INSTANCE);
|
||||
|
||||
|
||||
LogHelper.info("TechReborns Items Loaded");
|
||||
|
||||
|
|
|
@ -1,23 +1,38 @@
|
|||
package techreborn.items.tools;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import techreborn.client.TechRebornCreativeTabMisc;
|
||||
import techreborn.lib.ModInfo;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemBucket;
|
||||
|
||||
public class ItemFluidbucket extends ItemBucket{
|
||||
private String iconName;
|
||||
|
||||
public ItemFluidbucket(Block block)
|
||||
{
|
||||
super(block);
|
||||
setContainerItem(Items.bucket);
|
||||
setCreativeTab(TechRebornCreativeTabMisc.instance);
|
||||
setUnlocalizedName("techreborn.fluidbucket");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
public Item setUnlocalizedName(String par1Str)
|
||||
{
|
||||
itemIcon = iconRegister.registerIcon(ModInfo.MOD_ID.toLowerCase() + ":"
|
||||
+ getUnlocalizedName());
|
||||
iconName = par1Str;
|
||||
return super.setUnlocalizedName(par1Str);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister par1IconRegister)
|
||||
{
|
||||
this.itemIcon = par1IconRegister.registerIcon("techreborn:" + iconName);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 144 B |
Loading…
Reference in a new issue