Inactive [MECH] DwarfForge v 2.13 Run Furnaces on Lava [1.3.1-R1]

Discussion in 'Inactive/Unsupported Plugins' started by Don Redhorse, Dec 7, 2011.

  1. Offline

    Don Redhorse

    well... you know.. so if a player is not allowed to create dwarfforges but allowed to use them you could exploit that with flowing lava.

    some admins don't like that,

    I mean I can open a bug report for it... my last one with an XP exploit isn't answered since 30 days though..

    so I can either try to code around it, ignore the problems we have with toggleing etc of the forges or make the plugin exploitable.

    hmm I guess I will implement metrics in this too and see how many people are using it at all..
     
  2. Offline

    Revn

    I love this plugin!
    Please add this features.
    1. Reload Command
    2. Direct setting command
    Thank you very mush!
     
  3. Offline

    Don Redhorse

    hi... I'm sorry but I'm just maintaining it... now with bukkit being in limbo even more so..
     
  4. Offline

    Revn

    Thanks for answer, but never mind.
    I'll wait for your plugin much time.
    because it is my most favorite plugin. :)
    God bless you!!
     
  5. Offline

    Don Redhorse

    thanks... yeah.. perhaps I will add some stuff I'f I have a lot of time and feel bored... but bukkit atm is a oneway street into a dead end.

    I would rather like to spend time and effort when the alternatives arrive
     
  6. Offline

    jenks1999

    2012-04-24 01:17:38 [WARNING] Task of 'DwarfForge' generated an exception
    java.lang.ClassCastException: org.bukkit.craftbukkit.block.CraftBlockState cannot be cast to org.bukkit.block.Furnace
    at org.simiancage.bukkit.DwarfForge.Forge.douse(Forge.java:153)
    at org.simiancage.bukkit.DwarfForge.Forge.toggle(Forge.java:421)
    at org.simiancage.bukkit.DwarfForge.DFBlockListener$1.run(DFBlockListener.java:130)
    at org.bukkit.craftbukkit.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:126)
    at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:517)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:449)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:492)


    Please advise on fix for this error code... thank you.
     
  7. Offline

    gawelium

    This pluginer is dead too ?
     
  8. Offline

    Don Redhorse

    see my reply on dev bukkit

    nope just busy... I will let you know BEFORE I quit and will try to get somebody to take over the plugins before..

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

    With the new dev of 1.3.1 the below error is generated upon punching the furnace, tried 2.2 and the latest version.

    Edit: Oh, and it doesnt "run" either, its not just an error message.

    Code:
    13:19:34 [WARNING] Task of 'DwarfForge' generated an exception
    java.lang.NoClassDefFoundError: net/minecraft/server/FurnaceRecipes
            at org.simiancage.bukkit.DwarfForge.Utils.resultOfCooking(Utils.java:76)
            at org.simiancage.bukkit.DwarfForge.Utils.canCook(Utils.java:83)
            at org.simiancage.bukkit.DwarfForge.Forge.updateRawMaterial(Forge.java:219)
            at org.simiancage.bukkit.DwarfForge.Forge.update(Forge.java:329)
            at org.simiancage.bukkit.DwarfForge.Forge.run(Forge.java:372)
            at org.bukkit.craftbukkit.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:126)
            at net.minecraft.server.MinecraftServer.q(MinecraftServer.java:508)
            at net.minecraft.server.DedicatedServer.q(DedicatedServer.java:212)
            at net.minecraft.server.MinecraftServer.p(MinecraftServer.java:472)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:404)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:539)
    
     
  10. Offline

    mattmoss

    EDIT: Okay, my previous post was probably all wrong.

    It *seems* to me that this particular bit is part of the bukkit api. See:
    https://github.com/Bukkit/CraftBukk...java/net/minecraft/server/RecipesFurnace.java

    So I'm not sure why it wouldn't work. Sorry.
     
  11. Eclipse tells me that FurnaceRecipes dont exist, but it does say that FurnaceRecipe (not the missing s at the end) exist in org.bukkit.inventory. Perhaps that can help? However, removing the stray s made it complain about the .getInstance() bit. Since i practically dont know anything about java.. i dont really know what to put there instead. But perhaps you do :)

    Edit: Also, you have FurnaceRecipes, eclipse suggests FurnaceRecipe and the link you posted to says RecipesFurnace, they are all diffrent.
     
  12. Offline

    mattmoss

    Ahhh... it looks like, in 1.3.1, they change the name from FurnaceRecipes to RecipesFurnace.

    EDIT: Example diff from 1.3.1 patch:
    Code:
    @@ -97,7 +101,7 @@ public ItemStack a(int i) {
     
                     slot.a(itemstack1, itemstack);
                 } else if (i != 1 && i != 0) {
    -                if (FurnaceRecipes.getInstance().getResult(itemstack1.getItem().id) != null) {
    +                if (RecipesFurnace.getInstance().getResult(itemstack1.getItem().id) != null) {
                         if (!this.a(itemstack1, 0, 1, false)) {
                             return null;
                         }
    
     
    Don Redhorse likes this.
  13. Does that mean you can fix it? :)

    Edit: Sorry, that made it so easy even i could fix it ;)
     
  14. Offline

    mattmoss

    Currently, I do not have all the tools/libraries/configuration on my machine. If I did, I could do so. It would be pretty simple to do. All the setup is the pain in the ass part.

    If DR is around and can make the fix, which should be pretty simple, I would leave it to him to do, since I imagine he has this stuff setup already. As of his last post above, although things seem to be quiet, he does appear to be around. However, if he is no longer working on the project... well, I can get everything setup on my machine again and build it, though it's a low priority for me compared to my day job.
     
  15. Don Redhorse mattmoss
    I have compiled two versions of 2.11 with the fix, i call them 2.12, one with source and one without. But im not sure what rules say about just handing theese out.

    Edit: After reading the license it seems we are free to do pretty much what we want with it. So here are the links to the fixed files.

    http://www.nub.nu/DwarfForge_2.12.jar
    http://www.nub.nu/DwarfForge_2.12_SRC.jar

    They contain the base 2.11 code and the fix, nothing else. The plugin author (Don Redhorse) has nothing to do with them, they will be removed if he requests it. Use at your own risk.. etc etc.
     
    Don Redhorse likes this.
  16. Offline

    mattmoss

    You rock, Sorken.
     
  17. I use 2.2 with the fix myself. So technically i havent tested theese.. but let me know if they dont work.
     
  18. Offline

    cabowabo4000

    Wait Isnt Minecraft 1.3.1 out now? it updated for me yesterday ,so, why is everyone still making posts for 1.2.5 if bukkit hasnt updated yet and its ot 1.2.5?????
     
  19. Because we are crafty and use the developer builds of 1.3.1 :p
     
  20. Offline

    mattmoss

    I wouldn't know. :) I'm not running a server.

    The "you rock" is for doing something in short order. Rock on.
     
  21. Offline

    cabowabo4000

    Were Can i get this Dev Build for 1.3.1 :rolleyes:
     
  22. Offline

    Don Redhorse

    Hi Sorken, do you want to make a Pull Request on GitHub for it?

    Otherwise I will redo the stuff you did.
     
  23. I have no idea how to use github nor do i really know java. But i just changed like 2 lines plus version string. So you better update it :)
     
  24. Offline

    Don Redhorse

    Last edited by a moderator: May 22, 2016
  25. Offline

    Minecraftnewbie

    This is a great plugin and I love it, but when I exit the server and came back it had stopped what it was doing, and its rather annoying, idk if furnaces do this as well, or if its just your plugin but it sure would be great to leave a bunch of things to melt while being offline.
     
  26. I dont know about stopping because of server restart, but for it to work while you are offline or away from it, it needs to keep the chunk loaded, if it spans two chunks i guess it would need to keep both loaded. Keeping chunks loaded is a drain on memory and resources. Almost all plugins ive tried have had issues resulting from keeping chunks loaded. If you have many players with many dwarfforges, it could even become a major slowdown. Probably not worth the trouble.

    However, leaving and then coming back results in the furnaces resuming their work. Atleast for me. I use a modified older version though, i dunno if perhaps one of the newer features have changed behaviour.

    Don Redhorse
    A relatively easy-to-add feature struck me, as it is now you need to hit each furnace to toggle them, what about striking input chest to turn on all furnaces? To prevent toggling them it could be start only, or have the output chest work as a stop-all.

    The same code that is used to detect striking a furnace could probably be used on the chests, then check what furnaces are in the forge and set their state according to what chest the user is bonking on.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 22, 2016
  27. Don Redhorse
    Seems DF is causing a bucket dupe issue since it adds its own bucket in both DF and normal furnaces. This was added way back when minecraft didnt do this itself.

    Commenting out the following code in DFInventoryListener seemed to fix the dupe issue, but burn time looks dodgy. If you leave and let the chunk unload and then reload it seems like the flame shows max flame until it goes out. Another problem seems to be the bucket isnt moved from dwarfforges to chest at all times thus choking fuel supply and stalling the furnace.

    Code:
            if (event.getFuel().getType() == Material.LAVA_BUCKET) {
                final ItemStack bucket = new ItemStack(Material.BUCKET, 1);
     
                main.queueTask(new Runnable() {
                    public void run() {
                        ItemStack item = bucket;
     
                        if (forge != null) {    // It is a Dwarf Forge.
                            Block inputChest = forge.getInputChest();
                            Block outputChest = forge.getOutputChest();
     
                            // First try putting the bucket in the output chest.
                            if (item != null && outputChest != null) {
                                item = forge.addTo(item, outputChest, false);
                            }
     
                            // Next try putting the bucket in the input chest.
                            if (item != null && inputChest != null) {
                                item = forge.addTo(item, inputChest, false);
                            }
                        }
     
                        if (item != null) {
                            Inventory inv = ((Furnace) block.getState()).getInventory();
                            ItemStack curr = inv.getItem(Forge.FUEL_SLOT);
                            if (curr == null || curr.getType() == Material.AIR) {  // Is fuel slot empty?
                                // Yes, place it in the fuel slot.
                                inv.setItem(Forge.FUEL_SLOT, item);
                            } else {
                                // Not empty; no place left to put the bucket. Drop it to the ground.
                                block.getWorld().dropItemNaturally(block.getLocation(), item);
                            }
                        }
                    }
                });
            }
    
     
  28. Offline

    Don Redhorse

    I hope I fixed that already... only using bucket handling on dwarfforges... it may be wonky though.

    I never tried this myself and I don't know how to handle it... let me know if the new version works.
     
  29. Ok, compiled 2.14 and tested, the bucket moving works perfectly, but the furnace stops working. It smelts one piece and then that cooked item will stay in the result box (of the furnace) and nothing more gets added.

    Edit:
    Im using an older 2.2 version that ive forked (dunno why, it just seems easier to work with).

    This is how im thinking...
    Code:
            // If it was a lava bucket that was used, preserve an empty bucket
            if (event.getFuel().getType() == Material.LAVA_BUCKET) {
                final ItemStack bucket = new ItemStack(Material.BUCKET, 1);
                main.queueTask(new Runnable() {
                    public void run() {
                        ItemStack item = bucket;
     
                        if (forge != null) {    // Check for DF, normal furnace works so leave alone.
                            Block inputChest = forge.getInputChest();
                            Block outputChest = forge.getOutputChest();
     
                            // First try putting the bucket in the output chest.
                            if (item != null && outputChest != null) {
                                item = forge.addTo(item, outputChest, false);
                            }
     
                            // Next try putting the bucket in the input chest.
                            if (item != null && inputChest != null) {
                                item = forge.addTo(item, inputChest, false);
                            }
     
                            // *IF* we placed a bucket somewhere, remove from fuel slot.
                            // Otherwise do nothing and let it stall.
                            if (item == null) {
                               Inventory inv = ((Furnace) block.getState()).getInventory();
                               inv.setItem(Forge.FUEL_SLOT, new ItemStack(Material.AIR));
                            }
                        }
                    }
                });
            }
    
     

Share This Page