mirror of
https://github.com/GTNewHorizons/Avaritia.git
synced 2026-11-21 04:32:29 +00:00
Stuff and Things
This commit is contained in:
1 parent
f118481c35
commit
8997655d2d
12 files changed
+199
-50
No files matched your search
@@ -35,6 +35,7 @@ public class Config {
|
||||
public static boolean forestry = true;
|
||||
public static boolean ee3 = true;
|
||||
public static boolean extracells = true;
|
||||
public static boolean witch = true;
|
||||
|
||||
public static boolean copper = true;
|
||||
public static boolean tin = true;
|
||||
@@ -81,6 +82,7 @@ public class Config {
|
||||
forestry = conf.get("compatibility", "Forestry", true).getBoolean(true);
|
||||
ee3 = conf.get("compatibility", "Equivalent Exchange 3", true).getBoolean(true);
|
||||
extracells = conf.get("compatibility", "Extra Cells", true).getBoolean(true);
|
||||
witch = conf.get("compatibility", "Witchery", true).getBoolean(true);
|
||||
|
||||
conf.addCustomCategoryComment("materials", "Disable to stop using that material in recipes. Useful if a mod adds unobtainable placeholder ores.");
|
||||
copper = conf.get("materials", "Copper", true).getBoolean(true);
|
||||
|
||||
@@ -116,6 +116,16 @@ public class LudicrousEvents {
|
||||
event.drops.clear();
|
||||
}
|
||||
}
|
||||
else if(held.getItem() == LudicrousItems.infinity_axe) {
|
||||
|
||||
if (ToolHelper.hammering.contains(event.harvester)
|
||||
&& ToolHelper.hammerdrops.containsKey(event.harvester)
|
||||
&& ToolHelper.hammerdrops.get(event.harvester) != null) {
|
||||
|
||||
ToolHelper.hammerdrops.get(event.harvester).addAll(event.drops);
|
||||
event.drops.clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void extraLuck(HarvestDropsEvent event, int mult){
|
||||
|
||||
@@ -394,7 +394,7 @@ public class Compat {
|
||||
"IERRRRREI",
|
||||
"IEEEREEEI",
|
||||
"IIIIRIIII",
|
||||
'X', new ItemStack(LudicrousItems.resource, 1, 5),
|
||||
'X', new ItemStack(LudicrousBlocks.resource_block, 1, 1),
|
||||
'E', "blockEnderium",
|
||||
'I', new ItemStack(LudicrousItems.resource, 1, 6),
|
||||
'R', new ItemStack(LudicrousItems.singularity, 1, 3));
|
||||
@@ -405,6 +405,16 @@ public class Compat {
|
||||
}
|
||||
}
|
||||
|
||||
if(Loader.isModLoaded("witchery") && Config.witch){
|
||||
try {
|
||||
Item ingredient = getItem("witchery", "ingredient");
|
||||
Grinder.catalyst.getInput().add(new ItemStack(ingredient, 1, 150));
|
||||
}
|
||||
catch (Throwable e){
|
||||
Lumberjack.log(Level.INFO, e, "Avaritia suffered from Curse of the Incompatibility.");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static Block getBlock(String mod, String block) throws ItemNotFoundException {
|
||||
|
||||
@@ -124,7 +124,7 @@ public class RenderTileInfinitato extends TileEntitySpecialRenderer {
|
||||
renderIcon(Tsundere.costumes.getIconFromDamage(0));
|
||||
}
|
||||
else if(name.startsWith("moo") && name.endsWith("oon")) {
|
||||
GL11.glScalef(1.75F, 1.75F, 1.25F);
|
||||
GL11.glScalef(2.5F, 2.5F, 1.25F);
|
||||
GL11.glRotatef(180F, 0F, 0F, 1F);
|
||||
GL11.glTranslatef(-0.5F, -0.6F, -0.8F);
|
||||
renderIcon(Tsundere.costumes.getIconFromDamage(1));
|
||||
|
||||
@@ -1,16 +1,23 @@
|
||||
package fox.spiteful.avaritia.compat.thaumcraft;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import fox.spiteful.avaritia.Avaritia;
|
||||
import fox.spiteful.avaritia.compat.Compat;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.common.Thaumcraft;
|
||||
import thaumcraft.common.lib.network.PacketHandler;
|
||||
import thaumcraft.common.lib.network.playerdata.PacketAspectPool;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ItemAkashicRecord extends Item {
|
||||
|
||||
public ItemAkashicRecord(){
|
||||
@@ -36,4 +43,21 @@ public class ItemAkashicRecord extends Item {
|
||||
return stack;
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void getSubItems(Item item, CreativeTabs tab, List list) {
|
||||
super.getSubItems(item, tab, list);
|
||||
try {
|
||||
Item wand = Compat.getItem("Thaumcraft", "WandCasting");
|
||||
ItemStack cosmic = new ItemStack(wand, 1, 9000);
|
||||
NBTTagCompound tag = new NBTTagCompound();
|
||||
tag.setString("cap", "matrix");
|
||||
tag.setString("rod", "infinity");
|
||||
cosmic.setTagCompound(tag);
|
||||
list.add(cosmic);
|
||||
}
|
||||
catch (Throwable e){}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -65,14 +65,15 @@ public class Lucrum {
|
||||
" CIC ",
|
||||
" NIIC",
|
||||
" NINC ",
|
||||
" NIN ",
|
||||
" NXN ",
|
||||
" CNIN ",
|
||||
"CIIN ",
|
||||
" CIC ",
|
||||
" C ",
|
||||
'I', new ItemStack(LudicrousItems.resource, 1, 6),
|
||||
'C', new ItemStack(LudicrousItems.resource, 1, 1),
|
||||
'N', new ItemStack(LudicrousItems.resource, 1, 4));
|
||||
'N', new ItemStack(LudicrousItems.resource, 1, 4),
|
||||
'X', new ItemStack(LudicrousBlocks.resource_block, 1, 1));
|
||||
|
||||
if(Loader.isModLoaded("ThaumicTinkerer")) {
|
||||
try {
|
||||
|
||||
@@ -9,12 +9,20 @@ public class Gregorizer {
|
||||
public static int multiplier = 1;
|
||||
|
||||
public static void balance(){
|
||||
if(Loader.isModLoaded("Thaumcraft"))
|
||||
modifier += 100;
|
||||
if(Loader.isModLoaded("TConstruct") || Loader.isModLoaded("HydCraft"))
|
||||
modifier += 100;
|
||||
if(Loader.isModLoaded("ThermalExpansion") || Loader.isModLoaded("TSteelworks") || Loader.isModLoaded("IC2") || Loader.isModLoaded("ThaumicTinkerer"))
|
||||
modifier += 300;
|
||||
if(Loader.isModLoaded("technom"))
|
||||
modifier += 600;
|
||||
if(Loader.isModLoaded("magicalcrops"))
|
||||
multiplier += 1;
|
||||
if(Loader.isModLoaded("AgriCraft"))
|
||||
multiplier += 1;
|
||||
if(Loader.isModLoaded("MineFactoryReloaded"))
|
||||
multiplier += 1;
|
||||
multiplier += 3;
|
||||
if(Loader.isModLoaded("BigReactors"))
|
||||
modifier += 100;
|
||||
if(Loader.isModLoaded("EE3"))
|
||||
@@ -23,21 +31,19 @@ public class Gregorizer {
|
||||
multiplier += 3;
|
||||
if(Loader.isModLoaded("Botania"))
|
||||
modifier += 50;
|
||||
if(Loader.isModLoaded("IC2"))
|
||||
modifier += 300;
|
||||
if(Loader.isModLoaded("ThermalExpansion") || Loader.isModLoaded("TSteelworks"))
|
||||
modifier += 300;
|
||||
if(Loader.isModLoaded("technom"))
|
||||
modifier += 500;
|
||||
if(Loader.isModLoaded("ExtraUtilities"))
|
||||
modifier += 150;
|
||||
if(Loader.isModLoaded("Thaumcraft"))
|
||||
modifier += 100;
|
||||
modifier += 500;
|
||||
if(Loader.isModLoaded("appliedenergistics2"))
|
||||
modifier += 200;
|
||||
if(Loader.isModLoaded("ImmersiveEngineering"))
|
||||
modifier += 400;
|
||||
modifier += 300;
|
||||
if(Loader.isModLoaded("Mekanism")) {
|
||||
modifier += 500;
|
||||
multiplier += 1;
|
||||
}
|
||||
if(Loader.isModLoaded("Torcherino"))
|
||||
multiplier += 2;
|
||||
if(Loader.isModLoaded("DraconicEvolution")) {
|
||||
modifier += 300;
|
||||
multiplier += 1;
|
||||
}
|
||||
|
||||
@@ -78,7 +78,7 @@ public class Grinder {
|
||||
result.addEnchantment(Enchantment.fortune, 10);
|
||||
ExtremeCraftingManager.getInstance().addRecipe(result,
|
||||
" IIIIIII ",
|
||||
"IIIIIIIII",
|
||||
"IIIICIIII",
|
||||
"II N II",
|
||||
" N ",
|
||||
" N ",
|
||||
@@ -87,6 +87,7 @@ public class Grinder {
|
||||
" N ",
|
||||
" N ",
|
||||
'I', new ItemStack(LudicrousItems.resource, 1, 6),
|
||||
'C', new ItemStack(LudicrousBlocks.crystal_matrix, 1),
|
||||
'N', new ItemStack(LudicrousItems.resource, 1, 4));
|
||||
|
||||
ExtremeCraftingManager.getInstance().addRecipe(new ItemStack(LudicrousItems.infinity_sword),
|
||||
@@ -118,7 +119,7 @@ public class Grinder {
|
||||
'X', new ItemStack(LudicrousBlocks.resource_block, 1, 1),
|
||||
'N', new ItemStack(LudicrousItems.resource, 1, 4));
|
||||
|
||||
ExtremeCraftingManager.getInstance().addRecipe(new ItemStack(LudicrousItems.infinity_axe),
|
||||
/*ExtremeCraftingManager.getInstance().addRecipe(new ItemStack(LudicrousItems.infinity_axe),
|
||||
" I ",
|
||||
"IIIII",
|
||||
"IIII ",
|
||||
@@ -129,7 +130,7 @@ public class Grinder {
|
||||
" N ",
|
||||
" N ",
|
||||
'I', new ItemStack(LudicrousItems.resource, 1, 6),
|
||||
'N', new ItemStack(LudicrousItems.resource, 1, 4));
|
||||
'N', new ItemStack(LudicrousItems.resource, 1, 4));*/
|
||||
|
||||
ExtremeCraftingManager.getInstance().addRecipe(new ItemStack(LudicrousItems.infinity_armor),
|
||||
" NN NN ",
|
||||
@@ -142,13 +143,13 @@ public class Grinder {
|
||||
" NIIIIIN ",
|
||||
" NNNNN ",
|
||||
'I', new ItemStack(LudicrousItems.resource, 1, 6),
|
||||
'X', new ItemStack(LudicrousItems.resource, 1, 5),
|
||||
'X', new ItemStack(LudicrousBlocks.crystal_matrix, 1),
|
||||
'N', new ItemStack(LudicrousItems.resource, 1, 4));
|
||||
|
||||
ExtremeCraftingManager.getInstance().addRecipe(new ItemStack(LudicrousItems.infinity_helm),
|
||||
" NNNNN ",
|
||||
" NIIIIIN ",
|
||||
" NXXIXXN ",
|
||||
" N XIX N ",
|
||||
" NIIIIIN ",
|
||||
" NIIIIIN ",
|
||||
" NI I IN ",
|
||||
@@ -161,13 +162,14 @@ public class Grinder {
|
||||
"NIIIXIIIN",
|
||||
"NINNXNNIN",
|
||||
"NIN NIN",
|
||||
"NIN NIN",
|
||||
"NCN NCN",
|
||||
"NIN NIN",
|
||||
"NIN NIN",
|
||||
"NIN NIN",
|
||||
"NNN NNN",
|
||||
'I', new ItemStack(LudicrousItems.resource, 1, 6),
|
||||
'X', new ItemStack(LudicrousItems.resource, 1, 5),
|
||||
'C', new ItemStack(LudicrousBlocks.crystal_matrix, 1),
|
||||
'N', new ItemStack(LudicrousItems.resource, 1, 4));
|
||||
|
||||
ExtremeCraftingManager.getInstance().addRecipe(new ItemStack(LudicrousItems.infinity_shoes),
|
||||
|
||||
@@ -1,13 +1,24 @@
|
||||
/*
|
||||
*
|
||||
* Code blatantly jacked from Vazkii
|
||||
* Get the original here: https://github.com/Vazkii/Botania/blob/master/src/main/java/vazkii/botania/common/item/equipment/tool/terrasteel/ItemTerraAxe.java
|
||||
*/
|
||||
|
||||
package fox.spiteful.avaritia.items.tools;
|
||||
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import fox.spiteful.avaritia.Avaritia;
|
||||
import fox.spiteful.avaritia.Lumberjack;
|
||||
import fox.spiteful.avaritia.entity.EntityImmortalItem;
|
||||
import fox.spiteful.avaritia.items.LudicrousItems;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.enchantment.Enchantment;
|
||||
import net.minecraft.enchantment.EnchantmentHelper;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -15,22 +26,31 @@ import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.ItemAxe;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.ChunkCoordinates;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.ForgeHooks;
|
||||
import net.minecraftforge.common.util.EnumHelper;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import org.apache.logging.log4j.Level;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class ItemAxeInfinity extends ItemAxe {
|
||||
|
||||
private static final ToolMaterial opAxe = EnumHelper.addToolMaterial("INFINITY_PICKAXE", 32, 9999, 9999F, 20.0F, 200);
|
||||
private static Map<Integer, List<BlockSwapper>> blockSwappers = new HashMap();
|
||||
|
||||
public ItemAxeInfinity(){
|
||||
super(opAxe);
|
||||
setUnlocalizedName("infinity_axe");
|
||||
setTextureName("avaritia:infinity_axe");
|
||||
setCreativeTab(Avaritia.tab);
|
||||
FMLCommonHandler.instance().bus().register(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -55,42 +75,32 @@ public class ItemAxeInfinity extends ItemAxe {
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) {
|
||||
/*if(player.isSneaking()) {
|
||||
if(player.isSneaking()) {
|
||||
player.swingItem();
|
||||
int fortune = EnchantmentHelper.getFortuneModifier(player);
|
||||
boolean silk = EnchantmentHelper.getSilkTouchModifier(player);
|
||||
|
||||
}*/
|
||||
int range = 13;
|
||||
|
||||
ToolHelper.removeBlocksInIteration(player, stack, world, (int)player.posX, (int)player.posY, (int)player.posZ, -range, -3, -range, range, range * 2 - 3, range, null, ToolHelper.materialsAxe, silk, fortune, false);
|
||||
}
|
||||
return stack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockStartBreak(ItemStack stack, int x, int y, int z, EntityPlayer player) {
|
||||
/*if(stack.getTagCompound() != null && stack.getTagCompound().getBoolean("destroyer")) {
|
||||
MovingObjectPosition raycast = ToolHelper.raytraceFromEntity(player.worldObj, player, true, 10);
|
||||
if (raycast != null) {
|
||||
breakOtherBlock(player, stack, x, y, z, x, y, z, raycast.sideHit);
|
||||
}
|
||||
}*/
|
||||
MovingObjectPosition raycast = ToolHelper.raytraceFromEntity(player.worldObj, player, true, 10);
|
||||
if (raycast != null) {
|
||||
breakOtherBlock(player, stack, x, y, z, x, y, z, raycast.sideHit);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public void breakOtherBlock(EntityPlayer player, ItemStack stack, int x, int y, int z, int originX, int originY, int originZ, int side) {
|
||||
|
||||
/*World world = player.worldObj;
|
||||
Material mat = world.getBlock(x, y, z).getMaterial();
|
||||
if(!ToolHelper.isRightMaterial(mat, ItemPickaxeInfinity.MATERIALS))
|
||||
if(player.isSneaking())
|
||||
return;
|
||||
|
||||
if(world.isAirBlock(x, y, z))
|
||||
return;
|
||||
|
||||
ForgeDirection direction = ForgeDirection.getOrientation(side);
|
||||
int fortune = EnchantmentHelper.getFortuneModifier(player);
|
||||
boolean silk = EnchantmentHelper.getSilkTouchModifier(player);
|
||||
boolean doY = direction.offsetY == 0;
|
||||
|
||||
int range = 8;
|
||||
|
||||
ToolHelper.removeBlocksInIteration(player, stack, world, x, y, z, -range, doY ? -1 : -range, -range, range, doY ? range * 2 - 2 : range, range, null, ItemPickaxeInfinity.MATERIALS, silk, fortune, false);*/
|
||||
|
||||
ChunkCoordinates coords = new ChunkCoordinates(x, y, z);
|
||||
addBlockSwapper(player.worldObj, player, stack, coords, coords, 32, false, true, new ArrayList());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -112,4 +122,78 @@ public class ItemAxeInfinity extends ItemAxe {
|
||||
return false;
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onTickEnd(TickEvent.WorldTickEvent event) {
|
||||
if(event.phase == TickEvent.Phase.END) {
|
||||
int dim = event.world.provider.dimensionId;
|
||||
if(blockSwappers.containsKey(dim)) {
|
||||
List<BlockSwapper> swappers = blockSwappers.get(dim);
|
||||
List<BlockSwapper> swappersSafe = new ArrayList(swappers);
|
||||
swappers.clear();
|
||||
for(BlockSwapper s : swappersSafe)
|
||||
if(s != null)
|
||||
s.tick();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static BlockSwapper addBlockSwapper(World world, EntityPlayer player, ItemStack stack, ChunkCoordinates origCoords, ChunkCoordinates coords, int steps, boolean leaves, boolean force, List<String> posChecked) {
|
||||
BlockSwapper swapper = new BlockSwapper(world, player, stack, origCoords, coords, steps, leaves, force, posChecked);
|
||||
int dim = world.provider.dimensionId;
|
||||
if(!blockSwappers.containsKey(dim))
|
||||
blockSwappers.put(dim, new ArrayList());
|
||||
blockSwappers.get(dim).add(swapper);
|
||||
return swapper;
|
||||
}
|
||||
private static class BlockSwapper {
|
||||
final World world;
|
||||
final EntityPlayer player;
|
||||
final ItemStack stack;
|
||||
final ChunkCoordinates origCoords;
|
||||
final int steps;
|
||||
final ChunkCoordinates coords;
|
||||
final boolean leaves;
|
||||
final boolean force;
|
||||
final List<String> posChecked;
|
||||
BlockSwapper(World world, EntityPlayer player, ItemStack stack, ChunkCoordinates origCoords, ChunkCoordinates coords, int steps, boolean leaves, boolean force, List<String> posChecked) {
|
||||
this.world = world;
|
||||
this.player = player;
|
||||
this.stack = stack;
|
||||
this.origCoords = origCoords;
|
||||
this.coords = coords;
|
||||
this.steps = steps;
|
||||
this.leaves = leaves;
|
||||
this.force = force;
|
||||
this.posChecked = posChecked;
|
||||
}
|
||||
void tick() {
|
||||
Block blockat = world.getBlock(coords.posX, coords.posY, coords.posZ);
|
||||
if(!force && blockat.isAir(world, coords.posX, coords.posY, coords.posZ))
|
||||
return;
|
||||
ToolHelper.removeBlockWithDrops(player, stack, world, coords.posX, coords.posY, coords.posZ, null, ToolHelper.materialsAxe, EnchantmentHelper.getEnchantmentLevel(Enchantment.silkTouch.effectId, stack) > 0, EnchantmentHelper.getEnchantmentLevel(Enchantment.fortune.effectId, stack), 0F, false);
|
||||
if(steps == 0)
|
||||
return;
|
||||
for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
|
||||
int x = coords.posX + dir.offsetX;
|
||||
int y = coords.posY + dir.offsetY;
|
||||
int z = coords.posZ + dir.offsetZ;
|
||||
String pstr = posStr(x, y, z);
|
||||
if(posChecked.contains(pstr))
|
||||
continue;
|
||||
Block block = world.getBlock(x, y, z);
|
||||
boolean log = block.isWood(world, x, y, z);
|
||||
boolean leaf = block.isLeaves(world, x, y, z);
|
||||
if(log || leaf) {
|
||||
int steps = this.steps - 1;
|
||||
steps = leaf ? leaves ? steps : 3 : steps;
|
||||
addBlockSwapper(world, player, stack, origCoords, new ChunkCoordinates(x, y, z), steps, leaf, false, posChecked);
|
||||
posChecked.add(pstr);
|
||||
}
|
||||
}
|
||||
}
|
||||
String posStr(int x, int y, int z) {
|
||||
return x + ":" + y + ":" + z;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -7,11 +7,13 @@
|
||||
|
||||
package fox.spiteful.avaritia.items.tools;
|
||||
|
||||
import fox.spiteful.avaritia.items.LudicrousItems;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
@@ -30,7 +32,7 @@ public class ToolHelper {
|
||||
|
||||
public static Material[] materialsPick = new Material[]{ Material.rock, Material.iron, Material.ice, Material.glass, Material.piston, Material.anvil };
|
||||
public static Material[] materialsShovel = new Material[]{ Material.grass, Material.ground, Material.sand, Material.snow, Material.craftedSnow, Material.clay };
|
||||
public static Material[] materialsAxe = new Material[]{ Material.coral, Material.leaves, Material.plants, Material.wood };
|
||||
public static Material[] materialsAxe = new Material[]{ Material.coral, Material.leaves, Material.plants, Material.wood, Material.vine };
|
||||
|
||||
private static Random randy = new Random();
|
||||
|
||||
@@ -96,6 +98,8 @@ public class ToolHelper {
|
||||
|
||||
Material mat = world.getBlock(x, y, z).getMaterial();
|
||||
if(!world.isRemote && blk != null && !blk.isAir(world, x, y, z)/* && blk.getPlayerRelativeBlockHardness(player, world, x, y, z) > 0*/) {
|
||||
if(blk == Blocks.grass && stack.getItem() == LudicrousItems.infinity_axe)
|
||||
world.setBlock(x, y, z, Blocks.dirt);
|
||||
if(!blk.canHarvestBlock(player, meta) || !isRightMaterial(mat, materialsListing))
|
||||
return;
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package fox.spiteful.avaritia.tile;
|
||||
|
||||
import fox.spiteful.avaritia.Lumberjack;
|
||||
import fox.spiteful.avaritia.crafting.CompressorManager;
|
||||
import fox.spiteful.avaritia.items.LudicrousItems;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -7,6 +8,7 @@ import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import org.apache.logging.log4j.Level;
|
||||
|
||||
public class TileEntityCompressor extends TileLudicrous implements ISidedInventory {
|
||||
|
||||
@@ -41,7 +43,7 @@ public class TileEntityCompressor extends TileLudicrous implements ISidedInvento
|
||||
packet = true;
|
||||
}
|
||||
}
|
||||
if (progress >= target && processing != null && (output == null || output.isItemEqual(processing))) {
|
||||
if (progress >= target && processing != null && (output == null || (output.isItemEqual(processing) && output.stackSize < output.getMaxStackSize()))) {
|
||||
if(output == null)
|
||||
output = processing.copy();
|
||||
else if(output.isItemEqual(processing))
|
||||
@@ -206,9 +208,13 @@ public class TileEntityCompressor extends TileLudicrous implements ISidedInvento
|
||||
|
||||
@Override
|
||||
public boolean isItemValidForSlot(int slot, ItemStack stack){
|
||||
if(stack == null)
|
||||
return false;
|
||||
if(slot == 0){
|
||||
if(processing == null)
|
||||
return true;
|
||||
if(CompressorManager.getOutput(stack) == null)
|
||||
return false;
|
||||
if(CompressorManager.getOutput(stack).isItemEqual(processing))
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user