Posted January 21, 201411 yr As of now, there's the NBT for fluids. Is it safe to use the NBT? I mean, will the NBT be carried from mod_A tank, through Buildcraft pipes, then to mod_B tank? Or is it better to just create separate Fluids (with separate IDs)? Need some insight on this. Thank you! -saus
January 22, 201411 yr Author //Loop iterates four times. for (int i = 0; i < CellarRegistryUtils.getBoozeMeta(appleCider_booze); ++i) { FluidStack stack = new FluidStack(appleCider_booze.getID(), FluidContainerRegistry.BUCKET_VOLUME); Utils.setMeta(stack, i); FluidContainerRegistry.registerFluidContainer(stack, new ItemStack(appleCider_bucket, 1, i), FluidContainerRegistry.EMPTY_BUCKET); } (Loops four times to register a bucket with four subitems with fluids that contains the nbt (set by Utils.setMeta(param)) Apparently, FluidContainerRegistry doesn't accept NBTs because: Utils.getMeta(FluidContainerRegistry.getFluidForFilledItem(filledC); Will always return 3 no matter what. Util functions (pretty fugly ItemStack displayName ripoff): public static boolean hasMeta(FluidStack fluidstack) { if (fluidstack != null) { return fluidstack.tag == null ? false : (!fluidstack.tag.hasKey("meta") ? false : true); } return false; } public static int getMeta(FluidStack fluidstack) { int ret = 0; if (hasMeta(fluidstack)) { if (fluidstack.tag != null && fluidstack.tag.hasKey("meta")) { ret = fluidstack.tag.getInteger("meta"); } } return ret; } public static void setMeta(FluidStack fluidstack, int value) { if (fluidstack.tag == null) { fluidstack.tag = new NBTTagCompound("tag"); } fluidstack.tag.setInteger("meta", value); }
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.