Small fixes, gunpowder recipe
This commit is contained in:
parent
3524a4036f
commit
58a389eaf2
7 changed files with 21 additions and 34 deletions
|
@ -4,7 +4,7 @@ import net.fabricmc.api.ModInitializer;
|
||||||
import net.fabricmc.loader.api.FabricLoader;
|
import net.fabricmc.loader.api.FabricLoader;
|
||||||
import net.minecraft.util.Identifier;
|
import net.minecraft.util.Identifier;
|
||||||
import ru.betterend.api.BetterEndPlugin;
|
import ru.betterend.api.BetterEndPlugin;
|
||||||
import ru.betterend.config.MainConfig;
|
import ru.betterend.config.Configs;
|
||||||
import ru.betterend.effects.EndEnchantments;
|
import ru.betterend.effects.EndEnchantments;
|
||||||
import ru.betterend.effects.EndPotions;
|
import ru.betterend.effects.EndPotions;
|
||||||
import ru.betterend.item.GuideBook;
|
import ru.betterend.item.GuideBook;
|
||||||
|
@ -55,7 +55,7 @@ public class BetterEnd implements ModInitializer {
|
||||||
}
|
}
|
||||||
|
|
||||||
FabricLoader.getInstance().getEntrypoints("betterend", BetterEndPlugin.class).forEach(BetterEndPlugin::register);
|
FabricLoader.getInstance().getEntrypoints("betterend", BetterEndPlugin.class).forEach(BetterEndPlugin::register);
|
||||||
MainConfig.saveConfig();
|
Configs.saveConfigs();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean hasGuideBook() {
|
public static boolean hasGuideBook() {
|
||||||
|
|
11
src/main/java/ru/betterend/config/Configs.java
Normal file
11
src/main/java/ru/betterend/config/Configs.java
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
package ru.betterend.config;
|
||||||
|
|
||||||
|
public class Configs {
|
||||||
|
public static final ItemConfig ITEM_CONFIG = new ItemConfig();
|
||||||
|
public static final BiomeConfig BIOME_CONFIG = new BiomeConfig();
|
||||||
|
|
||||||
|
public static void saveConfigs() {
|
||||||
|
ITEM_CONFIG.saveChanges();
|
||||||
|
BIOME_CONFIG.saveChanges();
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,28 +0,0 @@
|
||||||
package ru.betterend.config;
|
|
||||||
|
|
||||||
public class MainConfig {
|
|
||||||
public static final ItemConfig ITEM_CONFIG = getItemConfig();
|
|
||||||
public static final BiomeConfig BIOME_CONFIG = getBiomeConfig();
|
|
||||||
|
|
||||||
private static ItemConfig itemConfig;
|
|
||||||
private static BiomeConfig biomeConfig;
|
|
||||||
|
|
||||||
public static ItemConfig getItemConfig() {
|
|
||||||
if (itemConfig == null) {
|
|
||||||
itemConfig = new ItemConfig();
|
|
||||||
}
|
|
||||||
return itemConfig;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static BiomeConfig getBiomeConfig() {
|
|
||||||
if (biomeConfig == null) {
|
|
||||||
biomeConfig = new BiomeConfig();
|
|
||||||
}
|
|
||||||
return biomeConfig;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void saveConfig() {
|
|
||||||
itemConfig.saveChanges();
|
|
||||||
biomeConfig.saveChanges();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -147,6 +147,8 @@ public class CraftingRecipes {
|
||||||
.addMaterial('C', EndItems.CRYSTAL_SHARDS)
|
.addMaterial('C', EndItems.CRYSTAL_SHARDS)
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GridRecipe.make("sulphur_gunpowder", Items.GUNPOWDER).setList("SC").addMaterial('S', EndItems.CRYSTALLINE_SULPHUR).addMaterial('C', Items.COAL, Items.CHARCOAL).build();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void registerLantern(String name, Block lantern, Block slab) {
|
private static void registerLantern(String name, Block lantern, Block slab) {
|
||||||
|
|
|
@ -24,6 +24,7 @@ import net.minecraft.world.biome.Biome;
|
||||||
import net.minecraft.world.biome.Biome.Category;
|
import net.minecraft.world.biome.Biome.Category;
|
||||||
import net.minecraft.world.biome.BiomeKeys;
|
import net.minecraft.world.biome.BiomeKeys;
|
||||||
import ru.betterend.BetterEnd;
|
import ru.betterend.BetterEnd;
|
||||||
|
import ru.betterend.config.Configs;
|
||||||
import ru.betterend.util.JsonFactory;
|
import ru.betterend.util.JsonFactory;
|
||||||
import ru.betterend.world.biome.BiomeAmberLand;
|
import ru.betterend.world.biome.BiomeAmberLand;
|
||||||
import ru.betterend.world.biome.BiomeBlossomingSpires;
|
import ru.betterend.world.biome.BiomeBlossomingSpires;
|
||||||
|
@ -267,6 +268,7 @@ public class EndBiomes {
|
||||||
private static void registerBiomeDirect(EndBiome biome) {
|
private static void registerBiomeDirect(EndBiome biome) {
|
||||||
fillSet();
|
fillSet();
|
||||||
int possibleID = incID++;
|
int possibleID = incID++;
|
||||||
|
Configs.BIOME_CONFIG.getBoolean(biome, "enabled");
|
||||||
if (occupiedIDs.contains(possibleID)) {
|
if (occupiedIDs.contains(possibleID)) {
|
||||||
String message = "ID for biome " + biome.getID() + " is already occupied, changing biome ID from " + possibleID + " to ";
|
String message = "ID for biome " + biome.getID() + " is already occupied, changing biome ID from " + possibleID + " to ";
|
||||||
while (occupiedIDs.contains(possibleID)) {
|
while (occupiedIDs.contains(possibleID)) {
|
||||||
|
|
|
@ -87,10 +87,10 @@ import ru.betterend.blocks.complex.ColoredMaterial;
|
||||||
import ru.betterend.blocks.complex.StoneMaterial;
|
import ru.betterend.blocks.complex.StoneMaterial;
|
||||||
import ru.betterend.blocks.complex.WoodenMaterial;
|
import ru.betterend.blocks.complex.WoodenMaterial;
|
||||||
import ru.betterend.config.ItemConfig;
|
import ru.betterend.config.ItemConfig;
|
||||||
import ru.betterend.config.MainConfig;
|
import ru.betterend.config.Configs;
|
||||||
|
|
||||||
public class EndBlocks {
|
public class EndBlocks {
|
||||||
private static final ItemConfig CONFIG = MainConfig.ITEM_CONFIG;
|
private static final ItemConfig CONFIG = Configs.ITEM_CONFIG;
|
||||||
|
|
||||||
// Terrain //
|
// Terrain //
|
||||||
public static final Block ENDSTONE_DUST = registerBlock("endstone_dust", new BlockEndstoneDust());
|
public static final Block ENDSTONE_DUST = registerBlock("endstone_dust", new BlockEndstoneDust());
|
||||||
|
|
|
@ -35,7 +35,7 @@ import net.minecraft.util.registry.Registry;
|
||||||
|
|
||||||
import ru.betterend.BetterEnd;
|
import ru.betterend.BetterEnd;
|
||||||
import ru.betterend.config.ItemConfig;
|
import ru.betterend.config.ItemConfig;
|
||||||
import ru.betterend.config.MainConfig;
|
import ru.betterend.config.Configs;
|
||||||
import ru.betterend.item.EndArmorMaterial;
|
import ru.betterend.item.EndArmorMaterial;
|
||||||
import ru.betterend.item.EndAxe;
|
import ru.betterend.item.EndAxe;
|
||||||
import ru.betterend.item.EndHammer;
|
import ru.betterend.item.EndHammer;
|
||||||
|
@ -50,7 +50,7 @@ import ru.betterend.util.TagHelper;
|
||||||
|
|
||||||
public class EndItems {
|
public class EndItems {
|
||||||
|
|
||||||
private static final ItemConfig CONFIG = MainConfig.ITEM_CONFIG;
|
private static final ItemConfig CONFIG = Configs.ITEM_CONFIG;
|
||||||
private static final List<Item> MOD_BLOCKS = Lists.newArrayList();
|
private static final List<Item> MOD_BLOCKS = Lists.newArrayList();
|
||||||
private static final List<Item> MOD_ITEMS = Lists.newArrayList();
|
private static final List<Item> MOD_ITEMS = Lists.newArrayList();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue