• Recently Browsing

    No registered users viewing this page.

  • Posts

    • First: No, it work on all IDE, if you are modding for 1.12.2 is still should work. Second: Read the blue Gui above your Topic title. It say: 1.12.2 is no longer supported. Update to a new Version of Minecraft for receive support. Simply google and you should have your solution.
    • the only differences i see, is that the SlimeModel extends SegmentedModel and mine extends AgeableModel. And, that they use an integer in the constructor of the Model-class and i use a boolean.   I want to keep it extend AgeableModel, because my one has got a head and a body and i still want to use one list for head-parts and one for body-parts.   The model-class: package drachenbauer32.angrybirdsmod.entities.models; import com.google.common.collect.ImmutableList; import net.minecraft.client.renderer.entity.model.AgeableModel; import net.minecraft.client.renderer.model.ModelRenderer; import net.minecraft.entity.Entity; import net.minecraft.util.math.MathHelper; public class CoralModel<T extends Entity> extends AgeableModel<T> { private final ModelRenderer bone; private final ModelRenderer bone2; private final ModelRenderer bone3; private final ModelRenderer bone4; private final ModelRenderer bone5; private final ModelRenderer bone6; private final ModelRenderer bone7; public CoralModel(boolean layer) { textureWidth = 56; textureHeight = 32; bone = new ModelRenderer(this); bone.setRotationPoint(0.0F, 18.1F, 0.0F); bone2 = new ModelRenderer(this); bone3 = new ModelRenderer(this); bone4 = new ModelRenderer(this); bone5 = new ModelRenderer(this); bone6 = new ModelRenderer(this); bone7 = new ModelRenderer(this); if (layer) { bone.addBox("back_fin", 0.0F, -12.0F, 0.0F, 0, 12, 6, 0.0F, 38, 6); } else { bone.addBox("head", -4.0F, -8.0F, -4.0F, 8, 8, 8, 0.0F, 0, 0); bone.addBox("antenna_part_1", -0.5F, -12.0F, -4.0F, 1, 4, 1, 0.0F, 28, 0); bone.addBox("antenna_part_2", -0.5F, -12.0F, -6.0F, 1, 1, 2, 0.0F, 24, 5); bone.addBox("antenna_light", -1.0F, -12.0F, -8.0F, 2, 3, 2, 0.0F, 0, 0); bone2.setRotationPoint(0.0F, 20.1F, 0.0F); bone2.addBox("body", -3.0F, -4.0F, -3.0F, 6, 6, 6, 0.0F, 32, 0); bone3.setRotationPoint(-2.0F, 22.1F, -2.0F); bone3.addBox("right_front_leg", -1.0F, 0.0F, -1.0F, 2, 2, 2, 0.0F, 0, 16); bone3.addBox("right_front_flipper", -1.0F, 2.0F, -2.0F, 2, 0, 1, 0.0F, 1, 20); bone4.setRotationPoint(2.0F, 22.1F, -2.0F); bone4.addBox("left_front_leg", -1.0F, 0.0F, -1.0F, 2, 2, 2, 0.0F, 8, 16); bone4.addBox("left_front_flipper", -1.0F, 2.0F, -2.0F, 2, 0, 1, 0.0F, 9, 20); bone5.setRotationPoint(-2.0F, 22.1F, 2.0F); bone5.addBox("right_hind_leg", -1.0F, 0.0F, -1.0F, 2, 2, 2, 0.0F, 16, 16); bone5.addBox("right_hind_flipper", -1.0F, 2.0F, -2.0F, 2, 0, 1, 0.0F, 17, 20); bone6.setRotationPoint(2.0F, 22.1F, 2.0F); bone6.addBox("left_hind_leg", -1.0F, 0.0F, -1.0F, 2, 2, 2, 0.0F, 24, 16); bone6.addBox("left_hind_flipper", -1.0F, 2.0F, -2.0F, 2, 0, 1, 0.0F, 25, 20); bone7.setRotationPoint(0.0F, 20.1F, 3.0F); bone7.addBox("tail_part_1", -2.0F, -2.0F, 0.0F, 4, 4, 4, 0.0F, 0, 24); bone7.addBox("tail_part_2", -1.0F, 0.0F, 4.0F, 2, 2, 2, 0.0F, 4, 20); bone7.addBox("tail_fin", 0.0F, -1.0F, 6.0f, 0, 4, 2, 0.0F, 16, 26); } } @Override protected Iterable<ModelRenderer> getHeadParts() { return ImmutableList.of(bone); } @Override protected Iterable<ModelRenderer> getBodyParts() { return ImmutableList.of(bone2, bone3, bone4, bone5, bone6, bone7); } @Override public void setRotationAngles(Entity coral, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch) { //float limbSwingValue = bone.rotateAngleX = headPitch * 0.017453292f; bone.rotateAngleY = netHeadYaw * 0.017453292f; bone3.rotateAngleX = MathHelper.cos(limbSwing * 0.6662F + (float)Math.PI) * 3 * limbSwingAmount; bone4.rotateAngleX = MathHelper.cos(limbSwing * 0.6662F) * 3 * limbSwingAmount; bone5.rotateAngleX = MathHelper.cos(limbSwing * 0.6662F) * 3 * limbSwingAmount; bone6.rotateAngleX = MathHelper.cos(limbSwing * 0.6662F + (float)Math.PI) * 3 * limbSwingAmount; bone7.rotateAngleY = MathHelper.cos(limbSwing * 0.6662F) * 3 * limbSwingAmount; bone7.rotateAngleX = ageInTicks; System.out.println(limbSwing); //System.out.println(limbSwingAmount); } }
    • Yeah I'm modding for 1.12.2 so that's probably why it's not showing up.
    • I did what you say, but now i get that exception:   java.lang.IllegalStateException: No renderer registered for enderslime:enderslime     at net.minecraft.client.renderer.entity.EntityRendererManager.<init>(EntityRendererManager.java:189) ~[forge-1.15-29.0.4_mapped_snapshot_20190719-1.14.3-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} I got it before sometimes when i registered something before render, but now i have no idea how to fix it. Commit: https://gitlab.com/Emily_Ravenhold/enderSlime/-/commit/73f0efefcddd7f1dd4a8bb7905f3dffce833a1e2 Thanks!
    • Alright, so applying your suggestion to my code did fix the error. However, there's another problem, and I'm not sure exactly what's causing it. It could be an issue with my capability's storage class, it could be that I'm not attaching the capability properly, or something else, but when I went to check my custom sword in-game, instead of printing the amount of "juice" it was supposed to store (juice is just another word for energy; it's just an int value) in the sword's tooltip, it just printed this: https://imgur.com/a/vOUhiDo   Here's my updated Provider class, in case that could have an effect on the above issue: package zorochase.oneirocraft.capability; import net.minecraft.util.Direction; import net.minecraftforge.common.capabilities.Capability; import net.minecraftforge.common.capabilities.CapabilityInject; import net.minecraftforge.common.capabilities.ICapabilityProvider; import net.minecraftforge.common.util.LazyOptional; import javax.annotation.Nonnull; import javax.annotation.Nullable; import java.util.function.Supplier; public class JuicedItemProvider implements ICapabilityProvider { private Supplier<IJuicedItem> juicedItemSupplier; @CapabilityInject(IJuicedItem.class) public static Capability<IJuicedItem> JUICED_ITEM_CAPABILITY = null; public JuicedItemProvider() { this(() -> JUICED_ITEM_CAPABILITY.getDefaultInstance()); } JuicedItemProvider(Supplier<IJuicedItem> sup) { this.juicedItemSupplier = sup; } private LazyOptional<IJuicedItem> capability = LazyOptional.of(() -> juicedItemSupplier.get()); @Nonnull @Override public <T> LazyOptional<T> getCapability(@Nonnull Capability<T> cap, @Nullable Direction side) { return cap == JUICED_ITEM_CAPABILITY ? capability.cast() : LazyOptional.empty(); } }   Here's the storage class: package zorochase.oneirocraft.capability; import net.minecraft.nbt.CompoundNBT; import net.minecraft.nbt.INBT; import net.minecraft.util.Direction; import net.minecraftforge.common.capabilities.Capability; import javax.annotation.Nullable; public class JuicedItemStorage implements Capability.IStorage<IJuicedItem> { @Nullable @Override public INBT writeNBT(Capability<IJuicedItem> capability, IJuicedItem instance, Direction side) { CompoundNBT tag = new CompoundNBT(); tag.putInt("juice", instance.getJuice()); tag.putInt("maxJuiceTransferable", instance.getMaxJuiceTransferable()); tag.putBoolean("empowered", instance.getIsEmpowered()); return tag; } @Override public void readNBT(Capability<IJuicedItem> capability, IJuicedItem instance, Direction side, INBT nbt) { CompoundNBT tag = (CompoundNBT) nbt; instance.setJuice(tag.getInt("juice")); instance.setJuiceTransferLimit(tag.getInt("maxJuiceTransferable")); instance.setEmpowered(tag.getBoolean("empowered")); } }   Here's how I'm printing the sword's "juice": @Override public void addInformation(ItemStack stack, @Nullable World worldIn, List<ITextComponent> tooltip, ITooltipFlag flagIn) { tooltip.add( new TranslationTextComponent( String.valueOf( stack.getCapability(JuicedItemProvider.JUICED_ITEM_CAPABILITY).map(IJuicedItem::getJuice) ) ).applyTextStyle(TextFormatting.AQUA) ); }   And here's what I did to attach it in my main class: @SubscribeEvent public static void onAttachCapabilities(AttachCapabilitiesEvent<ItemStack> event) { Item item = event.getObject().getItem(); if (item instanceof DreamsteelSwordItem) { event.addCapability(new ResourceLocation(Oneirocraft.MOD_ID, "juiceditem"), new JuicedItemProvider()); } }   Again, I really do appreciate your help. I apologize for requesting it continually, it's only because I'm having a hard time wrapping my head around this concept.
  • Topics

  • Who's Online (See full list)