Compare commits

..

No commits in common. "1.18" and "mistress" have entirely different histories.

17 changed files with 81 additions and 117 deletions

1
.gitignore vendored
View File

@ -31,4 +31,3 @@ bin/
# fabric # fabric
run/ run/
remappedSrc/

View File

@ -1,18 +1,18 @@
plugins { plugins {
id 'fabric-loom' version '0.10-SNAPSHOT' id 'fabric-loom' version '0.5-SNAPSHOT'
id 'maven-publish' id 'maven-publish'
} }
sourceCompatibility = JavaVersion.VERSION_17 sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_17 targetCompatibility = JavaVersion.VERSION_1_8
archivesBaseName = project.archives_base_name archivesBaseName = project.archives_base_name
version = project.mod_version + "-" + project.minecraft_version version = project.mod_version
group = project.maven_group group = project.maven_group
repositories { repositories {
maven { maven {
url "https://maven.terraformersmc.com/releases/" url "http://maven.terraformersmc.com/releases/"
} }
maven { maven {
name = 'Ladysnake Mods' name = 'Ladysnake Mods'
@ -70,9 +70,8 @@ processResources {
// ensure that the encoding is set to UTF-8, no matter what the system default is // ensure that the encoding is set to UTF-8, no matter what the system default is
// this fixes some edge cases with special characters not displaying correctly // this fixes some edge cases with special characters not displaying correctly
// see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html // see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
tasks.withType(JavaCompile).configureEach { tasks.withType(JavaCompile) {
it.options.encoding = "UTF-8" options.encoding = "UTF-8"
it.options.release = 17
} }
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task // Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
@ -86,3 +85,24 @@ task sourcesJar(type: Jar, dependsOn: classes) {
jar { jar {
from "LICENSE" from "LICENSE"
} }
// configure the maven publication
publishing {
publications {
mavenJava(MavenPublication) {
// add all the jars that should be included when publishing to maven
artifact(remapJar) {
builtBy remapJar
}
artifact(sourcesJar) {
builtBy remapSourcesJar
}
}
}
// select the repositories you want to publish to
repositories {
// uncomment to publish to the local maven
// mavenLocal()
}
}

View File

@ -3,18 +3,18 @@ org.gradle.jvmargs=-Xmx1G
# Fabric Properties # Fabric Properties
# check these on https://fabricmc.net/use # check these on https://fabricmc.net/use
minecraft_version=1.18.2 minecraft_version=1.16.5
yarn_mappings=1.18.2+build.2 yarn_mappings=1.16.5+build.9
loader_version=0.13.3 loader_version=0.11.3
# Mod Properties # Mod Properties
mod_version = 1.2.1 mod_version = 1.1
maven_group = dev.agatharose maven_group = dev.agatharose
archives_base_name = asbestos archives_base_name = asbestos
# Dependencies # Dependencies
# currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api # currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api
fabric_version=0.48.0+1.18.2 fabric_version=0.34.2+1.16
modmenu_version=3.1.0 modmenu_version=1.16.9
cca_version=4.0.1 cca_version=2.8.3
cloth_version=6.2.57 cloth_version=4.11.26

View File

@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-6.6.1-bin.zip
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists

View File

@ -14,7 +14,7 @@ import dev.onyxstudios.cca.api.v3.entity.EntityComponentFactoryRegistry;
import dev.onyxstudios.cca.api.v3.entity.EntityComponentInitializer; import dev.onyxstudios.cca.api.v3.entity.EntityComponentInitializer;
import me.shedaniel.autoconfig.AutoConfig; import me.shedaniel.autoconfig.AutoConfig;
import me.shedaniel.autoconfig.serializer.Toml4jConfigSerializer; import me.shedaniel.autoconfig.serializer.Toml4jConfigSerializer;
import dev.onyxstudios.cca.api.v3.entity.RespawnCopyStrategy; import nerdhub.cardinal.components.api.util.RespawnCopyStrategy;
import net.fabricmc.api.ModInitializer; import net.fabricmc.api.ModInitializer;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.entity.damage.DamageSource; import net.minecraft.entity.damage.DamageSource;

View File

@ -1,7 +1,5 @@
package dev.agatharose.asbestos; package dev.agatharose.asbestos;
import java.util.Arrays;
import dev.agatharose.asbestos.block.AsbestosRoofBlock; import dev.agatharose.asbestos.block.AsbestosRoofBlock;
import dev.agatharose.asbestos.block.CarcinogenicBlock; import dev.agatharose.asbestos.block.CarcinogenicBlock;
import dev.agatharose.asbestos.item.PpeArmorMaterial; import dev.agatharose.asbestos.item.PpeArmorMaterial;
@ -11,6 +9,7 @@ import net.fabricmc.fabric.api.biome.v1.BiomeModifications;
import net.fabricmc.fabric.api.biome.v1.BiomeSelectors; import net.fabricmc.fabric.api.biome.v1.BiomeSelectors;
import net.fabricmc.fabric.api.item.v1.FabricItemSettings; import net.fabricmc.fabric.api.item.v1.FabricItemSettings;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags;
import net.minecraft.block.Material; import net.minecraft.block.Material;
import net.minecraft.entity.EquipmentSlot; import net.minecraft.entity.EquipmentSlot;
import net.minecraft.entity.effect.StatusEffectInstance; import net.minecraft.entity.effect.StatusEffectInstance;
@ -26,19 +25,15 @@ import net.minecraft.sound.BlockSoundGroup;
import net.minecraft.util.Identifier; import net.minecraft.util.Identifier;
import net.minecraft.util.registry.BuiltinRegistries; import net.minecraft.util.registry.BuiltinRegistries;
import net.minecraft.util.registry.Registry; import net.minecraft.util.registry.Registry;
import net.minecraft.util.registry.RegistryEntry;
import net.minecraft.util.registry.RegistryKey; import net.minecraft.util.registry.RegistryKey;
import net.minecraft.world.gen.GenerationStep; import net.minecraft.world.gen.GenerationStep;
import net.minecraft.world.gen.YOffset; import net.minecraft.world.gen.decorator.Decorator;
import net.minecraft.world.gen.decorator.RangeDecoratorConfig;
import net.minecraft.world.gen.feature.ConfiguredFeature; import net.minecraft.world.gen.feature.ConfiguredFeature;
import net.minecraft.world.gen.feature.Feature; import net.minecraft.world.gen.feature.Feature;
import net.minecraft.world.gen.feature.OreConfiguredFeatures;
import net.minecraft.world.gen.feature.OreFeatureConfig; import net.minecraft.world.gen.feature.OreFeatureConfig;
import net.minecraft.world.gen.feature.PlacedFeature;
import net.minecraft.world.gen.placementmodifier.CountPlacementModifier;
import net.minecraft.world.gen.placementmodifier.HeightRangePlacementModifier;
import net.minecraft.world.gen.placementmodifier.SquarePlacementModifier;
@SuppressWarnings("deprecation")
public class AsbestosRegistry { public class AsbestosRegistry {
// block/item definitions // block/item definitions
public static final Item ASBESTOS_FIBERS = new Item(new FabricItemSettings().group(ItemGroup.MATERIALS) public static final Item ASBESTOS_FIBERS = new Item(new FabricItemSettings().group(ItemGroup.MATERIALS)
@ -51,10 +46,10 @@ public class AsbestosRegistry {
FabricBlockSettings.of(Material.WOOL).hardness(1.0f).sounds(BlockSoundGroup.WOOL), 40); FabricBlockSettings.of(Material.WOOL).hardness(1.0f).sounds(BlockSoundGroup.WOOL), 40);
public static final CarcinogenicBlock SERPENTINITE_BLOCK = new CarcinogenicBlock(FabricBlockSettings public static final CarcinogenicBlock SERPENTINITE_BLOCK = new CarcinogenicBlock(FabricBlockSettings
.of(Material.STONE).hardness(3.0f).requiresTool(), 20); .of(Material.STONE).hardness(3.0f).breakByTool(FabricToolTags.PICKAXES).requiresTool(), 20);
public static final CarcinogenicBlock POPCORN_CEILING_BLOCK = new CarcinogenicBlock(FabricBlockSettings public static final CarcinogenicBlock POPCORN_CEILING_BLOCK = new CarcinogenicBlock(FabricBlockSettings
.of(Material.WOOD).hardness(2.0f).sounds(BlockSoundGroup.WOOD), .of(Material.WOOD).hardness(2.0f).breakByTool(FabricToolTags.AXES).sounds(BlockSoundGroup.WOOD),
20); 20);
public static final CarcinogenicBlock ASBESTOS_TILE_BLOCK = new CarcinogenicBlock( public static final CarcinogenicBlock ASBESTOS_TILE_BLOCK = new CarcinogenicBlock(
@ -80,16 +75,12 @@ public class AsbestosRegistry {
new Item.Settings().group(ItemGroup.COMBAT)); new Item.Settings().group(ItemGroup.COMBAT));
// serpentinite worldgen // serpentinite worldgen
private static ConfiguredFeature<?, ?> SERPENTINITE_OVERWORLD = new ConfiguredFeature<OreFeatureConfig, Feature<OreFeatureConfig>>(
Feature.ORE, new OreFeatureConfig(OreConfiguredFeatures.DEEPSLATE_ORE_REPLACEABLES,
SERPENTINITE_BLOCK.getDefaultState(), 5));
public static PlacedFeature SERPENTINITE_PLACED_FEATURE = new PlacedFeature( private static ConfiguredFeature<?, ?> SERPENTINITE_OVERWORLD = Feature.ORE
RegistryEntry.of(SERPENTINITE_OVERWORLD), .configure(new OreFeatureConfig(OreFeatureConfig.Rules.BASE_STONE_OVERWORLD,
Arrays.asList( SERPENTINITE_BLOCK.getDefaultState(), 5))
CountPlacementModifier.of(20), .decorate(Decorator.RANGE.configure(new RangeDecoratorConfig(0, 0, 32))).spreadHorizontally()
SquarePlacementModifier.of(), .repeat(10);
HeightRangePlacementModifier.uniform(YOffset.getBottom(), YOffset.fixed(0))));
public static void register() { public static void register() {
// asbestos fibers item // asbestos fibers item
@ -125,13 +116,12 @@ public class AsbestosRegistry {
ASBESTOS_ROOF_BLOCK, new Item.Settings().group(ItemGroup.BUILDING_BLOCKS))); ASBESTOS_ROOF_BLOCK, new Item.Settings().group(ItemGroup.BUILDING_BLOCKS)));
// serpentinite worldgen // serpentinite worldgen
RegistryKey<PlacedFeature> serpentiniteOverworld = RegistryKey.of( RegistryKey<ConfiguredFeature<?, ?>> serpentiniteOverworld = RegistryKey.of(
Registry.PLACED_FEATURE_KEY, new Identifier("asbestos", "serpentinite_overworld")); Registry.CONFIGURED_FEATURE_WORLDGEN,
new Identifier("asbestos", "serpentinite_overworld"));
Registry.register(BuiltinRegistries.CONFIGURED_FEATURE, serpentiniteOverworld.getValue(), Registry.register(BuiltinRegistries.CONFIGURED_FEATURE, serpentiniteOverworld.getValue(),
SERPENTINITE_OVERWORLD); SERPENTINITE_OVERWORLD);
Registry.register(BuiltinRegistries.PLACED_FEATURE, serpentiniteOverworld.getValue(),
SERPENTINITE_PLACED_FEATURE);
BiomeModifications.addFeature(BiomeSelectors.foundInOverworld(), BiomeModifications.addFeature(BiomeSelectors.foundInOverworld(),
GenerationStep.Feature.UNDERGROUND_ORES, serpentiniteOverworld); GenerationStep.Feature.UNDERGROUND_ORES, serpentiniteOverworld);

View File

@ -5,13 +5,13 @@ import me.shedaniel.autoconfig.AutoConfig;
import net.minecraft.entity.LivingEntity; import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.effect.StatusEffect; import net.minecraft.entity.effect.StatusEffect;
import net.minecraft.entity.effect.StatusEffectInstance; import net.minecraft.entity.effect.StatusEffectInstance;
import net.minecraft.entity.effect.StatusEffectCategory; import net.minecraft.entity.effect.StatusEffectType;
import net.minecraft.entity.effect.StatusEffects; import net.minecraft.entity.effect.StatusEffects;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
public class MesotheliomaStatusEffect extends StatusEffect { public class MesotheliomaStatusEffect extends StatusEffect {
public MesotheliomaStatusEffect() { public MesotheliomaStatusEffect() {
super(StatusEffectCategory.HARMFUL, 0x302412); super(StatusEffectType.HARMFUL, 0x302412);
} }
@Override @Override

View File

@ -37,20 +37,16 @@ public class AsbestosRoofBlock extends CarcinogenicBlock {
public VoxelShape getOutlineShape(BlockState state, BlockView view, BlockPos pos, ShapeContext ctx) { public VoxelShape getOutlineShape(BlockState state, BlockView view, BlockPos pos, ShapeContext ctx) {
Direction dir = state.get(Properties.HORIZONTAL_FACING); Direction dir = state.get(Properties.HORIZONTAL_FACING);
switch (dir) { switch (dir) {
case NORTH: case NORTH:
return VoxelShapes.union(VoxelShapes.cuboid(0, 0, 0, 1, 0.5, 1), return VoxelShapes.union(VoxelShapes.cuboid(0, 0, 0, 1, 0.5, 1), VoxelShapes.cuboid(1, 0.5, 1, 0, 1, 0.5));
VoxelShapes.cuboid(0, 0.5, 0.5, 1, 1, 1)); case SOUTH:
case SOUTH: return VoxelShapes.union(VoxelShapes.cuboid(0, 0, 0, 1, 0.5, 1), VoxelShapes.cuboid(0, 0.5, 0, 1, 1, 0.5));
return VoxelShapes.union(VoxelShapes.cuboid(0, 0, 0, 1, 0.5, 1), case EAST:
VoxelShapes.cuboid(0, 0.5, 0, 1, 1, 0.5)); return VoxelShapes.union(VoxelShapes.cuboid(0, 0, 0, 1, 0.5, 1), VoxelShapes.cuboid(0, 0.5, 0, 0.5, 1, 1));
case EAST: case WEST:
return VoxelShapes.union(VoxelShapes.cuboid(0, 0, 0, 1, 0.5, 1), return VoxelShapes.union(VoxelShapes.cuboid(0, 0, 0, 1, 0.5, 1), VoxelShapes.cuboid(1, 0.5, 0, 0.5, 1, 1));
VoxelShapes.cuboid(0, 0.5, 0, 0.5, 1, 1)); default:
case WEST: return VoxelShapes.fullCube();
return VoxelShapes.union(VoxelShapes.cuboid(0, 0, 0, 1, 0.5, 1),
VoxelShapes.cuboid(0.5, 0.5, 0, 1, 1, 1));
default:
return VoxelShapes.fullCube();
} }
} }

View File

@ -3,7 +3,7 @@ package dev.agatharose.asbestos.component;
import dev.agatharose.asbestos.Asbestos; import dev.agatharose.asbestos.Asbestos;
import dev.onyxstudios.cca.api.v3.component.sync.AutoSyncedComponent; import dev.onyxstudios.cca.api.v3.component.sync.AutoSyncedComponent;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.nbt.NbtCompound; import net.minecraft.nbt.CompoundTag;
public class PlayerMesotheliomaComponent implements MesotheliomaComponent, AutoSyncedComponent { public class PlayerMesotheliomaComponent implements MesotheliomaComponent, AutoSyncedComponent {
private PlayerEntity player; private PlayerEntity player;
@ -26,12 +26,12 @@ public class PlayerMesotheliomaComponent implements MesotheliomaComponent, AutoS
} }
@Override @Override
public void readFromNbt(NbtCompound tag) { public void readFromNbt(CompoundTag tag) {
this.mesothelioma = tag.getInt("mesothelioma"); this.mesothelioma = tag.getInt("mesothelioma");
} }
@Override @Override
public void writeToNbt(NbtCompound tag) { public void writeToNbt(CompoundTag tag) {
tag.putInt("mesothelioma", this.mesothelioma); tag.putInt("mesothelioma", this.mesothelioma);
} }
} }

View File

@ -1,6 +1,7 @@
package dev.agatharose.asbestos.config; package dev.agatharose.asbestos.config;
import me.shedaniel.autoconfig.ConfigData; import me.shedaniel.autoconfig.ConfigData;
import me.shedaniel.autoconfig.annotation.Config;
import me.shedaniel.autoconfig.annotation.*; import me.shedaniel.autoconfig.annotation.*;
@Config(name = "asbestos") @Config(name = "asbestos")

View File

@ -1,14 +1,18 @@
package dev.agatharose.asbestos.item; package dev.agatharose.asbestos.item;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;
import static dev.agatharose.asbestos.AsbestosRegistry.*;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.item.MiningToolItem; import net.minecraft.item.MiningToolItem;
import net.minecraft.item.ToolMaterial; import net.minecraft.item.ToolMaterial;
import net.minecraft.tag.TagKey;
import net.minecraft.util.Identifier;
import net.minecraft.util.registry.Registry;
public class ScraperItem extends MiningToolItem { public class ScraperItem extends MiningToolItem {
private static TagKey<Block> affectedBlocks = TagKey.of(Registry.BLOCK_KEY, new Identifier("asbestos", "scrapable"));
private static Set<Block> affectedBlocks = new HashSet<Block>(
Arrays.asList(ASBESTOS_BLOCK, POPCORN_CEILING_BLOCK, ASBESTOS_TILE_BLOCK));
public ScraperItem(ToolMaterial material, float attackDamage, float attackSpeed, Settings settings) { public ScraperItem(ToolMaterial material, float attackDamage, float attackSpeed, Settings settings) {
super(attackDamage, attackSpeed, material, affectedBlocks, settings); super(attackDamage, attackSpeed, material, affectedBlocks, settings);

View File

@ -4,7 +4,7 @@
"block.asbestos.popcorn_ceiling_block": "Popcorn Ceiling", "block.asbestos.popcorn_ceiling_block": "Popcorn Ceiling",
"block.asbestos.asbestos_tile_block": "Asbestos Tiles", "block.asbestos.asbestos_tile_block": "Asbestos Tiles",
"block.asbestos.asbestos_roof_block": "Asbestos Roof Tiles", "block.asbestos.asbestos_roof_block": "Asbestos Roof Tiles",
"item.asbestos.asbestos_fibers": "Asbestos Fibers", "item.asbestos.asbestos_fibers": "Asbests Fibers",
"item.asbestos.iron_scraper": "Asbestos Scraper", "item.asbestos.iron_scraper": "Asbestos Scraper",
"item.asbestos.ppe_helmet": "Asbestos Removal PPE Helmet", "item.asbestos.ppe_helmet": "Asbestos Removal PPE Helmet",
"item.asbestos.ppe_chestplate": "Asbestos Removal PPE Chestplate", "item.asbestos.ppe_chestplate": "Asbestos Removal PPE Chestplate",

View File

@ -1,24 +0,0 @@
{
"block.asbestos.asbestos_block": "Asbestblock",
"block.asbestos.serpentinite_block": "Serpentinit",
"block.asbestos.popcorn_ceiling_block": "Popcorntak",
"block.asbestos.asbestos_tile_block": "Asbestrutor",
"block.asbestos.asbestos_roof_block": "Asbesttakrutor",
"item.asbestos.asbestos_fibers": "Asbestfiber",
"item.asbestos.iron_scraper": "Asbestskrapa",
"item.asbestos.ppe_helmet": "Asbestborttagningsskyddshj\u00e4lm",
"item.asbestos.ppe_chestplate": "Asbestborttagningsskyddsv\u00e4st",
"item.asbestos.ppe_leggings": "Asbestborttagningsskyddsbyxor",
"item.asbestos.ppe_boots": "Asbestborttagningsskyddsst\u00f6vlar",
"effect.asbestos.mesothelioma": "Mesoteliom",
"death.attack.mesotheliomaDamage": "%1$s fick r\u00e4tt till finansiell kompensation",
"text.autoconfig.asbestos.title": "Asbestborttagning",
"text.autoconfig.asbestos.option.mesothelioma": "Mesoteliominst\u00e4llningar",
"text.autoconfig.asbestos.option.mesothelioma.offset": "Avst\u00e5nd (block)",
"text.autoconfig.asbestos.option.mesothelioma.offset.@Tooltip": "Hur m\u00e5nga block runt spelaren som kollas",
"text.autoconfig.asbestos.option.mesothelioma.period": "Period (sekunder)",
"text.autoconfig.asbestos.option.mesothelioma.period.@Tooltip[0]": "Hur m\u00e5nga sekunder som ska g\u00e5 mellan",
"text.autoconfig.asbestos.option.mesothelioma.period.@Tooltip[1]": "varje koll efter asbest runt spelaren",
"text.autoconfig.asbestos.option.mesothelioma.threshold": "Mesoteliomtr\u00f6skelv\u00e4rde",
"text.autoconfig.asbestos.option.mesothelioma.threshold.@Tooltip": "Hur m\u00e5nga mesoteliom-\"po\u00e4ng\" spelaren beh\u00f6ver f\u00e6r att d\u00e6"
}

View File

@ -1,8 +0,0 @@
{
"replace": false,
"values": [
"asbestos:asbestos_block",
"asbestos:popcorn_ceiling_block",
"asbestos:asbestos_tile_block"
]
}

View File

@ -1,6 +0,0 @@
{
"replace": false,
"values": [
"asbestos:popcorn_ceiling_block"
]
}

View File

@ -1,7 +0,0 @@
{
"replace": false,
"values": [
"asbestos:serpentinite_block",
"asbestos:asbestos_roof_block"
]
}

View File

@ -31,10 +31,9 @@
] ]
}, },
"depends": { "depends": {
"fabricloader": ">=0.12.0", "fabricloader": ">=0.7.4",
"fabric": "*", "fabric": "*",
"minecraft": "1.18.x", "minecraft": "1.16.x"
"java": ">=17"
}, },
"suggests": { "suggests": {
"modmenu": "*" "modmenu": "*"