-
Notifications
You must be signed in to change notification settings - Fork 32
ClickCrystals Development
Hate how the in-game GUI looks? Did you know that you can actually change the textures with a resource pack? To start off, all ClickCrystals assets can be found here.
The link above will take you to all the default textures on ClickCrystal's Github. In the repository, you can find all the texture assets that ClickCrystals uses, feel free to download them and edit them!
Do you want some examples of how other resource packs for ClickCrystals? Visit ClickCrystalsPlus Pack on Modrinth
Just like how you would create a normal texture pack, follow the steps below:
- Create a folder with the name of your texture
MyPack - Inside of the folder create a new file named "pack.mcmeta"
MyPack/pack.mcmeta - In the same folder, create a new folder named "assets"
MyPack/assets/ - Then in that assets folder create another folder inside of it
MyPack/assets/clickcrystals/ - Go to the link provided above and download contents from its clickcrystals folder to the one that you just created
https://github.com/ItziSpyder/ClickCrystals/tree/main/src/main/resources/assets/clickcrystals->MyPack/assets/clickcrystals - Start editing the textures and get creative!
Hating the lack of features, or wanting new modules? Guess what? You can fork this repository and make your own versions of ClickCrystals! (DISCLAIMER: DO NOT MARKET AS OWN WITHOUT GIVING US CREDIT!)
To set up your environment for making your own version of ClickCrystals:
- Clone this repository or Github. (It does not matter if you make it public or private.)
- Make sure you have your IDE ready
- You would also want to make sure Git Desktop is downloaded to your computer
- In your IDE projects folder, open up the command prompt and type in
git clone <your cloned repository link> - Load up the project in your IDE and get creative!
Modules can be created by creating a Java class under the modules.modules package. It is best to note that creating a Module Java file directly under the modules can result in a structure looking rather unorganized. Your new Java class should extend the io.github.itzispyder.clickcrystals.modules.Module class.
public class Foo extends Module {
}It is also important to implement the abstract methods from the Module class you extended from.
public class Foo extends Module {
@Override
public void onEnable() {
}
@Override
public void onDisable() {
}
}If your new module is going to be firing events, it is important to implement the io.github.itzispyder.clickcrystals.events.Listener interface After implementing the Listener interface, you would want to include a way to register this interface. In this case, we'll register the listener on enable and unregister on disable. The field system comes from the interface io.github.itzispyder.clickcrystals.Global that the Module class implements.
Any events will be fired with a method annotated by @io.github.itzispyder.clickcrystals.EventHandler. This is important, as the event bus wont pass on any methods without this annotation!
public class Foo extends Module {
@Override
public void onEnable() {
system.addListener(this);
}
@Override
public void onDisable() {
system.removeListener(this);
}
@EventHandler // event annotation
private void foo(/*Target Event*/) {
// do something
}
}While creating your module, there are a few helper util classes that you may want to know about. The utils can be found under the package io.github.itzispyder.clickcrystals.util These include:
-
HotbarUtilswhich swaps to items in hotbar, or getting in-hand items. -
InvUtilsor inventory utils, sends inventory packets like swapping to offhand or clicking on items, or even dropping items. -
PlayerUtilswhich include helper methods for the MinecraftClient's player -
BlockUtilsfor managing or checking blocks and interactions -
InteractionUtilsfor similating or managing in-game interactions - etc.
All event listeners need to implement the io.github.itzispyder.clickcrystals.events.Listener interface in order be able to be registered. It is important to also implement the io.github.itzispyder.clickcrystals.Global if you want to register the event in the same class. If not, the system field would not be accessible and you'd have to call ClickCrystalsSystem.getInstance(). Once you have a way to register the event, make sure that method gets called!
All events passed would have methods it can call. These methods would take in the type of event as a target parameter, and are always annotated with the annotation io.github.itzispyder.clickcrystals.events.EventHandler.
public class TestListener implements Listener, Global {
public static void init() { // call this somewhere!
system.addListener(new TestListener());
}
@EventHandler
private void foo(ClientTickStartEvent e) {
// before the start of every tick
}
@EventHandler
private void foo(ClientTickEndEvent e) {
// after every tick
}
@EventHandler
private void foo(/*Some event*/) {
// do something
}
}// without Global interface
public class TestListener implements Listener {
public static void init() { // call this somewhere!
ClickCrystalsSystem.getInstance().eventbus.subscribe(new TestListener());
}
@EventHandler
private void foo(/*Some event*/) {
// do something
}
}Firing the event is fairly simple. Call the pass method from system event bus with an instance of io.github.itzispyder.clickcrystals.events.Event.
ClickCrystalsSystem.getInstance().eventbus.pass(/*Some event*/);
ClickCrystalsSystem.getInstance().eventbus.pass(new ClientTickEvent());Events can be fired with a CallbackInfo from Mixins! This will automatically cancel the callback info if the event is canceled.
ClickCrystalsSystem.getInstance().eventbus.passWithCallbackInfo(CallbackInfo#, /*Some event*/);