mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-20 04:09:40 +00:00
1.6.2 test - Finished liquids, added connected textures on glass
This commit is contained in:
1 parent
40c6f445a2
commit
a80fcbce86
704 files changed
+60909
No files matched your search
@@ -0,0 +1,53 @@
|
||||
package tconstruct.plugins.minefactoryreloaded;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import powercrystals.minefactoryreloaded.api.FarmingRegistry;
|
||||
import tconstruct.common.TContent;
|
||||
import tconstruct.entity.BlueSlime;
|
||||
import tconstruct.plugins.minefactoryreloaded.grindables.GrindableStandard;
|
||||
import tconstruct.plugins.minefactoryreloaded.harvestables.HarvestableOreBerry;
|
||||
import cpw.mods.fml.common.FMLLog;
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.common.Mod;
|
||||
import cpw.mods.fml.common.Mod.Init;
|
||||
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||
import cpw.mods.fml.common.network.NetworkMod;
|
||||
|
||||
@Mod(modid = "TConstruct|CompatMineFactoryReloaded", name = "TConstruct Compat: MFR", version = "0.1", dependencies = "after:MineFactoryReloaded;after:TConstruct")
|
||||
@NetworkMod(clientSideRequired = false, serverSideRequired = false)
|
||||
public class MineFactoryReloaded
|
||||
{
|
||||
@Init
|
||||
public static void load (FMLInitializationEvent ev)
|
||||
{
|
||||
if (!Loader.isModLoaded("MineFactoryReloaded"))
|
||||
{
|
||||
FMLLog.warning("MineFactoryReloaded missing - TConstruct Compat: MFR not loading.");
|
||||
return;
|
||||
}
|
||||
try
|
||||
{
|
||||
FMLLog.fine("MineFactoryReloaded detected. Registering TConstruct farmables/grindables with MFR's Farming Registry.");
|
||||
|
||||
FarmingRegistry.registerHarvestable(new HarvestableOreBerry(TContent.oreBerry.blockID, TContent.oreBerries.itemID, 0));
|
||||
FarmingRegistry.registerHarvestable(new HarvestableOreBerry(TContent.oreBerrySecond.blockID, TContent.oreBerries.itemID, 4));
|
||||
|
||||
// A note: in 1.6, this method of registering grindables will no longer exist, once MFR moves to a more universal way of gathering drops.
|
||||
FarmingRegistry.registerGrindable(new GrindableStandard(BlueSlime.class, new ItemStack(TContent.strangeFood)));
|
||||
//FarmingRegistry.registerGrindable(new GrindableStandard(Crystal.class, new ItemStack(Item.gunpowder)));
|
||||
//FarmingRegistry.registerGrindable(new GrindableStandard(MetalSlime.class, new ItemStack(TContent.strangeFood)));
|
||||
//FarmingRegistry.registerGrindable(new GrindableStandard(NitroCreeper.class, new ItemStack(Item.gunpowder)));
|
||||
//FarmingRegistry.registerGrindable(new GrindableStandard(Skyla.class, new ItemStack(Item.gunpowder)));
|
||||
|
||||
/*
|
||||
* Perhaps TC ores should be registered as drops from the MFR Laser Drill here, but I don't know which things would be suitable for that.
|
||||
* Syntax: FarmingRegistry.registerLaserOre(int weight, ItemStack droppedStack));
|
||||
* Currently used weights are from about 50 (emerald) to 175 (coal).
|
||||
*/
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package tconstruct.plugins.minefactoryreloaded.grindables;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import powercrystals.minefactoryreloaded.api.IFactoryGrindable;
|
||||
import powercrystals.minefactoryreloaded.api.MobDrop;
|
||||
|
||||
public class GrindableStandard implements IFactoryGrindable
|
||||
{
|
||||
private Class<?> _grindableClass;
|
||||
private List<MobDrop> _drops;
|
||||
|
||||
public GrindableStandard(Class<?> entityToGrind, MobDrop[] dropStacks)
|
||||
{
|
||||
_grindableClass = entityToGrind;
|
||||
_drops = new ArrayList<MobDrop>();
|
||||
for (MobDrop d : dropStacks)
|
||||
{
|
||||
_drops.add(d);
|
||||
}
|
||||
}
|
||||
|
||||
public GrindableStandard(Class<?> entityToGrind, ItemStack dropStack)
|
||||
{
|
||||
_grindableClass = entityToGrind;
|
||||
_drops = new ArrayList<MobDrop>();
|
||||
_drops.add(new MobDrop(10, dropStack));
|
||||
}
|
||||
|
||||
public GrindableStandard(Class<?> entityToGrind)
|
||||
{
|
||||
_grindableClass = entityToGrind;
|
||||
_drops = new ArrayList<MobDrop>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<?> getGrindableEntity ()
|
||||
{
|
||||
return _grindableClass;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MobDrop> grind (World world, EntityLiving entity, Random random)
|
||||
{
|
||||
return _drops;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
package tconstruct.plugins.minefactoryreloaded.harvestables;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import powercrystals.minefactoryreloaded.api.HarvestType;
|
||||
import powercrystals.minefactoryreloaded.api.IFactoryHarvestable;
|
||||
|
||||
public class HarvestableOreBerry implements IFactoryHarvestable
|
||||
{
|
||||
private int _sourceBlockId;
|
||||
private int _berryItemId;
|
||||
private int _metaOffset;
|
||||
|
||||
public HarvestableOreBerry(int sourceBlockId, int berryItemId, int metaOffset)
|
||||
{
|
||||
_sourceBlockId = sourceBlockId;
|
||||
_berryItemId = berryItemId;
|
||||
_metaOffset = metaOffset;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getPlantId ()
|
||||
{
|
||||
return _sourceBlockId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public HarvestType getHarvestType ()
|
||||
{
|
||||
return HarvestType.Column;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean breakBlock ()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canBeHarvested (World world, Map<String, Boolean> harvesterSettings, int x, int y, int z)
|
||||
{
|
||||
return world.getBlockMetadata(x, y, z) >= 12;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ItemStack> getDrops (World world, Random rand, Map<String, Boolean> harvesterSettings, int x, int y, int z)
|
||||
{
|
||||
ItemStack[] returnItems = { new ItemStack(_berryItemId, 1, world.getBlockMetadata(x, y, z) % 4 + _metaOffset) };
|
||||
return Arrays.asList(returnItems);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preHarvest (World world, int x, int y, int z)
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postHarvest (World world, int x, int y, int z)
|
||||
{
|
||||
world.setBlockMetadataWithNotify(x, y, z, world.getBlockMetadata(x, y, z) - 4, 2);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user