generated from neoforged/MDK
-
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
f2812e5
commit 28de1a4
Showing
12 changed files
with
89 additions
and
304 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
src/main/java/io/github/realyusufismail/tutorialmod/TutorialMod.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
3 changes: 2 additions & 1 deletion
3
...render/TutorialModShieldItemRenderer.java → ...shield/TutorialModShieldItemRenderer.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
50 changes: 50 additions & 0 deletions
50
...hub/realyusufismail/tutorialmod/client/render/trident/TutorialModTridentItemRenderer.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,50 @@ | ||
package io.github.realyusufismail.tutorialmod.client.render.trident; | ||
|
||
import com.mojang.blaze3d.vertex.PoseStack; | ||
import com.mojang.blaze3d.vertex.VertexConsumer; | ||
import com.mojang.math.Axis; | ||
import io.github.realyusufismail.tutorialmod.TutorialMod; | ||
import net.minecraft.client.model.TridentModel; | ||
import net.minecraft.client.model.geom.ModelLayers; | ||
import net.minecraft.client.renderer.MultiBufferSource; | ||
import net.minecraft.client.renderer.entity.EntityRenderer; | ||
import net.minecraft.client.renderer.entity.EntityRendererProvider; | ||
import net.minecraft.client.renderer.entity.ItemRenderer; | ||
import net.minecraft.client.renderer.texture.OverlayTexture; | ||
import net.minecraft.resources.ResourceLocation; | ||
import net.minecraft.util.Mth; | ||
import net.minecraft.world.entity.projectile.ThrownTrident; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
public class TutorialModTridentItemRenderer extends EntityRenderer<ThrownTrident> { | ||
|
||
private final TridentModel tridentModel; | ||
|
||
public TutorialModTridentItemRenderer(EntityRendererProvider.Context context) { | ||
super(context); | ||
tridentModel = new TridentModel(context.bakeLayer(ModelLayers.TRIDENT)); | ||
} | ||
|
||
@Override | ||
public void render(ThrownTrident pEntity, float pEntityYaw, float pPartialTick, PoseStack pPoseStack, MultiBufferSource pBuffer, int pPackedLight) { | ||
pPoseStack.pushPose(); | ||
pPoseStack.mulPose( | ||
Axis.YP.rotationDegrees(Mth.lerp(pPartialTick, pEntity.yRotO, pEntity.getYRot()) - 90.0f)); | ||
pPoseStack.mulPose( | ||
Axis.ZP.rotationDegrees(Mth.lerp(pPartialTick, pEntity.xRotO, pEntity.getYRot()) + 90.0f)); | ||
VertexConsumer vertexConsumer = | ||
ItemRenderer.getFoilBufferDirect( | ||
pBuffer, | ||
tridentModel.renderType(getTextureLocation(pEntity)), | ||
false, | ||
pEntity.isFoil()); | ||
tridentModel.renderToBuffer(pPoseStack, vertexConsumer, pPackedLight, OverlayTexture.NO_OVERLAY); | ||
pPoseStack.popPose(); | ||
super.render(pEntity, pEntityYaw, pPartialTick, pPoseStack, pBuffer, pPackedLight); | ||
} | ||
|
||
@Override | ||
public @NotNull ResourceLocation getTextureLocation(ThrownTrident pEntity) { | ||
return ResourceLocation.fromNamespaceAndPath(TutorialMod.MOD_ID, "entity/trident/example_trident"); | ||
} | ||
} |
4 changes: 2 additions & 2 deletions
4
...utorialModShieldItemRendererProvider.java → ...utorialModShieldItemRendererProvider.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
33 changes: 33 additions & 0 deletions
33
...io/github/realyusufismail/tutorialmod/client/trident/TutorialModTridentRendererISTER.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,33 @@ | ||
package io.github.realyusufismail.tutorialmod.client.trident; | ||
|
||
import com.mojang.blaze3d.vertex.PoseStack; | ||
import io.github.realyusufismail.tutorialmod.TutorialMod; | ||
import io.github.realyusufismail.tutorialmod.client.render.ModBlockEntityWithoutLevelRenderer; | ||
import io.github.realyusufismail.tutorialmod.init.ItemInit; | ||
import net.minecraft.client.model.TridentModel; | ||
import net.minecraft.client.model.geom.ModelLayers; | ||
import net.minecraft.client.renderer.MultiBufferSource; | ||
import net.minecraft.client.resources.model.ModelResourceLocation; | ||
import net.minecraft.resources.ResourceLocation; | ||
import net.minecraft.server.packs.resources.ResourceManager; | ||
import net.minecraft.world.item.ItemDisplayContext; | ||
import net.minecraft.world.item.ItemStack; | ||
|
||
public class TutorialModTridentRendererISTER extends ModBlockEntityWithoutLevelRenderer { | ||
|
||
private TridentModel tridentModel; | ||
private final ModelResourceLocation modelResourceLocation = | ||
new ModelResourceLocation(ResourceLocation.fromNamespaceAndPath("tutorialmod", "example_trident"), "example_trident"); | ||
private final ResourceLocation textureLocation = | ||
ResourceLocation.fromNamespaceAndPath(TutorialMod.MOD_ID, "entity/trident/example_trident"); | ||
|
||
@Override | ||
public void onResourceManagerReload(ResourceManager pResourceManager) { | ||
tridentModel = new TridentModel(this.entityModelSet.bakeLayer(ModelLayers.TRIDENT)); | ||
} | ||
|
||
@Override | ||
public void renderByItem(ItemStack pStack, ItemDisplayContext pDisplayContext, PoseStack pPoseStack, MultiBufferSource pBuffer, int pPackedLight, int pPackedOverlay) { | ||
|
||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
src/main/java/io/github/realyusufismail/tutorialmod/items/ModShieldItem.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
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
Binary file added
BIN
+206 Bytes
src/main/resources/assets/tutorialmod/textures/entity/trident/example_trident.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+186 Bytes
src/main/resources/assets/tutorialmod/textures/item/example_trident.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion
1
src/main/resources/assets/tutorialmod/textures/models/trident/Trident.bbmodel
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.