Commit 10ce1374 authored by Dennis Bonke's avatar Dennis Bonke Committed by Dennis

Trying to play sound and more testing, people will hate me

Signed-off-by: default avatarDennis <admin@dennisbonke.com>
parent 543ae5f9
......@@ -46,6 +46,8 @@ else
println "!! No build number set !!"
}
idea.module.inheritOutputDirs = true
project.buildnumber = "5"
version = "1.7.10-0.2.2-B1" + "-" + project.buildnumber
......
......@@ -3,12 +3,15 @@ package com.advancedmods.advancedtools;
import com.advancedmods.advancedtools.common.generic.creativetabs.CreativeTabATCombat;
import com.advancedmods.advancedtools.common.generic.creativetabs.CreativeTabATMaterials;
import com.advancedmods.advancedtools.common.generic.creativetabs.CreativeTabATTools;
import com.advancedmods.advancedtools.core.ATAchievements;
import com.advancedmods.advancedtools.core.ATCompat;
import com.advancedmods.advancedtools.core.ATConfigHandler;
import com.advancedmods.advancedtools.core.ATProps;
import com.advancedmods.advancedtools.core.ATRegistry;
import com.advancedmods.amcore.core.environment.IMCHandler;
import com.advancedmods.amcore.core.mod.BaseMod;
import com.advancedmods.amcore.core.mod.updater.UpdateManager;
import com.google.common.base.Stopwatch;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
......@@ -18,10 +21,14 @@ import cpw.mods.fml.common.event.FMLInterModComms;
import cpw.mods.fml.common.event.FMLLoadCompleteEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.event.FMLServerStartingEvent;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraftforge.common.AchievementPage;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import java.util.concurrent.TimeUnit;
/**
* Created by Dennisbonke on 17-3-2015.
*/
......@@ -29,11 +36,11 @@ import org.apache.logging.log4j.Logger;
public class AdvancedTools extends BaseMod {
@Instance(ATProps.modid)
public static AdvancedTools instance;
public AdvancedTools instance;
public static Logger log = LogManager.getLogger(ATProps.modid);
public static final String issueURL = "http://git.zsinfo.nl/AdvancedMods/AdvancedTools/issues";
public static final String updateURL = "http://git.zsinfo.nl/AdvancedMods/AdvancedTools/tree/master/VERSION";
public static final String downloadURL = "http://git.zsinfo.nl/AdvancedMods/AdvancedTools/pipelines";
private final String issueURL = "http://git.zsinfo.nl/AdvancedMods/AdvancedTools/issues";
private final String updateURL = "http://git.zsinfo.nl/AdvancedMods/AdvancedTools/tree/master/VERSION";
private final String downloadURL = "http://git.zsinfo.nl/AdvancedMods/AdvancedTools/pipelines";
// Creative Tabs
public static final CreativeTabs tabCombat = new CreativeTabATCombat("Combat");
public static final CreativeTabs tabMaterials = new CreativeTabATMaterials("Materials");
......@@ -43,8 +50,22 @@ public class AdvancedTools extends BaseMod {
public void preInit(FMLPreInitializationEvent event) {
// Starting mod
final Stopwatch watch = Stopwatch.createStarted();
log.info("Starting Advanced Tools version: " + ATProps.version + "...");
log.info("Entering Pre-Init...");
// Config
try {
log.info("Loading config...");
ATConfigHandler.init(event.getSuggestedConfigurationFile());
FMLCommonHandler.instance().bus().register(new ATConfigHandler());
log.info("Config loaded!");
} catch (Exception e) {
log.error("=============================ERROR!=============================");
log.error("Failed to load the configuration file, using defaults!");
log.error("Please report this as a bug report with the stacktrace, the minecraft log and a mod list + version to: " + issueURL);
log.error("=============================ERROR!=============================");
e.printStackTrace();
}
// Update Checker
try {
log.info("Starting Update Checker for Advanced Tools...");
......@@ -81,18 +102,31 @@ public class AdvancedTools extends BaseMod {
log.info("OreDictionary registered.");
} catch (Exception e) {
log.error("=============================ERROR!=============================");
log.error("Failed to add ingots and nuggets, printing stacktrace...");
log.error("Failed to add ingots and nuggets to the OreDictionary, printing stacktrace...");
log.error("This is a severe error, skipping the recipe registration to avoid problems!");
log.error("Please report this as a bug report with the stacktrace, the minecraft log and a mod list + version to: " + issueURL);
log.error("=============================ERROR!=============================");
e.printStackTrace();
}
log.info("Pre-Init Finished");
// Achievements test
try {
log.info("Initializing achievements...");
AchievementPage.registerAchievementPage(new ATAchievements());
log.info("Achievements registered");
} catch (Exception e) {
log.error("=============================ERROR!=============================");
log.error("Failed to add achievements, printing stacktrace...");
log.error("Please report this as a bug report with the stacktrace, the minecraft log and a mod list + version to: " + issueURL);
log.error("=============================ERROR!=============================");
e.printStackTrace();
}
log.info("Pre-Init Finished in " + watch.elapsed(TimeUnit.MILLISECONDS) + " ms");
}
@EventHandler
public void Init(FMLInitializationEvent event) {
public void init(FMLInitializationEvent event) {
final Stopwatch watch = Stopwatch.createStarted();
log.info("Entering Init...");
// Recipe Registry
try {
......@@ -118,7 +152,7 @@ public class AdvancedTools extends BaseMod {
log.error("Please report this as a bug report with the stacktrace, the minecraft log and a mod list + version to: " + issueURL);
log.error("=============================ERROR!=============================");
}
log.info("Init Finished");
log.info("Init Finished in " + watch.elapsed(TimeUnit.MILLISECONDS) + " ms");
log.info("Mod loaded");
}
......@@ -163,6 +197,11 @@ public class AdvancedTools extends BaseMod {
}
}
@EventHandler
public void serverStarting(FMLServerStartingEvent event) {
}
public String getModId() {
return ATProps.modid;
}
......@@ -175,4 +214,7 @@ public class AdvancedTools extends BaseMod {
return ATProps.version;
}
public static Logger getLog() {
return log;
}
}
package com.advancedmods.advancedtools.common.generic;
import net.minecraft.entity.Entity;
import net.minecraft.util.DamageSource;
import net.minecraft.util.EntityDamageSource;
/*
Created by Dennis on 25-9-2018 12:56
Copyright 2018
*/
public class TestDamageSource extends EntityDamageSource {
public TestDamageSource(Entity source) {
super("testop", source);
}
@Override
public DamageSource setDamageBypassesArmor() {
return super.setDamageBypassesArmor();
}
}
package com.advancedmods.advancedtools.common.generic.block;
import com.advancedmods.advancedtools.AdvancedTools;
import com.advancedmods.amcore.AMCore;
import net.minecraft.block.material.Material;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World;
public class ATFlagBlock extends ATBlock {
public ATFlagBlock() {
super(Material.rock);
this.setCreativeTab(AdvancedTools.tabMaterials);
this.setBlockName("flagtestblock");
this.setBlockTextureName("advancedtools:flagTestBlock");
}
@Override
public boolean onBlockActivated(World world, int p_149727_2_, int p_149727_3_, int p_149727_4_, EntityPlayer player, int p_149727_6_, float p_149727_7_, float p_149727_8_, float p_149727_9_) {
AMCore.log.warn("Block activated!");
world.playRecord("advancedtools:blocks.ussr", (int) player.posX, (int) player.posY, (int) player.posZ);
return super.onBlockActivated(world, p_149727_2_, p_149727_3_, p_149727_4_, player, p_149727_6_, p_149727_7_, p_149727_8_, p_149727_9_);
}
}
package com.advancedmods.advancedtools.common.items;
import com.advancedmods.advancedtools.AdvancedTools;
import com.advancedmods.advancedtools.common.generic.TestDamageSource;
import com.advancedmods.advancedtools.common.generic.items.ATItemSword;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EntityDamageSource;
/*
Created by Dennis on 25-9-2018 12:50
Copyright 2018
*/
public class TestSword extends ATItemSword {
public TestSword(ToolMaterial material) {
super(material);
this.setUnlocalizedName("swordop");
this.setCreativeTab(AdvancedTools.tabCombat);
this.setMaxStackSize(1);
}
@Override
public boolean hitEntity(ItemStack stack, EntityLivingBase victim, EntityLivingBase player) {
if(player.worldObj.isRemote)
return true;
if(victim instanceof EntityPlayer) {
EntityPlayer pvp = (EntityPlayer)victim;
if(((EntityPlayer) victim).capabilities.isCreativeMode) {
victim.attackEntityFrom(new TestDamageSource(player).setFireDamage().setMagicDamage().setDamageBypassesArmor().setDamageAllowedInCreativeMode(), 4.0f);
}
victim.attackEntityFrom(new TestDamageSource(player).setFireDamage().setMagicDamage().setDamageBypassesArmor(), 4.0f);
return true;
}
victim.func_110142_aN().func_94547_a(new TestDamageSource(player), victim.getHealth(), victim.getHealth());
float currHealth = victim.getHealth();
float newHealth = victim.getHealth() / 2;
if(currHealth < 4)
newHealth = 0;
victim.setHealth(newHealth);
victim.onDeath(new EntityDamageSource("testop", player).setFireDamage().setMagicDamage().setDamageBypassesArmor());
return true;
}
@Override
public boolean onLeftClickEntity(ItemStack stack, EntityPlayer player, Entity entity) {
if(!entity.worldObj.isRemote && entity instanceof EntityPlayer) {
EntityPlayer victim = (EntityPlayer)entity;
if(victim.capabilities.isCreativeMode && !victim.isDead && victim.getHealth() > 0) {
victim.func_110142_aN().func_94547_a(new TestDamageSource(player), victim.getHealth(), victim.getHealth());
victim.setHealth(0);
victim.onDeath(new EntityDamageSource("testop", player));
return true;
}
}
return false;
}
}
package com.advancedmods.advancedtools.core;
import net.minecraft.stats.Achievement;
import net.minecraftforge.common.AchievementPage;
/*
Created by Dennis on 24-9-2018 13:47
Copyright 2018
*/
public class ATAchievements extends AchievementPage {
public static Achievement netherStarXL = new Achievement("starblock", "starblock", 0, 0, ATRegistry.blockNetherStar, null).registerStat().setSpecial();
public static Achievement helloThere = new Achievement("hello", "hello", 0, 1, ATRegistry.ringOfFlight, netherStarXL).registerStat().initIndependentStat();
public ATAchievements() {
super("Advanced Tools", new Achievement[] {netherStarXL, helloThere});
}
}
package com.advancedmods.advancedtools.core;
import com.advancedmods.advancedtools.AdvancedTools;
import com.advancedmods.advancedtools.common.compat.ProjectECompat;
import cpw.mods.fml.common.Loader;
public class ATCompat {
public static void compatInit() {
if(Loader.isModLoaded("ProjectE")) {
if(Loader.isModLoaded("ProjectE") && ATConfigHandler.enableProjectEcompat) {
AdvancedTools.getLog().info("Initializing OP ProjectE stuff...");
ProjectECompat.initOP();
AdvancedTools.getLog().info("Done! Enjoy your bedrock!");
}
}
......
package com.advancedmods.advancedtools.core;
import cpw.mods.fml.client.event.ConfigChangedEvent;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.common.config.Configuration;
import java.io.File;
/*
Created by Dennis on 24-9-2018 18:16
Copyright 2018
*/
public class ATConfigHandler {
public static Configuration config;
public static boolean enableProjectEcompat = true;
public static boolean enableFMCompat = true;
public static boolean enableTestingStuff = true;
public static void init(File configFile) {
if(config == null) {
config = new Configuration(configFile);
loadConfig();
}
}
@SubscribeEvent
public void onConfigurationChangedEvent(ConfigChangedEvent.OnConfigChangedEvent event) {
if(event.modID.equalsIgnoreCase(ATProps.modid)) {
loadConfig();
}
}
private static void loadConfig() {
// Name, Category, Default value, Description
enableFMCompat = config.getBoolean("enableFMCompat", "compat", true, "When false, forces the registration of the nether star block, even with forbidden magic loaded");
enableProjectEcompat = config.getBoolean("enableProjectECompat", "compat", true, "When false, disables the registration of EMC values with ProjectE");
enableTestingStuff = config.getBoolean("enableTestingStuff", "debug", true, "When true, enables testing stuff");
if(config.hasChanged()) {
config.save();
}
}
}
......@@ -14,14 +14,16 @@ public class ATProps {
public static final String FORGE_BUILD = "1614";
public static final String FORGE_VERSION = "[" + FORGE_BASE + FORGE_BUILD + "]";
//public static final String AMCORE_VERSION = "[" + AMCoreProps.version + "]";
public static final String AMCORE_VERSION = "[1.7.10R0.2.2B1]";
//public static final String AMCORE_VERSION = "[1.7.10R0.2.2B1]";
public static final String BAUBLES_VERSION = "1.0.1.10";
// General Mod stuff
public static final String name = "Advanced Tools";
public static final String modid = "AdvancedTools";
public static final String version = VERSION_COMPLETE;
public static final String dependencies = "required-after:Forge@" + FORGE_VERSION + ";" + "required-after:AMCore@" + AMCORE_VERSION + ";required-after:Baubles@" + BAUBLES_VERSION;
//public static final String dependencies = "required-after:Forge@" + FORGE_VERSION + ";" + "required-after:AMCore@" + AMCORE_VERSION + ";required-after:Baubles@" + BAUBLES_VERSION;
// New deps, i really don't care about AMCore version.
public static final String dependencies = "required-after:Forge@" + FORGE_VERSION + ";" + "required-after:AMCore" + ";required-after:Baubles@" + BAUBLES_VERSION;
//public static final String commonproxy = "com.advancedmods.advancedtools.common.CommonProxy";
//public static final String clientproxy = "com.advancedmods.advancedtools.client.ClientProxy";
......
package com.advancedmods.advancedtools.core;
import com.advancedmods.advancedtools.common.block.BlockNetherStar;
import com.advancedmods.advancedtools.common.generic.block.ATFlagBlock;
import com.advancedmods.advancedtools.common.items.TestSword;
import com.advancedmods.advancedtools.common.items.armor.EmeraldArmor;
import com.advancedmods.advancedtools.common.items.baubles.RingOfFlight;
import com.advancedmods.advancedtools.common.items.tools.ingot.BoneIngot;
......@@ -48,6 +50,7 @@ public class ATRegistry {
public static ItemArmor.ArmorMaterial quartzArmor = EnumHelper.addArmorMaterial("Quartz", 22, new int[]{2, 5, 3, 2}, 13);
public static Item.ToolMaterial copper = EnumHelper.addToolMaterial("Copper", 2, 400, 6.5f, 3.0f, 15);
public static ItemArmor.ArmorMaterial copperArmor = EnumHelper.addArmorMaterial("Copper", 22, new int[]{2, 5, 3, 2}, 13);
public static Item.ToolMaterial testOP = EnumHelper.addToolMaterial("TestOP", 5, 3000, 15.0f, 15.0f, 75);
// Blocks
// Nether star
......@@ -59,7 +62,7 @@ public class ATRegistry {
// TODO: Finish Bone.
//public static Item boneIngot = new BoneIngot();
//public static Item boneNugget = new BoneNugget(4010);
//public static Item bonePickaxe = new BonePickaxe(5005, bone);
//public static Item bonePickaxe = new BonePickaxe (5005, bone);
//public static Item boneShovel = new BoneShovel(5006, bone);
//public static Item boneAxe = new BoneAxe(5007, bone);
//public static Item boneSword = new BoneSword(5008, bone);
......@@ -188,10 +191,14 @@ public class ATRegistry {
// Blocks
//public static Block BlockCopper = new BlockCopper();
public static Block flagTestBlock = new ATFlagBlock();
// Baubles.
public static Item ringOfFlight = new RingOfFlight();
// Testsword
public static Item opSword = new TestSword(testOP);
public static void registerItemsAndBlocks() {
// Blocks
......@@ -199,6 +206,9 @@ public class ATRegistry {
if(!Loader.isModLoaded("ForbiddenMagic")) {
GameRegistry.registerBlock(blockNetherStar, "netherstarblock");
}
if(ATConfigHandler.enableTestingStuff) {
GameRegistry.registerBlock(flagTestBlock, "flagtestblock");
}
// Items
// Ingots
......@@ -465,6 +475,6 @@ public class ATRegistry {
}
public static void initBaublesRecipes() {
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ringOfFlight), "fef", "ene", "fef", 'f', Items.feather, 'e', "gemEmerald", 'n', blockNetherStar));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ringOfFlight), "fef", "ene", "fef", 'f', Items.feather, 'e', "gemEmerald", 'n', "blockNetherStar"));
}
}
\ No newline at end of file
......@@ -4,7 +4,7 @@ itemGroup.Materials=Advanced Tools Materials
itemGroup.Tools=Advanced Tools Tools
// Baubles
item.advancedtools:RingOfFlight.name=Ring of Flight
item.advancedtools:ringofflight.name=Ring of Flight
// Armor
// Emerald
......@@ -15,6 +15,7 @@ item.advancedtools:EmeraldBoots.name=Emerald Boots
// Blocks
tile.advancedtools:netherstarblock.name=Nether Star Block
tile.advancedtools:testflagblock.name=Test Flag Blok
// Ingots
item.advancedtools:boneingot.name=Bone Ingot
......@@ -24,4 +25,10 @@ item.advancedtools:lapisingot.name=Lapis Ingot
item.advancedtools:flintingot.name=Flint Ingot
item.advancedtools:netherioningot.name=Netherion Ingot
item.advancedtools:quartzingot.name=Quartz Ingot
item.advancedtools:copperingot.name=Copper Ingot
\ No newline at end of file
item.advancedtools:copperingot.name=Copper Ingot
// Achievements
achievement.hello=Hello There
achievement.hello.desc=General Kenobi
achievement.starblock=Nether Stars!
achievement.starblock.desc=Craft a nether star block
\ No newline at end of file
......@@ -4,7 +4,7 @@ itemGroup.Materials=Advanced Tools Materialen
itemGroup.Tools=Advanced Tools Werktuigen
// Baubles
item.advancedtools:RingOfFlight.name=Vliegring
item.advancedtools:ringofflight.name=Vliegring
// Armor
// Emerald
......@@ -15,6 +15,7 @@ item.advancedtools:EmeraldBoots.name=Smaragd Schoenen
// Blocks
tile.advancedtools:netherstarblock.name=Nether Ster Blok
tile.advancedtools:testflagblock.name=Test Vlag Blok
// Ingots
item.advancedtools:boneingot.name=Been Staaf
......@@ -24,4 +25,10 @@ item.advancedtools:lapisingot.name=Lapis Staaf
item.advancedtools:flintingot.name=Vuursteen Staaf
item.advancedtools:netherioningot.name=Netherion Staaf
item.advancedtools:quartzingot.name=Kwarts Staaf
item.advancedtools:copperingot.name=Koper Staaf
\ No newline at end of file
item.advancedtools:copperingot.name=Koper Staaf
// Achievements
achievement.hello=Hallo Daar
achievement.hello.desc=General Kenobi
achievement.starblock=Nether Stars!
achievement.starblock.desc=Maak een nether ster blok
\ No newline at end of file
{
"blocks.ussr": {"category": "ambient","sounds": [{"name": "ussr","stream": false},"blocks/ussr/ussr"]}
}
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment