-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
+ fix #28 + add tracer function for infinity bow + update readme + try to fix halo item
- Loading branch information
Showing
58 changed files
with
1,568 additions
and
93 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
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
74 changes: 74 additions & 0 deletions
74
src/main/java/committee/nova/mods/avaritia/client/model/HaloItemModelLoader.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,74 @@ | ||
package committee.nova.mods.avaritia.client.model; | ||
|
||
import com.google.gson.JsonDeserializationContext; | ||
import com.google.gson.JsonObject; | ||
import com.google.gson.JsonParseException; | ||
import it.unimi.dsi.fastutil.Pair; | ||
import it.unimi.dsi.fastutil.ints.IntList; | ||
import net.minecraft.client.renderer.block.model.BakedQuad; | ||
import net.minecraft.client.renderer.block.model.BlockModel; | ||
import net.minecraft.client.renderer.block.model.ItemOverrides; | ||
import net.minecraft.client.renderer.texture.MissingTextureAtlasSprite; | ||
import net.minecraft.client.renderer.texture.TextureAtlasSprite; | ||
import net.minecraft.client.resources.model.*; | ||
import net.minecraft.resources.ResourceLocation; | ||
import net.minecraftforge.client.model.geometry.IGeometryBakingContext; | ||
import net.minecraftforge.client.model.geometry.IGeometryLoader; | ||
import net.minecraftforge.client.model.geometry.IUnbakedGeometry; | ||
|
||
import java.util.HashSet; | ||
import java.util.Objects; | ||
import java.util.function.Function; | ||
|
||
/** | ||
* Name: Avaritia-forge / HaloItemModelLoader | ||
* Author: cnlimiter | ||
* CreateTime: 2023/9/18 23:45 | ||
* Description: | ||
*/ | ||
|
||
public class HaloItemModelLoader implements IGeometryLoader<HaloItemModelLoader.HaloItemModel> { | ||
|
||
|
||
|
||
@Override | ||
public HaloItemModel read(JsonObject jsonObject, JsonDeserializationContext deserializationContext) throws JsonParseException { | ||
return null; | ||
} | ||
|
||
public static class HaloItemModel implements IUnbakedGeometry<HaloItemModel>{ | ||
private final BlockModel baseModel; | ||
private final IntList layerColors; | ||
private final String texture; | ||
private final int color; | ||
private final int size; | ||
private final boolean pulse; | ||
private Material haloMaterial; | ||
|
||
public HaloItemModel(BlockModel baseModel, IntList layerColors, String texture, int color, int size, boolean pulse) { | ||
this.baseModel = baseModel; | ||
this.layerColors = layerColors; | ||
this.texture = texture; | ||
this.color = color; | ||
this.size = size; | ||
this.pulse = pulse; | ||
} | ||
|
||
@Override | ||
public BakedModel bake(IGeometryBakingContext context, ModelBaker baker, Function<Material, TextureAtlasSprite> spriteGetter, ModelState modelState, ItemOverrides overrides, ResourceLocation modelLocation) { | ||
if (haloMaterial == null){ | ||
HashSet<Material> materials = new HashSet<Material>(); | ||
this.haloMaterial = context.getMaterial(this.texture); | ||
materials.add(this.haloMaterial); | ||
// this.baseModel.resolveParents() | ||
// materials.addAll(); | ||
} | ||
|
||
|
||
return null; | ||
} | ||
|
||
|
||
|
||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
src/main/java/committee/nova/mods/avaritia/client/render/entity/HeavenArrowRender.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
2 changes: 1 addition & 1 deletion
2
src/main/java/committee/nova/mods/avaritia/client/render/entity/HeavenSubArrowRender.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
35 changes: 35 additions & 0 deletions
35
src/main/java/committee/nova/mods/avaritia/client/render/entity/TracerArrowRender.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,35 @@ | ||
package committee.nova.mods.avaritia.client.render.entity; | ||
|
||
import committee.nova.mods.avaritia.Static; | ||
import committee.nova.mods.avaritia.common.entity.arrow.HeavenArrowEntity; | ||
import committee.nova.mods.avaritia.common.entity.arrow.TraceArrowEntity; | ||
import net.minecraft.client.renderer.entity.ArrowRenderer; | ||
import net.minecraft.client.renderer.entity.EntityRendererProvider; | ||
import net.minecraft.resources.ResourceLocation; | ||
import net.minecraftforge.api.distmarker.Dist; | ||
import net.minecraftforge.api.distmarker.OnlyIn; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
/** | ||
* Description: | ||
* Author: cnlimiter | ||
* Date: 2022/4/20 18:54 | ||
* Version: 1.0 | ||
*/ | ||
@OnlyIn(Dist.CLIENT) | ||
public class TracerArrowRender extends ArrowRenderer<TraceArrowEntity> { | ||
|
||
private static final ResourceLocation tex = new ResourceLocation(Static.MOD_ID, "textures/entity/heavenarrow.png"); | ||
|
||
|
||
public TracerArrowRender(EntityRendererProvider.Context p_174008_) { | ||
super(p_174008_); | ||
} | ||
|
||
@Override | ||
public @NotNull ResourceLocation getTextureLocation(@NotNull TraceArrowEntity entity) { | ||
return tex; | ||
} | ||
|
||
|
||
} |
Oops, something went wrong.