Jump to content

Gwafu

Members
  • Posts

    36
  • Joined

  • Last visited

Everything posted by Gwafu

  1. //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); }
  2. 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
  3. The idea is to have a block kind of 'flow' through metadatas. When a water block is above the block, it instantaneously turns into meta=7 through onNeighborBlockChanged. When this block reaches meta=7, it will start 'flowing' into blocks (same block) perpendicular to it, slowly increasing its meta from 1 up to 7. I haven't really coded it yet, it's just an idea. I might try using updateTick() (didn't know that information, thanks for the heads up :-))
  4. Is there a function or a way that will be triggered when a block reaches a specific metadata (let's say 7)? UpdateTick() can't be used since it's random update within a chunk (?). Any help is appreciated :>
  5. /@ Chibill: Care to explain how that would work? Or even provide an example I tried to copy the orientCamera method, some stuff in setupCameraTransform, and did a lot of reflection to test if this would work: It didn't.
  6. As far as I know, RenderGameOverlayEvent only deals with hud stuff such as health bars, portal overlay, etc. The other render events deal with the entity model itself not what it is seeing. Either that or I just slip something else.
  7. Unlike the other effects, the nausea potion effect is not controlled on Potion.java. It is controlled in EntityRenderer.java instead (as we've been saying earlier).
  8. Yes, I have thought of using a TickHandler before. The problem is, the screen swaying effect is not as simple as "increase player speed by 2". f2 = this.mc.thePlayer.prevTimeInPortal + (this.mc.thePlayer.timeInPortal - this.mc.thePlayer.prevTimeInPortal) * par1; if (f2 > 0.0F) { byte b0 = 20; if (this.mc.thePlayer.isPotionActive(Potion.confusion)) { b0 = 7; } float f3 = 5.0F / (f2 * f2 + 5.0F) - f2 * 0.04F; f3 *= f3; GL11.glRotatef(((float)this.rendererUpdateCount + par1) * (float)b0, 0.0F, 1.0F, 1.0F); GL11.glScalef(1.0F / f3, 1.0F, 1.0F); GL11.glRotatef(-((float)this.rendererUpdateCount + par1) * (float)b0, 0.0F, 1.0F, 1.0F); } this.orientCamera(par1); (As posted earlier) Either that or I'm not thinking this through. Regarding the switching the effect on and off, it is handled by a custom potion effect (which will give the swaying camera, then a bunch of other vanilla potion effects). Why not just use the vanilla Confusion potion effect? Simply because it'll look ugly (having two potion effects added).
  9. I have the feeling that would be too much for a simple mod. How would I be able to override the class? Thread is still open for anymore answers.
  10. [Long title is long.] As the title says, it is possible to add the nausea effect (the swirly camera screen) without adding the potion effect (the ones on the left of the inventory)? player.timeInPortal += 0.006666667F; if (player.timeInPortal > 1.0F) { player.timeInPortal = 1.0F; } Only adds the purple screen overlay. Thanks in advance! ~s
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.