Jump to content
Search In
  • More options...
Find results that contain...
Find results in...


  • Posts

  • Joined

  • Last visited

Posts posted by grand_mind1

  1. Ah, of course, I misunderstood you. Thanks! I now see that I may have asked my question incorrectly. The reason I need the libraries is so I can link them to my Intellij workspace so I can actually program using Forge. At the moment, the libraries aren't linked to Intellij like they should be. I at first thought this was because gradle was not downloading the files altogether, however I now see that this is not the case. Have I done something else incorrectly?

  2. First off, I'm very new to Gradle so if I misunderstand how it should work, please forgive and correct me. So, as the title states, when I try to setup my Intellij workspace with

    gradlew setupDecompWorkspace

    it seems to run normal with no errors, however, it doesn't download the Forge or Minecraft libraries that I think should be downloaded.

    I decided to do a little testing and found that on my desktop(windows pc), the command runs perfectly, and all the files are downloaded. However, on my laptop(mac) the files are not downloaded. I'm not sure if this difference in computer is the cause, or if it is something else. The output of the command is this:



    Powered By MCP:           


    Searge, ProfMobius, Fesh0r,

    R4wk, ZeuX, IngisKahn, bspkrs

    MCP Data version : unknown


    :extractMcpData UP-TO-DATE                                                     


    :extractUserDev UP-TO-DATE                                                         

    :genSrgs SKIPPED       

    :extractNatives UP-TO-DATE                                                 




    warning: [options] bootstrap class path not set in conjunction with -source 1.6

    1 warning                 

    :downloadMcpTools UP-TO-DATE     

    :downloadClient SKIPPED       

    :downloadServer SKIPPED       

    :mergeJars SKIPPED       

    :deobfuscateJar SKIPPED       

    :decompile SKIPPED       

    :processSources SKIPPED       

    :remapJar SKIPPED       

    :extractMinecraftSrc SKIPPED       

    :recompMinecraft SKIPPED       

    :repackMinecraft SKIPPED       





    Total time: 19.492 secs



    I can also provide any other needed information, as I wasn't sure exactly what would be necessary.

    All help is appreciated!

    Thanks!  :D

  3. Well, testing with this:

    List entities= world.getEntitiesWithinAABB(EntitySheep.class, myAABB);
    		for(int i = 0; i < 10; i++)

    I was able to produce this: "EntitySheep['Sheep'/19, l='New World', x=29.07, y=4.00, z=-787.93]" Now I think I'm more confused than when I started :) I've either done something wrong to get this or I don't understand at all(probably both... :) ) This is not what I was expecting to get at all. I'm not really sure how I'm going to be able to check for something like this.

  4. Ah, yes. Sorry about that, it's quite late here and I'm forgetting things :). However, after doing some further testing, I'm not really sure what exactly it's putting in the list. I've tried testing using entity.contains() and so far nothing has come up true. Am I looking for the wrong thing?

  5. Ok, here is what I have now:

    public void shearSheep(World world, int x, int y, int z, EntitySheep target)
    	if(target instanceof EntitySheep)
    		ArrayList<ItemStack> stuff = target.onSheared(null, world, (int)target.posX, (int)target.posY, (int)target.posZ, 0);
    public void onNeighborBlockChange(World world, int x, int y, int z, int id)
    	AxisAlignedBB myAABB = AxisAlignedBB.getAABBPool().getAABB(x, y+1, z, x, y+2, z);
    	if(!world.isRemote && world.isBlockIndirectlyGettingPowered(x, y, z))
    		List entity= world.getEntitiesWithinAABB(EntitySheep.class, myAABB);
    		if(entity instanceof EntitySheep)
    			EntitySheep aSheep = (EntitySheep)entity;
    			shearSheep(world, x, y, z, aSheep);

    I have it print "1" and "2" for testing. When I put a sheep above the block and power it, 1 is printed but 2 is not, so the sheep is not sheared. I think this is because world.getEntitiesWithinAABB() returns a list. I did try casting to an EntitySheep before checking but, as predicted, that did not work.

  6. Ok, I think I might understand how AABB works. So what I would have to do is create an AABB above the block and when the block gets powered, check if there is an entity in the AABB that can be sheared and if it can, then shear it? If that is the case, then I still have a problem(I think): world.getEntitiesWithinAABB() returns a list of the entities in the AABB. My shearSheep() method uses EntitySheep as the target and I'm pretty sure the game wouldn't like me trying to cast a list into an EntitySheep.

  7. I'm really sorry, I feel like I'm doing something wrong. I wasn't able to find it in the BlockBasePressurePlate either. However, I looked in the world class again and found getEntitiesWithinAABB. I feel like this might be what you're talking about. If it is, would you mind explaining how this works? I obviously put the class of the entity that I'm searching for within the AABB but I'm not too sure what AABB is(Axis Aligned Bounding Box?).

  8. Sorry, but I'm a bit confused with this. I looked in the BlockPressurePlate class but cannot seem to find any call of world.getEntitiesInAABB. I also can't find any method with this name in the world class. Am I not understanding correctly?

  9. Thanks so much!

    Mind if I ask one more thing? :)

    I'm making a different block that I want to be activated with redstone but the only way I know how to do that is with onNeighborBlockChange which doesn't allow for an entity as a variable(which I need since this block will be interacting with entities)

    Is there any way I can get around this?

  10. Ah, yes. Shearing a sheep is quite different from shearing the definition of a sheep :)

    I tested it out and it works very well. All I need now is to get the items but I already know how to do that.

    My only problem now is that if I(and possibly other mobs) step on the block, the game crashes. I think this is because of me casting the target to the type IShearable. I think I can fix this by just checking to make sure that the entity standing atop the block is a sheep.

    Is there a method that would return the name of a specified entity?

  11. Hmm, ok. If I understood you correctly, I believe this is what I should have:

    public void shearSheep(World world, int x, int y, int z, Entity target)
    EntitySheep.onSheared(null, world, (int)target.posX, (int)target.posY, (int)target.posZ, 3);
    public void onEntityWalking(World world, int x, int y, int z, Entity entity)
    IShearable target = (IShearable)entity;
    if(!world.isRemote && target.isShearable(null, entity.worldObj, (int)entity.posX, (int)entity.posY, (int)entity.posZ))
    	shearSheep(world, (int)entity.posX, (int)entity.posY, (int)entity.posZ, entity);


    However, I get an error on the line where I call EntitySheep.onSheared(), saying that I can't make a static reference to a non-static field(which this method is not, so the error is correct). Have I done something incorrect?

  12. Sorry, but I'm not sure what you mean. I understand that I can call EntitySheep.onSheared() in my shearSheep method, but I don't understand the bit about not using parameters. I see that the actual EntitySheep.onSheared method does not use any of the parameters you give it, but I still have to put them in when I call it. Am I just able to put whatever I want(assuming it's the correct variable type)? I doubt I'm understanding what you mean. :)

  13. Ok, so I got the block to be able to do things when a sheep walks on it just not shearing it. I looked in the IShearable class and found this:

    public ArrayList<ItemStack> onSheared(ItemStack item, World world, int x, int y, int z, int fortune);

    This should apparently preform all of the actions related to being sheared, but I'm not completely sure how to use this. I immediately see a problem with this in that there is a fortune variable which a block obviously won't have. This is my current code:

    public void shearSheep(int x, int y, int z, Entity target)
    public void onEntityWalking(World world, int x, int y, int z, Entity entity)
    IShearable target = (IShearable)entity;
    if(!world.isRemote && target.isShearable(null, entity.worldObj, (int)entity.posX, (int)entity.posY, (int)entity.posZ))
    	shearSheep((int)entity.posX, (int)entity.posY, (int)entity.posZ, entity);

    As you can see, the shearSheep() method is empty. I think the onSheared() method is supposed to be for items. Anyone have any ideas?

  14. Warning: I'm new to modding


    Hi, as you probably guessed from the title, I want to try to make a block that, when activated with redstone, it will shear a sheep standing above it. I think I know how to do the activated with redstone part by just overriding onNeighborBlockChange(), however the shearing part kind of confuses me. I looked at the code for shears, but it uses  itemInteractionForEntity() which is used for when you right-click on an entity with an item so I don't think that I will be able to use that. I tried to alter the shears code to work with a block but I wasn't really able to get it to work correctly. Again, I am new to modding so this might be something really obvious.

    Help is appreciated!



  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.