Created the staff of devs item, designed to be used for debug tasks

This commit is contained in:
Robert S 2014-05-28 20:22:54 -04:00
parent a88bc11666
commit 0e42b23e80
5 changed files with 55 additions and 1 deletions

View file

@ -45,6 +45,7 @@ tile.resonantinduction\:machineMaterial.10.name=Steel
item.resonantinduction\:imprint.name=Imprint item.resonantinduction\:imprint.name=Imprint
item.resonantinduction\:hammer.name=Hammer item.resonantinduction\:hammer.name=Hammer
item.resonantinduction\:handCrank.name=Hand Crank item.resonantinduction\:handCrank.name=Hand Crank
item.resonantinduction\:devStaff.name=Staff of Devs
## Machines ## Machines
tile.resonantinduction\:castingMold.name=Casting Mold tile.resonantinduction\:castingMold.name=Casting Mold

Binary file not shown.

After

Width:  |  Height:  |  Size: 604 B

View file

@ -3,11 +3,16 @@ package resonantinduction.core;
import java.util.HashMap; import java.util.HashMap;
import net.minecraft.command.CommandBase; import net.minecraft.command.CommandBase;
import net.minecraft.command.ICommand;
import net.minecraft.command.ICommandSender; import net.minecraft.command.ICommandSender;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ChatMessageComponent; import net.minecraft.util.ChatMessageComponent;
import net.minecraftforge.common.ForgeDirection; import net.minecraftforge.common.ForgeDirection;
import net.minecraftforge.event.ForgeSubscribe;
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
import net.minecraftforge.event.entity.player.PlayerInteractEvent.Action;
import resonantinduction.core.interfaces.ICmdMachine; import resonantinduction.core.interfaces.ICmdMachine;
import universalelectricity.api.CompatibilityModule; import universalelectricity.api.CompatibilityModule;
import universalelectricity.api.vector.VectorWorld; import universalelectricity.api.vector.VectorWorld;
@ -195,4 +200,35 @@ public class CommandMachine extends CommandBase
} }
return null; return null;
} }
@ForgeSubscribe
public void onPlayInteract(PlayerInteractEvent event)
{
if (event.action == Action.RIGHT_CLICK_BLOCK)
{
if (event.entityPlayer.getHeldItem() != null && event.entityPlayer.getHeldItem().itemID == Item.blazeRod.itemID)
{
if (event.entityPlayer.isSneaking())
{
VectorWorld hit = new VectorWorld(event.entity.worldObj, event.x, event.y, event.z);
TileEntity tile = hit.getTileEntity();
if (tile != null)
{
event.entityPlayer.sendChatToPlayer(ChatMessageComponent.createFromText("Selecting sentry at " + hit.toString()));
event.entityPlayer.sendChatToPlayer(ChatMessageComponent.createFromText("Sentry is awaiting orders"));
selection.put(event.entityPlayer.username, hit);
if (event.isCancelable())
event.setCanceled(true);
}
}
}
}
}
@Override
public int compareTo(Object par1Obj)
{
return this.compareTo((ICommand) par1Obj);
}
} }

View file

@ -22,6 +22,7 @@ import resonant.lib.network.PacketTile;
import resonant.lib.prefab.item.ItemBlockMetadata; import resonant.lib.prefab.item.ItemBlockMetadata;
import resonant.lib.utility.LanguageUtility; import resonant.lib.utility.LanguageUtility;
import resonantinduction.core.handler.TextureHookHandler; import resonantinduction.core.handler.TextureHookHandler;
import resonantinduction.core.items.ItemDevStaff;
import resonantinduction.core.prefab.part.PacketMultiPart; import resonantinduction.core.prefab.part.PacketMultiPart;
import resonantinduction.core.resource.BlockDust; import resonantinduction.core.resource.BlockDust;
import resonantinduction.core.resource.BlockMachineMaterial; import resonantinduction.core.resource.BlockMachineMaterial;
@ -75,7 +76,7 @@ public class ResonantInduction
public static Block blockOre; public static Block blockOre;
public static ItemOreResource itemRubble, itemDust, itemRefinedDust; public static ItemOreResource itemRubble, itemDust, itemRefinedDust;
public static ItemOreResourceBucket itemBucketMixture, itemBucketMolten; public static ItemOreResourceBucket itemBucketMixture, itemBucketMolten;
public static Item itemBiomass; public static Item itemBiomass, itemDevStaff;
public static Block blockDust, blockRefinedDust; public static Block blockDust, blockRefinedDust;
public static Block blockMachinePart; public static Block blockMachinePart;
@ -103,6 +104,7 @@ public class ResonantInduction
itemBucketMixture = new ItemOreResourceBucket(Settings.getNextItemID("bucketMixture"), "bucketMixture", false); itemBucketMixture = new ItemOreResourceBucket(Settings.getNextItemID("bucketMixture"), "bucketMixture", false);
itemBucketMolten = new ItemOreResourceBucket(Settings.getNextItemID("bucketMolten"), "bucketMolten", true); itemBucketMolten = new ItemOreResourceBucket(Settings.getNextItemID("bucketMolten"), "bucketMolten", true);
itemBiomass = contentRegistry.createItem(ItemBiomass.class); itemBiomass = contentRegistry.createItem(ItemBiomass.class);
itemDevStaff = contentRegistry.createItem(ItemDevStaff.class);
GameRegistry.registerItem(itemRubble, itemRubble.getUnlocalizedName()); GameRegistry.registerItem(itemRubble, itemRubble.getUnlocalizedName());
GameRegistry.registerItem(itemDust, itemDust.getUnlocalizedName()); GameRegistry.registerItem(itemDust, itemDust.getUnlocalizedName());

View file

@ -0,0 +1,15 @@
package resonantinduction.core.items;
import net.minecraft.item.Item;
/** Place holder item with no internal function. Used in junction with event handler to interact with
* debug objects.
*
* @author Darkguardsamn */
public class ItemDevStaff extends Item
{
public ItemDevStaff(int id)
{
super(id);
}
}