generated from NeoForgeMDKs/MDK-1.21-NeoGradle
-
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
Showing
7 changed files
with
65 additions
and
5 deletions.
There are no files selected for viewing
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,5 @@ | ||
{ | ||
"values": [ | ||
"nmt:obsidian_tipped_arrow" | ||
] | ||
} |
22 changes: 22 additions & 0 deletions
22
src/main/java/net/nova/nmt/client/renderer/entity/ObsidianTippableArrowRenderer.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,22 @@ | ||
package net.nova.nmt.client.renderer.entity; | ||
|
||
import net.minecraft.client.renderer.entity.ArrowRenderer; | ||
import net.minecraft.client.renderer.entity.EntityRendererProvider; | ||
import net.minecraft.resources.ResourceLocation; | ||
import net.minecraft.world.entity.projectile.Arrow; | ||
import net.neoforged.api.distmarker.Dist; | ||
import net.neoforged.api.distmarker.OnlyIn; | ||
|
||
@OnlyIn(Dist.CLIENT) | ||
public class ObsidianTippableArrowRenderer extends ArrowRenderer<Arrow> { | ||
public static final ResourceLocation NORMAL_ARROW_LOCATION = ResourceLocation.withDefaultNamespace("textures/entity/projectiles/arrow.png"); | ||
public static final ResourceLocation TIPPED_ARROW_LOCATION = ResourceLocation.withDefaultNamespace("textures/entity/projectiles/tipped_arrow.png"); | ||
|
||
public ObsidianTippableArrowRenderer(EntityRendererProvider.Context context) { | ||
super(context); | ||
} | ||
|
||
public ResourceLocation getTextureLocation(Arrow entity) { | ||
return entity.getColor() > 0 ? TIPPED_ARROW_LOCATION : NORMAL_ARROW_LOCATION; | ||
} | ||
} |
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
23 changes: 23 additions & 0 deletions
23
src/main/java/net/nova/nmt/data/tags/NMTItemTagsProvider.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,23 @@ | ||
package net.nova.nmt.data.tags; | ||
|
||
import net.minecraft.core.HolderLookup; | ||
import net.minecraft.data.PackOutput; | ||
import net.minecraft.data.tags.ItemTagsProvider; | ||
import net.minecraft.tags.ItemTags; | ||
import net.neoforged.neoforge.common.data.ExistingFileHelper; | ||
import net.nova.nmt.init.NMTItems; | ||
|
||
import java.util.concurrent.CompletableFuture; | ||
|
||
import static net.nova.nmt.NoMoreThings.MODID; | ||
|
||
public class NMTItemTagsProvider extends ItemTagsProvider { | ||
public NMTItemTagsProvider(PackOutput output, CompletableFuture<HolderLookup.Provider> lookupProvider, NMTBlockTagsProvider provider, ExistingFileHelper existingFileHelper) { | ||
super(output, lookupProvider, provider.contentsGetter(), MODID, existingFileHelper); | ||
} | ||
|
||
@Override | ||
protected void addTags(HolderLookup.Provider provider) { | ||
tag(ItemTags.ARROWS).add(NMTItems.OBSIDIAN_TIPPED_ARROW.get()); | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
src/main/java/net/nova/nmt/entity/projectile/ObsidianTippedArrow.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,11 @@ | ||
package net.nova.nmt.entity.projectile; | ||
|
||
import net.minecraft.world.entity.EntityType; | ||
import net.minecraft.world.entity.projectile.Arrow; | ||
import net.minecraft.world.level.Level; | ||
|
||
public class ObsidianTippedArrow extends Arrow { | ||
public ObsidianTippedArrow(EntityType<? extends Arrow> entityType, Level level) { | ||
super(entityType, level); | ||
} | ||
} |
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