-
Posts
30 -
Joined
-
Last visited
Converted
-
Gender
Male
-
Location
Italy
Recent Profile Visitors
1936 profile views
Slexom's Achievements

Tree Puncher (2/8)
0
Reputation
-
Ok , I understand why... I'm using classes like the following to organize my entites, they are all inner classes of the EntityTypesInit public static final class AlbinoCow { public static final String registryName = "albino_cow"; public static final RegistryObject<EntityType<AlbinoCowEntity>> registryObject = EntityTypesInit.ENTITY_TYPES.register( registryName, () -> EntityType.Builder.create(AlbinoCowEntity::new, EntityClassification.CREATURE) .size(EntityType.COW.getWidth(), EntityType.COW.getHeight()) .build(new ResourceLocation(EarthtojavamobsMod.MOD_ID, registryName).toString()) ); public static final int eggPrimaryColor = 0xdecac3; public static final int eggSecondaryColor = 0xf0a590; public static final String[] spawnBiomes = BiomeSpawnHelper.getBiomesListFromBiomes(BiomeSpawnHelper.PLAINS, BiomeSpawnHelper.MOUNTAINS, BiomeSpawnHelper.GRAVELLY_MOUNTAINS); } They are called when register the spawn in biomes for each entity, but a projectile have no spawn and never been called, so it could be the problem. I think I've to find another way to organize them. Thank you so much.
-
ENTITY_TYPES is the register where I have all the entities. public class EntityTypesInit { public static final DeferredRegister<EntityType<?>> ENTITY_TYPES = new DeferredRegister<>(ForgeRegistries.ENTITIES, EarthtojavamobsMod.MOD_ID); ... public static final class MelonSeedProjectile { public static final String registryName = "melon_seed_projectile"; public static final RegistryObject<EntityType<MelonSeedProjectileEntity>> registryObject = ENTITY_TYPES.register( registryName, () -> EntityType.Builder.<MelonSeedProjectileEntity>create(MelonSeedProjectileEntity::new, EntityClassification.MISC) .size(0.25F, 0.25F) .build(new ResourceLocation(EarthtojavamobsMod.MOD_ID, registryName).toString()) ); } ... } Is called from the mod constructor @Mod(EarthtojavamobsMod.MOD_ID) public class EarthtojavamobsMod { public static final String MOD_ID = "earthtojavamobs"; public EarthtojavamobsMod() { final ModLoadingContext modLoadingContext = ModLoadingContext.get(); final IEventBus modEventBus = FMLJavaModLoadingContext.get().getModEventBus(); FluidInit.FLUIDS.register(modEventBus); BlockInit.BLOCKS.register(modEventBus); EntityTypesInit.ENTITY_TYPES.register(modEventBus); // <--- CALLED HERE ItemInit.ITEMS.register(modEventBus); RecipesInit.RECIPES.register(modEventBus); modEventBus.register(this); modEventBus.addListener(this::setup); modLoadingContext.registerConfig(ModConfig.Type.CLIENT, ConfigHolder.CLIENT_SPEC); modLoadingContext.registerConfig(ModConfig.Type.SERVER, ConfigHolder.SERVER_SPEC); modLoadingContext.registerConfig(ModConfig.Type.COMMON, ConfigHolder.COMMON_SPEC); } ... }
-
Hi~ Here again with another stupid problem... This time I'm trying to register a new projectile following how the Snowball is make. I'm registering the entity like any other entity in the project but this one throw this error. Whats wrong this time? XD Log [19giu2020 20:58:43.075] [modloading-worker-0/ERROR] [net.minecraftforge.fml.javafmlmod.FMLModContainer/]: Exception caught during firing event: Registry Object not present: earthtojavamobs:melon_seed_projectile Index: 1 Listeners: 0: NORMAL 1: ASM: class net.slexom.earthtojavamobs.client.ClientModEventSubscriber onFMLClientSetupEvent(Lnet/minecraftforge/fml/event/lifecycle/FMLClientSetupEvent;)V java.lang.NullPointerException: Registry Object not present: earthtojavamobs:melon_seed_projectile at java.util.Objects.requireNonNull(Objects.java:290) at net.minecraftforge.fml.RegistryObject.get(RegistryObject.java:92) at net.slexom.earthtojavamobs.client.ClientModEventSubscriber.onFMLClientSetupEvent(ClientModEventSubscriber.java:74) at net.minecraftforge.eventbus.ASMEventHandler_4_ClientModEventSubscriber_onFMLClientSetupEvent_FMLClientSetupEvent.invoke(.dynamic) at net.minecraftforge.eventbus.ASMEventHandler.invoke(ASMEventHandler.java:80) at net.minecraftforge.eventbus.EventBus.post(EventBus.java:258) at net.minecraftforge.fml.javafmlmod.FMLModContainer.fireEvent(FMLModContainer.java:106) at java.util.function.Consumer.lambda$andThen$0(Consumer.java:65) at java.util.function.Consumer.lambda$andThen$0(Consumer.java:65) at net.minecraftforge.fml.ModContainer.transitionState(ModContainer.java:112) at net.minecraftforge.fml.ModList.lambda$null$10(ModList.java:135) at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184) at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1382) at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482) at java.util.stream.ForEachOps$ForEachTask.compute(ForEachOps.java:291) at java.util.concurrent.CountedCompleter.exec(CountedCompleter.java:731) at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289) at java.util.concurrent.ForkJoinPool.helpComplete(ForkJoinPool.java:1870) at java.util.concurrent.ForkJoinPool.awaitJoin(ForkJoinPool.java:2045) at java.util.concurrent.ForkJoinTask.doInvoke(ForkJoinTask.java:404) at java.util.concurrent.ForkJoinTask.invoke(ForkJoinTask.java:734) at java.util.stream.ForEachOps$ForEachOp.evaluateParallel(ForEachOps.java:160) at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateParallel(ForEachOps.java:174) at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:233) at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418) at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:583) at net.minecraftforge.fml.ModList.lambda$dispatchParallelEvent$11(ModList.java:135) at java.util.concurrent.ForkJoinTask$AdaptedRunnableAction.exec(ForkJoinTask.java:1386) at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289) at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056) at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692) at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157) [19giu2020 20:58:43.083] [modloading-worker-0/ERROR] [net.minecraftforge.fml.javafmlmod.FMLModContainer/LOADING]: Caught exception during event FMLClientSetupEvent dispatch for modid earthtojavamobs java.lang.NullPointerException: Registry Object not present: earthtojavamobs:melon_seed_projectile at java.util.Objects.requireNonNull(Objects.java:290) ~[?:1.8.0_231] at net.minecraftforge.fml.RegistryObject.get(RegistryObject.java:92) ~[forge-1.15.2-31.2.0_mapped_snapshot_20200618-1.15.1-recomp.jar:?] at net.slexom.earthtojavamobs.client.ClientModEventSubscriber.onFMLClientSetupEvent(ClientModEventSubscriber.java:74) ~[main/:?] at net.minecraftforge.eventbus.ASMEventHandler_4_ClientModEventSubscriber_onFMLClientSetupEvent_FMLClientSetupEvent.invoke(.dynamic) ~[?:?] at net.minecraftforge.eventbus.ASMEventHandler.invoke(ASMEventHandler.java:80) ~[eventbus-2.2.0-service.jar:?] at net.minecraftforge.eventbus.EventBus.post(EventBus.java:258) ~[eventbus-2.2.0-service.jar:?] at net.minecraftforge.fml.javafmlmod.FMLModContainer.fireEvent(FMLModContainer.java:106) ~[?:31.2] at java.util.function.Consumer.lambda$andThen$0(Consumer.java:65) ~[?:1.8.0_231] at java.util.function.Consumer.lambda$andThen$0(Consumer.java:65) ~[?:1.8.0_231] at net.minecraftforge.fml.ModContainer.transitionState(ModContainer.java:112) ~[?:?] at net.minecraftforge.fml.ModList.lambda$null$10(ModList.java:135) ~[?:?] at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184) ~[?:1.8.0_231] at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1382) ~[?:1.8.0_231] at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482) ~[?:1.8.0_231] at java.util.stream.ForEachOps$ForEachTask.compute(ForEachOps.java:291) ~[?:1.8.0_231] at java.util.concurrent.CountedCompleter.exec(CountedCompleter.java:731) ~[?:1.8.0_231] at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289) ~[?:1.8.0_231] at java.util.concurrent.ForkJoinPool.helpComplete(ForkJoinPool.java:1870) ~[?:1.8.0_231] at java.util.concurrent.ForkJoinPool.awaitJoin(ForkJoinPool.java:2045) ~[?:1.8.0_231] at java.util.concurrent.ForkJoinTask.doInvoke(ForkJoinTask.java:404) ~[?:1.8.0_231] at java.util.concurrent.ForkJoinTask.invoke(ForkJoinTask.java:734) ~[?:1.8.0_231] at java.util.stream.ForEachOps$ForEachOp.evaluateParallel(ForEachOps.java:160) ~[?:1.8.0_231] at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateParallel(ForEachOps.java:174) ~[?:1.8.0_231] at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:233) ~[?:1.8.0_231] at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418) ~[?:1.8.0_231] at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:583) ~[?:1.8.0_231] at net.minecraftforge.fml.ModList.lambda$dispatchParallelEvent$11(ModList.java:135) ~[?:?] at java.util.concurrent.ForkJoinTask$AdaptedRunnableAction.exec(ForkJoinTask.java:1386) [?:1.8.0_231] at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289) [?:1.8.0_231] at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056) [?:1.8.0_231] at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692) [?:1.8.0_231] at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157) [?:1.8.0_231] [19giu2020 20:58:43.100] [Server-Worker-1/FATAL] [net.minecraftforge.fml.ModLoader/LOADING]: Failed to complete lifecycle event SIDED_SETUP, 1 errors found [19giu2020 20:58:43.101] [Server-Worker-1/FATAL] [net.minecraftforge.eventbus.EventBus/EVENTBUS]: EventBus 0 shutting down - future events will not be posted. java.lang.Exception: stacktrace at net.minecraftforge.eventbus.EventBus.shutdown(EventBus.java:278) ~[eventbus-2.2.0-service.jar:?] at net.minecraftforge.fml.client.ClientModLoader.lambda$createRunnableWithCatch$5(ClientModLoader.java:115) ~[?:?] at net.minecraftforge.fml.client.ClientModLoader.startModLoading(ClientModLoader.java:123) ~[?:?] at net.minecraftforge.fml.client.ClientModLoader.lambda$onreload$3(ClientModLoader.java:105) ~[?:?] at net.minecraftforge.fml.client.ClientModLoader.lambda$createRunnableWithCatch$5(ClientModLoader.java:113) ~[?:?] at java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1626) [?:1.8.0_231] at java.util.concurrent.CompletableFuture$AsyncRun.exec(CompletableFuture.java:1618) [?:1.8.0_231] at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289) [?:1.8.0_231] at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056) [?:1.8.0_231] at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692) [?:1.8.0_231] at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157) [?:1.8.0_231] [19giu2020 20:58:43.893] [Forge Version Check/INFO] [net.minecraftforge.fml.VersionChecker/]: [forge] Found status: UP_TO_DATE Current: 31.2.0 Target: null [19giu2020 20:58:43.894] [Forge Version Check/INFO] [net.minecraftforge.fml.VersionChecker/]: [earthtojavamobs] Starting version check at https://raw.githubusercontent.com/Slexom/earth2java/master/update.json [19giu2020 20:58:45.573] [Forge Version Check/INFO] [net.minecraftforge.fml.VersionChecker/]: [earthtojavamobs] Found status: UP_TO_DATE Current: 1.3.0 Target: null [19giu2020 20:59:11.644] [Server-Worker-1/ERROR] [net.minecraftforge.fml.ModLoader/LOADING]: Skipping lifecycle event ENQUEUE_IMC, 1 errors found. [19giu2020 20:59:11.645] [Server-Worker-1/FATAL] [net.minecraftforge.fml.ModLoader/LOADING]: Failed to complete lifecycle event ENQUEUE_IMC, 1 errors found [19giu2020 20:59:11.645] [Server-Worker-1/FATAL] [net.minecraftforge.eventbus.EventBus/EVENTBUS]: EventBus 0 shutting down - future events will not be posted. java.lang.Exception: stacktrace at net.minecraftforge.eventbus.EventBus.shutdown(EventBus.java:278) ~[eventbus-2.2.0-service.jar:?] at net.minecraftforge.fml.client.ClientModLoader.lambda$createRunnableWithCatch$5(ClientModLoader.java:115) ~[?:?] at net.minecraftforge.fml.client.ClientModLoader.finishModLoading(ClientModLoader.java:137) ~[?:?] at net.minecraftforge.fml.client.ClientModLoader.lambda$onreload$4(ClientModLoader.java:107) ~[?:?] at java.util.concurrent.CompletableFuture.uniRun(CompletableFuture.java:705) [?:1.8.0_231] at java.util.concurrent.CompletableFuture$UniRun.tryFire(CompletableFuture.java:687) [?:1.8.0_231] at java.util.concurrent.CompletableFuture$Completion.exec(CompletableFuture.java:443) [?:1.8.0_231] at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289) [?:1.8.0_231] at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056) [?:1.8.0_231] at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692) [?:1.8.0_231] at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157) [?:1.8.0_231] Entity public class MelonSeedProjectileEntity extends ProjectileItemEntity { public MelonSeedProjectileEntity(EntityType<? extends MelonSeedProjectileEntity> p_i50159_1_, World p_i50159_2_) { super(p_i50159_1_, p_i50159_2_); } public MelonSeedProjectileEntity(World worldIn, LivingEntity throwerIn) { super(EntityTypesInit.MelonSeedProjectile.registryObject.get(), throwerIn, worldIn); } public MelonSeedProjectileEntity(World worldIn, double x, double y, double z) { super(EntityTypesInit.MelonSeedProjectile.registryObject.get(), x, y, z, worldIn); } protected Item getDefaultItem() { return Items.MELON_SEEDS; } @OnlyIn(Dist.CLIENT) private IParticleData makeParticle() { ItemStack itemstack = this.func_213882_k(); return (IParticleData) (itemstack.isEmpty() ? ParticleTypes.ITEM_SNOWBALL : new ItemParticleData(ParticleTypes.ITEM, itemstack)); } @OnlyIn(Dist.CLIENT) public void handleStatusUpdate(byte id) { if (id == 3) { IParticleData iparticledata = this.makeParticle(); for (int i = 0; i < 8; ++i) { this.world.addParticle(iparticledata, this.getPosX(), this.getPosY(), this.getPosZ(), 0.0D, 0.0D, 0.0D); } } } protected void onImpact(RayTraceResult result) { if (result.getType() == RayTraceResult.Type.ENTITY) { Entity entity = ((EntityRayTraceResult) result).getEntity(); int i = entity instanceof MelonGolemEntity ? 4 : 0; entity.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), (float) i); } if (!this.world.isRemote) { this.world.setEntityState(this, (byte) 3); this.remove(); } } } EntityInit public class EntityTypesInit { ... public static final class MelonSeedProjectile { public static final String registryName = "melon_seed_projectile"; public static final RegistryObject<EntityType<MelonSeedProjectileEntity>> registryObject = ENTITY_TYPES.register( registryName, () -> EntityType.Builder.<MelonSeedProjectileEntity>create(MelonSeedProjectileEntity::new, EntityClassification.MISC) .size(0.25F, 0.25F) .build(new ResourceLocation(EarthtojavamobsMod.MOD_ID, registryName).toString()) ); } ... } Renderer Register @SubscribeEvent public static void onFMLClientSetupEvent(final FMLClientSetupEvent event) { ... RenderingRegistry.registerEntityRenderingHandler(EntityTypesInit.MelonSeedProjectile.registryObject.get(), renderManagerIn -> new SpriteRenderer<MelonSeedProjectileEntity>(renderManagerIn, Minecraft.getInstance().getItemRenderer())); }
-
Oh ok, thank you for the info.
-
I want to change texture of a mob (derived from IronGolemEntity) if it is attacking. I supposed that attackTarget contain the current target LivingEntity of my mob, so I was checking on the renderer if the entity.getAttackTarget() != null . The problem is the value is always null. I was supposing the NearestAttackableTargetGoal would fill the value in ... public void startExecuting() { this.goalOwner.setAttackTarget(this.nearestTarget); super.startExecuting(); } ... Is me wrong? There is another way?
-
More tests. Any entity inside the fluid SOURCE block have this bug. Removing the water tag don't trigger this issue, but entity act like if the block is air. Using a lead is possible to move out of the mud entities if far enough to force pull it. I don't really know where to look or what to do more...
-
After some test. The entity is unablento swim when is on the source block. Look like it can't find a path to wherever it want to go and start spinning. If the block is not a source, so is a flowing fluid, the entity is able to swim and go out of the fluid. It can be some bad configuration of the block? But the various parts look fine to me.
-
Update. The pigs spin also when they are not tempted. When tempted they spin if the player is far more than ~3 blocks else they just look. The spin issue is found only when they are in the Mud fluid. The mud is a normal fluid with some settings about tick rate and density and is tagged as minecraft:water and earthtojavamobs:mud, the MudFlowingFluidBlock extends a FlowingFluidBlock with the only change on lava interaction. Here the fluid code: FluidInit.java EDIT: Look like they are unable to swim in the custom fluid...
-
Anyone, any idea?
-
Changing priority do nothing. I've already did tests on priority. Also, the GoToMudGoal not execute while inside mud. public boolean shouldExecute() { return !this.muddy_pig.isInMud() && super.shouldExecute(); } And yes, the isInMud flag work properly or the texture would not change accordingly.
-
My little muddy pig love mud so much he don't care if I show him a juicy carrot. So, instead of going out of the mud and follow me, he spin on the spot. I've spent last hour reading all the various goal, trying to find some incompatibility, or some pathfinding issue. I've seen there was a similar bug in 1.14.x and 1.15.1, can it be related? Or I simply messed up the entity goals? The code of the entity is long, here the link to the github repo: https://github.com/Slexom/earth2java/blob/1.2.2/src/main/java/net/slexom/earthtojavamobs/entity/MuddyPigEntity.java
-
[Solved][1.15.2] FlowingFluidBlock: Exception while updating neighbours
Slexom replied to Slexom's topic in Modder Support
Before making changes on how register things on the mod I was using the constructor without the supplier. Now I'm using the supplier and inside the constructor code there is this.fluid = null; . That's what generate the error. Close or delete this if you want. -
A little bit exaggerated for half line of code. I'll put my fluid back on the water tag and fix what broke(fog color, lava interaction, etc.). Thank you for your reply.