Update config to new system. Remove adaptor for now.

This commit is contained in:
Vincent Lee committed 2019-03-13 23:58:42 -05:00
1 parent 2500e3a52e
commit 2acde8a867
61 files changed
+317 -550

No files matched your search

@@ -44,7 +44,7 @@ public class RecipeManaInfusion {
catalystState = catalyst;
}
public Object getInput() {
public Ingredient getInput() {
return input;
}
@@ -38,7 +38,7 @@ public final class BaubleRenderHandler implements LayerRenderer<EntityPlayer> {
@Override
public void render(@Nonnull EntityPlayer player, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale) {
if(!ConfigHandler.renderBaubles || player.getActivePotionEffect(MobEffects.INVISIBILITY) != null)
if(!ConfigHandler.CLIENT.renderBaubles.get() || player.getActivePotionEffect(MobEffects.INVISIBILITY) != null)
return;
// todo 1.13
@@ -47,7 +47,7 @@ public final class DebugHandler {
@SubscribeEvent
public static void onDrawDebugText(RenderGameOverlayEvent.Text event) {
World world = Minecraft.getInstance().world;
if(ConfigHandler.debugInfo && Minecraft.getInstance().gameSettings.showDebugInfo) {
if(ConfigHandler.CLIENT.debugInfo.get() && Minecraft.getInstance().gameSettings.showDebugInfo) {
event.getLeft().add("");
String version = LibMisc.VERSION;
if(version.contains("GRADLE"))
@@ -67,15 +67,15 @@ public final class DebugHandler {
if(GuiScreen.isCtrlKeyDown() && GuiScreen.isShiftKeyDown()) {
event.getLeft().add(PREFIX + "Config Context");
event.getLeft().add(" shaders.enabled: " + ConfigHandler.useShaders);
event.getLeft().add(" shaders.secondaryUnit: " + ConfigHandler.glSecondaryTextureUnit);
event.getLeft().add(" shaders.enabled: " + ConfigHandler.CLIENT.useShaders.get());
event.getLeft().add(" shaders.secondaryUnit: " + ConfigHandler.CLIENT.glSecondaryTextureUnit.get());
GLCapabilities caps = GL.getCapabilities();
event.getLeft().add(PREFIX + "OpenGL Context");
event.getLeft().add(" GL_VERSION: " + GL11.glGetString(GL11.GL_VERSION));
event.getLeft().add(" GL_RENDERER: " + GL11.glGetString(GL11.GL_RENDERER));
event.getLeft().add(" GL_SHADING_LANGUAGE_VERSION: " + GL11.glGetString(GL20.GL_SHADING_LANGUAGE_VERSION));
event.getLeft().add(" GL_MAX_TEXTURE_IMAGE_UNITS_ARB: " + GL11.glGetInteger(ARBFragmentShader.GL_MAX_TEXTURE_IMAGE_UNITS_ARB));
event.getLeft().add(" GL_MAX_TEXTURE_IMAGE_UNITS_ARB: " + GL11.glGetInteger(GL20.GL_MAX_TEXTURE_IMAGE_UNITS_ARB));
event.getLeft().add(" GL_ARB_multitexture: " + caps.GL_ARB_multitexture);
event.getLeft().add(" GL_ARB_texture_non_power_of_two: " + caps.GL_ARB_texture_non_power_of_two);
event.getLeft().add(" OpenGL13: " + caps.OpenGL13);
@@ -287,7 +287,7 @@ public final class HUDHandler {
Minecraft mc = Minecraft.getInstance();
int width = 182;
int x = mc.mainWindow.getScaledWidth() / 2 - width / 2;
int y = mc.mainWindow.getScaledHeight() - ConfigHandler.manaBarHeight;
int y = mc.mainWindow.getScaledHeight() - ConfigHandler.CLIENT.manaBarHeight.get();
if(!hasCreative) {
if(totalMaxMana == 0)
@@ -401,7 +401,7 @@ public final class HUDHandler {
}
}
if(!ConfigHandler.lexicaOfflineMode && !draw && pos.entity == null) {
if(!ConfigHandler.CLIENT.lexicaOfflineMode.get() && !draw && pos.entity == null) {
profiler.startSection("wikiLookup");
if(!block.isAir(state, mc.world, pos.getBlockPos()) && !(block instanceof BlockLiquid)) {
IWikiProvider provider = WikiHooks.getWikiFor(block);
@@ -42,12 +42,12 @@ public class RenderLexicon {
"\"Vazkii did a thing.\" - cpw"
};
static int quote = -1;
private static int quote = -1;
@SubscribeEvent
public static void renderItem(RenderSpecificHandEvent evt) {
Minecraft mc = Minecraft.getInstance();
if(!ConfigHandler.lexicon3dModel
if(!ConfigHandler.CLIENT.lexicon3dModel.get()
|| mc.gameSettings.thirdPersonView != 0
|| mc.player.getHeldItem(evt.getHand()).isEmpty()
|| mc.player.getHeldItem(evt.getHand()).getItem() != ModItems.lexicon)
@@ -84,7 +84,7 @@ public final class TooltipAdditionDisplayHandler {
Gui.drawRect(x - 4, tooltipY - 4, x + 20, tooltipY + 26, 0x44000000);
Gui.drawRect(x - 6, tooltipY - 6, x + 22, tooltipY + 28, 0x44000000);
if(ConfigHandler.useShiftForQuickLookup ? GuiScreen.isShiftKeyDown() : GuiScreen.isCtrlKeyDown()) {
if(ConfigHandler.CLIENT.useShiftForQuickLookup.get() ? GuiScreen.isShiftKeyDown() : GuiScreen.isCtrlKeyDown()) {
lexiconLookupTime += ClientTickHandler.delta;
int cx = x + 8;
@@ -134,7 +134,7 @@ public final class TooltipAdditionDisplayHandler {
GlStateManager.scalef(0.5F, 0.5F, 1F);
boolean mac = Minecraft.IS_RUNNING_ON_MAC;
mc.fontRenderer.drawStringWithShadow(TextFormatting.BOLD + (ConfigHandler.useShiftForQuickLookup ? "Shift" : mac ? "Cmd" : "Ctrl"), (x + 10) * 2 - 16, (tooltipY + 8) * 2 + 20, 0xFFFFFFFF);
mc.fontRenderer.drawStringWithShadow(TextFormatting.BOLD + (ConfigHandler.CLIENT.useShiftForQuickLookup.get() ? "Shift" : mac ? "Cmd" : "Ctrl"), (x + 10) * 2 - 16, (tooltipY + 8) * 2 + 20, 0xFFFFFFFF);
GlStateManager.scalef(2F, 2F, 1F);
@@ -124,7 +124,7 @@ public final class ShaderHelper {
}
public static boolean useShaders() {
return ConfigHandler.useShaders && OpenGlHelper.shadersSupported && checkIncompatibleMods();
return ConfigHandler.CLIENT.useShaders.get() && OpenGlHelper.shadersSupported && checkIncompatibleMods();
}
private static boolean checkIncompatibleMods() {
@@ -160,13 +160,10 @@ public class ClientProxy implements IProxy {
ModChallenges.init();
if(ConfigHandler.boundBlockWireframe)
if(ConfigHandler.CLIENT.boundBlockWireframe.get())
MinecraftForge.EVENT_BUS.register(BoundTileRenderer.class);
if(ConfigHandler.useAdaptativeConfig)
MinecraftForge.EVENT_BUS.register(AdaptorNotifier.class);
if(ConfigHandler.enableSeasonalFeatures) {
if(ConfigHandler.CLIENT.enableSeasonalFeatures.get()) {
LocalDateTime now = LocalDateTime.now();
if (now.getMonth() == Month.DECEMBER && now.getDayOfMonth() >= 16 || now.getMonth() == Month.JANUARY && now.getDayOfMonth() <= 2)
jingleTheBells = true;
@@ -350,7 +347,7 @@ public class ClientProxy implements IProxy {
if(Thread.currentThread().getThreadGroup() == SidedThreadGroups.SERVER)
return false;
if(!ConfigHandler.useVanillaParticleLimiter)
if(!ConfigHandler.CLIENT.useVanillaParticleLimiter.get())
return true;
float chance = 1F;
@@ -68,7 +68,7 @@ public class FXSparkle extends Particle {
ParticleRenderDispatcher.fakeSparkleFxCount = 0;
GlStateManager.color4f(1.0F, 1.0F, 1.0F, 0.75F);
Minecraft.getInstance().textureManager.bindTexture(ConfigHandler.matrixMode ? vanillaParticles : particles);
Minecraft.getInstance().textureManager.bindTexture(ConfigHandler.CLIENT.matrixMode.get() ? vanillaParticles : particles);
tessellator.getBuffer().begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX_COLOR);
for(FXSparkle sparkle : queuedRenders)
@@ -78,7 +78,7 @@ public class FXWisp extends Particle {
ParticleRenderDispatcher.depthIgnoringWispFxCount = 0;
GlStateManager.color4f(1.0F, 1.0F, 1.0F, 0.75F);
Minecraft.getInstance().textureManager.bindTexture(ConfigHandler.matrixMode ? vanillaParticles : particles);
Minecraft.getInstance().textureManager.bindTexture(ConfigHandler.CLIENT.matrixMode.get() ? vanillaParticles : particles);
if(!queuedRenders.isEmpty()) {
tessellator.getBuffer().begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX_LMAP_COLOR);
@@ -55,13 +55,13 @@ public class GuiButtonCategory extends GuiButtonLexicon {
GL11.glBindTexture(GL11.GL_TEXTURE_2D, r.getTexture(resource).getGlTextureId());
ARBShaderObjects.glUniform1iARB(imageUniform, 0);
OpenGlHelper.glActiveTexture(ARBMultitexture.GL_TEXTURE0_ARB + ConfigHandler.glSecondaryTextureUnit);
OpenGlHelper.glActiveTexture(ARBMultitexture.GL_TEXTURE0_ARB + ConfigHandler.CLIENT.glSecondaryTextureUnit.get());
GlStateManager.enableTexture2D();
GL11.glGetInteger(GL11.GL_TEXTURE_BINDING_2D);
GL11.glBindTexture(GL11.GL_TEXTURE_2D, r.getTexture(stencilResource).getGlTextureId());
ARBShaderObjects.glUniform1iARB(maskUniform, ConfigHandler.glSecondaryTextureUnit);
ARBShaderObjects.glUniform1iARB(maskUniform, ConfigHandler.CLIENT.glSecondaryTextureUnit.get());
ARBShaderObjects.glUniform1fARB(heightMatchUniform, heightMatch);
};
@@ -30,7 +30,7 @@ public class LexiconModel implements IBakedModel {
public Pair<? extends IBakedModel, Matrix4f> handlePerspective(ItemCameraTransforms.TransformType cameraTransformType) {
if((cameraTransformType == ItemCameraTransforms.TransformType.FIRST_PERSON_RIGHT_HAND
|| cameraTransformType == ItemCameraTransforms.TransformType.FIRST_PERSON_LEFT_HAND)
&& ConfigHandler.lexicon3dModel)
&& ConfigHandler.CLIENT.lexicon3dModel.get())
return Pair.of(this, null);
IBakedModel original = Minecraft.getInstance().getBlockRendererDispatcher().getBlockModelShapes().getModelManager().getModel(path2D);
return original.handlePerspective(cameraTransformType);
@@ -29,7 +29,7 @@ public class RenderTileFloatingFlower extends TileEntityRenderer {
@Override
public void render(@Nonnull TileEntity tile, double d0, double d1, double d2, float t, int digProgress) {
if(ConfigHandler.staticFloaters)
if(ConfigHandler.CLIENT.staticFloaters.get())
return;
if (tile != null)
@@ -27,7 +27,7 @@ public final class SkyblockRenderEvents {
@SubscribeEvent
public static void onRender(RenderWorldLastEvent event) {
World world = Minecraft.getInstance().world;
if(ConfigHandler.enableFancySkybox && world.getDimension().getType() == DimensionType.OVERWORLD && (ConfigHandler.enableFancySkyboxInNormalWorlds || WorldTypeSkyblock.isWorldSkyblock(Minecraft.getInstance().world))) {
if(ConfigHandler.CLIENT.enableFancySkybox.get() && world.getDimension().getType() == DimensionType.OVERWORLD && (ConfigHandler.enableFancySkyboxInNormalWorlds || WorldTypeSkyblock.isWorldSkyblock(Minecraft.getInstance().world))) {
if(!(world.getDimension().getSkyRenderer() instanceof SkyblockSkyRenderer))
world.getDimension().setSkyRenderer(new SkyblockSkyRenderer());
}
@@ -24,7 +24,9 @@ import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fml.DeferredWorkQueue;
import net.minecraftforge.fml.DistExecutor;
import net.minecraftforge.fml.ModList;
import net.minecraftforge.fml.ModLoadingContext;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.config.ModConfig;
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
import net.minecraftforge.fml.event.server.FMLServerAboutToStartEvent;
import net.minecraftforge.fml.event.server.FMLServerStartingEvent;
@@ -115,6 +117,8 @@ public class Botania {
proxy = DistExecutor.runForDist(() -> ClientProxy::new, () -> ServerProxy::new);
proxy.registerHandlers();
FMLJavaModLoadingContext.get().getModEventBus().addListener(this::commonSetup);
ModLoadingContext.get().registerConfig(ModConfig.Type.CLIENT, ConfigHandler.CLIENT_SPEC);
ModLoadingContext.get().registerConfig(ModConfig.Type.COMMON, ConfigHandler.COMMON_SPEC);
MinecraftForge.EVENT_BUS.addListener(this::serverAboutToStart);
MinecraftForge.EVENT_BUS.addListener(this::serverStarting);
MinecraftForge.EVENT_BUS.addListener(this::serverStopping);
@@ -130,8 +134,6 @@ public class Botania {
BotaniaAPI.internalHandler = new InternalMethodHandler();
ConfigHandler.loadConfig(event.getSuggestedConfigurationFile());
PacketHandler.init();
ModBrews.init();
ModMultiblocks.init();
@@ -194,15 +196,17 @@ public class Botania {
FMLInterModComms.sendMessage("chiselsandbits", "ignoreblocklogic", b.getRegistryName().toString());
if(Botania.thaumcraftLoaded) {
if(ConfigHandler.enableThaumcraftAspects) {
MinecraftForge.EVENT_BUS.register(TCAspects.class);
if(ConfigHandler.COMMON.enableThaumcraftAspects.get()) {
// todo 1.13 MinecraftForge.EVENT_BUS.register(TCAspects.class);
}
ModBrews.initTC();
ModBrewRecipes.initTC();
}
/* todo 1.13
if(Botania.bcApiLoaded)
new StatementAPIPlugin();
*/
}
public void postInit(FMLPostInitializationEvent event) {
@@ -215,7 +219,6 @@ public class Botania {
}
ModBlocks.addDispenserBehaviours();
ConfigHandler.loadPostInit();
LexiconData.postInit();
int words = 0;
@@ -96,7 +96,7 @@ public class BlockModDoubleFlower extends BlockTallFlower implements ILexiconabl
int g = (hex & 0xFF00) >> 8;
int b = hex & 0xFF;
if(rand.nextDouble() < ConfigHandler.flowerParticleFrequency)
if(rand.nextDouble() < ConfigHandler.CLIENT.flowerParticleFrequency.get())
Botania.proxy.sparkleFX(pos.getX() + 0.3 + rand.nextFloat() * 0.5, pos.getY() + 0.5 + rand.nextFloat() * 0.5, pos.getZ() + 0.3 + rand.nextFloat() * 0.5, r / 255F, g / 255F, b / 255F, rand.nextFloat(), 5);
}
@@ -62,7 +62,7 @@ public class BlockModFlower extends BlockFlower implements ILexiconable, IGrowab
double y = pos.getY() + offset.y;
double z = pos.getZ() + offset.z;
if(rand.nextDouble() < ConfigHandler.flowerParticleFrequency)
if(rand.nextDouble() < ConfigHandler.CLIENT.flowerParticleFrequency.get())
Botania.proxy.sparkleFX(x + 0.3 + rand.nextFloat() * 0.5, y + 0.5 + rand.nextFloat() * 0.5, z + 0.3 + rand.nextFloat() * 0.5, r / 255F, g / 255F, b / 255F, rand.nextFloat(), 5);
}
@@ -70,7 +70,7 @@ public class BlockFloatingFlower extends BlockMod implements ILexiconable {
@Nonnull
@Override
public EnumBlockRenderType getRenderType(IBlockState state) {
return ConfigHandler.staticFloaters ? EnumBlockRenderType.MODEL : EnumBlockRenderType.ENTITYBLOCK_ANIMATED;
return ConfigHandler.CLIENT.staticFloaters.get() ? EnumBlockRenderType.MODEL : EnumBlockRenderType.ENTITYBLOCK_ANIMATED;
}
@Nonnull
@@ -107,7 +107,7 @@ public class BlockFloatingFlower extends BlockMod implements ILexiconable {
int g = (hex & 0xFF00) >> 8;
int b = hex & 0xFF;
if(rand.nextDouble() < ConfigHandler.flowerParticleFrequency)
if(rand.nextDouble() < ConfigHandler.CLIENT.flowerParticleFrequency.get())
Botania.proxy.sparkleFX(pos.getX() + 0.3 + rand.nextFloat() * 0.5, pos.getY() + 0.5 + rand.nextFloat() * 0.5, pos.getZ() + 0.3 + rand.nextFloat() * 0.5, r / 255F, g / 255F, b / 255F, rand.nextFloat(), 5);
}
@@ -75,7 +75,7 @@ public class BlockModMushroom extends BlockMushroom implements IHornHarvestable,
int g = (hex & 0xFF00) >> 8;
int b = hex & 0xFF;
if(rand.nextDouble() < ConfigHandler.flowerParticleFrequency * 0.25F)
if(rand.nextDouble() < ConfigHandler.CLIENT.flowerParticleFrequency.get() * 0.25F)
Botania.proxy.sparkleFX(pos.getX() + 0.3 + rand.nextFloat() * 0.5, pos.getY() + 0.5 + rand.nextFloat() * 0.5, pos.getZ() + 0.3 + rand.nextFloat() * 0.5, r / 255F, g / 255F, b / 255F, rand.nextFloat(), 5);
}
@@ -91,7 +91,7 @@ public class SubTilePureDaisy extends SubTileEntity {
if(recipe.set(world,coords, this)) {
world.addBlockEvent(getPos(), supertile.getBlockState().getBlock(), RECIPE_COMPLETE_EVENT, positionAt);
if(ConfigHandler.blockBreakParticles)
if(ConfigHandler.COMMON.blockBreakParticles.get())
supertile.getWorld().playEvent(2001, coords, Block.getStateId(recipe.getOutputState()));
}
}
@@ -58,7 +58,7 @@ public class SubTileAgricarnation extends SubTileFunctional {
Block block = supertile.getWorld().getBlockState(pos).getBlock();
mana -= 5;
supertile.getWorld().getPendingBlockTicks().scheduleTick(pos, block, 1);
if(ConfigHandler.blockBreakParticles)
if(ConfigHandler.COMMON.blockBreakParticles.get())
supertile.getWorld().playEvent(2005, pos, 6 + supertile.getWorld().rand.nextInt(4));
supertile.getWorld().playSound(null, x, y, z, ModSounds.agricarnation, SoundCategory.BLOCKS, 0.01F, 0.5F + (float) Math.random() * 0.5F);
@@ -43,7 +43,7 @@ public class SubTileClayconia extends SubTileFunctional {
BlockPos coords = getCoordsToPut();
if(coords != null) {
supertile.getWorld().removeBlock(coords);
if(ConfigHandler.blockBreakParticles)
if(ConfigHandler.COMMON.blockBreakParticles.get())
supertile.getWorld().playEvent(2001, coords, Block.getStateId(Blocks.SAND.getDefaultState()));
EntityItem item = new EntityItem(supertile.getWorld(), coords.getX() + 0.5, coords.getY() + 0.5, coords.getZ() + 0.5, new ItemStack(Items.CLAY_BALL));
supertile.getWorld().spawnEntity(item);
@@ -50,7 +50,7 @@ public class SubTileJadedAmaranthus extends SubTileFunctional {
if((supertile.getWorld().isAirBlock(up) || blockAbove.isReplaceable(supertile.getWorld(), up)) && stateAbove.getMaterial() != Material.WATER && ModBlocks.flower.canPlaceBlockAt(supertile.getWorld(), up)) {
EnumDyeColor color = EnumDyeColor.byId(supertile.getWorld().rand.nextInt(16));
IBlockState state = ModBlocks.getFlower(color).getDefaultState();
if(ConfigHandler.blockBreakParticles)
if(ConfigHandler.COMMON.blockBreakParticles.get())
supertile.getWorld().playEvent(2001, up, Block.getStateId(state));
supertile.getWorld().setBlockState(up, state, 1 | 2);
mana -= COST;
@@ -61,7 +61,7 @@ public class SubTileMarimorphosis extends SubTileFunctional {
IBlockState state = getStoneToPut(coords);
if(state != null) {
supertile.getWorld().setBlockState(coords, state);
if(ConfigHandler.blockBreakParticles)
if(ConfigHandler.COMMON.blockBreakParticles.get())
supertile.getWorld().playEvent(2001, coords, Block.getStateId(state));
mana -= COST;
@@ -61,7 +61,7 @@ public class SubTileOrechid extends SubTileFunctional {
IBlockState state = getOreToPut();
if(state != null) {
supertile.getWorld().setBlockState(coords, state);
if(ConfigHandler.blockBreakParticles)
if(ConfigHandler.COMMON.blockBreakParticles.get())
supertile.getWorld().playEvent(2001, coords, Block.getStateId(state));
supertile.getWorld().playSound(null, supertile.getPos(), ModSounds.orechid, SoundCategory.BLOCKS, 2F, 1F);
@@ -120,7 +120,7 @@ public class SubTileRannuncarpus extends SubTileFunctional {
if(stateToPlace != null) {
if(stateToPlace.getBlock().canPlaceBlockAt(supertile.getWorld(), coords)) {
supertile.getWorld().setBlockState(coords, stateToPlace, 1 | 2);
if(ConfigHandler.blockBreakParticles)
if(ConfigHandler.COMMON.blockBreakParticles.get())
supertile.getWorld().playEvent(2001, coords, Block.getStateId(stateToPlace));
validPositions.remove(coords);
ItemBlock.setTileEntityNBT(supertile.getWorld(), null, coords, stack);
@@ -87,7 +87,7 @@ public class SubTileMunchdew extends SubTileGenerating {
supertile.getWorld().removeBlock(breakCoords);
ticksWithoutEating = 0;
ateOnce = true;
if(ConfigHandler.blockBreakParticles)
if(ConfigHandler.COMMON.blockBreakParticles.get())
supertile.getWorld().playEvent(2001, breakCoords, Block.getStateId(state));
mana += manaPerLeaf;
}
@@ -133,7 +133,7 @@ public class TileAlfPortal extends TileMod implements ITickable {
if(ticksOpen > 60) {
ticksSinceLastItem++;
if(ConfigHandler.elfPortalParticlesEnabled)
if(world.isRemote && ConfigHandler.CLIENT.elfPortalParticlesEnabled.get())
blockParticle(state);
List<EntityItem> items = world.getEntitiesWithinAABB(EntityItem.class, aabb);
@@ -59,7 +59,7 @@ public class TilePylon extends TileEntity implements ITickable {
Vector3 centerBlock = new Vector3(centerPos.getX() + 0.5, centerPos.getY() + 0.75 + (Math.random() - 0.5 * 0.25), centerPos.getZ() + 0.5);
if(variant == BlockPylon.Variant.NATURA) {
if(ConfigHandler.elfPortalParticlesEnabled) {
if(ConfigHandler.CLIENT.elfPortalParticlesEnabled.get()) {
double worldTime = ticks;
worldTime += new Random(pos.hashCode()).nextInt(1000);
worldTime /= 5;
@@ -229,7 +229,7 @@ public class TilePool extends TileMod implements IManaPool, IKeyLocked, ISparkAt
}
case CHARGE_EFFECT_EVENT: {
if(world.isRemote) {
if(ConfigHandler.chargingAnimationEnabled) {
if(ConfigHandler.COMMON.chargingAnimationEnabled.get()) {
boolean outputting = param == 1;
Vector3 itemVec = Vector3.fromBlockPos(pos).add(0.5, 0.5 + Math.random() * 0.3, 0.5);
Vector3 tileVec = Vector3.fromBlockPos(pos).add(0.2 + Math.random() * 0.6, 0, 0.2 + Math.random() * 0.6);
@@ -311,7 +311,7 @@ public class TilePool extends TileMod implements IManaPool, IKeyLocked, ISparkAt
}
if(didSomething) {
if(ConfigHandler.chargingAnimationEnabled && world.rand.nextInt(20) == 0) {
if(ConfigHandler.COMMON.chargingAnimationEnabled.get() && world.rand.nextInt(20) == 0) {
world.addBlockEvent(getPos(), getBlockState().getBlock(), CHARGE_EFFECT_EVENT, outputting ? 1 : 0);
}
isDoingTransfer = outputting;
@@ -446,7 +446,7 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector,
burst.setShooterUUID(getIdentifier());
world.spawnEntity(burst);
burst.ping();
if(!ConfigHandler.silentSpreaders)
if(!ConfigHandler.COMMON.silentSpreaders.get())
world.playSound(null, pos, ModSounds.spreaderFire, SoundCategory.BLOCKS, 0.05F * (paddingColor != -1 ? 0.2F : 1F), 0.7F + 0.3F * (float) Math.random());
}
}
@@ -300,7 +300,7 @@ public final class BotaniaCreativeTab extends ItemGroup {
addItem(ModItems.ancientWillKaril);
addItem(ModItems.pinkinator);
addItem(ModItems.gaiaHead);
if(ConfigHandler.relicsEnabled) {
if(ConfigHandler.COMMON.relicsEnabled.get()) {
addItem(ModItems.dice);
addItem(ModItems.infiniteFruit);
addItem(ModItems.kingKey);
@@ -43,23 +43,23 @@ public final class BiomeDecorationHandler {
if(!flowers)
return;
int dist = Math.min(8, Math.max(1, ConfigHandler.flowerPatchSize));
for(int i = 0; i < ConfigHandler.flowerQuantity; i++) {
if(event.getRand().nextInt(ConfigHandler.flowerPatchChance) == 0) {
int dist = Math.min(8, Math.max(1, ConfigHandler.COMMON.flowerPatchSize.get()));
for(int i = 0; i < ConfigHandler.COMMON.flowerQuantity.get(); i++) {
if(event.getRand().nextInt(ConfigHandler.COMMON.flowerPatchChance.get()) == 0) {
int x = pos.getX() + event.getRand().nextInt(16) + 8;
int z = pos.getZ() + event.getRand().nextInt(16) + 8;
int y = event.getWorld().getTopSolidOrLiquidBlock(pos).getY();
EnumDyeColor color = EnumDyeColor.byMetadata(event.getRand().nextInt(16));
for(int j = 0; j < ConfigHandler.flowerDensity * ConfigHandler.flowerPatchChance; j++) {
for(int j = 0; j < ConfigHandler.COMMON.flowerDensity.get() * ConfigHandler.COMMON.flowerPatchChance.get(); j++) {
int x1 = x + event.getRand().nextInt(dist * 2) - dist;
int y1 = y + event.getRand().nextInt(4) - event.getRand().nextInt(4);
int z1 = z + event.getRand().nextInt(dist * 2) - dist;
BlockPos pos2 = new BlockPos(x1, y1, z1);
if(event.getWorld().isAirBlock(pos2) && (!event.getWorld().provider.isNether() || y1 < 127) && ModBlocks.flower.canPlaceBlockAt(event.getWorld(), pos2)) {
event.getWorld().setBlockState(pos2, ModBlocks.flower.getDefaultState().with(BotaniaStateProps.COLOR, color), 2);
if(event.getRand().nextDouble() < ConfigHandler.flowerTallChance && ((BlockModFlower) ModBlocks.flower).canGrow(event.getWorld(), pos2, event.getWorld().getBlockState(pos2), false)) {
if(event.getRand().nextDouble() < ConfigHandler.COMMON.flowerTallChance.get() && ((BlockModFlower) ModBlocks.flower).canGrow(event.getWorld(), pos2, event.getWorld().getBlockState(pos2), false)) {
Block block = ModBlocks.getDoubleFlower(color);
if(block instanceof BlockDoublePlant) {
((BlockDoublePlant) block).placeAt(event.getWorld(), pos2, 3);
@@ -70,7 +70,7 @@ public final class BiomeDecorationHandler {
}
}
for(int i = 0; i < ConfigHandler.mushroomQuantity; i++) {
for(int i = 0; i < ConfigHandler.COMMON.mushroomQuantity.get(); i++) {
int x = pos.getX() + event.getRand().nextInt(16) + 8;
int z = pos.getZ() + event.getRand().nextInt(16) + 8;
int y = event.getRand().nextInt(26) + 4;
@@ -10,432 +10,237 @@
*/
package vazkii.botania.common.core.handler;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.text.Style;
import net.minecraft.util.text.TextComponentString;
import net.minecraft.util.text.TextComponentTranslation;
import net.minecraft.util.text.TextFormatting;
import net.minecraftforge.common.config.Configuration;
import net.minecraftforge.common.config.Property;
import net.minecraftforge.fml.client.event.ConfigChangedEvent;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import vazkii.botania.common.Botania;
import vazkii.botania.common.lib.LibMisc;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import net.minecraftforge.common.ForgeConfigSpec;
import org.apache.commons.lang3.tuple.Pair;
public final class ConfigHandler {
public static Configuration config;
public static ConfigAdaptor adaptor;
public static class Client {
public final ForgeConfigSpec.BooleanValue useAdaptativeConfig;
public final ForgeConfigSpec.BooleanValue useShaders;
public final ForgeConfigSpec.BooleanValue lexiconRotatingItems;
public final ForgeConfigSpec.BooleanValue lexiconJustifiedText;
public final ForgeConfigSpec.BooleanValue subtlePowerSystem;
public final ForgeConfigSpec.BooleanValue staticWandBeam;
public final ForgeConfigSpec.BooleanValue boundBlockWireframe;
public final ForgeConfigSpec.BooleanValue lexicon3dModel;
public final ForgeConfigSpec.DoubleValue flowerParticleFrequency;
public final ForgeConfigSpec.BooleanValue elfPortalParticlesEnabled;
public final ForgeConfigSpec.BooleanValue useVanillaParticleLimiter;
public final ForgeConfigSpec.BooleanValue renderBaubles;
public final ForgeConfigSpec.BooleanValue enableSeasonalFeatures;
public final ForgeConfigSpec.BooleanValue useShiftForQuickLookup;
public final ForgeConfigSpec.BooleanValue lexicaOfflineMode;
public final ForgeConfigSpec.BooleanValue enableArmorModels;
public final ForgeConfigSpec.BooleanValue enableFancySkybox;
public final ForgeConfigSpec.BooleanValue enableFancySkyboxInNormalWorlds;
public final ForgeConfigSpec.IntValue manaBarHeight;
public final ForgeConfigSpec.IntValue flightBarHeight;
public final ForgeConfigSpec.IntValue flightBarBreathHeight;
public final ForgeConfigSpec.IntValue glSecondaryTextureUnit;
public static boolean useAdaptativeConfig = true;
public final ForgeConfigSpec.BooleanValue staticFloaters;
public final ForgeConfigSpec.BooleanValue debugInfo;
public final ForgeConfigSpec.BooleanValue matrixMode;
public final ForgeConfigSpec.BooleanValue referencesEnabled;
public static boolean useShaders = true;
public static boolean lexiconRotatingItems = true;
public static boolean lexiconJustifiedText = false;
public static boolean subtlePowerSystem = false;
public static boolean staticWandBeam = false;
public static boolean boundBlockWireframe = true;
public static boolean lexicon3dModel = true;
public static double flowerParticleFrequency = 0.75F;
public static boolean blockBreakParticles = true;
public static boolean blockBreakParticlesTool = true;
public static boolean elfPortalParticlesEnabled = true;
public static boolean chargingAnimationEnabled = true;
public static boolean useVanillaParticleLimiter = true;
public static boolean silentSpreaders = false;
public static boolean renderBaubles = true;
public static boolean enableSeasonalFeatures = true;
public static boolean useShiftForQuickLookup = false;
public static boolean lexicaOfflineMode = false;
public static boolean enableArmorModels = true;
public static boolean enableFancySkybox = true;
public static boolean enableFancySkyboxInNormalWorlds = false;
public static int manaBarHeight = 29;
public static int flightBarHeight = 49;
public static int flightBarBreathHeight = 59;
public static int glSecondaryTextureUnit = 7;
public static boolean altFlowerTextures = false;
public static boolean staticFloaters = false;
public static boolean debugInfo = true;
public static boolean matrixMode = false;
public static boolean referencesEnabled = true;
// public static boolean versionCheckEnabled = true;
public static int spreaderPositionShift = 1;
public static int spreaderTraceTime = 400;
public static boolean flowerForceCheck = true;
public static boolean enderPickpocketEnabled = true;
public static boolean fallenKanadeEnabled = true;
public static boolean enchanterEnabled = true;
public static boolean fluxfieldEnabled = true;
public static boolean relicsEnabled = true;
public static boolean ringOfOdinFireResist = true;
public static boolean invertMagnetRing = false;
public static boolean enableThaumcraftStablizers = true;
public static boolean enableThaumcraftAspects = true;
public static int harvestLevelWeight = 2;
public static int harvestLevelBore = 3;
public static int flowerQuantity = 2;
public static int flowerDensity = 2;
public static int flowerPatchSize = 6;
public static int flowerPatchChance = 16;
public static double flowerTallChance = 0.05;
public static int mushroomQuantity = 40;
public static void loadConfig(File configFile) {
config = new Configuration(configFile);
config.load();
load();
public Client(ForgeConfigSpec.Builder builder) {
useAdaptativeConfig = builder
.comment("Set this to false to disable the Adaptative Config. Adaptative Config changes any default config values from old versions to the new defaults to make sure you aren't missing out on changes because of old configs. It will not touch any values that were changed manually.")
.define("adaptive_config", true);
useShaders = builder
.comment("Set this to false to disable the use of shaders for some of the mod's renders.")
.define("shaders.enabled", true);
lexiconRotatingItems = builder
.comment("Set this to false to disable the rotating items in the petal and rune entries in the Lexica Botania.")
.define("lexicon.rotating_items", true);
lexiconJustifiedText = builder
.comment("Set this to true to enable justified text in the Lexica Botania's text pages.")
.define("lexicon.justified_text", false);
subtlePowerSystem = builder
.comment("Set this to true to set the power system's particles to be a lot more subtle. Good for low-end systems, if the particles are causing lag.")
.define("subtile_power_system", false);
staticWandBeam = builder
.comment("Set this to true to use a static wand beam that shows every single position of the burst, similar to the way it used to work on old Botania versions. Warning: Disabled by default because it may be laggy.")
.define("static_wand_beam", false);
boundBlockWireframe = builder
.comment("Set this to false to disable the wireframe when looking a block bound to something (spreaders, flowers, etc).")
.define("bound_block_wireframe", true);
lexicon3dModel = builder
.comment("Set this to false to disable the animated 3D render for the Lexica Botania.")
.define("lexicon.render_3d", true);
flowerParticleFrequency = builder
.comment("The frequency in which particles spawn from normal (worldgen) mystical flowers")
.defineInRange("particles.flower_frequency", 0.75, Double.MIN_VALUE, Double.MAX_VALUE);
elfPortalParticlesEnabled = builder
.comment("Set this to false to disable the particles in the elven portal.")
.define("particles.elf_portal", true);
useVanillaParticleLimiter = builder
.comment("Set this to false to always display all particles regardless of the \"Particles\" setting in the Vanilla options menu.")
.define("particles.use_vanilla", true);
renderBaubles = builder
.comment("Set this to false to disable rendering of baubles in the player.")
.define("render_baubles", true);
enableSeasonalFeatures = builder
.comment("Set this to false to disable seasonal features, such as halloween and christmas.")
.define("seasonal_features", true);
useShiftForQuickLookup = builder
.comment("Set this to true to use Shift instead of Ctrl for the inventory lexica botania quick lookup feature")
.define("quick_lookup.use_shift", false);
lexicaOfflineMode = builder
.comment("Set this to true to disable the wiki lookup feature of the lexica, for offline usage")
.define("quick_lookup.offline_mode", false);
enableArmorModels = builder
.comment("Set this to false to disable custom armor models")
.define("armor_models", true);
enableFancySkybox = builder
.comment("Set this to false to disable the fancy skybox in Garden of Glass")
.define("fancy_skybox.enabled", true);
enableFancySkyboxInNormalWorlds = builder
.comment("Set this to true to enable the fancy skybox in non Garden of Glass worlds. (Does not require Garden of Glass loaded to use, needs 'fancy_skybox.enabled' to be true as well)")
.define("fancy_skybox.normal_worlds", false);
manaBarHeight = builder
.comment("The height of the mana display bar in above the XP bar. You can change this if you have a mod that changes where the XP bar is.")
.defineInRange("hud.mana_bar.height", 29, 0, Integer.MAX_VALUE);
flightBarHeight = builder
.comment("The height of the Flugel Tiara flight bar. You can change this if you have a mod that adds a bar in that spot.")
.defineInRange("hud.flight_bar.height", 49, 0, Integer.MAX_VALUE);
flightBarBreathHeight = builder
.comment("The height of the Flugel Tiara flight bar if your breath bar is shown. You can change this if you have a mod that adds a bar in that spot.")
.defineInRange("hud.flight_bar_breath.height", 59, 0, Integer.MAX_VALUE);
glSecondaryTextureUnit = builder
.comment("The GL Texture Unit to use for the secondary sampler passed in to the Lexica Botania's category button shader. DO NOT TOUCH THIS IF YOU DON'T KNOW WHAT YOU'RE DOING")
.defineInRange("shaders.secondary_unit", 7, 0, Integer.MAX_VALUE);
staticFloaters = builder
.comment("Set this to true if you use lots of floating flowers and are experiencing rendering lag. Will disable the floating flowers' animations and render them statically for a major performance boost. Hit F3+A in-world after toggling this.")
.define("static_floaters", false);
debugInfo = builder
.comment("Set to false to disable Botania's messages in the F3 debug screen")
.define("debug_info", true);
matrixMode = builder
.comment("Set this to true if you are the chosen one. For lovers of glitch art and just general mad people.")
.define("matrix_mode", false);
referencesEnabled = builder
.comment("Set this to false to disable the references in the flower tooltips. (You monster D:)")
.define("references", true);
}
}
public static void load() {
String desc;
desc = "Set this to false to disable the Adaptative Config. Adaptative Config changes any default config values from old versions to the new defaults to make sure you aren't missing out on changes because of old configs. It will not touch any values that were changed manually.";
useAdaptativeConfig = loadPropBool("adaptativeConfig.enabled", desc, useAdaptativeConfig);
adaptor = new ConfigAdaptor(useAdaptativeConfig);
desc = "Set this to false to disable the use of shaders for some of the mod's renders.";
useShaders = loadPropBool("shaders.enabled", desc, useShaders);
desc = "Set this to false to disable the rotating items in the petal and rune entries in the Lexica Botania.";
lexiconRotatingItems = loadPropBool("lexicon.enable.rotatingItems", desc, lexiconRotatingItems);
desc = "Set this to true to enable justified text in the Lexica Botania's text pages.";
lexiconJustifiedText = loadPropBool("lexicon.enable.justifiedText", desc, lexiconJustifiedText);
desc = "Set this to true to set the power system's particles to be a lot more subtle. Good for low-end systems, if the particles are causing lag.";
subtlePowerSystem = loadPropBool("powerSystem.subtle", desc, subtlePowerSystem);
desc = "Set this to true to use a static wand beam that shows every single position of the burst, similar to the way it used to work on old Botania versions. Warning: Disabled by default because it may be laggy.";
staticWandBeam = loadPropBool("wandBeam.static", desc, staticWandBeam);
desc = "Set this to false to disable the wireframe when looking a block bound to something (spreaders, flowers, etc).";
boundBlockWireframe = loadPropBool("boundBlock.wireframe.enabled", desc, boundBlockWireframe);
desc = "Set this to false to disable the animated 3D render for the Lexica Botania.";
lexicon3dModel = loadPropBool("lexicon.render.3D", desc, lexicon3dModel);
desc = "The frequency in which particles spawn from normal (worldgen) mystical flowers";
flowerParticleFrequency = loadPropDouble("flowerParticles.frequency", desc, flowerParticleFrequency);
desc = "Set this to false to remove the block breaking particles from the flowers and other items in the mod.";
blockBreakParticles = loadPropBool("blockBreakingParticles.enabled", desc, blockBreakParticles);
desc = "Set this to false to remove the block breaking particles from the Mana Shatterer, as there can be a good amount in higher levels.";
blockBreakParticlesTool = loadPropBool("blockBreakingParticlesTool.enabled", desc, blockBreakParticlesTool);
desc = "Set this to false to disable the particles in the elven portal.";
elfPortalParticlesEnabled = loadPropBool("elfPortal.particles.enabled", desc, elfPortalParticlesEnabled);
desc = "Set this to false to disable the animation when an item is charging on top of a mana pool.";
chargingAnimationEnabled = loadPropBool("chargeAnimation.enabled", desc, chargingAnimationEnabled);
desc = "Set this to false to always display all particles regardless of the \"Particles\" setting in the Vanilla options menu.";
useVanillaParticleLimiter = loadPropBool("vanillaParticleConfig.enabled", desc, useVanillaParticleLimiter);
desc = "Set this to true to disable the mana spreader shooting sound.";
silentSpreaders = loadPropBool("manaSpreaders.silent", desc, silentSpreaders);
desc = "Set this to false to disable rendering of baubles in the player.";
renderBaubles = loadPropBool("baubleRender.enabled", desc, renderBaubles);
desc = "Set this to false to disable seasonal features, such as halloween and christmas.";
enableSeasonalFeatures = loadPropBool("seasonalFeatures.enabled", desc, enableSeasonalFeatures);
desc = "Set this to true to use Shift instead of Ctrl for the inventory lexica botania quick lookup feature.";
useShiftForQuickLookup = loadPropBool("quickLookup.useShift", desc, useShiftForQuickLookup);
desc = "Set this to true to disable the wiki lookup feature of the lexica, for offline usage.";
lexicaOfflineMode = loadPropBool("quickLookup.lexicaOfflineMode", desc, lexicaOfflineMode);
desc = "Set this to false to disable custom armor models.";
enableArmorModels = loadPropBool("armorModels.enable", desc, enableArmorModels);
desc = "Set this to false to disable the fancy skybox in Garden of Glass.";
enableFancySkybox = loadPropBool("fancySkybox.enable", desc, enableFancySkybox);
desc = "Set this to true to enable the fancy skybox in non Garden of Glass worlds. (Does not require Garden of Glass loaded to use, needs 'fancySkybox.enable' to be true as well)";
enableFancySkyboxInNormalWorlds = loadPropBool("fancySkybox.normalWorlds", desc, enableFancySkyboxInNormalWorlds);
desc = "The height of the mana display bar in above the XP bar. You can change this if you have a mod that changes where the XP bar is.";
manaBarHeight = loadPropInt("manaBar.height", desc, manaBarHeight);
desc = "The height of the Flugel Tiara flight bar. You can change this if you have a mod that adds a bar in that spot.";
flightBarHeight = loadPropInt("flightBar.height", desc, flightBarHeight);
desc = "The height of the Flugel Tiara flight bar if your breath bar is shown. You can change this if you have a mod that adds a bar in that spot.";
flightBarBreathHeight = loadPropInt("flightBarBreath.height", desc, flightBarBreathHeight);
desc = "The GL Texture Unit to use for the secondary sampler passed in to the Lexica Botania's category button shader. DO NOT TOUCH THIS IF YOU DON'T KNOW WHAT YOU'RE DOING";
glSecondaryTextureUnit = loadPropInt("shaders.secondaryUnit", desc, glSecondaryTextureUnit);
desc = "Set this to true if you use lots of floating flowers and are experiencing rendering lag. Will disable the floating flowers' animations and render them statically for a major performance boost. Hit F3+A in-world after toggling this.";
staticFloaters = loadPropBool("staticFloaters.enabled", desc, staticFloaters);
desc = "Set to false to disable Botania's messages in the F3 debug screen";
debugInfo = loadPropBool("debugInfo.enabled", desc, debugInfo);
desc = "Set this to true if you are the chosen one. For lovers of glitch art and just general mad people.";
matrixMode = loadPropBool("matrixMode.enabled", desc, matrixMode);
desc = "Set this to false to disable the references in the flower tooltips. (You monster D:)";
referencesEnabled = loadPropBool("references.enabled", desc, referencesEnabled);
// desc = "Set this to false to disable checking and alerting when new Botania versions come out. (keywords for noobs: update notification message)";
// versionCheckEnabled = loadPropBool("versionChecking.enabled", desc, versionCheckEnabled);
desc = "Do not ever touch this value if not asked to. Possible symptoms of doing so include your head turning backwards, the appearance of Titans near the walls or you being trapped in a game of Sword Art Online.";
spreaderPositionShift = loadPropInt("spreader.posShift", desc, spreaderPositionShift);
desc = "How many ticks into the future will mana spreaders attempt to predict where mana bursts go? Setting this lower will improve spreader performance, but will cause them to not fire at targets that are too far away.";
spreaderTraceTime = loadPropInt("spreader.traceTime", desc, spreaderTraceTime);
desc = "Turn this off ONLY IF you're on an extremely large world with an exaggerated count of Mana Spreaders/Mana Pools and are experiencing TPS lag. This toggles whether flowers are strict with their checking for connecting to pools/spreaders or just check whenever possible.";
flowerForceCheck = loadPropBool("flower.forceCheck", desc, flowerForceCheck);
desc = "Set to false to disable the ability for the Hand of Ender to pickpocket other players' ender chests.";
enderPickpocketEnabled = loadPropBool("enderPickpocket.enabled", desc, enderPickpocketEnabled);
desc = "Set this to false to disable the Fallen Kanade flower (gives Regeneration). This config option is here for those using Blood Magic. Note: Turning this off will not remove ones already in the world, it'll simply prevent the crafting.";
fallenKanadeEnabled = loadPropBool("fallenKanade.enabled", desc, fallenKanadeEnabled);
desc = "Set this to false to disable the Mana Enchanter. Since some people find it OP or something. This only disables the entry and creation. Old ones that are already in the world will stay.";
enchanterEnabled = loadPropBool("manaEnchanter.enabled", desc, enchanterEnabled);
desc = "Set this to false to disable the Mana Fluxfield (generates RF from mana). This only disables the entry and creation. Old ones that are already in the world will stay.";
fluxfieldEnabled = loadPropBool("manaFluxfield.enabled", desc, fluxfieldEnabled);
desc = "Set this to false to disable the Relic System. This only disables the entries, drops and achievements. Old ones that are already in the world will stay.";
relicsEnabled = loadPropBool("relics.enabled", desc, relicsEnabled);
desc = "Set this to false to make the Ring of Odin not apply fire resistance. Mostly for people who use Witchery transformations.";
ringOfOdinFireResist = loadPropBool("ringOfOdin.fireResist", desc, ringOfOdinFireResist);
desc = "Set this to true to invert the Ring of Magnetization's controls (from shift to stop to shift to work)";
invertMagnetRing = loadPropBool("magnetRing.invert", desc, invertMagnetRing);
desc = "Set this to false to disable Thaumcraft Infusion Stabilizing in botania blocks";
enableThaumcraftStablizers = loadPropBool("thaumraftStabilizers.enabled", desc, enableThaumcraftStablizers);
desc = "Set this to false to disable Thaumcraft aspects on Botania items";
enableThaumcraftAspects = loadPropBool("thaumcraftAspects.enabled", desc, enableThaumcraftAspects);
desc = "The harvest level of the Mana Lens: Weight. 3 is diamond level. Defaults to 2 (iron level)";
harvestLevelWeight = loadPropInt("harvestLevel.weightLens", desc, harvestLevelWeight);
desc = "The harvest level of the Mana Lens: Bore. 3 is diamond level. Defaults to 3";
harvestLevelBore = loadPropInt("harvestLevel.boreLens", desc, harvestLevelBore);
desc = "The quantity of Botania flower patches to generate in the world, defaults to 2, the lower the number the less patches generate.";
flowerQuantity = loadPropInt("worldgen.flower.quantity", desc, flowerQuantity);
desc = "The density of each Botania flower patch generated, defaults to 2, the lower the number, the less each patch will have.";
adaptor.addMappingInt(0, "worldgen.flower.density", 16);
adaptor.addMappingInt(238, "worldgen.flower.density", 2);
flowerDensity = loadPropInt("worldgen.flower.density", desc, flowerDensity);
desc = "The size of each Botania flower patch, defaults to 6. The larger this is the farther the each patch can spread";
flowerPatchSize = loadPropInt("worldgen.flower.patchSize", desc, flowerPatchSize);
desc = "The inverse chance for a Botania flower patch to be generated, defaults to 16. The higher this value is the less patches will exist and the more flower each will have.";
adaptor.addMappingInt(0, "worldgen.flower.patchChance", 4);
adaptor.addMappingInt(238, "worldgen.flower.patchChance", 16);
flowerPatchChance = loadPropInt("worldgen.flower.patchChance", desc, flowerPatchChance);
desc = "The chance for a Botania flower generated in a patch to be a tall flower. 0.1 is 10%, 1 is 100%. Defaults to 0.05";
adaptor.addMappingDouble(0, "worldgen.flower.tallChance", 0.1);
adaptor.addMappingDouble(238, "worldgen.flower.tallChance", 0.05);
flowerTallChance = loadPropDouble("worldgen.flower.tallChance", desc, flowerTallChance);
desc = "The quantity of Botania mushrooms to generate underground, in the world, defaults to 40, the lower the number the less patches generate.";
mushroomQuantity = loadPropInt("worldgen.mushroom.quantity", desc, mushroomQuantity);
if(config.hasChanged())
config.save();
public static final Client CLIENT;
public static final ForgeConfigSpec CLIENT_SPEC;
static {
final Pair<Client, ForgeConfigSpec> specPair = new ForgeConfigSpec.Builder().configure(Client::new);
CLIENT_SPEC = specPair.getRight();
CLIENT = specPair.getLeft();
}
public static void loadPostInit() {
if(config.hasChanged())
config.save();
public static class Common {
public final ForgeConfigSpec.BooleanValue blockBreakParticles;
public final ForgeConfigSpec.BooleanValue blockBreakParticlesTool;
public final ForgeConfigSpec.BooleanValue chargingAnimationEnabled;
public final ForgeConfigSpec.BooleanValue silentSpreaders;
public final ForgeConfigSpec.IntValue spreaderTraceTime;
public final ForgeConfigSpec.BooleanValue flowerForceCheck;
public final ForgeConfigSpec.BooleanValue enderPickpocketEnabled;
public final ForgeConfigSpec.BooleanValue fallenKanadeEnabled;
public final ForgeConfigSpec.BooleanValue enchanterEnabled;
public final ForgeConfigSpec.BooleanValue fluxfieldEnabled;
public final ForgeConfigSpec.BooleanValue relicsEnabled;
public final ForgeConfigSpec.BooleanValue ringOfOdinFireResist;
public final ForgeConfigSpec.BooleanValue invertMagnetRing;
public final ForgeConfigSpec.BooleanValue enableThaumcraftStablizers;
public final ForgeConfigSpec.BooleanValue enableThaumcraftAspects;
public final ForgeConfigSpec.IntValue harvestLevelWeight;
public final ForgeConfigSpec.IntValue harvestLevelBore;
public final ForgeConfigSpec.IntValue flowerQuantity;
public final ForgeConfigSpec.IntValue flowerDensity;
public final ForgeConfigSpec.IntValue flowerPatchSize;
public final ForgeConfigSpec.IntValue flowerPatchChance;
public final ForgeConfigSpec.DoubleValue flowerTallChance;
public final ForgeConfigSpec.IntValue mushroomQuantity;
public Common(ForgeConfigSpec.Builder builder) {
blockBreakParticles = builder
.comment("Set this to false to remove the block breaking particles from the flowers and other items in the mod.")
.define("blockBreakingParticles.enabled", true);
blockBreakParticlesTool = builder
.comment("Set this to false to remove the block breaking particles from the Mana Shatterer, as there can be a good amount in higher levels.")
.define("blockBreakingParticlesTool.enabled", true);
chargingAnimationEnabled = builder
.comment("Set this to false to disable the animation when an item is charging on top of a mana pool")
.define("chargeAnimation.enabled", true);
silentSpreaders = builder
.comment("Set this to true to disable the mana spreader shooting sound")
.define("manaSpreaders.silent", false);
spreaderTraceTime = builder
.comment("How many ticks into the future will mana spreaders attempt to predict where mana bursts go? Setting this lower will improve spreader performance, but will cause them to not fire at targets that are too far away.")
.defineInRange("spreader.traceTime", 400, 1, Integer.MAX_VALUE);
flowerForceCheck = builder
.comment("Turn this off ONLY IF you're on an extremely large world with an exaggerated count of Mana Spreaders/Mana Pools and are experiencing TPS lag. This toggles whether flowers are strict with their checking for connecting to pools/spreaders or just check whenever possible.")
.define("flower.forceCheck", true);
enderPickpocketEnabled = builder
.comment("Set to false to disable the ability for the Hand of Ender to pickpocket other players' ender chests")
.define("enderPickpocket.enabled", true);
fallenKanadeEnabled = builder
.comment("Set this to false to disable the Fallen Kanade flower (gives Regeneration). This config option is here for those using Blood Magic. Note: Turning this off will not remove ones already in the world, it'll simply prevent the crafting.")
.define("fallenKanade.enabled", true);
enchanterEnabled = builder
.comment("Set this to false to disable the Mana Enchanter. Since some people find it OP or something. This only disables the entry and creation. Old ones that are already in the world will stay.")
.define("manaEnchanter.enabled", true);
fluxfieldEnabled = builder
.comment("Set this to false to disable the Mana Fluxfield (generates FE from mana). This only disables the entry and creation. Old ones that are already in the world will stay.")
.define("manaFluxfield.enabled", true);
relicsEnabled = builder
.comment("Set this to false to disable the Relic System. This only disables the entries, drops and achievements. Old ones that are already in the world will stay.")
.define("relics.enabled", true);
ringOfOdinFireResist = builder
.comment("Set this to false to make the Ring of Odin not apply fire resistance. Mostly for people who use Witchery transformations.")
.define("ringOfOdin.fireResist", true);
invertMagnetRing = builder
.comment("Set this to true to invert the Ring of Magnetization's controls (from shift to stop to shift to work)")
.define("magnetRing.invert", false);
enableThaumcraftStablizers = builder
.comment("Set this to false to disable Thaumcraft Infusion Stabilizing in botania blocks")
.define("thaumraftStabilizers.enabled", true);
enableThaumcraftAspects = builder
.comment("Set this to false to disable Thaumcraft aspects on Botania items")
.define("thaumcraftAspects.enabled", true);
harvestLevelWeight = builder
.comment("The harvest level of the Mana Lens: Weight. 3 is diamond level. Defaults to 2 (iron level)")
.defineInRange("harvestLevel.weightLens", 2, 0, Integer.MAX_VALUE);
harvestLevelBore = builder
.comment("The harvest level of the Mana Lens: Bore. 3 is diamond level. Defaults to 3")
.defineInRange("harvestLevel.boreLens", 3, 0, Integer.MAX_VALUE);
flowerQuantity = builder
.comment("The quantity of Botania flower patches to generate in the world, defaults to 2, the lower the number the less patches generate.")
.defineInRange("worldgen.flower.quantity", 2, 0, Integer.MAX_VALUE);
flowerDensity = builder
.comment("The density of each Botania flower patch generated, defaults to 2, the lower the number, the less each patch will have.")
.defineInRange("worldgen.flower.density", 2, 0, Integer.MAX_VALUE);
flowerPatchSize = builder
.comment("The size of each Botania flower patch, defaults to 6. The larger this is the farther the each patch can spread")
.defineInRange("worldgen.flower.patchSize", 6, 0, Integer.MAX_VALUE);
flowerPatchChance = builder
.comment("The inverse chance for a Botania flower patch to be generated, defaults to 16. The higher this value is the less patches will exist and the more flower each will have.")
.defineInRange("worldgen.flower.patchChance", 16, 0, Integer.MAX_VALUE);
flowerTallChance = builder
.comment("The chance for a Botania flower generated in a patch to be a tall flower. 0.1 is 10%, 1 is 100%. Defaults to 0.05")
.defineInRange("worldgen.flower.tallChance", 0.05, 0, 1);
mushroomQuantity = builder
.comment("The quantity of Botania mushrooms to generate underground, in the world, defaults to 40, the lower the number the less patches generate.")
.defineInRange("worldgen.mushroom.quantity", 40, 0, Integer.MAX_VALUE);
}
}
public static int loadPropInt(String propName, String desc, int default_) {
Property prop = config.get(Configuration.CATEGORY_GENERAL, propName, default_);
prop.setComment(desc);
if(adaptor != null)
adaptor.adaptPropertyInt(prop, prop.getInt(default_));
return prop.getInt(default_);
}
public static double loadPropDouble(String propName, String desc, double default_) {
Property prop = config.get(Configuration.CATEGORY_GENERAL, propName, default_);
prop.setComment(desc);
if(adaptor != null)
adaptor.adaptPropertyDouble(prop, prop.getDouble(default_));
return prop.getDouble(default_);
}
public static boolean loadPropBool(String propName, String desc, boolean default_) {
Property prop = config.get(Configuration.CATEGORY_GENERAL, propName, default_);
prop.setComment(desc);
if(adaptor != null)
adaptor.adaptPropertyBool(prop, prop.getBoolean(default_));
return prop.getBoolean(default_);
}
public static class ConfigAdaptor {
private boolean enabled;
private int lastBuild;
private int currentBuild;
private final Map<String, List<AdaptableValue>> adaptableValues = new HashMap<>();
private final List<String> changes = new ArrayList<>();
public ConfigAdaptor(boolean enabled) {
this.enabled = enabled;
String lastVersion = Botania.proxy.getLastVersion();
try {
lastBuild = Integer.parseInt(lastVersion);
currentBuild = Integer.parseInt(LibMisc.BUILD);
} catch(NumberFormatException e) {
this.enabled = false;
}
}
public <T> void adaptProperty(Property prop, T val) {
if(!enabled)
return;
String name = prop.getName();
if(!adaptableValues.containsKey(name))
return;
AdaptableValue<T> bestValue = null;
for(AdaptableValue<T> value : adaptableValues.get(name)) {
if(value.version >= lastBuild) // If version is newer than what we last used we don't care about it
continue;
if(bestValue == null || value.version > bestValue.version)
bestValue = value;
}
if(bestValue != null) {
T expected = bestValue.value;
T def = (T) prop.getDefault();
if(areEqualNumbers(val, expected) && !areEqualNumbers(val, def)) {
prop.setValue(def.toString());
changes.add(" " + prop.getName() + ": " + val + " -> " + def);
}
}
}
public <T> void addMapping(int version, String key, T val) {
if(!enabled)
return;
AdaptableValue<T> adapt = new AdaptableValue<>(version, val);
if(!adaptableValues.containsKey(key)) {
adaptableValues.put(key, new ArrayList<>());
}
List<AdaptableValue> list = adaptableValues.get(key);
list.add(adapt);
}
public boolean areEqualNumbers(Object v1, Object v2) {
double epsilon = 1.0E-6;
float v1f = ((Number) v1).floatValue();
float v2f;
if(v2 instanceof String)
v2f = Float.parseFloat((String) v2);
else v2f = ((Number) v2).floatValue();
return Math.abs(v1f - v2f) < epsilon;
}
public void tellChanges(EntityPlayer player) {
if(changes.size() == 0)
return;
player.sendMessage(new TextComponentTranslation("botaniamisc.adaptativeConfigChanges").setStyle(new Style().setColor(TextFormatting.GOLD)));
for(String change : changes)
player.sendMessage(new TextComponentString(change).setStyle(new Style().setColor(TextFormatting.LIGHT_PURPLE)));
}
public void addMappingInt(int version, String key, int val) {
this.addMapping(version, key, val);
}
public void addMappingDouble(int version, String key, double val) {
this.addMapping(version, key, val);
}
public void addMappingBool(int version, String key, boolean val) {
this.addMapping(version, key, val);
}
public void adaptPropertyInt(Property prop, int val) {
this.adaptProperty(prop, val);
}
public void adaptPropertyDouble(Property prop, double val) {
this.adaptProperty(prop, val);
}
public void adaptPropertyBool(Property prop, boolean val) {
this.adaptProperty(prop, val);
}
public static class AdaptableValue<T> {
public final int version;
public final T value;
public final Class<? extends T> valueType;
public AdaptableValue(int version, T value) {
this.version = version;
this.value = value;
valueType = (Class<? extends T>) value.getClass();
}
}
}
@Mod.EventBusSubscriber(modid = LibMisc.MOD_ID)
public static class ChangeListener {
@SubscribeEvent
public static void onConfigChanged(ConfigChangedEvent.OnConfigChangedEvent eventArgs) {
if(eventArgs.getModID().equals(LibMisc.MOD_ID))
load();
}
public static final Common COMMON;
public static final ForgeConfigSpec COMMON_SPEC;
static {
final Pair<Common, ForgeConfigSpec> specPair = new ForgeConfigSpec.Builder().configure(Common::new);
COMMON_SPEC = specPair.getRight();
COMMON = specPair.getLeft();
}
}
@@ -212,7 +212,7 @@ public class InternalMethodHandler extends DummyMethodHandler {
@Override
public boolean shouldForceCheck() {
return ConfigHandler.flowerForceCheck;
return ConfigHandler.COMMON.flowerForceCheck.get();
}
@Override
@@ -16,7 +16,7 @@ public class EnableRelics implements LootCondition {
@Override
public boolean testCondition(@Nonnull Random rand, @Nonnull LootContext context) {
return ConfigHandler.relicsEnabled;
return ConfigHandler.COMMON.relicsEnabled.get();
}
public static class Serializer extends LootCondition.Serializer<EnableRelics> {
@@ -1,35 +0,0 @@
/**
* This class was created by <Vazkii>. It's distributed as
* part of the Botania Mod. Get the Source Code in github:
* https://github.com/Vazkii/Botania
*
* Botania is Open Source and distributed under the
* Botania License: http://botaniamod.net/license.php
*
* File Created @ [05/12/2015, 15:31:51 (GMT)]
*/
package vazkii.botania.common.core.version;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.gameevent.TickEvent.ClientTickEvent;
import vazkii.botania.common.core.handler.ConfigHandler;
public final class AdaptorNotifier {
private AdaptorNotifier() {}
private static boolean triedToWarnPlayer;
@SubscribeEvent
public static void onTick(ClientTickEvent event) {
if(!triedToWarnPlayer && Minecraft.getInstance().player != null) {
EntityPlayer player = Minecraft.getInstance().player;
ConfigHandler.adaptor.tellChanges(player);
triedToWarnPlayer = true;
}
}
}
@@ -21,6 +21,6 @@ public class FluxfieldConditionFactory implements IConditionSerializer {
@Override
public BooleanSupplier parse(@Nonnull JsonObject json) {
boolean value = JsonUtils.getBoolean(json , "value", true);
return () -> ConfigHandler.fluxfieldEnabled == value;
return () -> ConfigHandler.COMMON.fluxfieldEnabled.get() == value;
}
}
@@ -107,7 +107,7 @@ public final class ModPetalRecipes {
else orechidRecipe = BotaniaAPI.registerPetalRecipe(ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_ORECHID), gray, gray, yellow, green, red, runePride, runeGreed, redstoneRoot, pixieDust);
orechidIgnemRecipe = BotaniaAPI.registerPetalRecipe(ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_ORECHID_IGNEM), red, red, white, white, pink, runePride, runeGreed, redstoneRoot, pixieDust);
if(ConfigHandler.fallenKanadeEnabled)
if(ConfigHandler.COMMON.fallenKanadeEnabled.get())
fallenKanadeRecipe = BotaniaAPI.registerPetalRecipe(ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_FALLEN_KANADE), white, white, yellow, yellow, orange, runeSpring);
exoflameRecipe = BotaniaAPI.registerPetalRecipe(ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_EXOFLAME), red, red, gray, lightGray, runeFire, runeSummer);
agricarnationRecipe = BotaniaAPI.registerPetalRecipe(ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_AGRICARNATION), lime, lime, green, yellow, runeSpring, redstoneRoot);
@@ -86,7 +86,7 @@ public class EntityFallingStar extends EntityThrowableCopy {
if (pos.getBlockPos() != null) {
IBlockState state = world.getBlockState(pos.getBlockPos());
if(ConfigHandler.blockBreakParticles && !state.getBlock().isAir(state, world, pos.getBlockPos()))
if(ConfigHandler.COMMON.blockBreakParticles.get() && !state.getBlock().isAir(state, world, pos.getBlockPos()))
world.playEvent(2001, pos.getBlockPos(), Block.getStateId(state));
}
@@ -356,7 +356,7 @@ public class EntityManaBurst extends EntityThrowable implements IManaBurst {
this.noParticles = noParticles;
int iterations = 0;
while(isAlive() && iterations < ConfigHandler.spreaderTraceTime) {
while(isAlive() && iterations < ConfigHandler.COMMON.spreaderTraceTime.get()) {
tick();
iterations++;
}
@@ -469,7 +469,7 @@ public class EntityManaBurst extends EntityThrowable implements IManaBurst {
if(monocle)
Botania.proxy.setWispFXDepthTest(false);
if(ConfigHandler.subtlePowerSystem)
if(ConfigHandler.CLIENT.subtlePowerSystem.get())
Botania.proxy.wispFX(posX, posY, posZ, r, g, b, 0.1F * size, (float) (Math.random() - 0.5F) * 0.02F, (float) (Math.random() - 0.5F) * 0.02F, (float) (Math.random() - 0.5F) * 0.01F);
else {
float or = r;
@@ -568,7 +568,7 @@ public class EntityManaBurst extends EntityThrowable implements IManaBurst {
alreadyCollidedAt.add(rtr.getBlockPos());
if(dead && isAlive()) {
if(!fake) {
if(!fake && world.isRemote) {
Color color = new Color(getColor());
float r = color.getRed() / 255F;
float g = color.getGreen() / 255F;
@@ -578,7 +578,7 @@ public class EntityManaBurst extends EntityThrowable implements IManaBurst {
int maxMana = getStartingMana();
float size = (float) mana / (float) maxMana;
if(!ConfigHandler.subtlePowerSystem)
if(!ConfigHandler.CLIENT.subtlePowerSystem.get())
for(int i = 0; i < 4; i++)
Botania.proxy.wispFX(posX, posY, posZ, r, g, b, 0.15F * size, (float) (Math.random() - 0.5F) * 0.04F, (float) (Math.random() - 0.5F) * 0.04F, (float) (Math.random() - 0.5F) * 0.04F);
Botania.proxy.sparkleFX((float) posX, (float) posY, (float) posZ, r, g, b, 4, 2);
@@ -774,7 +774,7 @@ public class EntityManaBurst extends EntityThrowable implements IManaBurst {
}
protected boolean shouldDoFakeParticles() {
if (ConfigHandler.staticWandBeam)
if (ConfigHandler.CLIENT.staticWandBeam.get())
return true;
TileEntity tile = getShooter();
@@ -55,7 +55,7 @@ public class ItemEnderHand extends ItemMod implements IManaUsingItem, IBlockProv
@Override
public boolean itemInteractionForEntity(ItemStack stack, EntityPlayer player, EntityLivingBase entity, EnumHand hand) {
if(ConfigHandler.enderPickpocketEnabled && entity instanceof EntityPlayer && ManaItemHandler.requestManaExact(stack, player, COST_OTHER, false)) {
if(ConfigHandler.COMMON.enderPickpocketEnabled.get() && entity instanceof EntityPlayer && ManaItemHandler.requestManaExact(stack, player, COST_OTHER, false)) {
if(!player.world.isRemote)
player.displayGUIChest(((EntityPlayer) entity).getInventoryEnderChest());
ManaItemHandler.requestManaExact(stack, player, COST_OTHER, true);
@@ -126,7 +126,7 @@ public class ItemTwigWand extends ItemMod implements ICoordBoundItem {
}
}
if(block == Blocks.LAPIS_BLOCK && ConfigHandler.enchanterEnabled) {
if(block == Blocks.LAPIS_BLOCK && ConfigHandler.COMMON.enchanterEnabled.get()) {
EnumFacing.Axis axis = null;
if(TileEnchanter.canEnchanterExist(world, pos, EnumFacing.Axis.X))
axis = EnumFacing.Axis.X;
@@ -98,7 +98,7 @@ public class ItemBlockSpecialFlower extends ItemBlockMod implements IRecipeKeyPr
sig.addTooltip(par1ItemStack, world, stacks);
if(ConfigHandler.referencesEnabled) {
if(ConfigHandler.CLIENT.referencesEnabled.get()) {
String refUnlocalized = sig.getUnlocalizedLoreTextForStack(par1ItemStack);
String refLocalized = I18n.format(refUnlocalized);
if(!refLocalized.equals(refUnlocalized))
@@ -35,7 +35,7 @@ public abstract class ItemElementiumArmor extends ItemManasteelArmor implements
@Override
public String getArmorTextureAfterInk(ItemStack stack, EntityEquipmentSlot slot) {
return ConfigHandler.enableArmorModels ? LibResources.MODEL_ELEMENTIUM_NEW : slot == EntityEquipmentSlot.LEGS ? LibResources.MODEL_ELEMENTIUM_1 : LibResources.MODEL_ELEMENTIUM_0;
return ConfigHandler.CLIENT.enableArmorModels.get() ? LibResources.MODEL_ELEMENTIUM_NEW : slot == EntityEquipmentSlot.LEGS ? LibResources.MODEL_ELEMENTIUM_1 : LibResources.MODEL_ELEMENTIUM_0;
}
static ItemStack[] armorset;
@@ -95,13 +95,13 @@ public class ItemManasteelArmor extends ItemArmor implements IManaUsingItem, IPh
}
public String getArmorTextureAfterInk(ItemStack stack, EntityEquipmentSlot slot) {
return ConfigHandler.enableArmorModels ? LibResources.MODEL_MANASTEEL_NEW : slot == EntityEquipmentSlot.LEGS ? LibResources.MODEL_MANASTEEL_1 : LibResources.MODEL_MANASTEEL_0;
return ConfigHandler.CLIENT.enableArmorModels.get() ? LibResources.MODEL_MANASTEEL_NEW : slot == EntityEquipmentSlot.LEGS ? LibResources.MODEL_MANASTEEL_1 : LibResources.MODEL_MANASTEEL_0;
}
@Override
@OnlyIn(Dist.CLIENT)
public ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack itemStack, EntityEquipmentSlot armorSlot, ModelBiped original) {
if(ConfigHandler.enableArmorModels) {
if(ConfigHandler.CLIENT.enableArmorModels.get()) {
ModelBiped model = getArmorModelForSlot(entityLiving, itemStack, armorSlot);
if(model == null)
model = provideArmorModelForSlot(itemStack, armorSlot);
@@ -49,7 +49,7 @@ public class ItemManaweaveArmor extends ItemManasteelArmor {
@Override
public String getArmorTextureAfterInk(ItemStack stack, EntityEquipmentSlot slot) {
return ConfigHandler.enableArmorModels ? ClientProxy.jingleTheBells ? LibResources.MODEL_MANAWEAVE_NEW_HOLIDAY : LibResources.MODEL_MANAWEAVE_NEW : slot == EntityEquipmentSlot.LEGS ? LibResources.MODEL_MANAWEAVE_1 : LibResources.MODEL_MANAWEAVE_0;
return ConfigHandler.CLIENT.enableArmorModels.get() ? ClientProxy.jingleTheBells ? LibResources.MODEL_MANAWEAVE_NEW_HOLIDAY : LibResources.MODEL_MANAWEAVE_NEW : slot == EntityEquipmentSlot.LEGS ? LibResources.MODEL_MANAWEAVE_1 : LibResources.MODEL_MANAWEAVE_0;
}
@Nonnull
@@ -48,7 +48,7 @@ public class ItemTerrasteelArmor extends ItemManasteelArmor {
@Override
public String getArmorTextureAfterInk(ItemStack stack, EntityEquipmentSlot slot) {
return ConfigHandler.enableArmorModels ? LibResources.MODEL_TERRASTEEL_NEW : slot == EntityEquipmentSlot.CHEST ? LibResources.MODEL_TERRASTEEL_1 : LibResources.MODEL_TERRASTEEL_0;
return ConfigHandler.CLIENT.enableArmorModels.get() ? LibResources.MODEL_TERRASTEEL_NEW : slot == EntityEquipmentSlot.CHEST ? LibResources.MODEL_TERRASTEEL_1 : LibResources.MODEL_TERRASTEEL_0;
}
@Nonnull
@@ -483,9 +483,9 @@ public class ItemFlightTiara extends ItemBauble implements IManaUsingItem, IBaub
mc.textureManager.bindTexture(textureHud);
int xo = mc.mainWindow.getScaledWidth() / 2 + 10;
int x = xo;
int y = mc.mainWindow.getScaledHeight() - ConfigHandler.flightBarHeight;
int y = mc.mainWindow.getScaledHeight() - ConfigHandler.CLIENT.flightBarHeight.get();
if(player.areEyesInFluid(FluidTags.WATER))
y = mc.mainWindow.getScaledHeight() - ConfigHandler.flightBarBreathHeight;
y = mc.mainWindow.getScaledHeight() - ConfigHandler.CLIENT.flightBarBreathHeight.get();
int left = ItemNBTHelper.getInt(stack, TAG_TIME_LEFT, MAX_FLY_TIME);
@@ -84,7 +84,7 @@ public class ItemMagnetRing extends ItemBauble {
}
if(cooldown <= 0) {
if(player.isSneaking() == ConfigHandler.invertMagnetRing) {
if(player.isSneaking() == ConfigHandler.COMMON.invertMagnetRing.get()) {
double x = player.posX;
double y = player.posY + 0.75;
double z = player.posZ;
@@ -104,7 +104,7 @@ public final class ToolCommons {
damageItem(stack, 1, player, 80);
} else world.removeBlock(pos);
if(particles && ConfigHandler.blockBreakParticles && ConfigHandler.blockBreakParticlesTool)
if(particles && ConfigHandler.COMMON.blockBreakParticles.get() && ConfigHandler.COMMON.blockBreakParticlesTool.get())
world.playEvent(2001, pos, Block.getStateId(state));
}
}
@@ -26,7 +26,7 @@ public class ItemElementiumHelmRevealing extends ItemElementiumHelm {
@Override
public String getArmorTextureAfterInk(ItemStack stack, EntityEquipmentSlot slot) {
return ConfigHandler.enableArmorModels ? LibResources.MODEL_ELEMENTIUM_NEW : LibResources.MODEL_ELEMENTIUM_2;
return ConfigHandler.CLIENT.enableArmorModels.get() ? LibResources.MODEL_ELEMENTIUM_NEW : LibResources.MODEL_ELEMENTIUM_2;
}
}
@@ -26,7 +26,7 @@ public class ItemManasteelHelmRevealing extends ItemManasteelHelm {
@Override
public String getArmorTextureAfterInk(ItemStack stack, EntityEquipmentSlot slot) {
return ConfigHandler.enableArmorModels ? LibResources.MODEL_MANASTEEL_NEW : LibResources.MODEL_MANASTEEL_2;
return ConfigHandler.CLIENT.enableArmorModels.get() ? LibResources.MODEL_MANASTEEL_NEW : LibResources.MODEL_MANASTEEL_2;
}
}
@@ -26,7 +26,7 @@ public class ItemTerrasteelHelmRevealing extends ItemTerrasteelHelm {
@Override
public String getArmorTextureAfterInk(ItemStack stack, EntityEquipmentSlot slot) {
return ConfigHandler.enableArmorModels ? LibResources.MODEL_TERRASTEEL_NEW : LibResources.MODEL_TERRASTEEL_2;
return ConfigHandler.CLIENT.enableArmorModels.get() ? LibResources.MODEL_TERRASTEEL_NEW : LibResources.MODEL_TERRASTEEL_2;
}
}
@@ -45,7 +45,7 @@ public class LensMine extends Lens {
if(warp && (block == ModBlocks.pistonRelay || block == Blocks.PISTON || block == Blocks.MOVING_PISTON || block == Blocks.PISTON_HEAD))
return false;
int harvestLevel = ConfigHandler.harvestLevelBore;
int harvestLevel = ConfigHandler.COMMON.harvestLevelBore.get();
TileEntity tile = world.getTileEntity(collidePos);
@@ -62,7 +62,7 @@ public class LensMine extends Lens {
float chance = net.minecraftforge.event.ForgeEventFactory.fireBlockHarvesting(items, world, collidePos, state, 0, 1.0f, false, null);
world.removeBlock(collidePos);
if(ConfigHandler.blockBreakParticles)
if(ConfigHandler.COMMON.blockBreakParticles.get())
world.playEvent(2001, collidePos, Block.getStateId(state));
boolean offBounds = source.getY() < 0;
@@ -31,7 +31,7 @@ public class LensWeight extends Lens {
@Override
public boolean collideBurst(IManaBurst burst, EntityThrowable entity, RayTraceResult pos, boolean isManaBlock, boolean dead, ItemStack stack) {
if(!entity.world.isRemote && !burst.isFake() && pos.type == RayTraceResult.Type.BLOCK) {
int harvestLevel = ConfigHandler.harvestLevelWeight;
int harvestLevel = ConfigHandler.COMMON.harvestLevelWeight.get();
BlockPos bPos = pos.getBlockPos();
Block block = entity.world.getBlockState(bPos).getBlock();
@@ -43,7 +43,7 @@ public class ItemOdinRing extends ItemRelicBauble {
damageNegations.add(DamageSource.DROWN.damageType);
damageNegations.add(DamageSource.FALL.damageType);
damageNegations.add(DamageSource.LAVA.damageType);
if(ConfigHandler.ringOfOdinFireResist) {
if(ConfigHandler.COMMON.ringOfOdinFireResist.get()) {
damageNegations.add(DamageSource.IN_FIRE.damageType);
damageNegations.add(DamageSource.ON_FIRE.damageType);
}
@@ -54,7 +54,7 @@ public class ItemOdinRing extends ItemRelicBauble {
@Override
public void onValidPlayerWornTick(ItemStack stack, EntityPlayer player) {
if(player.isBurning() && ConfigHandler.ringOfOdinFireResist)
if(player.isBurning() && ConfigHandler.COMMON.ringOfOdinFireResist.get())
player.extinguish();
}
@@ -443,7 +443,7 @@ public final class LexiconData {
sparkUpgrades.setLexiconPages(new PageText("0"), new PageText("1"), new PageText("2"), new PageText("3"),
new PageText("4"), new PageCraftingRecipe("5", ModCraftingRecipes.recipesSparkUpgrades));
if (ConfigHandler.fluxfieldEnabled) {
if (ConfigHandler.COMMON.fluxfieldEnabled.get()) {
rfGenerator = new BasicLexiconEntry(LibLexicon.MANA_RF_GENERATOR, categoryMana);
rfGenerator.setLexiconPages(new PageText("0"),
new PageCraftingRecipe("1", ModCraftingRecipes.recipeRFGenerator));
@@ -568,7 +568,7 @@ public final class LexiconData {
orechidIgnem = new AlfheimLexiconEntry(LibLexicon.FFLOWER_ORECHID_IGNEM, categoryFunctionalFlowers);
orechidIgnem.setLexiconPages(new PageText("0"), new PagePetalRecipe<>("1", ModPetalRecipes.orechidIgnemRecipe));
if (ConfigHandler.fallenKanadeEnabled) {
if (ConfigHandler.COMMON.fallenKanadeEnabled.get()) {
fallenKanade = new BasicLexiconEntry(LibLexicon.FFLOWER_FALLEN_KANADE, categoryFunctionalFlowers);
fallenKanade.setLexiconPages(new PageText(Botania.bloodMagicLoaded ? "0a" : "0"),
new PagePetalRecipe<>("1", ModPetalRecipes.fallenKanadeRecipe));
@@ -689,7 +689,7 @@ public final class LexiconData {
pylon = new BasicLexiconEntry(LibLexicon.DEVICE_PYLON, categoryDevices);
pylon.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCraftingRecipes.recipePylon));
if (ConfigHandler.enchanterEnabled) {
if (ConfigHandler.COMMON.enchanterEnabled.get()) {
manaEnchanting = new BasicLexiconEntry(LibLexicon.DEVICE_MANA_ENCHANTING, categoryDevices);
manaEnchanting
.setLexiconPages(new PageText("0"), new PageText("1"),
@@ -1057,8 +1057,8 @@ public final class LexiconData {
new PageManaInfusionRecipe("2", ModManaInfusionRecipes.pistonRelayRecipe));
enderHand = new BasicLexiconEntry(LibLexicon.ENDER_ENDER_HAND, categoryEnder);
enderHand.setLexiconPages(new PageText(ConfigHandler.enderPickpocketEnabled ? "0" : "0a"), new PageText("2"),
new PageCraftingRecipe(ConfigHandler.enderPickpocketEnabled ? "1" : "1a",
enderHand.setLexiconPages(new PageText(ConfigHandler.COMMON.enderPickpocketEnabled.get() ? "0" : "0a"), new PageText("2"),
new PageCraftingRecipe(ConfigHandler.COMMON.enderPickpocketEnabled.get() ? "1" : "1a",
ModCraftingRecipes.recipeEnderHand));
enderDagger = new BasicLexiconEntry(LibLexicon.ENDER_ENDER_DAGGER, categoryEnder);
@@ -1299,7 +1299,7 @@ public final class LexiconData {
new PageLoreText("4"), new PageLoreText("5"), new PageLoreText("6"), new PageLoreText("7"))
.setIcon(new ItemStack(Items.WRITABLE_BOOK));
if (ConfigHandler.relicsEnabled) {
if (ConfigHandler.COMMON.relicsEnabled.get()) {
relics = new AlfheimLexiconEntry(LibLexicon.ALF_RELICS, categoryAlfhomancy);
relics.setLexiconPages(new PageText("0")).setIcon(new ItemStack(ModItems.dice));
@@ -1407,7 +1407,7 @@ public final class LexiconData {
if (Botania.thaumcraftLoaded) {
tcIntegration = new CompatLexiconEntry(LibLexicon.MISC_TC_INTEGRATION, BotaniaAPI.categoryMisc, "Thaumcraft");
if (ConfigHandler.enableThaumcraftStablizers)
if (ConfigHandler.COMMON.enableThaumcraftStablizers.get())
tcIntegration.setLexiconPages(new PageText("0"), new PageText("1"),
new PageCraftingRecipe("2", ModCraftingRecipes.recipeHelmetOfRevealing), new PageText("3"),
new PageManaInfusionRecipe("4", ModManaInfusionRecipes.manaInkwellRecipe), new PageText("5"),
@@ -75,11 +75,8 @@ public class PageManaInfusionRecipe extends PageRecipe {
TextureManager render = Minecraft.getInstance().textureManager;
FontRenderer font = Minecraft.getInstance().fontRenderer;
Object input = recipe.getInput();
if(input instanceof String)
input = OreDictionary.getOres((String) input).get(0);
renderItemAtGridPos(gui, 1, 1, (ItemStack) input, false);
if(recipe.getInput().getMatchingStacks().length > 0)
renderItemAtGridPos(gui, 1, 1, recipe.getInput().getMatchingStacks()[0], false);
renderItemAtGridPos(gui, 2, 1, renderStack, false);
@@ -71,7 +71,7 @@ public class PagePetalRecipe<T extends RecipePetals> extends PageRecipe {
List<Object> inputs = recipe.getInputs();
int degreePerInput = (int) (360F / inputs.size());
float currentDegree = ConfigHandler.lexiconRotatingItems ? GuiScreen.isShiftKeyDown() ? ticksElapsed : ticksElapsed + ClientTickHandler.partialTicks : 0;
float currentDegree = ConfigHandler.CLIENT.lexiconRotatingItems.get() ? GuiScreen.isShiftKeyDown() ? ticksElapsed : ticksElapsed + ClientTickHandler.partialTicks : 0;
int inputIndex = ticksElapsed / 40;
for(Object obj : inputs) {
@@ -87,7 +87,7 @@ public class PageText extends LexiconPage {
int spacing = 4;
int wcount = words.size();
int compensationSpaces = 0;
boolean justify = ConfigHandler.lexiconJustifiedText && wcount > 0 && lines.size() > i && !lines.get(i + 1).isEmpty();
boolean justify = ConfigHandler.CLIENT.lexiconJustifiedText.get() && wcount > 0 && lines.size() > i && !lines.get(i + 1).isEmpty();
if(justify) {
String s = Joiner.on("").join(words);