Millstone and gear now requires hand crank
This commit is contained in:
parent
4f101e97e2
commit
f96ee359b2
7 changed files with 34 additions and 24 deletions
|
@ -9,6 +9,7 @@ import net.minecraft.util.Icon;
|
||||||
import net.minecraft.world.IBlockAccess;
|
import net.minecraft.world.IBlockAccess;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import resonantinduction.core.Reference;
|
import resonantinduction.core.Reference;
|
||||||
|
import resonantinduction.mechanical.gear.ItemHandCrank;
|
||||||
import universalelectricity.api.vector.Vector3;
|
import universalelectricity.api.vector.Vector3;
|
||||||
import calclavia.lib.prefab.block.BlockTile;
|
import calclavia.lib.prefab.block.BlockTile;
|
||||||
import calclavia.lib.utility.inventory.InventoryUtility;
|
import calclavia.lib.utility.inventory.InventoryUtility;
|
||||||
|
@ -87,9 +88,18 @@ public class BlockMillstone extends BlockTile
|
||||||
{
|
{
|
||||||
TileMillstone tile = (TileMillstone) te;
|
TileMillstone tile = (TileMillstone) te;
|
||||||
ItemStack current = player.inventory.getCurrentItem();
|
ItemStack current = player.inventory.getCurrentItem();
|
||||||
|
|
||||||
ItemStack output = tile.getStackInSlot(0);
|
ItemStack output = tile.getStackInSlot(0);
|
||||||
|
|
||||||
|
if (current != null && current.getItem() instanceof ItemHandCrank)
|
||||||
|
{
|
||||||
|
if (output != null)
|
||||||
|
{
|
||||||
|
tile.doGrind(new Vector3(player));
|
||||||
|
player.addExhaustion(0.3f);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (output != null)
|
if (output != null)
|
||||||
{
|
{
|
||||||
InventoryUtility.dropItemStack(world, new Vector3(player), output, 0);
|
InventoryUtility.dropItemStack(world, new Vector3(player), output, 0);
|
||||||
|
@ -107,27 +117,6 @@ public class BlockMillstone extends BlockTile
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onUseWrench(World world, int x, int y, int z, EntityPlayer entityPlayer, int side, float hitX, float hitY, float hitZ)
|
|
||||||
{
|
|
||||||
TileEntity te = world.getBlockTileEntity(x, y, z);
|
|
||||||
|
|
||||||
if (te instanceof TileMillstone)
|
|
||||||
{
|
|
||||||
TileMillstone tile = (TileMillstone) te;
|
|
||||||
ItemStack output = tile.getStackInSlot(0);
|
|
||||||
|
|
||||||
if (output != null)
|
|
||||||
{
|
|
||||||
tile.doGrind(new Vector3(entityPlayer));
|
|
||||||
entityPlayer.addExhaustion(0.3f);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TileEntity createNewTileEntity(World var1)
|
public TileEntity createNewTileEntity(World var1)
|
||||||
{
|
{
|
||||||
|
|
|
@ -23,6 +23,7 @@ import resonantinduction.mechanical.fluid.transport.TileGrate;
|
||||||
import resonantinduction.mechanical.fluid.transport.TilePump;
|
import resonantinduction.mechanical.fluid.transport.TilePump;
|
||||||
import resonantinduction.mechanical.gear.ItemGear;
|
import resonantinduction.mechanical.gear.ItemGear;
|
||||||
import resonantinduction.mechanical.gear.ItemGearShaft;
|
import resonantinduction.mechanical.gear.ItemGearShaft;
|
||||||
|
import resonantinduction.mechanical.gear.ItemHandCrank;
|
||||||
import resonantinduction.mechanical.item.ItemPipeGauge;
|
import resonantinduction.mechanical.item.ItemPipeGauge;
|
||||||
import resonantinduction.mechanical.logistic.belt.BlockDetector;
|
import resonantinduction.mechanical.logistic.belt.BlockDetector;
|
||||||
import resonantinduction.mechanical.logistic.belt.BlockManipulator;
|
import resonantinduction.mechanical.logistic.belt.BlockManipulator;
|
||||||
|
@ -81,6 +82,7 @@ public class Mechanical
|
||||||
public static final ContentRegistry contentRegistry = new ContentRegistry(Settings.CONFIGURATION, Settings.idManager, ID).setPrefix(Reference.PREFIX).setTab(TabRI.CORE);
|
public static final ContentRegistry contentRegistry = new ContentRegistry(Settings.CONFIGURATION, Settings.idManager, ID).setPrefix(Reference.PREFIX).setTab(TabRI.CORE);
|
||||||
|
|
||||||
// Energy
|
// Energy
|
||||||
|
public static Item itemHandCrank;
|
||||||
public static Item itemGear;
|
public static Item itemGear;
|
||||||
public static Item itemGearShaft;
|
public static Item itemGearShaft;
|
||||||
public static Block windTurbine;
|
public static Block windTurbine;
|
||||||
|
@ -115,6 +117,7 @@ public class Mechanical
|
||||||
NetworkRegistry.instance().registerGuiHandler(this, proxy);
|
NetworkRegistry.instance().registerGuiHandler(this, proxy);
|
||||||
MinecraftForge.EVENT_BUS.register(new MicroblockHighlightHandler());
|
MinecraftForge.EVENT_BUS.register(new MicroblockHighlightHandler());
|
||||||
|
|
||||||
|
itemHandCrank = contentRegistry.createItem(ItemHandCrank.class);
|
||||||
itemGear = contentRegistry.createItem(ItemGear.class);
|
itemGear = contentRegistry.createItem(ItemGear.class);
|
||||||
itemGearShaft = contentRegistry.createItem(ItemGearShaft.class);
|
itemGearShaft = contentRegistry.createItem(ItemGearShaft.class);
|
||||||
windTurbine = contentRegistry.createTile(BlockWindTurbine.class, TileWindTurbine.class);
|
windTurbine = contentRegistry.createTile(BlockWindTurbine.class, TileWindTurbine.class);
|
||||||
|
@ -159,6 +162,7 @@ public class Mechanical
|
||||||
public void postInit(FMLPostInitializationEvent evt)
|
public void postInit(FMLPostInitializationEvent evt)
|
||||||
{
|
{
|
||||||
// Add recipes
|
// Add recipes
|
||||||
|
GameRegistry.addRecipe(new ShapedOreRecipe(itemHandCrank, "S ", "SSS", " S", 'S', Item.stick));
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(itemGear, 1, 0), "SWS", "W W", "SWS", 'W', "plankWood", 'S', Item.stick));
|
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(itemGear, 1, 0), "SWS", "W W", "SWS", 'W', "plankWood", 'S', Item.stick));
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(itemGear, 1, 1), " W ", "WGW", " W ", 'G', new ItemStack(itemGear, 1, 0), 'W', Block.cobblestone));
|
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(itemGear, 1, 1), " W ", "WGW", " W ", 'G', new ItemStack(itemGear, 1, 0), 'W', Block.cobblestone));
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(itemGear, 1, 2), " W ", "WGW", " W ", 'G', new ItemStack(itemGear, 1, 1), 'W', Item.ingotIron));
|
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(itemGear, 1, 2), " W ", "WGW", " W ", 'G', new ItemStack(itemGear, 1, 1), 'W', Item.ingotIron));
|
||||||
|
|
|
@ -0,0 +1,14 @@
|
||||||
|
package resonantinduction.mechanical.gear;
|
||||||
|
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.item.EnumToolMaterial;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
|
||||||
|
public class ItemHandCrank extends Item
|
||||||
|
{
|
||||||
|
public ItemHandCrank(int id)
|
||||||
|
{
|
||||||
|
super(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -117,7 +117,7 @@ public class PartGear extends PartMechanical implements IMechanical, IMultiBlock
|
||||||
@Override
|
@Override
|
||||||
public boolean activate(EntityPlayer player, MovingObjectPosition hit, ItemStack item)
|
public boolean activate(EntityPlayer player, MovingObjectPosition hit, ItemStack item)
|
||||||
{
|
{
|
||||||
if (WrenchUtility.isUsableWrench(player, player.getCurrentEquippedItem(), x(), y(), z()))
|
if (item != null && item.getItem() instanceof ItemHandCrank)
|
||||||
{
|
{
|
||||||
if (player.isSneaking())
|
if (player.isSneaking())
|
||||||
{
|
{
|
||||||
|
@ -138,7 +138,6 @@ public class PartGear extends PartMechanical implements IMechanical, IMultiBlock
|
||||||
player.addExhaustion(0.01f);
|
player.addExhaustion(0.01f);
|
||||||
}
|
}
|
||||||
|
|
||||||
WrenchUtility.damageWrench(player, player.getCurrentEquippedItem(), x(), y(), z());
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else if (player.isSneaking())
|
else if (player.isSneaking())
|
||||||
|
|
|
@ -42,6 +42,9 @@ public final class MachineRecipes
|
||||||
if (obj instanceof FluidStack)
|
if (obj instanceof FluidStack)
|
||||||
return new FluidStackResource((FluidStack) obj);
|
return new FluidStackResource((FluidStack) obj);
|
||||||
|
|
||||||
|
if (obj instanceof RecipeResource)
|
||||||
|
return (RecipeResource) obj;
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -17,6 +17,7 @@ item.resonantinduction\:oreDust.name=%v Dust
|
||||||
item.resonantinduction\:oreDust.tooltip=Shift-right click on a cauldron to refine.
|
item.resonantinduction\:oreDust.tooltip=Shift-right click on a cauldron to refine.
|
||||||
item.resonantinduction\:oreRefinedDust.name=%v Refined Dust
|
item.resonantinduction\:oreRefinedDust.name=%v Refined Dust
|
||||||
item.resonantinduction\:oreRubble.name=%v Rubble
|
item.resonantinduction\:oreRubble.name=%v Rubble
|
||||||
|
item.resonantinduction\:handCrank.name=Hand Crank
|
||||||
|
|
||||||
### Archaic Module
|
### Archaic Module
|
||||||
## machineMaterials
|
## machineMaterials
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 1.1 KiB |
Loading…
Reference in a new issue