• 0

    posted a message on Using player isSprinting() with a ridable entity
    Quote from Lil Avii

    Yes yes "Use ModLoader now herpderp" I get that part, believe me, hence why I explicitly stated on the first line that I wasn't using ModLoader. I was asking if anyone had any non-ModLoader solutions. And, no, everything is not 100 times harder without ModLoader. I've gotten plenty far with little hassle, and most of the hassle I have had up until now I would have had even if I was using ModLoader. Jeez.

    Jamol, I've tried to use isSprinting() but that doesn't seem to register when the player is riding an entity :3. Sneak does, however. Huh.

    For any non-Modloader peeps out there that may have a solution, my current bit of riding code:

    public void moveEntity(double d, double d1, double d2)
    	{
    		if(riddenByEntity != null)
    		{
    		 if(riddenByEntity.isSprinting()){
    		 System.out.println("We're Sprinting!"); //Actually.... it is not reaching this so there is obviously a problem with "isSprinting()"
    		   motionX += riddenByEntity.motionX*10;
    		   motionZ += riddenByEntity.motionZ*10;
    		 }
    		 else {
    		 motionX += riddenByEntity.motionX*5;
    		   motionZ += riddenByEntity.motionZ*5;
    		 }
    			if(isCollidedHorizontally)
    			{
    				isJumping = true;
    			}
    			super.moveEntity(motionX, motionY, motionZ);
    		}
    		else super.moveEntity(d, d1, d2);
    	}


    Elsewise I think I might try key-binding. |D


    If the player can already control the horse's movement, why not just make a custom copy of isSprinting() inside the horse file that's activated by the player in the same way as normal but used exclusively by the horse to increase its speed?
    Posted in: Modification Development
  • 0

    posted a message on Slingshot almost done, HELP!
    Quote from Nervana14

    Hi, I am back. I finally managed to make it work, now I just need to know where do I change the damage value of the stonepiece when thrown by the slingshot, and still having problem with the render file...I dont know if I need it, as I just want the item texture itself to show.


    private double damage = 2.0D;


    Change this number -- it gets multiplied based on certain aspects such as velocity and "arrowCritical" during the arrow firing functions.

    Also you will need the Render file because it's not just a plain-old item entity. However, making the Render file point at the proper texture has proven a pain in the ass for me...so I have to wish you luck on that one if no one else can help you there.
    Posted in: Modification Development
  • 0

    posted a message on Quick Questions from People that already made mod.
    The game recompiles in such a short time that there's no point in not testing it frequently.
    Posted in: Modification Development
  • 0

    posted a message on TheInstitution's Modding Tutorials + FORGE TUTS
    Quote from Miners_Mod

    Can you do something on custom light renders such as a purple torch that cast purple light?


    To do this you have to modify the lighting engine. Have fun with that.
    Posted in: Tutorials
  • 0

    posted a message on A Moderately Interesting Problem For Those of You Out There Who Like That Sort of Thing
    Quote from dakamojo
    As a side note you might consider looking into the pathing logic employed by the skeletons in 1.2.3. They now seek out water blocks in daylight. This logic takes care of both finding the block you are looking for in an area, and calculating a path to it if it is reachable.


    Oh trust me, I already have. 95% of it is still obfuscated so trying to read it feels kind of like looking into the toilet in a public restroom.
    Posted in: Modification Development
  • 0

    posted a message on [32x](1.5+) ~Steelfeathers' Enchanted Pack~ [Updated 3/16]
    Quote from steelfeathers

    I'll have to test it, but thanks. ^^



    I love let's plays-- especially ones that use my pack. :3
    Thanks!



    Do Optifine and forge play nice?



    Yessir. The rule-enforcing has begun. >:]


    *dancedance*


    I haven't tested it recently, mostly because last time I tried to use Optifine it mysteriously made none of my mod textures display, despite the fact that the game knew they were all there. (It would have crashed with errors stating that it couldn't find the texture files otherwise)
    Posted in: Resource Packs
  • 0

    posted a message on [Creating Mods] Minecraft Forge [28/1/12]
    Quote from Methuselah96

    yes as crueltyinc said, the block ids haven't been implemented yet. my guess is that that will come out at the same time as the official api
    and to add to his other comment forge is also recommended if you're making new dimensions, adding arrows, adding redstone type things, adding ladders, adding liquids, and especially adding new tools and armor


    Translation:

    "Forge is recommended if you plan on doing anything at all interesting, want between zero and extremely few base-class edits, and virtually guaranteed compatibility with some of the largest, most popular, and most well-developed mods out there."
    Posted in: Tutorials
  • 0

    posted a message on A Moderately Interesting Problem For Those of You Out There Who Like That Sort of Thing
    Thank you all for pointing out my stupidity with the automatic null assignment. Now I can finally get to the part of this that actually DOES something...
    Posted in: Modification Development
  • 0

    posted a message on Custom flower looks like ore in my inventory... please help
    Quote from Hdana1229

    I wanted to test if this was only a glitch for Flax, so I quickly made this, another naturally generated flower, that has the same problem.


    In the tin ore file where you used ModLoader.addOverride() in place of the "0" for the texture index number, just put a 0 here and move that Override to the same place it is in the Flax file, partly because the inconsistency bothers me, but mostly because the inconsistency could be a problem...

    If that doesn't help post back and we can try the next thing.
    Posted in: Modification Development
  • 2

    posted a message on par1, 2 and 3 etc?
    Quote from Smitfraud

    Yeah, so I'm trying to learn a bit of java, and I've noticed in some of minecraft classes the words "par1", par2" and "par3", sometimes with other words with them. Can someone explain to me what they do?

    I guess they've got something to do with worlds and such. I'm a newbie.


    When you see things like
    World par1World
    , which used to be
    World world
    in MCP56, these define a variable for the constructor that has the "type" of that class, meaning you can do things like
    world.getBlockID(Xcoord, Ycoord, Zcoord)
    This is a method from the "World" class file, thus it's allowing you to use methods from the "world" variable of the type "World".

    The others, such as the aforementioned
    (par1, par2, par3)
    are numbers, or strings, like ints, floats, or doubles that are passed in as arguments to the method when the method is called.

    The example "world.getBlockId(Xcoord, Ycoord, Zcoord)" is supposed to accept X, Y, and Z coordinates in the form of a number and return the ID of the block at that location in the world.

    If you felt the desire to, you could actually change "par1, par2, par3" in your file to "potato, eggMcMuffin, giantFlyingTurtleZombies" or something similar. In normal non-obfuscated code things like this are given actual useful names so that it's easy to determine what they're for.
    Posted in: Modification Development
  • 0

    posted a message on Error involving npc's holding weapons
    Quote from FuryRising

    Where? I don't see it.

    public ItemStack getHeldItem()
    { <----Opening bracket
    return defaultHeldItem;
    }


    Woops...looked at the wrong post earlier...Yeah I still see nothing wrong with your code at all, I even copy/pasted it into my own file to see if it gave me an error and it didn't...

    ...I guess I would just copy anything customized into a completely fresh file, start over, and see if it gives you the same errors.
    Posted in: Modification Development
  • 0

    posted a message on Does "isMovementCeased()" have any function anymore?
    Quote from Lil Avii

    I ask because nothing seems to respond to it anymore. For instance, I have a boolean isFree(), which I know works as it should. Its setters and getters are also working accordingly.

    But when I use-
    public boolean isMovementCeased(){
    	 return !isFree();
    }


    - or any other return statement such as !hasPath(), movement of the entity definitely does not cease. Soooo yeah. I'm guessing I'm a failure or it really is an unused method now.

    If the former, am I missing something critical about that method?

    If the latter, is there a work around? 'Cuz these animals need to stop gallivanting across the countryside.


    You can probably check the monsters current position against the fields for its position in the last tick, I'm fairly sure there's something that allows you to access that information readily.

    ...and a quick check into Entity revealed this near the top:

    	public double prevPosX;
    	public double prevPosY;
    	public double prevPosZ;


    This is how I get the entity's position in something I'm working on at the moment
         int hostPosX = (int) (entityHost.posX);
         int hostPosY = (int) (entityHost.posY);
         int hostPosZ = (int) (entityHost.posZ);
    Posted in: Modification Development
  • 0

    posted a message on Custom flower looks like ore in my inventory... please help
    We need to see the file for tin ore too.
    Posted in: Modification Development
  • 0

    posted a message on A Moderately Interesting Problem For Those of You Out There Who Like That Sort of Thing
    Well after fiddling with this and getting it "nearly" working...

    ...I am now stuck on this.

    	public boolean shouldExecute()
    	{
    	 tick++;
    //		System.out.println("EntityAIAttractedToBlock.shouldExecute() was called");
    	 int hostPosX = (int) (entityHost.posX);
    //	 System.out.println(hostPosX);
    		int hostPosY = (int) (entityHost.posY);
    //		System.out.println(hostPosY);
    		int hostPosZ = (int) (entityHost.posZ);
    //		System.out.println(hostPosZ);
    
    		if(tick == tickDelay)
    		{
    		 tick = 0;
    			for (int posY1 = hostPosY + viewRangeYMin ; posY1 <= hostPosY + viewRangeYMax; posY1++)
    			 for (int posX1 = hostPosX + viewRangeXMin; posX1 <= hostPosX + viewRangeXMax; posX1++)
    			 for (int posZ1 = hostPosZ + viewRangeZMin; posZ1 <= hostPosZ + viewRangeZMax; posZ1++)
    			 {
    			 if (((posY1 <= 256) && (posY1 > 0)))
    			 {
    			 tickObservationTally1++;
    	/*		 System.out.println(posX1);
    			 System.out.println(posY1);
    			 System.out.println(posZ1);
    	*/		 if(tickObservationTally1 == 100)
    			 {
    			 tickObservationTally2++;
    				 System.out.println("next:" + tickObservationTally2);
    				 tickObservationTally1 = 0;
    			 }
    	 blockPosX = posX1;
    	 blockPosY = posY1;
    	 blockPosZ = posZ1;
    			 }
    			 }
    			if(world.getBlockId(blockPosX, blockPosY, blockPosZ) == blockAttractedTo)
    			{
    			 System.out.println("world.getBlockId was actually run, didn't crash, and returned true?!?!?!");
    			 moveRelatedToBlock = true;
    			}
    		}
    		return this.moveRelatedToBlock;
    	}


    world.getBlockId is throwing NullPointerExceptions, I have no freaking clue why. It's supposed to return an int, I'm checking it against an int. It wants X, Y, and X coords, I'm checking it against correct (I verified this repeatedly) X, Y, and Z coords. The only difference between this usage of world.getBlockId and other instances of its use is that I defined world as "private World world;" rather than placing it in the constructor, since the constructor for this method has to be empty...

    ...I have to be missing something stupid here but I can't figure out what :angry:
    Posted in: Modification Development
  • 0

    posted a message on [32x](1.5+) ~Steelfeathers' Enchanted Pack~ [Updated 3/16]
    I miss this texturepack...I've been stuck in eyeso- I mean default for like the last 2 weeks because Forge API and MCPatcher don't play nice atm...and I had to make 16x block textures before I did them all in 32x :(
    Posted in: Resource Packs
  • To post a comment, please .