Jump to content

Drachenbauer

Members
  • Posts

    727
  • Joined

  • Last visited

Everything posted by Drachenbauer

  1. I don´t know, where to call it since i don´t have the method any more, where i called it bevore. Can you please tell me, where exactly i can call MatrixStack#scale now?
  2. I created my Entitytypes like this in my EntityTypes-class: public static EntityType<?> STELLA; In 1.14 it worked, and now it still shows no errors there. So i thaught, no changes are needed here.
  3. That was the method in the startpost, but it does not exist any more... This is, why i ask.
  4. I don´t know, where to place this in my code. In the entity-class, or in the renderer-class, and in wich method there?
  5. Hello I have got a problem with the renderingRegistry: An Entity-Class (Stella from my Angry Birds Entities): package drachenbauer32.angrybirdsmod.entities; import drachenbauer32.angrybirdsmod.init.AngryBirdsEntities; import net.minecraft.entity.AgeableEntity; import net.minecraft.entity.EntityType; import net.minecraft.entity.Pose; import net.minecraft.entity.ai.goal.LookAtGoal; import net.minecraft.entity.ai.goal.LookRandomlyGoal; import net.minecraft.entity.ai.goal.RandomSwimmingGoal; import net.minecraft.entity.ai.goal.RandomWalkingGoal; import net.minecraft.entity.ai.goal.SwimGoal; import net.minecraft.entity.passive.AnimalEntity; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.world.World; public class StellaEntity extends AnimalEntity { @SuppressWarnings("unchecked") public StellaEntity(EntityType<? extends AnimalEntity> type, World worldIn) { super((EntityType<? extends AnimalEntity>) AngryBirdsEntities.STELLA, worldIn); } @Override public AgeableEntity createChild(AgeableEntity arg0) { return null; } @Override public float getEyeHeight(Pose pose) { return this.getSize(pose).height / 2; } @Override protected void registerGoals() { this.goalSelector.addGoal(0, new SwimGoal(this)); this.goalSelector.addGoal(1, new RandomSwimmingGoal(this, 0.2d, 10)); this.goalSelector.addGoal(2, new RandomWalkingGoal(this, 0.2d)); this.goalSelector.addGoal(3, new LookAtGoal(this, PlayerEntity.class, 6.0F)); this.goalSelector.addGoal(4, new LookRandomlyGoal(this)); } @Override protected void registerAttributes() { super.registerAttributes(); } } The renderer-Class for this Entity: package drachenbauer32.angrybirdsmod.entities.renderers; import drachenbauer32.angrybirdsmod.entities.StellaEntity; import drachenbauer32.angrybirdsmod.entities.models.StellaModel; import drachenbauer32.angrybirdsmod.util.Reference; import net.minecraft.client.renderer.entity.EntityRenderer; import net.minecraft.client.renderer.entity.EntityRendererManager; import net.minecraft.client.renderer.entity.MobRenderer; import net.minecraft.client.renderer.entity.model.EntityModel; import net.minecraft.util.ResourceLocation; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.fml.client.registry.IRenderFactory; @OnlyIn(Dist.CLIENT) public class StellaRenderer extends MobRenderer<StellaEntity, EntityModel<StellaEntity>> { private static final ResourceLocation STELLA_TEXTURE = new ResourceLocation(Reference.MOD_ID + ":textures/entity/stella.png"); public StellaRenderer(EntityRendererManager manager) { super(manager, new StellaModel(), 0.5f); } @Override public ResourceLocation getEntityTexture(StellaEntity arg0) { return STELLA_TEXTURE; } public static class RenderFactory implements IRenderFactory<StellaEntity> { @Override public EntityRenderer<? super StellaEntity> createRenderFor(EntityRendererManager manager) { return new StellaRenderer(manager); } } } And the Model-Class: package drachenbauer32.angrybirdsmod.entities.models; import com.google.common.collect.ImmutableList; import com.mojang.blaze3d.matrix.MatrixStack; import com.mojang.blaze3d.vertex.IVertexBuilder; import drachenbauer32.angrybirdsmod.entities.StellaEntity; import net.minecraft.client.renderer.entity.model.AgeableModel; import net.minecraft.client.renderer.model.ModelRenderer; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; @OnlyIn(Dist.CLIENT) public class StellaModel<T extends StellaEntity> extends AgeableModel<T> { private final ModelRenderer bone; private final ModelRenderer bone2; private final ModelRenderer bone3; private final ModelRenderer bone4; private final ModelRenderer bone5; public StellaModel() { textureWidth = 32; textureHeight = 16; bone = new ModelRenderer(this); bone.setRotationPoint(0.0F, 20.0F, 0.0F); bone.func_217178_a("body", -4.0F, -4.0F, -4.0F, 8, 8, 8, 0.0F, 0, 0); bone.func_217178_a("beak", -1-1.0F, 2.0F, -5.0F, 2, 1, 1, 0.0F, 25, 0); bone.func_217178_a("head_feather_1", 0.0F, -6.0F, -8.0F, 0, 2, 6, 0.0F, 10, 10); bone.func_217178_a("tail_feather_1", 0.0F, 1.0F, 4.0F, 0, 1, 4, 0.0F, 24, 3); bone2 = new ModelRenderer(this); bone2.setRotationPoint(0.0F, -4.0F, -2.0F); setRotationAngle(bone2, -0.5236F, 0.0F, 0.0F); bone.addChild(bone2); bone2.func_217178_a("head_feather_2", 0.0F, -2.0F, -6.0F, 0, 2, 6, 0.0F, 10, 10); bone3 = new ModelRenderer(this); bone3.setRotationPoint(0.0F, -4.0F, -2.0F); setRotationAngle(bone3, -1.0472F, 0.0F, 0.0F); bone.addChild(bone3); bone3.func_217178_a("head_feather_3", 0.0F, -2.0F, -6.0F, 0, 2, 8, 0.0F, 10, 10); bone4 = new ModelRenderer(this); bone4.setRotationPoint(0.0F, 1.0F, 4.0F); setRotationAngle(bone4, 0.5236F, 0.0F, 0.0F); bone.addChild(bone4); bone4.func_217178_a("tail_feather_2", 0.0F, 0.0F, 0.0F, 0, 1, 4, 0.0F, 24, 3); bone5 = new ModelRenderer(this); bone5.setRotationPoint(0.0F, 1.0F, 4.0F); setRotationAngle(bone5, -0.5236F, 0.0F, 0.0F); bone.addChild(bone5); bone5.func_217178_a("tail_feather_3", 0.0F, 0.0F, 0.0F, 0, 1, 4, 0.0F, 24, 3); } @Override protected Iterable<ModelRenderer> func_225602_a_() { //head/Main parts here return ImmutableList.of(bone); } @Override protected Iterable<ModelRenderer> func_225600_b_() { return null; } public void render(final T stella, final float limbSwing, final float limbSwingAmount, final float ageInTicks, final float netHeadYaw, final float headPitch) { bone.rotateAngleX = headPitch * 0.017453292f; bone.rotateAngleY = netHeadYaw * 0.017453292f; } @Override public void func_225598_a_(MatrixStack p_225598_1_, IVertexBuilder p_225598_2_, int p_225598_3_, int p_225598_4_, float p_225598_5_, float p_225598_6_, float p_225598_7_, float p_225598_8_) { // TODO Auto-generated method stub } @Override public void func_225597_a_(StellaEntity p_225597_1_, float p_225597_2_, float p_225597_3_, float p_225597_4_, float netHeadYaw, float headPitch) { } public void setRotationAngle(ModelRenderer model, float x, float y, float z) { model.rotateAngleX = x; model.rotateAngleY = y; model.rotateAngleZ = z; } } My problem is about this lines (i have one for each Entity) in my RenderHandler: RenderingRegistry.registerEntityRenderingHandler(StellaEntity.class,new StellaRenderer.RenderFactory()); In 1.14.3 it worked. But now it says, my arguments are not compatible and wants an EntityType. So i tried this: RenderingRegistry.registerEntityRenderingHandler(AngryBirdsEntities.STELLA,new StellaRenderer.RenderFactory()); But id still says, my arguments are not compatible. Then i found this format in someone´s mod (just with a turtle instead of Stella): RenderingRegistry.registerEntityRenderingHandler(AngryBirdsEntities.STELLA,StellaRenderer::new); But it now markes the last part (The instance of the renderer-class) of the line as an error and still keeps the other error wit not compatible. Why do i get errors with something, that works in someone else´s Mod for the same version of minecraft?
  6. ctrl * space shows me nothing, i can put in there, in this case...
  7. Can you please show your solution or tell me the name of the official java-class, that calls "registerEntityRenderingHandler" to register entity renderers? I don´t know how to find this file, if i don´t know it´s name..
  8. I cannot override them, it looks like they are specific for "QuadrupedModel" and my entities don´t extend this. Can i use them without override them?
  9. Hello In my entities i have "getSize". Does this mean the hight from the model or from the collision-box?
  10. Hello in 1.14.3 i had this in my models? public void render(BluesEntity entity, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale) { bone.render(scale); } it tells the model to wich bodyparts it has to render, because they are not child of others. Childs are automaticly rendered with their parents. but now it does not know this method any more. How do i do this now?
  11. Hello in 1.14.1 i used this to ad cubes to a body-part (here named as bone) of an entity-model: bone.cubeList.add(new ModelBox(bone, 0, 0, -4.0F, -4.0F, -4.0F, 8, 8, 8, 0.0F, false)); It´s because blockbench made it this way and it gives me the biggest number of property-vanues (2x texture-position, 3x cube-position, 3x cube-size and two more) to set for this cube. But in 1.15.1 "cubeList" is not visible and it does not know "ModelBox" any more. How do i add cubes with this number of values now? Edit: i found this: bone.func_217178_a("body", -4.0F, -4.0F, -4.0F, 8, 8, 8, 0.0F, 0, 0); It provides almost all of theese values. But i miss the one, that is "false" in my old one (the last value in that line). i think, it´s about mirrored texturing. So how do i now tell it to mirror a texture for the other leg or something like that?
  12. Hello In 1.14.3 i used this to scale down some of my entities: @Override public float prepareScale(BluesEntity entitylivingbaseIn, float partialTicks) { GlStateManager.scalef(0.5F, 0.5F, 0.5F); return super.prepareScale(entitylivingbaseIn, partialTicks); } but now it does not know "prepareScale" or "scalef" any more... How do i write this now? Maybe i can use MatrixStack instead of GlStateManager now. But how?
  13. Does this mean, if i add func_226896_b_() there, the block is set as solid, and if not, not?
  14. Isn`t it easyer for the Mojang-people to build it with useful names there?
  15. Hello Some methods have names like "func_226896_b_"? I think, modding is easyer, if all methods and fields are named as what they are used for, like "getCollisionShape". So why theese weird names?
  16. in my other mod i have the method "isSolid" in some block-classes. But now, 1n 1.15.1 it´s marked red and the hint says, it´s a final method now. How do i set this property now?
  17. Hello In my block registration i use material colors to make my block-tiles appear in the right color on the map. but now i noticed, that there is no "ORANGE" in this list... I think, there should be the 16 basic colors and terracotter-variants from them. But for orange, i see only "ORANGE_TERRACOTTA". And for white i noticed exactly the same. Is this something, that they forgot to put into the actual version? If they fix it, how do i make it appear in my modding-workspace, too?
  18. In my flat tiles block class i have this: public BlockState updatePostPlacement(BlockState stateIn, Direction facing, BlockState facingState, IWorld worldIn, BlockPos currentPos, BlockPos facingPos) { return !stateIn.isValidPosition(worldIn, currentPos) ? Blocks.AIR.getDefaultState() : super.updatePostPlacement(stateIn, facing, facingState, worldIn, currentPos, facingPos); } public boolean isValidPosition(BlockState state, IWorldReader worldIn, BlockPos pos) { return !worldIn.isAirBlock(pos.down()); } It´s from the carpet block and wmkes impossible to place it on air. But it includes a depricated method: super.updatePostPlacement(stateIn, facing, facingState, worldIn, currentPos, facingPos); which method can i use here instead, that i get no more deprication warning?
  19. How do i write a recipe, that uses the stonecutter to cut a concrete, ceramic or glazed ceramic block into 16 slices as my new flat ground tiles? Edit: I found out, how it works. It´s very similar to normal recipes, bur uses ""type": "minecraft:stonecutting"," as recipe type ant only one item as ingredient. Ingame now my tile appears in the cutting variants area, if i put a concrete block into the stonecutter.
  20. If my item is not registered, i wonder, why... In 1.14.3 this way to register items worked... Edit: i noticed, that i forgot a "@SubscribeEvent" above the item registry event. Now my item appears on the tab from my item-group, but not in it´s inventory-slots. Now i try the item sorter again. I noticed, that I forgot "super.fill(itemStacks);" in the fill-method of my item-group. Now it works. And placing the flat blocks on the ground works too. Now i just have to add blocks of all the materials, i want to have in this mod and add english and german language naming.
  21. Here is now my git-repository: https://github.com/Drachenbauer/FlatTilesMod Edit: the commented areas in the main-class and the class for the custom creative tab are from a tabsorter, that i actually deactivated. I´ll reactivate it, if the items work.
  22. also i noticed, that the tab of this shows no title-item-icon. Edit: the items don´t appear in the misc-tab, too
  23. My selfmade itemgroup.
  24. It´s in the item registry, that i posted above. It includes group(FLAT_TILES) for each item
  25. My creativetab is another class, that i just didn´t post here, because in the other mod it worked so far. I took all about it from the other mod. So i think, the problem is not about the creative tab itself. maybe something about the json's: base for the flat tiles: { "parent": "block/thin_block", "elements": [ { "from": [ 0, 0, 0 ], "to": [ 16, 1, 16 ], "faces": { "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#material", "cullface": "down" }, "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#material" }, "north": { "uv": [ 0, 15, 16, 16 ], "texture": "#material", "cullface": "north" }, "south": { "uv": [ 0, 15, 16, 16 ], "texture": "#material", "cullface": "south" }, "west": { "uv": [ 0, 15, 16, 16 ], "texture": "#material", "cullface": "west" }, "east": { "uv": [ 0, 15, 16, 16 ], "texture": "#material", "cullface": "east" } } } ] } one specific block: { "parent": "flattilesmod:block/tile", "textures": { "particle": "block/blue_concrete", "material": "block/blue_concrete" } } Blockstates for this block: { "variants": { "": { "model": "flattilesmod:block/blue_concrete_tile" } } } Blockitem: { "parent": "flattilesmod:block/blue_concrete_tile" } Is there some issue?
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.