Skip to content

Commit

Permalink
Merge branch 'MCreator:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
willpill authored Oct 28, 2023
2 parents cb29b32 + 6e02504 commit 5f5b854
Show file tree
Hide file tree
Showing 184 changed files with 1,669 additions and 1,125 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ jobs:
distribution: 'adopt'
- name: Install Dependencies
run: |
brew install cdrtools
brew install create-dmg
- name: Build and Export Release Using Gradle
if: github.event.inputs.release-type == 'release'
run: ./gradlew generateExportReport exportMac -Pbuilddate=${{ needs.export1.outputs.build_date }}
Expand All @@ -114,4 +114,4 @@ jobs:
"minecraft": "${{ needs.export1.outputs.mc_version }}"
}
]]-->
overwrite: true
overwrite: true
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ dependencies {
implementation fileTree(dir: 'lib', include: ['*.jar'])

// from maven
implementation group: 'commons-io', name: 'commons-io', version: '2.14.0'
implementation group: 'commons-io', name: 'commons-io', version: '2.15.0'
implementation group: 'org.freemarker', name: 'freemarker', version: '2.3.32'
implementation group: 'com.google.code.gson', name: 'gson', version: '2.10.1'
implementation group: 'com.github.sps.junidecode', name: 'junidecode', version: '0.3'
Expand All @@ -103,7 +103,7 @@ dependencies {
implementation group: 'com.google.guava', name: 'guava', version: '32.1.2-jre'
implementation group: 'de.javagl', name: 'obj', version: '0.4.0'
implementation group: 'com.univocity', name: 'univocity-parsers', version: '2.9.1'
implementation group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.21.0'
implementation group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.21.1'
implementation group: 'org.apache.commons', name: 'commons-text', version: '1.10.0'
implementation group: 'org.slf4j', name: 'slf4j-nop', version: '2.0.9'
implementation group: 'org.gradle', name: 'gradle-tooling-api', version: '8.4'
Expand All @@ -124,7 +124,7 @@ dependencies {
}

javafx {
version = '21'
version = '21.0.1'
modules = ['javafx.web', 'javafx.swing']
configurations = ['provided', 'win64', 'macX64', 'macAarch64', 'linux64'] // we provide natives during deployment or with SDK
}
Expand Down
2 changes: 1 addition & 1 deletion platform/export.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
if (project.snapshot) {
project.mcreatorconf.setProperty('mcreator', "EAP " + (String) project.mcreatorconf.getProperty('mcreator') + (String) project.builddate)
project.mcreatorconf.setProperty('mcreator', "EAP " + (String) project.mcreatorconf.getProperty('mcreator') + "." + (String) project.builddate)
}

tasks.register('cleanupPlugins') {
Expand Down
Binary file added platform/mac/diskimage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 16 additions & 12 deletions platform/mac/mac.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,22 @@ static void convertCRLF(File input, File out) {

void makeDMG(File directory, File outputDMGFile, String volumeName) {
if (Os.isFamily(Os.FAMILY_MAC)) {
ant.exec(executable: 'hdiutil', failonerror: true) {
arg(value: 'create')
arg(value: '-srcfolder')
arg(value: directory)
arg(value: '-volname')
arg(value: volumeName)
arg(value: '-ov') // read-only disk image
arg(value: '-format')
arg(value: 'UDZO') // UDZ0 zlib-compressed image
arg(value: '-imagekey')
arg(value: 'zlib-level=9') // maximum compression
arg(value: outputDMGFile)
exec {
commandLine 'create-dmg',
'--volname', volumeName,
'--volicon', 'platform/mac/volume.icns',
'--background', 'platform/mac/diskimage.png',
'--window-pos', '200', '120',
'--window-size', '480', '325',
'--icon-size', '100',
'--icon', 'MCreator.app', '145', '121',
'--hide-extension', 'MCreator.app',
'--text-size', '10',
'--app-drop-link', '337', '121',
'--eula', 'LICENSE.txt',
'--format', 'ULMO',
outputDMGFile,
directory
}
} else {
def mkisofs_binary = Os.isFamily(Os.FAMILY_WINDOWS) ? './build/tools/mkisofs/Sample/mkisofs' : './mkisofs'
Expand Down
Binary file added platform/mac/volume.icns
Binary file not shown.
10 changes: 10 additions & 0 deletions plugins/generator-1.19.4/datapack-1.19.4/structure.definition.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
templates:
- template: structure/structure_set.json.ftl
writer: json
name: "@MODDATAROOT/worldgen/structure_set/@registryname.json"
- template: structure/structure.json.ftl
writer: json
name: "@MODDATAROOT/worldgen/structure/@registryname.json"
- template: structure/template_pool.json.ftl
writer: json
name: "@MODDATAROOT/worldgen/template_pool/@registryname.json"
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<#assign spawnBiomes = w.filterBrokenReferences(data.restrictionBiomes)>
{
"type": "minecraft:jigsaw",
"start_pool": "${modid}:${registryname}",
"size": 1,
"max_distance_from_center": 64,
"spawn_overrides": {},
"step": "${generator.map(data.generationStep, "generationsteps")}",
"terrain_adaptation": "${data.terrainAdaptation}",
"start_height": {
"absolute": 0
},
"project_start_to_heightmap": "${data.surfaceDetectionType}",
<#if spawnBiomes?size == 1>
"biomes": "${spawnBiomes?first}",
<#else>
"biomes": [
<#list spawnBiomes as spawnBiome>"${spawnBiome}"<#sep>,</#list>
],
</#if>
"use_expansion_hack": false
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"structures": [
{
"structure": "${modid}:${registryname}",
"weight": 1
}
],
"placement": {
"type": "minecraft:random_spread",
"spacing": ${data.spacing},
"separation": ${data.separation},
"salt": ${thelper.randompositiveint(registryname)}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"name": "${modid}:${registryname}",
"fallback": "minecraft:empty",
"elements": [
{
"weight": 1,
"element": {
"element_type": "minecraft:single_pool_element",
"location": "${modid}:${data.structure}",
"projection": "${data.projection}",
"processors": {
"processors": [
{
"processor_type": "minecraft:block_ignore",
"blocks": [
<#if data.ignoreBlocks == "STRUCTURE_BLOCK">
{
"Name": "minecraft:structure_block"
}
<#elseif data.ignoreBlocks == "AIR_AND_STRUCTURE_BLOCK">
{
"Name": "minecraft:structure_block"
},
{
"Name": "minecraft:air"
}
<#elseif data.ignoreBlocks == "AIR">
{
"Name": "minecraft:air"
}
</#if>
]
}
]
}
}
}
]
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
_default: Q
_default: UNKNOWN
0: 0
1: 1
2: 2
Expand Down Expand Up @@ -61,7 +61,7 @@ RWIN: RIGHT_SUPER
M: M
MINUS: MINUS
N: N
NONE: NONE
NONE: UNKNOWN
NUMLOCK: NUM_LOCK
NUMPAD0: KP_0
NUMPAD1: KP_1
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
(${input$entity} instanceof LivingEntity _livEnt ? _livEnt.isFallFlying():false)
(${input$entity} instanceof LivingEntity _livEnt${cbi} && _livEnt${cbi}.isFallFlying())
Original file line number Diff line number Diff line change
@@ -1 +1 @@
(${input$entity} instanceof LivingEntity _livEnt ? _livEnt.isBlocking():false)
(${input$entity} instanceof LivingEntity _livEnt${cbi} && _livEnt${cbi}.isBlocking())
Original file line number Diff line number Diff line change
@@ -1 +1 @@
(${input$entity} instanceof LivingEntity _livEnt ? _livEnt.isBaby():false)
(${input$entity} instanceof LivingEntity _livEnt${cbi} && _livEnt${cbi}.isBaby())
Original file line number Diff line number Diff line change
@@ -1 +1 @@
(${input$entity} instanceof LivingEntity _livEnt ? _livEnt.isSleeping():false)
(${input$entity} instanceof LivingEntity _livEnt${cbi} && _livEnt${cbi}.isSleeping())
14 changes: 6 additions & 8 deletions plugins/generator-1.19.4/forge-1.19.4/structure.definition.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
templates:
- template: structure/structure.java.ftl
name: "@SRCROOT/@BASEPACKAGEPATH/world/features/@NAMEFeature.java"
- template: json/structure_feature_biome_modifier.json.ftl
- template: structure/structure_set.json.ftl # loaded from datapack generator
writer: json
name: "@MODDATAROOT/forge/biome_modifier/@registryname_biome_modifier.json"
- template: structure/configured_structure.json.ftl
name: "@MODDATAROOT/worldgen/structure_set/@registryname.json"
- template: structure/structure.json.ftl # loaded from datapack generator
writer: json
name: "@MODDATAROOT/worldgen/configured_feature/@registryname.json"
- template: structure/placed_structure.json.ftl
name: "@MODDATAROOT/worldgen/structure/@registryname.json"
- template: structure/template_pool.json.ftl # loaded from datapack generator
writer: json
name: "@MODDATAROOT/worldgen/placed_feature/@registryname.json"
name: "@MODDATAROOT/worldgen/template_pool/@registryname.json"
Original file line number Diff line number Diff line change
Expand Up @@ -604,17 +604,31 @@ public class ${name}Entity extends ${extendsClass} <#if data.ranged>implements R
</#if>

<#if data.waterMob>
@Override public boolean canBreatheUnderwater() {
return true;
}

@Override public boolean checkSpawnObstruction(LevelReader world) {
@Override public boolean checkSpawnObstruction(LevelReader world) {
return world.isUnobstructed(this);
}
</#if>

@Override public boolean isPushedByFluid() {
return false;
}
<#if data.breatheUnderwater?? && (hasProcedure(data.breatheUnderwater) || data.breatheUnderwater.getFixedValue())>
@Override public boolean canBreatheUnderwater() {
double x = this.getX();
double y = this.getY();
double z = this.getZ();
Level world = this.level;
Entity entity = this;
return <@procedureOBJToConditionCode data.breatheUnderwater true false/>;
}
</#if>

<#if data.pushedByFluids?? && (hasProcedure(data.pushedByFluids) || !data.pushedByFluids.getFixedValue())>
@Override public boolean isPushedByFluid() {
double x = this.getX();
double y = this.getY();
double z = this.getZ();
Level world = this.level;
Entity entity = this;
return <@procedureOBJToConditionCode data.pushedByFluids false false/>;
}
</#if>

<#if data.disableCollisions>
Expand Down
10 changes: 10 additions & 0 deletions plugins/generator-1.20.1/datapack-1.20.1/structure.definition.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
templates:
- template: structure/structure_set.json.ftl
writer: json
name: "@MODDATAROOT/worldgen/structure_set/@registryname.json"
- template: structure/structure.json.ftl
writer: json
name: "@MODDATAROOT/worldgen/structure/@registryname.json"
- template: structure/template_pool.json.ftl
writer: json
name: "@MODDATAROOT/worldgen/template_pool/@registryname.json"
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<#assign spawnBiomes = w.filterBrokenReferences(data.restrictionBiomes)>
{
"type": "minecraft:jigsaw",
"start_pool": "${modid}:${registryname}",
"size": 1,
"max_distance_from_center": 64,
"spawn_overrides": {},
"step": "${generator.map(data.generationStep, "generationsteps")}",
"terrain_adaptation": "${data.terrainAdaptation}",
"start_height": {
"absolute": 0
},
"project_start_to_heightmap": "${data.surfaceDetectionType}",
<#if spawnBiomes?size == 1>
"biomes": "${spawnBiomes?first}",
<#else>
"biomes": [
<#list spawnBiomes as spawnBiome>"${spawnBiome}"<#sep>,</#list>
],
</#if>
"use_expansion_hack": false
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"structures": [
{
"structure": "${modid}:${registryname}",
"weight": 1
}
],
"placement": {
"type": "minecraft:random_spread",
"spacing": ${data.spacing},
"separation": ${data.separation},
"salt": ${thelper.randompositiveint(registryname)}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"name": "${modid}:${registryname}",
"fallback": "minecraft:empty",
"elements": [
{
"weight": 1,
"element": {
"element_type": "minecraft:single_pool_element",
"location": "${modid}:${data.structure}",
"projection": "${data.projection}",
"processors": {
"processors": [
{
"processor_type": "minecraft:block_ignore",
"blocks": [
<#if data.ignoreBlocks == "STRUCTURE_BLOCK">
{
"Name": "minecraft:structure_block"
}
<#elseif data.ignoreBlocks == "AIR_AND_STRUCTURE_BLOCK">
{
"Name": "minecraft:structure_block"
},
{
"Name": "minecraft:air"
}
<#elseif data.ignoreBlocks == "AIR">
{
"Name": "minecraft:air"
}
</#if>
]
}
]
}
}
}
]
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
_default: Q
_default: UNKNOWN
0: 0
1: 1
2: 2
Expand Down Expand Up @@ -61,7 +61,7 @@ RWIN: RIGHT_SUPER
M: M
MINUS: MINUS
N: N
NONE: NONE
NONE: UNKNOWN
NUMLOCK: NUM_LOCK
NUMPAD0: KP_0
NUMPAD1: KP_1
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
(${input$entity} instanceof LivingEntity _livEnt ? _livEnt.isFallFlying():false)
(${input$entity} instanceof LivingEntity _livEnt${cbi} && _livEnt${cbi}.isFallFlying())
Original file line number Diff line number Diff line change
@@ -1 +1 @@
(${input$entity} instanceof LivingEntity _livEnt ? _livEnt.isBlocking():false)
(${input$entity} instanceof LivingEntity _livEnt${cbi} && _livEnt${cbi}.isBlocking())
Original file line number Diff line number Diff line change
@@ -1 +1 @@
(${input$entity} instanceof LivingEntity _livEnt ? _livEnt.isBaby():false)
(${input$entity} instanceof LivingEntity _livEnt${cbi} && _livEnt${cbi}.isBaby())
Loading

0 comments on commit 5f5b854

Please sign in to comment.