Skip to content

Commit 548e78a

Browse files
committed
added 1.17 Snapshot 20w51a
1 parent b1dc2f6 commit 548e78a

35 files changed

+1233
-4
lines changed

fabric-1.15.2/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ buildscript {
88
gradlePluginPortal()
99
}
1010
dependencies {
11-
classpath group: 'net.fabricmc', name: 'fabric-loom', version: '0.5.35'
11+
classpath group: 'net.fabricmc', name: 'fabric-loom', version: '0.6.9'
1212
}
1313
}
1414
apply plugin: 'fabric-loom'

fabric-1.16.1/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ buildscript {
88
gradlePluginPortal()
99
}
1010
dependencies {
11-
classpath group: 'net.fabricmc', name: 'fabric-loom', version: '0.5.35'
11+
classpath group: 'net.fabricmc', name: 'fabric-loom', version: '0.6.9'
1212
}
1313
}
1414
apply plugin: 'fabric-loom'

fabric-1.16.2/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ buildscript {
88
gradlePluginPortal()
99
}
1010
dependencies {
11-
classpath group: 'net.fabricmc', name: 'fabric-loom', version: '0.5.35'
11+
classpath group: 'net.fabricmc', name: 'fabric-loom', version: '0.6.9'
1212
}
1313
}
1414
apply plugin: 'fabric-loom'

fabric-1.16.4/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ buildscript {
88
gradlePluginPortal()
99
}
1010
dependencies {
11-
classpath group: 'net.fabricmc', name: 'fabric-loom', version: '0.5.35'
11+
classpath group: 'net.fabricmc', name: 'fabric-loom', version: '0.6.9'
1212
}
1313
}
1414
apply plugin: 'fabric-loom'

fabric-1.17/build.gradle

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
buildscript {
2+
repositories {
3+
jcenter()
4+
maven {
5+
name = 'Fabric'
6+
url = 'https://maven.fabricmc.net/'
7+
}
8+
gradlePluginPortal()
9+
}
10+
dependencies {
11+
classpath group: 'net.fabricmc', name: 'fabric-loom', version: '0.6.9'
12+
}
13+
}
14+
apply plugin: 'fabric-loom'
15+
apply plugin: 'scala'
16+
apply plugin: 'maven-publish'
17+
18+
sourceCompatibility = JavaVersion.VERSION_1_8
19+
targetCompatibility = JavaVersion.VERSION_1_8
20+
21+
archivesBaseName = parent.project.archives_base_name
22+
version = parent.version + "+fabric-" + project.minecraft_version
23+
group = parent.group
24+
25+
configurations {
26+
shadow
27+
compile.extendsFrom(shadow)
28+
}
29+
30+
dependencies {
31+
//to change the versions see the gradle.properties file
32+
minecraft "com.mojang:minecraft:${project.minecraft_version}"
33+
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
34+
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
35+
36+
// Fabric API. This is technically optional, but you probably want it anyway.
37+
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
38+
39+
modImplementation "net.fabricmc:fabric-language-scala:0.3.1.+"
40+
41+
shadow "io.circe:circe-parser_2.13:0.13.0"
42+
shadow "io.circe:circe-generic_2.13:0.13.0"
43+
shadow "io.circe:circe-generic-extras_2.13:0.13.0"
44+
shadow "io.circe:circe-config_2.13:0.7.0"
45+
46+
compileOnly group: 'com.google.code.findbugs', name: 'jsr305', version: '3.0.2'
47+
48+
// PSA: Some older mods, compiled on Loom 0.2.1, might have outdated Maven POMs.
49+
// You may need to force-disable transitiveness on them.
50+
51+
}
52+
53+
processResources {
54+
inputs.property "version", project.version
55+
56+
from(sourceSets.main.resources.srcDirs) {
57+
include "fabric.mod.json"
58+
expand "version": project.version
59+
}
60+
61+
from(sourceSets.main.resources.srcDirs) {
62+
exclude "fabric.mod.json"
63+
}
64+
}
65+
66+
// ensure that the encoding is set to UTF-8, no matter what the system default is
67+
// this fixes some edge cases with special characters not displaying correctly
68+
// see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
69+
tasks.withType(JavaCompile) {
70+
options.encoding = "UTF-8"
71+
}
72+
73+
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
74+
// if it is present.
75+
// If you remove this task, sources will not be generated.
76+
task sourcesJar(type: Jar, dependsOn: classes) {
77+
classifier = "sources"
78+
from sourceSets.main.allSource
79+
}
80+
81+
jar {
82+
from "LICENSE"
83+
from {
84+
configurations.shadow.collect { file ->
85+
[
86+
"scala-library",
87+
].any { file.toString().contains(it) } ? null : file.isDirectory() ? file : zipTree(file)
88+
}
89+
}
90+
}
91+
92+
// configure the maven publication
93+
publishing {
94+
publications {
95+
mavenJava(MavenPublication) {
96+
// add all the jars that should be included when publishing to maven
97+
artifact(remapJar) {
98+
builtBy remapJar
99+
}
100+
artifact(sourcesJar) {
101+
builtBy remapSourcesJar
102+
}
103+
}
104+
}
105+
106+
// select the repositories you want to publish to
107+
repositories {
108+
// uncomment to publish to the local maven
109+
// mavenLocal()
110+
}
111+
}

fabric-1.17/gradle.properties

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Fabric Properties
2+
# check these on https://fabricmc.net/use
3+
minecraft_version=20w51a
4+
yarn_mappings=20w51a+build.31
5+
loader_version=0.11.1
6+
# Dependencies
7+
# currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api
8+
fabric_version=0.29.3+1.17
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"variants": {
3+
"": {
4+
"model": "fluidphysics:block/spring"
5+
}
6+
}
7+
}
Loading
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"block.fluidphysics.spring": "Quelle",
3+
"item.fluidphysics.spring": "Quelle"
4+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"block.fluidphysics.spring": "Spring",
3+
"item.fluidphysics.spring": "Spring"
4+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"block.fluidphysics.spring": "Источник",
3+
"item.fluidphysics.spring": "Источник"
4+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"parent": "block/cube_all",
3+
"textures": {
4+
"all": "fluidphysics:block/spring"
5+
}
6+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"parent": "fluidphysics:block/spring"
3+
}
Binary file not shown.
Loading
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"schemaVersion": 1,
3+
"id": "fluidphysics",
4+
"version": "${version}",
5+
"name": "Fluid Physics",
6+
"description": "This mod blends together vanilla fluid mechanics with something a little more realistic plus some small additions.",
7+
"authors": [
8+
"LolHens"
9+
],
10+
"contact": {
11+
"homepage": "https://github.com/LolHens/mc-fluid-physics",
12+
"sources": "https://github.com/LolHens/mc-fluid-physics"
13+
},
14+
"license": "Apache-2.0",
15+
"icon": "assets/fluidphysics/icon.png",
16+
"environment": "*",
17+
"entrypoints": {
18+
"main": [
19+
{
20+
"adapter": "scala",
21+
"value": "de.lolhens.minecraft.fluidphysics.FluidPhysicsMod"
22+
}
23+
]
24+
},
25+
"mixins": [
26+
"fluidphysics.mixins.json"
27+
],
28+
"depends": {
29+
"fabric-language-scala": "*",
30+
"fabricloader": ">=0.7.4",
31+
"fabric": ">=0.15.0",
32+
"minecraft": "1.17.x"
33+
}
34+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"required": true,
3+
"minVersion": "0.8",
4+
"package": "de.lolhens.minecraft.fluidphysics.mixin",
5+
"compatibilityLevel": "JAVA_8",
6+
"mixins": [
7+
"AbstractBlockStateMixin",
8+
"FlowableFluidAccessor",
9+
"FlowableFluidMixin",
10+
"PistonBlockMixin",
11+
"SpringFeatureMixin",
12+
"ThreadedAnvilChunkStorageAccessor",
13+
"WaterFluidMixin"
14+
],
15+
"client": [
16+
"BiomeColorsMixin"
17+
],
18+
"injectors": {
19+
"defaultRequire": 1
20+
}
21+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
package de.lolhens.minecraft.fluidphysics
2+
3+
import de.lolhens.minecraft.fluidphysics.block.SpringBlock
4+
import de.lolhens.minecraft.fluidphysics.config.FluidPhysicsConfig
5+
import de.lolhens.minecraft.fluidphysics.util.RainRefill
6+
import net.fabricmc.api.ModInitializer
7+
import net.fabricmc.fabric.api.`object`.builder.v1.block.FabricBlockSettings
8+
import net.fabricmc.loader.api.FabricLoader
9+
import net.fabricmc.loader.api.metadata.ModMetadata
10+
import net.minecraft.block.{Block, Material}
11+
import net.minecraft.item.{BlockItem, Item, ItemGroup}
12+
import net.minecraft.util.Identifier
13+
import net.minecraft.util.registry.Registry
14+
15+
import scala.jdk.CollectionConverters._
16+
17+
object FluidPhysicsMod extends ModInitializer {
18+
val metadata: ModMetadata = {
19+
FabricLoader.getInstance().getEntrypointContainers("main", classOf[ModInitializer])
20+
.iterator().asScala.find(this eq _.getEntrypoint).get.getProvider.getMetadata
21+
}
22+
23+
lazy val config: FluidPhysicsConfig = FluidPhysicsConfig.loadOrCreate(metadata.getId)
24+
25+
val SPRING_BLOCK_ID = new Identifier(metadata.getId, "spring")
26+
val SPRING_BLOCK: Block = new SpringBlock(FabricBlockSettings.of(Material.STONE).requiresTool().hardness(2.0F).resistance(6.0F))
27+
28+
override def onInitialize(): Unit = {
29+
config
30+
31+
Registry.register(Registry.BLOCK, SPRING_BLOCK_ID, SPRING_BLOCK)
32+
Registry.register(Registry.ITEM, SPRING_BLOCK_ID, new BlockItem(SPRING_BLOCK, new Item.Settings().group(ItemGroup.BUILDING_BLOCKS)))
33+
34+
RainRefill.init()
35+
}
36+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package de.lolhens.minecraft.fluidphysics.block
2+
3+
import de.lolhens.minecraft.fluidphysics.FluidPhysicsMod
4+
import net.minecraft.block.AbstractBlock.Settings
5+
import net.minecraft.block.Block
6+
7+
class SpringBlock(settings: Settings) extends Block(settings) {
8+
FluidPhysicsMod.config.spring.filter(_.shouldUpdateBlocksInWorld).foreach { spring =>
9+
setDefaultState(spring.getBlock.getDefaultState)
10+
}
11+
}

0 commit comments

Comments
 (0)