Skip to content

Commit

Permalink
first try of adding an entity
Browse files Browse the repository at this point in the history
Flame spren. basically a zelda fairy.  trying to make it act kinda like a minecraft bee. Not yet working as intended.
  • Loading branch information
leafreynolds committed Jun 2, 2021
1 parent d82d85e commit 2be19f9
Show file tree
Hide file tree
Showing 17 changed files with 1,065 additions and 4 deletions.
74 changes: 74 additions & 0 deletions blockbench/SprenFlameModel.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
// Made with Blockbench 3.8.3
// Exported for Minecraft version 1.15 - 1.16
// Paste this class into your mod and generate all required imports


public class SprenFlameModel extends EntityModel<Entity> {
private final ModelRenderer body;
private final ModelRenderer wingLeft;
private final ModelRenderer wingLeftUpper_r1;
private final ModelRenderer wingLeftLower_r1;
private final ModelRenderer wingRight;
private final ModelRenderer wingRightLower_r1;
private final ModelRenderer wingRightUpper_r1;

public SprenFlameModel() {
textureWidth = 16;
textureHeight = 16;

body = new ModelRenderer(this);
body.setRotationPoint(0.0F, 24.0F, 0.0F);
body.setTextureOffset(0, 0).addBox(-2.0F, -4.0F, 0.0F, 4.0F, 4.0F, 0.0F, 0.0F, false);
body.setTextureOffset(0, 0).addBox(-1.0F, -3.0F, -1.0F, 2.0F, 2.0F, 2.0F, 0.0F, false);

wingLeft = new ModelRenderer(this);
wingLeft.setRotationPoint(0.0F, 0.0F, 0.0F);
body.addChild(wingLeft);


wingLeftUpper_r1 = new ModelRenderer(this);
wingLeftUpper_r1.setRotationPoint(0.0F, 0.0F, 0.0F);
wingLeft.addChild(wingLeftUpper_r1);
setRotationAngle(wingLeftUpper_r1, 0.0F, 0.7854F, -0.1745F);
wingLeftUpper_r1.setTextureOffset(0, 0).addBox(1.0F, -3.75F, 1.0F, 4.0F, 3.0F, 0.0F, 0.0F, false);

wingLeftLower_r1 = new ModelRenderer(this);
wingLeftLower_r1.setRotationPoint(0.0F, 0.0F, 0.0F);
wingLeft.addChild(wingLeftLower_r1);
setRotationAngle(wingLeftLower_r1, 0.0F, 0.3491F, 0.0F);
wingLeftLower_r1.setTextureOffset(0, 0).addBox(0.5F, -1.0F, 0.0F, 3.0F, 2.0F, 0.0F, 0.0F, false);

wingRight = new ModelRenderer(this);
wingRight.setRotationPoint(0.0F, 0.0F, 0.0F);
body.addChild(wingRight);


wingRightLower_r1 = new ModelRenderer(this);
wingRightLower_r1.setRotationPoint(0.0F, 0.0F, 0.0F);
wingRight.addChild(wingRightLower_r1);
setRotationAngle(wingRightLower_r1, 0.0F, -0.3491F, 0.0F);
wingRightLower_r1.setTextureOffset(0, 0).addBox(-3.5F, -1.0F, 0.0F, 3.0F, 2.0F, 0.0F, 0.0F, false);

wingRightUpper_r1 = new ModelRenderer(this);
wingRightUpper_r1.setRotationPoint(0.0F, 0.0F, 0.0F);
wingRight.addChild(wingRightUpper_r1);
setRotationAngle(wingRightUpper_r1, 0.0F, -0.7854F, 0.1745F);
wingRightUpper_r1.setTextureOffset(0, 0).addBox(-5.0F, -3.75F, 1.0F, 4.0F, 3.0F, 0.0F, 0.0F, false);
}

@Override
public void setRotationAngles(Entity entity, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch){
//previously the render function, render code was moved to a method below
}

@Override
public void render(MatrixStack matrixStack, IVertexBuilder buffer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha){
body.render(matrixStack, buffer, packedLight, packedOverlay);
}

public void setRotationAngle(ModelRenderer modelRenderer, float x, float y, float z) {
modelRenderer.rotateAngleX = x;
modelRenderer.rotateAngleY = y;
modelRenderer.rotateAngleZ = z;
}
}
1 change: 1 addition & 0 deletions blockbench/master_sword.bbmodel
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"meta":{"format_version":"3.6","creation_time":1622580956,"model_format":"java_block","box_uv":false},"name":"master_sword","parent":"forge:item/default","ambientocclusion":true,"front_gui_light":false,"visible_box":[1,1,0],"resolution":{"width":16,"height":16},"elements":[{"name":"blade","rescale":false,"from":[5.999999999999997,13,8.000000000000004],"to":[9.999999999999998,30,8.000000000000004],"autouv":0,"color":7,"locked":false,"origin":[7.999999999999998,21.5,8.000000000000004],"faces":{"north":{"uv":[0,0,3,16],"texture":0},"east":{"uv":[0,0,1,16],"texture":0},"south":{"uv":[0,0,3,16],"texture":0},"west":{"uv":[0,0,1,16],"texture":0},"up":{"uv":[0,0,1,3],"rotation":90,"texture":0},"down":{"uv":[0,0,1,3],"rotation":270,"texture":0}},"uuid":"aaf79074-d592-8e4e-a28b-df4c4687ed74"},{"name":"handguard_inner","rescale":false,"from":[5.499999999999989,9,7.000000000000005],"to":[10.499999999999991,11,9.000000000000005],"autouv":0,"color":7,"locked":false,"origin":[7.99999999999999,10,8.000000000000005],"faces":{"north":{"uv":[13,0,16,3],"texture":0},"east":{"uv":[13,0,16,1],"texture":0},"south":{"uv":[13,0,16,3],"texture":0},"west":{"uv":[13,0,16,1],"texture":0},"up":{"uv":[13,0,16,3],"rotation":270,"texture":0},"down":{"uv":[13,0,16,3],"rotation":90,"texture":0}},"uuid":"a5ffbf16-796c-1a30-5ed1-f1d7d469cbbb"},{"name":"pommel","rescale":false,"from":[6,0,8.000000000000005],"to":[10,3,8.000000000000005],"autouv":0,"color":7,"locked":false,"origin":[8,1.5,8.000000000000005],"faces":{"north":{"uv":[13,12,16,16],"texture":0},"east":{"uv":[13,14,16,16],"texture":0},"south":{"uv":[13,12,16,16],"texture":0},"west":{"uv":[13,14,16,16],"texture":0},"up":{"uv":[13,11,16,14],"texture":0},"down":{"uv":[13,11,16,14],"texture":0}},"uuid":"bc97d4b7-36ef-852f-dec5-55ea442c2128"},{"name":"blade","rescale":false,"from":[6.9999999999999964,12,7.500000000000005],"to":[8.999999999999996,31,8.500000000000005],"autouv":0,"color":7,"locked":false,"origin":[7.9999999999999964,21.5,8.000000000000005],"faces":{"north":{"uv":[0,0,2,16],"texture":0},"east":{"uv":[0,0,1,16],"texture":0},"south":{"uv":[0,0,2,16],"texture":0},"west":{"uv":[0,0,1,16],"texture":0},"up":{"uv":[0,0,1,2],"rotation":90,"texture":0},"down":{"uv":[0,0,1,2],"rotation":270,"texture":0}},"uuid":"fb1e8b98-517b-5524-cdea-9b2caeeaa4a0"},{"name":"handguard_inner","rescale":false,"from":[6,11,7.500000000000005],"to":[10.000000000000002,12,8.500000000000005],"autouv":0,"color":7,"locked":false,"origin":[8,11.5,8.000000000000005],"faces":{"north":{"uv":[13,0,16,1],"texture":0},"east":{"uv":[13,0,16,1],"texture":0},"south":{"uv":[13,0,16,1],"texture":0},"west":{"uv":[13,0,16,1],"texture":0},"up":{"uv":[13,0,16,3],"rotation":270,"texture":0},"down":{"uv":[13,0,16,3],"rotation":90,"texture":0}},"uuid":"883a5785-e5e6-c31c-e221-c7cb0c5f33bf"},{"name":"handguard_inner","rescale":false,"from":[4,9.250000000000004,7.500000000000005],"to":[12.000000000000002,10.250000000000004,8.500000000000005],"autouv":0,"color":7,"locked":false,"origin":[8,9.750000000000004,8.000000000000005],"faces":{"north":{"uv":[13,0,16,1],"texture":0},"east":{"uv":[13,0,16,1],"texture":0},"south":{"uv":[13,0,16,1],"texture":0},"west":{"uv":[13,0,16,1],"texture":0},"up":{"uv":[13,0,16,3],"rotation":270,"texture":0},"down":{"uv":[13,0,16,3],"rotation":90,"texture":0}},"uuid":"aa42abed-b866-408e-11f1-626ee673c252"},{"name":"handle","rescale":false,"from":[7.5123685207504,2,7.470139749457896],"to":[8.5123685207504,9,8.470139749457896],"autouv":0,"color":6,"locked":false,"rotation":[0,45,0],"origin":[8.012368520750398,5.5,7.970139749457895],"faces":{"north":{"uv":[5,8,6,15],"texture":0},"east":{"uv":[5,8,6,15],"texture":0},"south":{"uv":[5,8,6,15],"texture":0},"west":{"uv":[5,8,6,15],"texture":0},"up":{"uv":[5,8,6,9],"rotation":90,"texture":0},"down":{"uv":[5,9,6,10],"rotation":270,"texture":0}},"uuid":"0731ae31-28f7-d982-a3e4-805690efc839"},{"name":"handle","rescale":false,"from":[7.499999999999997,2,7.500000000000005],"to":[8.499999999999998,9,8.500000000000005],"autouv":0,"color":6,"locked":false,"origin":[7.999999999999998,5.5,8.000000000000005],"faces":{"north":{"uv":[5,8,6,15],"texture":0},"east":{"uv":[5,8,6,15],"texture":0},"south":{"uv":[5,8,6,15],"texture":0},"west":{"uv":[5,8,6,15],"texture":0},"up":{"uv":[5,8,6,9],"texture":0},"down":{"uv":[5,9,6,10],"texture":0}},"uuid":"96fefb0e-5486-4393-d862-bffd945afee4"},{"name":"pommel","rescale":false,"from":[3,9.5,8.000000000000005],"to":[5,11.5,8.000000000000005],"autouv":0,"color":7,"locked":false,"origin":[4,10.5,8.000000000000005],"faces":{"north":{"uv":[13,13,15,15],"texture":0},"east":{"uv":[13,14,16,16],"texture":0},"south":{"uv":[14,13,16,15],"texture":0},"west":{"uv":[13,14,16,16],"texture":0},"up":{"uv":[13,11,16,14],"texture":0},"down":{"uv":[13,11,16,14],"texture":0}},"uuid":"12e58443-e2c0-5f50-f9aa-21160e16e7db"},{"name":"pommel","rescale":false,"from":[11,9.5,8.000000000000005],"to":[13,11.5,8.000000000000005],"autouv":0,"color":7,"locked":false,"origin":[12,10.5,8.000000000000005],"faces":{"north":{"uv":[14,13,16,15],"texture":0},"east":{"uv":[13,14,16,16],"texture":0},"south":{"uv":[13,13,15,15],"texture":0},"west":{"uv":[13,14,16,16],"texture":0},"up":{"uv":[13,11,16,14],"rotation":180,"texture":0},"down":{"uv":[13,11,16,14],"rotation":180,"texture":0}},"uuid":"e775309d-8d24-b350-1447-2e553965117f"}],"outliner":[{"name":"blade","origin":[8,8,8],"uuid":"beb6a69e-5040-5673-3714-d017e0029a6f","export":true,"isOpen":true,"locked":false,"visibility":true,"autouv":0,"children":["aaf79074-d592-8e4e-a28b-df4c4687ed74","fb1e8b98-517b-5524-cdea-9b2caeeaa4a0","a5ffbf16-796c-1a30-5ed1-f1d7d469cbbb","883a5785-e5e6-c31c-e221-c7cb0c5f33bf","aa42abed-b866-408e-11f1-626ee673c252","0731ae31-28f7-d982-a3e4-805690efc839","96fefb0e-5486-4393-d862-bffd945afee4","bc97d4b7-36ef-852f-dec5-55ea442c2128","12e58443-e2c0-5f50-f9aa-21160e16e7db","e775309d-8d24-b350-1447-2e553965117f"]}],"textures":[{"path":"","name":"Shardblade_blue","folder":"block","namespace":"","id":"1","particle":true,"visible":true,"mode":"bitmap","saved":false,"uuid":"db0555e9-6e9e-c8b2-f6e1-d38f4235504d","source":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAsElEQVQ4T2N88vL/fwYGBoab104xODuaM4LYhIC1Wx5YDwgwkmvA3GmcDMlZ38k3AMUFIOeDALFeQPYi2AuD1wAnJyd4aO/btw9rDNHGC55hnf+3ryonKk1gdQHFBoBS2tFdk4hzwd79J+EBBUsHhFyAHLiM5BgAciH7nysMP1l0GLAaQMgLGJmpu7udwc/bGZ6UCXkBJP/pw1MGPgFpBsb8kjZwGCAbQCg7g+RhlgAASjKeoxXtPPAAAAAASUVORK5CYII="}],"display":{"thirdperson_righthand":{"rotation":[0,90,0],"translation":[-0.5,0.75,0]},"thirdperson_lefthand":{"rotation":[0,90,0],"translation":[-0.5,0.75,0]},"firstperson_righthand":{"rotation":[0,90,0]},"firstperson_lefthand":{"rotation":[0,90,0]},"ground":{"translation":[0,4,0]},"gui":{"rotation":[0,0,-45],"translation":[-3.5,-3.5,-2],"scale":[0.67,0.67,0.67]},"head":{"rotation":[50,0,0],"translation":[0,2.75,0]},"fixed":{"rotation":[0,0,46],"translation":[4.5,-3.75,-1.25],"scale":[0.78,0.78,0.78]}}}
1 change: 1 addition & 0 deletions blockbench/spren_fire.bbmodel
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"meta":{"format_version":"3.6","creation_time":1622597082,"model_format":"modded_entity","box_uv":true},"name":"SprenFlameModel","geometry_name":"SprenFlameModel","modded_entity_version":"1.15","visible_box":[1,1,0],"layered_textures":false,"resolution":{"width":16,"height":16},"elements":[{"name":"body","rescale":false,"from":[-1,1,-1],"to":[1,3,1],"autouv":1,"color":1,"locked":false,"origin":[0,0,0],"faces":{"north":{"uv":[2,2,4,4],"texture":0},"east":{"uv":[0,2,2,4],"texture":0},"south":{"uv":[6,2,8,4],"texture":0},"west":{"uv":[4,2,6,4],"texture":0},"up":{"uv":[4,2,2,0],"texture":0},"down":{"uv":[6,0,4,2],"texture":0}},"uuid":"76456099-bf80-da7d-c86c-3e64e97c9b8d"},{"name":"shine","rescale":false,"from":[-2,0,0],"to":[2,4,0],"autouv":1,"color":7,"locked":false,"origin":[0,0,0],"faces":{"north":{"uv":[0,0,4,4],"texture":0},"east":{"uv":[0,0,0,4],"texture":null},"south":{"uv":[4,0,8,4],"texture":0},"west":{"uv":[4,0,4,4],"texture":null},"up":{"uv":[4,0,0,0],"texture":null},"down":{"uv":[8,0,4,0],"texture":null}},"uuid":"e28a7c06-90aa-4575-1208-6b2714fd258c"},{"name":"wingLeftUpper","rescale":false,"from":[-5,0.75,1],"to":[-1,3.75,1],"autouv":0,"color":3,"locked":false,"rotation":[0,-45,-10],"origin":[0,0,0],"faces":{"north":{"uv":[0,0,4,3],"texture":0},"east":{"uv":[0,0,0,3],"texture":null},"south":{"uv":[4,0,8,3],"texture":0},"west":{"uv":[4,0,4,3],"texture":null},"up":{"uv":[4,0,0,0],"texture":null},"down":{"uv":[8,0,4,0],"texture":null}},"uuid":"efc5a28f-b378-2f8c-f3ab-ac469e9dd76a"},{"name":"wingLeftLower","rescale":false,"from":[-3.5,-1,0],"to":[-0.5,1,0],"autouv":0,"color":3,"locked":false,"rotation":[0,-20,0],"origin":[0,0,0],"faces":{"north":{"uv":[0,0,3,2],"texture":0},"east":{"uv":[0,0,0,2],"texture":null},"south":{"uv":[3,0,6,2],"texture":0},"west":{"uv":[3,0,3,2],"texture":null},"up":{"uv":[3,0,0,0],"texture":null},"down":{"uv":[6,0,3,0],"texture":null}},"uuid":"8ed175c2-6275-2364-2a0f-27ec59dd7f1e"},{"name":"wingRightLower","rescale":false,"from":[0.5,-1,0],"to":[3.5,1,0],"autouv":1,"color":3,"locked":false,"rotation":[0,20,0],"origin":[0,0,0],"faces":{"north":{"uv":[0,0,3,2],"texture":0},"east":{"uv":[0,0,0,2],"texture":null},"south":{"uv":[3,0,6,2],"texture":0},"west":{"uv":[3,0,3,2],"texture":null},"up":{"uv":[3,0,0,0],"texture":null},"down":{"uv":[6,0,3,0],"texture":null}},"uuid":"0e9a6c15-eb66-f416-2f3d-e765a2af7d15"},{"name":"wingRightUpper","rescale":false,"from":[1,0.75,1],"to":[5,3.75,1],"autouv":1,"color":3,"locked":false,"rotation":[0,45,10],"origin":[0,0,0],"faces":{"north":{"uv":[0,0,4,3],"texture":0},"east":{"uv":[0,0,0,3],"texture":null},"south":{"uv":[4,0,8,3],"texture":0},"west":{"uv":[4,0,4,3],"texture":null},"up":{"uv":[4,0,0,0],"texture":null},"down":{"uv":[8,0,4,0],"texture":null}},"uuid":"61d19791-1533-5adc-2150-1c2b8d078428"}],"outliner":[{"name":"body","origin":[0,0,0],"uuid":"68bafcc8-aa5d-7fce-2ecc-65ebdae04cc0","export":true,"isOpen":true,"locked":false,"visibility":true,"autouv":0,"children":["e28a7c06-90aa-4575-1208-6b2714fd258c","76456099-bf80-da7d-c86c-3e64e97c9b8d",{"name":"wingLeft","origin":[0,0,0],"uuid":"d6df0177-9765-a781-64a7-7d03cd044f0b","export":true,"isOpen":true,"locked":false,"visibility":true,"autouv":0,"children":["8ed175c2-6275-2364-2a0f-27ec59dd7f1e","efc5a28f-b378-2f8c-f3ab-ac469e9dd76a"]},{"name":"wingRight","origin":[0,0,0],"uuid":"05622feb-c442-384d-0344-83e77361c874","export":true,"isOpen":false,"locked":false,"visibility":true,"autouv":0,"children":["61d19791-1533-5adc-2150-1c2b8d078428","0e9a6c15-eb66-f416-2f3d-e765a2af7d15"]}]}],"textures":[{"path":"E:\\Repo\\LabDay\\Minecraft\\cosmere\\src\\main\\resources\\assets\\cosmere\\textures\\entity\\firespren.png","name":"firespren.png","folder":"entity","namespace":"cosmere","id":"0","particle":false,"visible":true,"mode":"bitmap","saved":true,"uuid":"d91cae4f-85f7-fdf6-90bc-7d2980ed15dc","source":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAO0lEQVQ4T2M8nWLznwEPMJl9mKGi+S5OFYzDwID////jDQOQ5/GGwdAwILtgMu5oJMYLowYwMAzzMAAAd1hZl8Uc/pMAAAAASUVORK5CYII="}]}
2 changes: 1 addition & 1 deletion src/main/generated/.cache/cache
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ edaa7877000a497242bfd5901b6773cfa26fc309 assets/cosmere/blockstates/tin_block.js
b118f65ac1078511bdff353013a20ebe62732b22 assets/cosmere/blockstates/tin_ore.json
edaa7877000a497242bfd5901b6773cfa26fc309 assets/cosmere/blockstates/zinc_block.json
b118f65ac1078511bdff353013a20ebe62732b22 assets/cosmere/blockstates/zinc_ore.json
1d56a6a8128ca5b3d38fb47c6061caf4cc5515cf assets/cosmere/lang/en_us.json
36eca81a90d2cd07b2a287cd22cedf54a038d66d assets/cosmere/lang/en_us.json
e9fe228cb639a8823d11fe37d1d1b079e9bd4cb7 assets/cosmere/models/block/gem_block.json
b66394816822b5feda05810c580e11ddb986f4a0 assets/cosmere/models/block/metal_block.json
645553d67807b60210c1bfae147ccd31ec88eaf0 assets/cosmere/models/block/ore_block.json
Expand Down
2 changes: 2 additions & 0 deletions src/main/generated/assets/cosmere/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
"effect.cosmere.tapping_steel": "Tapping Steel",
"effect.cosmere.tapping_tin": "Tapping Tin",
"effect.cosmere.tapping_zinc": "Tapping Zinc",
"entity.cosmere.spren_flame": "Spren Flame",
"gui.cosmere.button.back": "Back",
"gui.cosmere.cancel": "> Cancel",
"gui.cosmere.confirm": "> Confirm",
Expand Down Expand Up @@ -214,6 +215,7 @@
"item.cosmere.steel_nugget": "Steel Nugget",
"item.cosmere.steel_ring_metalmind": "Steel Ring Metalmind",
"item.cosmere.steel_spike": "Steel Spike",
"item.cosmere.test_blade": "Test Blade",
"item.cosmere.tin_bracelet_metalmind": "Tin Bracelet Metalmind",
"item.cosmere.tin_ingot": "Tin Ingot",
"item.cosmere.tin_necklace_metalmind": "Tin Necklace Metalmind",
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/leaf/cosmere/Cosmere.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ public Cosmere()
LootModifierRegistry.LOOT_MODIFIERS.register(modBus);
ManifestationRegistry.MANIFESTATIONS.register(modBus);
AttributesRegistry.ATTRIBUTES.register(modBus);
EntityRegistry.ENTITIES.register(modBus);

FeatureRegistry.FEATURES.register(modBus);
RecipeRegistry.SPECIAL_RECIPES.register(modBus);
Expand All @@ -66,6 +67,7 @@ private void commonSetup(FMLCommonSetupEvent event)
event.enqueueWork(() ->
{
FeatureRegistry.registerConfiguredFeatures();
EntityRegistry.PrepareEntityAttributes();
});

//Entity Caps
Expand Down
6 changes: 5 additions & 1 deletion src/main/java/leaf/cosmere/client/ClientSetup.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@

import leaf.cosmere.Cosmere;
import leaf.cosmere.client.gui.SpriteIconPositioning;
import leaf.cosmere.client.renderer.entity.*;
import leaf.cosmere.constants.Metals;
import leaf.cosmere.registry.*;
import leaf.cosmere.utils.helpers.LogHelper;
import leaf.cosmere.utils.helpers.ResourceLocationHelper;
import leaf.cosmere.manifestation.AManifestation;
import leaf.cosmere.registry.ManifestationRegistry;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.client.renderer.RenderTypeLookup;
Expand All @@ -22,6 +23,7 @@
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.client.event.TextureStitchEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.client.registry.*;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;

Expand Down Expand Up @@ -51,6 +53,8 @@ public static void init(final FMLClientSetupEvent event)
RenderTypeLookup.setRenderLayer(metalType.getOreBlock(), cutoutMipped);
}

RenderingRegistry.registerEntityRenderingHandler(EntityRegistry.SPREN_FIRE.get(), SprenFlameRenderer::new);

LogHelper.info("Client setup complete!");
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package leaf.cosmere.client.renderer.entity;

import com.mojang.blaze3d.matrix.*;
import leaf.cosmere.client.renderer.entity.model.*;
import leaf.cosmere.entities.spren.*;
import leaf.cosmere.utils.helpers.*;
import net.minecraft.client.renderer.entity.*;
import net.minecraft.util.*;
import net.minecraft.util.math.MathHelper;
import net.minecraftforge.api.distmarker.*;

@OnlyIn(Dist.CLIENT)
public class SprenFlameRenderer extends MobRenderer<SprenFlameEntity, SprenFlameModel<SprenFlameEntity>>
{
private static final ResourceLocation FIRE_SPREN_TEXTURES = ResourceLocationHelper.prefix("textures/entity/spren_flame.png");

public SprenFlameRenderer(EntityRendererManager renderManagerIn)
{
super(renderManagerIn, new SprenFlameModel(), 0.25F);
}

/**
* Returns the location of an entity's texture.
*/
public ResourceLocation getEntityTexture(SprenFlameEntity entity)
{
return FIRE_SPREN_TEXTURES;
}

protected void preRenderCallback(SprenFlameEntity entitylivingbaseIn, MatrixStack matrixStackIn, float partialTickTime)
{
matrixStackIn.scale(0.8F, 0.8F, 0.8F);
}

protected void applyRotations(SprenFlameEntity entityLiving, MatrixStack matrixStackIn, float ageInTicks, float rotationYaw, float partialTicks)
{
matrixStackIn.translate(0.0D, (double) (MathHelper.cos(ageInTicks * 0.3F) * 0.1F), 0.0D);
super.applyRotations(entityLiving, matrixStackIn, ageInTicks, rotationYaw, partialTicks);
}
}
Loading

0 comments on commit 2be19f9

Please sign in to comment.