mirror of
https://github.com/GTNewHorizons/Chisel.git
synced 2026-11-12 00:07:37 +00:00
Fixed the crash with chisels <,<
This commit is contained in:
1 parent
3ef784b494
commit
fe2c7e8c87
3 files changed
+14
-10
No files matched your search
@@ -53,7 +53,8 @@ public class Carving
|
||||
public String getOre(Block block, int metadata)
|
||||
{
|
||||
CarvingGroup group = getGroup(block, metadata);
|
||||
if(group == null) return null;
|
||||
if(group == null)
|
||||
return null;
|
||||
|
||||
return group.oreName;
|
||||
}
|
||||
@@ -61,10 +62,12 @@ public class Carving
|
||||
public ArrayList<ItemStack> getItems(ItemStack chiseledItem)
|
||||
{
|
||||
ArrayList<ItemStack> items = new ArrayList<ItemStack>();
|
||||
|
||||
int damage = chiseledItem.getItemDamage();
|
||||
|
||||
CarvingGroup group = getGroup(Block.getBlockFromItem(chiseledItem.getItem()), damage);
|
||||
if(group == null) return items;
|
||||
if(group == null)
|
||||
return items;
|
||||
|
||||
HashMap<String, Integer> mapping = new HashMap<String, Integer>();
|
||||
|
||||
@@ -100,13 +103,17 @@ public class Carving
|
||||
|
||||
public CarvingGroup getGroup(Block block, int metadata)
|
||||
{
|
||||
if(block.equals(Blocks.stone)) block = Blocks.stonebrick;
|
||||
if(block.equals(Blocks.stone))
|
||||
block = Blocks.stonebrick;
|
||||
|
||||
// Check name first
|
||||
CarvingGroup res;
|
||||
int i = OreDictionary.getOreID(block.getUnlocalizedName());
|
||||
if(i < 1)
|
||||
return null;
|
||||
|
||||
if((res = carvingGroupsByOre.get(OreDictionary.getOreIDs(new ItemStack(block, 1, metadata)))) != null)
|
||||
return res;
|
||||
//if((res = carvingGroupsByOre.get(OreDictionary.getOreIDs(new ItemStack(block, 1, metadata)))) != null)
|
||||
// return res;
|
||||
|
||||
if((res = carvingGroupsByVariation.get(key(block, metadata))) != null)
|
||||
return res;
|
||||
|
||||
@@ -1,16 +1,14 @@
|
||||
package info.jbcs.minecraft.chisel.inventory;
|
||||
|
||||
import info.jbcs.minecraft.chisel.item.ItemChisel;
|
||||
import info.jbcs.minecraft.utilities.General;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class InventoryChiselSelection implements IInventory
|
||||
{
|
||||
ItemStack chisel = null;
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package info.jbcs.minecraft.chisel.inventory;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
|
||||
Reference in new issue
Block a user