Jump to content

FerroCentric

Members
  • Posts

    8
  • Joined

  • Last visited

FerroCentric's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. I'm trying to replace the default player entity with a custom entity that implements the GeckoLib IAnimatable interface and has the necessary methods for GeckoLib animation. However, things are only being added, not modified. As such, there's probably an easier (and more reasonable) way to make these things part of the basic playerentity. If you have any way to do either, I'm all ears.
  2. I looked in EntityType.java before and couldn't find it, but for some reason I found the register now. Apparently it uses createNothing(), which was one of the first methods I ruled out trying to figure out how to register it. Thanks for the info on IFactories tho, it helped me better understand some more things regarding constructors and implementing.
  3. Am I looking for a Static Entity, a T, or a Private Static Entity? I presume it's the 4th in the picture, since its the only one fulfillable by the PlayerEntity constructor? I have no idea at this point.
  4. Ok, then how do I get a PlayerEntity's IFactory for registry? You gotta be able to register it somehow, and a null value won't be too helpful to the register.
  5. What are you referring to? The first IFactory method from poopoodice, or the one in my PlayerEntityReplace?
  6. I think I understand. So, almost all entity types are constructed with an EntityType and a world, and as such their constructors, when the IFactory interface is implemented, can be used to construct an IFactory with create(). However, players don't construct with an EntityType variable, and therefore cannot be used easily with the IFactory interface. So, this begs the question: How would I register a new PlayerEntity type entity? I tried some of your methods, but each one requires a PlayerEntity superconstructor with an EntityType variable, which don't exist. Is there some way to skip up to the LivingEntity superconstructor, or something? Or, better yet, is there any easy way to override the PlayerEntity class directly (without making compatibility issues) to get it to implement an interface and to change certain methods? (I'm trying to make the player be animatable by GeckoLib, so I've been making this entity to replace the normal PlayerEntity, hence the name of the entity)
  7. I think I can rig one up, but how would I get a World variable for the IFactory.create() method during registry? Or, is there a different way to create an IFactory during/for registry? Edit: I don't know what I'm doing, but I tried to rig up a variation of the PlayerEnityReplace constructor that produces an IFactory: public IFactory<T extends Entity> PlayerEntityReplace(World p_i241920_1_, BlockPos p_i241920_2_, float p_i241920_3_, GameProfile p_i241920_4_, EntityType<T> p_create_1_, World p_create_2_) { super(p_i241920_1_, p_i241920_2_, p_i241920_3_, p_i241920_4_); return EntityType.IFactory.<PlayerEntityReplace>create(p_create_1_, p_create_2_); } Believe it or not, it doesn't compile. It's expecting a comma where extends is (in <T extends Entity>), and I'm not entirely sure how to make a non-static reference to the create() method. I am 100% certain I'm doing this wrong, but I don't know what I'm supposed to do.
  8. I'm new to minecraft modding and java, so bear with me: I've been trying to register an entity. Simple enough, I suppose. I've been cobbling together some code from different sources, and ended up with this: package com.tfcraft.transformacraft.registry; import com.tfcraft.transformacraft.entities.PlayerEntityReplace; import net.minecraft.entity.EntityClassification; import net.minecraft.entity.EntityType; import net.minecraft.util.ResourceLocation; import net.minecraftforge.fml.RegistryObject; import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; import net.minecraftforge.registries.DeferredRegister; import net.minecraftforge.registries.ForgeRegistries; public class EntityReg { private static final DeferredRegister<EntityType<?>> RegEnt = DeferredRegister.create(ForgeRegistries.ENTITIES, "transformacraft"); public static RegistryObject<EntityType<PlayerEntityReplace>> PLRREPLACE_ENTITY = RegEnt.register("player_replace", () -> EntityType.Builder.<PlayerEntityReplace>of(PlayerEntityReplace::new, EntityClassification.MISC) .build(new ResourceLocation("transformacraft", "player_replace").toString())); public static void register() { RegEnt.register(FMLJavaModLoadingContext.get().getModEventBus()); } } There was some problems with figuring this out (Mainly the fact that the EntityType.Builder.create() method apparently no longer exists, .of() seemed functionally identical, correct me if I'm wrong), HOWEVER PlayerEntityReplace::new apparently doesn't work as an IFactory? Every source I found for registering entities simply used (InsertGenericEntityExampleClassHere)::new for that part of the create() method, and it apparently worked for them fine. But, using it in my project simply has my IDE (Eclipse) underline it in red with the message "The type PlayerEntityReplace does not define PlayerEntityReplace(EntityType<PlayerEntityReplace>, World) that is applicable here" (Which I found to be the create() method of an IFactory?) What am I doing wrong here?
×
×
  • Create New...

Important Information

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