Skip to content

Commit

Permalink
full update to 1.20.5
Browse files Browse the repository at this point in the history
  • Loading branch information
bms-1984 committed Apr 29, 2024
1 parent a79a931 commit 9c24c35
Show file tree
Hide file tree
Showing 86 changed files with 134 additions and 160 deletions.
12 changes: 6 additions & 6 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ org.gradle.debug=false

mappings_version=2024.04.14
minecraft_version=1.20.5
minecraft_version_range=[1.20.4,1.21)
minecraft_version_range=[1.20.5,1.21)
neo_version=20.5.16-beta
neo_version_range=[20.4,)
loader_version_range=[4.7 ,)
kotlinforforge_version=4.10.0
kotlinforforge_version_range=[4.10.0,)
neo_version_range=[20.5,)
loader_version_range=[5.0.1,)
kotlinforforge_version=5.0.1
kotlinforforge_version_range=[5.0.1,)
top_version=11.0.2-3
jei_version=17.3.0.49

Expand All @@ -37,4 +37,4 @@ mod_version=0.0.1.0
mod_group_id=net.benjimadness.triad
mod_authors=BenjiMadness
mod_description=Tech Mod
pack_format_id=26
pack_format_id=32
16 changes: 3 additions & 13 deletions src/main/kotlin/net/benjimadness/triad/TriadMod.kt
Original file line number Diff line number Diff line change
Expand Up @@ -30,28 +30,21 @@ import net.neoforged.bus.api.SubscribeEvent
import net.neoforged.fml.common.EventBusSubscriber
import net.neoforged.fml.common.Mod
import net.neoforged.fml.config.ModConfig
import net.neoforged.fml.event.lifecycle.FMLClientSetupEvent
import net.neoforged.fml.event.lifecycle.FMLCommonSetupEvent
import net.neoforged.fml.event.lifecycle.FMLDedicatedServerSetupEvent
import net.neoforged.neoforge.capabilities.Capabilities
import net.neoforged.neoforge.capabilities.RegisterCapabilitiesEvent
import net.neoforged.neoforge.client.event.RegisterMenuScreensEvent
import org.slf4j.Logger
import thedarkcolour.kotlinforforge.neoforge.forge.LOADING_CONTEXT
import thedarkcolour.kotlinforforge.neoforge.forge.MOD_BUS
import thedarkcolour.kotlinforforge.neoforge.forge.registerConfig
import thedarkcolour.kotlinforforge.neoforge.forge.runForDist

@Mod(TriadMod.MODID)
@EventBusSubscriber(bus = EventBusSubscriber.Bus.MOD)
object TriadMod {
const val MODID = "triad"
val LOGGER: Logger = LogUtils.getLogger()
init {

runForDist(
clientTarget = { MOD_BUS.addListener(::onClientSetup) },
serverTarget = { MOD_BUS.addListener(::onServerSetup) })
registerConfig(ModConfig.Type.COMMON, TriadConfig.SPEC)
LOADING_CONTEXT.activeContainer.registerConfig(ModConfig.Type.COMMON, TriadConfig.SPEC)
TriadBlocks.REGISTRY.register(MOD_BUS)
TriadItems.REGISTRY.register(MOD_BUS)
TriadItems.ARMOR_MATERIAL_REGISTRY.register(MOD_BUS)
Expand All @@ -64,6 +57,7 @@ object TriadMod {
TriadMenus.REGISTRY.register(MOD_BUS)
}

@Suppress("UNUSED_PARAMETER")
@SubscribeEvent
private fun onCommonSetup(event: FMLCommonSetupEvent) {
LOGGER.info("Trying Triad, David, Stephen, Neil, Graham, Joni, YESSIREE!")
Expand Down Expand Up @@ -120,15 +114,11 @@ object TriadMod {
) { o, _ -> o.energyStorage }
}

private fun onClientSetup(event: FMLClientSetupEvent) {}

@SubscribeEvent
private fun onRegisterMenuScreens(event: RegisterMenuScreensEvent) {
event.register(TriadMenus.GRINDER_MENU_TYPE.get(), ::GrinderScreen)
event.register(TriadMenus.FURNACE_MENU_TYPE.get(), ::ElectricFurnaceScreen)
event.register(TriadMenus.TURBINE_MENU_TYPE.get(), ::TurbineScreen)
event.register(TriadMenus.ITEM_BOILER_MENU_TYPE.get(), ::BoilerScreen)
}

private fun onServerSetup(event: FMLDedicatedServerSetupEvent) {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ import net.minecraft.core.BlockPos
import net.minecraft.world.level.block.state.BlockState

class SteelCapacitorBlockEntity(pos: BlockPos, state: BlockState) :
AbstractCapacitorBlockEntity(25000, 5, TriadBlockEntities.STEEL_CAPACITOR_BLOCK_ENTITY_TYPE, pos, state)
AbstractCapacitorBlockEntity(50000, 5, TriadBlockEntities.STEEL_CAPACITOR_BLOCK_ENTITY_TYPE, pos, state)

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class GrinderRecipe(
override fun codec(): MapCodec<GrinderRecipe> = RecordCodecBuilder.mapCodec {
it.group(
Ingredient.CODEC_NONEMPTY.fieldOf("ingredient").forGetter(GrinderRecipe::input),
ItemStack.SIMPLE_ITEM_CODEC.fieldOf("result").forGetter(GrinderRecipe::output)
ItemStack.CODEC.fieldOf("result").forGetter(GrinderRecipe::output)
).apply(it, ::GrinderRecipe)
}

Expand Down
26 changes: 13 additions & 13 deletions src/main/kotlin/net/benjimadness/triad/registry/TriadItems.kt
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ import net.benjimadness.triad.TriadMod
import net.benjimadness.triad.api.block.Blades
import net.benjimadness.triad.api.item.ReusableItem
import net.benjimadness.triad.item.BladeItem
import net.benjimadness.triad.item.armor.TriadArmorItem
import net.minecraft.core.registries.Registries
import net.minecraft.resources.ResourceLocation
import net.minecraft.sounds.SoundEvents
import net.minecraft.world.item.*
import net.minecraft.world.item.crafting.Ingredient
Expand All @@ -36,7 +36,7 @@ object TriadItems {
val REGISTRY: DeferredRegister.Items = DeferredRegister.createItems(TriadMod.MODID)
val ARMOR_MATERIAL_REGISTRY: DeferredRegister<ArmorMaterial> = DeferredRegister.create(Registries.ARMOR_MATERIAL, TriadMod.MODID)

val BRONZE_ARMOR_MATERIAL: DeferredHolder<ArmorMaterial, ArmorMaterial> = registerArmorMaterial("bronze") {
private val BRONZE_ARMOR_MATERIAL: DeferredHolder<ArmorMaterial, ArmorMaterial> = registerArmorMaterial("bronze") {
ArmorMaterial(
hashMapOf
(
Expand All @@ -48,12 +48,12 @@ object TriadItems {
15,
SoundEvents.ARMOR_EQUIP_IRON,
{ Ingredient.of(BRONZE_INGOT) },
null,
listOf(ArmorMaterial.Layer(ResourceLocation(TriadMod.MODID, "bronze"))),
0F,
0.25F
)
}
val STEEL_ARMOR_MATERIAL: DeferredHolder<ArmorMaterial, ArmorMaterial> = registerArmorMaterial("steel") {
private val STEEL_ARMOR_MATERIAL: DeferredHolder<ArmorMaterial, ArmorMaterial> = registerArmorMaterial("steel") {
ArmorMaterial(
hashMapOf
(
Expand All @@ -65,7 +65,7 @@ object TriadItems {
12,
SoundEvents.ARMOR_EQUIP_IRON,
{ Ingredient.of(STEEL_INGOT) },
null,
listOf(ArmorMaterial.Layer(ResourceLocation(TriadMod.MODID, "steel"))),
1F,
0.4F
)
Expand Down Expand Up @@ -106,16 +106,16 @@ object TriadItems {
HoeItem(Tiers.IRON, Item.Properties())
}
val BRONZE_CHESTPLATE: Item by registerItem("bronze_chestplate") {
TriadArmorItem("bronze", BRONZE_ARMOR_MATERIAL, ArmorItem.Type.CHESTPLATE)
ArmorItem(BRONZE_ARMOR_MATERIAL, ArmorItem.Type.CHESTPLATE, Item.Properties())
}
val BRONZE_HELMET: Item by registerItem("bronze_helmet") {
TriadArmorItem("bronze", BRONZE_ARMOR_MATERIAL, ArmorItem.Type.HELMET)
ArmorItem(BRONZE_ARMOR_MATERIAL, ArmorItem.Type.HELMET, Item.Properties())
}
val BRONZE_LEGGINGS: Item by registerItem("bronze_leggings") {
TriadArmorItem("bronze", BRONZE_ARMOR_MATERIAL, ArmorItem.Type.LEGGINGS)
ArmorItem(BRONZE_ARMOR_MATERIAL, ArmorItem.Type.LEGGINGS, Item.Properties())
}
val BRONZE_BOOTS: Item by registerItem("bronze_boots") {
TriadArmorItem("bronze", BRONZE_ARMOR_MATERIAL, ArmorItem.Type.BOOTS)
ArmorItem(BRONZE_ARMOR_MATERIAL, ArmorItem.Type.BOOTS, Item.Properties())
}
val STEEL_PICKAXE: Item by registerItem("steel_pickaxe") {
PickaxeItem(Tiers.DIAMOND, Item.Properties())
Expand All @@ -133,16 +133,16 @@ object TriadItems {
HoeItem(Tiers.DIAMOND, Item.Properties())
}
val STEEL_CHESTPLATE: Item by registerItem("steel_chestplate") {
TriadArmorItem("steel", STEEL_ARMOR_MATERIAL, ArmorItem.Type.CHESTPLATE)
ArmorItem(STEEL_ARMOR_MATERIAL, ArmorItem.Type.CHESTPLATE, Item.Properties())
}
val STEEL_HELMET: Item by registerItem("steel_helmet") {
TriadArmorItem("steel", STEEL_ARMOR_MATERIAL, ArmorItem.Type.HELMET)
ArmorItem(STEEL_ARMOR_MATERIAL, ArmorItem.Type.HELMET, Item.Properties())
}
val STEEL_LEGGINGS: Item by registerItem("steel_leggings") {
TriadArmorItem("steel", STEEL_ARMOR_MATERIAL, ArmorItem.Type.LEGGINGS)
ArmorItem(STEEL_ARMOR_MATERIAL, ArmorItem.Type.LEGGINGS, Item.Properties())
}
val STEEL_BOOTS: Item by registerItem("steel_boots") {
TriadArmorItem("steel", STEEL_ARMOR_MATERIAL, ArmorItem.Type.BOOTS)
ArmorItem(STEEL_ARMOR_MATERIAL, ArmorItem.Type.BOOTS, Item.Properties())
}

private fun registerArmorMaterial(name: String, material: Supplier<ArmorMaterial>) = ARMOR_MATERIAL_REGISTRY.register(name, material)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,7 @@
"ingredient": {
"tag": "c:dusts/bronze"
},
"result": "triad:bronze_ingot"
"result": {
"id": "triad:bronze_ingot"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,7 @@
"ingredient": {
"tag": "c:dusts/copper"
},
"result": "minecraft:copper_ingot"
"result": {
"id": "minecraft:copper_ingot"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,7 @@
"ingredient": {
"tag": "c:dusts/gold"
},
"result": "minecraft:gold_ingot"
"result": {
"id": "minecraft:gold_ingot"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,7 @@
"ingredient": {
"tag": "c:dusts/iron"
},
"result": "minecraft:iron_ingot"
"result": {
"id": "minecraft:iron_ingot"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,7 @@
"ingredient": {
"tag": "c:dusts/steel"
},
"result": "triad:steel_ingot"
"result": {
"id": "triad:steel_ingot"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,7 @@
"ingredient": {
"tag": "c:raw_materials/tin"
},
"result": "triad:tin_ingot"
"result": {
"id": "triad:tin_ingot"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,7 @@
"ingredient": {
"tag": "c:dusts/tin"
},
"result": "triad:tin_ingot"
"result": {
"id": "triad:tin_ingot"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,7 @@
"ingredient": {
"tag": "c:ores/tin"
},
"result": "triad:tin_ingot"
"result": {
"id": "triad:tin_ingot"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
"#$#"
],
"result": {
"item": "minecraft:blast_furnace"
"id": "minecraft:blast_furnace"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
" @ "
],
"result": {
"item": "triad:bronze_axe"
"id": "triad:bronze_axe"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
" "
],
"result": {
"item": "triad:bronze_blade"
"id": "triad:bronze_blade"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
"###"
],
"result": {
"item": "triad:bronze_block"
"id": "triad:bronze_block"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
"# #"
],
"result": {
"item": "triad:bronze_boots"
"id": "triad:bronze_boots"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
"###"
],
"result": {
"item": "triad:bronze_chestplate"
"id": "triad:bronze_chestplate"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
"###"
],
"result": {
"item": "triad:bronze_furnace"
"id": "triad:bronze_furnace"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
"#$#"
],
"result": {
"item": "triad:bronze_grinder"
"id": "triad:bronze_grinder"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
" "
],
"result": {
"item": "triad:bronze_helmet"
"id": "triad:bronze_helmet"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
" @ "
],
"result": {
"item": "triad:bronze_hoe"
"id": "triad:bronze_hoe"
}
}
Loading

0 comments on commit 9c24c35

Please sign in to comment.