Skip to content

Commit

Permalink
Fix the datapack issue by correctly registering stuff. I still think …
Browse files Browse the repository at this point in the history
…moving most of it to datapacks is the better option though.

Bump Version.
  • Loading branch information
Nick1st committed Mar 23, 2023
1 parent 21ed466 commit e8d6e55
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 4 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ org.gradle.parallel=false
org.gradle.daemon=false

# Mod Properties
mod_version=2.5.2-alpha2
mod_version=2.5.2-alpha3
maven_group=qouteall
archives_base_name=immersive-portals

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class MiscUtilModEntry {
public MiscUtilModEntry() {
DimensionMisc.init();

//ExtraDimensionStorage.init();
ExtraDimensionStorage.init();

DynamicDimensionsImpl.init();

Expand All @@ -46,6 +46,6 @@ public static void serverTick(TickEvent.ServerTickEvent event) {
}

public static void registerCommand(RegisterCommandsEvent event) {
//DimsCommand.register(event.getDispatcher());
DimsCommand.register(event.getDispatcher());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public static void init() {
DimStackGameRule.init();
DimStackManagement.init();

//AlternateDimensions.init();
AlternateDimensions.init();

// Registry.register( //Fixme removal
// Registry.CHUNK_GENERATOR,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package qouteall.imm_ptl.peripheral.alternate_dimension;

import com.mojang.serialization.Codec;
import net.minecraft.core.registries.Registries;
import net.minecraft.world.level.biome.BiomeSource;
import net.minecraft.world.level.chunk.ChunkGenerator;
import net.minecraftforge.registries.DeferredRegister;
import net.minecraftforge.registries.RegistryObject;

public class PeripheralRegistries {

public static final DeferredRegister<Codec<? extends ChunkGenerator>> CHUNK_GENERATOR = DeferredRegister.create(Registries.CHUNK_GENERATOR, "immersive_portals");
public static final DeferredRegister<Codec<? extends BiomeSource>> BIOME_SOURCE = DeferredRegister.create(Registries.BIOME_SOURCE, "immersive_portals");

public static final RegistryObject<Codec<ErrorTerrainGenerator>> ERROR_TERRAIN_GENERATOR = CHUNK_GENERATOR.register("error_terrain_generator", () -> ErrorTerrainGenerator.codec);
public static final RegistryObject<Codec<NormalSkylandGenerator>> NORMAL_SKYLAND_GENERATOR = CHUNK_GENERATOR.register("normal_skyland_generator", () -> NormalSkylandGenerator.codec);
public static final RegistryObject<Codec<ChaosBiomeSource>> CHAOS_BIOME_SOURCE = BIOME_SOURCE.register("chaos_biome_source", () -> ChaosBiomeSource.CODEC);
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import net.minecraftforge.registries.RegistryObject;
import qouteall.imm_ptl.peripheral.CommandStickItem;
import qouteall.imm_ptl.peripheral.PeripheralModMain;
import qouteall.imm_ptl.peripheral.alternate_dimension.PeripheralRegistries;
import qouteall.imm_ptl.peripheral.guide.IPOuterClientMisc;

import javax.annotation.Nullable;
Expand Down Expand Up @@ -78,6 +79,8 @@ public PeripheralModEntry() {
PeripheralModEntry.registerBlockItems(); //TODO Move this to a real DeferredRegistry @Nick1st
BLOCKS.register(FMLJavaModLoadingContext.get().getModEventBus());
ITEMS.register(FMLJavaModLoadingContext.get().getModEventBus());
PeripheralRegistries.CHUNK_GENERATOR.register(FMLJavaModLoadingContext.get().getModEventBus());
PeripheralRegistries.BIOME_SOURCE.register(FMLJavaModLoadingContext.get().getModEventBus());
CommandStickItem.CommandStickData.register(FMLJavaModLoadingContext.get().getModEventBus());

PeripheralModMain.init();
Expand Down

0 comments on commit e8d6e55

Please sign in to comment.