Skip to content

Commit

Permalink
Remove api dependence on the rest of the mod
Browse files Browse the repository at this point in the history
  • Loading branch information
Adubbz committed Nov 22, 2023
1 parent 8f3044b commit dafd384
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 30 deletions.
10 changes: 10 additions & 0 deletions src/main/java/biomesoplenty/api/BOPAPI.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*******************************************************************************
* Copyright 2023, the Glitchfiend Team.
* All rights reserved.
******************************************************************************/
package biomesoplenty.api;

public class BOPAPI
{
public static final String MOD_ID = "biomesoplenty";
}
6 changes: 3 additions & 3 deletions src/main/java/biomesoplenty/api/biome/BOPBiomes.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
******************************************************************************/
package biomesoplenty.api.biome;

import biomesoplenty.core.BiomesOPlenty;
import biomesoplenty.api.BOPAPI;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Lists;
import net.minecraft.core.registries.Registries;
Expand Down Expand Up @@ -96,15 +96,15 @@ public static List<ResourceKey<Biome>> getAllBiomes()

private static ResourceKey<Biome> registerOverworld(String name)
{
ResourceKey<Biome> key = ResourceKey.create(Registries.BIOME, new ResourceLocation(BiomesOPlenty.MOD_ID, name));
ResourceKey<Biome> key = ResourceKey.create(Registries.BIOME, new ResourceLocation(BOPAPI.MOD_ID, name));
overworldBiomes.add(key);
allBiomes.add(key);
return key;
}

private static ResourceKey<Biome> register(String name)
{
ResourceKey<Biome> key = ResourceKey.create(Registries.BIOME, new ResourceLocation(BiomesOPlenty.MOD_ID, name));
ResourceKey<Biome> key = ResourceKey.create(Registries.BIOME, new ResourceLocation(BOPAPI.MOD_ID, name));
allBiomes.add(key);
return key;
}
Expand Down
24 changes: 12 additions & 12 deletions src/main/java/biomesoplenty/api/block/BOPBlockSetTypes.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,22 @@
******************************************************************************/
package biomesoplenty.api.block;

import biomesoplenty.core.BiomesOPlenty;
import biomesoplenty.api.BOPAPI;
import net.minecraft.world.level.block.state.properties.BlockSetType;

import static net.minecraft.world.level.block.state.properties.BlockSetType.register;

public class BOPBlockSetTypes
{
public static final BlockSetType FIR = register(new BlockSetType(BiomesOPlenty.MOD_ID + ":fir"));
public static final BlockSetType PINE = register(new BlockSetType(BiomesOPlenty.MOD_ID + ":pine"));
public static final BlockSetType REDWOOD = register(new BlockSetType(BiomesOPlenty.MOD_ID + ":redwood"));
public static final BlockSetType MAHOGANY = register(new BlockSetType(BiomesOPlenty.MOD_ID + ":mahogany"));
public static final BlockSetType JACARANDA = register(new BlockSetType(BiomesOPlenty.MOD_ID + ":jacaranda"));
public static final BlockSetType PALM = register(new BlockSetType(BiomesOPlenty.MOD_ID + ":palm"));
public static final BlockSetType WILLOW = register(new BlockSetType(BiomesOPlenty.MOD_ID + ":willow"));
public static final BlockSetType DEAD = register(new BlockSetType(BiomesOPlenty.MOD_ID + ":dead"));
public static final BlockSetType MAGIC = register(new BlockSetType(BiomesOPlenty.MOD_ID + ":magic"));
public static final BlockSetType UMBRAN = register(new BlockSetType(BiomesOPlenty.MOD_ID + ":umbran"));
public static final BlockSetType HELLBARK = register(new BlockSetType(BiomesOPlenty.MOD_ID + ":hellbark"));
public static final BlockSetType FIR = register(new BlockSetType(BOPAPI.MOD_ID + ":fir"));
public static final BlockSetType PINE = register(new BlockSetType(BOPAPI.MOD_ID + ":pine"));
public static final BlockSetType REDWOOD = register(new BlockSetType(BOPAPI.MOD_ID + ":redwood"));
public static final BlockSetType MAHOGANY = register(new BlockSetType(BOPAPI.MOD_ID + ":mahogany"));
public static final BlockSetType JACARANDA = register(new BlockSetType(BOPAPI.MOD_ID + ":jacaranda"));
public static final BlockSetType PALM = register(new BlockSetType(BOPAPI.MOD_ID + ":palm"));
public static final BlockSetType WILLOW = register(new BlockSetType(BOPAPI.MOD_ID + ":willow"));
public static final BlockSetType DEAD = register(new BlockSetType(BOPAPI.MOD_ID + ":dead"));
public static final BlockSetType MAGIC = register(new BlockSetType(BOPAPI.MOD_ID + ":magic"));
public static final BlockSetType UMBRAN = register(new BlockSetType(BOPAPI.MOD_ID + ":umbran"));
public static final BlockSetType HELLBARK = register(new BlockSetType(BOPAPI.MOD_ID + ":hellbark"));
}
24 changes: 12 additions & 12 deletions src/main/java/biomesoplenty/api/block/BOPWoodTypes.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,22 @@
******************************************************************************/
package biomesoplenty.api.block;

import biomesoplenty.core.BiomesOPlenty;
import biomesoplenty.api.BOPAPI;
import net.minecraft.world.level.block.state.properties.WoodType;

import static net.minecraft.world.level.block.state.properties.WoodType.register;

public class BOPWoodTypes
{
public static final WoodType FIR = register(new WoodType(BiomesOPlenty.MOD_ID + ":fir", BOPBlockSetTypes.FIR));
public static final WoodType PINE = register(new WoodType(BiomesOPlenty.MOD_ID + ":pine", BOPBlockSetTypes.PINE));
public static final WoodType REDWOOD = register(new WoodType(BiomesOPlenty.MOD_ID + ":redwood", BOPBlockSetTypes.REDWOOD));
public static final WoodType MAHOGANY = register(new WoodType(BiomesOPlenty.MOD_ID + ":mahogany", BOPBlockSetTypes.MAHOGANY));
public static final WoodType JACARANDA = register(new WoodType(BiomesOPlenty.MOD_ID + ":jacaranda", BOPBlockSetTypes.JACARANDA));
public static final WoodType PALM = register(new WoodType(BiomesOPlenty.MOD_ID + ":palm", BOPBlockSetTypes.PALM));
public static final WoodType WILLOW = register(new WoodType(BiomesOPlenty.MOD_ID + ":willow", BOPBlockSetTypes.WILLOW));
public static final WoodType DEAD = register(new WoodType(BiomesOPlenty.MOD_ID + ":dead", BOPBlockSetTypes.DEAD));
public static final WoodType MAGIC = register(new WoodType(BiomesOPlenty.MOD_ID + ":magic", BOPBlockSetTypes.MAGIC));
public static final WoodType UMBRAN = register(new WoodType(BiomesOPlenty.MOD_ID + ":umbran", BOPBlockSetTypes.UMBRAN));
public static final WoodType HELLBARK = register(new WoodType(BiomesOPlenty.MOD_ID + ":hellbark", BOPBlockSetTypes.HELLBARK));
public static final WoodType FIR = register(new WoodType(BOPAPI.MOD_ID + ":fir", BOPBlockSetTypes.FIR));
public static final WoodType PINE = register(new WoodType(BOPAPI.MOD_ID + ":pine", BOPBlockSetTypes.PINE));
public static final WoodType REDWOOD = register(new WoodType(BOPAPI.MOD_ID + ":redwood", BOPBlockSetTypes.REDWOOD));
public static final WoodType MAHOGANY = register(new WoodType(BOPAPI.MOD_ID + ":mahogany", BOPBlockSetTypes.MAHOGANY));
public static final WoodType JACARANDA = register(new WoodType(BOPAPI.MOD_ID + ":jacaranda", BOPBlockSetTypes.JACARANDA));
public static final WoodType PALM = register(new WoodType(BOPAPI.MOD_ID + ":palm", BOPBlockSetTypes.PALM));
public static final WoodType WILLOW = register(new WoodType(BOPAPI.MOD_ID + ":willow", BOPBlockSetTypes.WILLOW));
public static final WoodType DEAD = register(new WoodType(BOPAPI.MOD_ID + ":dead", BOPBlockSetTypes.DEAD));
public static final WoodType MAGIC = register(new WoodType(BOPAPI.MOD_ID + ":magic", BOPBlockSetTypes.MAGIC));
public static final WoodType UMBRAN = register(new WoodType(BOPAPI.MOD_ID + ":umbran", BOPBlockSetTypes.UMBRAN));
public static final WoodType HELLBARK = register(new WoodType(BOPAPI.MOD_ID + ":hellbark", BOPBlockSetTypes.HELLBARK));
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
******************************************************************************/
package biomesoplenty.api.damagesource;

import biomesoplenty.core.BiomesOPlenty;
import biomesoplenty.api.BOPAPI;
import net.minecraft.core.registries.Registries;
import net.minecraft.resources.ResourceKey;
import net.minecraft.resources.ResourceLocation;
Expand All @@ -17,6 +17,6 @@ public class BOPDamageTypes

private static ResourceKey<DamageType> register(String name)
{
return ResourceKey.create(Registries.DAMAGE_TYPE, new ResourceLocation(BiomesOPlenty.MOD_ID, name));
return ResourceKey.create(Registries.DAMAGE_TYPE, new ResourceLocation(BOPAPI.MOD_ID, name));
}
}
3 changes: 2 additions & 1 deletion src/main/java/biomesoplenty/core/BiomesOPlenty.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

package biomesoplenty.core;

import biomesoplenty.api.BOPAPI;
import biomesoplenty.init.*;
import net.minecraft.core.particles.ParticleType;
import net.minecraft.core.registries.Registries;
Expand Down Expand Up @@ -38,7 +39,7 @@
@Mod(value = BiomesOPlenty.MOD_ID)
public class BiomesOPlenty
{
public static final String MOD_ID = "biomesoplenty";
public static final String MOD_ID = BOPAPI.MOD_ID;

public static final DeferredRegister<Biome> BIOME_REGISTER = DeferredRegister.create(Registries.BIOME, BiomesOPlenty.MOD_ID);
public static final DeferredRegister<Block> BLOCK_REGISTER = DeferredRegister.create(Registries.BLOCK, MOD_ID);
Expand Down

0 comments on commit dafd384

Please sign in to comment.