Renamed transformations to variations and fixed adding variations when the variation didn't already exist.
This commit is contained in:
parent
9f71834a5a
commit
fbea82bc59
2 changed files with 9 additions and 3 deletions
|
@ -10,6 +10,7 @@ import com.cricketcraft.chisel.api.carving.CarvingUtils;
|
|||
import com.cricketcraft.chisel.api.carving.ICarvingGroup;
|
||||
import com.cricketcraft.chisel.api.carving.ICarvingVariation;
|
||||
import com.cricketcraft.chisel.carving.Carving;
|
||||
import com.cricketcraft.chisel.carving.CarvingVariation;
|
||||
|
||||
public class ChiselHelper {
|
||||
|
||||
|
@ -28,6 +29,11 @@ public class ChiselHelper {
|
|||
return Carving.chisel.getVariation(Block.getBlockFromItem(toStack(stack).getItem()), stack.getDamage());
|
||||
}
|
||||
|
||||
public static ICarvingVariation makeVariation(IItemStack stack)
|
||||
{
|
||||
return new CarvingVariation(Block.getBlockFromItem(toStack(stack).getItem()), stack.getDamage(),99);
|
||||
}
|
||||
|
||||
public static boolean groupContainsVariation(ICarvingGroup group, ICarvingVariation variation)
|
||||
{
|
||||
for(ICarvingVariation otherVariation : group.getVariations())
|
||||
|
|
|
@ -21,7 +21,7 @@ import stanhebben.zenscript.annotations.ZenMethod;
|
|||
@ZenClass("mods.chisel.Groups")
|
||||
public class Groups {
|
||||
@ZenMethod
|
||||
public static void addTransformation(String groupName, IItemStack stack) {
|
||||
public static void addVariation(String groupName, IItemStack stack) {
|
||||
ICarvingGroup group=ChiselHelper.getGroup(groupName);
|
||||
ICarvingVariation variation=ChiselHelper.getVariation(stack);
|
||||
if(group==null)
|
||||
|
@ -82,7 +82,7 @@ public class Groups {
|
|||
|
||||
|
||||
@ZenMethod
|
||||
public static void removeTransformation(String groupName, IItemStack stack) {
|
||||
public static void removeVariation(String groupName, IItemStack stack) {
|
||||
ICarvingGroup group=ChiselHelper.getGroup(groupName);
|
||||
ICarvingVariation variation=ChiselHelper.getVariation(stack);
|
||||
if(group==null)
|
||||
|
@ -92,7 +92,7 @@ public class Groups {
|
|||
}
|
||||
if(variation==null)
|
||||
{
|
||||
MineTweakerAPI.getLogger().logError("Can't create variation from " + stack);
|
||||
MineTweakerAPI.getLogger().logError("Can't find variation from " + stack);
|
||||
return;
|
||||
}
|
||||
if(!ChiselHelper.groupContainsVariation(group, variation))
|
||||
|
|
Loading…
Reference in a new issue