Skip to content

Commit

Permalink
Merge pull request RebelKeithy#71 from lclc98/master
Browse files Browse the repository at this point in the history
  • Loading branch information
odininon committed Oct 3, 2013
2 parents 47006d7 + 7916f37 commit de495e1
Show file tree
Hide file tree
Showing 28 changed files with 1,171 additions and 23 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package rebelkeithy.mods.metallurgy.integration;

import dan200.turtle.api.ITurtleUpgrade;
import dan200.turtle.api.TurtleAPI;
import net.minecraft.item.Item;
import rebelkeithy.mods.metallurgy.core.MetallurgyCore;
import rebelkeithy.mods.metallurgy.core.metalsets.OreInfo;
Expand Down Expand Up @@ -114,19 +116,17 @@ public static void addTurtles()

public static void createTurtle(int id, String name, Item tool)
{
// TODO Fix compatibility later
if (MetallurgyCore.DEBUG)
{
System.out.println("Metallurgy: Creating " + name + " Turtle");
}

// dan200.turtle.shared.TurtleTool toolTurtle = new
// dan200.turtle.shared.TurtleTool(id, name, tool, false);
// dan200.turtle.api.TurtleAPI.registerUpgrade(toolTurtle);
ITurtleUpgrade toolTurtle = new ComputerCraftTurtle(id, name, tool);
TurtleAPI.registerUpgrade(toolTurtle);

if (MetallurgyCore.DEBUG)
{
// System.out.println("Metallurgy: Registered " + toolTurtle);
System.out.println("Metallurgy: Registered " + toolTurtle);
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
package rebelkeithy.mods.metallurgy.integration;

import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Icon;
import dan200.computer.api.IHostedPeripheral;
import dan200.turtle.api.ITurtleAccess;
import dan200.turtle.api.ITurtleUpgrade;
import dan200.turtle.api.TurtleSide;
import dan200.turtle.api.TurtleUpgradeType;
import dan200.turtle.api.TurtleVerb;

public class ComputerCraftTurtle implements ITurtleUpgrade {

int id;
String name;
Item tool;

public ComputerCraftTurtle(int id, String name, Item tool) {
this.id = id;
this.name = name;
this.tool = tool;
}

@Override
public int getUpgradeID() {
return id;
}

@Override
public String getAdjective() {
return name;
}

@Override
public TurtleUpgradeType getType() {
return TurtleUpgradeType.Tool;
}

@Override
public ItemStack getCraftingItem() {
return new ItemStack(tool);
}

@Override
public boolean isSecret() {
return false;
}

@Override
public IHostedPeripheral createPeripheral(ITurtleAccess turtle, TurtleSide side) {
return null;
}

@Override
public boolean useTool(ITurtleAccess turtle, TurtleSide side, TurtleVerb verb, int direction) {
return false;
}

@Override
public Icon getIcon(ITurtleAccess turtle, TurtleSide side) {
return tool.getIconFromDamage(0);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ public void createMachineRecipes()

for (int n = 0; n < 8; n++)
{
GameRegistry.addRecipe(new ItemStack(lantern, 4, n), "SSS", "GTG", "SSS", 'S', Block.cobblestone, 'T', Block.torchWood, 'G', new ItemStack(coloredGlass, 1, n));
GameRegistry.addRecipe(new ItemStack(lantern, 1, n), "SSS", "GTG", "SSS", 'S', Block.cobblestone, 'T', Block.torchWood, 'G', new ItemStack(coloredGlass, 1, n));
}

GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(glassDust, 2, 1), new ItemStack(glassDust, 1, 0), "dustIron"));
Expand Down Expand Up @@ -218,7 +218,7 @@ public void postInit(FMLPostInitializationEvent event)
AppliedEnergestics.init();
}

@cpw.mods.fml.common.Mod.Init
@EventHandler
public void Init(FMLInitializationEvent event)
{
loadCrusher();
Expand Down Expand Up @@ -469,7 +469,7 @@ public void loadCrusher()
CrusherRecipes.addCrushing(Item.ingotGold.itemID, 0, new ItemStack(MetallurgyMetals.dustGold));
}

@PreInit
@EventHandler
public void preInit(FMLPreInitializationEvent event)
{
final ModMetadata metadata = event.getModMetadata();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public void renderTileEntityPylonAt(TileEntityPylon te, double x, double y, doub
final int meta = te.getType();

final String name = BlockPylon.names[meta];
final ResourceLocation texture = new ResourceLocation("Metallurgy:textures/blocks/machines/pylon/" + name + "Pylon.png");
final ResourceLocation texture = new ResourceLocation("Metallurgy:textures/blocks/machines/pylon/" + name.replace(" ", "") + "Pylon.png");
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
model.setCubeRotation(te.rotationX, te.rotationY, te.rotationZ);
model.renderAll();
Expand Down
12 changes: 6 additions & 6 deletions common/rebelkeithy/mods/metallurgy/metals/MetallurgyMetals.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import rebelkeithy.mods.metallurgy.metals.utilityItems.tnt.EntityLargeTNTPrimed;
import rebelkeithy.mods.metallurgy.metals.utilityItems.tnt.EntityMinersTNTPrimed;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.Mod.Init;
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.Mod.PostInit;
Expand Down Expand Up @@ -297,15 +298,15 @@ public void createUtilityItems()
}

id = utilityConfig.get("Item IDs", "Magnesium Igniter", 29007).getInt();
magnesiumIgniter = new ItemIgniter(id).setTextureName("Metallurgy:Utility/Igniter").setUnlocalizedName("Metallurgy:Utility/Igniter").setCreativeTab(utilityTab);
magnesiumIgniter = new ItemIgniter(id).setMaxDamage(128).setMaxStackSize(1).setTextureName("Metallurgy:Utility/Igniter").setUnlocalizedName("Metallurgy:Utility/Igniter").setCreativeTab(utilityTab);
LanguageRegistry.addName(magnesiumIgniter, "Magnesium Igniter");
if (utilityConfig.get("Recipes", "Enable Magnesium Igniter", true).getBoolean(true))
{
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(magnesiumIgniter), "X ", " F", 'X', "dustMagnesium", 'F', Item.flint));
}

id = utilityConfig.get("Item IDs", "Match", 29008).getInt();
match = new ItemIgniter(id).setTextureName("Metallurgy:Utility/Match").setUnlocalizedName("Metallurgy:Utility/Match").setCreativeTab(utilityTab);
match = new ItemIgniter(id).setMaxDamage(1).setMaxStackSize(64).setTextureName("Metallurgy:Utility/Match").setUnlocalizedName("Metallurgy:Utility/Match").setCreativeTab(utilityTab);
LanguageRegistry.addName(match, "Match");
if (utilityConfig.get("Recipes", "Enable Match", true).getBoolean(true))
{
Expand Down Expand Up @@ -341,7 +342,7 @@ public void createUtilityItems()
}
}

@Init
@EventHandler
public void Init(FMLInitializationEvent event)
{
// TODO add config for vanilla dusts
Expand Down Expand Up @@ -464,7 +465,7 @@ private boolean isSetEnabled(String setName)
return enabled;
}

@PostInit
@EventHandler
public void postInit(FMLPostInitializationEvent event)
{
if (isSetEnabled("Base") && baseSet.getOreInfo("Steel").helmet != null)
Expand Down Expand Up @@ -496,14 +497,13 @@ public void postInit(FMLPostInitializationEvent event)
try
{
Class.forName("dan200.turtle.api.TurtleAPI");
Class.forName("dan200.turtle.shared.TurtleTool");
ComputerCraftIntegration.init();
} catch (final Exception e)
{
}
}

@PreInit
@EventHandler
public void preInit(FMLPreInitializationEvent event)
{
final ModMetadata metadata = event.getModMetadata();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package rebelkeithy.mods.metallurgy.metals;

import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.potion.PotionEffect;
import net.minecraft.world.World;
import rebelkeithy.mods.keithyutils.metablock.ICollisionListener;
Expand All @@ -13,9 +13,9 @@ public class VyroxeresCollisionListener implements ICollisionListener
public void collide(World par1World, int par2, int par3, int par4, Entity par5Entity, int meta)
{

if (par5Entity instanceof EntityLiving)
if (par5Entity instanceof EntityLivingBase)
{
((EntityLiving) par5Entity).addPotionEffect(new PotionEffect(19, 120, 1));
((EntityLivingBase) par5Entity).addPotionEffect(new PotionEffect(19, 120, 1));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ public class ItemIgniter extends ItemFlintAndSteel
public ItemIgniter(int par1)
{
super(par1);
maxStackSize = 1;
setMaxDamage(128);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import rebelkeithy.mods.metallurgy.core.MetallurgyCore;
import rebelkeithy.mods.metallurgy.core.metalsets.MetalSet;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.Mod.Init;
import cpw.mods.fml.common.Mod.PostInit;
import cpw.mods.fml.common.Mod.PreInit;
Expand All @@ -34,7 +35,7 @@ public class MetallurgyVanilla

public static MetalSet vanillaSet;

@Init
@EventHandler
public void Init(FMLInitializationEvent event)
{

Expand All @@ -43,12 +44,12 @@ public void Init(FMLInitializationEvent event)
proxy.registerNames();
}

@PostInit
@EventHandler
public void PostInit(FMLPostInitializationEvent event)
{
}

@PreInit
@EventHandler
public void preInit(FMLPreInitializationEvent event)
{

Expand Down
Loading

0 comments on commit de495e1

Please sign in to comment.