Skip to content

Commit

Permalink
feat: more code highlight and snippets (#16)
Browse files Browse the repository at this point in the history
Mentioned in #11
  • Loading branch information
Death-123 authored Apr 5, 2020
1 parent 9fbdbf1 commit 5d9bb73
Show file tree
Hide file tree
Showing 5 changed files with 409 additions and 28 deletions.
30 changes: 30 additions & 0 deletions language/snippets/aether_legacy.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"ImportAether":{
"prefix": "AetherImport",
"body":[
"import mods.aether_legacy;"
],
"description": "Import Aether"
},
"registerEnchantement": {
"prefix": "registerEnchantement",
"body":[
"Enchanter.registerEnchantment(input, output, time);"
],
"description": "Out put messages"
},
"registerAccessory": {
"prefix": "registerAccessory",
"body":[
"Acessory.registerAccessory(input, accessory);"
],
"description": "Out put messages"
},
"registerFreezable": {
"prefix": "registerAccessory",
"body":[
"registerFreezable(input, output, timeRequired);"
],
"description": "Out put messages"
}
}
13 changes: 11 additions & 2 deletions language/snippets/global.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
{
"Print": {
"Print":{
"prefix": "print",
"body": ["print(\"$1\");"],
"body":[
"print(${type:String});"
],
"description": "Prints the string to the crafttweaker log as information."
},
"Import":{
"prefix": "import",
"body":[
"import ${type:module};"
],
"description": "Import a mod"
},
"Total_Actions": {
"prefix": "tota",
"body": ["totalActions();"],
Expand Down
51 changes: 51 additions & 0 deletions language/snippets/jei.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"ImportJei":{
"prefix": "jeiImport",
"body":[
"import mods.jei.JEI;"
],
"description": "Import Jei"
},
"JeiHide":{
"prefix": "jeiRemoveAndHide",
"body":[
"mods.jei.JEI.hide(${item});"
],
"description": "Hide item from JEI"
},
"JeiRemoveAndHide":{
"prefix": "jeiRemoveAndHide",
"body":[
"mods.jei.JEI.removeAndHide(${item});"
],
"description": "remove a item recipe and hide it in JEI"
},
"JeiRemoveAndHideNbtMatch":{
"prefix": "jeiRemoveAndHideNbtMatch",
"body":[
"mods.jei.JEI.removeAndHide(${item}, false);"
],
"description": "remove a item recipe and hide it in JEI"
},
"JeiHideCategory":{
"prefix": "jeiHideCategory",
"body":[
"mods.jei.JEI.hideCategory(\"${category}\");"
],
"description": "Hide a Category"
},
"JeiAddItem":{
"prefix": "jeiAddItem",
"body": [
"mods.jei.JEI.addItem(${item})"
],
"description": "Add a item to Jei"
},
"JeiAddDesciption":{
"prefix": "jeiAddDesciption",
"body": [
"mods.jei.JEI.addDescription(${item},\"${description}\");"
],
"description": "Add a description to a item in jei"
}
}
204 changes: 204 additions & 0 deletions language/snippets/zenscript.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,204 @@
{
"For":{
"prefix": "for",
"body":[
"for ${1:num},${2:item} in ${3:array} {",
"\t",
"}"
],
"description": "For element"
},
"If":{
"prefix": "if",
"body":[
"if (${cond}) {",
"\t${branch1}",
"} else {",
"\t${branch2}",
"}"
],
"description": "If element else element"
},
"Val":{
"prefix": "val",
"body":[
"val ${name} = ${expression};"
],
"description": "Create a variable"
},
"Var":{
"prefix": "var",
"body":[
"var ${name} = ${expression};"
],
"description": "Create a variable"
},
"Recipes":{
"prefix": "recipes",
"body":[
"recipes"
],
"description": "Recipes Manager"
},
"Furnace":{
"prefix": "Furnace",
"body":[
"furnace"
],
"description": "Furnace Manager"
},
"AddShaped":{
"prefix":"recipeAddshaped",
"body":[
"recipes.addShaped(${output}, ${input});"
],
"description": "Add Shaped Craft"
},
"AddShapeless":{
"prefix":"recipeAddshapeless",
"body":[
"recipes.addShapeless(${output}, ${input});"
],
"description": "Add Shapeless Craft"
},
"RemoveCraft":{
"prefix":"remove",
"body":[
"recipes.addShaped(${output});"
],
"description": "Remove Craft"
},
"RemoveShaped":{
"prefix":"removeshaped",
"body":[
"recipes.removeShaped(${output}, ${input});"
],
"description": "Remove Shaped Craft"
},
"RemoveShapeless":{
"prefix":"removeshapeless",
"body":[
"recipes.removeShapeless(${output});"
],
"description": "Remove Shapedless Craft"
},
"AddOreDictionary":{
"prefix":"add",
"body":[
"${od}.add(${item});"
],
"description": "Add item to OD."
},
"RemoveOreDictionary":{
"prefix":"remove",
"body":[
"${od}.remove(${item});"
],
"description": "Remove item from OD."
},
"MirrorOreDictionary":{
"prefix":"mirror",
"body":[
"${od1}.mirror(${od2});"
],
"description": "Mirror OD. to OD."
},
"AddAllOreDictionary":{
"prefix":"addall",
"body":[
"${od1}.addAll(${od2});"
],
"description": "Add OD. to OD."
},
"AddFurnaceRecipe":{
"prefix":"addrecipe",
"body":[
"furnace.addRecipe(${output}, ${input}, ${xp});"
],
"description": "Add Furnace Recipe"
},
"RemoveFurnaceRecipe":{
"prefix":"remove",
"body":[
"furnace.remove(${output}, ${input});"
],
"description": "Remove Furnace Recipe"
},
"SetFuel":{
"prefix":"setfuel",
"body":[
"furnace.setFuel(${item}, ${value]});"
],
"description": "Set Furnace Fuel"
},
"WithTag":{
"prefix":"withtag",
"body":[
"${item}.withTag(${tag});"
],
"description": "Items with tag"
},
"WithDamage":{
"prefix":"withdamage",
"body":[
"${item}.withDamage(${value});"
],
"description": "Item with damage"
},
"OnlyWithTag":{
"prefix":"onlywithtag",
"body":[
"${item}.onlyWithTag(${value});"
],
"description":"Item with tag only"
},
"OnlyDamageAtLeast":{
"prefix":"onlydamageatleast",
"body":[
"${item}.onlyDamageAtLeast(${value});"
],
"description": "Least with damage"
},
"OnlyDamageAtMost":{
"prefix":"onlydamageatMost",
"body":[
"${item}.onlyDamageAtMost(${value});"
],
"description": "Most with damage"
},
"OnlyDamageBetween":{
"prefix":"onlydamagebetween",
"body":[
"${item}.onlyDamageBetween(${value1}, ${value2});"
],
"description": "Damage between with two num"
},
"Reuse":{
"prefix":"reuse",
"body":[
"${item}.reuse(${item});"
],
"description": "Retrun item"
},
"TransFormDamage":{
"prefix":"transformdamage",
"body":[
"${item}.transformDamage(${value});"
],
"description": "Make item add damage"
},
"DisPlayName":{
"prefix":"displayname",
"body":[
"${item}.displayName = \"${value}\";"
],
"description": "Set item display name"
},
"Null":{
"prefix":"null",
"body":[
"null"
],
"description": "Empty Value"
}
}
Loading

0 comments on commit 5d9bb73

Please sign in to comment.