Compare commits
13 Commits
createairf
...
createairf
Author | SHA1 | Date | |
---|---|---|---|
46a668339c | |||
58a5175ed9 | |||
7ccdf8d063 | |||
5bf98c8248 | |||
3e3ab91895 | |||
2bbd719a5f | |||
44b85603da | |||
36942712f1 | |||
fd5ef6c9f7 | |||
82e8b27221 | |||
8a31930866 | |||
a1b720f918 | |||
30cdf291a6 |
@ -1,5 +1,8 @@
|
|||||||
name: build
|
name: build
|
||||||
on: [ pull_request, push ]
|
on:
|
||||||
|
pull_request: {}
|
||||||
|
push: {}
|
||||||
|
workflow_dispatch: {}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
@ -9,14 +12,14 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: checkout repository
|
- name: checkout repository
|
||||||
uses: actions/checkout@v2
|
uses: https://git.bitheaven.ru/actions/checkout@v2
|
||||||
|
|
||||||
- name: setup jdk ${{ matrix.java }}
|
- name: setup jdk ${{ matrix.java }}
|
||||||
uses: actions/setup-java@v1
|
uses: https://git.bitheaven.ru/actions/setup-java@v1
|
||||||
with:
|
with:
|
||||||
java-version: ${{ matrix.java }}
|
java-version: ${{ matrix.java }}
|
||||||
|
|
||||||
- uses: actions/cache@v2
|
- uses: https://git.bitheaven.ru/actions/cache@v2
|
||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
~/.gradle/caches
|
~/.gradle/caches
|
||||||
@ -32,7 +35,7 @@ jobs:
|
|||||||
run: ./gradlew build
|
run: ./gradlew build
|
||||||
|
|
||||||
- name: capture build artifacts
|
- name: capture build artifacts
|
||||||
uses: actions/upload-artifact@v2
|
uses: https://git.bitheaven.ru/actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: Artifacts
|
name: Artifacts
|
||||||
path: build/libs/
|
path: build/libs/
|
||||||
|
18
build.gradle
18
build.gradle
@ -10,8 +10,7 @@ targetCompatibility = JavaVersion.VERSION_17
|
|||||||
archivesBaseName = project.archives_base_name
|
archivesBaseName = project.archives_base_name
|
||||||
group = project.maven_group
|
group = project.maven_group
|
||||||
|
|
||||||
//String buildNumber = System.getenv("GITHUB_RUN_NUMBER")
|
String buildNumber = System.getenv("GITEA_RUN_NUMBER")
|
||||||
String buildNumber = 4
|
|
||||||
version = "${mod_version}+${minecraft_version}" + (buildNumber != null ? "-${buildNumber}" : "")
|
version = "${mod_version}+${minecraft_version}" + (buildNumber != null ? "-${buildNumber}" : "")
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
@ -32,10 +31,15 @@ repositories {
|
|||||||
maven { url = "https://jitpack.io/" } // Mixin Extras, Fabric ASM
|
maven { url = "https://jitpack.io/" } // Mixin Extras, Fabric ASM
|
||||||
maven { url = "https://maven.tterrag.com/" } // Flywheel
|
maven { url = "https://maven.tterrag.com/" } // Flywheel
|
||||||
|
|
||||||
maven {
|
exclusiveContent {
|
||||||
url 'https://www.cursemaven.com'
|
forRepository {
|
||||||
content {
|
maven {
|
||||||
includeGroup "curse.maven"
|
name = "Modrinth"
|
||||||
|
url = "https://api.modrinth.com/maven"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
filter {
|
||||||
|
includeGroup "maven.modrinth"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -57,7 +61,7 @@ dependencies {
|
|||||||
modImplementation("com.simibubi.create:create-fabric-${minecraft_version}:${create_version}")
|
modImplementation("com.simibubi.create:create-fabric-${minecraft_version}:${create_version}")
|
||||||
|
|
||||||
// Thin Air
|
// Thin Air
|
||||||
modImplementation("curse.maven:new-thin-air-878379:4611944")
|
modImplementation("maven.modrinth:thin-air:v8.1.3-1.20.1-Fabric")
|
||||||
|
|
||||||
// Development QOL
|
// Development QOL
|
||||||
modLocalRuntime("maven.modrinth:lazydfu:${lazydfu_version}")
|
modLocalRuntime("maven.modrinth:lazydfu:${lazydfu_version}")
|
||||||
|
@ -5,7 +5,7 @@ org.gradle.jvmargs=-Xmx1G
|
|||||||
# check these on https://modmuss50.me/fabric.html
|
# check these on https://modmuss50.me/fabric.html
|
||||||
minecraft_version=1.20.1
|
minecraft_version=1.20.1
|
||||||
yarn_mappings=1.20.1+build.10
|
yarn_mappings=1.20.1+build.10
|
||||||
fabric_loader_version=0.14.24
|
fabric_loader_version=0.14.21
|
||||||
# check this on https://modmuss50.me/fabric.html
|
# check this on https://modmuss50.me/fabric.html
|
||||||
fabric_api_version=0.90.0+1.20.1
|
fabric_api_version=0.90.0+1.20.1
|
||||||
|
|
||||||
|
@ -1,8 +1,7 @@
|
|||||||
package ru.bitheaven.createairfabric;
|
package ru.bitheaven.createairfabric;
|
||||||
|
|
||||||
import com.simibubi.create.Create;
|
import com.simibubi.create.Create;
|
||||||
import fuzs.thinair.helper.AirHelper;
|
import fuzs.thinair.helper.AirQualityHelperImpl;
|
||||||
import fuzs.thinair.helper.AirQualityLevel;
|
|
||||||
import io.github.fabricators_of_create.porting_lib.util.EnvExecutor;
|
import io.github.fabricators_of_create.porting_lib.util.EnvExecutor;
|
||||||
import net.fabricmc.api.ModInitializer;
|
import net.fabricmc.api.ModInitializer;
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.ResourceLocation;
|
||||||
@ -25,8 +24,8 @@ public class CreateAirFabric implements ModInitializer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static boolean airQualityActivatesHelmet(LivingEntity entity) {
|
public static boolean airQualityActivatesHelmet(LivingEntity entity) {
|
||||||
final var air = AirHelper.getO2LevelFromLocation(entity.getEyePosition(), entity.level()).getFirst();
|
AirQualityHelperImpl air = new AirQualityHelperImpl();
|
||||||
return air == AirQualityLevel.RED || air == AirQualityLevel.YELLOW;
|
return !air.getAirQualityAtLocation(entity.level(), entity.getEyePosition()).canBreathe;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ResourceLocation id(String path) {
|
public static ResourceLocation id(String path) {
|
||||||
|
@ -1,18 +1,14 @@
|
|||||||
package ru.bitheaven.createairfabric.mixin;
|
package ru.bitheaven.createairfabric.mixin;
|
||||||
|
|
||||||
import fuzs.thinair.helper.AirHelper;
|
|
||||||
import fuzs.thinair.helper.AirQualityLevel;
|
|
||||||
import net.minecraft.tags.TagKey;
|
import net.minecraft.tags.TagKey;
|
||||||
|
import net.minecraft.world.entity.LivingEntity;
|
||||||
import net.minecraft.world.level.material.Fluid;
|
import net.minecraft.world.level.material.Fluid;
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
import org.spongepowered.asm.mixin.injection.At;
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||||
|
|
||||||
import ru.bitheaven.createairfabric.CreateAirFabric;
|
import ru.bitheaven.createairfabric.CreateAirFabric;
|
||||||
import com.simibubi.create.content.equipment.armor.DivingHelmetItem;
|
import com.simibubi.create.content.equipment.armor.DivingHelmetItem;
|
||||||
|
|
||||||
import net.minecraft.world.entity.LivingEntity;
|
|
||||||
|
|
||||||
@Mixin(DivingHelmetItem.class)
|
@Mixin(DivingHelmetItem.class)
|
||||||
public abstract class DivingHelmetItemMixin {
|
public abstract class DivingHelmetItemMixin {
|
||||||
/**
|
/**
|
||||||
|
@ -0,0 +1,24 @@
|
|||||||
|
package ru.bitheaven.createairfabric.mixin;
|
||||||
|
|
||||||
|
|
||||||
|
import com.simibubi.create.content.equipment.armor.RemainingAirOverlay;
|
||||||
|
import net.minecraft.tags.TagKey;
|
||||||
|
import net.minecraft.world.level.material.Fluid;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||||
|
import ru.bitheaven.createairfabric.CreateAirFabric;
|
||||||
|
|
||||||
|
import net.minecraft.client.player.LocalPlayer;
|
||||||
|
|
||||||
|
@Mixin(RemainingAirOverlay.class)
|
||||||
|
public class RemainingAirOverlayMixin {
|
||||||
|
/**
|
||||||
|
* Activate UI "if in water or lava" -> "if in water or bad air or lava"
|
||||||
|
*/
|
||||||
|
@Redirect(at = @At(value = "INVOKE", target = "Lnet/minecraft/client/player/LocalPlayer;isEyeInFluid(Lnet/minecraft/tags/TagKey;)Z"),
|
||||||
|
method = "render(Lnet/minecraft/client/gui/GuiGraphics;II)V")
|
||||||
|
private static boolean redirectRender(LocalPlayer player, TagKey<Fluid> fluidTagKey) {
|
||||||
|
return player.isEyeInFluid(fluidTagKey) || CreateAirFabric.airQualityActivatesHelmet(player);
|
||||||
|
}
|
||||||
|
}
|
Binary file not shown.
Before Width: | Height: | Size: 52 KiB After Width: | Height: | Size: 60 KiB |
@ -7,7 +7,8 @@
|
|||||||
"DivingHelmetItemMixin"
|
"DivingHelmetItemMixin"
|
||||||
],
|
],
|
||||||
"client": [
|
"client": [
|
||||||
"MinecraftMixin"
|
"MinecraftMixin",
|
||||||
|
"RemainingAirOverlayMixin"
|
||||||
],
|
],
|
||||||
"injectors": {
|
"injectors": {
|
||||||
"defaultRequire": 1
|
"defaultRequire": 1
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
"fabricloader": ">=${fabric_loader_version}",
|
"fabricloader": ">=${fabric_loader_version}",
|
||||||
"fabric": "*",
|
"fabric": "*",
|
||||||
"minecraft": "${minecraft_version}",
|
"minecraft": "${minecraft_version}",
|
||||||
"create": "${create_version}"
|
"create": "${create_version}",
|
||||||
|
"thinair": "*"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user