6 | * This will combine the {@link BehaviourClimable} behaviours with all {@link BehaviourVine} behaviours. 7 | */ 8 | public interface BehaviourClimableVine extends BehaviourClimable, BehaviourVine { 9 | } 10 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # gradle 2 | 3 | .gradle/ 4 | build/ 5 | out/ 6 | classes/ 7 | 8 | # eclipse 9 | 10 | *.launch 11 | 12 | # idea 13 | 14 | .idea/ 15 | *.iml 16 | *.ipr 17 | *.iws 18 | 19 | # vscode 20 | 21 | .settings/ 22 | .vscode/ 23 | bin/ 24 | .classpath 25 | .project 26 | 27 | # fabric 28 | 29 | run/ 30 | run-client/ 31 | run-server/ 32 | output/ 33 | *.log 34 | /CHANGES.md 35 | /src/main/generated/.cache/ 36 | /modrinth.json 37 | -------------------------------------------------------------------------------- /src/main/java/org/betterx/bclib/interfaces/BCLPlacementContext.java: -------------------------------------------------------------------------------- 1 | package org.betterx.bclib.interfaces; 2 | 3 | import net.minecraft.world.level.block.Mirror; 4 | import net.minecraft.world.level.block.Rotation; 5 | 6 | public interface BCLPlacementContext { 7 | Rotation bcl_getRotation(); 8 | void bcl_setRotation(Rotation bcl_rotation); 9 | Mirror bcl_getMirror(); 10 | void bcl_setMirror(Mirror bcl_mirror); 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/org/betterx/bclib/api/v3/bonemeal/EndStoneSpreader.java: -------------------------------------------------------------------------------- 1 | package org.betterx.bclib.api.v3.bonemeal; 2 | 3 | import org.betterx.bclib.api.v3.tag.BCLBlockTags; 4 | 5 | public class EndStoneSpreader extends TaggedBonemealBlockSpreader { 6 | static final EndStoneSpreader INSTANCE = new EndStoneSpreader(); 7 | 8 | protected EndStoneSpreader() { 9 | super(BCLBlockTags.BONEMEAL_SOURCE_END_STONE); 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/org/betterx/bclib/behaviours/interfaces/BehaviourClimable.java: -------------------------------------------------------------------------------- 1 | package org.betterx.bclib.behaviours.interfaces; 2 | 3 | /** 4 | * Interface for blocks that can be climbed. 5 | *
6 | * {@link org.betterx.bclib.api.v2.PostInitAPI} will add the {@link net.minecraft.tags.BlockTags#CLIMBABLE} tag to all blocks that
7 | * implement this interface.
8 | */
9 | public interface BehaviourClimable extends BlockBehaviour {
10 | }
11 |
--------------------------------------------------------------------------------
/src/main/java/org/betterx/bclib/api/v3/datagen/DatapackRecipeBuilder.java:
--------------------------------------------------------------------------------
1 | package org.betterx.bclib.api.v3.datagen;
2 |
3 | import net.minecraft.data.recipes.RecipeOutput;
4 | import net.minecraft.resources.ResourceLocation;
5 |
6 | public interface DatapackRecipeBuilder {
7 | ResourceLocation getId();
8 |
9 | default String getNamespace() {
10 | return this.getId().getNamespace();
11 | }
12 | void build(RecipeOutput cc);
13 | }
14 |
--------------------------------------------------------------------------------
/src/main/java/org/betterx/bclib/client/gui/modmenu/EntryPoint.java:
--------------------------------------------------------------------------------
1 | package org.betterx.bclib.client.gui.modmenu;
2 |
3 | //import org.betterx.bclib.integration.modmenu.ModMenuIntegration;
4 | //
5 | //@Deprecated()
6 | //public class EntryPoint extends ModMenuIntegration {
7 | // //public static final Object entrypointObject = createEntrypoint(new EntryPoint());
8 | //
9 | // public EntryPoint() {
10 | // super(MainScreen::new);
11 | // }
12 | //}
13 |
--------------------------------------------------------------------------------
/src/main/java/org/anti_ad/mc/ipn/api/IPNIgnore.java:
--------------------------------------------------------------------------------
1 | package org.anti_ad.mc.ipn.api;
2 |
3 | import java.lang.annotation.ElementType;
4 | import java.lang.annotation.Retention;
5 | import java.lang.annotation.RetentionPolicy;
6 | import java.lang.annotation.Target;
7 |
8 | // Included from "Inventory Profiles Next" (https://github.com/blackd/Inventory-Profiles)
9 | @Retention(RetentionPolicy.RUNTIME)
10 | @Target(ElementType.TYPE)
11 | public @interface IPNIgnore {
12 | }
--------------------------------------------------------------------------------
/src/main/java/org/betterx/bclib/sdf/operator/SDFRound.java:
--------------------------------------------------------------------------------
1 | package org.betterx.bclib.sdf.operator;
2 |
3 | public class SDFRound extends SDFUnary {
4 | private float radius;
5 |
6 | public SDFRound setRadius(float radius) {
7 | this.radius = radius;
8 | return this;
9 | }
10 |
11 | @Override
12 | public float getDistance(float x, float y, float z) {
13 | return this.source.getDistance(x, y, z) - radius;
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/src/main/java/org/betterx/bclib/client/textures/SpriteLister.java:
--------------------------------------------------------------------------------
1 | package org.betterx.bclib.client.textures;
2 |
3 | import net.minecraft.client.renderer.texture.atlas.sources.DirectoryLister;
4 |
5 | import net.fabricmc.api.EnvType;
6 | import net.fabricmc.api.Environment;
7 |
8 | @Environment(value = EnvType.CLIENT)
9 | public class SpriteLister extends DirectoryLister {
10 | public SpriteLister(String string) {
11 | super(string, string + "/");
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/main/java/org/betterx/bclib/sdf/operator/SDFScale.java:
--------------------------------------------------------------------------------
1 | package org.betterx.bclib.sdf.operator;
2 |
3 | public class SDFScale extends SDFUnary {
4 | private float scale;
5 |
6 | public SDFScale setScale(float scale) {
7 | this.scale = scale;
8 | return this;
9 | }
10 |
11 | @Override
12 | public float getDistance(float x, float y, float z) {
13 | return source.getDistance(x / scale, y / scale, z / scale) * scale;
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/src/main/java/org/betterx/bclib/sdf/operator/SDFUnion.java:
--------------------------------------------------------------------------------
1 | package org.betterx.bclib.sdf.operator;
2 |
3 | import org.betterx.bclib.util.MHelper;
4 |
5 | public class SDFUnion extends SDFBinary {
6 | @Override
7 | public float getDistance(float x, float y, float z) {
8 | float a = this.sourceA.getDistance(x, y, z);
9 | float b = this.sourceB.getDistance(x, y, z);
10 | this.selectValue(a, b);
11 | return MHelper.min(a, b);
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/main/java/org/betterx/bclib/sdf/operator/SDFIntersection.java:
--------------------------------------------------------------------------------
1 | package org.betterx.bclib.sdf.operator;
2 |
3 | import org.betterx.bclib.util.MHelper;
4 |
5 | public class SDFIntersection extends SDFBinary {
6 | @Override
7 | public float getDistance(float x, float y, float z) {
8 | float a = this.sourceA.getDistance(x, y, z);
9 | float b = this.sourceB.getDistance(x, y, z);
10 | this.selectValue(a, b);
11 | return MHelper.max(a, b);
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/main/java/org/betterx/bclib/sdf/operator/SDFSubtraction.java:
--------------------------------------------------------------------------------
1 | package org.betterx.bclib.sdf.operator;
2 |
3 | import org.betterx.bclib.util.MHelper;
4 |
5 | public class SDFSubtraction extends SDFBinary {
6 | @Override
7 | public float getDistance(float x, float y, float z) {
8 | float a = this.sourceA.getDistance(x, y, z);
9 | float b = this.sourceB.getDistance(x, y, z);
10 | this.selectValue(a, b);
11 | return MHelper.max(a, -b);
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/main/java/org/betterx/bclib/sdf/primitive/SDFSphere.java:
--------------------------------------------------------------------------------
1 | package org.betterx.bclib.sdf.primitive;
2 |
3 | import org.betterx.bclib.util.MHelper;
4 |
5 | public class SDFSphere extends SDFPrimitive {
6 | private float radius;
7 |
8 | public SDFSphere setRadius(float radius) {
9 | this.radius = radius;
10 | return this;
11 | }
12 |
13 | @Override
14 | public float getDistance(float x, float y, float z) {
15 | return MHelper.length(x, y, z) - radius;
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/main/java/org/betterx/bclib/behaviours/interfaces/BehaviourPlantLike.java:
--------------------------------------------------------------------------------
1 | package org.betterx.bclib.behaviours.interfaces;
2 |
3 | import org.betterx.wover.tabs.api.interfaces.CreativeTabPredicate;
4 |
5 | import net.minecraft.world.item.BlockItem;
6 |
7 | public interface BehaviourPlantLike extends BlockBehaviour {
8 | CreativeTabPredicate TAB_PREDICATE = item -> item instanceof BlockItem bi
9 | && (bi.getBlock() instanceof BehaviourPlantLike
10 | || bi.getBlock() instanceof BehaviourLeaves);
11 | }
12 |
--------------------------------------------------------------------------------
/src/main/java/org/betterx/bclib/api/v2/dataexchange/Connector.java:
--------------------------------------------------------------------------------
1 | package org.betterx.bclib.api.v2.dataexchange;
2 |
3 | import org.betterx.bclib.api.v2.dataexchange.handler.DataExchange;
4 |
5 | import java.util.Set;
6 |
7 | abstract class Connector {
8 | protected final DataExchange api;
9 |
10 | Connector(DataExchange api) {
11 | this.api = api;
12 | }
13 |
14 | public abstract boolean onClient();
15 |
16 | protected Set
9 | * Adds composting chance, mineable with shears and hoe.
10 | */
11 | public interface BehaviourLeaves extends AddMineableShears, AddMineableHoe, BehaviourCompostable {
12 | @Override
13 | default float compostingChance() {
14 | return 0.3f;
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/src/main/java/org/betterx/bclib/behaviours/interfaces/BehaviourVine.java:
--------------------------------------------------------------------------------
1 | package org.betterx.bclib.behaviours.interfaces;
2 |
3 | import org.betterx.bclib.interfaces.tools.AddMineableHoe;
4 | import org.betterx.bclib.interfaces.tools.AddMineableShears;
5 |
6 | /**
7 | * Interface for blocks that are vines.
8 | *
9 | * This will add the {@link AddMineableShears}, {@link AddMineableHoe} and {@link BehaviourCompostable} behaviours.
10 | */
11 | public interface BehaviourVine extends AddMineableShears, AddMineableHoe, BehaviourPlantLike, BehaviourCompostable, BehaviourClimable {
12 | }
13 |
--------------------------------------------------------------------------------
/src/main/java/org/betterx/bclib/sdf/operator/SDFUnary.java:
--------------------------------------------------------------------------------
1 | package org.betterx.bclib.sdf.operator;
2 |
3 | import org.betterx.bclib.sdf.SDF;
4 |
5 | import net.minecraft.core.BlockPos;
6 | import net.minecraft.world.level.block.state.BlockState;
7 |
8 | public abstract class SDFUnary extends SDF {
9 | protected SDF source;
10 |
11 | public SDFUnary setSource(SDF source) {
12 | this.source = source;
13 | return this;
14 | }
15 |
16 | @Override
17 | public BlockState getBlockState(BlockPos pos) {
18 | return source.getBlockState(pos);
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/main/java/org/betterx/bclib/sdf/operator/SDFCopyRotate.java:
--------------------------------------------------------------------------------
1 | package org.betterx.bclib.sdf.operator;
2 |
3 | import org.betterx.bclib.util.MHelper;
4 |
5 | public class SDFCopyRotate extends SDFUnary {
6 | int count = 1;
7 |
8 | public SDFCopyRotate setCount(int count) {
9 | this.count = count;
10 | return this;
11 | }
12 |
13 | @Override
14 | public float getDistance(float x, float y, float z) {
15 | float px = (float) Math.atan2(x, z);
16 | float pz = MHelper.length(x, z);
17 | return this.source.getDistance(px, y, pz);
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/main/java/org/betterx/bclib/interfaces/ItemModelProvider.java:
--------------------------------------------------------------------------------
1 | package org.betterx.bclib.interfaces;
2 |
3 | import org.betterx.bclib.client.models.ModelsHelper;
4 |
5 | import net.minecraft.client.renderer.block.model.BlockModel;
6 | import net.minecraft.resources.ResourceLocation;
7 |
8 | import net.fabricmc.api.EnvType;
9 | import net.fabricmc.api.Environment;
10 |
11 | public interface ItemModelProvider {
12 | @Environment(EnvType.CLIENT)
13 | default BlockModel getItemModel(ResourceLocation resourceLocation) {
14 | return ModelsHelper.createItemModel(resourceLocation);
15 | }
16 | }
--------------------------------------------------------------------------------
/src/main/java/org/betterx/bclib/server/BCLibServer.java:
--------------------------------------------------------------------------------
1 | package org.betterx.bclib.server;
2 |
3 | import org.betterx.bclib.api.v2.ModIntegrationAPI;
4 | import org.betterx.bclib.api.v2.PostInitAPI;
5 | import org.betterx.bclib.api.v2.dataexchange.DataExchangeAPI;
6 |
7 | import net.fabricmc.api.DedicatedServerModInitializer;
8 |
9 | public class BCLibServer implements DedicatedServerModInitializer {
10 | @Override
11 | public void onInitializeServer() {
12 | ModIntegrationAPI.registerAll();
13 | DataExchangeAPI.prepareServerside();
14 |
15 | PostInitAPI.postInit(false);
16 | }
17 |
18 | }
19 |
--------------------------------------------------------------------------------
/src/main/java/org/betterx/datagen/bclib/worldgen/BlockTagProvider.java:
--------------------------------------------------------------------------------
1 | package org.betterx.datagen.bclib.worldgen;
2 |
3 | import org.betterx.wover.core.api.ModCore;
4 | import org.betterx.wover.datagen.api.WoverTagProvider;
5 | import org.betterx.wover.tag.api.event.context.TagBootstrapContext;
6 |
7 | import net.minecraft.world.level.block.Block;
8 |
9 | public class BlockTagProvider extends WoverTagProvider.ForBlocks {
10 | public BlockTagProvider(ModCore modCore) {
11 | super(modCore);
12 | }
13 |
14 | @Override
15 | public void prepareTags(TagBootstrapContext
6 | * {@link org.betterx.bclib.api.v2.PostInitAPI} will add the
7 | * {@link org.betterx.wover.tag.api.predefined.CommonItemTags#COMPOSTABLE} tag to the items of all blocks that
8 | * implement this interface. It will also register the Block with the {@link org.betterx.bclib.api.v2.ComposterAPI}
9 | */
10 | public interface BehaviourCompostable extends BlockBehaviour {
11 |
12 | /**
13 | * The chance that this block will be composted.
14 | *
15 | * The default value is 0.1f.
16 | *
17 | * @return The chance that this block will be composted.
18 | */
19 | default float compostingChance() {
20 | return 0.1f;
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/src/main/java/org/betterx/bclib/mixin/common/MobSpawnSettingsAccessor.java:
--------------------------------------------------------------------------------
1 | package org.betterx.bclib.mixin.common;
2 |
3 | import net.minecraft.util.random.WeightedRandomList;
4 | import net.minecraft.world.entity.MobCategory;
5 | import net.minecraft.world.level.biome.MobSpawnSettings;
6 | import net.minecraft.world.level.biome.MobSpawnSettings.SpawnerData;
7 |
8 | import org.spongepowered.asm.mixin.Mixin;
9 | import org.spongepowered.asm.mixin.Mutable;
10 | import org.spongepowered.asm.mixin.gen.Accessor;
11 |
12 | import java.util.Map;
13 |
14 | @Mixin(MobSpawnSettings.class)
15 | public interface MobSpawnSettingsAccessor {
16 | @Accessor("spawners")
17 | Map
12 | * This integration allows you to use ModMenu without adding a dependency to your project. If the
13 | * Mod is installed on the Client.
14 | *
15 | * You can add a screen for your mod by calling {@link #addModMenuScreen(String, Function)}
16 | */
17 | public class ModMenu {
18 | static final Map