Skip to content

Commit

Permalink
Added worthy_potion
Browse files Browse the repository at this point in the history
  • Loading branch information
RealYusufIsmail committed Oct 16, 2023
1 parent fbffaa3 commit 149a0f8
Show file tree
Hide file tree
Showing 9 changed files with 114 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// 1.20.1 2023-10-12T22:09:59.3296691 Languages: en_us
8b0152e07cd1a1ee30bf67cc31642c7f52bea792 assets/armourandtoolsmod/lang/en_us.json
// 1.20.1 2023-10-16T08:43:51.7417297 Languages: en_us
e9fb8de4e52cfdc1f2fca0cb36fbfb0c1d6ca5ed assets/armourandtoolsmod/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@
"item.armourandtoolsmod.imperium_pickaxe": "Imperium Pickaxe",
"item.armourandtoolsmod.imperium_sword": "Imperium Sword",
"item.armourandtoolsmod.magma_strike_pickaxe": "Magma Strike Pickaxe",
"item.armourandtoolsmod.mjolnir": "Mjölnir",
"item.armourandtoolsmod.rainbow": "Rainbow Ingot",
"item.armourandtoolsmod.rainbow_boots": "Rainbow Boots",
"item.armourandtoolsmod.rainbow_chestplate": "Rainbow Chestplate",
Expand Down Expand Up @@ -160,5 +161,8 @@
"item.armourandtoolsmod.sapphire_pickaxe": "Sapphire Pickaxe",
"item.armourandtoolsmod.sapphire_shield": "Sapphire Shield",
"item.armourandtoolsmod.sapphire_shovel": "Sapphire Shovel",
"item.armourandtoolsmod.sapphire_sword": "Sapphire Sword"
"item.armourandtoolsmod.sapphire_sword": "Sapphire Sword",
"item.minecraft.lingering_potion.effect.worthy_potion": "Worthy Potion",
"item.minecraft.potion.effect.worthy_potion": "Worthy Potion",
"item.minecraft.splash_potion.effect.worthy_potion": "Worthy Potion"
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ class ArmourAndToolsMod {
EntityTypeInit.ENTITY_TYPES.register(bus)
BlockEntityTypeInit.BLOCK_ENTITY_TYPES.register(bus)
CreativeModeTabInit.CREATIVE_MODE_TAB.register(bus)
PotionsInit.POTION.register(bus)

// Register ourselves for server and other game events we are interested in
// Register the data generators
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
* Copyright 2023 RealYusufIsmail.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
*
* you may not use this file except in compliance with the License.
*
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.github.realyusufismail.armourandtoolsmod.core.init

import io.github.realyusufismail.armourandtoolsmod.items.hammer.HammerItem
import net.minecraft.world.item.enchantment.EnchantmentCategory

object EnchantmentCategoryInit {
val HAMMER = EnchantmentCategory.create("hammer") { item -> item is HammerItem }

Check warning on line 25 in src/main/kotlin/io/github/realyusufismail/armourandtoolsmod/core/init/EnchantmentCategoryInit.kt

View workflow job for this annotation

GitHub Actions / qodana

Constant conditions

Condition 'item is HammerItem' is always false
}
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,11 @@ object ItemInit {
HammerItem(CustomToolMaterial.DRAGON_DESTROYER, 1000, -3.6f, 10F, HammerLevel.LEGENDARY)
}

val MJOLNIR: ObjectHolderDelegate<Item> =
ITEMS.registerObject("mjolnir") {
HammerItem(CustomToolMaterial.MJOLNIR, 10000, -3.6f, 10F, HammerLevel.GODLY)
}

// Tridents
val AQUMARINE_TRIDENT: ObjectHolderDelegate<Item> =
ITEMS.registerSmeltableObject("aqumarine_trident", AQUMARINE) { AqumarineTridentItem() }
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
* Copyright 2023 RealYusufIsmail.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
*
* you may not use this file except in compliance with the License.
*
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.github.realyusufismail.armourandtoolsmod.core.init

import io.github.realyusufismail.armourandtoolsmod.ArmourAndToolsMod
import net.minecraft.world.item.alchemy.Potion
import net.minecraftforge.registries.DeferredRegister
import net.minecraftforge.registries.ForgeRegistries
import thedarkcolour.kotlinforforge.forge.ObjectHolderDelegate
import thedarkcolour.kotlinforforge.forge.registerObject

object PotionsInit {
val POTION: DeferredRegister<Potion> =
DeferredRegister.create(ForgeRegistries.POTIONS, ArmourAndToolsMod.MOD_ID)

// WORTHY_POTION has no effect, it just an indication that the potion is worthy to use mjolnir
public val WORTHY_POTION: ObjectHolderDelegate<Potion> =
POTION.registerObject("worthy_potion") { Potion() }
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ enum class CustomToolMaterial(
IMPERIUM_SWORD(6, 4000, 20, Supplier { Ingredient.of(ItemInit.IMPERIUM.get()) }),
IMPERIUM_PICKAXE(6, 4000, 20, Supplier { Ingredient.of(ItemInit.IMPERIUM.get()) }),
MAGMA_STRIKE_PICKAXE(6, 8000, 20, Supplier { Ingredient.of(ItemInit.IMPERIUM.get()) }),
DRAGON_DESTROYER(7, 10000, 25, Supplier { Ingredient.of(ItemInit.RUBY.get()) });
DRAGON_DESTROYER(7, 10000, 25, Supplier { Ingredient.of(ItemInit.RUBY.get()) }),
MJOLNIR(10, 50000, 0, Supplier { Ingredient.of(ItemInit.RUBY.get()) });

private val harvestLevel = 0
private val maxUses = 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ class ModEnLangProvider(gen: DataGenerator) : ModEnLangProviderSupport(gen, MOD_
addItem(ItemInit.IMPERIUM_PICKAXE, "Imperium Pickaxe")
addItem(ItemInit.MAGMA_STRIKE_PICKAXE, "Magma Strike Pickaxe")
addItem(ItemInit.DRAGON_DESTROYER, "Dragon Destroyer")
addItem(ItemInit.MJOLNIR, "Mjölnir")

// Shields
addItem(ItemInit.RUBY_SHIELD, "Ruby Shield")
Expand All @@ -146,6 +147,9 @@ class ModEnLangProvider(gen: DataGenerator) : ModEnLangProviderSupport(gen, MOD_
// Trident
addItem(ItemInit.AQUMARINE_TRIDENT, "Aqumarine Trident")

// Potions
addPotion("worthy_potion", "Worthy Potion")

// others
add("creativetab.armourandtoolsmod", "Armour and Item Mod")
add("container.custom_armour_crafting_table", "Armour Crafting Table")
Expand Down Expand Up @@ -301,4 +305,10 @@ class ModEnLangProvider(gen: DataGenerator) : ModEnLangProviderSupport(gen, MOD_
add(Component.translatable("advancements.$MOD_ID.$advancement.title"), title)
add(Component.translatable("advancements.$MOD_ID.$advancement.description"), description)
}

private fun addPotion(object_name: String, name: String) {
add(Component.translatable("item.minecraft.potion.effect.$object_name"), name)
add(Component.translatable("item.minecraft.splash_potion.effect.$object_name"), name)
add(Component.translatable("item.minecraft.lingering_potion.effect.$object_name"), name)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
* Copyright 2023 RealYusufIsmail.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
*
* you may not use this file except in compliance with the License.
*
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.github.realyusufismail.armourandtoolsmod.enchantment

import io.github.realyusufismail.armourandtoolsmod.core.init.EnchantmentCategoryInit
import net.minecraft.world.entity.EquipmentSlot
import net.minecraft.world.item.enchantment.Enchantment

/** Once applied to a hammer gives you the ability to fly. */
class SkyForgeEnchantment :
Enchantment(
Rarity.VERY_RARE, EnchantmentCategoryInit.HAMMER, arrayOf(EquipmentSlot.MAINHAND)) {}

0 comments on commit 149a0f8

Please sign in to comment.