-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Started on getting all other spawns working Fixed Camel rendering Other stuff
- Loading branch information
1 parent
88677e4
commit 09a6d57
Showing
21 changed files
with
269 additions
and
247 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
37 changes: 37 additions & 0 deletions
37
src/main/java/com/teammetallurgy/atum/client/render/entity/layer/CamelArmorLayer.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,37 @@ | ||
package com.teammetallurgy.atum.client.render.entity.layer; | ||
|
||
import com.mojang.blaze3d.matrix.MatrixStack; | ||
import com.mojang.blaze3d.vertex.IVertexBuilder; | ||
import com.teammetallurgy.atum.Atum; | ||
import com.teammetallurgy.atum.client.model.entity.CamelModel; | ||
import com.teammetallurgy.atum.entity.animal.CamelEntity; | ||
import net.minecraft.client.renderer.IRenderTypeBuffer; | ||
import net.minecraft.client.renderer.RenderType; | ||
import net.minecraft.client.renderer.entity.IEntityRenderer; | ||
import net.minecraft.client.renderer.entity.layers.LayerRenderer; | ||
import net.minecraft.client.renderer.texture.OverlayTexture; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraft.util.ResourceLocation; | ||
|
||
import javax.annotation.Nonnull; | ||
|
||
public class CamelArmorLayer extends LayerRenderer<CamelEntity, CamelModel<CamelEntity>> { | ||
private final CamelModel<CamelEntity> model = new CamelModel<>(0.1F); | ||
|
||
public CamelArmorLayer(IEntityRenderer<CamelEntity, CamelModel<CamelEntity>> entityRenderer) { | ||
super(entityRenderer); | ||
} | ||
|
||
@Override | ||
public void render(@Nonnull MatrixStack matrixStack, @Nonnull IRenderTypeBuffer buffer, int packedLight, CamelEntity camel, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch) { | ||
ItemStack armor = camel.getArmor(); | ||
if (!armor.isEmpty()) { | ||
CamelEntity.ArmorType armorType = CamelEntity.ArmorType.getByItemStack(armor); | ||
this.getEntityModel().copyModelAttributesTo(this.model); | ||
this.model.setLivingAnimations(camel, limbSwing, limbSwingAmount, partialTicks); | ||
this.model.setRotationAngles(camel, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch); | ||
IVertexBuilder ivertexbuilder = buffer.getBuffer(RenderType.getEntityCutoutNoCull(armorType.getTexture())); | ||
this.model.render(matrixStack, ivertexbuilder, packedLight, OverlayTexture.NO_OVERLAY, 1.0F, 1.0F, 1.0F, 1.0F); | ||
} | ||
} | ||
} |
39 changes: 39 additions & 0 deletions
39
src/main/java/com/teammetallurgy/atum/client/render/entity/layer/CamelDecorLayer.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,39 @@ | ||
package com.teammetallurgy.atum.client.render.entity.layer; | ||
|
||
import com.mojang.blaze3d.matrix.MatrixStack; | ||
import com.mojang.blaze3d.vertex.IVertexBuilder; | ||
import com.teammetallurgy.atum.Atum; | ||
import com.teammetallurgy.atum.client.model.entity.CamelModel; | ||
import com.teammetallurgy.atum.entity.animal.CamelEntity; | ||
import net.minecraft.client.renderer.IRenderTypeBuffer; | ||
import net.minecraft.client.renderer.RenderType; | ||
import net.minecraft.client.renderer.entity.IEntityRenderer; | ||
import net.minecraft.client.renderer.entity.layers.LayerRenderer; | ||
import net.minecraft.client.renderer.texture.OverlayTexture; | ||
import net.minecraft.item.DyeColor; | ||
import net.minecraft.util.ResourceLocation; | ||
|
||
import javax.annotation.Nonnull; | ||
|
||
public class CamelDecorLayer extends LayerRenderer<CamelEntity, CamelModel<CamelEntity>> { | ||
private static final ResourceLocation[] CAMEL_DECOR_TEXTURES = new ResourceLocation[]{new ResourceLocation(Atum.MOD_ID, "textures/entity/camel_carpet/camel_carpet_white.png"), new ResourceLocation(Atum.MOD_ID, "textures/entity/camel_carpet/camel_carpet_orange.png"), new ResourceLocation(Atum.MOD_ID, "textures/entity/camel_carpet/camel_carpet_magenta.png"), new ResourceLocation(Atum.MOD_ID, "textures/entity/camel_carpet/camel_carpet_light_blue.png"), new ResourceLocation(Atum.MOD_ID, "textures/entity/camel_carpet/camel_carpet_yellow.png"), new ResourceLocation(Atum.MOD_ID, "textures/entity/camel_carpet/camel_carpet_lime.png"), new ResourceLocation(Atum.MOD_ID, "textures/entity/camel_carpet/camel_carpet_pink.png"), new ResourceLocation(Atum.MOD_ID, "textures/entity/camel_carpet/camel_carpet_gray.png"), new ResourceLocation(Atum.MOD_ID, "textures/entity/camel_carpet/camel_carpet_light_gray.png"), new ResourceLocation(Atum.MOD_ID, "textures/entity/camel_carpet/camel_carpet_cyan.png"), new ResourceLocation(Atum.MOD_ID, "textures/entity/camel_carpet/camel_carpet_purple.png"), new ResourceLocation(Atum.MOD_ID, "textures/entity/camel_carpet/camel_carpet_blue.png"), new ResourceLocation(Atum.MOD_ID, "textures/entity/camel_carpet/camel_carpet_brown.png"), new ResourceLocation(Atum.MOD_ID, "textures/entity/camel_carpet/camel_carpet_green.png"), new ResourceLocation(Atum.MOD_ID, "textures/entity/camel_carpet/camel_carpet_red.png"), new ResourceLocation(Atum.MOD_ID, "textures/entity/camel_carpet/camel_carpet_black.png")}; | ||
private final CamelModel<CamelEntity> model = new CamelModel<>(0.5F); | ||
|
||
public CamelDecorLayer(IEntityRenderer<CamelEntity, CamelModel<CamelEntity>> entityRenderer) { | ||
super(entityRenderer); | ||
} | ||
|
||
@Override | ||
public void render(@Nonnull MatrixStack matrixStack, @Nonnull IRenderTypeBuffer buffer, int packedLight, CamelEntity camel, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch) { | ||
DyeColor dyeColor = camel.getColor(); | ||
ResourceLocation location; | ||
if (dyeColor != null) { | ||
location = CAMEL_DECOR_TEXTURES[dyeColor.getId()]; | ||
|
||
this.getEntityModel().copyModelAttributesTo(this.model); | ||
this.model.setRotationAngles(camel, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch); | ||
IVertexBuilder ivertexbuilder = buffer.getBuffer(RenderType.getEntityCutoutNoCull(location)); | ||
this.model.render(matrixStack, ivertexbuilder, packedLight, OverlayTexture.NO_OVERLAY, 1.0F, 1.0F, 1.0F, 1.0F); | ||
} | ||
} | ||
} |
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
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
Oops, something went wrong.