Skip to content

Commit

Permalink
A catalyst of code. 1.6.4-1.1
Browse files Browse the repository at this point in the history
- Fixed the Emperor's Chalice, and added the chaliceMultiplier config
option. It scales the 1 heart to half a leg of hunger ratio along with
the number.

- Dug into FMLInterModComms, and made a small API for registering
blocks for use with the Destruction Catalyst. (For other mod's
terrain.) Here is an example:

FMLInterModComms.sendMessage("xreliquary", "DestructionCatalyst",
String.valueOf(Block.obsidian.blockID));

- I also reformatted the mod for GMCP, should make my life easier when
it comes to building.
  • Loading branch information
TrainerGuy22 committed Dec 4, 2013
1 parent acfb664 commit d2c6008
Show file tree
Hide file tree
Showing 200 changed files with 74 additions and 30 deletions.
31 changes: 31 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import com.github.abrarsyed.gmcp.GMCP

buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.github.abrarsyed.gmcp:GMCP:latest.integration'
}
}

apply plugin: "gmcp"

minecraft { minecraftVersion = "1.6.4" }
group = 'xreliquary'
version = "1.1"
archivesBaseName = 'Reliquary'

processResources
{
from(sourceSets.main.resources.srcDirs) {
include '**/*.lang'
include '**/*.info'
expand 'version':project.version, 'mcversion':project.minecraft.minecraftVersion
}

from(sourceSets.main.resources.srcDirs) {
exclude '**/*.lang'
exclude '**/*.info'
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import cpw.mods.fml.common.FMLLog;

public class Config {

// items
public static int handgunID;
public static int magazineID;
Expand Down Expand Up @@ -43,6 +43,7 @@ public class Config {
public static int lilypadID;

// options
public static int chaliceMultiplier;
public static boolean disableCoinAudio;

public static void init(File configFile) {
Expand Down Expand Up @@ -132,8 +133,8 @@ public static void init(File configFile) {
.getInt(Indexes.LILYPAD_DEFAULT_ID);

// miscellaneous options
disableCoinAudio = config.get("Misc_Options", "disableCoinAudio",
false).getBoolean(Reference.DISABLE_COIN_AUDIO_DEFAULT);
disableCoinAudio = config.get("Misc_Options", "disableCoinAudio", false).getBoolean(Reference.DISABLE_COIN_AUDIO_DEFAULT);
chaliceMultiplier = config.get("Chalice_Amount_Multiplier", "chaliceMultiplier", 1).getInt(1);
} catch (Exception e) {
FMLLog.log(Level.SEVERE, e, Reference.MOD_NAME
+ " had a problem while loading its configuration.");
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
package xreliquary;

import com.google.common.collect.ImmutableList;

import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.ForgeSubscribe;
import net.minecraftforge.fluids.FluidContainerRegistry;
import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fluids.FluidStack;
import xreliquary.blocks.XRBlocks;
import xreliquary.common.CommonProxy;
import xreliquary.items.AlkahestMap;
import xreliquary.items.ItemDestructionCatalyst;
import xreliquary.items.XRAlkahestry;
import xreliquary.items.XRItems;
import xreliquary.lib.Reference;
Expand All @@ -19,6 +24,9 @@
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLInterModComms;
import cpw.mods.fml.common.event.FMLInterModComms.IMCEvent;
import cpw.mods.fml.common.event.FMLInterModComms.IMCMessage;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.event.FMLServerStartingEvent;
Expand Down Expand Up @@ -69,7 +77,7 @@ public void preInit(FMLPreInitializationEvent event) {
public void load(FMLInitializationEvent event) {
proxy.registerEntityTrackers();
proxy.registerRenderers();
proxy.registerEvents();
MinecraftForge.EVENT_BUS.register(this);
proxy.registerTileEntities();
LanguageRegistry.instance().addStringLocalization(
"itemGroup." + Reference.MOD_ID, "Xeno's Reliquary");
Expand All @@ -79,6 +87,16 @@ public void load(FMLInitializationEvent event) {
public void modsLoaded(FMLPostInitializationEvent event) {
System.out.println("Xeno's Reliquary loaded.");
}

@EventHandler
public void onMessage(IMCEvent event) {
for(IMCMessage message: event.getMessages()) {
if(message.key.equals("DestructionCatalyst")) {
System.out.println("[Reliquary] Added block " + message.getStringValue() + " from " + message.getSender() + " was added to the Destruction Catalyst's registry.");
ItemDestructionCatalyst.ids.add(Integer.valueOf(message.getStringValue()));
}
}
}

public static void customBusterExplosion(Entity par1Entity,
EntityPlayer player, double par2, double par4, double par6,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import net.minecraft.client.renderer.entity.RenderSnowball;
import net.minecraft.item.Item;
import net.minecraftforge.client.MinecraftForgeClient;
import net.minecraftforge.common.MinecraftForge;
import xreliquary.Config;
import xreliquary.client.audio.SoundHandler;
Expand All @@ -28,6 +29,7 @@
import xreliquary.entities.EntitySeekerShot;
import xreliquary.entities.EntitySpecialSnowball;
import xreliquary.entities.EntityStormShot;
import xreliquary.items.XRItems;
import xreliquary.lib.Reference;
import cpw.mods.fml.client.registry.RenderingRegistry;

Expand Down Expand Up @@ -102,8 +104,7 @@ EntityCondensedFertility.class, new RenderThrown(
Reference.SPLASH_POTION_SPRITE
+ Reference.FERTILIZER_META));

// MinecraftForgeClient.registerItemRenderer(XRItems.handgun.itemID,
// new ItemRendererHandgun());
MinecraftForgeClient.registerItemRenderer(XRItems.handgun.itemID, new ItemRendererHandgun());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,9 @@ public ItemRendererHandgun() {

@Override
public boolean handleRenderType(ItemStack item, ItemRenderType type) {
switch (type) {
case EQUIPPED:
return true;
default:
return false;
}
if(type == ItemRenderType.EQUIPPED || type == ItemRenderType.EQUIPPED_FIRST_PERSON)
return true;
return false;
}

@Override
Expand All @@ -38,8 +35,7 @@ public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item,

@Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
switch (type) {
case EQUIPPED: {
if(type == ItemRenderType.EQUIPPED || type == ItemRenderType.EQUIPPED_FIRST_PERSON) {
GL11.glPushMatrix();

Minecraft.getMinecraft().renderEngine.bindTexture(ClientReference.HANDGUN_TEXTURE);
Expand All @@ -53,14 +49,10 @@ public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
float scale = 0.5F;
GL11.glScalef(scale, scale, scale);

handgunModel.render((Entity) data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F,
0.0625F);
handgunModel.render((Entity) data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F);

GL11.glPopMatrix();
}
default:
break;
}

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,6 @@ public void registerActions() {

}

public void registerEvents() {

}

public void registerSoundHandler() {
// Nothing here as this is a server side proxy
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package xreliquary.items;

import java.util.ArrayList;
import java.util.List;

import net.minecraft.block.Block;
Expand All @@ -13,6 +14,8 @@
import xreliquary.lib.Reference;

public class ItemDestructionCatalyst extends ItemXR {

public static List<Integer> ids = new ArrayList<Integer>();

protected ItemDestructionCatalyst(int par1) {
super(par1);
Expand Down Expand Up @@ -85,8 +88,8 @@ public boolean isBreakable(int id) {
|| id == Block.cobblestone.blockID || id == Block.stone.blockID
|| id == Block.sand.blockID || id == Block.sandStone.blockID
|| id == Block.snow.blockID || id == Block.slowSand.blockID
|| id == Block.netherrack.blockID
|| id == Block.whiteStone.blockID;
|| id == Block.netherrack.blockID || id == Block.whiteStone.blockID
|| ids.contains(id);
}

public boolean consumeGunpowder(EntityPlayer player) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import net.minecraft.util.Icon;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
import xreliquary.Config;
import xreliquary.Reliquary;
import xreliquary.lib.Names;
import xreliquary.lib.Reference;
Expand Down Expand Up @@ -98,12 +99,13 @@ public boolean hasEffect(ItemStack stack) {
return true;
}

public ItemStack onFoodEaten(ItemStack ist, World world, EntityPlayer player) {
@Override
public ItemStack onEaten(ItemStack ist, World world, EntityPlayer player) {
if (world.isRemote)
return ist;

player.getFoodStats().addStats(1, 0.5F);
player.attackEntityFrom(DamageSource.drown, 1);
player.getFoodStats().addStats(1, (float) (Config.chaliceMultiplier / 2));
player.attackEntityFrom(DamageSource.drown, Config.chaliceMultiplier);
return new ItemStack(this, 1, 0);
}

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions reliquary_common/mcmod.info → src/main/resources/mcmod.info
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
"modid": "xreliquary",
"name": "Xeno's Reliquary",
"description": "Two words: magical swag. Oh, and a gun.",
"version": "1.0.6b",
"version": "${version}",
"updateUrl": "",
"logoFile": "/mods/xreliquary/textures/logo/xrlogo.png",
"mcversion": "1.6.4",
"mcversion": "${mcversion}",
"authorList": [
"x3n0ph0b3"
"TheMike"
Expand Down

0 comments on commit d2c6008

Please sign in to comment.