Initial commit
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
package com.oierbravo.{{MECHANICAL_ID}};
|
||||
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
|
||||
public class ModConstants {
|
||||
public static final String MODID = "{{MECHANICAL_ID}}";
|
||||
public static final String DISPLAY_NAME = "{{MECHANICAL_NAME}}";
|
||||
public static ResourceLocation asResource(String path) {
|
||||
return ResourceLocation.fromNamespaceAndPath(MODID, path);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.oierbravo.{{MECHANICAL_ID}}.foundation.utility;
|
||||
|
||||
import com.oierbravo.{{MECHANICAL_ID}}.ModConstants;
|
||||
import net.createmod.catnip.lang.Lang;
|
||||
import net.createmod.catnip.lang.LangBuilder;
|
||||
|
||||
public class ModLang extends Lang {
|
||||
public ModLang() {
|
||||
super();
|
||||
}
|
||||
public static LangBuilder builder() {
|
||||
return new LangBuilder(ModConstants.MODID);
|
||||
}
|
||||
public static LangBuilder translate(String langKey, Object... args) {
|
||||
return builder().translate(langKey, args);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
package com.oierbravo.{{MECHANICAL_ID}}.infrastructure.config;
|
||||
|
||||
import com.simibubi.create.api.stress.BlockStressValues;
|
||||
import net.createmod.catnip.config.ConfigBase;
|
||||
import net.neoforged.bus.api.SubscribeEvent;
|
||||
import net.neoforged.fml.ModContainer;
|
||||
import net.neoforged.fml.ModLoadingContext;
|
||||
import net.neoforged.fml.common.EventBusSubscriber;
|
||||
import net.neoforged.fml.config.ModConfig;
|
||||
import net.neoforged.fml.event.config.ModConfigEvent;
|
||||
import net.neoforged.neoforge.common.ModConfigSpec;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
import java.util.EnumMap;
|
||||
import java.util.Map;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
@EventBusSubscriber(bus = EventBusSubscriber.Bus.MOD)
|
||||
public class MConfigs {
|
||||
private static final Map<ModConfig.Type, ConfigBase> CONFIGS = new EnumMap<>(ModConfig.Type.class);
|
||||
|
||||
private static ModConfigServer server;
|
||||
private static ModConfigClient client;
|
||||
|
||||
public static ModConfigServer server() {
|
||||
return server;
|
||||
}
|
||||
public static ModConfigClient client() { return client; }
|
||||
|
||||
public static ConfigBase byType(ModConfig.Type type) {
|
||||
return CONFIGS.get(type);
|
||||
}
|
||||
private static <T extends ConfigBase> T register(Supplier<T> factory, ModConfig.Type side) {
|
||||
Pair<T, ModConfigSpec> specPair = new ModConfigSpec.Builder().configure(builder -> {
|
||||
T config = factory.get();
|
||||
config.registerAll(builder);
|
||||
return config;
|
||||
});
|
||||
|
||||
T config = specPair.getLeft();
|
||||
config.specification = specPair.getRight();
|
||||
CONFIGS.put(side, config);
|
||||
return config;
|
||||
}
|
||||
public static void register(ModLoadingContext context, ModContainer container) {
|
||||
server = register(ModConfigServer::new, ModConfig.Type.SERVER);
|
||||
client = register(ModConfigClient::new, ModConfig.Type.CLIENT);
|
||||
|
||||
for (Map.Entry<ModConfig.Type, ConfigBase> pair : CONFIGS.entrySet())
|
||||
container.registerConfig(pair.getKey(), pair.getValue().specification);
|
||||
|
||||
ModStress stress = server().stressValues;
|
||||
BlockStressValues.IMPACTS.registerProvider(stress::getImpact);
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public static void onLoad(ModConfigEvent.Loading event) {
|
||||
for (ConfigBase config : CONFIGS.values())
|
||||
if (config.specification == event.getConfig()
|
||||
.getSpec())
|
||||
config.onLoad();
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public static void onReload(ModConfigEvent.Reloading event) {
|
||||
for (ConfigBase config : CONFIGS.values())
|
||||
if (config.specification == event.getConfig()
|
||||
.getSpec())
|
||||
config.onReload();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.oierbravo.{{MECHANICAL_ID}}.infrastructure.config;
|
||||
|
||||
import net.createmod.catnip.config.ConfigBase;
|
||||
|
||||
public class ModConfigClient extends ConfigBase {
|
||||
//public final ExampleConfigsClient example = nested(0, ExampleConfigsClient::new, "Example Configs");
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "client";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.oierbravo.{{MECHANICAL_ID}}.infrastructure.config;
|
||||
|
||||
import net.createmod.catnip.config.ConfigBase;
|
||||
|
||||
public class ModConfigServer extends ConfigBase {
|
||||
//public final ExampleConfigs example = nested(0, ExampleConfigs::new, "Example");
|
||||
|
||||
public final ModStress stressValues = nested(0, ModStress::new, "Stress values");
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "server";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
package com.oierbravo.{{MECHANICAL_ID}}.infrastructure.config;
|
||||
|
||||
import com.oierbravo.{{MECHANICAL_ID}}.ModConstants;
|
||||
import com.tterrag.registrate.builders.BlockBuilder;
|
||||
import com.tterrag.registrate.util.nullness.NonNullUnaryOperator;
|
||||
import it.unimi.dsi.fastutil.objects.Object2DoubleMap;
|
||||
import it.unimi.dsi.fastutil.objects.Object2DoubleOpenHashMap;
|
||||
import net.createmod.catnip.config.ConfigBase;
|
||||
import net.createmod.catnip.registry.RegisteredObjectsHelper;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.neoforged.neoforge.common.ModConfigSpec.Builder;
|
||||
import net.neoforged.neoforge.common.ModConfigSpec.ConfigValue;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.function.DoubleSupplier;
|
||||
|
||||
public class ModStress extends ConfigBase {
|
||||
// bump this version to reset configured values.
|
||||
private static final int VERSION = 1;
|
||||
|
||||
// IDs need to be used since configs load before registration
|
||||
|
||||
private static final Object2DoubleMap<ResourceLocation> DEFAULT_IMPACTS = new Object2DoubleOpenHashMap<>();
|
||||
private static final Object2DoubleMap<ResourceLocation> DEFAULT_CAPACITIES = new Object2DoubleOpenHashMap<>();
|
||||
|
||||
protected final Map<ResourceLocation, ConfigValue<Double>> capacities = new HashMap<>();
|
||||
protected final Map<ResourceLocation, ConfigValue<Double>> impacts = new HashMap<>();
|
||||
|
||||
@Override
|
||||
public void registerAll(Builder builder) {
|
||||
builder.comment(".", Comments.su, Comments.impact)
|
||||
.push("impact");
|
||||
DEFAULT_IMPACTS.forEach((id, value) -> this.impacts.put(id, builder.define(id.getPath(), value)));
|
||||
builder.pop();
|
||||
|
||||
builder.comment(".", Comments.su, Comments.capacity)
|
||||
.push("capacity");
|
||||
DEFAULT_CAPACITIES.forEach((id, value) -> this.capacities.put(id, builder.define(id.getPath(), value)));
|
||||
builder.pop();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "stressValues.v" + VERSION;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public DoubleSupplier getImpact(Block block) {
|
||||
ResourceLocation id = RegisteredObjectsHelper.getKeyOrThrow(block);
|
||||
ConfigValue<Double> value = this.impacts.get(id);
|
||||
return value == null ? null : value::get;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public DoubleSupplier getCapacity(Block block) {
|
||||
ResourceLocation id = RegisteredObjectsHelper.getKeyOrThrow(block);
|
||||
ConfigValue<Double> value = this.capacities.get(id);
|
||||
return value == null ? null : value::get;
|
||||
}
|
||||
|
||||
public static <B extends Block, P> NonNullUnaryOperator<BlockBuilder<B, P>> setNoImpact() {
|
||||
return setImpact(0);
|
||||
}
|
||||
|
||||
public static <B extends Block, P> NonNullUnaryOperator<BlockBuilder<B, P>> setImpact(double value) {
|
||||
return builder -> {
|
||||
assertFromThisMod(builder);
|
||||
ResourceLocation id = ModConstants.asResource(builder.getName());
|
||||
DEFAULT_IMPACTS.put(id, value);
|
||||
return builder;
|
||||
};
|
||||
}
|
||||
|
||||
public static <B extends Block, P> NonNullUnaryOperator<BlockBuilder<B, P>> setCapacity(double value) {
|
||||
return builder -> {
|
||||
assertFromThisMod(builder);
|
||||
ResourceLocation id = ModConstants.asResource(builder.getName());
|
||||
DEFAULT_CAPACITIES.put(id, value);
|
||||
return builder;
|
||||
};
|
||||
}
|
||||
private static void assertFromThisMod(BlockBuilder<?, ?> builder) {
|
||||
if (!builder.getOwner().getModid().equals(ModConstants.MODID)) {
|
||||
throw new IllegalStateException("Non-Create blocks cannot be added to " + ModConstants.DISPLAY_NAME + "'s config.");
|
||||
}
|
||||
}
|
||||
|
||||
private static class Comments {
|
||||
static String su = "[in Stress Units]";
|
||||
static String impact =
|
||||
"Configure the individual stress impact of mechanical blocks. Note that this cost is doubled for every speed increase it receives.";
|
||||
static String capacity = "Configure how much stress a source can accommodate for.";
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.oierbravo.{{MECHANICAL_ID}}.infrastructure.data;
|
||||
|
||||
import com.oierbravo.{{MECHANICAL_ID}}.{{MECHANICAL_MAIN_CLASS}};
|
||||
import com.oierbravo.{{MECHANICAL_ID}}.ModConstants;
|
||||
import com.simibubi.create.Create;
|
||||
import com.tterrag.registrate.providers.RegistrateDataProvider;
|
||||
import net.minecraft.data.DataGenerator;
|
||||
import net.minecraft.data.PackOutput;
|
||||
import net.neoforged.neoforge.data.event.GatherDataEvent;
|
||||
|
||||
public class ModDataGen {
|
||||
public static void gatherData(GatherDataEvent event) {
|
||||
|
||||
DataGenerator generator = event.getGenerator();
|
||||
PackOutput output = generator.getPackOutput();
|
||||
|
||||
if (event.includeServer()) {
|
||||
//generator.addProvider(true, new ExamplenRecipeGen(output, event.getLookupProvider()));
|
||||
|
||||
}
|
||||
event.getGenerator().addProvider(true, {{MECHANICAL_MAIN_CLASS}}.registrate().setDataProvider(new RegistrateDataProvider({{MECHANICAL_MAIN_CLASS}}.registrate(), ModConstants.MODID, event)));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.oierbravo.{{MECHANICAL_ID}}.ponders;
|
||||
|
||||
import com.oierbravo.{{MECHANICAL_ID}}.ModConstants;
|
||||
import net.createmod.ponder.api.registration.PonderPlugin;
|
||||
import net.createmod.ponder.api.registration.PonderSceneRegistrationHelper;
|
||||
import net.createmod.ponder.api.registration.PonderTagRegistrationHelper;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class ModPonderPlugin implements PonderPlugin {
|
||||
|
||||
@Override
|
||||
public @NotNull String getModId() {
|
||||
return ModConstants.MODID;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerScenes(PonderSceneRegistrationHelper<ResourceLocation> helper) {
|
||||
//PonderSceneRegistrationHelper<ItemProviderEntry<?, ?>> HELPER = helper.withKeyFunction(RegistryEntry::getId);
|
||||
|
||||
//HELPER.forComponents(ModRegistration.MECHANICAL_CHICKEN_BLOCK)
|
||||
// .addStoryBoard("mechanical", MechanicalChickenScenes::mechanicalChicken);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerTags(PonderTagRegistrationHelper<ResourceLocation> helper) {
|
||||
//PonderTagRegistrationHelper<RegistryEntry<?, ?>> TAG_HELPER = helper.withKeyFunction(RegistryEntry::getId);
|
||||
//TAG_HELPER.addToTag(KINETIC_APPLIANCES).add(ModRegistration.MECHANICAL_BLOCK);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.oierbravo.{{MECHANICAL_ID}}.registrate;
|
||||
|
||||
import com.oierbravo.{{MECHANICAL_ID}}.{{MECHANICAL_MAIN_CLASS}};
|
||||
|
||||
import com.tterrag.registrate.util.entry.BlockEntityEntry;
|
||||
public class ModBlockEntities {
|
||||
|
||||
/*public static final BlockEntityEntry<ExampleBlockEntity> EXAMPLE = CreateSifter.registrate()
|
||||
.blockEntity("example", SifterBlockEntity::new)
|
||||
.visual(() -> SifterVisual::new)
|
||||
.validBlocks(ModBlocks.EXAMPLE)
|
||||
.renderer(() -> SifterRenderer::new)
|
||||
.register();*/
|
||||
|
||||
public static void register() {}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.oierbravo.{{MECHANICAL_ID}}.registrate;
|
||||
|
||||
import com.oierbravo.{{MECHANICAL_ID}}.ModConstants;
|
||||
import com.oierbravo.{{MECHANICAL_ID}}.infrastucture.config.ModStress;
|
||||
import com.simibubi.create.AllBlocks;
|
||||
import com.simibubi.create.AllTags;
|
||||
import com.simibubi.create.foundation.data.AssetLookup;
|
||||
import com.simibubi.create.foundation.data.BlockStateGen;
|
||||
import com.simibubi.create.foundation.data.SharedProperties;
|
||||
import com.tterrag.registrate.providers.RegistrateRecipeProvider;
|
||||
import com.tterrag.registrate.util.entry.BlockEntry;
|
||||
import net.minecraft.data.recipes.RecipeCategory;
|
||||
import net.minecraft.data.recipes.ShapedRecipeBuilder;
|
||||
import net.minecraft.tags.BlockTags;
|
||||
import net.minecraft.tags.ItemTags;
|
||||
import net.minecraft.world.item.Items;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.material.MapColor;
|
||||
|
||||
import static com.oierbravo.{{MECHANICAL_ID}}.{{MECHANICAL_MAIN_CLASS}}.REGISTRATE;
|
||||
import static com.simibubi.create.foundation.data.ModelGen.customItemModel;
|
||||
import static com.simibubi.create.foundation.data.TagGen.pickaxeOnly;
|
||||
|
||||
public class ModBlocks {
|
||||
/*public static final BlockEntry<ExampleBlock> SIFTER = REGISTRATE.block("example_block", ExampleBlock::new)
|
||||
.initialProperties(SharedProperties::stone)
|
||||
.properties(p -> p.mapColor(MapColor.METAL))
|
||||
.transform(pickaxeOnly())
|
||||
.blockstate((c, p) -> p.simpleBlock(c.getEntry(), AssetLookup.partialBaseModel(c, p)))
|
||||
.transform(ModStress.setImpact(4.0))
|
||||
.item()
|
||||
.transform(customItemModel())
|
||||
.recipe((c, p) -> ShapedRecipeBuilder.shaped(RecipeCategory.MISC, c.get())
|
||||
.define('W', ItemTags.PLANKS)
|
||||
.define('A', AllBlocks.ANDESITE_CASING)
|
||||
.define('C', AllBlocks.COGWHEEL)
|
||||
.define('P', AllTags.commonItemTag("stones"))
|
||||
.define('S', Items.STICK)
|
||||
.pattern("WAW")
|
||||
.pattern("SCS")
|
||||
.pattern(" P ")
|
||||
.unlockedBy("has_andesite_casing", RegistrateRecipeProvider.has(AllTags.AllItemTags.CASING.tag))
|
||||
.save(p, ModConstants.asResource("crafting/" + c.getName())))
|
||||
.register();
|
||||
*/
|
||||
|
||||
public static void register() {}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.oierbravo.{{MECHANICAL_ID}}.registrate;
|
||||
|
||||
import com.oierbravo.{{MECHANICAL_ID}}.ModLang;
|
||||
import com.oierbravo.mechanicals.Mechanicals;
|
||||
import com.oierbravo.mechanicals.utility.MechanicalLangIdGenerator;
|
||||
import com.simibubi.create.AllCreativeModeTabs;
|
||||
import com.simibubi.create.AllItems;
|
||||
import com.simibubi.create.Create;
|
||||
import com.simibubi.create.foundation.item.TagDependentIngredientItem;
|
||||
import com.tterrag.registrate.util.entry.ItemEntry;
|
||||
import com.tterrag.registrate.util.entry.RegistryEntry;
|
||||
import net.minecraft.core.registries.Registries;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.world.item.CreativeModeTab;
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.neoforged.bus.api.IEventBus;
|
||||
import net.neoforged.neoforge.registries.DeferredHolder;
|
||||
import net.neoforged.neoforge.registries.DeferredRegister;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static com.oierbravo.{{MECHANICAL_ID}}.ModConstants.MODID;
|
||||
|
||||
public class ModCreativeTabs {
|
||||
|
||||
private static final DeferredRegister<CreativeModeTab> TAB_REGISTER =
|
||||
DeferredRegister.create(Registries.CREATIVE_MODE_TAB, MODID);
|
||||
|
||||
|
||||
public static final DeferredHolder<CreativeModeTab, CreativeModeTab> MAIN_TAB = TAB_REGISTER.register("main",
|
||||
() -> CreativeModeTab.builder()
|
||||
.title(ModLang.translate(MechanicalLangIdGenerator.creativeTabId("main")).component())
|
||||
.withTabsBefore(AllCreativeModeTabs.PALETTES_CREATIVE_TAB.getId())
|
||||
//.icon(ModBlocks.EXAMPLE::asStack)
|
||||
.build());
|
||||
|
||||
public static void register(IEventBus modEventBus) {
|
||||
TAB_REGISTER.register(modEventBus);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package com.oierbravo.{{MECHANICAL_ID}}.registrate;
|
||||
|
||||
import com.oierbravo.{{MECHANICAL_ID}}.{{MECHANICAL_MAIN_CLASS}};
|
||||
import com.oierbravo.mechanicals.register.fluid.MechanicalSolidRenderedPlaceableFluidType;
|
||||
import com.simibubi.create.AllFluids;
|
||||
import com.simibubi.create.AllTags;
|
||||
import com.simibubi.create.foundation.data.CreateRegistrate;
|
||||
import com.tterrag.registrate.builders.FluidBuilder;
|
||||
import com.tterrag.registrate.util.entry.FluidEntry;
|
||||
import net.createmod.catnip.theme.Color;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.level.BlockAndTintGetter;
|
||||
import net.minecraft.world.level.material.FluidState;
|
||||
import net.neoforged.neoforge.fluids.BaseFlowingFluid;
|
||||
import net.neoforged.neoforge.fluids.FluidStack;
|
||||
import org.joml.Vector3f;
|
||||
|
||||
import java.util.function.Supplier;
|
||||
|
||||
public class ModFluids {
|
||||
public static final CreateRegistrate REGISTRATE = {{MECHANICAL_MAIN_CLASS}}.registrate();
|
||||
|
||||
/*public static final FluidEntry<BaseFlowingFluid.Flowing> EXAMPLE_FLUID =
|
||||
REGISTRATE.standardFluid("example_fluid",
|
||||
MechanicalSolidRenderedPlaceableFluidType.create(0x88A000,
|
||||
() -> 1f / 8f *0.5f))
|
||||
.lang("Example fluid")
|
||||
.properties(b -> b.viscosity(2000)
|
||||
.density(1400))
|
||||
.fluidProperties(p -> p.levelDecreasePerBlock(2)
|
||||
.tickRate(25)
|
||||
.slopeFindDistance(3)
|
||||
.explosionResistance(100f))
|
||||
.tag(AllTags.commonFluidTag("example_fluid"))
|
||||
.source(BaseFlowingFluid.Source::new) // TODO: remove when Registrate fixes FluidBuilder
|
||||
.bucket()
|
||||
.tag(AllTags.commonItemTag("buckets/example_fluid"))
|
||||
.build()
|
||||
.register();
|
||||
*/
|
||||
public static void register() {}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package com.oierbravo.{{MECHANICAL_ID}}.registrate;
|
||||
|
||||
import com.oierbravo.{{MECHANICAL_ID}}.ModConstants;
|
||||
import com.simibubi.create.AllItems;
|
||||
import com.simibubi.create.AllTags;
|
||||
import com.simibubi.create.foundation.data.AssetLookup;
|
||||
import com.simibubi.create.foundation.data.recipe.CompatMetals;
|
||||
import com.simibubi.create.foundation.item.TagDependentIngredientItem;
|
||||
import com.tterrag.registrate.providers.RegistrateRecipeProvider;
|
||||
import com.tterrag.registrate.util.entry.ItemEntry;
|
||||
import net.minecraft.data.recipes.RecipeCategory;
|
||||
import net.minecraft.data.recipes.ShapedRecipeBuilder;
|
||||
import net.minecraft.data.recipes.ShapelessRecipeBuilder;
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraft.world.item.Items;
|
||||
import net.minecraft.world.level.ItemLike;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
|
||||
import static com.oierbravo.{{MECHANICAL_ID}}.{{MECHANICAL_MAIN_CLASS}}.REGISTRATE;
|
||||
import static com.tterrag.registrate.providers.RegistrateRecipeProvider.inventoryTrigger;
|
||||
|
||||
public class ModItems {
|
||||
|
||||
/*public static final ItemEntry<Mesh> STRING_MESH =
|
||||
REGISTRATE.item("example_item", ExampleItem::new)
|
||||
.model(AssetLookup.existingItemModel())
|
||||
.properties(properties -> properties.durability(8))
|
||||
.tag(AllTags.commonItemTag("meshes"))
|
||||
.recipe((c, p) -> ShapedRecipeBuilder.shaped(RecipeCategory.MISC, c.get())
|
||||
.define('C', Items.STRING)
|
||||
.define('S', Items.STICK)
|
||||
.pattern("SSS")
|
||||
.pattern("SCS")
|
||||
.pattern("SSS")
|
||||
.unlockedBy("has_string", RegistrateRecipeProvider.has(Items.STRING))
|
||||
.unlockedBy("has_stick", RegistrateRecipeProvider.has(Items.STICK))
|
||||
.save(p, ModConstants.asResource("crafting/" + c.getName())))
|
||||
.register();
|
||||
*/
|
||||
|
||||
public static void register() {}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.oierbravo.{{MECHANICAL_ID}}.registrate;
|
||||
|
||||
import com.oierbravo.{{MECHANICAL_ID}}.ModConstants;
|
||||
import dev.engine_room.flywheel.lib.model.baked.PartialModel;
|
||||
|
||||
public class ModPartials {
|
||||
private static PartialModel block(String path) {
|
||||
return PartialModel.of(ModConstants.asResource("block/" + path));
|
||||
}
|
||||
private static PartialModel item(String path) {
|
||||
return PartialModel.of(ModConstants.asResource("item/" + path));
|
||||
}
|
||||
public static void init() {
|
||||
// init static fields
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package com.oierbravo.{{MECHANICAL_ID}}.registrate;
|
||||
|
||||
import com.oierbravo.{{MECHANICAL_ID}}.ModConstants;
|
||||
import com.simibubi.create.foundation.recipe.RecipeFinder;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.core.registries.Registries;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.crafting.*;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.neoforged.bus.api.IEventBus;
|
||||
import net.neoforged.neoforge.registries.DeferredRegister;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
import java.util.function.Predicate;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
import static com.oierbravo.{{MECHANICAL_ID}}.ModConstants.MODID;
|
||||
|
||||
public class ModRecipes {
|
||||
public static final DeferredRegister<RecipeSerializer<?>> SERIALIZERS =
|
||||
DeferredRegister.create(Registries.RECIPE_SERIALIZER, MODID);
|
||||
public static final DeferredRegister<RecipeType<?>> RECIPE_TYPES = DeferredRegister.create(Registries.RECIPE_TYPE, MODID);
|
||||
|
||||
public static void register(IEventBus eventBus) {
|
||||
|
||||
SERIALIZERS.register(eventBus);
|
||||
RECIPE_TYPES.register(eventBus);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.oierbravo.{{MECHANICAL_ID}}.registrate;
|
||||
|
||||
import com.simibubi.create.AllShapes;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||
|
||||
public class ModShapes {
|
||||
|
||||
private static AllShapes.Builder shape(VoxelShape shape) {
|
||||
return new AllShapes.Builder(shape);
|
||||
}
|
||||
private static AllShapes.Builder shape(double x1, double y1, double z1, double x2, double y2, double z2) {
|
||||
return shape(cuboid(x1, y1, z1, x2, y2, z2));
|
||||
}
|
||||
|
||||
private static VoxelShape cuboid(double x1, double y1, double z1, double x2, double y2, double z2) {
|
||||
return Block.box(x1, y1, z1, x2, y2, z2);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
package com.oierbravo.{{MECHANICAL_ID}};
|
||||
|
||||
import com.mojang.logging.LogUtils;
|
||||
import com.oierbravo.{{MECHANICAL_ID}}.infrastructure.data.ModDataGen;
|
||||
import com.oierbravo.{{MECHANICAL_ID}}.infrastucture.config.MConfigs;
|
||||
import com.oierbravo.{{MECHANICAL_ID}}.ponders.ModPonderPlugin;
|
||||
import com.oierbravo.{{MECHANICAL_ID}}.registrate.*;
|
||||
import com.oierbravo.mechanicals.utility.RegistrateLangBuilder;
|
||||
import com.simibubi.create.foundation.data.CreateRegistrate;
|
||||
import com.simibubi.create.foundation.item.ItemDescription;
|
||||
import com.simibubi.create.foundation.item.KineticStats;
|
||||
import com.simibubi.create.foundation.item.TooltipModifier;
|
||||
import net.createmod.catnip.lang.FontHelper;
|
||||
import net.createmod.ponder.foundation.PonderIndex;
|
||||
import net.neoforged.bus.api.IEventBus;
|
||||
import net.neoforged.fml.ModContainer;
|
||||
import net.neoforged.fml.ModLoadingContext;
|
||||
import net.neoforged.fml.common.Mod;
|
||||
import net.neoforged.fml.event.lifecycle.FMLClientSetupEvent;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
import static com.oierbravo.{{MECHANICAL_ID}}.ModConstants.MODID;
|
||||
|
||||
@Mod(MODID)
|
||||
public class {{MECHANICAL_MAIN_CLASS}}
|
||||
{
|
||||
|
||||
public static final CreateRegistrate REGISTRATE = CreateRegistrate.create(MODID).defaultCreativeTab(ModCreativeTabs.MAIN_TAB.getKey());
|
||||
static {
|
||||
REGISTRATE.setTooltipModifierFactory(item ->
|
||||
new ItemDescription.Modifier(item, FontHelper.Palette.STANDARD_CREATE)
|
||||
.andThen(TooltipModifier.mapNull(KineticStats.create(item)))
|
||||
);
|
||||
}
|
||||
public static final Logger LOGGER = LogUtils.getLogger();
|
||||
|
||||
public {{MECHANICAL_MAIN_CLASS}}(IEventBus modEventBus, ModContainer modContainer)
|
||||
{
|
||||
ModLoadingContext modLoadingContext = ModLoadingContext.get();
|
||||
|
||||
REGISTRATE.registerEventListeners(modEventBus);
|
||||
|
||||
ModCreativeTabs.register(modEventBus);
|
||||
|
||||
ModBlocks.register();
|
||||
ModItems.register();
|
||||
ModBlockEntities.register();
|
||||
|
||||
ModFluids.register();
|
||||
|
||||
MConfigs.register(modLoadingContext,modContainer);
|
||||
|
||||
|
||||
modEventBus.addListener(this::doClientStuff);
|
||||
modEventBus.addListener(this::registerCapabilities);
|
||||
|
||||
modEventBus.addListener(ModDataGen::gatherData);
|
||||
|
||||
ModFluids.register();
|
||||
generateLangEntries();
|
||||
}
|
||||
private void generateLangEntries(){
|
||||
new RegistrateLangBuilder(MODID, registrate())
|
||||
.addRaw("config.jade.plugin_{{MECHANICAL_ID}}.{{MECHANICAL_ID}}_data", "Example")
|
||||
.add("itemGroup.{{MECHANICAL_ID}}:main", "Example");
|
||||
|
||||
}
|
||||
@net.neoforged.bus.api.SubscribeEvent
|
||||
public void registerCapabilities(net.neoforged.neoforge.capabilities.RegisterCapabilitiesEvent event) {
|
||||
|
||||
}
|
||||
private void doClientStuff(final FMLClientSetupEvent event) {
|
||||
|
||||
ModPartials.init();
|
||||
PonderIndex.addPlugin(new ModPonderPlugin());
|
||||
|
||||
}
|
||||
public static CreateRegistrate registrate() {
|
||||
return REGISTRATE;
|
||||
}
|
||||
}
|
||||
1
src/main/resources/META-INF/accesstransformer.cfg
Normal file
1
src/main/resources/META-INF/accesstransformer.cfg
Normal file
@@ -0,0 +1 @@
|
||||
public-f net.minecraft.data.recipes.RecipeProvider getName()Ljava/lang/String;
|
||||
33
src/main/resources/META-INF/neoforge.mods.toml
Normal file
33
src/main/resources/META-INF/neoforge.mods.toml
Normal file
@@ -0,0 +1,33 @@
|
||||
modLoader="javafml" #mandatory
|
||||
loaderVersion = "[0,)"
|
||||
license="LGPL3"
|
||||
[[mods]] #mandatory
|
||||
modId="${mod_id}" #mandatory
|
||||
version="${file.jarVersion}" #mandatory
|
||||
displayName="${mod_name}" #mandatory
|
||||
logoFile="logo.png" #optional
|
||||
credits="Thanks to the Creators of Create" #optional
|
||||
authors="oierbravo" #optional
|
||||
description='''
|
||||
Create addon
|
||||
'''
|
||||
[[dependencies."${mod_id}"]]
|
||||
modId="neoforge"
|
||||
type="required"
|
||||
versionRange="${neo_version_range}"
|
||||
ordering="NONE"
|
||||
side="BOTH"
|
||||
|
||||
[[dependencies."${mod_id}"]]
|
||||
modId="minecraft"
|
||||
type="required"
|
||||
versionRange="${minecraft_version_range}"
|
||||
ordering="NONE"
|
||||
side="BOTH"
|
||||
|
||||
[[dependencies."${mod_id}"]]
|
||||
modId = "create"
|
||||
mandatory = true
|
||||
versionRange="[6.0.4,6.1.0)"
|
||||
ordering = "AFTER"
|
||||
side = "BOTH"
|
||||
9
src/main/resources/assets/atlases/blocks.json
Normal file
9
src/main/resources/assets/atlases/blocks.json
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"sources": [
|
||||
{
|
||||
"type": "directory",
|
||||
"source": "fluid",
|
||||
"prefix": "fluid/"
|
||||
}
|
||||
]
|
||||
}
|
||||
9
src/main/resources/assets/minecraft/atlases/blocks.json
Normal file
9
src/main/resources/assets/minecraft/atlases/blocks.json
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"sources": [
|
||||
{
|
||||
"type": "directory",
|
||||
"source": "fluid",
|
||||
"prefix": "fluid/"
|
||||
}
|
||||
]
|
||||
}
|
||||
BIN
src/main/resources/logo.png
Normal file
BIN
src/main/resources/logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 553 KiB |
13
src/main/resources/{{MECHANICAL_ID}}.mixins.json.jinja
Normal file
13
src/main/resources/{{MECHANICAL_ID}}.mixins.json.jinja
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"required": true,
|
||||
"priority": 1100,
|
||||
"package": "com.oierbravo.{{MECHANICAL_ID}}.mixin",
|
||||
"compatibilityLevel": "JAVA_16",
|
||||
"refmap": "{{MECHANICAL_ID}}.refmap.json",
|
||||
"mixins": [],
|
||||
"client": [],
|
||||
"injectors": {
|
||||
"defaultRequire": 1
|
||||
},
|
||||
"minVersion": "0.8"
|
||||
}
|
||||
Reference in New Issue
Block a user