Jump to content

Krevik

Members
  • Posts

    179
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by Krevik

  1. Hi there! I am having problem with structure generated using template (structure .nbt) The problem: structure is not spawned, nothing wrong in logs. My Code: StructureGenerating class my cloud_mini_temple.nbt is located in \assets\kathairis\structures\ . What might be the problem? Thanks in advance
  2. Finally got it working.... Seems that I am complete debugging dumb and I cannot even properly read debugger. So: The problem was, that spawnable Block is set to grass block in canSpawn() method in EntityAnimal class. It was enough to change the canSpawn() method to accept also other blocks. Thank you @diesieben07 for your patience and help - maybe I cannot debug but after all I learned something.
  3. Well the code goes properly to worldIn.spawnEntity, the only thing I am actually thinking of is that just before calling worldIn.spawnEntity there is such line of code in public static void performWorldGenSpawning(IWorld worldIn, Biome biomeIn, int centerX, int centerZ, Random diameterX) : ientitylivingdata = entityliving.onInitialSpawn(worldIn.getDifficultyForLocation(new BlockPos(entityliving)), ientitylivingdata, (NBTTagCompound)null); and it is null, however as far as I am concerned entity living data actually can be null, so I guess it's not a problem. So at the end worldIn.spawnEntity is called, but there's no mob visible on the map. So it goes through all the checks.
  4. Hello there! I am rewriting my old topic, just to make it more clear. I have a problem - I've got custom dimension with custom biomes, and I cannot make custom mob spawns working. Whenever I add a new mob spawn to my custom biome - it doesn't work - it is not spawned. The weird thing is some of the mobs actually work (in my case it's mystic bird and two common butterflies, but it's only 2 working out of... many). I've been trying to learn and do some debugging - everything seems correct - the mobs are added to the new biomes spawns lists, and in debugging code seems like they are actually spawned. So here are my important code parts: ModEntities My ModSubscriber (register things and such): I've got also spawn eggs and the mobs can be normally spawned using these eggs. Also I can spawn these mobs with command properly. I know the code is not made in the proper way, but trust me I am trying to deal with the problem for few weeks actually, and I were trying ... a lot of combinations, ways, etc....
  5. Hmmm maybe you need to experiment with fogStart and fogEnd parameters? GlStateManager.fogStart(fogStartFloat-for e.g. 4f); GlStateManager.fogEnd(fogEndFloat for e.g. 40f);
  6. so your events are not being called actually. Maybe try changing event methods to static?
  7. Well I am not an expert, but you can do that using debugger, orrr I always do that by simply putting System.out.println("YAY It was called, so it's working!"); inside the method I wanna check. I would suggest putting two checks - before if and after if - so you will get double result - check if your event is actually working (is it being called) and check if entity actually is inside that material, so you will be sure that your if works correctly.
  8. Did you check if events are being called?
  9. You can use EntityType.Builder.create
  10. As in the topic - what's the best way to send certain message to all the players? There's no such method as sendToAll as it was in earlier versions.
  11. Please just write down ANY idea you have. Maybe it's something really obvious and I am just blind. ref
  12. really nobody know what might be wrong? :/
  13. How did you find it? I cannot find it in my 1.13 project
  14. Okay so I've been trying my best to debug the code for the few last days, but I still cannot find what's wrong
  15. how looks the line of code that the NPE points to?
  16. Okay so after my first few steps with debugging it appears that only birds (as creatures) and monsters are added to biome spawn lists. Any idea why? :O EDIT: I checked wrongly, seems like everything is added properly to spawn lists
  17. well so I checked things and it appears that this is not null. It was probably null earlier as I tried to call these register methods too early (as I said, I was trying to put these methods almost everywhere) But still only birds and monsters are being spawned. (Updating code). Where exactly should I put break point? And how to read it after the breakpoint is fired?
  18. I am not home rn will post the full crash log later but it's from EntityPlacementRegistry.register sth like "cannot register placement for "null", already registred placement for "null" value"
  19. 1.Because I am getting NPE then (what is totally weird to me) 2.hmmm here it should normally work, so yeah you're right gonna change it. 3. To be honest I do not know how to properly debug vanilla code
  20. Hello there! I am having weird problem with custom entities spawns in custom biomes. I've been trying for few days with different functions, ways of registration, etc... At the moment the problem is: I cannot get all my mobs spawns working. For e.g. Monsters spawns normally, but day mobs - no. Only one of them is being spawned actually - bird. Another ways of registration gave me only minecraft crash or inability entering my dimension. Here's my git repository: https://github.com/Krevik/Kathairis And here are the most important parts of the code: ModEntities (list of all entities, spawns, etc) public static final EntityType<EntityBasicButterfly> BASIC_BUTTERFLY1 = _null(); public static final EntityType<EntityBasicButterfly> BASIC_BUTTERFLY2 = _null(); public static final EntityType<EntityCloudShimmer> CLOUD_SHIMMER = _null(); public static final EntityType<EntityIllukini> ILLUKINI = _null(); public static final EntityType<EntityRubySile> RUBY_SILE = _null(); public static final EntityType<EntitySkylight> SKYLIGHT = _null(); public static final EntityType<EntityBigTurtle> BIG_TURTLE = _null(); public static final EntityType<EntityBison> BISON = _null(); public static final EntityType<EntityCactiSpore> CACTI_SPORE = _null(); public static final EntityType<EntityCamel> CAMEL = _null(); public static final EntityType<EntityCloudOister> CLOUD_OISTER = _null(); public static final EntityType<EntityCloudySlime> CLOUDY_SLIME = _null(); public static final EntityType<EntityFlyingSquid> FLYING_SQUID = _null(); public static final EntityType<EntityFungite> FUNGITE = _null(); public static final EntityType<EntityGaznowel> GAZNOWEL = _null(); public static final EntityType<EntityGecko> GECKO = _null(); public static final EntityType<EntityHowler> HOWLER = _null(); public static final EntityType<EntityJellyFish> JELLY_FISH = _null(); public static final EntityType<EntityLivingFlower> LIVING_FLOWER = _null(); public static final EntityType<EntityMysticBird> MYSTIC_BIRD = _null(); public static final EntityType<EntityPhasm> PHASM = _null(); public static final EntityType<EntityPoisonousScorpion> POISONOUS_SCORPION = _null(); public static final EntityType<EntitySkyray> SKYRAY = _null(); public static final EntityType<EntityStrangeWanderer> STRANGE_WANDERER = _null(); public static void registerPlacementType(EntityType<?> type,EntitySpawnPlacementRegistry.SpawnPlacementType spawnType){ EntitySpawnPlacementRegistry.register(type, spawnType, Heightmap.Type.MOTION_BLOCKING_NO_LEAVES,null); } public static void registerPlacementTypes(){ registerPlacementType(ModEntities.BASIC_BUTTERFLY1, EntitySpawnPlacementRegistry.SpawnPlacementType.ON_GROUND); registerPlacementType(ModEntities.BASIC_BUTTERFLY2, EntitySpawnPlacementRegistry.SpawnPlacementType.ON_GROUND); registerPlacementType(ModEntities.CLOUD_SHIMMER, EntitySpawnPlacementRegistry.SpawnPlacementType.ON_GROUND); registerPlacementType(ModEntities.ILLUKINI, EntitySpawnPlacementRegistry.SpawnPlacementType.ON_GROUND); registerPlacementType(ModEntities.RUBY_SILE, EntitySpawnPlacementRegistry.SpawnPlacementType.ON_GROUND); registerPlacementType(ModEntities.SKYLIGHT, EntitySpawnPlacementRegistry.SpawnPlacementType.ON_GROUND); registerPlacementType(ModEntities.BIG_TURTLE, EntitySpawnPlacementRegistry.SpawnPlacementType.ON_GROUND); registerPlacementType(ModEntities.BISON, EntitySpawnPlacementRegistry.SpawnPlacementType.ON_GROUND); registerPlacementType(ModEntities.CACTI_SPORE, EntitySpawnPlacementRegistry.SpawnPlacementType.ON_GROUND); registerPlacementType(ModEntities.CAMEL, EntitySpawnPlacementRegistry.SpawnPlacementType.ON_GROUND); registerPlacementType(ModEntities.CLOUD_OISTER, EntitySpawnPlacementRegistry.SpawnPlacementType.ON_GROUND); registerPlacementType(ModEntities.CLOUDY_SLIME, EntitySpawnPlacementRegistry.SpawnPlacementType.ON_GROUND); registerPlacementType(ModEntities.FLYING_SQUID, EntitySpawnPlacementRegistry.SpawnPlacementType.ON_GROUND); registerPlacementType(ModEntities.FUNGITE, EntitySpawnPlacementRegistry.SpawnPlacementType.ON_GROUND); registerPlacementType(ModEntities.GAZNOWEL, EntitySpawnPlacementRegistry.SpawnPlacementType.ON_GROUND); registerPlacementType(ModEntities.GECKO, EntitySpawnPlacementRegistry.SpawnPlacementType.ON_GROUND); registerPlacementType(ModEntities.HOWLER, EntitySpawnPlacementRegistry.SpawnPlacementType.ON_GROUND); registerPlacementType(ModEntities.JELLY_FISH, EntitySpawnPlacementRegistry.SpawnPlacementType.ON_GROUND); registerPlacementType(ModEntities.LIVING_FLOWER, EntitySpawnPlacementRegistry.SpawnPlacementType.ON_GROUND); registerPlacementType(ModEntities.MYSTIC_BIRD, EntitySpawnPlacementRegistry.SpawnPlacementType.ON_GROUND); registerPlacementType(ModEntities.PHASM, EntitySpawnPlacementRegistry.SpawnPlacementType.ON_GROUND); registerPlacementType(ModEntities.POISONOUS_SCORPION, EntitySpawnPlacementRegistry.SpawnPlacementType.ON_GROUND); registerPlacementType(ModEntities.SKYRAY, EntitySpawnPlacementRegistry.SpawnPlacementType.ON_GROUND); registerPlacementType(ModEntities.STRANGE_WANDERER, EntitySpawnPlacementRegistry.SpawnPlacementType.ON_GROUND); } private static void registerEntitySpawn(EntityType<? extends EntityLiving> type,EnumCreatureType creatureType, EntitySpawnPlacementRegistry.SpawnPlacementType spawnType,Biome[] biomes, int weight, int min, int max) { for (Biome b : biomes) { Biome biome=b; if (biome != null) { biome.getSpawns(creatureType).add(new Biome.SpawnListEntry(type, weight, min, max)); } } } public static void registerEntitySpawns(){ EntitySpawnPlacementRegistry.SpawnPlacementType ON_GROUND = EntitySpawnPlacementRegistry.SpawnPlacementType.ON_GROUND; registerEntitySpawn(ModEntities.MYSTIC_BIRD,EnumCreatureType.CREATURE,ON_GROUND,new Biome[]{ModBiomes.KATHARIAN_FOREST,ModBiomes.KATHARIAN_SWAMP,ModBiomes.PLAIN_FIELDS},12,1,2); registerEntitySpawn(ModEntities.BIG_TURTLE,EnumCreatureType.CREATURE,ON_GROUND,new Biome[]{ModBiomes.KATHARIAN_DESERT,ModBiomes.KATHARIAN_DESERT_EDGE,ModBiomes.SOFT_SAND_LAKES},12,1,1); registerEntitySpawn(ModEntities.POISONOUS_SCORPION,EnumCreatureType.MONSTER,ON_GROUND,new Biome[]{ModBiomes.KATHARIAN_DESERT,ModBiomes.KATHARIAN_DESERT_EDGE,ModBiomes.SOFT_SAND_LAKES},3,1,1); registerEntitySpawn(ModEntities.CAMEL,EnumCreatureType.CREATURE,ON_GROUND,new Biome[]{ModBiomes.KATHARIAN_DESERT,ModBiomes.KATHARIAN_DESERT_EDGE,ModBiomes.SOFT_SAND_LAKES},6,1,1); registerEntitySpawn(ModEntities.GECKO,EnumCreatureType.CREATURE,ON_GROUND,new Biome[]{ModBiomes.KATHARIAN_FOREST},4,1,1); registerEntitySpawn(ModEntities.LIVING_FLOWER,EnumCreatureType.CREATURE,ON_GROUND,new Biome[]{ModBiomes.KATHARIAN_FOREST},8,1,1); registerEntitySpawn(ModEntities.HOWLER,EnumCreatureType.MONSTER,ON_GROUND,new Biome[]{ModBiomes.KATHARIAN_FOREST},5,1,1); registerEntitySpawn(ModEntities.FUNGITE,EnumCreatureType.MONSTER,ON_GROUND,new Biome[]{ModBiomes.KATHARIAN_FOREST},2,1,1); //registerEntitySpawn(ModEntities.CACTI_SPORE,EnumCreatureType.CREATURE,ON_GROUND,new Biome[]{ModBiomes.KATHARIAN_FOREST},4,1,1); //registerEntitySpawn(ModEntities.JELLY_FISH,EnumCreatureType.CREATURE,ON_GROUND,new Biome[]{ModBiomes.PLAIN_FIELDS},10,1,2); //registerEntitySpawn(ModEntities.BISON,EnumCreatureType.CREATURE,ON_GROUND,new Biome[]{ModBiomes.PLAIN_FIELDS},8,2,4); //registerEntitySpawn(ModEntities.BASIC_BUTTERFLY1,EnumCreatureType.CREATURE,ON_GROUND,new Biome[]{ModBiomes.PLAIN_FIELDS},10,1,1); //registerEntitySpawn(ModEntities.BASIC_BUTTERFLY2,EnumCreatureType.CREATURE,ON_GROUND,new Biome[]{ModBiomes.PLAIN_FIELDS},10,1,1); //registerEntitySpawn(ModEntities.PHASM,EnumCreatureType.MONSTER,ON_GROUND,new Biome[]{ModBiomes.KATHARIAN_SWAMP},2,1,1); } } Actually I've been trying methods registerEntitySpawns() and registerPlacementTypes() almost everywhere but at the moment I call them here (main mod file): private void setup(final FMLCommonSetupEvent event) { ModEntities.registerPlacementTypes(); ModEntities.registerEntitySpawns(); } Also registration methods of entities: @SubscribeEvent public static void onRegisterEntityTypes(final RegistryEvent.Register<EntityType<?>> event){ event.getRegistry().registerAll( setup(EntityType.Builder.create(EntityBigTurtle.class, EntityBigTurtle::new).build("big_turtle"),"big_turtle"), setup(EntityType.Builder.create(EntityButterfly.class, EntityButterfly::new).build("basic_butterfly1"), "basic_butterfly1"), setup(EntityType.Builder.create(EntityButterfly1.class, EntityButterfly1::new).build("basic_butterfly2"), "basic_butterfly2"), setup(EntityType.Builder.create(EntityCloudShimmer.class, EntityCloudShimmer::new).build("cloud_shimmer"), "cloud_shimmer"), setup(EntityType.Builder.create(EntityIllukini.class, EntityIllukini::new).build("illukini"), "illukini"), setup(EntityType.Builder.create(EntityRubySile.class, EntityRubySile::new).build("ruby_sile"), "ruby_sile"), setup(EntityType.Builder.create(EntitySkylight.class, EntitySkylight::new).build("skylight"), "skylight"), setup(EntityType.Builder.create(EntityBison.class, EntityBison::new).build("bison"), "bison"), setup(EntityType.Builder.create(EntityCactiSpore.class, EntityCactiSpore::new).build("cacti_spore"), "cacti_spore"), setup(EntityType.Builder.create(EntityCamel.class, EntityCamel::new).build("camel"), "camel"), setup(EntityType.Builder.create(EntityCloudOister.class, EntityCloudOister::new).build("cloud_oister"), "cloud_oister"), setup(EntityType.Builder.create(EntityCloudySlime.class, EntityCloudySlime::new).build("cloudy_slime"), "cloudy_slime"), setup(EntityType.Builder.create(EntityFlyingSquid.class, EntityFlyingSquid::new).build("flying_squid"), "flying_squid"), setup(EntityType.Builder.create(EntityFungite.class, EntityFungite::new).build("fungite"), "fungite"), setup(EntityType.Builder.create(EntityGaznowel.class, EntityGaznowel::new).build("gaznowel"), "gaznowel"), setup(EntityType.Builder.create(EntityGecko.class, EntityGecko::new).build("gecko"), "gecko"), setup(EntityType.Builder.create(EntityHowler.class, EntityHowler::new).build("howler"), "howler"), setup(EntityType.Builder.create(EntityJellyFish.class, EntityJellyFish::new).build("jelly_fish"), "jelly_fish"), setup(EntityType.Builder.create(EntityLivingFlower.class, EntityLivingFlower::new).build("living_flower"), "living_flower"), setup(EntityType.Builder.create(EntityMysticBird.class, EntityMysticBird::new).build("mystic_bird"), "mystic_bird"), setup(EntityType.Builder.create(EntityPhasm.class, EntityPhasm::new).build("phasm"), "phasm"), setup(EntityType.Builder.create(EntityPoisonousScorpion.class, EntityPoisonousScorpion::new).build("poisonous_scorpion"), "poisonous_scorpion"), setup(EntityType.Builder.create(EntitySkyray.class, EntitySkyray::new).build("skyray"), "skyray"), setup(EntityType.Builder.create(EntityStrangeWanderer.class, EntityStrangeWanderer::new).build("strange_wanderer"), "strange_wanderer") ); } So assuming once again - at the moment I can enter my dimension, but only birds and monsters are really being spawned.
  21. Ohh thank you, I didn't know actually
  22. it's @OnlyIn(Dist.CLIENT) I think.
×
×
  • Create New...

Important Information

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