Hello, I am unable to register a custom TNT block I made. I am getting two errors, one in the constructor in my Primed_Dynamite class. I am unsure of what type to cast, here is the code for it:
public Primed_Dynamite(Level p_32079_, double p_32080_, double p_32081_, double p_32082_, @Nullable LivingEntity p_32083_) {
//this(CustomEntityType.DYNAMITE, p_32079_);
this((EntityType<Primed_Dynamite>)CustomEntityType.PRIMED_DYNAMITE, p_32079_);
this.setPos(p_32080_, p_32081_, p_32082_);
double d0 = p_32079_.random.nextDouble() * (double)((float)Math.PI * 2F);
this.setDeltaMovement(-Math.sin(d0) * 0.02D, (double)0.2F, -Math.cos(d0) * 0.02D);
this.setFuse(80);
this.xo = p_32080_;
this.yo = p_32081_;
this.zo = p_32082_;
this.owner = p_32083_;
}
I am also clueless as to how to make a registryObject for the primed dynamite entity, with my current code I get the errors: "The method register(String, Supplier<? extends I>) in the type DeferredRegister<EntityType<?>> is not applicable for the arguments (String, () -> {})" and "The method build(null) is undefined for the type Block"
public static final RegistryObject<EntityType<Primed_Dynamite>> PRIMED_DYNAMITE =
ENTITY_TYPES.register("dynamite",
() -> EntityType.Builder.of(Primed_Dynamite::new, ModBlocks.DYNAMITE.get().build(null)));
Here is my github repositry and the specific files in question:
https://github.com/John-Tsiglieris/Mod
https://github.com/John-Tsiglieris/Mod/blob/main/src/main/java/block/custom/Dynamite.java
https://github.com/John-Tsiglieris/Mod/blob/main/src/main/java/block/custom/Primed_Dynamite.java
https://github.com/John-Tsiglieris/Mod/blob/main/src/main/java/entity/custom/CustomEntityType.java