generated from FabricMC/fabric-example-mod
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use Lodestone instead of custom loader
- Loading branch information
Showing
17 changed files
with
121 additions
and
274 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,17 @@ | ||
package dev.jaxydog; | ||
|
||
import dev.jaxydog.utility.register.AutoRegisterImpl; | ||
import dev.jaxydog.lodestone.Lodestone; | ||
import dev.jaxydog.lodestone.api.ClientLoaded; | ||
import net.fabricmc.api.ClientModInitializer; | ||
|
||
public class CheeseClient implements ClientModInitializer { | ||
|
||
@Override | ||
public void onInitializeClient() { | ||
AutoRegisterImpl.runClient(); | ||
Cheese.BLOCKS.register(ClientLoaded.class); | ||
Cheese.ITEMS.register(ClientLoaded.class); | ||
|
||
Lodestone.load(ClientLoaded.class, Cheese.MOD_ID); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,29 @@ | ||
package dev.jaxydog.content.block; | ||
|
||
import dev.jaxydog.utility.register.Registerable; | ||
import dev.jaxydog.Cheese; | ||
import dev.jaxydog.lodestone.api.CommonLoaded; | ||
import net.minecraft.block.Block; | ||
import net.minecraft.registry.Registries; | ||
import net.minecraft.registry.Registry; | ||
import net.minecraft.util.Identifier; | ||
|
||
public class CustomBlock extends Block implements Registerable.Main { | ||
public class CustomBlock extends Block implements CommonLoaded { | ||
|
||
private final String RAW_ID; | ||
private final String path; | ||
|
||
public CustomBlock(String rawId, Settings settings) { | ||
public CustomBlock(String path, Settings settings) { | ||
super(settings); | ||
this.RAW_ID = rawId; | ||
this.path = path; | ||
} | ||
|
||
@Override | ||
public String getRawId() { | ||
return this.RAW_ID; | ||
public Identifier getLoaderId() { | ||
return Cheese.newId(this.path); | ||
} | ||
|
||
@Override | ||
public void registerMain() { | ||
Main.super.registerMain(); | ||
Registry.register(Registries.BLOCK, this.getId(), this); | ||
public void loadCommon() { | ||
Registry.register(Registries.BLOCK, this.getLoaderId(), this); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.