-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e21801d
commit 575281e
Showing
2 changed files
with
109 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#priority 32767 | ||
import crafttweaker.item.IItemStack; | ||
import crafttweaker.item.IIngredient; | ||
import crafttweaker.item.IItemCondition; | ||
import crafttweaker.data.IData; | ||
|
||
|
||
zenClass ConditionedItemStack { | ||
var stack as IItemStack = null; | ||
zenConstructor(para as IItemStack) { | ||
stack = para; | ||
} | ||
function setStack(stack as IItemStack) { | ||
this.stack = stack; | ||
} | ||
function onlyEmptyTag() as IItemStack { | ||
return this.stack.only(function(item) { | ||
return (item.tag == {}); | ||
}); | ||
} | ||
function withLore(para as string[]) as IItemStack { | ||
return this.stack.only(function(item) { | ||
val data as string = item.tag.asString(); | ||
var result as bool = true; | ||
for i in para { | ||
if (result) { | ||
result &= data.contains(i); | ||
} else break; | ||
} | ||
return result; | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
#priority 30001 | ||
#loader contenttweaker | ||
import mods.contenttweaker.MaterialSystem; | ||
import mods.contenttweaker.Material; | ||
import mods.contenttweaker.Part; | ||
import mods.contenttweaker.PartBuilder; | ||
import mods.contenttweaker.MaterialPart; | ||
import mods.contenttweaker.RegisterMaterialPart; | ||
import mods.contenttweaker.PartDataPiece; | ||
import mods.contenttweaker.MaterialPartData; | ||
import mods.contenttweaker.PartType; | ||
import mods.contenttweaker.IItemColorSupplier; | ||
import mods.contenttweaker.IBlockColorSupplier; | ||
import scripts.grassUtils.StringHelperCot as StringHelper; | ||
import scripts.grassUtils.LoggerCot as Logger; | ||
|
||
zenClass MaterialSystemHelper { | ||
zenConstructor() { | ||
} | ||
var materialList as Material[string] = {}; | ||
var partList as Part[string] = {}; | ||
|
||
function registerMaterial(name as string,color as int) as Material { | ||
val id as string = StringHelper.toUpperCamelCase(name); | ||
var material as Material = MaterialSystem.getMaterialBuilder().setName(id).setColor(color).build(); | ||
this.materialList[id] = material; | ||
return material; | ||
} | ||
|
||
function getMaterial(key as string) as Material { | ||
return MaterialSystem.getMaterial(key); | ||
} | ||
|
||
function getAllMaterials() as Material[string] { | ||
return MaterialSystem.getMaterials(); | ||
} | ||
|
||
function registerNormalPart(name as string, type as string, hasOverlay as bool) as Part { | ||
val id as string = StringHelper.toSnakeCase(name); | ||
val oreDictID as string = StringHelper.toLowerCamelCase(name); | ||
var part as Part = MaterialSystem.getPartBuilder().setName(id).setPartType(MaterialSystem.getPartType(type)).setHasOverlay(hasOverlay).setOreDictName(oreDictID).build(); | ||
this.partList[name] = part; | ||
return part; | ||
} | ||
|
||
function registerSpecialPart(name as string, hasOverlay as bool, fx as RegisterMaterialPart) as Part { | ||
// TODO | ||
return null; | ||
} | ||
|
||
function getPart(key as string) as Part { | ||
return MaterialSystem.getPart(key); | ||
} | ||
|
||
function getAllParts() as Part[string] { | ||
return MaterialSystem.getParts(); | ||
} | ||
|
||
function registerAMaterialPart(materialID as string, partID as string) /* as MaterialPart */{ | ||
/* return */this.partList[partID].registerToMaterial(this.materialList[materialID]); | ||
} | ||
|
||
function registerMaterialPartByPart(partID as string) /* as MaterialPart[] */{ | ||
/* return */ this.partList[partID].registerToMaterials(this.materialList.values); | ||
} | ||
|
||
function registerMaterialPartByMaterial(materialID as string) /* as MaterialPart[] */{ | ||
/* return */ this.materialList[materialID].registerParts(this.partList.values); | ||
} | ||
|
||
function registerAllMaterialParts() { | ||
for key in partList { | ||
this.registerMaterialPartByPart(key); | ||
} | ||
} | ||
} |