Inactive [MECH] Mendel's sheep [1.2.3-R01]

Discussion in 'Inactive/Unsupported Plugins' started by m0rt, Nov 28, 2011.

  1. Offline

    m0rt

    Mendel's sheep
    Version: 0.3.1
    Download (jar)| BukkitDev | Source

    Mendel's sheep, as the name suggests, implements Mendel's laws of inheritance for sheeps. Their born color is no longer affected by the parent's color, but by it's genes. Coloring the sheep will no longer change the color of it's children.

    Sheeps have 4 pairs of alleles, each affecting one "aspect" of the color. Thanks to the selection of minecraft colors, the "aspects" are a little artificial. Their technical names are "colorness" (colorful/dim), "naturalness" (natural/artifical colors), "lightness" (light/dark) and hue (no actual meaning). Following table shows how they are translated to sheep colors (values 1 are domiant, zeroes are recessive):
    sheep.png
    Sheep images belong to minecraftwiki.net

    There is a set of admin tools to test/play with the plugin. Each has a separate permission, and they all inherit from "mendelsheep" permission, that is defaulted to OP;
    mendelsheep.inspect: Displays the sheep's genome on right-click
    mendelsheep.restore: Reverts the sheep to birth color on right-click while holding bone
    mendelsheep.spawn: Allows the usage of /ms or /mendelsheep command, that just spawns a sheep at your position

    Installation and Config:
    So far there is no config, just drag-and-drop the jar in plugins folder.

    Changelog:
    0.3.1 - fixed multiworld support and color table bug (purple color was always replaced with magenta)
    0.3 - fixed inheritance bugs
    0.2b - fixes due to obfuscation change
    0.2 - removed unsued code, added grow function
     
    TexasGamer and owenftw like this.
  2. Offline

    aehoooo

    Thats very.... interesting.
     
    Monkah and ZNickq like this.
  3. Offline

    Sp0ng3b0b

    Great Plugin, but is it possible to implemet random babys? So that color spreads arount the world without interacting? Would be epic :D
     
  4. Offline

    mmob18

    I don't get it...
     
  5. Offline

    m0rt

    Sp0ng3b0b: That would be possible, however maybe that's for another plugin to do.
    mmob18: Are you familiar with Mendelian Inheritance? (That's how inheritance works IRL) This is an implementation of this simple laws. Obviously I made up the "genes" and "traits", but it still follows the laws.
     
  6. Offline

    CainFoool

    Oh god, it's Science class all over again! (Dominant, Recessive, Alleles) D:
     
    MrRedLogan likes this.
  7. Offline

    nala3

    Thats brilliant, surprisingly original XD
     
  8. Offline

    kotoroshinoto

    you should put in a slight chance for mutation when passing parental genes to the baby sheep. come up with a small chance of each gene to mutate into the other allele version. (allows for getting new alleles when breeding sheep if you don't find more exotic colors spawning naturally.)
     
  9. Offline

    Mausterio

    Suggestion: Add a command that shows you a table of breading like

    R= Red
    W= White
    P= Pink

    R+W=P
     
  10. Offline

    m0rt

    @kotoroshinito: I could do that, but it is alredy confusing as it is, without any random mutations. You can find only white sheep in nature, however they often carry multiple recessive alleles (never a recessive pair).

    @Mausterio: It really isn't that simple, if you for example breed a blue and a white sheep, you can get all colors, or only white, or anything in between, depending on the white sheep's genes (there are 16 different versions of white sheep actually)
     
  11. Offline

    rmb938

    This is awesome adding to my server now!
     
  12. Offline

    Xordaii

    Is there anyway you or this author could hook into the other's plugin and tell what color a sheep is supposed to be, so that when the wool respawns it is the proper color? I don't see that either has an API, but hoping it is possible.

    In some future version Jeb will add sheep regrowth, and was hoping you would be able to have it regrow the same color. For now, that is just a dev version thing. Are you planning on hooking into that when it does appear in the official version?
     
  13. Offline

    m0rt

    I just added a fix for regrowing, if you regrow wool on sheep, that has been colored, it's color will correctly return to it's born color. It should work with the other mentioned plugin, as well as any other wool-regrowing plugins, maybe even including the 1.0.1 feature (but I am not sure how sheep class is going to be changed, maybe it could break)
     
  14. Offline

    Xordaii

    Tested it last night and today. Both plugins together still don't work together, only seperately. Maybe when one has an API for the other to use? This is a fun plugin, though. I had a blast trying to breed all the colors. Can you explain what the 11 10 and 01 mean? Which is recessive, which dominant? Maybe how to get a 11 pair (I tried that all last night, but if I have a sheep with 01 00 00 00 and one with 10 00 00 00 I can't get them to breed a 11 00 00 00 no matter how hard I tried, I am guessing it would be easier if I knew how the math worked. I did figure out that as long as there was a 1 in a pair needed for that color, you got that color. What I couldn't fathom was how a 00 10 00 01 father and 11 00 10 mother could have a child with 00 00 01 10. Seems to me there is already randomness?
     
    ZNickq likes this.
  15. Offline

    md_5

    Latest rb please, tag me when that is done.
     
    m0rt likes this.
  16. Offline

    m0rt

    The 1579 was a typo, it was meant to be 1597. However at the time I am unable to use "Edit thread" function for some reason.
    The 11 00 ... output is mostly for debugging, it wasn't really meant to be used as a game feature (that's why it's on permission). Every pair represents (obviously) a pair of alles (one gene). 1 represent dominant allele, 0 recessive. Logically then any combination of 11, 10 or 01 results in presence of the trait, only 00 results in absence of the trait. Furthermore 10 and 01 should not make any difference for breeding purposes. ( Two 10s can result in 11). I know there are sometimes bugs, where breeding gives random results, I will look into that.
    The incompatibility is strange, I will ask the other author for source code. (For testing purposes, I added my own regrow in previous version, using mendelsheep.regrow and right-click with watch. It is extremely simple, just calls the regrow function (sheep.setSheared(false)), so unless the plugin does some color change itself, it should work fine)
     
  17. Offline

    Kaikz

  18. Offline

    md_5

    Approved, I have edited it for you, the button is in the top right under thread tools
     
  19. Offline

    m0rt

    I know where it is :). The thing is, that lately, it just freezes when I click it, instead of the regular thread-editing dialog. Been like this for a couple of days.
    Anyway, I am now testing a fixed version, there was indeed a bug in inheritance, the new genome was sometimes calculated incorrectly.
     
  20. Offline

    SkateKoliva

    Bez sensu :d
     
  21. Offline

    kotoroshinoto

    This plugin doesn't seem to play nice with multi-world situations like multi-verse. It works fine on "world", but the additional worlds don't appear to have functional mendelsheep (right clicks don't display genomes.)

    It also doesn't seem to be functional on sheep that are force-spawned by plugins like commandbook. (while commandbook is installed the /ms spawning doesn't seem to work either)
     
  22. Offline

    Tanite

    Looks interesting but multi-world is a must, agreed.
     
  23. Offline

    m0rt

    You are right, the ms command doesn't work, which is strange, as I think it used to work fine in previous versions. I am working on a fix for this.
    Multi-world should work fine, unless bukkit somehow handles the other worlds differently inside, which is possible. I will see what the fix does about this.
     
  24. Offline

    kotoroshinoto

    I tried breeding in op mode with infinite wheat, never got anything except black/white sheep in the other worlds, and right click never displayed a genome (it does this for me properly on the default world), so something seems to be screwy with the way it handles other worlds currently.
     
  25. Offline

    wuselfuzz

    Working on 1.1.0-R1-SNAPSHOT (1714) and sheep regrew wool successfully without RegrowingSheepcoat. \o/

    There's still that bug Veroni3 mentioned on bukkitdev:

    I fixed that locally in my version by replacing the first MAGENTA with PURPLE, compiling the MendelGenome.java using javac --classpath craftbukkit.jar MendelGenome.java and replacing the class files in the jar using zip/unzip.
     
  26. Offline

    m0rt

    I just uploaded newest version, it worked for me on Multiverse-created world. It can be incompatible with some sheep-spawning plugins, because it removes all incorrectly spawned sheep and replaces them with newly spawned, mendelian sheeps, maintaining it's position and rotation. So if some plugin does something with a sheep after it's spawned (e.g. spawns a sheep and saves a link to it in some list), it's not going to work. This is all a temporary solution, as there is currently no other way of detecting a child birth (no event for that).
     
  27. Offline

    Hemlas

    Absolutely brilliant! An ingenious implementation of Mendel's law
     
  28. Offline

    wuselfuzz

    Just tested bukkit 1744 and it killed Mendel's Sheep. Reverted back to 1716.
     
  29. Offline

    m0rt

    wuselfuzz: What exactly is wrong? Works fine for me, even regrowing wool in correct color.
     
  30. Offline

    wuselfuzz

    I didn't get the bitfield for sheep genes on right click. Just installed bukkit build 1774 and it works, though.
     

Share This Page