Event for giant mushroom growth?

Discussion in 'Plugin Development' started by jblaske, Oct 19, 2011.

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

    jblaske

    I was poked around in the java docs and with the event types, and I didn't see any event that fires when you trigger a giant mushroom growth (aside from player interact)

    Am I missing something? or is this a bug?
     
  2. Offline

    Father Of Time

    Personally I have nooo idea, but if you don't mind taking a few shots in the dark I have a few suggestions for places to look.

    Have you looked at the block physics event? I know this handles things like portal closing, water flowing, etc... it might handle block growth.

    Have you looked at how other items that grow are handled, such as trees, sugar cane, cactus, etc? I would imagine the same event is used to trigger all plant growth, so I would start by working backwards from trees.

    I know I really didn't add much here, but I saw your post had no reponses and felt something was better than nothing. Personally I would sponge through the block physics events to see if any are plant related.
     
  3. Offline

    jblaske

    Doh! I can't believe I didn't check physics! I bet it is in here, I'll report back.
     
  4. Offline

    Father Of Time

    Awesome, please do! :D I love people who do show and tell after they make a discovery. If you don't manage to find anything let us know, when I get home from work and classes I will thumb through the events to see if I can help you with your search, who knows maybe I will use what we find to make trees grow and drop apples. ^^

    Good luck!
     
  5. Offline

    jblaske

    Sadly, Physics does not catch the event (or any grow events)

    It seems all grow events are not tracked at all.
     
  6. Offline

    Daniel Heppner

    *psst* make a pull request with the event.
     
  7. Offline

    jblaske

    I'd have to code the event before I could make a pull request. Which, at the moment I don't want to deal with.
     
  8. Offline

    Father Of Time

    I don't think it's an actual "function" or anything of the block physics event, but rather you need to catch the block physic event and check to see if that block is a blocktype GIANT_MUSHROOM1 or GIANT_MUSHROOM2.

    I'm at work right now and don't have access to my software, but from the top of my head it's something like...

    Code:
        Block eventblock = event.getBlock();
        if( eventblock.getType().TypeOf( Material.GIANT_MUSHROOM1 ) or eventblock.getType().TypeOf( Material.GIANT_MUSHROOM2 ) )
            //If this is triggered it means a giant mushroom just had a physic event
            // eventblock is the block that grew
            // event is the event of the growth
            // So some examples
            eventblock.setType(1); // Will turn a mushroom block into stone when it grows
            event.setCancelled(); // will stop the mushroom from growing.
    again, I have no idea if this is correct or not, it's simply my best guess. I've never played around with plant growth physics, however before I left the house this morning this post popped into my mind, so I did confirm that giant mushroom 1 and giant mushroom 2 are block Material types, which means its possible to check them for block physics events, which then means there is a strong likelihood the above code will work with some manipulation.

    Play around with the above code, let me know if you have any breakthroughs! ;)
     
  9. Offline

    jblaske

    That is exactly what i wanted to do but While testing to see if the event was fired, i just stuck a plain log to console if the event was fired. Then built the plugin and started testing with growing shrooms. The event never fired once when i was growing them.

    So we can't even make do with the event at all, as its never called during mushroom growth. The only thing that is called is PLAYER_INTERACT, which is how i decided to utilize it for my plugin.

    Just checking to see what the item in hand is and the block that is right clicked on, and i know if its a mushroom or not. The flaw with this is, if there is no room for the mushroom, and it can't grow - I'm improperly tracking a mushroom grow event.

    Also, this method won't work for tracking natural sugarcane or tree growth.
     
  10. Offline

    Father Of Time

    Firstly, I apologize for sending you on a wild goose chase. However, it’s a fact that mushroom growth is triggered at some point because they wouldn’t be able to grow independently if not (they would grow globally at the same time all at once). Somewhere there is an event that is triggered for GIANT_MUSHROOM1 & 2 blocks, we just simply haven’t found it yet.

    It would really help me help you to know why you need to know when the mushroom growth is triggered. By knowing what type of behavior you hope to create I may be better able to assist you with where to look.

    Either way I am interested in finding this myself, so we WILL find this eventually… just have to be patient. :D

    onBlockSpread event?
    EDIT: hmm, every single post I've read so far says the same thing, that there is NOT an event for crop growth.
    http://forums.bukkit.org/threads/wheat-growing.26655/#post-480444

    Now I don't know if..

    1) this is still a true statement, bukkit is forever evolving
    2) if crops and trees/shrooms are the same thing
    3) if these people are correct or just assuming (a lot of assuming occurs on these forums)

    Hopefully I will have some time to invest into researching this tonight, because my curiousty is officially peeked. :eek:

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 20, 2016
  11. Offline

    jblaske

    nope, I've tested:

    onBlockSpread
    onBlockForm
    onBlockFromTo
    onBlockLeavesDecay
    onBlockPhysics
    onBlockFade

    none of those trigger when growing a giant mushroom.
     
  12. Offline

    Daniel Heppner

    I know, but okay.
     
  13. Offline

    Father Of Time

    Ohhhh... I got tired of guessing and decided to look for some documentation on bukkit events, I just found this link!

    I am going to thumb through it here and there (I'm at work), but I bet if there is an event for growth it can be located here.
     
  14. Offline

    jblaske

    What link??
     
  15. Offline

    Father Of Time

    I know mushroom spreading is different from mushroom growth, but after browsing the entire block listner class I've begun to agree with you, there is no event listener for plant growth...

    However, I did noticed an event that occurs when a block is generated (not placed by players), maybe you can tap into that event and check to see if the block being generated is a mushroom block, in essence that is a "growrth".

    I know I'm not helping that much, but I'm trying. :p

    Oh, jezz... sorry
    http://jd.bukkit.org/doxygen/de/df8/classorg_1_1bukkit_1_1event_1_1block_1_1BlockListener.html

    I found this link:

    http://jd.bukkit.org/doxygen/da/d03/classorg_1_1bukkit_1_1material_1_1Tree.html

    Which is the Material class for Trees. inside that class is the following function.

    The data field is the only variable that saves data past world saves, so I would imagine this is what is used to determine the growth stage of a tree. I bet if we can trace backwards what calls this function we can find what "triggers" plant growth and create our own event listener if one doesn't exist...

    Just trying to think outside the box. :oops:

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 20, 2016
  16. Offline

    jblaske

    Yeah, I appreciate it - It really does look like some coding is going to need to be done to get this functionality.
     
  17. Offline

    Father Of Time

    I'm soo perplexed. Although trees have their own class in Materials.Tree mushrooms don't... mushrooms are nothing more than an enum variable in the Martials class:

    Code:
    00001 package org.bukkit;
    00002
    00003 import java.lang.reflect.Constructor;
    00004 import java.lang.reflect.InvocationTargetException;
    00005 import java.util.HashMap;
    00006 import java.util.Map;
    00007 import java.util.logging.Level;
    00008 import java.util.logging.Logger;
    00009 import org.bukkit.material.*;
    00010
    00014 public enum Material {
    00015     AIR(0),
    00016     STONE(1),
    00017     GRASS(2),
    00018     DIRT(3),
    00019     COBBLESTONE(4),
    00020     WOOD(5),
    00021     SAPLING(6, Tree.class),
    00022     BEDROCK(7),
    00023     WATER(8, MaterialData.class),
    00024     STATIONARY_WATER(9, MaterialData.class),
    00025     LAVA(10, MaterialData.class),
    00026     STATIONARY_LAVA(11, MaterialData.class),
    00027     SAND(12),
    00028     GRAVEL(13),
    00029     GOLD_ORE(14),
    00030     IRON_ORE(15),
    00031     COAL_ORE(16),
    00032     LOG(17, Tree.class),
    00033     LEAVES(18, Tree.class),
    00034     SPONGE(19),
    00035     GLASS(20),
    00036     LAPIS_ORE(21),
    00037     LAPIS_BLOCK(22),
    00038     DISPENSER(23, Dispenser.class),
    00039     SANDSTONE(24),
    00040     NOTE_BLOCK(25),
    00041     BED_BLOCK(26, Bed.class),
    00042     POWERED_RAIL(27, PoweredRail.class),
    00043     DETECTOR_RAIL(28, DetectorRail.class),
    00044     PISTON_STICKY_BASE(29, PistonBaseMaterial.class),
    00045     WEB(30),
    00046     LONG_GRASS(31, LongGrass.class),
    00047     DEAD_BUSH(32),
    00048     PISTON_BASE(33, PistonBaseMaterial.class),
    00049     PISTON_EXTENSION(34, PistonExtensionMaterial.class),
    00050     WOOL(35, Wool.class),
    00051     PISTON_MOVING_PIECE(36),
    00052     YELLOW_FLOWER(37),
    00053     RED_ROSE(38),
    00054     BROWN_MUSHROOM(39),
    00055     RED_MUSHROOM(40),
    00056     GOLD_BLOCK(41),
    00057     IRON_BLOCK(42),
    00058     DOUBLE_STEP(43, Step.class),
    00059     STEP(44, Step.class),
    00060     BRICK(45),
    00061     TNT(46),
    00062     BOOKSHELF(47),
    00063     MOSSY_COBBLESTONE(48),
    00064     OBSIDIAN(49),
    00065     TORCH(50, Torch.class),
    00066     FIRE(51),
    00067     MOB_SPAWNER(52),
    00068     WOOD_STAIRS(53, Stairs.class),
    00069     CHEST(54),
    00070     REDSTONE_WIRE(55, RedstoneWire.class),
    00071     DIAMOND_ORE(56),
    00072     DIAMOND_BLOCK(57),
    00073     WORKBENCH(58),
    00074     CROPS(59, Crops.class),
    00075     SOIL(60, MaterialData.class),
    00076     FURNACE(61, Furnace.class),
    00077     BURNING_FURNACE(62, Furnace.class),
    00078     SIGN_POST(63, 1, Sign.class),
    00079     WOODEN_DOOR(64, Door.class),
    00080     LADDER(65, Ladder.class),
    00081     RAILS(66, Rails.class),
    00082     COBBLESTONE_STAIRS(67, Stairs.class),
    00083     WALL_SIGN(68, 1, Sign.class),
    00084     LEVER(69, Lever.class),
    00085     STONE_PLATE(70, PressurePlate.class),
    00086     IRON_DOOR_BLOCK(71, Door.class),
    00087     WOOD_PLATE(72, PressurePlate.class),
    00088     REDSTONE_ORE(73),
    00089     GLOWING_REDSTONE_ORE(74),
    00090     REDSTONE_TORCH_OFF(75, RedstoneTorch.class),
    00091     REDSTONE_TORCH_ON(76, RedstoneTorch.class),
    00092     STONE_BUTTON(77, Button.class),
    00093     SNOW(78),
    00094     ICE(79),
    00095     SNOW_BLOCK(80),
    00096     CACTUS(81, MaterialData.class),
    00097     CLAY(82),
    00098     SUGAR_CANE_BLOCK(83, MaterialData.class),
    00099     JUKEBOX(84),
    00100     FENCE(85),
    00101     PUMPKIN(86, Pumpkin.class),
    00102     NETHERRACK(87),
    00103     SOUL_SAND(88),
    00104     GLOWSTONE(89),
    00105     PORTAL(90),
    00106     JACK_O_LANTERN(91, Pumpkin.class),
    00107     CAKE_BLOCK(92, 1, Cake.class),
    00108     DIODE_BLOCK_OFF(93, Diode.class),
    00109     DIODE_BLOCK_ON(94, Diode.class),
    00110     LOCKED_CHEST(95),
    00111     TRAP_DOOR(96, TrapDoor.class),
    00112     MONSTER_EGGS(97, MonsterEggs.class),
    00113     SMOOTH_BRICK(98, SmoothBrick.class),
    00114     HUGE_MUSHROOM_1(99),                                <<< HERE
    00115     HUGE_MUSHROOM_2(100),                              <<< HERE
    00116     IRON_FENCE(101),
    00117     THIN_GLASS(102),
    00118     MELON_BLOCK(103),
    00119     PUMPKIN_STEM(104),
    00120     MELON_STEM(105),
    00121     VINE(106),
    00122     FENCE_GATE(107),
    00123     BRICK_STAIRS(108),
    00124     SMOOTH_STAIRS(109),
    00125     // ----- Item Separator -----
    00126     IRON_SPADE(256, 1, 250),
    00127     IRON_PICKAXE(257, 1, 250),
    00128     IRON_AXE(258, 1, 250),
    00129     FLINT_AND_STEEL(259, 1, 64),
    00130     APPLE(260),
    00131     BOW(261, 1),
    00132     ARROW(262),
    00133     COAL(263, Coal.class),
    00134     DIAMOND(264),
    00135     IRON_INGOT(265),
    00136     GOLD_INGOT(266),
    00137     IRON_SWORD(267, 1, 250),
    00138     WOOD_SWORD(268, 1, 59),
    00139     WOOD_SPADE(269, 1, 59),
    00140     WOOD_PICKAXE(270, 1, 59),
    00141     WOOD_AXE(271, 1, 59),
    00142     STONE_SWORD(272, 1, 131),
    00143     STONE_SPADE(273, 1, 131),
    00144     STONE_PICKAXE(274, 1, 131),
    00145     STONE_AXE(275, 1, 131),
    00146     DIAMOND_SWORD(276, 1, 1561),
    00147     DIAMOND_SPADE(277, 1, 1561),
    00148     DIAMOND_PICKAXE(278, 1, 1561),
    00149     DIAMOND_AXE(279, 1, 1561),
    00150     STICK(280),
    00151     BOWL(281),
    00152     MUSHROOM_SOUP(282, 1),
    00153     GOLD_SWORD(283, 1, 32),
    00154     GOLD_SPADE(284, 1, 32),
    00155     GOLD_PICKAXE(285, 1, 32),
    00156     GOLD_AXE(286, 1, 32),
    00157     STRING(287),
    00158     FEATHER(288),
    00159     SULPHUR(289),
    00160     WOOD_HOE(290, 1, 59),
    00161     STONE_HOE(291, 1, 131),
    00162     IRON_HOE(292, 1, 250),
    00163     DIAMOND_HOE(293, 1, 1561),
    00164     GOLD_HOE(294, 1, 32),
    00165     SEEDS(295),
    00166     WHEAT(296),
    00167     BREAD(297),
    00168     LEATHER_HELMET(298, 1, 33),
    00169     LEATHER_CHESTPLATE(299, 1, 47),
    00170     LEATHER_LEGGINGS(300, 1, 45),
    00171     LEATHER_BOOTS(301, 1, 39),
    00172     CHAINMAIL_HELMET(302, 1, 66),
    00173     CHAINMAIL_CHESTPLATE(303, 1, 95),
    00174     CHAINMAIL_LEGGINGS(304, 1, 91),
    00175     CHAINMAIL_BOOTS(305, 1, 78),
    00176     IRON_HELMET(306, 1, 135),
    00177     IRON_CHESTPLATE(307, 1, 191),
    00178     IRON_LEGGINGS(308, 1, 183),
    00179     IRON_BOOTS(309, 1, 159),
    00180     DIAMOND_HELMET(310, 1, 271),
    00181     DIAMOND_CHESTPLATE(311, 1, 383),
    00182     DIAMOND_LEGGINGS(312, 1, 367),
    00183     DIAMOND_BOOTS(313, 1, 319),
    00184     GOLD_HELMET(314, 1, 67),
    00185     GOLD_CHESTPLATE(315, 1, 95),
    00186     GOLD_LEGGINGS(316, 1, 91),
    00187     GOLD_BOOTS(317, 1, 79),
    00188     FLINT(318),
    00189     PORK(319),
    00190     GRILLED_PORK(320),
    00191     PAINTING(321),
    00192     GOLDEN_APPLE(322),
    00193     SIGN(323, 1),
    00194     WOOD_DOOR(324, 1),
    00195     BUCKET(325, 1),
    00196     WATER_BUCKET(326, 1),
    00197     LAVA_BUCKET(327, 1),
    00198     MINECART(328, 1),
    00199     SADDLE(329, 1),
    00200     IRON_DOOR(330, 1),
    00201     REDSTONE(331),
    00202     SNOW_BALL(332, 16),
    00203     BOAT(333, 1),
    00204     LEATHER(334),
    00205     MILK_BUCKET(335, 1),
    00206     CLAY_BRICK(336),
    00207     CLAY_BALL(337),
    00208     SUGAR_CANE(338),
    00209     PAPER(339),
    00210     BOOK(340),
    00211     SLIME_BALL(341),
    00212     STORAGE_MINECART(342, 1),
    00213     POWERED_MINECART(343, 1),
    00214     EGG(344, 16),
    00215     COMPASS(345),
    00216     FISHING_ROD(346, 1, 64),
    00217     WATCH(347),
    00218     GLOWSTONE_DUST(348),
    00219     RAW_FISH(349),
    00220     COOKED_FISH(350),
    00221     INK_SACK(351, Dye.class),
    00222     BONE(352),
    00223     SUGAR(353),
    00224     CAKE(354, 1),
    00225     BED(355, 1),
    00226     DIODE(356),
    00227     COOKIE(357),
    00228     MAP(358, 1, MaterialData.class),
    00229     SHEARS(359, 1, 238),
    00230     MELON(360),
    00231     PUMPKIN_SEEDS(361),
    00232     MELON_SEEDS(362),
    00233     RAW_BEEF(363),
    00234     COOKED_BEEF(364),
    00235     RAW_CHICKEN(365),
    00236     COOKED_CHICKEN(366),
    00237     ROTTEN_FLESH(367),
    00238     ENDER_PEARL(368),
    00239     GOLD_RECORD(2256, 1),
    00240     GREEN_RECORD(2257, 1);
    00241
    00242     private final int id;
    00243     private final Class<? extends MaterialData> data;
    00244     private static final Map<Integer, Material> lookupId = new HashMap<Integer, Material>();
    00245     private static final Map<String, Material> lookupName = new HashMap<String, Material>();
    00246     private final int maxStack;
    00247     private final short durability;
    00248
    00249     private Material(final int id) {
    00250         this(id, 64);
    00251     }
    00252
    00253     private Material(final int id, final int stack) {
    00254         this(id, stack, null);
    00255     }
    00256
    00257     private Material(final int id, final int stack, final int durability) {
    00258         this(id, stack, durability, null);
    00259     }
    00260
    00261     private Material(final int id, final Class<? extends MaterialData> data) {
    00262         this(id, 64, data);
    00263     }
    00264
    00265     private Material(final int id, final int stack, final Class<? extends MaterialData> data) {
    00266         this(id, stack, -1, data);
    00267     }
    00268
    00269     private Material(final int id, final int stack, final int durability, final Class<? extends MaterialData> data) {
    00270         this.id = id;
    00271         this.durability = (short) durability;
    00272         this.maxStack = stack;
    00273         this.data = data;
    00274     }
    00275
    00281     public int getId() {
    00282         return id;
    00283     }
    00284
    00290     public int getMaxStackSize() {
    00291         return maxStack;
    00292     }
    00293
    00299     public short getMaxDurability() {
    00300         return durability;
    00301     }
    00302
    00308     public Class<? extends MaterialData> getData() {
    00309         return (data == null) ? MaterialData.class : data;
    00310     }
    00311
    00319     public MaterialData getNewData(final byte raw) {
    00320         if (data == null) {
    00321             return new MaterialData(id, raw);
    00322         }
    00323
    00324         try {
    00325             Constructor<? extends MaterialData> ctor = data.getConstructor(int.class, byte.class);
    00326
    00327             return ctor.newInstance(id, raw);
    00328         } catch (InstantiationException ex) {
    00329             Logger.getLogger(Material.class.getName()).log(Level.SEVERE, null, ex);
    00330         } catch (IllegalAccessException ex) {
    00331             Logger.getLogger(Material.class.getName()).log(Level.SEVERE, null, ex);
    00332         } catch (IllegalArgumentException ex) {
    00333             Logger.getLogger(Material.class.getName()).log(Level.SEVERE, null, ex);
    00334         } catch (InvocationTargetException ex) {
    00335             Logger.getLogger(Material.class.getName()).log(Level.SEVERE, null, ex);
    00336         } catch (NoSuchMethodException ex) {
    00337             Logger.getLogger(Material.class.getName()).log(Level.SEVERE, null, ex);
    00338         } catch (SecurityException ex) {
    00339             Logger.getLogger(Material.class.getName()).log(Level.SEVERE, null, ex);
    00340         }
    00341
    00342         return null;
    00343     }
    00344
    00350     public boolean isBlock() {
    00351         return id < 256;
    00352     }
    00353
    00360     public static Material getMaterial(final int id) {
    00361         return lookupId.get(id);
    00362     }
    00363
    00372     public static Material getMaterial(final String name) {
    00373         return lookupName.get(name);
    00374     }
    00375
    00384     public static Material matchMaterial(final String name) {
    00385         Material result = null;
    00386
    00387         try {
    00388             result = getMaterial(Integer.parseInt(name));
    00389         } catch (NumberFormatException ex) {}
    00390
    00391         if (result == null) {
    00392             String filtered = name.toUpperCase();
    00393
    00394             filtered = filtered.replaceAll("\\s+", "_").replaceAll("\\W", "");
    00395             result = lookupName.get(filtered);
    00396         }
    00397
    00398         return result;
    00399     }
    00400
    00401     static {
    00402         for (Material material : values()) {
    00403             lookupId.put(material.getId(), material);
    00404             lookupName.put(material.name(), material);
    00405         }
    00406     }
    00407 }
    
    The materials class doesn't have any functions to handle shroom growth, and mushrooms don't have a class of their own to house growth functions... I'm literally baffled as to what handles their growth...
     
  18. Offline

    jblaske

    I wouldn't be surprised if mushrooms are actually just a species of the tree class.

    It seems that they are not actually species of the tree class, either. I too am quite confused now.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 20, 2016
  19. Offline

    Father Of Time

    Good thinking, shame it didn't pan out... Just like you I am honestly completely lost on this... Could it be client side? I mean from player/entity/block/world events I don't see anything...

    again, the only thing I can think of is to look for anything within the bukkit project that calls the setdata function in the tree class, maybe that will lead us to something...
     
  20. Offline

    jblaske

    I'd love to see some Bukkit Team input on this, if anybody on the team has looked into hooking into tree events for growth and such.
     
  21. Offline

    Father Of Time

    from that link I provided you above I did a search for "grow" and found this:

    So the SetState function IS used to control the growth state of a crop, so it's likely used for the same purpose on trees.

    Crop.java

    Code:
    00001 package org.bukkit.material;
    00002
    00003 import org.bukkit.CropState;
    00004 import org.bukkit.Material;
    00005
    00009 public class Crops extends MaterialData {
    00010     public Crops() {
    00011         super(Material.CROPS);
    00012     }
    00013
    00014     public Crops(CropState state) {
    00015         this();
    00016         setState(state);
    00017     }
    00018
    00019     public Crops(final int type) {
    00020         super(type);
    00021     }
    00022
    00023     public Crops(final Material type) {
    00024         super(type);
    00025     }
    00026
    00027     public Crops(final int type, final byte data) {
    00028         super(type, data);
    00029     }
    00030
    00031     public Crops(final Material type, final byte data) {
    00032         super(type, data);
    00033     }
    00034
    00040     public CropState getState() {
    00041         return CropState.getByData(getData());
    00042     }
    00043
    00049     public void setState(CropState state) {
    00050         setData(state.getData());
    00051     }
    00052
    00053     @Override
    00054     public String toString() {
    00055         return getState() + " " + super.toString();
    00056     }
    00057 }
    
    CropState.java

    Code:
    00001 package org.bukkit;
    00002
    00003 import java.util.HashMap;
    00004 import java.util.Map;
    00005
    00009 public enum CropState {
    00010
    00014     SEEDED((byte) 0x0),
    00018     GERMINATED((byte) 0x1),
    00022     VERY_SMALL((byte) 0x2),
    00026     SMALL((byte) 0x3),
    00030     MEDIUM((byte) 0x4),
    00034     TALL((byte) 0x5),
    00038     VERY_TALL((byte) 0x6),
    00042     RIPE((byte) 0x7);
    00043
    00044     private final byte data;
    00045     private final static Map<Byte, CropState> states = new HashMap<Byte, CropState>();
    00046
    00047     private CropState(final byte data) {
    00048         this.data = data;
    00049     }
    00050
    00056     public byte getData() {
    00057         return data;
    00058     }
    00059
    00068     public static CropState getByData(final byte data) {
    00069         return states.get(data);
    00070     }
    00071
    00072     static {
    00073         for (CropState s : CropState.values()) {
    00074             states.put(s.getData(), s);
    00075         }
    00076     }
    00077 }
    
    Tree.java

    Code:
    00001 package org.bukkit.material;
    00002
    00003 import org.bukkit.Material;
    00004 import org.bukkit.TreeSpecies;
    00005
    00009 public class Tree extends MaterialData {
    00010     public Tree() {
    00011         super(Material.LOG);
    00012     }
    00013
    00014     public Tree(TreeSpecies species) {
    00015         this();
    00016         setSpecies(species);
    00017     }
    00018
    00019     public Tree(final int type) {
    00020         super(type);
    00021     }
    00022
    00023     public Tree(final Material type) {
    00024         super(type);
    00025     }
    00026
    00027     public Tree(final int type, final byte data) {
    00028         super(type, data);
    00029     }
    00030
    00031     public Tree(final Material type, final byte data) {
    00032         super(type, data);
    00033     }
    00034
    00040     public TreeSpecies getSpecies() {
    00041         return TreeSpecies.getByData(getData());
    00042     }
    00043
    00049     public void setSpecies(TreeSpecies species) {
    00050         setData(species.getData());
    00051     }
    00052
    00053     @Override
    00054     public String toString() {
    00055         return getSpecies() + " " + super.toString();
    00056     }
    00057 }
    

    At this point I am just trying to post anything useful, hopefully something will catch someones eye.

    Okay... I've done more searching than one person should do through any source code... And with that said I feel pretty damn confident saying that there isn't a single class dedicated to mushrooms... It appears that the only mention of giant mushrooms at ALL is in the Materials enumerator where it details HUGE_MUSHROOM1 and HUGE_MUSHROOM2... Even if it didn't have its own class SOMETHING is spawning them, SOMETHING is causing their growth... by doing a search of the source code I should be able to find something that generates a block with the material type set to HUGE_MUSHROOM, but nothing that I come across ever refers to this material type...

    I'm sorry jblaske, I've tried my best but at this time I really don't know where to go. I think you are right in that we will need the input from a bukkit developer to move forward, because I've taken so many shots in the dark I've commited 3 involuntary manslaughter's...

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 20, 2016
  22. Offline

    jblaske

    I can't thank you enough for all of the research, Hopefully all this knowledge will go to good use. I'm gonna tag @EvilSeph and @Dinnerbone to see if they know anything, or anybody that might be able to chime in.
     
  23. Offline

    ZNickq

    Um...just get the bukkit source on your computer, and then delete GIANT_MUSHROOM from the enum? It should cause errors where it is used :p
     
    jblaske and Father Of Time like this.
  24. Offline

    Father Of Time

    It's my pleasure, I am happy to lend a hand.

    Fantastic, hopefully some of the big guns around here will be able to shed more light on this topic. I will bring this post to the attention of a few developers here that I've found to be very informative, hopefully they will have some knowledge we can tap into...
     
  25. Offline

    jblaske

    While this is a great idea, you have missed the part where we are not at home and do not have access to these features. We can only do research thru the source and javadocs right now.
     
  26. Offline

    Father Of Time

    I like how a$$ backwards your brain works! Although as jblaske stated I can't really do that atm. ^^
     
    ZNickq likes this.
Thread Status:
Not open for further replies.

Share This Page