Rewrote fluids

Now uses json files
Now uses forge bucket
Now not broken, closes #557
This commit is contained in:
modmuss50 2016-05-17 18:36:51 +01:00
parent c20c6d4722
commit 7e2db4a715
11 changed files with 178 additions and 305 deletions

View file

@ -2,6 +2,7 @@ package techreborn;
import net.minecraft.block.BlockDispenser;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fml.client.event.ConfigChangedEvent;
import net.minecraftforge.fml.common.FMLCommonHandler;
import net.minecraftforge.fml.common.Mod;
@ -47,6 +48,12 @@ import java.io.File;
@Mod(modid = ModInfo.MOD_ID, name = ModInfo.MOD_NAME, version = ModInfo.MOD_VERSION, dependencies = ModInfo.MOD_DEPENDENCIES, guiFactory = ModInfo.GUI_FACTORY_CLASS, acceptedMinecraftVersions = "[1.9]")
public class Core
{
public Core() {
//Forge says to call it here, so yeah
FluidRegistry.enableUniversalBucket();
}
public static ConfigTechReborn config;
@SidedProxy(clientSide = ModInfo.CLIENT_PROXY_CLASS, serverSide = ModInfo.SERVER_PROXY_CLASS)

View file

@ -15,7 +15,6 @@ public class BlockFluidBase extends BlockFluidClassic
public BlockFluidBase(Fluid fluid, Material material)
{
super(fluid, material);
RebornCore.jsonDestroyer.registerObject(this);
}
@Override

View file

@ -3,6 +3,8 @@ package techreborn.blocks.fluid;
import me.modmuss50.jsonDestroyer.api.ITexturedFluid;
import net.minecraft.block.material.Material;
import net.minecraftforge.fluids.Fluid;
import reborncore.RebornCore;
import techreborn.Core;
public class BlockFluidTechReborn extends BlockFluidBase implements ITexturedFluid
{
@ -14,6 +16,7 @@ public class BlockFluidTechReborn extends BlockFluidBase implements ITexturedFlu
super(fluid, material);
setUnlocalizedName(name);
this.name = name;
Core.proxy.registerFluidBlockRendering(this, name);
}
}

View file

@ -2,7 +2,9 @@ package techreborn.blocks.fluid;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidRegistry;
import reborncore.common.util.Color;
import techreborn.Core;
public class TechRebornFluid extends Fluid
{
@ -11,5 +13,6 @@ public class TechRebornFluid extends Fluid
super(fluidName,
new ResourceLocation("techreborn:blocks/fluids/" + fluidName.replaceFirst("fluid", "") + "_flowing"),
new ResourceLocation("techreborn:blocks/fluids/" + fluidName.replaceFirst("fluid", "") + "_flowing"));
FluidRegistry.addBucketForFluid(this);
}
}

View file

@ -56,29 +56,6 @@ public class ModItems
public static Item purifiedCrushedOre;
public static Item cloakingDevice;
public static Item bucketBerylium;
public static Item bucketcalcium;
public static Item bucketcalciumcarbonate;
public static Item bucketChlorite;
public static Item bucketDeuterium;
public static Item bucketGlyceryl;
public static Item bucketHelium;
public static Item bucketHelium3;
public static Item bucketHeliumplasma;
public static Item bucketHydrogen;
public static Item bucketLithium;
public static Item bucketMercury;
public static Item bucketMethane;
public static Item bucketNitrocoalfuel;
public static Item bucketNitrofuel;
public static Item bucketNitrogen;
public static Item bucketNitrogendioxide;
public static Item bucketPotassium;
public static Item bucketSilicon;
public static Item bucketSodium;
public static Item bucketSodiumpersulfate;
public static Item bucketTritium;
public static Item bucketWolframium;
public static Item reBattery;
public static Item treeTap;
public static Item ironDrill;
@ -329,194 +306,6 @@ public class ModItems
cloakingDevice = PoweredItem.createItem(ItemCloakingDevice.class);
GameRegistry.registerItem(cloakingDevice, "cloakingdevice");
// 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.getFluid(), bucketBerylium);
bucketcalcium = new ItemFluidbucket(ModFluids.BlockFluidCalcium);
bucketcalcium.setUnlocalizedName("bucketcalcium").setContainerItem(Items.BUCKET);
GameRegistry.registerItem(bucketcalcium, "bucketcalcium");
FluidContainerRegistry.registerFluidContainer(
FluidRegistry.getFluidStack("fluidcalcium", FluidContainerRegistry.BUCKET_VOLUME),
new ItemStack(bucketcalcium), new ItemStack(Items.BUCKET));
BucketHandler.INSTANCE.buckets.put(ModFluids.BlockFluidCalcium.getFluid(), bucketcalcium);
bucketcalciumcarbonate = new ItemFluidbucket(ModFluids.BlockFluidCalciumCarbonate);
bucketcalciumcarbonate.setUnlocalizedName("bucketcalciumcarbonate").setContainerItem(Items.BUCKET);
GameRegistry.registerItem(bucketcalciumcarbonate, "bucketcalciumcarbonate");
FluidContainerRegistry.registerFluidContainer(
FluidRegistry.getFluidStack("fluidcalciumcarbonate", FluidContainerRegistry.BUCKET_VOLUME),
new ItemStack(bucketcalciumcarbonate), new ItemStack(Items.BUCKET));
BucketHandler.INSTANCE.buckets.put(ModFluids.BlockFluidCalciumCarbonate.getFluid(),
bucketcalciumcarbonate);
bucketChlorite = new ItemFluidbucket(ModFluids.BlockFluidChlorite);
bucketChlorite.setUnlocalizedName("bucketchlorite").setContainerItem(Items.BUCKET);
GameRegistry.registerItem(bucketChlorite, "bucketcalchlorite");
FluidContainerRegistry.registerFluidContainer(
FluidRegistry.getFluidStack("fluidchlorite", FluidContainerRegistry.BUCKET_VOLUME),
new ItemStack(bucketcalciumcarbonate), new ItemStack(Items.BUCKET));
BucketHandler.INSTANCE.buckets.put(ModFluids.BlockFluidChlorite.getFluid(), bucketChlorite);
bucketDeuterium = new ItemFluidbucket(ModFluids.BlockFluidDeuterium);
bucketDeuterium.setUnlocalizedName("bucketdeuterium").setContainerItem(Items.BUCKET);
GameRegistry.registerItem(bucketDeuterium, "bucketdeuterium");
FluidContainerRegistry.registerFluidContainer(
FluidRegistry.getFluidStack("fluiddeuterium", FluidContainerRegistry.BUCKET_VOLUME),
new ItemStack(bucketDeuterium), new ItemStack(Items.BUCKET));
BucketHandler.INSTANCE.buckets.put(ModFluids.BlockFluidDeuterium.getFluid(), bucketDeuterium);
bucketGlyceryl = new ItemFluidbucket(ModFluids.BlockFluidGlyceryl);
bucketGlyceryl.setUnlocalizedName("bucketglyceryl").setContainerItem(Items.BUCKET);
GameRegistry.registerItem(bucketGlyceryl, "bucketglyceryl");
FluidContainerRegistry.registerFluidContainer(
FluidRegistry.getFluidStack("fluidglyceryl", FluidContainerRegistry.BUCKET_VOLUME),
new ItemStack(bucketGlyceryl), new ItemStack(Items.BUCKET));
BucketHandler.INSTANCE.buckets.put(ModFluids.BlockFluidGlyceryl.getFluid(), bucketGlyceryl);
bucketHelium = new ItemFluidbucket(ModFluids.BlockFluidHelium);
bucketHelium.setUnlocalizedName("buckethelium").setContainerItem(Items.BUCKET);
GameRegistry.registerItem(bucketHelium, "buckethelium");
FluidContainerRegistry.registerFluidContainer(
FluidRegistry.getFluidStack("fluidhelium", FluidContainerRegistry.BUCKET_VOLUME),
new ItemStack(bucketHelium), new ItemStack(Items.BUCKET));
BucketHandler.INSTANCE.buckets.put(ModFluids.BlockFluidHelium.getFluid(), bucketHelium);
bucketHelium3 = new ItemFluidbucket(ModFluids.BlockFluidHelium3);
bucketHelium3.setUnlocalizedName("buckethelium3").setContainerItem(Items.BUCKET);
GameRegistry.registerItem(bucketHelium3, "buckethelium3");
FluidContainerRegistry.registerFluidContainer(
FluidRegistry.getFluidStack("fluidhelium3", FluidContainerRegistry.BUCKET_VOLUME),
new ItemStack(bucketHelium3), new ItemStack(Items.BUCKET));
BucketHandler.INSTANCE.buckets.put(ModFluids.BlockFluidHelium3.getFluid(), bucketHelium3);
bucketHeliumplasma = new ItemFluidbucket(ModFluids.BlockFluidHeliumplasma);
bucketHeliumplasma.setUnlocalizedName("bucketheliumplasma").setContainerItem(Items.BUCKET);
GameRegistry.registerItem(bucketHeliumplasma, "bucketheliumplasma");
FluidContainerRegistry.registerFluidContainer(
FluidRegistry.getFluidStack("fluidheliumplasma", FluidContainerRegistry.BUCKET_VOLUME),
new ItemStack(bucketHeliumplasma), new ItemStack(Items.BUCKET));
BucketHandler.INSTANCE.buckets.put(ModFluids.BlockFluidHeliumplasma.getFluid(), bucketHeliumplasma);
bucketHydrogen = new ItemFluidbucket(ModFluids.BlockFluidHydrogen);
bucketHydrogen.setUnlocalizedName("buckethydrogen").setContainerItem(Items.BUCKET);
GameRegistry.registerItem(bucketHydrogen, "buckethydrogen");
FluidContainerRegistry.registerFluidContainer(
FluidRegistry.getFluidStack("fluidhydrogen", FluidContainerRegistry.BUCKET_VOLUME),
new ItemStack(bucketHydrogen), new ItemStack(Items.BUCKET));
BucketHandler.INSTANCE.buckets.put(ModFluids.BlockFluidHydrogen.getFluid(), bucketHydrogen);
bucketLithium = new ItemFluidbucket(ModFluids.BlockFluidLithium);
bucketLithium.setUnlocalizedName("bucketlithium").setContainerItem(Items.BUCKET);
GameRegistry.registerItem(bucketLithium, "bucketlithium");
FluidContainerRegistry.registerFluidContainer(
FluidRegistry.getFluidStack("fluidlithium", FluidContainerRegistry.BUCKET_VOLUME),
new ItemStack(bucketLithium), new ItemStack(Items.BUCKET));
BucketHandler.INSTANCE.buckets.put(ModFluids.BlockFluidLithium.getFluid(), bucketLithium);
bucketMercury = new ItemFluidbucket(ModFluids.BlockFluidMercury);
bucketMercury.setUnlocalizedName("bucketmercury").setContainerItem(Items.BUCKET);
GameRegistry.registerItem(bucketMercury, "bucketmercury");
FluidContainerRegistry.registerFluidContainer(
FluidRegistry.getFluidStack("fluidmercury", FluidContainerRegistry.BUCKET_VOLUME),
new ItemStack(bucketMercury), new ItemStack(Items.BUCKET));
BucketHandler.INSTANCE.buckets.put(ModFluids.BlockFluidMercury.getFluid(), bucketMercury);
bucketMethane = new ItemFluidbucket(ModFluids.BlockFluidMethane);
bucketMethane.setUnlocalizedName("bucketmethane").setContainerItem(Items.BUCKET);
GameRegistry.registerItem(bucketMethane, "bucketmethane");
FluidContainerRegistry.registerFluidContainer(
FluidRegistry.getFluidStack("fluidmethane", FluidContainerRegistry.BUCKET_VOLUME),
new ItemStack(bucketMethane), new ItemStack(Items.BUCKET));
BucketHandler.INSTANCE.buckets.put(ModFluids.BlockFluidMethane.getFluid(), bucketMethane);
bucketNitrocoalfuel = new ItemFluidbucket(ModFluids.BlockFluidNitrocoalfuel);
bucketNitrocoalfuel.setUnlocalizedName("bucketnitrocoalfuel").setContainerItem(Items.BUCKET);
GameRegistry.registerItem(bucketNitrocoalfuel, "bucketnitrocoalfuel");
FluidContainerRegistry.registerFluidContainer(
FluidRegistry.getFluidStack("fluidnitrocoalfuel", FluidContainerRegistry.BUCKET_VOLUME),
new ItemStack(bucketNitrocoalfuel), new ItemStack(Items.BUCKET));
BucketHandler.INSTANCE.buckets.put(ModFluids.BlockFluidNitrocoalfuel.getFluid(), bucketNitrocoalfuel);
bucketNitrofuel = new ItemFluidbucket(ModFluids.BlockFluidNitrofuel);
bucketNitrofuel.setUnlocalizedName("bucketnitrofuel").setContainerItem(Items.BUCKET);
GameRegistry.registerItem(bucketNitrofuel, "bucketnitrofuel");
FluidContainerRegistry.registerFluidContainer(
FluidRegistry.getFluidStack("fluidnitrofuel", FluidContainerRegistry.BUCKET_VOLUME),
new ItemStack(bucketNitrofuel), new ItemStack(Items.BUCKET));
BucketHandler.INSTANCE.buckets.put(ModFluids.BlockFluidNitrofuel.getFluid(), bucketNitrofuel);
bucketNitrogen = new ItemFluidbucket(ModFluids.BlockFluidNitrogen);
bucketNitrogen.setUnlocalizedName("bucketnitrogen").setContainerItem(Items.BUCKET);
GameRegistry.registerItem(bucketNitrogen, "bucketnitrogen");
FluidContainerRegistry.registerFluidContainer(
FluidRegistry.getFluidStack("fluidnitrogen", FluidContainerRegistry.BUCKET_VOLUME),
new ItemStack(bucketNitrogen), new ItemStack(Items.BUCKET));
BucketHandler.INSTANCE.buckets.put(ModFluids.BlockFluidNitrogen.getFluid(), bucketNitrogen);
bucketNitrogendioxide = new ItemFluidbucket(ModFluids.BlockFluidNitrogendioxide);
bucketNitrogendioxide.setUnlocalizedName("bucketnitrogendioxide").setContainerItem(Items.BUCKET);
GameRegistry.registerItem(bucketNitrogendioxide, "bucketnitrogendioxide");
FluidContainerRegistry.registerFluidContainer(
FluidRegistry.getFluidStack("fluidnitrogendioxide", FluidContainerRegistry.BUCKET_VOLUME),
new ItemStack(bucketNitrogendioxide), new ItemStack(Items.BUCKET));
BucketHandler.INSTANCE.buckets.put(ModFluids.BlockFluidNitrogendioxide.getFluid(),
bucketNitrogendioxide);
bucketPotassium = new ItemFluidbucket(ModFluids.BlockFluidPotassium);
bucketPotassium.setUnlocalizedName("bucketpotassium").setContainerItem(Items.BUCKET);
GameRegistry.registerItem(bucketPotassium, "bucketpotassium");
FluidContainerRegistry.registerFluidContainer(
FluidRegistry.getFluidStack("fluidpotassium", FluidContainerRegistry.BUCKET_VOLUME),
new ItemStack(bucketPotassium), new ItemStack(Items.BUCKET));
BucketHandler.INSTANCE.buckets.put(ModFluids.BlockFluidPotassium.getFluid(), bucketPotassium);
bucketSilicon = new ItemFluidbucket(ModFluids.BlockFluidSilicon);
bucketSilicon.setUnlocalizedName("bucketsilicon").setContainerItem(Items.BUCKET);
GameRegistry.registerItem(bucketSilicon, "bucketsilicon");
FluidContainerRegistry.registerFluidContainer(
FluidRegistry.getFluidStack("fluidsilicon", FluidContainerRegistry.BUCKET_VOLUME),
new ItemStack(bucketSilicon), new ItemStack(Items.BUCKET));
BucketHandler.INSTANCE.buckets.put(ModFluids.BlockFluidSilicon.getFluid(), bucketSilicon);
bucketSodium = new ItemFluidbucket(ModFluids.BlockFluidSodium);
bucketSodium.setUnlocalizedName("bucketsodium").setContainerItem(Items.BUCKET);
GameRegistry.registerItem(bucketSodium, "bucketsodium");
FluidContainerRegistry.registerFluidContainer(
FluidRegistry.getFluidStack("fluidsodium", FluidContainerRegistry.BUCKET_VOLUME),
new ItemStack(bucketSodium), new ItemStack(Items.BUCKET));
BucketHandler.INSTANCE.buckets.put(ModFluids.BlockFluidSodium.getFluid(), bucketSodium);
bucketSodiumpersulfate = new ItemFluidbucket(ModFluids.BlockFluidSodiumpersulfate);
bucketSodiumpersulfate.setUnlocalizedName("bucketsodiumpersulfate").setContainerItem(Items.BUCKET);
GameRegistry.registerItem(bucketSodiumpersulfate, "bucketsodiumpersulfate");
FluidContainerRegistry.registerFluidContainer(
FluidRegistry.getFluidStack("fluidsodiumpersulfate", FluidContainerRegistry.BUCKET_VOLUME),
new ItemStack(bucketSodiumpersulfate), new ItemStack(Items.BUCKET));
BucketHandler.INSTANCE.buckets.put(ModFluids.BlockFluidSodiumpersulfate.getFluid(),
bucketSodiumpersulfate);
bucketTritium = new ItemFluidbucket(ModFluids.BlockFluidTritium);
bucketTritium.setUnlocalizedName("buckettritium").setContainerItem(Items.BUCKET);
GameRegistry.registerItem(bucketTritium, "buckettritium");
FluidContainerRegistry.registerFluidContainer(
FluidRegistry.getFluidStack("fluidtritium", FluidContainerRegistry.BUCKET_VOLUME),
new ItemStack(bucketTritium), new ItemStack(Items.BUCKET));
BucketHandler.INSTANCE.buckets.put(ModFluids.BlockFluidTritium.getFluid(), bucketTritium);
bucketWolframium = new ItemFluidbucket(ModFluids.BlockFluidWolframium);
bucketWolframium.setUnlocalizedName("bucketwolframium").setContainerItem(Items.BUCKET);
GameRegistry.registerItem(bucketWolframium, "bucketwolframium");
FluidContainerRegistry.registerFluidContainer(
FluidRegistry.getFluidStack("fluidwolframium", FluidContainerRegistry.BUCKET_VOLUME),
new ItemStack(bucketWolframium), new ItemStack(Items.BUCKET));
BucketHandler.INSTANCE.buckets.put(ModFluids.BlockFluidWolframium.getFluid(), bucketWolframium);
missingRecipe = new ItemMissingRecipe().setUnlocalizedName("missingRecipe");
GameRegistry.registerItem(missingRecipe, "mssingRecipe");

View file

@ -5,8 +5,11 @@ import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.ForgeModContainer;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.UniversalBucket;
import net.minecraftforge.fml.common.registry.GameRegistry;
import net.minecraftforge.oredict.OreDictionary;
import org.apache.commons.lang3.ArrayUtils;
@ -1534,7 +1537,7 @@ public class ModRecipes
ItemDusts.getDustByName("gold", 1), ItemDustsSmall.getSmallDustByName("Nickel", 1), null, 100,
120));
RecipeHandler.addRecipe(
new IndustrialGrinderRecipe(oreStack, new ItemStack(ModItems.bucketSodiumpersulfate), null,
new IndustrialGrinderRecipe(oreStack, getBucketWithFluid(ModFluids.fluidSodiumpersulfate), null,
ItemDusts.getDustByName("copper", 2), ItemDusts.getDustByName("gold", 1),
ItemDustsSmall.getSmallDustByName("Nickel", 1), new ItemStack(Items.BUCKET), 100, 120));
@ -1571,7 +1574,7 @@ public class ModRecipes
ItemDustsSmall.getSmallDustByName("Iron", 1), ItemDusts.getDustByName("zinc", 1), null, 100,
120));
RecipeHandler.addRecipe(
new IndustrialGrinderRecipe(oreStack, new ItemStack(ModItems.bucketSodiumpersulfate), null,
new IndustrialGrinderRecipe(oreStack, getBucketWithFluid(ModFluids.fluidSodiumpersulfate), null,
ItemDusts.getDustByName("tin", 2), ItemDustsSmall.getSmallDustByName("Iron", 1),
ItemDusts.getDustByName("zinc", 1), new ItemStack(Items.BUCKET), 100, 120));
} catch (Exception e)
@ -1599,7 +1602,7 @@ public class ModRecipes
ItemDustsSmall.getSmallDustByName("Iron", 1), ItemDustsSmall.getSmallDustByName("Platinum", 1),
null, 100, 120));
RecipeHandler.addRecipe(
new IndustrialGrinderRecipe(oreStack, new ItemStack(ModItems.bucketSodiumpersulfate), null,
new IndustrialGrinderRecipe(oreStack, getBucketWithFluid(ModFluids.fluidSodiumpersulfate), null,
ItemDusts.getDustByName("nickel", 3), ItemDustsSmall.getSmallDustByName("Iron", 1),
ItemDustsSmall.getSmallDustByName("Platinum", 1), new ItemStack(Items.BUCKET), 100,
120));
@ -1609,7 +1612,7 @@ public class ModRecipes
ItemDusts.getDustByName("nickel", 2), ItemDustsSmall.getSmallDustByName("Iron", 1),
ItemDusts.getDustByName("platinum", 1), null, 100, 120));
RecipeHandler.addRecipe(
new IndustrialGrinderRecipe(oreStack, new ItemStack(ModItems.bucketMercury), null,
new IndustrialGrinderRecipe(oreStack, getBucketWithFluid(ModFluids.fluidMercury), null,
ItemDusts.getDustByName("nickel", 2), ItemDustsSmall.getSmallDustByName("Iron", 1),
ItemDusts.getDustByName("platinum", 1), new ItemStack(Items.BUCKET), 100, 120));
} catch (Exception e)
@ -1637,7 +1640,7 @@ public class ModRecipes
ItemDustsSmall.getSmallDustByName("Iron", 1), ItemDusts.getDustByName("iron", 1), null, 100,
120));
RecipeHandler.addRecipe(
new IndustrialGrinderRecipe(oreStack, new ItemStack(ModItems.bucketSodiumpersulfate), null,
new IndustrialGrinderRecipe(oreStack, getBucketWithFluid(ModFluids.fluidSodiumpersulfate), null,
ItemDusts.getDustByName("zinc", 2), ItemDustsSmall.getSmallDustByName("Iron", 1),
ItemDusts.getDustByName("iron", 1), new ItemStack(Items.BUCKET), 100, 120));
} catch (Exception e)
@ -1665,7 +1668,7 @@ public class ModRecipes
ItemDusts.getDustByName("silver", 3), ItemDustsSmall.getSmallDustByName("Lead", 1),
ItemDustsSmall.getSmallDustByName("Sulfur", 1), null, 100, 120));
RecipeHandler.addRecipe(
new IndustrialGrinderRecipe(oreStack, new ItemStack(ModItems.bucketMercury), null,
new IndustrialGrinderRecipe(oreStack, getBucketWithFluid(ModFluids.fluidMercury), null,
ItemDusts.getDustByName("silver", 3), ItemDustsSmall.getSmallDustByName("Lead", 1),
ItemDustsSmall.getSmallDustByName("Sulfur", 1), new ItemStack(Items.BUCKET), 100, 120));
} catch (Exception e)
@ -1693,7 +1696,7 @@ public class ModRecipes
ItemDusts.getDustByName("lead", 2), ItemDusts.getDustByName("silver", 1),
ItemDustsSmall.getSmallDustByName("Sulfur", 1), null, 100, 120));
RecipeHandler.addRecipe(
new IndustrialGrinderRecipe(oreStack, new ItemStack(ModItems.bucketMercury), null,
new IndustrialGrinderRecipe(oreStack, getBucketWithFluid(ModFluids.fluidMercury), null,
ItemDusts.getDustByName("lead", 2), ItemDusts.getDustByName("silver", 1),
ItemDustsSmall.getSmallDustByName("Sulfur", 1), new ItemStack(Items.BUCKET), 100, 120));
} catch (Exception e)
@ -1886,7 +1889,7 @@ public class ModRecipes
new FluidStack(ModFluids.fluidMercury, 1000), ItemDusts.getDustByName("galena", 2),
ItemDustsSmall.getSmallDustByName("Sulfur", 1), ItemDusts.getDustByName("silver", 1), null, 100, 120));
RecipeHandler.addRecipe(
new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 0), new ItemStack(ModItems.bucketMercury),
new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 0), getBucketWithFluid(ModFluids.fluidMercury),
null, ItemDusts.getDustByName("galena", 2), ItemDustsSmall.getSmallDustByName("Sulfur", 1),
ItemDusts.getDustByName("silver", 1), new ItemStack(Items.BUCKET), 100, 120));
@ -1955,7 +1958,7 @@ public class ModRecipes
ItemDusts.getDustByName("zinc", 1), ItemDustsSmall.getSmallDustByName("YellowGarnet", 1), null, 100,
120));
RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 7),
new ItemStack(ModItems.bucketSodiumpersulfate), null, ItemDusts.getDustByName("sphalerite", 2),
getBucketWithFluid(ModFluids.fluidSodiumpersulfate), null, ItemDusts.getDustByName("sphalerite", 2),
ItemDusts.getDustByName("zinc", 1), ItemDustsSmall.getSmallDustByName("YellowGarnet", 1),
new ItemStack(Items.BUCKET), 100, 120));
@ -1974,7 +1977,7 @@ public class ModRecipes
ItemDustsSmall.getSmallDustByName("Manganese", 1), ItemDusts.getDustByName("silver", 2), null, 100,
120));
RecipeHandler.addRecipe(
new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 8), new ItemStack(ModItems.bucketMercury),
new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 8), getBucketWithFluid(ModFluids.fluidMercury),
null, ItemDusts.getDustByName("tungsten", 2), ItemDustsSmall.getSmallDustByName("Manganese", 1),
ItemDusts.getDustByName("silver", 2), new ItemStack(Items.BUCKET), 100, 120));
@ -1991,7 +1994,7 @@ public class ModRecipes
new FluidStack(ModFluids.fluidMercury, 1000), ItemDusts.getDustByName("platinum", 3),
ItemNuggets.getNuggetByName("iridium", 2), ItemDusts.getDustByName("nickel", 1), null, 100, 120));
RecipeHandler.addRecipe(
new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 9), new ItemStack(ModItems.bucketMercury),
new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 9), getBucketWithFluid(ModFluids.fluidMercury),
null, ItemDusts.getDustByName("platinum", 3), ItemNuggets.getNuggetByName("iridium", 2),
ItemDusts.getDustByName("nickel", 1), new ItemStack(Items.BUCKET), 100, 120));
@ -3118,7 +3121,7 @@ public class ModRecipes
ItemDustsSmall.getSmallDustByName("Platinum", 2), null,
ItemCells.getCellByName("empty"), 100, 120));
RecipeHandler.addRecipe(
new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 1), new ItemStack(ModItems.bucketMercury),
new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 1), getBucketWithFluid(ModFluids.fluidMercury),
null, TechRebornAPI.recipeCompact.getItem("iridiumOre"),
ItemDustsSmall.getSmallDustByName("Platinum", 2), null,
new ItemStack(Items.BUCKET), 100, 120));
@ -3386,4 +3389,8 @@ public class ModRecipes
CraftingHelper.addShapedOreRecipe(gemboots, " ", "G G", "G G", 'G', gem);
}
public static ItemStack getBucketWithFluid(Fluid fluid){
return UniversalBucket.getFilledBucket(ForgeModContainer.getInstance().universalBucket, fluid);
}
}

View file

@ -1,57 +0,0 @@
package techreborn.items.tools;
import me.modmuss50.jsonDestroyer.api.ITexturedBucket;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemBucket;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.Fluid;
import reborncore.RebornCore;
import techreborn.blocks.fluid.BlockFluidBase;
import techreborn.client.TechRebornCreativeTabMisc;
public class ItemFluidbucket extends ItemBucket implements ITexturedBucket
{
Fluid containedFluid;
private String iconName;
public ItemFluidbucket(BlockFluidBase block)
{
super(block);
setContainerItem(Items.BUCKET);
setCreativeTab(TechRebornCreativeTabMisc.instance);
setUnlocalizedName("techreborn.fluidbucket");
RebornCore.jsonDestroyer.registerObject(this);
containedFluid = block.getFluid();
}
@Override
public Item setUnlocalizedName(String par1Str)
{
iconName = par1Str;
return super.setUnlocalizedName(par1Str);
}
@Override
public boolean isGas(int damage) {
return false;
}
@Override
public Fluid getFluid(int damage) {
return containedFluid;
}
@Override
public int getMaxMeta()
{
return 1;
}
@Override
public ModelResourceLocation getModel(ItemStack stack, EntityPlayer player, int useRemaining) {
return null;
}
}

View file

@ -1,8 +1,11 @@
package techreborn.proxies;
import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.renderer.ItemMeshDefinition;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.client.renderer.block.statemap.StateMap;
import net.minecraft.client.renderer.block.statemap.StateMapperBase;
import net.minecraft.client.renderer.entity.Render;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.item.Item;
@ -32,6 +35,7 @@ import techreborn.client.render.entitys.RenderNukePrimed;
import techreborn.entitys.EntityNukePrimed;
import techreborn.init.ModBlocks;
import techreborn.init.ModSounds;
import techreborn.lib.ModInfo;
import techreborn.manual.loader.ManualLoader;
import java.io.File;
@ -132,4 +136,19 @@ public class ClientProxy extends CommonProxy
}
}
@Override
public void registerFluidBlockRendering(Block block, String name) {
super.registerFluidBlockRendering(block, name);
final ModelResourceLocation fluidLocation = new ModelResourceLocation(ModInfo.MOD_ID.toLowerCase() + ":fluids", name);
// use a custom state mapper which will ignore the LEVEL property
ModelLoader.setCustomStateMapper(block, new StateMapperBase()
{
@Override
protected ModelResourceLocation getModelResourceLocation(IBlockState state)
{
return fluidLocation;
}
});
}
}

View file

@ -1,5 +1,6 @@
package techreborn.proxies;
import net.minecraft.block.Block;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
@ -32,4 +33,9 @@ public class CommonProxy implements ICompatModule
{
}
public void registerFluidBlockRendering(Block block, String name){
}
}

View file

@ -0,0 +1,97 @@
{
"forge_marker": 1,
"variants": {
"techreborn.berylium": {
"model": "forge:fluid",
"custom": { "fluid": "fluidberylium" }
},
"techreborn.calcium": {
"model": "forge:fluid",
"custom": { "fluid": "fluidcalcium" }
},
"techreborn.calciumcarbonate": {
"model": "forge:fluid",
"custom": { "fluid": "fluidcalciumcarbonate" }
},
"techreborn.chlorite": {
"model": "forge:fluid",
"custom": { "fluid": "fluidchlorite" }
},
"techreborn.deuterium": {
"model": "forge:fluid",
"custom": { "fluid": "fluiddeuterium" }
},
"techreborn.glyceryl": {
"model": "forge:fluid",
"custom": { "fluid": "fluidglyceryl" }
},
"techreborn.helium": {
"model": "forge:fluid",
"custom": { "fluid": "fluidhelium" }
},
"techreborn.helium3": {
"model": "forge:fluid",
"custom": { "fluid": "fluidhelium3" }
},
"techreborn.heliumplasma": {
"model": "forge:fluid",
"custom": { "fluid": "fluidheliumplasma" }
},
"techreborn.hydrogen": {
"model": "forge:fluid",
"custom": { "fluid": "fluidhydrogen" }
},
"techreborn.lithium": {
"model": "forge:fluid",
"custom": { "fluid": "fluidlithium" }
},
"techreborn.mercury": {
"model": "forge:fluid",
"custom": { "fluid": "fluidmercury" }
},
"techreborn.methane": {
"model": "forge:fluid",
"custom": { "fluid": "fluidmethane" }
},
"techreborn.nitrocoalfuel": {
"model": "forge:fluid",
"custom": { "fluid": "fluidnitrocoalfuel" }
},
"techreborn.nitrofuel": {
"model": "forge:fluid",
"custom": { "fluid": "fluidnitrofuel" }
},
"techreborn.nitrogen": {
"model": "forge:fluid",
"custom": { "fluid": "fluidnitrogen" }
},
"techreborn.nitrogendioxide": {
"model": "forge:fluid",
"custom": { "fluid": "fluidnitrogendioxide" }
},
"techreborn.potassium": {
"model": "forge:fluid",
"custom": { "fluid": "fluidpotassium" }
},
"techreborn.silicon": {
"model": "forge:fluid",
"custom": { "fluid": "fluidsilicon" }
},
"techreborn.sodium": {
"model": "forge:fluid",
"custom": { "fluid": "fluidsodium" }
},
"techreborn.sodiumpersulfate": {
"model": "forge:fluid",
"custom": { "fluid": "fluidsodiumpersulfate" }
},
"techreborn.tritium": {
"model": "forge:fluid",
"custom": { "fluid": "fluidtritium" }
},
"techreborn.wolframium": {
"model": "forge:fluid",
"custom": { "fluid": "fluidwolframium" }
}
}
}

View file

@ -683,30 +683,30 @@ item.peridotChestplate.name=Peridot Chestplate
item.peridotLeggings.name=Peridot Leggings
item.peridotBoots.name=Peridot Boots
#Buckets
item.bucketberylium.name=Beryllium Bucket
item.bucketcalcium.name=Calcium Bucket
item.bucketcalciumcarbonate.name=Calciumcarbonate Bucket
item.bucketchlorite.name=Chlorite Bucket
item.bucketdeuterium.name=Deuterium Bucket
item.bucketglyceryl.name=Glyceryl Bucket
item.buckethelium.name=Helium Bucket
item.buckethelium3.name=Helium3 Bucket
item.bucketheliumplasma.name=Heliumplasma Bucket
item.buckethydrogen.name=Hydrogen Bucket
item.bucketlithium.name=Lithium Bucket
item.bucketmercury.name=Mercury Bucket
item.bucketmethane.name=Methane Bucket
item.bucketnitrocoalfuel.name=Nitrocoalfuel Bucket
item.bucketnitrofuel.name=Nitrofuel Bucket
item.bucketnitrogen.name=Nitrogen Bucket
item.bucketnitrogendioxide.name=Nitrogendioxide Bucket
item.bucketpotassium.name=Potassium Bucket
item.bucketsilicon.name=Silicon Bucket
item.bucketsodium.name=Sodium Bucket
item.bucketsodiumpersulfate.name=Sodiumpersulfate Bucket
item.buckettritium.name=Tritium Bucket
item.bucketwolframium.name=Wolframium Bucket
#Fluid
fluid.fluidberylium=Beryllium
fluid.fluidcalcium=Calcium
fluid.fluidcalciumcarbonate=Calciumcarbonate
fluid.fluidchlorite=Chlorite
fluid.fluiddeuterium=Deuterium
fluid.fluidglyceryl=Glyceryl
fluid.fluidhelium=Helium
fluid.fluidhelium3=Helium3
fluid.fluidheliumplasma=Heliumplasma
fluid.fluidhydrogen=Hydrogen
fluid.fluidlithium=Lithium
fluid.fluidmercury=Mercury
fluid.fluidmethane=Methane
fluid.fluidnitrocoalfuel=Nitrocoalfuel
fluid.fluidnitrofuel=Nitrofuel
fluid.fluidnitrogen=Nitrogen
fluid.fluidnitrogendioxide=Nitrogendioxide
fluid.fluidpotassium=Potassium
fluid.fluidsilicon=Silicon
fluid.fluidsodium=Sodium
fluid.fluidsodiumpersulfate=Sodiumpersulfate
fluid.fluidtritium=Tritium
fluid.fluidwolframium=Wolframium
#Items
item.techreborn.uuMatter.name=UU-Matter