First push
This commit is contained in:
@ -0,0 +1,36 @@
|
||||
package ru.bitheaven.createinteriorsfabric;
|
||||
|
||||
import com.simibubi.create.Create;
|
||||
import earth.terrarium.ad_astra.common.util.OxygenUtils;
|
||||
import io.github.fabricators_of_create.porting_lib.util.EnvExecutor;
|
||||
import net.fabricmc.api.ModInitializer;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.entity.LivingEntity;
|
||||
import net.minecraft.world.level.Level;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class CreateInteriorsFabric implements ModInitializer {
|
||||
public static final String ID = "createastrafabric";
|
||||
public static final String NAME = "Create Astra Fabric";
|
||||
public static final Logger LOGGER = LoggerFactory.getLogger(NAME);
|
||||
|
||||
@Override
|
||||
public void onInitialize() {
|
||||
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 airQualityActivatesHelmet(LivingEntity entity) {
|
||||
final Level level = entity.level();
|
||||
final boolean air = OxygenUtils.levelHasOxygen(level);
|
||||
return !air || entity.isUnderWater();
|
||||
}
|
||||
|
||||
public static ResourceLocation id(String path) {
|
||||
return new ResourceLocation(ID, path);
|
||||
}
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
package ru.bitheaven.createinteriorsfabric.mixin;
|
||||
|
||||
import ru.bitheaven.createinteriorsfabric.CreateInteriorsFabric;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
|
||||
import net.minecraft.client.main.GameConfig;
|
||||
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
@Mixin(Minecraft.class)
|
||||
public class MinecraftMixin {
|
||||
@Inject(method = "<init>", at = @At("TAIL"))
|
||||
private void example$init(GameConfig gameConfig, CallbackInfo ci) {
|
||||
CreateInteriorsFabric.LOGGER.info("Hello from {}", CreateInteriorsFabric.NAME);
|
||||
}
|
||||
}
|
BIN
src/main/resources/assets/createinteriorsfabric/icon.png
Normal file
BIN
src/main/resources/assets/createinteriorsfabric/icon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 79 KiB |
14
src/main/resources/createinteriorsfabric.mixins.json
Normal file
14
src/main/resources/createinteriorsfabric.mixins.json
Normal file
@ -0,0 +1,14 @@
|
||||
{
|
||||
"required": true,
|
||||
"minVersion": "0.8",
|
||||
"package": "ru.bitheaven.createinteriorsfabric.mixin",
|
||||
"compatibilityLevel": "JAVA_17",
|
||||
"mixins": [
|
||||
],
|
||||
"client": [
|
||||
"MinecraftMixin"
|
||||
],
|
||||
"injectors": {
|
||||
"defaultRequire": 1
|
||||
}
|
||||
}
|
31
src/main/resources/fabric.mod.json
Normal file
31
src/main/resources/fabric.mod.json
Normal file
@ -0,0 +1,31 @@
|
||||
{
|
||||
"schemaVersion": 1,
|
||||
"id": "createinteriorsfabric",
|
||||
"version": "${version}",
|
||||
"name": "Create Interiors Fabric",
|
||||
"description": "Port ",
|
||||
"authors": [
|
||||
"BitHeaven"
|
||||
],
|
||||
"contact": {
|
||||
"website": "https://bitheaven.ru",
|
||||
"repo": "https://git.bitheaven.ru/bitheaven/create-interiors-fabric"
|
||||
},
|
||||
"license": "GPL-3.0",
|
||||
"icon": "assets/createinteriorsfabric/icon.png",
|
||||
"environment": "*",
|
||||
"entrypoints": {
|
||||
"main": [
|
||||
"ru.bitheaven.createinteriorsfabric.CreateInteriorsFabric"
|
||||
]
|
||||
},
|
||||
"mixins": [
|
||||
"createinteriorsfabric.mixins.json"
|
||||
],
|
||||
"depends": {
|
||||
"fabricloader": ">=${fabric_loader_version}",
|
||||
"fabric": "*",
|
||||
"minecraft": "${minecraft_version}",
|
||||
"create": "${create_version}"
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user