Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private final <T extends TileEntity> Class<T> tileEntityClass;
- public <T extends TileEntity> MyClass(Class<T> tileEntityClass) {
- this.tileEntityClass = tileEntityClass;
- }
- // My function got creating a new instance of the TileEntity.
- public <T extends TileEntity> T getTileEntity() {
- return tileEntityClass.newInstance();
- } catch(Exception e) {
- e.printStackTrace();
- }
- return null;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement