Chop Golems and Axe of Stream Incompatibility

Chop Golems and Axe of Stream Incompatibility
0

Golems with this core just simply ignore all GregTech trees, making sweet infinite willow source impossible, at least with golems.

3 Likes

Wait how does Thaumcraft do Forestry Trees and such then?! I need to take a look at that.

2 Likes

The golem AI uses the Util.isWoodLog function to determine if it can chop it, that function is:

   public static boolean isWoodLog(IBlockAccess world, int x, int y, int z) {
      Block bi = world.getBlock(x, y, z);
      int md = world.getBlockMetadata(x, y, z);
      return bi == Blocks.air?false:(bi.canSustainLeaves(world, x, y, z)?true:ItemElementalAxe.oreDictLogs.contains(Arrays.asList(new Object[]{bi, Integer.valueOf(md)})));
   }

So if the block.canSustainLeaves is true then it can, else if the ItemElementalAxe.oreDictLogs contains the block and metadata (which is a public static field that you can add your own things to) then it can as well.

2 Likes

It says oreDictLogs as name of the List, why doesn’t it accept my Logs then?

2 Likes

Good question, it’s only filled in TC by:

                        if(ore.equals("woodLog")) {
                           for(ItemStack is : OreDictionary.getOres(ore)) {
                              ItemElementalAxe.oreDictLogs.add(Arrays.asList(new Integer[]{Integer.valueOf(Item.getIdFromItem(is.getItem())), Integer.valueOf(is.getItemDamage())}));
                           }
                       }

So if your wood is oredict’d as woodLog then it should work too?
Although if your wood returns true for block.canSustainLeaves then it should work as well.

2 Likes

What the actual fuck. The OreDict for Logs is “logWood” not “woodLog”

2 Likes

It’s TC, what do you expect? :wink:

But still, does your wood not return true for the block.canSustainLeaves call?

2 Likes

No it does not because then it could sustain Birch Leaves or Oak Leaves or some stupid garbage like that. The Trees are only supposed to sustain Leaves of their own Species damnit.

2 Likes

Sadly that’s not how most mods assume that, any log should be able to support any leaf. I’ve experienced that annoyance myself in the past too.

EDIT: Technically that’s how vanilla works as well, any log can support any leaf. I think the function was supposed to be called isLog or something in the actual MC source based on how it’s used in vanilla (being called canSustainLeaves seems to be an MCP’ism)…

2 Likes

yes isWood does exist too, Thaumcraft doesn’t use that obvious Function.

Anyways I’m gonna add the woodLog garbage to the System, probably through Automatic Re-Registration so all Logs from all Mods will be compatible that way, like Azanor obviously intended but failed to do.

2 Likes

Hmm, just looked over the source, the isWood function is also improperly named by MCP it seems, in vanilla it doesn’t have anything to do with wood, looks like it’s supposed to be an early out for replaceability testing, the actual wood check for that is yet a different function (no MCP name for it: func_150523_a, which checks if something is a generic ‘plant’ it seems). So that one seems wrong too from the looks of it (not that it keeps mods from using it from the looks of it, binnies bees, forestry, and BoP seem to, but not seeing anything else in my setup here that uses it)…

Sounds like the most compatible way, and would fix other mods wood’s that use logWood and not woodLog too. ^.^

2 Likes

I just noticed, because many Mods register Logs with Wildcard Meta, I need to actually add a special case for that…

2 Likes

Ooo, yeah thaumcraft’s thing will not work a wildcard, so if you add all 16 variants of wildcards that would work it seems as he actually tests it like ItemElementalAxe.oreDictLogs.contains(Arrays.asList(new Object[]{bi, Integer.valueOf(md)})) and oreDictLogs is an ArrayList, so it won’t work for wildcard things either it looks like. Thaumcrafts handling of this is pretty exceptionally broken… :-/

1 Like

Since both of you are here, can Thaumcraft Golems place GT6 Saplings?

2 Likes

Yeah, and can autoclick sifters too xD

2 Likes

Good to know that Sifting Tables work too even after my change to make them more AFK-able.

2 Likes

Anyways, the fix is up on the Secret Test Download Page now. There should not be any breaking changes at all in that Version, aside from Golems actually being able to break Wood now.

2 Likes

Well, golem still ignore the trees :\

2 Likes

Wait what? I dont know if you can look at it in NEI, but are the Logs registered as woodLog in it? Might be an NEI Plugin I have but considering I have one Plugin yet there is two ways, maybe Vanilla NEI can show.

2 Likes

It says - gregtech:gt.block.log.a
If that is what you’re asking
Also, blue mahoe is of the same class, and is too not being cut down by golem.
gt.block.log.b objects (like cinammon) have the same issue

2 Likes