Skip to content

Commit

Permalink
disable fluids and world features
Browse files Browse the repository at this point in the history
fix game crashing/not launching
  • Loading branch information
LucasPlacentino committed Aug 7, 2023
1 parent 785bcbb commit 554bed4
Show file tree
Hide file tree
Showing 12 changed files with 15 additions and 8 deletions.
9 changes: 6 additions & 3 deletions src/main/java/com/obsilab/mcsc/MCSC.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@

import com.mojang.logging.LogUtils;
import com.obsilab.mcsc.block.ModBlocks;
import com.obsilab.mcsc.block.custom.CrystalIngotBlock;
//import com.obsilab.mcsc.block.custom.CrystalIngotBlock;
import com.obsilab.mcsc.fluid.ModFluidTypes;
import com.obsilab.mcsc.fluid.ModFluids;
import com.obsilab.mcsc.item.ModItems;
import com.obsilab.mcsc.networking.ModMessages;
import com.obsilab.mcsc.world.feature.ModConfiguredFeatures;
import com.obsilab.mcsc.world.feature.ModFeatures;
import com.obsilab.mcsc.world.feature.ModPlacedFeatures;
import net.minecraft.client.Minecraft;
import net.minecraft.world.item.CreativeModeTabs;
import net.minecraft.world.item.Item;
Expand Down Expand Up @@ -54,8 +57,8 @@ public MCSC()
//ModFeatures.register(modEventBus); // registers features

//ModFluids before ModFluidTypes?
ModFluids.register(modEventBus); // registers fluids
ModFluidTypes.register(modEventBus); // registers fluid types
//ModFluids.register(modEventBus); // registers fluids
//ModFluidTypes.register(modEventBus); // registers fluid types

// Register the commonSetup method for modloading
modEventBus.addListener(this::commonSetup);
Expand Down
6 changes: 4 additions & 2 deletions src/main/java/com/obsilab/mcsc/block/ModBlocks.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,15 @@ public class ModBlocks {
.lightLevel(state -> state.getValue(TestBlock.ACTIVE) ? 8 : 0) // light level of 8 if block's ACTIVE property is true, else light level of 0
));

/*
public static final RegistryObject<LiquidBlock> TEST_FLUID_BLOCK = registerBlock(true,
"test_fluid_block",
() -> new LiquidBlock(
ModFluids.SOURCE_TEST_FLUID,
BlockBehaviour.Properties
.copy(Blocks.WATER)
));
*/

public static final RegistryObject<Block> CRYSTAL_INGOT_BLOCK = registerBlock(false, // crop block, so do not register BlockItem
"crystal_ingot",
Expand All @@ -85,7 +87,7 @@ public class ModBlocks {


private static <T extends Block> RegistryObject<T> registerBlock(Boolean register_block_item, String name, Supplier<T> block){
LOGGER.info("MCSC: Registering Block >> {} : {}", name, block.get()); //? .get() ?
LOGGER.info("MCSC: Registering Block >> {} : {}", name, block.toString()); //? .toString() ? .get() ?
RegistryObject<T> toReturn = BLOCKS.register(name, block);
if (register_block_item) {
registerBlockItem(name, toReturn);
Expand All @@ -94,7 +96,7 @@ private static <T extends Block> RegistryObject<T> registerBlock(Boolean registe
}

private static <T extends Block> RegistryObject<Item> registerBlockItem(String name, RegistryObject<T> block){
LOGGER.info("MCSC: Registering its blockItem >> {} : {}", name, block.get()); //? .get() ?
LOGGER.info("MCSC: Registering its blockItem >> {} : {}", name, block.toString()); //? .toString() ? .get() ?
return ModItems.ITEMS.register(name, () -> new BlockItem(block.get(), new Item.Properties()));
}

Expand Down
2 changes: 2 additions & 0 deletions src/main/java/com/obsilab/mcsc/fluid/ModFluids.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public class ModFluids {
public static final DeferredRegister<Fluid> FLUIDS =
DeferredRegister.create(ForgeRegistries.FLUIDS, MCSC.MOD_ID);

/*
public static final RegistryObject<FlowingFluid> SOURCE_TEST_FLUID =
FLUIDS.register("test_fluid", () -> new ForgeFlowingFluid.Source(ModFluids.TEST_FLUID_PROPERTIES));
Expand All @@ -34,6 +35,7 @@ public class ModFluids {
.block(ModBlocks.TEST_FLUID_BLOCK)
.bucket(ModItems.TEST_FLUID_BUCKET)
;
*/

public static void register(IEventBus eventBus) {
FLUIDS.register(eventBus);
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/com/obsilab/mcsc/item/ModItems.java
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ public class ModItems {
//.tab(ModCreativeModeTab.MCSC_TAB)
));

/*
public static final RegistryObject<Item> TEST_FLUID_BUCKET = registerItem(
"test_fluid_bucket", () -> new BucketItem(
ModFluids.SOURCE_TEST_FLUID,
Expand All @@ -141,9 +142,10 @@ public class ModItems {
//.group(MCSC.MCSC_GROUP)
//.tab(ModCreativeModeTab.MCSC_TAB)
));
*/

private static <T extends Item> RegistryObject<T> registerItem(String name, Supplier<T> item){
LOGGER.info("MCSC: Registering Item >> {} : {}", name, item.get()); //? .get() ?
LOGGER.info("MCSC: Registering Item >> {} : {}", name, item.toString()); //? .toString() ? .get() ?
return ITEMS.register(name, item);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import com.obsilab.mcsc.block.ModBlocks;
import net.minecraft.core.registries.Registries;
import net.minecraft.data.worldgen.features.FeatureUtils;
import net.minecraft.data.worldgen.features.OreFeatures;
import net.minecraft.resources.ResourceKey;
import net.minecraft.tags.BlockTags;
import net.minecraft.world.level.levelgen.feature.ConfiguredFeature;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import com.obsilab.mcsc.MCSC;
import net.minecraft.core.registries.Registries;
import net.minecraft.data.worldgen.features.FeatureUtils;
import net.minecraft.world.level.levelgen.VerticalAnchor;
import net.minecraft.world.level.levelgen.placement.*;
import net.minecraftforge.eventbus.api.IEventBus;
Expand Down

0 comments on commit 554bed4

Please # to comment.