Skip to content
This repository has been archived by the owner on May 13, 2023. It is now read-only.

Commit

Permalink
this doesn't compile yet, but have something to peek at
Browse files Browse the repository at this point in the history
  • Loading branch information
TehNut committed Aug 15, 2017
1 parent 973f101 commit 5fcdd97
Show file tree
Hide file tree
Showing 329 changed files with 3,265 additions and 2,971 deletions.
60 changes: 4 additions & 56 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,65 +5,37 @@ buildscript {
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:2.2-SNAPSHOT'
classpath 'org.ajoberstar:gradle-git:0.10.1'
classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT'
}
}

plugins {
id "net.minecraftforge.gradle.forge" version "2.0.2"
id 'com.matthewprenger.cursegradle' version '1.0.9'
id 'io.franzbecker.gradle-lombok' version '1.6'
id 'maven-publish'
}

apply plugin: 'maven-publish'

def build_number = 'CUSTOM'

if (System.getenv('BUILD_NUMBER') != null)
build_number = System.getenv('BUILD_NUMBER')

def username = 'BloodMagicDev'

def username = "${mod_name}"
if (project.hasProperty('dev_username'))
username = "${dev_username}"

group = package_group
archivesBaseName = mod_name
version = "${mc_version}-${mod_version}-${build_number}"

if (project.hasProperty('gitpush'))
version += "-ss"

import org.ajoberstar.grgit.*

ext.repo = Grgit.open(project.file('.'))
def gitHash = 'unknown'

if (new File(projectDir, '.git').exists())
gitHash = repo.log().find().abbreviatedId

repositories {
maven { url "http://dvs1.progwml6.com/files/maven" }
maven { url "http://tehnut.info/maven" }

ivy {
name "Thaumcraft"
artifactPattern "https://dl.dropboxusercontent.com/u/47135879/[module]-[revision]-deobf.[ext]"
}
ivy {
name "Baubles"
artifactPattern "https://dl.dropboxusercontent.com/u/47135879/[module]-1.8.9-[revision]-deobf.[ext]"
}
}

dependencies {
deobfCompile "mezz.jei:jei_${mc_version}:${jei_version}"
deobfCompile "mcp.mobius.waila:Hwyla:${waila_version}_${mc_version}"
deobfCompile "info.amerifrance.guideapi:Guide-API:${mc_version}-${guideapi_version}"

// compile name: "Thaumcraft", version: "${mc_version}-${thaumcraft_version}", ext: "jar"
// compile name: 'Baubles', version: "${baubles_version}", ext: 'jar'
}

minecraft {
Expand Down Expand Up @@ -104,31 +76,13 @@ if (JavaVersion.current().isJava8Compatible()) {
}
}

lombok {
version = "1.16.6"
sha256 = "e0a471be03e1e6b02bf019480cec7a3ac9801702bf7bf62f15d077ad4df8dd5d"
}

import io.franzbecker.gradle.lombok.task.DelombokTask

task delombok(type: DelombokTask) {
args("src/main/java", "-d", "build/sources/delomboked/java")
}

task delombokHelp(type: DelombokTask) {
args "--help"
}

tasks.eclipse.dependsOn installLombok

jar {
classifier = ''
manifest.mainAttributes(
"Built-By": System.getProperty('user.name'),
"Created-By": "${System.getProperty('java.vm.version')} + (${System.getProperty('java.vm.vendor')})",
"Implementation-Title": project.name,
"Implementation-Version": project.version,
"Git-Hash": gitHash,
"Built-On": "${mc_version}-${forge_version}"
)
}
Expand All @@ -147,11 +101,6 @@ task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
}

javadoc {
source = projectDir.path + "/build/sources/delomboked/java"
}

tasks.javadoc.dependsOn delombok
tasks.build.dependsOn javadoc, javadocJar, apiJar

tasks.withType(JavaCompile) { task ->
Expand Down Expand Up @@ -202,7 +151,7 @@ String getChangelogText() {

def curseRelations = {
optionalLibrary 'just-enough-items-jei'
optionalLibrary 'waila'
optionalLibrary 'hwyla'
requiredLibrary 'guide-api'
}

Expand All @@ -216,7 +165,6 @@ curseforge {
releaseType = 'beta'

relations curseRelations
addGameVersion '1.11.2'

addArtifact javadocJar
addArtifact sourceJar
Expand Down
14 changes: 7 additions & 7 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
mod_name=BloodMagic
package_group=com.wayoftime.bloodmagic
mod_version=2.1.11
mc_version=1.11
forge_version=13.19.1.2189
mod_version=2.2.0
mc_version=1.12
forge_version=14.21.1.2443
curse_id=224791

mappings_version=snapshot_20161212
mappings_version=snapshot_20170814

jei_version=4.0.5.203
waila_version=1.8.5-B19
guideapi_version=2.1.0-50
jei_version=4.7.5.85
waila_version=1.8.20-B35
guideapi_version=2.1.4-56
62 changes: 23 additions & 39 deletions src/main/java/WayofTime/bloodmagic/BloodMagic.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import WayofTime.bloodmagic.command.CommandBloodMagic;
import WayofTime.bloodmagic.api.registry.RitualRegistry;
import WayofTime.bloodmagic.meteor.MeteorConfigHandler;
import lombok.Getter;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.ItemStack;
import net.minecraft.launchwrapper.Launch;
Expand All @@ -15,85 +14,71 @@
import net.minecraftforge.fml.common.event.*;
import net.minecraftforge.fml.common.network.NetworkRegistry;
import WayofTime.bloodmagic.annot.Handler;
import WayofTime.bloodmagic.api.Constants;
import WayofTime.bloodmagic.api.util.helper.LogHelper;
import WayofTime.bloodmagic.client.gui.GuiHandler;
import WayofTime.bloodmagic.compat.ICompatibility;
import WayofTime.bloodmagic.network.BloodMagicPacketHandler;
import WayofTime.bloodmagic.proxy.CommonProxy;
import WayofTime.bloodmagic.registry.ModArmourTrackers;
import WayofTime.bloodmagic.registry.ModBlocks;
import WayofTime.bloodmagic.registry.ModCompatibility;
import WayofTime.bloodmagic.registry.RegistrarBloodMagicBlocks;
import WayofTime.bloodmagic.registry.ModCorruptionBlocks;
import WayofTime.bloodmagic.registry.ModEntities;
import WayofTime.bloodmagic.registry.ModItems;
import WayofTime.bloodmagic.registry.ModPotions;
import WayofTime.bloodmagic.registry.RegistrarBloodMagicItems;
import WayofTime.bloodmagic.registry.ModRecipes;
import WayofTime.bloodmagic.registry.ModRituals;
import WayofTime.bloodmagic.registry.ModTranquilityHandlers;
import WayofTime.bloodmagic.structures.ModDungeons;
import WayofTime.bloodmagic.util.Utils;
import WayofTime.bloodmagic.util.handler.IMCHandler;

@Mod(modid = Constants.Mod.MODID, name = Constants.Mod.NAME, version = Constants.Mod.VERSION, dependencies = Constants.Mod.DEPEND, guiFactory = "WayofTime.bloodmagic.client.gui.config.ConfigGuiFactory")
@Getter
@Mod(modid = BloodMagic.MODID, name = BloodMagic.NAME, version = BloodMagic.VERSION, dependencies = BloodMagic.DEPEND, guiFactory = "WayofTime.bloodmagic.client.gui.config.ConfigGuiFactory")
public class BloodMagic
{
@SidedProxy(serverSide = "WayofTime.bloodmagic.proxy.CommonProxy", clientSide = "WayofTime.bloodmagic.proxy.ClientProxy")
public static CommonProxy proxy;

@Mod.Instance(Constants.Mod.MODID)
public static BloodMagic instance;

public static CreativeTabs tabBloodMagic = new CreativeTabs(Constants.Mod.MODID + ".creativeTab")
public static final String MODID = "bloodmagic";
public static final String NAME = "Blood Magic: Alchemical Wizardry";
public static final String VERSION = "@VERSION@";
public static final String DEPEND = "required-after:guideapi;";
public static final CreativeTabs TAB_BM = new CreativeTabs(MODID + ".creativeTab")
{
@Override
public ItemStack getTabIconItem()
{
return new ItemStack(ModItems.BLOOD_ORB);
return new ItemStack(RegistrarBloodMagicItems.BLOOD_ORB);
}
};

public static CreativeTabs tabUpgradeTome = new CreativeTabs(Constants.Mod.MODID + ".creativeTabTome")
public static CreativeTabs TAB_TOMES = new CreativeTabs(MODID + ".creativeTabTome")
{
@Override
public ItemStack getTabIconItem()
{
return new ItemStack(ModItems.UPGRADE_TOME);
return new ItemStack(RegistrarBloodMagicItems.UPGRADE_TOME);
}

@Override
public boolean hasSearchBar()
{
return true;
}
}.setNoTitle().setBackgroundImageName("upgrade_tomes.png");

@Getter
private static boolean isDev = (Boolean) Launch.blackboard.get("fml.deobfuscatedEnvironment");
}.setNoTitle().setBackgroundImageName("items_search.png");
public static final boolean IS_DEV = (Boolean) Launch.blackboard.get("fml.deobfuscatedEnvironment");

static
{
tabUpgradeTome.setNoTitle().setBackgroundImageName("upgrade_tomes.png");

FluidRegistry.enableUniversalBucket();
}

private LogHelper logger = new LogHelper(Constants.Mod.MODID);
@SidedProxy(serverSide = "WayofTime.bloodmagic.proxy.CommonProxy", clientSide = "WayofTime.bloodmagic.proxy.ClientProxy")
public static CommonProxy proxy;
@Mod.Instance(BloodMagic.MODID)
public static BloodMagic instance;

public LogHelper logger = new LogHelper(MODID);
private File configDir;

@Mod.EventHandler
public void preInit(FMLPreInitializationEvent event)
{
configDir = new File(event.getModConfigurationDirectory(), "BloodMagic");
ConfigHandler.init(new File(getConfigDir(), "BloodMagic.cfg"));

ModBlocks.init();
ModItems.init();
ModPotions.init();
ModEntities.init();
ModCompatibility.registerModCompat();
ModCompatibility.loadCompat(ICompatibility.InitializationPhase.PRE_INIT);
ConfigHandler.init(new File(configDir, "BloodMagic.cfg"));

ModTranquilityHandlers.init();
ModDungeons.init();

Expand All @@ -105,13 +90,13 @@ public void preInit(FMLPreInitializationEvent event)
public void init(FMLInitializationEvent event)
{
BloodMagicPacketHandler.init();
RegistrarBloodMagicBlocks.registerBlacklists();

ModRecipes.init();
ModRituals.initRituals();
ModRituals.initImperfectRituals();
MeteorConfigHandler.init(new File(configDir, "meteors"));
ModArmourTrackers.init();
ModCompatibility.loadCompat(ICompatibility.InitializationPhase.INIT);
NetworkRegistry.INSTANCE.registerGuiHandler(BloodMagic.instance, new GuiHandler());
ModCorruptionBlocks.init();

Expand All @@ -122,7 +107,6 @@ public void init(FMLInitializationEvent event)
public void postInit(FMLPostInitializationEvent event)
{
ModRecipes.addCompressionHandlers();
ModCompatibility.loadCompat(ICompatibility.InitializationPhase.POST_INIT);

proxy.postInit();
}
Expand All @@ -135,7 +119,7 @@ public void loadComplete(FMLLoadCompleteEvent event) {
@Mod.EventHandler
public void modMapping(FMLModIdMappingEvent event)
{
ModCompatibility.loadCompat(ICompatibility.InitializationPhase.MAPPING);

}

@Mod.EventHandler
Expand Down
31 changes: 6 additions & 25 deletions src/main/java/WayofTime/bloodmagic/ConfigHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,9 @@
import java.util.Map;

import WayofTime.bloodmagic.meteor.MeteorConfigHandler;
import lombok.Getter;
import net.minecraft.block.Block;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.common.config.Configuration;
import net.minecraftforge.common.config.Property;
import net.minecraftforge.fml.client.event.ConfigChangedEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.registry.ForgeRegistries;
Expand All @@ -26,28 +24,23 @@
@Handler
public class ConfigHandler
{
@Getter
private static Configuration config;
public static Configuration config;

// Teleposer
public static String[] teleposerBlacklisting;
public static ArrayList<BlockStack> teleposerBlacklist = new ArrayList<BlockStack>();
public static ArrayList<BlockStack> teleposerBlacklist = new ArrayList<>();
public static List<String> teleposerBlacklistEntity;

// Transposition Sigil
public static String[] transpositionBlacklisting;
public static ArrayList<BlockStack> transpositionBlacklist = new ArrayList<BlockStack>();

// Item/Block Disabling
public static List<String> itemBlacklist;
public static List<String> blockBlacklist;
public static ArrayList<BlockStack> transpositionBlacklist = new ArrayList<>();

// Well of Suffering Blacklist
public static List<String> wellOfSufferingBlacklist;

// Blood Altar Sacrificial Values
public static String[] entitySacrificeValuesList;
public static Map<String, Integer> entitySacrificeValues = new HashMap<String, Integer>();
public static Map<String, Integer> entitySacrificeValues = new HashMap<>();

// Rituals
public static boolean ritualAnimalGrowth;
Expand Down Expand Up @@ -167,23 +160,11 @@ public static void init(File file)

public static void syncConfig()
{
boolean configVersionChanged = false;

String category;

category = "Version";
Property prop = config.get(category, "Config Version", Constants.Mod.VERSION);
if (!prop.getString().equals(Constants.Mod.VERSION))
{
configVersionChanged = true;
prop.setValue(Constants.Mod.VERSION);
}

category = "Item/Block Blacklisting";
config.addCustomCategoryComment(category, "Allows disabling of specific Blocks/Items.\nNote that using this may result in crashes. Use is not supported.");
config.setCategoryRequiresMcRestart(category, true);
itemBlacklist = Arrays.asList(config.getStringList("itemBlacklist", category, new String[] {}, "Items to not be registered. This requires their mapping name. Usually the same as the class name. Can be found in F3+H mode."));
blockBlacklist = Arrays.asList(config.getStringList("blockBlacklist", category, new String[] {}, "Blocks to not be registered. This requires their mapping name. Usually the same as the class name. Can be found in F3+H mode."));

category = "Teleposer Blacklist";
config.addCustomCategoryComment(category, "Block blacklisting");
Expand Down Expand Up @@ -306,7 +287,7 @@ public static void syncConfig()

category = "General";
config.addCustomCategoryComment(category, "General settings");
BloodMagicAPI.setLoggingEnabled(config.getBoolean("enableLogging", category, true, "Allows logging information to the console. Fatal errors will bypass this"));
BloodMagicAPI.loggingEnabled = config.getBoolean("enableLogging", category, true, "Allows logging information to the console. Fatal errors will bypass this");
sacrificialPackConversion = config.getInt("sacrificialPackConversion", category, 20, 0, 100, "Base multiplier for the Coat of Arms. DamageDealt * sacrificialPackConversion");
sacrificialDaggerDamage = config.getInt("sacrificialDaggerDamage", category, 2, 0, 10000, "Damage done from using the Sacrificial Dagger");
sacrificialDaggerConversion = config.getInt("sacrificialDaggerConversion", category, 100, 0, 10000, "Amount of LP received per damage point (not heart!)");
Expand Down Expand Up @@ -376,7 +357,7 @@ private static void buildEntitySacrificeValues()
@SubscribeEvent
public void onConfigChanged(ConfigChangedEvent event)
{
if (event.getModID().equals(Constants.Mod.MODID))
if (event.getModID().equals(BloodMagic.MODID))
{
syncConfig();
MeteorConfigHandler.handleMeteors(false);
Expand Down
Loading

0 comments on commit 5fcdd97

Please sign in to comment.