Skip to content
This repository has been archived by the owner on Jan 26, 2025. It is now read-only.

Commit

Permalink
YES
Browse files Browse the repository at this point in the history
  • Loading branch information
RawDiamondMC committed Nov 5, 2023
1 parent c1fb857 commit 84ec39e
Show file tree
Hide file tree
Showing 271 changed files with 3,202 additions and 11 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ jobs:
gradle-version: wrapper
gradle-distribution-sha-256-sum-warning: false

- name: build
run: ./gradlew cleanBuildFolders

- name: build
run: ./gradlew build

Expand Down
11 changes: 7 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@ plugins {
id 'idea'
}

tasks.register('move-jar', Copy) {
mkdir "$rootDir/artifacts"
from "$rootDir/platforms/1.20.1/build/libs"
into "$rootDir/artifacts"
tasks.register('cleanBuildFolders') {
doLast {
delete "$rootDir/artifacts"
subprojects { subproject ->
delete "$subproject.projectDir/build"
}
}
}

subprojects {
Expand Down
19 changes: 17 additions & 2 deletions platforms/1.20.1/build.gradle
Original file line number Diff line number Diff line change
@@ -1,26 +1,41 @@
plugins {
id 'architectury-plugin' version '3.4.146'
id 'dev.architectury.loom' version '1.4.359' apply false
id 'dev.architectury.loom' version '1.4.361' apply false
}

version = "$project.mod_version"

architectury {
minecraft = '1.20.1'
}

tasks.register('move-jar', Copy) {
//mkdir "$rootDir/artifacts"
from "$rootDir/platforms/1.20.1/forge/build/libs"
from "$rootDir/platforms/1.20.1/fabric/build/libs"
from "$rootDir/platforms/1.20.1/quilt/build/libs"
into "$rootDir/artifacts/1.20.1"
}

subprojects {
apply plugin: 'dev.architectury.loom'

dependencies {
minecraft 'com.mojang:minecraft:1.20.1'
mappings "net.fabricmc:yarn:$project.yarn_mappings:v2"
}
repositories {
maven { url = 'https://maven.resourcefulbees.com/repository/maven-public/' }
}
}

allprojects {
apply plugin: 'java'
apply plugin: 'architectury-plugin'

version = project.mod_version
base {
archivesName = 'stonecraft-1.20.1'
}

tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
Expand Down
3 changes: 3 additions & 0 deletions platforms/1.20.1/common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ loom {
accessWidenerPath = file 'src/main/resources/stonecraft.accesswidener'
}

version="$parent.mod_version"

dependencies {
modImplementation "net.fabricmc:fabric-loader:$parent.fabric_loader_version"
modImplementation "com.teamresourceful.resourcefullib:resourcefullib-common-1.20.1:$parent.resourceful_lib_version"
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
package top.ctnstudios.stonecraft;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import top.ctnstudios.stonecraft.common.registry.ModItems;

public class StoneCraft {
public static final String MODID = "stonecraft";
public static final Logger LOGGER = LoggerFactory.getLogger(MODID);
public static void init() {
ModItems.ITEMS.init();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package top.ctnstudios.stonecraft.api;

import net.minecraft.advancement.criterion.Criteria;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.effect.StatusEffects;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.server.network.ServerPlayerEntity;
import net.minecraft.stat.Stats;
import net.minecraft.world.World;

public class CanClearBadEffects extends Item {
public CanClearBadEffects(Settings settings) {
super(settings);
}

public ItemStack finishUsing(ItemStack stack, World world, LivingEntity user) {
super.finishUsing(stack, world, user);
if (user instanceof ServerPlayerEntity serverPlayerEntity) {
Criteria.CONSUME_ITEM.trigger(serverPlayerEntity, stack);
serverPlayerEntity.incrementStat(Stats.USED.getOrCreateStat(this));
}
if (!world.isClient) {
user.removeStatusEffect(StatusEffects.MINING_FATIGUE);
user.removeStatusEffect(StatusEffects.SLOWNESS);
user.removeStatusEffect(StatusEffects.INSTANT_DAMAGE);
user.removeStatusEffect(StatusEffects.NAUSEA);
user.removeStatusEffect(StatusEffects.BLINDNESS);
user.removeStatusEffect(StatusEffects.HUNGER);
user.removeStatusEffect(StatusEffects.WEAKNESS);
user.removeStatusEffect(StatusEffects.POISON);
user.removeStatusEffect(StatusEffects.WITHER);
user.removeStatusEffect(StatusEffects.LEVITATION);
user.removeStatusEffect(StatusEffects.UNLUCK);
user.removeStatusEffect(StatusEffects.DARKNESS);
}
return stack;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
package top.ctnstudios.stonecraft.common.item.ArmorMaterials;

import net.minecraft.item.ArmorItem;
import net.minecraft.item.ArmorMaterial;
import net.minecraft.item.Items;
import net.minecraft.recipe.Ingredient;
import net.minecraft.sound.SoundEvent;
import net.minecraft.sound.SoundEvents;

public class lv0ArmorMaterial implements ArmorMaterial {
private static final int[] BASE_DURABILITY = new int[] {124, 198, 173, 99};
private static final int[] PROTECTION_VALUES = new int[] {1, 3, 2, 1};

@Override
public int getDurability(ArmorItem.Type type) {
return BASE_DURABILITY[type.getEquipmentSlot().getEntitySlotId()];
}

@Override
public int getProtection(ArmorItem.Type type) {
return PROTECTION_VALUES[type.getEquipmentSlot().getEntitySlotId()];
}

@Override
public int getEnchantability() {
return 2;
}

@Override
public SoundEvent getEquipSound() {
return SoundEvents.BLOCK_STONE_STEP;
}

@Override
public Ingredient getRepairIngredient() {
return Ingredient.ofItems(Items.STONE);
}

@Override
public String getName() {
return "lv0armor";
}

@Override
public float getToughness() {
return 0;
}

@Override
public float getKnockbackResistance() {
return 0;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
package top.ctnstudios.stonecraft.common.item.ArmorMaterials;

import net.minecraft.item.ArmorItem;
import net.minecraft.item.ArmorMaterial;
import net.minecraft.item.ItemConvertible;
import net.minecraft.recipe.Ingredient;
import net.minecraft.sound.SoundEvent;
import net.minecraft.sound.SoundEvents;

import top.ctnstudios.stonecraft.common.registry.ModItems;

public class lv1ArmorMaterial implements ArmorMaterial {
private static final int[] BASE_DURABILITY = new int[] {171, 274, 240, 137};
private static final int[] PROTECTION_VALUES = new int[] {2, 3, 3, 1};

@Override
public int getDurability(ArmorItem.Type type) {
return BASE_DURABILITY[type.getEquipmentSlot().getEntitySlotId()];
}

@Override
public int getProtection(ArmorItem.Type type) {
return PROTECTION_VALUES[type.getEquipmentSlot().getEntitySlotId()];
}

@Override
public int getEnchantability() {
return 3;
}

@Override
public SoundEvent getEquipSound() {
return SoundEvents.BLOCK_STONE_STEP;
}

@Override
public Ingredient getRepairIngredient() {
return Ingredient.ofItems((ItemConvertible) ModItems.LV1STONE);
}

@Override
public String getName() {
return "lv1armor";
}

@Override
public float getToughness() {
return 0;
}

@Override
public float getKnockbackResistance() {
return 0.1F;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
package top.ctnstudios.stonecraft.common.item.ArmorMaterials;

import net.minecraft.item.ArmorItem;
import net.minecraft.item.ArmorMaterial;
import net.minecraft.item.ItemConvertible;
import net.minecraft.recipe.Ingredient;
import net.minecraft.sound.SoundEvent;
import net.minecraft.sound.SoundEvents;

import top.ctnstudios.stonecraft.common.registry.ModItems;

public class lv2ArmorMaterial implements ArmorMaterial {
private static final int[] BASE_DURABILITY = new int[] {271, 434, 380, 217};
private static final int[] PROTECTION_VALUES = new int[] {2, 4, 3, 2};

@Override
public int getDurability(ArmorItem.Type type) {
return BASE_DURABILITY[type.getEquipmentSlot().getEntitySlotId()];
}

@Override
public int getProtection(ArmorItem.Type type) {
return PROTECTION_VALUES[type.getEquipmentSlot().getEntitySlotId()];
}

@Override
public int getEnchantability() {
return 5;
}

@Override
public SoundEvent getEquipSound() {
return SoundEvents.BLOCK_STONE_STEP;
}

@Override
public Ingredient getRepairIngredient() {
return Ingredient.ofItems((ItemConvertible) ModItems.LV1STONE);
}

@Override
public String getName() {
return "lv2armor";
}

@Override
public float getToughness() {
return 0;
}

@Override
public float getKnockbackResistance() {
return 0.3F;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
package top.ctnstudios.stonecraft.common.item.ArmorMaterials;

import net.minecraft.item.ArmorItem;
import net.minecraft.item.ArmorMaterial;
import net.minecraft.item.ItemConvertible;
import net.minecraft.recipe.Ingredient;
import net.minecraft.sound.SoundEvent;
import net.minecraft.sound.SoundEvents;

import top.ctnstudios.stonecraft.common.registry.ModItems;

public class lv3ArmorMaterial implements ArmorMaterial {
private static final int[] BASE_DURABILITY = new int[] {431, 542, 505, 357};
private static final int[] PROTECTION_VALUES = new int[] {2, 5, 4, 1};

@Override
public int getDurability(ArmorItem.Type type) {
return BASE_DURABILITY[type.getEquipmentSlot().getEntitySlotId()];
}

@Override
public int getProtection(ArmorItem.Type type) {
return PROTECTION_VALUES[type.getEquipmentSlot().getEntitySlotId()];
}

@Override
public int getEnchantability() {
return 7;
}

@Override
public SoundEvent getEquipSound() {
return SoundEvents.BLOCK_STONE_STEP;
}

@Override
public Ingredient getRepairIngredient() {
return Ingredient.ofItems((ItemConvertible) ModItems.LV1STONE);
}

@Override
public String getName() {
return "lv3armor";
}

@Override
public float getToughness() {
return 1.0F;
}

@Override
public float getKnockbackResistance() {
return 0.5F;
}
}
Loading

0 comments on commit 84ec39e

Please sign in to comment.