Remove Fletching and Bowstring restriction integration, since they're kinda useless and don't work with non-materials

This commit is contained in:
Bernhard Bonigl committed 2014-12-28 16:46:41 +01:00
1 parent cee11fa1a0
commit 3d42a1fd04
3 files changed
+19 -9

No files matched your search

@@ -28,6 +28,11 @@ public class PartRestrictionHandler {
PatternBuilder.ItemKey key = PatternBuilder.instance.getItemKey(event.material);
if(key == null)
return;
// bowstring and fletching
if(event.pattern.getItemDamage() == 23 || event.pattern.getItemDamage() == 24)
return;
PatternBuilder.MaterialSet set = ((PatternBuilder.MaterialSet)PatternBuilder.instance.materialSets.get(key.key));
if(set == null)
return;
@@ -46,6 +46,10 @@ public class RestrictionConfig {
comment.append("partnames are: ");
// patterns
for(String name : RestrictionHelper.configNameToPattern.keySet()) {
// exclude fletching and bowstring
if("bowstring".equals(name) || "fletching".equals(name))
continue;
comment.append(name);
comment.append(", ");
}
@@ -6,10 +6,7 @@ import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import tconstruct.library.TConstructRegistry;
import tconstruct.library.crafting.CastingRecipe;
import tconstruct.library.tools.BowstringMaterial;
import tconstruct.library.tools.CustomMaterial;
import tconstruct.library.tools.FletchingMaterial;
import tconstruct.library.tools.ToolMaterial;
import tconstruct.library.tools.*;
import tconstruct.library.util.IToolPart;
import tconstruct.smeltery.TinkerSmeltery;
import tconstruct.smeltery.items.MetalPattern;
@@ -198,6 +195,9 @@ public final class RestrictionHelper {
else
name = (new ItemStack(pattern, 1, meta)).getUnlocalizedName();
if(name == null || name.isEmpty())
continue;
ItemMetaWrapper im = configNameToPattern.get(name);
// not registered in the mapping yet?
if(im == null) {
@@ -213,11 +213,10 @@ public final class RestrictionHelper {
}
// bowstring and fletchling are treated differently
for(Integer matID : TConstructRegistry.toolMaterials.keySet())
for(CustomMaterial mat : TConstructRegistry.customMaterials)
{
// bowstring
CustomMaterial mat = TConstructRegistry.getCustomMaterial(matID, BowstringMaterial.class);
if(mat != null)
if(mat instanceof BowstringMaterial)
{
ItemMetaWrapper im = configNameToPattern.get("bowstring");
// not registered in the mapping yet?
@@ -234,8 +233,7 @@ public final class RestrictionHelper {
}
// fletchling
mat = TConstructRegistry.getCustomMaterial(matID, FletchingMaterial.class);
if(mat != null)
if(mat instanceof FletchingMaterial)
{
ItemMetaWrapper im = configNameToPattern.get("fletching");
// not registered in the mapping yet?
@@ -278,6 +276,9 @@ public final class RestrictionHelper {
else
name = (new ItemStack(pattern, 1, meta)).getUnlocalizedName();
if(name == null || name.isEmpty())
continue;
ItemMetaWrapper im = configNameToCast.get(name);
// not registered in the mapping yet?
if(im == null) {