This repository has been archived by the owner on Jan 26, 2025. It is now read-only.
generated from FabricMC/fabric-example-mod
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c1fb857
commit 84ec39e
Showing
271 changed files
with
3,202 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
platforms/1.20.1/common/src/main/java/top/ctnstudios/stonecraft/StoneCraft.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
} | ||
} |
39 changes: 39 additions & 0 deletions
39
platforms/1.20.1/common/src/main/java/top/ctnstudios/stonecraft/api/CanClearBadEffects.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |
53 changes: 53 additions & 0 deletions
53
.../src/main/java/top/ctnstudios/stonecraft/common/item/ArmorMaterials/lv0ArmorMaterial.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |
55 changes: 55 additions & 0 deletions
55
.../src/main/java/top/ctnstudios/stonecraft/common/item/ArmorMaterials/lv1ArmorMaterial.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |
55 changes: 55 additions & 0 deletions
55
.../src/main/java/top/ctnstudios/stonecraft/common/item/ArmorMaterials/lv2ArmorMaterial.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |
55 changes: 55 additions & 0 deletions
55
.../src/main/java/top/ctnstudios/stonecraft/common/item/ArmorMaterials/lv3ArmorMaterial.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |
Oops, something went wrong.