Compare commits
16 Commits
createairf
...
be9a4bdd59
Author | SHA1 | Date | |
---|---|---|---|
be9a4bdd59 | |||
2c386caace | |||
b749efbbac | |||
8f01df0971 | |||
3683405780 | |||
f4625f84b3 | |||
3a3b3b11fa | |||
23667171ae | |||
9d811a82af | |||
fb97097b67 | |||
328ca781ff | |||
429b444058 | |||
be08c76edf | |||
7e65f5d748 | |||
1079b588e5 | |||
301bcad666 |
@ -12,21 +12,21 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: checkout repository
|
- name: checkout repository
|
||||||
uses: https://git.bitheaven.ru/actions/checkout@v2
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: setup jdk ${{ matrix.java }}
|
- name: setup jdk ${{ matrix.java }}
|
||||||
uses: https://git.bitheaven.ru/actions/setup-java@v1
|
uses: actions/setup-java@v4
|
||||||
with:
|
with:
|
||||||
|
distribution: 'liberica'
|
||||||
java-version: ${{ matrix.java }}
|
java-version: ${{ matrix.java }}
|
||||||
|
|
||||||
- uses: https://git.bitheaven.ru/actions/cache@v2
|
- uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
~/.gradle/caches
|
~/.gradle/caches
|
||||||
~/.gradle/loom-cache
|
~/.gradle/loom-cache
|
||||||
~/.gradle/wrapper
|
~/.gradle/wrapper
|
||||||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/gradle-wrapper.properties') }}
|
key: ${{ runner.os }}-gradle-${{ hashFiles('**/gradle-wrapper.properties') }}
|
||||||
restore-keys: ${{ runner.os }}-gradle
|
|
||||||
|
|
||||||
- name: make gradle wrapper executable
|
- name: make gradle wrapper executable
|
||||||
run: chmod +x ./gradlew
|
run: chmod +x ./gradlew
|
||||||
@ -34,8 +34,11 @@ jobs:
|
|||||||
- name: build
|
- name: build
|
||||||
run: ./gradlew build
|
run: ./gradlew build
|
||||||
|
|
||||||
- name: capture build artifacts
|
- name: Make release
|
||||||
uses: https://git.bitheaven.ru/actions/upload-artifact@v2
|
uses: actions/gitea-release-action@v1
|
||||||
with:
|
with:
|
||||||
name: Artifacts
|
name: Create Air Fabric 1.0-1${{ gitea.run_id }} for 1.20.1
|
||||||
path: build/libs/
|
md5sum: true
|
||||||
|
sha256sum: true
|
||||||
|
files: |-
|
||||||
|
build/libs/**
|
||||||
|
11
build.gradle
11
build.gradle
@ -1,5 +1,5 @@
|
|||||||
plugins {
|
plugins {
|
||||||
id 'fabric-loom' version '1.2-SNAPSHOT'
|
id 'fabric-loom' version '1.5-SNAPSHOT'
|
||||||
id "io.github.p03w.machete" version "1.+" // automatic jar compressing on build
|
id "io.github.p03w.machete" version "1.+" // automatic jar compressing on build
|
||||||
id 'maven-publish'
|
id 'maven-publish'
|
||||||
}
|
}
|
||||||
@ -61,15 +61,18 @@ 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("maven.modrinth:thin-air:v8.1.3-1.20.1-Fabric")
|
modImplementation("maven.modrinth:thin-air:${thinair_version}")
|
||||||
|
|
||||||
// Ad Astra
|
// Ad Astra
|
||||||
modImplementation("curse.maven:ad-astra-635042:4774341")
|
modImplementation("maven.modrinth:ad-astra:${adastra_version}")
|
||||||
|
modImplementation("maven.modrinth:botarium:${botarium_version}")
|
||||||
|
|
||||||
// Development QOL
|
// Development QOL
|
||||||
modLocalRuntime("maven.modrinth:lazydfu:${lazydfu_version}")
|
modLocalRuntime("maven.modrinth:lazydfu:${lazydfu_version}")
|
||||||
modLocalRuntime("com.terraformersmc:modmenu:${modmenu_version}")
|
modLocalRuntime("com.terraformersmc:modmenu:${modmenu_version}")
|
||||||
|
|
||||||
|
include(implementation(annotationProcessor("io.github.llamalad7:mixinextras-fabric:0.4.1")))
|
||||||
|
|
||||||
// Recipe Viewers - Create Fabric supports JEI, REI, and EMI.
|
// Recipe Viewers - Create Fabric supports JEI, REI, and EMI.
|
||||||
// See root gradle.properties to choose which to use at runtime.
|
// See root gradle.properties to choose which to use at runtime.
|
||||||
switch (recipe_viewer.toLowerCase(Locale.ROOT)) {
|
switch (recipe_viewer.toLowerCase(Locale.ROOT)) {
|
||||||
@ -87,7 +90,7 @@ processResources {
|
|||||||
properties.put("version", version)
|
properties.put("version", version)
|
||||||
properties.put("fabric_loader_version", fabric_loader_version)
|
properties.put("fabric_loader_version", fabric_loader_version)
|
||||||
properties.put("fabric_api_version", fabric_api_version)
|
properties.put("fabric_api_version", fabric_api_version)
|
||||||
properties.put("create_version", create_version)
|
properties.put("create_version", "~" + create_version.split("-")[0] + "-" + create_version.split("-")[1])
|
||||||
properties.put("minecraft_version", minecraft_version)
|
properties.put("minecraft_version", minecraft_version)
|
||||||
|
|
||||||
properties.forEach((k, v) -> inputs.property(k, v))
|
properties.forEach((k, v) -> inputs.property(k, v))
|
||||||
|
@ -22,7 +22,12 @@ org.gradle.jvmargs=-Xmx1G
|
|||||||
|
|
||||||
# Dependencies
|
# Dependencies
|
||||||
# https://modrinth.com/mod/create-fabric/versions
|
# https://modrinth.com/mod/create-fabric/versions
|
||||||
create_version = 0.5.1-d-build.1161+mc1.20.1
|
create_version = 0.5.1-f-build.1329+mc1.20.1
|
||||||
|
# https://modrinth.com/mod/thin-air/versions
|
||||||
|
thinair_version = v8.1.5-1.20.1-Fabric
|
||||||
|
# https://modrinth.com/mod/ad-astra/versions
|
||||||
|
adastra_version = MxqFxL9C
|
||||||
|
botarium_version = 5a8eybLl
|
||||||
# set to disabled to have none of them.
|
# set to disabled to have none of them.
|
||||||
recipe_viewer = disabled
|
recipe_viewer = disabled
|
||||||
# Mod Menu - https://modrinth.com/mod/modmenu/versions
|
# Mod Menu - https://modrinth.com/mod/modmenu/versions
|
||||||
|
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@ -1,6 +1,6 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
|
||||||
networkTimeout=10000
|
networkTimeout=10000
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
|
@ -1,9 +1,8 @@
|
|||||||
package ru.bitheaven.createairfabric;
|
package ru.bitheaven.createairfabric;
|
||||||
|
|
||||||
import com.simibubi.create.Create;
|
import com.simibubi.create.Create;
|
||||||
import earth.terrarium.ad_astra.common.util.OxygenUtils;
|
import earth.terrarium.adastra.api.systems.OxygenApi;
|
||||||
import fuzs.thinair.helper.AirQualityHelperImpl;
|
import fuzs.thinair.helper.AirQualityHelperImpl;
|
||||||
import io.github.fabricators_of_create.porting_lib.util.EnvExecutor;
|
|
||||||
import net.fabricmc.api.ModInitializer;
|
import net.fabricmc.api.ModInitializer;
|
||||||
import net.fabricmc.loader.api.FabricLoader;
|
import net.fabricmc.loader.api.FabricLoader;
|
||||||
import net.minecraft.world.entity.Entity;
|
import net.minecraft.world.entity.Entity;
|
||||||
@ -18,10 +17,6 @@ public class CreateAirFabric implements ModInitializer {
|
|||||||
@Override
|
@Override
|
||||||
public void onInitialize() {
|
public void onInitialize() {
|
||||||
LOGGER.info("Create addon mod [{}] is loading alongside Create [{}]!", NAME, Create.VERSION);
|
LOGGER.info("Create addon mod [{}] is loading alongside Create [{}]!", NAME, Create.VERSION);
|
||||||
LOGGER.info(EnvExecutor.unsafeRunForDist(
|
|
||||||
() -> () -> "{} is accessing Porting Lib from the client!",
|
|
||||||
() -> () -> "{} is accessing Porting Lib from the server!"
|
|
||||||
), NAME);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isOxygen(Entity entity) {
|
public static boolean isOxygen(Entity entity) {
|
||||||
@ -31,7 +26,7 @@ public class CreateAirFabric implements ModInitializer {
|
|||||||
.getAirQualityAtLocation(entity.level(), entity.getEyePosition()).canBreathe;
|
.getAirQualityAtLocation(entity.level(), entity.getEyePosition()).canBreathe;
|
||||||
}
|
}
|
||||||
if (FabricLoader.getInstance().isModLoaded("ad_astra")) {
|
if (FabricLoader.getInstance().isModLoaded("ad_astra")) {
|
||||||
oxygen &= OxygenUtils.levelHasOxygen(entity.level());
|
oxygen &= OxygenApi.API.hasOxygen(entity.level());
|
||||||
}
|
}
|
||||||
return oxygen;
|
return oxygen;
|
||||||
}
|
}
|
||||||
|
@ -1,25 +1,43 @@
|
|||||||
package ru.bitheaven.createairfabric.mixin;
|
package ru.bitheaven.createairfabric.mixin;
|
||||||
|
|
||||||
|
import com.simibubi.create.content.equipment.armor.BacktankItem;
|
||||||
import com.simibubi.create.content.equipment.armor.BacktankUtil;
|
import com.simibubi.create.content.equipment.armor.BacktankUtil;
|
||||||
import com.simibubi.create.content.equipment.armor.DivingHelmetItem;
|
import com.simibubi.create.content.equipment.armor.DivingHelmetItem;
|
||||||
import earth.terrarium.ad_astra.common.entity.system.EntityOxygenSystem;
|
|
||||||
import earth.terrarium.ad_astra.common.util.ModUtils;
|
import earth.terrarium.adastra.common.items.armor.SpaceSuitItem;
|
||||||
|
import earth.terrarium.adastra.common.systems.OxygenApiImpl;
|
||||||
|
import earth.terrarium.adastra.common.tags.ModItemTags;
|
||||||
|
import net.minecraft.world.entity.Entity;
|
||||||
|
import net.minecraft.world.entity.EquipmentSlot;
|
||||||
import net.minecraft.world.entity.LivingEntity;
|
import net.minecraft.world.entity.LivingEntity;
|
||||||
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;
|
||||||
|
|
||||||
@Mixin(EntityOxygenSystem.class)
|
@Mixin(OxygenApiImpl.class)
|
||||||
public abstract class EntityOxygenSystemMixin {
|
public abstract class EntityOxygenSystemMixin {
|
||||||
/**
|
/**
|
||||||
* Make air exists if Create Air
|
* Make air exists if Create Air
|
||||||
*/
|
*/
|
||||||
@Redirect(at = @At(value = "INVOKE", target = "Learth/terrarium/ad_astra/common/util/ModUtils;armourIsOxygenated(Lnet/minecraft/world/entity/LivingEntity;)Z"),
|
@Redirect(at = @At(value = "INVOKE", target = "Learth/terrarium/adastra/common/items/armor/SpaceSuitItem;hasOxygen(Lnet/minecraft/world/entity/Entity;)Z"),
|
||||||
method = "oxygenTick(Lnet/minecraft/world/entity/LivingEntity;Lnet/minecraft/server/level/ServerLevel;)V")
|
method = "entityTick(Lnet/minecraft/server/level/ServerLevel;Lnet/minecraft/world/entity/LivingEntity;)V")
|
||||||
private static boolean redirectOxygenTick(LivingEntity entity) {
|
private boolean redirectHasOxygen(Entity entity) {
|
||||||
|
if (!(entity instanceof LivingEntity livingEntity)) return SpaceSuitItem.hasOxygen(entity);
|
||||||
boolean createOxygen = true;
|
boolean createOxygen = true;
|
||||||
createOxygen &= !DivingHelmetItem.getWornItem(entity).isEmpty();
|
createOxygen &= !DivingHelmetItem.getWornItem(livingEntity).isEmpty();
|
||||||
createOxygen &= !BacktankUtil.getAllWithAir(entity).isEmpty();
|
createOxygen &= !BacktankUtil.getAllWithAir(livingEntity).isEmpty();
|
||||||
return ModUtils.armourIsOxygenated(entity) || createOxygen;
|
return SpaceSuitItem.hasOxygen(livingEntity) || createOxygen;
|
||||||
|
}
|
||||||
|
@Redirect(at = @At(value = "INVOKE", target = "Learth/terrarium/adastra/common/items/armor/SpaceSuitItem;hasFullSet(Lnet/minecraft/world/entity/LivingEntity;)Z"),
|
||||||
|
method = "entityTick(Lnet/minecraft/server/level/ServerLevel;Lnet/minecraft/world/entity/LivingEntity;)V")
|
||||||
|
private boolean redirectHasFullSet(LivingEntity entity) {
|
||||||
|
boolean createArmor = true;
|
||||||
|
createArmor &= entity.getItemBySlot(EquipmentSlot.HEAD).getItem() instanceof DivingHelmetItem;
|
||||||
|
createArmor &= entity.getItemBySlot(EquipmentSlot.CHEST).getItem() instanceof BacktankItem;
|
||||||
|
createArmor &= entity.getItemBySlot(EquipmentSlot.LEGS).is(ModItemTags.SPACE_SUITS);
|
||||||
|
createArmor &= entity.getItemBySlot(EquipmentSlot.FEET).is(ModItemTags.SPACE_SUITS);
|
||||||
|
|
||||||
|
return SpaceSuitItem.hasFullSet(entity) || createArmor;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,32 +1,31 @@
|
|||||||
package ru.bitheaven.createairfabric.mixin;
|
package ru.bitheaven.createairfabric.mixin;
|
||||||
|
|
||||||
import earth.terrarium.ad_astra.common.config.AdAstraConfig;
|
import earth.terrarium.adastra.common.items.armor.NetheriteSpaceSuitItem;
|
||||||
import earth.terrarium.ad_astra.common.entity.system.EntityTemperatureSystem;
|
import earth.terrarium.adastra.common.tags.ModItemTags;
|
||||||
import earth.terrarium.ad_astra.common.item.armor.NetheriteSpaceSuit;
|
import earth.terrarium.adastra.common.systems.TemperatureApiImpl;
|
||||||
import earth.terrarium.ad_astra.common.registry.ModTags;
|
|
||||||
import net.minecraft.world.entity.EquipmentSlot;
|
import net.minecraft.world.entity.EquipmentSlot;
|
||||||
import net.minecraft.world.entity.LivingEntity;
|
import net.minecraft.world.entity.LivingEntity;
|
||||||
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;
|
||||||
|
|
||||||
@Mixin(EntityTemperatureSystem.class)
|
@Mixin(TemperatureApiImpl.class)
|
||||||
public abstract class EntityTemperatureSystemMixin {
|
public abstract class EntityTemperatureSystemMixin {
|
||||||
@Redirect(at = @At(value = "INVOKE", target = "Learth/terrarium/ad_astra/common/entity/system/EntityTemperatureSystem;burnEntity(Lnet/minecraft/world/entity/LivingEntity;)V"),
|
@Redirect(at = @At(value = "INVOKE", target = "Learth/terrarium/adastra/common/systems/TemperatureApiImpl;burnEntity(Lnet/minecraft/world/entity/LivingEntity;)V"),
|
||||||
method = "temperatureTick(Lnet/minecraft/world/entity/LivingEntity;Lnet/minecraft/server/level/ServerLevel;)V")
|
method = "entityTick(Lnet/minecraft/server/level/ServerLevel;Lnet/minecraft/world/entity/LivingEntity;)V")
|
||||||
private static void redirectTemperatureTick(LivingEntity entity) {
|
private void redirectTemperatureTick(TemperatureApiImpl instance, LivingEntity entity) {
|
||||||
boolean createNetherite = true;
|
boolean createNetherite = true;
|
||||||
createNetherite &= entity.getItemBySlot(EquipmentSlot.HEAD).getItem().isFireResistant();
|
createNetherite &= entity.getItemBySlot(EquipmentSlot.HEAD).getItem().isFireResistant();
|
||||||
createNetherite &= entity.getItemBySlot(EquipmentSlot.CHEST).getItem().isFireResistant();
|
createNetherite &= entity.getItemBySlot(EquipmentSlot.CHEST).getItem().isFireResistant();
|
||||||
createNetherite &= entity.getItemBySlot(EquipmentSlot.LEGS).is(ModTags.HEAT_RESISTANT)
|
createNetherite &= entity.getItemBySlot(EquipmentSlot.LEGS).is(ModItemTags.HEAT_RESISTANT_ARMOR)
|
||||||
|| entity.getItemBySlot(EquipmentSlot.LEGS).getItem() instanceof NetheriteSpaceSuit
|
|| entity.getItemBySlot(EquipmentSlot.LEGS).getItem() instanceof NetheriteSpaceSuitItem
|
||||||
|| entity.getItemBySlot(EquipmentSlot.LEGS).getItem().isFireResistant();
|
|| entity.getItemBySlot(EquipmentSlot.LEGS).getItem().isFireResistant();
|
||||||
createNetherite &= entity.getItemBySlot(EquipmentSlot.FEET).is(ModTags.HEAT_RESISTANT)
|
createNetherite &= entity.getItemBySlot(EquipmentSlot.FEET).is(ModItemTags.HEAT_RESISTANT_ARMOR)
|
||||||
|| entity.getItemBySlot(EquipmentSlot.FEET).getItem() instanceof NetheriteSpaceSuit
|
|| entity.getItemBySlot(EquipmentSlot.FEET).getItem() instanceof NetheriteSpaceSuitItem
|
||||||
|| entity.getItemBySlot(EquipmentSlot.FEET).getItem().isFireResistant();
|
|| entity.getItemBySlot(EquipmentSlot.FEET).getItem().isFireResistant();
|
||||||
|
|
||||||
if(!createNetherite) {
|
if(!createNetherite) {
|
||||||
entity.hurt(entity.damageSources().onFire(), (float) AdAstraConfig.heatDamage);
|
entity.hurt(entity.damageSources().onFire(), 6);
|
||||||
entity.setSecondsOnFire(10);
|
entity.setSecondsOnFire(10);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user