Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/main/java/nc/config/NCConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -345,8 +345,9 @@ public class NCConfig {
public static boolean mushroom_gen;
public static int mushroom_gen_size;
public static int mushroom_gen_rate;

public static boolean register_fission_fluid_blocks;
public static boolean disableALLFluidItemBlocks;
public static boolean register_cofh_fluids;

public static boolean register_projecte_emc;
Expand Down Expand Up @@ -938,6 +939,8 @@ private static void syncConfig(boolean loadFromFile, boolean setFromConfig) {

Property propertyRegisterFluidBlocks = config.get(CATEGORY_OTHER, "register_fluid_blocks", false, Lang.localise("gui.config.other.register_fluid_blocks.comment"));
propertyRegisterFluidBlocks.setLanguageKey("gui.config.other.register_fluid_blocks");
Property propertyDisableALLFluidItemBlocks = config.get(CATEGORY_OTHER, "disableALLFluidItemBlocks", false, Lang.localise("gui.config.other.disable_ALL_Fluid_Item_Blocks.comment"));
propertyDisableALLFluidItemBlocks.setLanguageKey("gui.config.other.disable_ALL_Fluid_Item_Blocks");
Property propertyRegisterCoFHFluids = config.get(CATEGORY_OTHER, "register_cofh_fluids", false, Lang.localise("gui.config.other.register_cofh_fluids.comment"));
propertyRegisterCoFHFluids.setLanguageKey("gui.config.other.register_cofh_fluids");

Expand Down Expand Up @@ -1258,6 +1261,7 @@ private static void syncConfig(boolean loadFromFile, boolean setFromConfig) {
propertyOrderOther.add(propertyMushroomGenSize.getName());
propertyOrderOther.add(propertyMushroomGenRate.getName());
propertyOrderOther.add(propertyRegisterFluidBlocks.getName());
propertyOrderOther.add(propertyDisableALLFluidItemBlocks.getName());
propertyOrderOther.add(propertyRegisterCoFHFluids.getName());
propertyOrderOther.add(propertyRegisterProjectEEMC.getName());
propertyOrderOther.add(propertyOreDictRawMaterialRecipes.getName());
Expand Down Expand Up @@ -1558,6 +1562,7 @@ private static void syncConfig(boolean loadFromFile, boolean setFromConfig) {
mushroom_gen_size = propertyMushroomGenSize.getInt();
mushroom_gen_rate = propertyMushroomGenRate.getInt();
register_fission_fluid_blocks = propertyRegisterFluidBlocks.getBoolean();
disableALLFluidItemBlocks = propertyDisableALLFluidItemBlocks.getBoolean();
register_cofh_fluids = propertyRegisterCoFHFluids.getBoolean();
register_projecte_emc = propertyRegisterProjectEEMC.getBoolean();
ore_dict_raw_material_recipes = propertyOreDictRawMaterialRecipes.getBoolean();
Expand Down Expand Up @@ -1856,6 +1861,7 @@ private static void syncConfig(boolean loadFromFile, boolean setFromConfig) {
propertyMushroomGenSize.set(mushroom_gen_size);
propertyMushroomGenRate.set(mushroom_gen_rate);
propertyRegisterFluidBlocks.set(register_fission_fluid_blocks);
propertyDisableALLFluidItemBlocks.set(disableALLFluidItemBlocks);
propertyRegisterCoFHFluids.set(register_cofh_fluids);
propertyRegisterProjectEEMC.set(register_projecte_emc);
propertyOreDictRawMaterialRecipes.set(ore_dict_raw_material_recipes);
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/nc/init/NCCoolantFluids.java
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,10 @@ public static void register() {
if (NCConfig.register_fission_fluid_blocks && fluidBlock != null) registerBlock(fluidBlock);
}
}

public static void registerBlock(NCBlockFluid block) {
ForgeRegistries.BLOCKS.register(withName(block));
ForgeRegistries.ITEMS.register(new NCItemBlock(block).setRegistryName(block.getRegistryName()));
if (!NCConfig.disableALLFluidItemBlocks) ForgeRegistries.ITEMS.register(new NCItemBlock(block).setRegistryName(block.getRegistryName()));
NuclearCraft.proxy.registerFluidBlockRendering(block, "fluid_molten_colored");
}

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/nc/init/NCFissionFluids.java
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,10 @@ public static void register() {
}
}
}

public static void registerBlock(NCBlockFluid block) {
ForgeRegistries.BLOCKS.register(withName(block));
ForgeRegistries.ITEMS.register(new NCItemBlock(block).setRegistryName(block.getRegistryName()));
if (!NCConfig.disableALLFluidItemBlocks) ForgeRegistries.ITEMS.register(new NCItemBlock(block).setRegistryName(block.getRegistryName()));
NuclearCraft.proxy.registerFluidBlockRendering(block, "fluid_molten_colored");
}

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/nc/init/NCFluids.java
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,10 @@ public static void register() {
registerBlock(fluidPair.getRight());
}
}

public static void registerBlock(NCBlockFluid block) {
ForgeRegistries.BLOCKS.register(withName(block));
ForgeRegistries.ITEMS.register(new NCItemBlock(block).setRegistryName(block.getRegistryName()));
if (!NCConfig.disableALLFluidItemBlocks) ForgeRegistries.ITEMS.register(new NCItemBlock(block).setRegistryName(block.getRegistryName()));
NuclearCraft.proxy.registerFluidBlockRendering(block, block.getBlockName());
}

Expand Down
21 changes: 11 additions & 10 deletions src/main/java/nc/proxy/ClientProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -92,17 +92,18 @@ public EntityPlayer getPlayerEntity(MessageContext ctx) {
static {
ModelLoaderRegistry.registerLoader(ModelTexturedFluid.FluidTexturedLoader.INSTANCE);
}

@Override
public void registerFluidBlockRendering(Block block, String name) {
name = name.toLowerCase();
super.registerFluidBlockRendering(block, name);
FluidStateMapper mapper = new FluidStateMapper(name);

Item item = Item.getItemFromBlock(block);
ModelBakery.registerItemVariants(item);
ModelLoader.setCustomMeshDefinition(item, mapper);

if (!NCConfig.disableALLFluidItemBlocks) {
Item item = Item.getItemFromBlock(block);
ModelBakery.registerItemVariants(item);
ModelLoader.setCustomMeshDefinition(item, mapper);
}
//ModelLoader.setCustomStateMapper(block, new StateMap.Builder().ignore(block.LEVEL).build());
ModelLoader.setCustomStateMapper(block, mapper);
}
Expand All @@ -124,28 +125,28 @@ public ModelResourceLocation getModelLocation(ItemStack stack) {
return location;
}
}

@Override
public void initFluidColors() {
super.initFluidColors();
if (FMLCommonHandler.instance().getEffectiveSide().isClient()) {
BlockColors blockColors = Minecraft.getMinecraft().getBlockColors();
ItemColors itemColors = Minecraft.getMinecraft().getItemColors();

for (List<? extends Fluid> fluidList : Arrays.asList(NCCoolantFluids.fluidList, NCFissionFluids.fluidList)) {
for (Fluid fluid : fluidList) {
if (fluid.getBlock() instanceof NCBlockFluid fluidBlock) {
blockColors.registerBlockColorHandler(new ColorRenderer.FluidBlockColor(fluidBlock), fluidBlock);
itemColors.registerItemColorHandler(new ColorRenderer.FluidItemBlockColor(fluidBlock), fluidBlock);
if (!NCConfig.disableALLFluidItemBlocks) itemColors.registerItemColorHandler(new ColorRenderer.FluidItemBlockColor(fluidBlock), fluidBlock);
}
}
}

for (Pair<Fluid, NCBlockFluid> fluidPair : NCFluids.fluidPairList) {
NCBlockFluid fluidBlock = fluidPair.getRight();
if (fluidBlock != null) {
blockColors.registerBlockColorHandler(new ColorRenderer.FluidBlockColor(fluidBlock), fluidBlock);
itemColors.registerItemColorHandler(new ColorRenderer.FluidItemBlockColor(fluidBlock), fluidBlock);
if (!NCConfig.disableALLFluidItemBlocks) itemColors.registerItemColorHandler(new ColorRenderer.FluidItemBlockColor(fluidBlock), fluidBlock);
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/assets/nuclearcraft/lang/en_us.lang
Original file line number Diff line number Diff line change
Expand Up @@ -2425,6 +2425,8 @@ gui.config.other.dungeon_loot.comment=Will NuclearCraft loot generate in chests?

gui.config.other.register_fluid_blocks=Register Fission Fluid Blocks
gui.config.other.register_fluid_blocks.comment=Register fission fluid and molten salt coolant blocks? Keep false if running low on block IDs.
gui.config.other.disable_ALL_Fluid_Item_Blocks=Disable ALL Fluid Block Items
gui.config.other.disable_ALL_Fluid_Item_Blocks.comment=Disable the item forms of NuclearCraft fluid blocks? This allows JEI to display these fluids as proper fluid ingredients instead of block items. Requires a full restart and may break existing items or scripts that reference the fluid block items.
gui.config.other.register_cofh_fluids=Register CoFH Fluid Alternatives
gui.config.other.register_cofh_fluids.comment=Register alternative Thermal Foundation fluids? It is recommended that this is set to true if no CoFH mods are installed.

Expand Down