• 0

    posted a message on setBlockWithNotify isn't working
    Quote from Muserae

    No clue what that means, so no where XD
    I'm assuming I put something in mod_whatever to create it?


    They meant "What is this code actually being used in?"

    Assuming this is a Block file:

    You most likely want to put this function into
    	public void updateTick(World world, int x, int y, int z, Random random) {}



    Also a random tip -- if something isn't working, feel obliged to spam System.out.println()'s all over it to check what parts of it are actually being used, if any. I would still be stuck on the first half of the method I'm trying to write if it weren't for those... ;)
    Posted in: Modification Development
  • 0

    posted a message on New plant isn't placable?
    Quote from iguana72

    ... I feel so stupid. I should have realized that. Thanks, though

    But there's still the problem of it looking like a black and white version of the grass. Any ideas why that doesn't work?


            Item.itemsList[blockVineNether.blockID] = new ItemColored(blockVineNether.blockID - 256, false);


    In Block.java there are a few lines like this for miscellaneous other plants, it has something to do with how the game auto-creates block textures.
    Posted in: Modification Development
  • 0

    posted a message on No more empty terrain sprite indices left! error
    Quote from Julienlego

    So should I wait for Jeb to update the code or just use Forge API?


    Just use Forge API. In the long run it's worth it.
    I currently have 80-90 files and not a single one is a base class edit.

    Also here's a thread for a few beginning Forge tutorials:
    http://www.minecraft...ft-forge-28112/
    Posted in: Modification Development
  • 0

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

    Bump, come on someone, please help, without help for this simple problem, I'll end up giving up on modding, this is the only problem in my code, everything else i've made works just fine, and once someone helps me with this problem, i'll eventually release a major npc mod, based around medieval/revolutionary times.


    I see now. You're missing an opening bracket in ItemStack getHeldItem()
    Posted in: Modification Development
  • 0

    posted a message on Railcraft 9.2.2.0
    Bookmarking this for later...

    Minecarts were one of the things I first saw in Minecraft that drove me to want to try it out in the first place, and I always have loved them.
    Posted in: Minecraft Mods
  • 0

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

    Sorry to talk about this again but I got another problem with your flower tutorial. You were right, we have to change GenerateSurface to generateSurface, but the flower is replacing the block when spawned (and not on top of it). I think it's because we use the worldgenminable. It would be very nice if you help me and sorry again.


    If it really does use WorldGenMinable then that's the exact cause. Use WorldGenFlowers, it's there for a reason.
    Posted in: Tutorials
  • 0

    posted a message on Need help with crash error [SOLVED]
    Quote from mattyp153

    OK I think everything is fixed but I'm not sure how and to save starting a new topic I'm going to ask my last question in this one.

    In my mod there is a new type of glass with the same texture as regular glass (different color) but when you break it it makes a breaking stone sound how do I make it a breaking glass sound?


    When you initialize the block you can use
    .setStepSound(Block.soundGlassFootstep)
    Posted in: Modification Development
  • 0

    posted a message on Increasing Velocity of EntityThrowable Items
    From EntityPotion:

        protected float func_40075_e()
        {
            return 0.05F;
        }
    
        protected float func_40077_c()
        {
            return 0.5F;
        }
    
        protected float func_40074_d()
        {
            return -20.0F;


    This is what EntityPotion uses to make splash potions have such a small travel distance, notice the -20.0F there. I've had to use these parameters for a few things and figured you'd want some sort of example.
    Posted in: Modification Development
  • 0

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

    Gotta Be Honest! This Helped me out alot. But some of the tuts dont actually seem to work for me "personally". The reason for this is i seem to get an warnings in some of my ".class" files when i decompile it into eclipse i dont seem to be doing anything wrong! But for instance in the tuts on how to make a NPC, it dosent work because it wont let me do the "public void addRenderer(Map map)" <------ Or somin like that! Because apparently (This is what error/warning i get (It underlines it in yellow)) "map is a raw type. References to generic type Map<K,V> should be parameterized" and i get a warning (underlined in yellow) on this "map.put(EntityRedCow.class, new RenderRedCow(new ModelRedCow(), 0.5F));" because apparently "is references to Map which is a raw type" Again!!!! Why does it do this? Anyone know? Rather annoying after i have done some pretty cool **** but it wont work because it comes up with stupid warnings like this which stop the mod from working!!!!!!


    Also i have lots of my ".class and .java" fuels working but there are loads of files with the warning sign on, is this whats meant to happen or should they all work? IF they should how can i get them to work they seem to always be like this and i dont do anything wrong when i decompile and open in ecliipse!!!!


    Warnings aren't the same as errors. In the majority of cases a warning should only mean you're doing something that isn't necessarily "recommended." You'll encounter that same warning in several places within the game. Errors, however, are actual compiler errors that Eclipse is forewarning you of that need to be fixed for the code to compile.
    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 Plecks

    Unless I'm misunderstanding what you want to do, you should be able to do this with a couple loops:
    for (int y = yToCheckMin ; y <= yToCheckMax; y++)
    	for (int x = xToCheckMin; x <= xToCheckMax; x++)
    		for (int z = zToCheckMin; z <= zToCheckMin; z++)
    			if (!((y >= 256)
    				|| (y < 0))
    				&& world.getBlockId(x,y,z) == blockID)
    				  {
    					   //Found a block we want, do something/add to list/whatever
    				  }

    If its a large area, you wouldn't want to run this too often as it can add up to a lot of blocks (ie a chunk is 16x16x256, which is over 65000 blocks), or just run it on a smaller area.


    I had a feeling for loops would come into play. Thanks for this -- time to go fiddle with it.
    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
    Quote from Julienlego

    I don't know a thing about how the AI code works, but just hear me out. I believe what you want is a mob that checks all the non-air blocks within a certain area in order to identify certain blocks and react based on their location and/or properties. To do that, what I'd do is have a method go through an array of all non-air blocks within that location and identify certain types of blocks by comparing their blockID number. You'd want this process to occur when the mob is updating itself. You might actually want to code the mob so that after it moves it looks for a type of block within the chunk the entity is located in (IDK if that's possible though).

    fyi, since entities can search out for other entities, the same can be said for blocks, even if it's not actually in the code. I had to improvise and use a TileEntity when I wanted a block to check for the presence of another block of the same type.


    I understand basically all of this and you've pretty much restated exactly what I want to do, with the exception that I want to convert the passed in coordinate arguments into an AxisAlignedBB bounding box so that World.getDensity can be used to cull the non-real (air) blocks from the search. Once someone can help me figure out how to actually preform the search through all of the coordinates it needs to I can most likely write the entire rest of this file with all of the navigation and updating code by myself.

    Eventually when I can get this entire file written and working I'll probably release it publicly, seeing as being able to tell a mob to look for any block of your choosing with one single line of code and no extra work is not only useful, but full of potential. If I can get this working it opens up possibilities like having a monster move towards, and stay in the vicinity of, a torch block when it gets close enough.
    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
    Quote from Julienlego

    I'd use a TileEntity instead of an entity. He could use the World.getTileEntity method and use an instanceof operator to look for that specific TileEntity.


    Except that I already stated very clearly in my reply to him exactly why this isn't the solution.
    Posted in: Modification Development
  • 1

    posted a message on no more empty terrain sprite indices left?
    If you watch the command line output from ModLoader when starting the game, it always shows this huge list of texture overrides and states how many sprite slots remain. If you ever see it state that there are 0 remaining this means you're out of sprite slots. There are various ways to resolve this, the best of which, most painful, and most worthwhile, is to get Forge API and port your mod to it so that you can use your own custom spritesheets as well as the huge variety of useful, albeit sometimes confusing, hooks it provides.
    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
    Quote from Pheenixm

    If its your own block, a creative solution would be to spawn an entity inside it with size 0,0 and then use the mob AI to seek out that entity. Also, i saw a thread on mob AI like this abiut a week ago. Have you tried Google?


    The point isn't to look for my own block, it's to be able to tell any mob a person desires to either be attracted to or repelled by any block they specify. I don't need help with the EntityAI itself, I need help from someone who understands how to deal with searching through numerous coordinates non-static coordinates within a given area around a specified location. I know there are methods that allows entities to seek out other entities, but I haven't seen any equivalents for blocks, and even when I look through the entity methods in a vain attempt to get even the slightest clue how to do this, they don't have to search on this scale, and they're all still obfuscated beyond hope of recognition.
    Posted in: Modification Development
  • 0

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

    I've been working on a vikings mod lately, it uses modloader. Here is where my problem is, I put Arrows pointing at the lines I get errors on

    public ItemStack getHeldItem()		  <
    	{
    		return defaultHeldItem;
    	}					  <
    
    	static
    	{
    		defaultHeldItem = new ItemStack(Item.axeSteel, 1);
    	}					  <
    }


    The last 2 errors are the brackets, the first one is pointed out at the I in ItemStack, all 3 errors say "class, interface, or enum expected."

    Any help would be greatly appreciated, this problem is no doubt simple to solve, I'm just not used to coding npc's that hold weapons.


    Try moving the static{} portion to the top of the file and define it like a normal variable like so
    	private static final ItemStack defaultHeldItem = new ItemStack(Item.bow, 1);


    Other mobs have it defined with that line at the top of their files, and it's the only thing I can think of seeing as it's the only thing in your code differing from the norm.
    Posted in: Modification Development
  • To post a comment, please .