Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
46c6f8a
Begun work on custom registry builder
Dan6335 May 13, 2025
d168555
Solved the hardcoded modid issue
Dan6335 May 13, 2025
5fc148b
Tweaked the modid getter
Dan6335 May 13, 2025
127f6cf
Made some tweaks
Dan6335 May 13, 2025
b911710
Fixed the comment
Dan6335 May 13, 2025
7d7d50b
Optimized imports
Dan6335 May 13, 2025
cdc6410
Tweaked this
Dan6335 May 13, 2025
1ca3676
Made all builders get modId from RegistryBuilder.getModID
Dan6335 May 13, 2025
c94158d
Added block entity registries
Dan6335 May 26, 2025
3a8f07b
Merge branch '1.21-1.21.3' of https://github.com/MeAlam1/BlueLib into…
Dan6335 May 26, 2025
abbfca6
Fixed the accesstransformer-nf.cfg and bluelib.accesswidener
Dan6335 May 26, 2025
2b9f15f
Forgot this
Dan6335 May 26, 2025
da0e9b8
Moved neoforge entity renderer to neo registry helper
Dan6335 May 26, 2025
2049ea7
My latest menu registry work
Dan6335 May 29, 2025
df0f70d
Fixed fabric creative tab error
Dan6335 May 30, 2025
78f9b1a
Started work on recipe gen and fixed errors found in ToV
Dan6335 Jun 9, 2025
43d48e4
Merge branch '1.21-1.21.3' of https://github.com/MeAlam1/BlueLib into…
Dan6335 Jun 10, 2025
a5cba1b
Fixed recipe gen
Dan6335 Jun 10, 2025
206bce7
Fixed recipe gen not generating correct recipes
Dan6335 Jun 10, 2025
26fae97
Added the smithing recipes
Dan6335 Jun 10, 2025
e846338
Added fabric recipe gen and removing smithing trip for now
Dan6335 Jun 11, 2025
26b7dbb
Fixed LivingEntity Builder
MeAlam1 Jun 16, 2025
f91fcc0
Added the ability to create ores using .ore()
Dan6335 Aug 5, 2025
4afbd8e
Merge remote-tracking branch 'origin/custom-registry' into custom-reg…
Dan6335 Aug 5, 2025
7f0c7eb
Added the ability to create wood blocks using .wood()
Dan6335 Aug 5, 2025
1f427e5
Merge branch '1.21-1.21.3' of https://github.com/MeAlam1/BlueLib into…
Dan6335 Aug 6, 2025
c1f8718
Fixed registry error
Dan6335 Aug 6, 2025
d6947aa
Spotless
Dan6335 Aug 6, 2025
5977f70
Removed duplicate accesstransformer.cfg
Dan6335 Aug 6, 2025
ab5079b
Started working on Nuking Statics, Dan will finish it
MeAlam1 Aug 7, 2025
d065865
Removed static methods from all registry builders
Dan6335 Aug 7, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions common/src/main/java/software/bluelib/BlueLibCommon.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,38 @@

import static software.bluelib.BlueLibConstants.SCHEDULER;

import java.nio.file.Path;
import java.util.concurrent.TimeUnit;
import net.minecraft.network.chat.Component;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;
import org.spongepowered.asm.launch.MixinBootstrap;
import software.bluelib.api.event.mod.ModIntegration;
import software.bluelib.api.net.NetworkRegistry;
import software.bluelib.api.registry.AbstractRegistryBuilder;
import software.bluelib.api.registry.BlueRegistryBuilder;
import software.bluelib.api.utils.logging.BaseLogLevel;
import software.bluelib.api.utils.logging.BaseLogger;
import software.bluelib.internal.BlueTranslation;
import software.bluelib.internal.registry.BlueNetworkRegistry;
import software.bluelib.internal.registry.BlueRecipeSerializerRegistry;
import software.bluelib.internal.registry.BlueRecipeTypeRegistry;
import software.bluelib.internal.registry.TestEntityReg;

@ApiStatus.Internal
public class BlueLibCommon {

/**
* Initializes the {@link AbstractRegistryBuilder} instance with the mod ID. Replace {@link BlueLibConstants#MOD_ID} with your mod's unique mod ID to register content under your mod's namespace.
* <p>
* This is essential for registering mod content such as items, blocks, and entities.
* <p>
* <strong>Do not remove</strong>, as it will break the mod's registration system.
* <p>
* Do not use this, you need to add this line into your own mod.
*/
public static AbstractRegistryBuilder REGISTRIES = new BlueRegistryBuilder(BlueLibConstants.MOD_ID);

private BlueLibCommon() {}

public static void init() {
Expand All @@ -49,6 +64,8 @@ public static void doRegistration() {
InternalNetworkRegistry.networkServer();
BlueRecipeTypeRegistry.init();
BlueRecipeSerializerRegistry.init();

TestEntityReg.init();
}

public static void doClientRegistration() {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
/*
* Copyright (C) 2024 BlueLib Contributors
*
* This Source Code Form is subject to the terms of the MIT License.
* If a copy of the MIT License was not distributed with this file,
* You can obtain one at https://opensource.org/licenses/MIT.
*/
package software.bluelib.api.registry;

import java.util.List;
import java.util.function.Function;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.MobCategory;
import net.minecraft.world.item.Item;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.entity.BlockEntity;
import net.minecraft.world.level.block.entity.BlockEntityType;
import software.bluelib.api.registry.builders.blocks.BlockBuilder;
import software.bluelib.api.registry.builders.blocks.BlockEntityBuilder;
import software.bluelib.api.registry.builders.entity.LivingEntityBuilder;
import software.bluelib.api.registry.builders.entity.ProjectileBuilder;
import software.bluelib.api.registry.builders.items.ItemBuilder;
import software.bluelib.api.registry.builders.keybinds.KeybindBuilder;
import software.bluelib.api.registry.builders.tabs.CreativeTabBuilder;
import software.bluelib.api.registry.datagen.entity.EntityTagBuilder;

public abstract class AbstractRegistryBuilder {

private final String modID;

public AbstractRegistryBuilder(final String pModId) {
modID = pModId;
}

public String getModID() {
return modID;
}

public <T extends LivingEntity> LivingEntityBuilder<T> livingEntity(String pName, EntityType.EntityFactory<T> pFactory, MobCategory pCategory) {
return new LivingEntityBuilder<>(pName, pFactory, pCategory, modID);
}

public <T extends Entity> ProjectileBuilder<T> projectile(String pName, EntityType.EntityFactory<T> pFactory, MobCategory pCategory, Class<T> pEntityClass) {
return new ProjectileBuilder<>(pName, pFactory, pCategory, pEntityClass, modID);
}

public <T extends Block> BlockBuilder<T> block(String pName, Function<Block.Properties, T> pFactory) {
return new BlockBuilder<>(pName, pFactory, modID);
}

public <T extends BlockEntity> BlockEntityBuilder<T> blockEntity(String pName, BlockEntityType.BlockEntitySupplier<T> pFactory) {
return new BlockEntityBuilder<>(pName, pFactory, modID);
}

public <T extends Item> ItemBuilder<T> item(String pName, Function<Item.Properties, T> pConstructor) {
return new ItemBuilder<>(pName, pConstructor, modID);
}

public EntityTagBuilder entityTag(String pName) {
return new EntityTagBuilder(pName, modID);
}

public CreativeTabBuilder tab(String pId) {
return new CreativeTabBuilder(pId, modID);
}

public KeybindBuilder keybind(String pName, int pKeyCode) {
return new KeybindBuilder(pName, pKeyCode, modID);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/*
* Copyright (C) 2024 BlueLib Contributors
*
* This Source Code Form is subject to the terms of the MIT License.
* If a copy of the MIT License was not distributed with this file,
* You can obtain one at https://opensource.org/licenses/MIT.
*/
package software.bluelib.api.registry;

public class BlueRegistryBuilder extends AbstractRegistryBuilder {

public BlueRegistryBuilder(String pModId) {
super(pModId);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/*
* Copyright (C) 2024 BlueLib Contributors
*
* This Source Code Form is subject to the terms of the MIT License.
* If a copy of the MIT License was not distributed with this file,
* You can obtain one at https://opensource.org/licenses/MIT.
*/
package software.bluelib.api.registry.builders;

public class BuilderUtils {

private BuilderUtils() {}
}
Loading
Loading