uecasm / colony4cc

MineColonies for ComputerCraft integration addon mod for Minecraft
GNU General Public License v3.0
7 stars 8 forks source link

Code can't find builder #1

Closed nickflik0934 closed 3 years ago

nickflik0934 commented 3 years ago

https://user-images.githubusercontent.com/39279513/110164671-fa02a600-7df1-11eb-9dea-10ba4f114613.png https://user-images.githubusercontent.com/39279513/110164820-333b1600-7df2-11eb-92de-fa9946ee8d9c.png

I am trying to get the required resources of the building that the builder is working on. But it returns "No Builder". I'm using minecolonies-0.13.670-ALPHA.

uecasm commented 3 years ago

Yeah, there've been a lot of changes to the MineColonies mod recently. Currently this mod should be considered compatible only up until version 655. I'll work on getting an update out for the newer versions.

uecasm commented 3 years ago

I've just released version 1.2.0, which supports 674 and up. Give that a go and see if it improves things.

nickflik0934 commented 3 years ago

I'll try, thank you :p

nickflik0934 commented 3 years ago

We are on 676, I'm not sure if that destroys the functionality again. I am still getting a string/nil value back "not builder" I am using the function: "colony.getBuilderResources(vector.new(1752, 68, -4211))" I get the colony peripheral with a wired modem. Not sure why it doesn't work but other than that, getting citizen data works and I'm happy with that. afbeelding afbeelding

uecasm commented 3 years ago

That's rather odd. When I call colony.getBuildings() in a test world, the output related to the builder is this:

  {
    citizens = {
      {
        name = "Janelle E. Guildford",
        id = 1,
      },
    },
    type = "builder",
    wip = false,
    storageBlocks = 5,
    maxLevel = 5,
    style = "fortress",
    name = "",
    guarded = true,
    built = true,
    storageSlots = 135,
    location = {
      y = 64,
      x = -324,
      z = 252,
    },
    level = 3,
    footprint = {
      corner2 = {
        y = 79,
        x = -320,
        z = 256,
      },
      rotation = 0,
      corner1 = {
        y = 63,
        x = -337,
        z = 247,
      },
      mirror = false,
    },
    priority = 1,
  },

And then when calling colony.getBuilderResources(vector.new(-324, 64, 252)) it returns either {} or a list of resources, depending on whether they're currently building or not. So that's working as far as I can tell. Can you think of something you're doing differently? Are you sure you're getting the x,y,z in the right order (note they don't always display in the right order, see above), and using the location of the builder and not one of the corner positions, and that the computer is in the same colony as the builder?

Otherwise, while it's a little more awkward to use this interface, you can get the same information by using getWorkOrders() to find the ids of currently in progress orders and then getWorkOrderResources(id) to get the same output as getBuilderResources.

5cript commented 3 years ago

I have the same issue with minecolonies-0.13.696-BETA-universal and Colony4ComputerCraft-1.16.4-1.2.0.jar. getBuilderResources() returns "not builder" as an error and getWorkOrderResources(correct_id) also returns the same error string. https://github.com/uecasm/colony4cc/blob/94df8f6836790f7aaa73f3cb644b3289fdf6ffa1/src/main/java/nz/co/mirality/colony4cc/peripheral/ColonyPeripheral.java#L290

5cript commented 3 years ago

I cannot reproduce it in creative singleplayer. It works well there. Only in multiplayer.

nickflik0934 commented 3 years ago

Perhaps this only gives an error in multiplayer, I'm not sure if the mod mine colonies behaves differently in multiplayer, but the problem may lay there. It could also be something along the lines of block protection on multiplayer servers?

Could you test this on your singleplayer lan server @5cript? See if it still works, it might do the same as on multiplayer.

5cript commented 3 years ago

Yes I can reproduce it in a completly freshly created multiplayer environment. So its definitely a multiplayer only issue.

uecasm commented 3 years ago

Ah, multiplayer, that explains much. I didn't really do much testing with multiplayer, so that one slipped through the cracks.

A new build 1.2.1 will be available shortly that should fix this.

5cript commented 3 years ago

Just want to confirm the fix from my end.