Skip to content

Commit

Permalink
Custom paintings
Browse files Browse the repository at this point in the history
  • Loading branch information
Goldorion committed Jul 28, 2021
1 parent 8c9f17a commit 492f1c6
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 0 deletions.
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Another version will be made to support entirely MCreator 2021.2
* Updated to Fabric API 0.37.1
* Improved generated code for custom armors
* Added support for the painting mod element
* [#124] Added support for tooltips for each armor item
* Added knockback resistance support for custom armors
* [Bugfix #113] Workspaces could not build properly.
Expand Down
3 changes: 3 additions & 0 deletions src/fabric-1.16.5/painting.definition.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
templates:
- template: painting.java.ftl
name: "@SRCROOT/@BASEPACKAGEPATH/painting/@NAMEPainting.java"
6 changes: 6 additions & 0 deletions src/fabric-1.16.5/templates/modbase/mod.java.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,12 @@ public class ${JavaModName} implements ModInitializer {
</#if>
</#list>

<#list w.getElementsOfType("PAINTING") as painting>
<#assign ge = painting.getGeneratableElement()>
public static final PaintingMotive ${painting} = Registry.register(Registry.PAINTING_MOTIVE,
id("${painting.getRegistryName()}"), ${painting}Painting.painting);
</#list>

@Override
public void onInitialize() {
LOGGER.info("Initializing ${JavaModName}");
Expand Down
26 changes: 26 additions & 0 deletions src/fabric-1.16.5/templates/painting.java.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<#--
This file is part of Fabric-Generator-MCreator.
Fabric-Generator-MCreator is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Fabric-Generator-MCreator is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with Fabric-Generator-MCreator. If not, see <https://www.gnu.org/licenses/>.
-->

<#-- @formatter:off -->

package ${package}.painting;

public class ${name}Painting {

public static PaintingMotive painting = new PaintingMotive(${data.width}, ${data.height});
}
<#-- @formatter:on -->

0 comments on commit 492f1c6

Please sign in to comment.