Stuff and things

Cross-mod shenanigans, resource block beacon bases
This commit is contained in:
Jeremy Diamond committed 2015-07-12 20:26:52 -07:00
1 parent 46483a70e3
commit bf3b71020c
13 files changed
+211 -7

No files matched your search

@@ -8,12 +8,13 @@ import net.minecraft.entity.item.EntityItem;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import net.minecraftforge.event.entity.player.PlayerEvent;
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
import org.apache.logging.log4j.Level;
import java.util.Random;
import static net.minecraftforge.event.world.BlockEvent.HarvestDropsEvent;
public class LudicrousEvents {
private Random randy = new Random();
@@ -33,6 +34,11 @@ public class LudicrousEvents {
}
}
@SubscribeEvent
public void extraLuck(HarvestDropsEvent event){
}
private void dropItem(ItemStack drop, World world, int x, int y, int z){
float f = 0.7F;
double d0 = (double)(randy.nextFloat() * f) + (double)(1.0F - f) * 0.5D;
@@ -42,4 +48,5 @@ public class LudicrousEvents {
entityitem.delayBeforeCanPickup = 10;
world.spawnEntityInWorld(entityitem);
}
}
@@ -2,6 +2,7 @@ package fox.spiteful.avaritia.blocks;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.world.IBlockAccess;
public class BlockCrystalMatrix extends Block {
@@ -15,4 +16,10 @@ public class BlockCrystalMatrix extends Block {
setBlockTextureName("avaritia:block_crystal_matrix");
}
@Override
public boolean isBeaconBase(IBlockAccess worldObj, int x, int y, int z, int beaconX, int beaconY, int beaconZ)
{
return true;
}
}
@@ -6,15 +6,17 @@ import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import java.util.List;
public class BlockResource extends Block {
public static final String[] types = new String[]{"neutronium"};
public static final String[] types = new String[]{"neutronium", "infinity", "gaia"};
private IIcon[] icons;
public BlockResource(){
@@ -63,4 +65,10 @@ public class BlockResource extends Block {
this.icons[i] = iconRegister.registerIcon("avaritia:block_" + types[i]);
}
}
@Override
public boolean isBeaconBase(IBlockAccess worldObj, int x, int y, int z, int beaconX, int beaconY, int beaconZ)
{
return true;
}
}
@@ -1,15 +1,39 @@
package fox.spiteful.avaritia.compat;
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.registry.GameRegistry;
import fox.spiteful.avaritia.Lumberjack;
import fox.spiteful.avaritia.blocks.LudicrousBlocks;
import fox.spiteful.avaritia.crafting.Grinder;
import net.minecraft.block.Block;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import org.apache.logging.log4j.Level;
public class Compat {
public static boolean nei = false;
public static boolean thaumic = false;
public static boolean sc2 = false;
public static boolean ae2 = false;
public static boolean exu = false;
public static boolean ic2 = false;
public static boolean gt = false;
public static boolean botan = false;
public static boolean blood = false;
public static boolean lolDargon = false;
public static void census(){
nei = Loader.isModLoaded("NotEnoughItems");
thaumic = Loader.isModLoaded("Thaumcraft");
sc2 = Loader.isModLoaded("StevesCarts");
ae2 = Loader.isModLoaded("appliedenergistics2");
exu = Loader.isModLoaded("ExtraUtilities");
ic2 = Loader.isModLoaded("IC2");
gt = Loader.isModLoaded("gregtech");
botan = Loader.isModLoaded("Botania");
blood = Loader.isModLoaded("AWWayofTime");
lolDargon = Loader.isModLoaded("DraconicEvolution");
}
public static void compatify(){
@@ -29,14 +53,155 @@ public class Compat {
e.printStackTrace();
}
}
if(thaumic){
try
{
Lucrum.abracadabra();
}
catch(Throwable e){
Lumberjack.log(Level.INFO, "Avaritia accumulated too much Warp!");
e.printStackTrace();
thaumic = false;
}
}
if(sc2){
try {
Block resource = getBlock("StevesCarts", "BlockMetalStorage");
ItemStack galg = new ItemStack(resource, 1, 2);
Grinder.catalyst.recipeItems.add(galg);
}
catch(Exception e){
Lumberjack.log(Level.INFO, "Avaritia died of old age while trying to craft the Galgadorian Drill.");
e.printStackTrace();
sc2 = false;
}
}
if(ae2){
try {
Item resource = getItem("appliedenergistics2", "item.ItemMultiMaterial");
ItemStack cell = new ItemStack(resource, 1, 38);
Grinder.catalyst.recipeItems.add(cell);
}
catch (Exception e){
Lumberjack.log(Level.INFO, "Avaritia couldn't figure out how channels work.");
e.printStackTrace();
ae2 = false;
}
}
if(exu){
try {
Block bedrockium = getBlock("ExtraUtilities", "block_bedrockium");
Block deco = getBlock("ExtraUtilities", "decorativeBlock1");
ItemStack bed = new ItemStack(bedrockium, 1, 0);
ItemStack unstable = new ItemStack(deco, 1, 5);
Grinder.catalyst.recipeItems.add(bed);
Grinder.catalyst.recipeItems.add(unstable);
}
catch (Exception e){
Lumberjack.log(Level.INFO, "Avaritia was unable to stop Lavos.");
e.printStackTrace();
exu = false;
}
}
if(ic2){
try {
if(gt){
try {
Block resource = getBlock("gregtech", "gt.meta.storage.ingot");
ItemStack osmir = new ItemStack(resource, 1, 8682);
Grinder.catalyst.recipeItems.add(osmir);
}
catch(Exception e){
Lumberjack.log(Level.INFO, "Avaritia got sick of only getting 2 planks per log.");
e.printStackTrace();
gt = false;
}
}
if(!gt){
Item iridium = getItem("IC2", "itemPartIridium");
ItemStack plate = new ItemStack(iridium, 1, 0);
Grinder.catalyst.recipeItems.add(plate);
}
}
catch (Exception e){
Lumberjack.log(Level.INFO, "Avaritia blew up the macerator.");
e.printStackTrace();
ic2 = false;
}
}
if(botan){
try {
Item resource = getItem("Botania", "manaResource");
ItemStack gaia = new ItemStack(resource, 1, 14);
GameRegistry.addShapedRecipe(new ItemStack(LudicrousBlocks.resource_block, 1, 2), new Object[]{
"XXX",
"XXX",
"XXX",
'X', gaia
});
GameRegistry.addShapedRecipe(new ItemStack(resource, 9, 14), new Object[]{
"X", 'X', new ItemStack(LudicrousBlocks.resource_block, 1, 2)
});
Grinder.catalyst.recipeItems.add(new ItemStack(LudicrousBlocks.resource_block, 1, 2));
}
catch (Exception e){
Lumberjack.log(Level.INFO, "Avaritia is wondering where all the dayblooms went.");
e.printStackTrace();
botan = false;
}
}
if(blood){
try {
Block crystal = getBlock("AWWayofTime", "blockCrystal");
ItemStack cluster = new ItemStack(crystal, 1, 0);
Grinder.catalyst.recipeItems.add(cluster);
}
catch (Exception e){
Lumberjack.log(Level.INFO, "Avaritia decided to use a Fallen Kanade instead.");
e.printStackTrace();
blood = false;
}
}
if(lolDargon){
try {
Block dargon = getBlock("DraconicEvolution", "draconicBlock");
ItemStack lol = new ItemStack(dargon, 1, 0);
Grinder.catalyst.recipeItems.add(lol);
}
catch (Exception e){
Lumberjack.log(Level.INFO, "Avaritia was distracted by a giant glowing sphere.");
e.printStackTrace();
lolDargon = false;
}
}
}
public static Block getBlock(String mod, String block) throws ItemNotFoundException {
Block target = GameRegistry.findBlock(mod, block);
if(target == null)
throw new ItemNotFoundException(mod, block);
return target;
}
public static Item getItem(String mod, String item) throws ItemNotFoundException {
Item target = GameRegistry.findItem(mod, item);
if(target == null)
throw new ItemNotFoundException(mod, item);
return target;
}
public static class ItemNotFoundException extends Exception {
public ItemNotFoundException(String mod, String item){
super("Unable to find " + item + " in mod " + mod + "! Are you using the correct version of the mod?");
}
}
}
@@ -117,7 +117,7 @@ public class ExtremeCraftingManager {
'N', new ItemStack(LudicrousBlocks.resource_block, 1, 0)});
}
public void addShapelessRecipe(ItemStack result, Object ... ingredients)
public ExtremeShapelessRecipe addShapelessRecipe(ItemStack result, Object ... ingredients)
{
ArrayList arraylist = new ArrayList();
Object[] aobject = ingredients;
@@ -146,7 +146,9 @@ public class ExtremeCraftingManager {
}
}
this.recipes.add(new ExtremeShapelessRecipe(result, arraylist));
ExtremeShapelessRecipe recipe = new ExtremeShapelessRecipe(result, arraylist);
this.recipes.add(recipe);
return recipe;
}
public ItemStack findMatchingRecipe(InventoryCrafting matrix, World world)
@@ -9,6 +9,8 @@ import net.minecraft.item.ItemStack;
public class Grinder {
public static ExtremeShapelessRecipe catalyst;
public static void artsAndCrafts(){
GameRegistry.addShapedRecipe(new ItemStack(LudicrousItems.resource, 1, 0), new Object[]{"X X", " X ", "X X", 'X', new ItemStack(Items.diamond)});
@@ -55,8 +57,9 @@ public class Grinder {
'N', new ItemStack(LudicrousItems.resource, 1, 4),
'C', new ItemStack(LudicrousItems.resource, 1, 5)});
ExtremeCraftingManager.getInstance().addShapelessRecipe(new ItemStack(LudicrousItems.resource, 1, 5), new Object[]{
catalyst = ExtremeCraftingManager.getInstance().addShapelessRecipe(new ItemStack(LudicrousItems.resource, 1, 5), new Object[]{
new ItemStack(LudicrousBlocks.crystal_matrix, 1), new ItemStack(LudicrousBlocks.resource_block, 1, 0),
new ItemStack(Blocks.emerald_block, 1),
new ItemStack(LudicrousItems.singularity, 1, 0), new ItemStack(LudicrousItems.singularity, 1, 1),
new ItemStack(LudicrousItems.singularity, 1, 2)});
@@ -17,8 +17,8 @@ public class TileEntityNeutron extends TileEntity implements IInventory {
private int progress;
public void updateEntity(){
//if(++progress >= 10665){
if(++progress >= 300){
if(++progress >= 10665){
//if(++progress >= 300){
if(neutrons == null)
neutrons = new ItemStack(LudicrousItems.resource, 1, 2);
else if(neutrons.getItem() == LudicrousItems.resource && neutrons.getItemDamage() == 2 && neutrons.stackSize < 64)
@@ -17,6 +17,8 @@ tile.compressed_workbench.name=Compressed Crafting Table
tile.very_compressed_workbench.name=Double Compressed Crafting Table
tile.block_crystal_matrix.name=Crystal Matrix
tile.block_neutronium.name=Neutronium Block
tile.block_infinity.name=Infinity Block
tile.block_gaia.name=Gaia Block
tile.dire_crafting.name=Dire Crafting Table
tile.neutron_collector.name=Neutron Collector
#
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

@@ -0,0 +1,5 @@
{
"animation": {
"frametime": 4
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 610 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

@@ -0,0 +1,5 @@
{
"animation": {
"frametime": 2
}
}