-
Notifications
You must be signed in to change notification settings - Fork 44
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
86adf51
commit bf51900
Showing
3 changed files
with
94 additions
and
37 deletions.
There are no files selected for viewing
35 changes: 0 additions & 35 deletions
35
src/main/java/com/klikli_dev/occultism/api/common/misc/IButcherKnifeLoot.java
This file was deleted.
Oops, something went wrong.
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
92 changes: 92 additions & 0 deletions
92
src/main/java/com/klikli_dev/occultism/registry/OccultismTiers.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,92 @@ | ||
/* | ||
* MIT License | ||
* | ||
* Copyright 2024 klikli-dev | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and | ||
* associated documentation files (the "Software"), to deal in the Software without restriction, including | ||
* without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies | ||
* of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following | ||
* conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in all copies or substantial | ||
* portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, | ||
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR | ||
* PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE | ||
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT | ||
* OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | ||
* OTHER DEALINGS IN THE SOFTWARE. | ||
*/ | ||
|
||
package com.klikli_dev.occultism.registry; | ||
|
||
import com.google.common.base.Suppliers; | ||
import net.minecraft.tags.BlockTags; | ||
import net.minecraft.tags.TagKey; | ||
import net.minecraft.world.item.Items; | ||
import net.minecraft.world.item.Tier; | ||
import net.minecraft.world.item.Tiers; | ||
import net.minecraft.world.item.crafting.Ingredient; | ||
import net.minecraft.world.level.block.Block; | ||
|
||
import java.util.function.Supplier; | ||
|
||
public enum OccultismTiers implements Tier { | ||
SPIRIT_ATTUNED(Tiers.DIAMOND, BlockTags.INCORRECT_FOR_DIAMOND_TOOL, Tiers.STONE.getUses(), 8.0F, 3.0F, 10, () -> Ingredient.of(Items.DIAMOND)), | ||
IESNIUM(Tiers.DIAMOND, BlockTags.INCORRECT_FOR_DIAMOND_TOOL, 1561, 8.0F, 3.0F, 10, () -> Ingredient.of(Items.DIAMOND)); | ||
|
||
private final Tiers vanillaTier; | ||
private final TagKey<Block> incorrectBlocksForDrops; | ||
private final int uses; | ||
private final float speed; | ||
private final float damage; | ||
private final int enchantmentValue; | ||
private final Supplier<Ingredient> repairIngredient; | ||
|
||
OccultismTiers(Tiers vanillaTier, TagKey<Block> incorrectBlockForDrops, int uses, float speed, float damage, int enchantmentValue, Supplier<Ingredient> repairIngredient) { | ||
this.vanillaTier = vanillaTier; | ||
this.incorrectBlocksForDrops = incorrectBlockForDrops; | ||
this.uses = uses; | ||
this.speed = speed; | ||
this.damage = damage; | ||
this.enchantmentValue = enchantmentValue; | ||
this.repairIngredient = Suppliers.memoize(repairIngredient::get); | ||
} | ||
|
||
@Override | ||
public int getUses() { | ||
return this.uses; | ||
} | ||
|
||
@Override | ||
public float getSpeed() { | ||
return this.speed; | ||
} | ||
|
||
@Override | ||
public float getAttackDamageBonus() { | ||
return this.damage; | ||
} | ||
|
||
@Override | ||
public TagKey<Block> getIncorrectBlocksForDrops() { | ||
return this.incorrectBlocksForDrops; | ||
} | ||
|
||
@Override | ||
public int getEnchantmentValue() { | ||
return this.enchantmentValue; | ||
} | ||
|
||
@Override | ||
public Ingredient getRepairIngredient() { | ||
return this.repairIngredient.get(); | ||
} | ||
|
||
@org.jetbrains.annotations.Nullable | ||
public net.minecraft.tags.TagKey<net.minecraft.world.level.block.Block> getTag() { | ||
return net.neoforged.neoforge.common.CommonHooks.getTagFromVanillaTier(this.vanillaTier); | ||
} | ||
} |