Skip to content

Commit

Permalink
hammer somewhat renders
Browse files Browse the repository at this point in the history
  • Loading branch information
RealYusufIsmail committed Oct 17, 2023
1 parent ecfc229 commit ffbb91e
Show file tree
Hide file tree
Showing 6 changed files with 944 additions and 947 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ class ArmourAndToolsMod {
// register entity renderers
bus.addListener(ClientSetup::registerEntityRenders)
// register click event
FORGE_BUS.addListener(ClientSetup::rightClickEmpty)
FORGE_BUS.addListener(ClientSetup::rightClickBlock)
FORGE_BUS.addListener(ClientSetup::leftClickBlock)
FORGE_BUS.addListener(ClientSetup::leftClickEmpty)
FORGE_BUS.addListener(ClientSetup::clickEntity)

FORGE_BUS.register(this)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ object ClientSetup {
EntityTypeInit.MJOLNIR_THROWN_TRIDENT.get(), ::MjolnirItemRenderer)
}

fun rightClickBlock(event: PlayerInteractEvent.RightClickBlock) {
fun leftClickBlock(event: PlayerInteractEvent.LeftClickBlock) {
if (event.itemStack.item == ItemInit.MJOLNIR.get()) {
fireLightningBolt(event)
}
Expand All @@ -139,7 +139,7 @@ object ClientSetup {
}
}

fun rightClickEmpty(event: PlayerInteractEvent.RightClickEmpty) {
fun leftClickEmpty(event: PlayerInteractEvent.LeftClickEmpty) {
if (event.itemStack.item == ItemInit.MJOLNIR.get()) {
fireLightningBolt(event)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,18 @@
*/
package io.github.realyusufismail.armourandtoolsmod.client.renderer.hammer

import io.github.realyusufismail.armourandtoolsmod.ArmourAndToolsMod
import io.github.realyusufismail.armourandtoolsmod.client.renderer.trident.ArmourToolsModTridentItemRenderer
import io.github.realyusufismail.armourandtoolsmod.common.entity.ArmourToolsModTridentEntity
import io.github.realyusufismail.armourandtoolsmod.core.init.ItemInit
import net.minecraft.client.renderer.entity.EntityRendererProvider
import net.minecraft.data.models.model.ModelLocationUtils
import net.minecraft.resources.ResourceLocation

class MjolnirItemRenderer(context: EntityRendererProvider.Context) :
ArmourToolsModTridentItemRenderer(context) {
private val location: ResourceLocation =
ArmourAndToolsMod.getModIdAndName("textures/item/mjolnir/all.png")

override fun getTextureLocation(pEntity: ArmourToolsModTridentEntity): ResourceLocation {
// this item consists of multiple textures, so we need to return the mode
return ModelLocationUtils.getModelLocation(ItemInit.MJOLNIR.get())
return location
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,18 @@ package io.github.realyusufismail.armourandtoolsmod.client.renderer.hammer

import io.github.realyusufismail.armourandtoolsmod.ArmourAndToolsMod
import io.github.realyusufismail.armourandtoolsmod.client.renderer.trident.ister.ArmourToolsModTridentRendererISTER
import io.github.realyusufismail.armourandtoolsmod.core.init.ItemInit
import net.minecraft.client.resources.model.ModelResourceLocation
import net.minecraft.data.models.model.ModelLocationUtils
import net.minecraft.resources.ResourceLocation

class MjolnirItemRendererISTER() : ArmourToolsModTridentRendererISTER() {
class MjolnirItemRendererISTER : ArmourToolsModTridentRendererISTER() {
private val location: ResourceLocation =
ArmourAndToolsMod.getModIdAndName("textures/item/mjolnir/all.png")

override fun getModelResourceLocation(): ModelResourceLocation {
return ModelResourceLocation(ArmourAndToolsMod.getModIdAndName("mjolnir"), "inventory")
}

override fun getTextureLocation(): ResourceLocation {
return ModelLocationUtils.getModelLocation(ItemInit.MJOLNIR.get())
return location
}
}
Loading

0 comments on commit ffbb91e

Please sign in to comment.