Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redstone recipe #357

Closed
stijn04356789 opened this issue Aug 16, 2016 · 15 comments
Closed

Redstone recipe #357

stijn04356789 opened this issue Aug 16, 2016 · 15 comments

Comments

@stijn04356789
Copy link

With the new update players are no longer able to make red stone in multiplayer however they can in SP

@krakel
Copy link

krakel commented Aug 16, 2016

The recipe for redstone and other was removed to a directory disabled.
d42a868

scripts\AAA_vars_and_oreDicts\AA_vars.zs (1 hit)
    Line 182: global redstone = <minecraft:redstone_block>;
scripts\disabled\bloodmagic.zs (1 hit)
    Line 82: mods.bloodmagic.Altar.addRecipe(<AWWayofTime:weakBloodOrb>,<minecraft:redstone_block>, 1,10000,5,5);
scripts\disabled\vanilla.zs (1 hit)
    Line 9: recipes.addShapeless(<minecraft:redstone_block>, [<minecraft:lava_bucket>, <ore:sand>]);

@tyler489
Copy link
Contributor

thats the old scripts

@krakel
Copy link

krakel commented Aug 16, 2016

Now I understand the problem. They would order all recipes and expact ModTweaker load all scrips at alphabetical order. But the mod did not do this, I think. A long time ago I intended a change on the old MineTweaker (simple Arrays.sort(files); ). ModTweaker got the same problem.

  scripts\AAA_vars_and_oreDicts\AA_vars.zs (2 hits)
    Line 182: global redstone = <minecraft:redstone_block>;
    Line 660: global redstoneDust = <minecraft:redstone>;
  scripts\BloodMagic\Alchemy.zs (2 hits)
    Line 70: addRecipe(brewRaising*3, [woolBat,oilVitiol,mutandis,<minecraft:bone>,<minecraft:redstone>], 3,5000);
    Line 90: addRecipe(soupRedstone*1, [tongueDog,luckDrop,mandrakeRoot,woolBat,<minecraft:redstone>], 3,5000);
  scripts\BloodMagic\Altar.zs (1 hit)
    Line 39: addRecipe(orbWeak,redstone, 1,10000,5,5);
  scripts\Botania\altar.zs (1 hit)
    Line 5: addRecipe(orechid, [leadIngot, diagem, emeraldgem, aluIngot, nickelIngot, minicioEssence, amberGem, silverIngot, tinIngot, quicksilver, copperIngot, chargedCertus, shardBalanced, goldIngot, ironIngot, redstone], 50000);
  scripts\disabled\witchery.zs (2 hits)
    Line 31: mods.bloodmagic.Alchemy.addRecipe(<witchery:ingredient:65>*3, [<witchery:ingredient:24>,<witchery:ingredient:30>,<witchery:ingredient:14>,<minecraft:bone>,<minecraft:redstone>], 3,5000);
    Line 51: mods.bloodmagic.Alchemy.addRecipe(<witchery:ingredient:40>*1, [<witchery:ingredient:25>,<witchery:ingredient:39>,<witchery:ingredient:22>,<witchery:ingredient:24>,<minecraft:redstone>], 3,5000);
  scripts\Vanilla\CraftingShaped.zs (8 hits)
    Line 11: recipes.addShaped(bloodDynamo, [[redstone, redstone, redstone], [redstone, altar, redstone], [redstone, redstone, redstone]]);
    Line 11: recipes.addShaped(bloodDynamo, [[redstone, redstone, redstone], [redstone, altar, redstone], [redstone, redstone, redstone]]);
    Line 11: recipes.addShaped(bloodDynamo, [[redstone, redstone, redstone], [redstone, altar, redstone], [redstone, redstone, redstone]]);
    Line 11: recipes.addShaped(bloodDynamo, [[redstone, redstone, redstone], [redstone, altar, redstone], [redstone, redstone, redstone]]);
    Line 11: recipes.addShaped(bloodDynamo, [[redstone, redstone, redstone], [redstone, altar, redstone], [redstone, redstone, redstone]]);
    Line 11: recipes.addShaped(bloodDynamo, [[redstone, redstone, redstone], [redstone, altar, redstone], [redstone, redstone, redstone]]);
    Line 11: recipes.addShaped(bloodDynamo, [[redstone, redstone, redstone], [redstone, altar, redstone], [redstone, redstone, redstone]]);
    Line 11: recipes.addShaped(bloodDynamo, [[redstone, redstone, redstone], [redstone, altar, redstone], [redstone, redstone, redstone]]);
  scripts\Vanilla\CraftingShapeless.zs (1 hit)
    Line 8: recipes.addShapeless(redstone, [lavabuck, sandOredict]);

The recipe exists (last line), but the AAA_vars_and_oreDicts was not loaded befor Vanilla.

@tyler489
Copy link
Contributor

A we are using crafttweeker
B every thing else in vanilla shapeless loaded

@krakel
Copy link

krakel commented Aug 17, 2016

Oh wunderfull, CraftTweaker is a fork of MineTweaker3. For MineTweaker3 I was asking for the directory sorting: stanhebben/MineTweaker3#270 . Wenn I inspect on CraftTweaker the file minetweaker/runtime/providers/ScriptProviderDirectory.java i found the same missing handling for sorting the directory.

public Iterator<IScriptIterator> getScripts() {
        List<IScriptIterator> scripts = new ArrayList<IScriptIterator>();
        if (directory.exists()) {
// <--- missing Array sorting
            for (File file : directory.listFiles()) {
                if (file.isDirectory()) {
                    scripts.add(new ScriptIteratorDirectory(file));
                } else if (file.getName().endsWith(".zs")) {
                    scripts.add(new ScriptIteratorSingle(file));
                } else if (file.getName().endsWith(".zip")) {
                    try {
                        scripts.add(new ScriptIteratorZip(file));
                    } catch (IOException ex) {
                        MineTweakerAPI.logError("Could not load " + file.getName() + ": " + ex.getMessage());
                    }
                }
            }
        }
        return scripts.iterator();
    }

@johnfg2610
Copy link
Contributor

were not actuly using normal craft tweaker were using a fork of craft tweaker

@kindlich
Copy link
Contributor

Okay, before barking about how the directories aren't working porperly (which they obviously are!)
let's take another look at our CT version, will we?

Like John just commented, we're using a custom Version of CT (Hence the name 'custom' that was added a few days ago), that supports folders and global variables while keeping all of the other MT features!
It was originally designed by techlone, who has discontinued it without making a PR to jareDll, so we combined them both on a local repo and assembled it.
That way we can both test it and ensure it's working so the PR can go without too many isssues!

And about the 'disabled' folder:
Techlone specifically declared folders named 'disabled' to be ignored, and if you read my commit notice on that commit, you'd understood that those were the old script files that were there before I rewrote everything, I just kept them in case something major was to mess up....

Those files are technically not there!

In case you want to take a closer look at our version, on my repo is one that is almost the same as the one we're using (our Version just has "customized" in the mcmod.info files):
https://github.com/kindlich/CraftTweaker

@krakel
Copy link

krakel commented Aug 17, 2016

I want only help!
Ok, I inspect the source at kindlich Github. He used a modified version of MineTweaker, especially the minetweaker/runtime/providers/ path. But there are the same sorting problem. Windows sort the file on a directory and the java function directory.listFiles() produce a alphabetical sorted list of all files. But I think Linux don't do it. So all SP on Windows works well and some MP with a Linux Server not. Always sort the file list is the best choice.

My recommendation for the minetweaker/runtime/providers/ScriptIteratorDirectory.java

    private static void iterate(File directory, List<File> contentsList) {
        File[] files = directory.listFiles();
        if (files == null) return;
        java.util.Arrays.sort(files); // <-- sorting based on Comparable natural ordering
        for (File file : files) {
            if (file.isDirectory() && !file.getName().equals("disabled")) {
                iterate(file, contentsList);
            } else if (file.isFile() && file.getName().endsWith(".zs")) {
                contentsList.add(file);
            }
        }
    }

@kindlich
Copy link
Contributor

Ok, first of all:
Are we still talking about the Redstone Recipe missing?!?
Because if we are, we have a temporary workaround:
Connect to the Server, then Disconnect and the next time you connect all recipes are shown correctly until you restart your client.

@kindlich
Copy link
Contributor

However, since we do have some Problems with linux Servers atm I'm setting up a VM with ubuntu to test some stuff, then I'll tell ya the loading order.

@krakel
Copy link

krakel commented Aug 17, 2016

We discuss about the redstone. Thanks for the workaround.

A last word on the order of files on directory.listFiles().
From the https://docs.oracle.com/javase/8/docs/api/java/io/File.html

section listFiles

There is no guarantee that the name strings in the resulting array will appear in any specific order; they are not, in particular, guaranteed to appear in alphabetical order.

@kindlich
Copy link
Contributor

@krakel
Even though your comment about the sorting had nothing to do with this problem here, it helped with some other problems the linux mym-server had!

Gonna add that to mym soon, thx 👍

@krakel
Copy link

krakel commented Aug 17, 2016

@kindlich
Yes, on my test I saw only the redstone recipes was broken.
Sorry for the not matched discussion. In german: manchmal gehen die Pferde mit einem durch!
I love this pack and have no problem to restart the game, but the errors should be reduced over the time.
And sorry for my horrible english. :)

@kindlich
Copy link
Contributor

Made a new issue for the Synching problem:
#359

@johnfg2610
Copy link
Contributor

should be fixed i belive

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants