Jump to content

Recommended Posts

Posted

start with something like

public Class<? extends BowType.class> type;
public itemConstructor(int id, Class<? extends BowType.class> c){
super(i);
type = c;
}

;

 

then depending on if the class constructor needs parameters

public BowType bowInit(){
try{
//no parameters
return type.newInstance();
} catch(Exception e){
e.printStackTrace();
}
return null;
}

or

public BowType bowInit(){
try{
return type.getConstructor(Parameter1.class, Parameter2.class).newInstance(parameter1Object, parameter2Object);
} catch(Exception e){
e.printStackTrace();
}
return null;
}

  Quote
I think its my java of the variables.

Posted

I did what you said but it crashed on the onPlayerStoppedUsing method. Here's the code for the class file. And please ignore the badly named variables. I basically copied the ItemBow class.

 

  Reveal hidden contents

 

Posted

this is exactly what was in the error.

 

  Reveal hidden contents

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.