1

Events bug.

glowdemon1 5/12/13 3:32 pm
251
5/13/2013 8:40 pm
I tried to make my hoe till a 3x3 area around a player so I added a simple override to my hoe's class, however the syntax of "if (event.getResult() == Result.ALLOW)" was underlined at ALLOW, I tried to import events manualy but that did not help, I already looked into the original hoe class but that did not work out for me either, I do get a crash when I try to use the hoe, however this crash report will not say alot, if you want the hoe's class, tell me, I don't like throwing my codes around everywhere, thanks alot.

Edit : Error reads : ALLOW cannot be resolved or is not a field.
Posted by
glowdemon1
Level 23 : Expert Miner
0

  Have something to say?

JoinSign in

3

IAmChosen
05/13/2013 8:40 pm
Level 36 : Artisan Modder
glowdemon1
IAmChosen
glowdemon1I tried to make my hoe till a 3x3 area around a player so I added a simple override to my hoe's class, however the syntax of "if (event.getResult() == Result.ALLOW)" was underlined at ALLOW, I tried to import events manualy but that did not help, I already looked into the original hoe class but that did not work out for me either, I do get a crash when I try to use the hoe, however this crash report will not say alot, if you want the hoe's class, tell me, I don't like throwing my codes around everywhere, thanks alot.

Edit : Error reads : ALLOW cannot be resolved or is not a field.

I haven't heard of a Result class in forge or minecraft, but in the case it does exist, anything called from the class itself and not an object must be static. ex:


Class class = new Class();
class.method();//Non-static, called in instance

Class.staticMethod();//Static, called from class itself


There is an events class in forge however it does seem to work properly when used in other Classes, it just does not work in my override :/

I know about the events class, I think the problem lies in whatever Result is.
1
glowdemon1
05/13/2013 12:01 pm
Level 23 : Expert Miner
IAmChosen
glowdemon1I tried to make my hoe till a 3x3 area around a player so I added a simple override to my hoe's class, however the syntax of "if (event.getResult() == Result.ALLOW)" was underlined at ALLOW, I tried to import events manualy but that did not help, I already looked into the original hoe class but that did not work out for me either, I do get a crash when I try to use the hoe, however this crash report will not say alot, if you want the hoe's class, tell me, I don't like throwing my codes around everywhere, thanks alot.

Edit : Error reads : ALLOW cannot be resolved or is not a field.

I haven't heard of a Result class in forge or minecraft, but in the case it does exist, anything called from the class itself and not an object must be static. ex:


Class class = new Class();
class.method();//Non-static, called in instance

Class.staticMethod();//Static, called from class itself


There is an events class in forge however it does seem to work properly when used in other Classes, it just does not work in my override :/
1
IAmChosen
05/13/2013 1:19 am
Level 36 : Artisan Modder
glowdemon1I tried to make my hoe till a 3x3 area around a player so I added a simple override to my hoe's class, however the syntax of "if (event.getResult() == Result.ALLOW)" was underlined at ALLOW, I tried to import events manualy but that did not help, I already looked into the original hoe class but that did not work out for me either, I do get a crash when I try to use the hoe, however this crash report will not say alot, if you want the hoe's class, tell me, I don't like throwing my codes around everywhere, thanks alot.

Edit : Error reads : ALLOW cannot be resolved or is not a field.

I haven't heard of a Result class in forge or minecraft, but in the case it does exist, anything called from the class itself and not an object must be static. ex:


Class class = new Class();
class.method();//Non-static, called in instance

Class.staticMethod();//Static, called from class itself
1

Welcome