GithubHelp home page GithubHelp logo

Comments (11)

AEnterprise avatar AEnterprise commented on June 23, 2024

will somebody look intro it? i was unable to prevent it with a null check as it already errors when asking for the hardness

from forestrymc.

SandGrainOne avatar SandGrainOne commented on June 23, 2024

Could this be caused by the log taking damage from the tool and thus changing the damage value that is used to determine what type of log it is?

How is Meta values separated from damage on the block during mining? Is mining damage a value we can get in addition to meta/damage?

Edit:
nvm, nuub questions :)

from forestrymc.

SandGrainOne avatar SandGrainOne commented on June 23, 2024

All Forestry Wood have a Hardness. The issue here is that Forestry fails to identify the type of Wood because there is no given world object. The world variable is null.

I can't find any other reason for why this could fail like this.

This is one of those things I don't understand. How can the world variable be null? Is there a common cause?

Lastly I'd like to know if we should change the code to check for missing arguments. Should the code fail like now or should we return the default hardness.

from forestrymc.

AEnterprise avatar AEnterprise commented on June 23, 2024

in cases like this i think it is best to return the default hardness. If it heapens with my custom tools, i'm sure it heapens with others as well

from forestrymc.

mezz avatar mezz commented on June 23, 2024

Tried to reproduce, couldn't get the tool to break anything at all, even vanilla trees.
Tried spawning a kinetic multitool with NEI, added a sawblade with integration table, and gave it a filled kinetic capsule. Nothing...

latest forestry
Eureka 1.2
Buildcraft 6.0.18
Buildcraft-Additions 1.6.4

from forestrymc.

AEnterprise avatar AEnterprise commented on June 23, 2024

what do you mean could not get it to break anything? where you in creative?

from forestrymc.

mezz avatar mezz commented on June 23, 2024

Thanks, I was in creative because the tool would break from lack of knowledge in regular mode.
I was able to reproduce the crash now, we get a null world object. (confirmed)
We can't determine the type of wood without the world object.
I'll look more into it.

from forestrymc.

mezz avatar mezz commented on June 23, 2024

Your code has world=null, x=y=z=0 when getDigSpeed is called. It seems to expect ItemPoweredBase onBlockStartBreak to be called first (which sets the world and position), but that's not what happens.

player is also null in getDigSpeed, so you call readBateries(stack, player) with a null player, even before calling anything related to Forestry.

This is definitely a bug on your side.
One solution could be to move the energy check to onBlockStartBreak and return true if there's not enough energy.

I'll wait for your response before closing this in case I missed something again. I hope I was able to help.

from forestrymc.

AEnterprise avatar AEnterprise commented on June 23, 2024

my code indeed asumes that that function is called (as it should be called when you start breakings something) The odd thing is that all of this works for non-forestry wood (works fine with BoP as far as i know)

moving the energy check still won't solve it as the world and x,y, z values will still be incorrect (or null)

from forestrymc.

mezz avatar mezz commented on June 23, 2024

onBlockStartBreak is called after you've been hitting the block for a while, when it's full of cracks and about to break. getDigSpeed will always be called first.

Vanilla doesn't use the world, x, y, or z, it just returns a hardness value for that block. Forestry has different woods depending on the meta value so it needs that information to be valid in order to determine what kind of wood it is.

from forestrymc.

AEnterprise avatar AEnterprise commented on June 23, 2024

you where right, all fixed now, thanks
AEnterprise/Buildcraft-Additions@553b65a

from forestrymc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.