[WIP] GrassEatingAnimals

Discussion in 'WIP and Development Status' started by 02JanDal, Feb 24, 2013.

Thread Status:
Not open for further replies.
  1. Offline

    02JanDal

    Right now, only sheep are eating grass. Not only is that boring, but also it's easy to create minimal farms (3x3) with many to many animals in.

    This plugin tries to address these issues, by making other animals eat grass too.

    Right now only cows are implemented, but as fast as they are stable and good I'm going to add Chickens, Pigs, Mushrooms and I'm probably also going to alter how Sheep work to make it work like the others.

    What happens right now is that if the cow is standing on a grass block or "in" long grass, there is a random chance that the cow will eat the grass, either removing the long grass or turning the grass block into a dirt block. This will add a specified amount of "food points" (foodLevel in code) to the cow. Also, over time the cow will lose food points. If the food points drop to zero, the cow will start to take damage (rather slowly) and eventually die. This means that if you have to many cows and the grass doesn't grow after fast enough your herd will die...

    It doesn't end there though, cows need a specified food level to be able to give milk. Giving milk will also take several food points, so you can't spam click with a stack of buckets any more.

    This is VERY work in progress right now, and there are still many features left to be implemented and bugs to be squashed.

    Features left to implement:
    • Baby animals should lose food points faster than adults They now eat more frequent
    • Ability to set all constants in a configuration file
    • Animals should try to find grass by them self when they are hungry. (Right now it happens that a cow stands still on a grass block, after a time it has eaten it (it's now a dirt block) and a bit later it dies)
    • Breeding should need a minimal food level
    • Several in code markers
    Also, as this is my first bukkit plugin and also my first try at java (other than a Hello world program), I have several questions according to bukkit programming that I don't think are important enough to get an own thread:
    • Right now "my" cow is inheriting from net.minecraft.server.v1_4_R1.EntityCow (from CraftBukkit) as far as I have understood it this is not a nice way to do it, but how should it be done?
    • Right now I'm assuming the c() function from EntityCow is called every tick, as looking at other code pointed that way. Is that right or is there some other function that I should use?
    • Is there a way to save a value along side an animal when the world is saved? I thought about using equipment, but it seemed to hackish, and the metadata system doesn't permanently save any values. Do cows have durability :) ?
    I have a github page for this plugin here
    The current jar file can be downloaded here
    Licensed under BSD 2-clause

    Thanks for taking the time to read!
     
  2. Offline

    chasechocolate

    Member since yesterday, and you made this? Nice work!
     
  3. Offline

    02JanDal

    I've done quite a bit of C++ programming (which is very similar to java) using the Qt toolkit (which is similar to Bukkit in that it is easy to understand).
     
  4. Offline

    chasechocolate

    Oh nice :) I've done some C++, but... *cough* java is better *cough* :p
     
  5. Offline

    02JanDal

    I think it depends on the project, but we better not start a war...
     
  6. Offline

    Wedhro

    I can't wait for this plugin to be released! What about letting people feed their chickens and pigs with wheat/seeds/apples/vegetables thrown on the ground also? Cows are overpowered in comparison with pigs and chickens, more feeding options would help balance them out.

    Also, in case you didn't think about it, what about diversifying the amount of food needed by each animal? Big, useful animals should eat more than little, less useful ones. This includes baby animals, they shouldn't eat more than adults IMO because it's not realistic (I know, who cares) and it's not balanced considering they do nothing useful until they grow up; having one more hungry mouth to feed is enough, no need to make it worse before you can actually do something with it.
    Of course making this values configurable would be even better.
     
  7. Offline

    02JanDal

    I like the idea about feeding in other ways, but trowing things on the ground could cause huge amounts of lag (there is a reason most lag reduction plugins care so much about removing lose items). Another idea might be animals eating the food out of chests perhaps?

    I think the easiest way to decide this is to make it configurable.

    The reason I haven't done much for a while now is I had a hard disk crash, so I had to sort that out first, but I'm up and running and will continue the development on this.

    Jan
     
  8. Offline

    Wedhro

    If lag is a problem this could be a solution.

    Happy to hear that.
     
  9. Offline

    Super User

    I thought the title says the grass eats the animals.
     
    afistofirony likes this.
  10. Offline

    02JanDal

    Well, might not be a terrible wrong idea...

    Having some other work right now, and I still have some of the problems outlined in my first post, so I don't know how far I'm going to take this (for right now)

    Jan
     
Thread Status:
Not open for further replies.

Share This Page