Skip to content

Commit

Permalink
Added Forge 1.20.1 support
Browse files Browse the repository at this point in the history
  • Loading branch information
Goldorion committed Aug 23, 2023
1 parent b523344 commit 451bb28
Show file tree
Hide file tree
Showing 21 changed files with 32 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

## 2.4.7
* Added Forge 1.20.1 support

## 2.4.6
* Added support for Fabric 1.20.1
* [Bugfix] In some cases, some getter blocks could cause build errors
Expand Down
1 change: 1 addition & 0 deletions src/forge-1.20.1/mappings/types.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
arraylist: ArrayList
1 change: 1 addition & 0 deletions src/forge-1.20.1/procedures/arraylist_add_value.java.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
${input$var}.add(${input$value});
1 change: 1 addition & 0 deletions src/forge-1.20.1/procedures/arraylist_clear.java.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
${input$var}.clear();
1 change: 1 addition & 0 deletions src/forge-1.20.1/procedures/arraylist_contain.java.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
${input$var}.contains(${input$value})
1 change: 1 addition & 0 deletions src/forge-1.20.1/procedures/arraylist_get_value.java.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
${input$var}.get(${opt.toInt(input$index)})
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(${input$var}.get(${opt.toInt(input$index)}) instanceof ArrayList _al ? _al : new ArrayList<>())
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/*@BlockState*/(${input$var}.get(${opt.toInt(input$index)}) instanceof BlockState _bs ? _bs : Blocks.AIR.defaultBlockState())
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(${input$var}.get(${opt.toInt(input$index)}) instanceof Direction _d ? _d : Direction.UP)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(${input$var}.get(${opt.toInt(input$index)}) instanceof Entity _e ? _e : null)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(${input$var}.get(${opt.toInt(input$index)}) instanceof File _f ? _f : new File(""))
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/*@ItemStack*/(${input$var}.get(${opt.toInt(input$index)}) instanceof ItemStack _bs ? _bs : ItemStack.EMPTY)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(${input$var}.get(${opt.toInt(input$index)}) instanceof JsonObject _jb ? _jb : new JsonObject())
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(${input$var}.get(${opt.toInt(input$index)}) instanceof Boolean _b ? _b : false)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(${input$var}.get(${opt.toInt(input$index)}) instanceof Double _d ? _d : 0)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(${input$var}.get(${opt.toInt(input$index)}) instanceof String _s ? _s : "")
1 change: 1 addition & 0 deletions src/forge-1.20.1/procedures/arraylist_isempty.java.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
${input$var}.isEmpty()
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
${input$var}.remove(${opt.toInt(input$index)});
1 change: 1 addition & 0 deletions src/forge-1.20.1/procedures/arraylist_set_value.java.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
${input$var}.set(${opt.toInt(input$index)}, ${input$value});
1 change: 1 addition & 0 deletions src/forge-1.20.1/procedures/arraylist_size.java.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
${input$var}.size()
10 changes: 10 additions & 0 deletions src/forge-1.20.1/variables/arraylist.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
defaultvalue: new ArrayList<>()
scopes:
local:
init: List<Object> ${var.getName()} = ${var.getType().getDefaultValue(generator.getWorkspace())};
get: ${name}
set: ${name} = (${javaType}) ${opt.removeParentheses(value)};
global_session:
init: public static List<Object> ${var.getName()} = ${var.getValue()};
get: ${JavaModName}Variables.${name}
set: ${JavaModName}Variables.${name} = ${opt.removeParentheses(value)};

0 comments on commit 451bb28

Please sign in to comment.