Advertisement
Guest User

Untitled

a guest
Jul 9th, 2015
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. private final Class<? extends TileEntityMachine> tileEntityClass;
  2.  
  3. public MyClass(Class<? extends TileEntityMachine> tileEntityClass) {
  4. this.tileEntityClass = tileEntityClass;
  5. }
  6.  
  7. // My function got creating a new instance of the TileEntity.
  8. public Class<? extends TileEntity> getTileEntity() {
  9. return tileEntityClass.newInstance();
  10. } catch(Exception e) {
  11. e.printStackTrace();
  12. }
  13.  
  14. return null;
  15. }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement