Jump to content

Making my Own Power [1.10.2]


NoVaGaming

Recommended Posts

Im kind of new to coding so im not that good at java like i can create custom blocks and items and jsons but thats where im limited. I dont know how to make my own power so if one of you lovley people could teach me or link me to somwhere without using an API it would be much appriciated

Are You Feeling it now Mr.Krabs?

 

GitHub

https://github.com/nuclearelectricity/Nuclear-Electricity

Link to comment
Share on other sites

Well, energy is simply an amount that goes up and down.

You'll need:

  • Storage: how much something can possibly have
  • I/O: How much can enter/leave a suitable storage
  • Generator: A way to get this energy
  • Transport: How to move this energy from point A to point B

 

I would recommend you create your "own API"; make Interfaces that handle each of these points separately (IEnergyStorage, IEnergyInput, IEnergyOutput etc), then create abstract classes that implement these classes, and then, finally create your proper classes, that extend the abstract class. It's a bit extra work, but leaves you with a clean workspace with easy-to-use classes.

Also previously known as eAndPi.

"Pi, is there a station coming up where we can board your train of thought?" -Kronnn

Published Mods: Underworld

Handy links: Vic_'s Forge events Own WIP Tutorials.

Link to comment
Share on other sites

Yea i just got so fing confused dude. I dont know much at all about java and i know your gonna say go learn but im trying to focus on modding are there any tutorials because i dont know how to code really well. I dont know most of the terms you just explaned

Are You Feeling it now Mr.Krabs?

 

GitHub

https://github.com/nuclearelectricity/Nuclear-Electricity

Link to comment
Share on other sites

I dont know most of the terms you just explaned

 

if you mean

  • Storage: how much something can possibly have
  • I/O: How much can enter/leave a suitable storage
  • Generator: A way to get this energy
  • Transport: How to move this energy from point A to point B

 

then that's not java-related but explaining what you might want to do.

Link to comment
Share on other sites

You don't have the Java knowledge necessary to even have someone help you with this.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

If somone just shows me the exect code i can just replicate it then learn it. I learn from people showing me

 

I would Google java tutorials, and learn how classes, inheritance, and interfaces work before trying to dive into complex minecraft modding. You seriously won't learn anything copying other people's code without knowledge of those things.

Link to comment
Share on other sites

This forum is not about providing drop-in copy-paste solutions. This forum should help people understand why they are having a problem and how to solve it and why X and Y solves it.

Then they do not have to ask next time.

If you do not agree with this mentality then yes by all means, please get off this forum.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

Dude im not learning anything if i go watch tutorials. I dont have time. i have school too you know?

 

Then honestly, you should probably forget it and focus on school. When you get older you might have a shot at learning how to write java/make mods.

 

*edit: And I didn't mean to WATCH tutorials. Video tutorials are kinda crap for writing code. You need a txt tutorial.

Link to comment
Share on other sites

Dude i got cofh api but now all i need to make is a generator and im stuck. So basicly its not java needed now i need to find out how to use it in blocks

 

write code, post it, along with errors, ask for help. No one is going to just write the code for you, especially when you don't know basic java terms like interfaces.

Link to comment
Share on other sites

Well theres no way im going to learn if there is no documentation

Dude i got cofh api but now all i need to make is a generator and im stuck. So basicly its not java needed now i need to find out how to use it in blocks

No documentation? Then what is this?

Or that?

Here, found a few more pieces: 1, 2, 3.

That's all random classes found in the... public GitHub repo. Don't come here and say there's no documentation. How would anyone have made anything using the CoFH API if there was no documentation?

Also previously known as eAndPi.

"Pi, is there a station coming up where we can board your train of thought?" -Kronnn

Published Mods: Underworld

Handy links: Vic_'s Forge events Own WIP Tutorials.

Link to comment
Share on other sites

A class can extend a single other class. It can also implement several other Interfaces.

An Interface is very similar to a regular class, in some points:

  • An interface can contain any number of methods.
  • An interface is written in a file with a .java extension, with the name of the interface matching the name of the file.
  • The byte code of an interface appears in a .class file.
  • Interfaces appear in packages, and their corresponding bytecode file must be in a directory structure that matches the package name.

However, the key differences are:

  • You cannot instantiate an interface.
  • An interface does not contain any constructors.
  • All of the methods in an interface are abstract.
  • An interface cannot contain instance fields. The only fields that can appear in an interface must be declared both static and final.
  • An interface is not extended by a class; it is implemented by a class.
  • An interface can extend multiple interfaces.

 

To describe what an Interface is, in layman's terms: An interface provide methods that has to exist in whatever class implements it. If class MyCustomClass implements ICustomInterface, which has a method called myCustomMethod, then MyCustomClass must have a method in it with the same name, and same variables. However, that is all. An interface cannot be used to do anything, only make sure that the methods that actually do the stuff, exists in the class.

Interfaces create methods without any body. Just name & variables, like this:

static boolean hasEnergy(int energy);

It is up to the one creating the class to actually make the hasEnergy method return anything.

Also previously known as eAndPi.

"Pi, is there a station coming up where we can board your train of thought?" -Kronnn

Published Mods: Underworld

Handy links: Vic_'s Forge events Own WIP Tutorials.

Link to comment
Share on other sites

An interface cannot contain instance fields. The only fields that can appear in an interface must be declared both static and final.

 

In C# you can, but really all that means is that the interface is declaring an explicit getter/setter.  I know this because I did it not to long ago.

 

e.g.

public interface ISomeThing {
    public someField {
        get; set;
    }
}

 

But yes, you can't do that in Java.  You'd have to declare it as a

getField()

and

setField(v)

methods and supply the field itself in the implementation.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

Yea so with CoFH Core How do i add those methods to my block

public class MyCustomClass extends SomeClass implements ICustomInterface, IOtherCustomInterface

 

 

Also previously known as eAndPi.

"Pi, is there a station coming up where we can board your train of thought?" -Kronnn

Published Mods: Underworld

Handy links: Vic_'s Forge events Own WIP Tutorials.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Akun Pro Kamboja adalah pilihan terbaik bagi Anda yang mencari pengalaman bermain slot Maxwin dengan transaksi mudah menggunakan Bank Lampung. Berikut adalah beberapa alasan mengapa Anda harus memilih Akun Pro Kamboja: Slot Maxwin Terbaik Kami menyajikan koleksi slot Maxwin terbaik yang menawarkan kesenangan bermain dan peluang kemenangan besar. Dengan fitur-fitur unggulan dan tema-tema menarik, setiap putaran permainan akan memberikan Anda pengalaman yang tak terlupakan. Transaksi Mudah dengan Bank Lampung Kami menyediakan layanan transaksi mudah melalui Bank Lampung untuk kenyamanan dan keamanan Anda. Dengan proses yang cepat dan efisien, Anda dapat melakukan deposit dan penarikan dana dengan lancar dan tanpa hambatan. Anti Rungkat Akun Pro Kamboja memberikan jaminan "anti rungkat" kepada para pemainnya. Dengan fitur ini, Anda dapat merasakan sensasi bermain dengan percaya diri, karena kami memastikan pengalaman bermain yang adil dan menyenangkan bagi semua pemain.  
    • BINGO188: Destinasi Terbaik untuk Pengalaman Slot yang Terjamin Selamat datang di BINGO188, tempat terbaik bagi para pecinta slot yang mencari pengalaman bermain yang terjamin dan penuh kemenangan. Di sini, kami menawarkan fitur unggulan yang dirancang untuk memastikan kepuasan dan keamanan Anda. Situs Slot Garansi Kekalahan 100 Kami memahami bahwa kadang-kadang kekalahan adalah bagian dari permainan. Namun, di BINGO188, kami memberikan jaminan keamanan dengan fitur garansi kekalahan 100. Jika Anda mengalami kekalahan, kami akan mengembalikan saldo Anda secara penuh. Kemenangan atau uang kembali, kami memastikan Anda tetap merasa aman dan nyaman. Bebas IP Tanpa TO Nikmati kebebasan bermain tanpa batasan IP dan tanpa harus khawatir tentang TO (Turn Over) di BINGO188. Fokuslah pada permainan Anda dan rasakan sensasi kemenangan tanpa hambatan. Server Thailand Paling Gacor Hari Ini Bergabunglah dengan server terbaik di Thailand hanya di BINGO188! Dengan tingkat kemenangan yang tinggi dan pengalaman bermain yang lancar, server kami dijamin akan memberikan Anda pengalaman slot yang tak tertandingi. Kesimpulan BINGO188 adalah pilihan terbaik bagi Anda yang menginginkan pengalaman bermain slot yang terjamin dan penuh kemenangan. Dengan fitur situs slot garansi kekalahan 100, bebas IP tanpa TO, dan server Thailand paling gacor hari ini, kami siap memberikan Anda pengalaman bermain yang aman, nyaman, dan menguntungkan. Bergabunglah sekarang dan mulailah petualangan slot Anda di BINGO188!
    • Mengapa Memilih AlibabaSlot? AlibabaSlot adalah pilihan terbaik bagi Anda yang mencari slot gacor dari Pgsoft dengan transaksi mudah menggunakan Bank Panin. Berikut adalah beberapa alasan mengapa Anda harus memilih AlibabaSlot: Slot Gacor dari Pgsoft Kami menyajikan koleksi slot gacor terbaik dari Pgsoft. Dengan fitur-fitur unggulan dan peluang kemenangan yang tinggi, setiap putaran permainan akan memberikan Anda kesenangan dan keuntungan yang maksimal. Transaksi Mudah dengan Bank Panin Kami menyediakan layanan transaksi mudah melalui Bank Panin untuk kenyamanan dan keamanan Anda. Dengan proses yang cepat dan efisien, Anda dapat melakukan deposit dan penarikan dana dengan lancar dan tanpa masalah.  
    • Delete the jei-server.toml file in your config folder and test it again
    • java.util.ConcurrentModificationException at java.base/java.util.HashMap.computeIfAbsent(Unknown Source) at Genesis//com.moonsworth.lunar. ... Looks like an issue with the Launcher - Make a test with another Launcher like MultiMC, AT Launcher or Technic Launcher or try the original one
  • Topics

×
×
  • Create New...

Important Information

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