Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 07/16/17 in all areas

  1. It is really simple and if I get anything wrong I really want someone to correct me. Make a class that has the @Mod.EventBusSubscriber and in that class put the method in the documentation. @SubscribeEvent public void registerBlocks(RegistryEvent.Register<Block> event) { event.getRegistry().registerAll(block1, block2, ...); } And where it says Register<Block> you can change Block to any class that extends IForgeRegistryEntry.Impl. This includes Item. Then event.getRegistry().register... is how you register your Items, Blocks, etc.
    1 point
  2. You also need to override getMaxItemUseDuration
    1 point
  3. Latest log from 13.20.0.2307 test enviroment https://pastebin.com/fkSNbzqC Outline: All damage sources do durability damage to armor. Research: I noticed a couple of mods had situations in which they were damaging player armor and so reported these to the mod authors. (in particular Tough as Nails and Blood Magic) Both active authors told me that they used DamageSource.generic which makes use of bypass armor. Out of a hunch I thought that it may be a forge bug. So I tested by creating minecraft profiles with forge installed from 1.8 through to 1.10 When I noticed that these all complied with bypass armor I started testing 1.11 forge versions. I tried a great deal of different versions until I pinpointed the issue starting in 13.20.0.2307. The bug affects all versions greater than it. The test method was to 1.create a world. 2.equip a set of armor 3.throw a instant damage potion at my feet. I did this with each forge version I tested until I pinpointed its origin at 13.20.0.2307 Note: This also occurs some time into 1.12 but is fixed by 14.21.1.2413 I have not thoroughly tested the 1.12 forge versions. Edit: I pinpointed the 1.12 fix of this issue to 14.21.1.2394 by using the above method.
    1 point
  4. You will have to make a method to do it, I would not necessarily do it before because then you will have to call World#setBlockState more times than necessary. Instead place your building in the world and then clear the area above it. Also do take into account what jeffryfisher said because what he said can and will happen which causes world gen lag because it can spiral out of control. It is called Runaway Chunk Generation.
    1 point
  5. Step through your code (and into calls) in the debugger. See if you notice recursion (if your structure spills into another chunk, then that chunk may generate another structure and so-on).
    1 point
  6. You mean to spawn naturally during world creation, or in response to some event or activity on part of the player? The natural spawns that are associated with the defined biomes, I use something like the following (called by my CommonProxy in the preInit() phase). public void registerEntitySpawns() { // register natural spawns for entities // EntityRegistry.addSpawn(MyEntity.class, spawnProbability, minSpawn, maxSpawn, enumCreatureType, [spawnBiome]); // See the constructor in BiomeGenBase.java to see the rarity of vanilla mobs; Sheep are probability 10 while Endermen are probability 1 // minSpawn and maxSpawn are about how groups of the entity spawn // enumCreatureType represents the "rules" Minecraft uses to determine spawning, based on creature type. By default, you have three choices: // EnumCreatureType.creature uses rules for animals: spawn everywhere it is light out. // EnumCreatureType.monster uses rules for monsters: spawn everywhere it is dark out. // EnumCreatureType.waterCreature uses rules for water creatures: spawn only in water. // [spawnBiome] is an optional parameter of type BiomeGenBase that limits the creature spawn to a single biome type. Without this parameter, it will spawn everywhere. // DEBUG System.out.println("Registering natural spawns"); // For the biome type you can use an list, but unfortunately the built-in biomeList contains // null entries and will crash, so you need to clean up that list. // Diesieben07 suggested the following code to remove the nulls and create list of all biomes BiomeGenBase[] allBiomes = Iterators.toArray(Iterators.filter(Iterators.forArray(BiomeGenBase.getBiomeGenArray()), Predicates.notNull()), BiomeGenBase.class); // savanna EntityRegistry.addSpawn(EntityLion.class, 6, 1, 5, EnumCreatureType.creature, BiomeGenBase.savanna); //change the values to vary the spawn rarity, biome, etc. EntityRegistry.addSpawn(EntityElephant.class, 10, 1, 5, EnumCreatureType.creature, BiomeGenBase.savanna); //change the values to vary the spawn rarity, biome, etc. // savannPlateau EntityRegistry.addSpawn(EntityLion.class, 6, 1, 5, EnumCreatureType.creature, BiomeGenBase.savannaPlateau); //change the values to vary the spawn rarity, biome, etc. EntityRegistry.addSpawn(EntityElephant.class, 10, 1, 5, EnumCreatureType.creature, BiomeGenBase.savannaPlateau); //change the values to vary the spawn rarity, biome, etc. } But if you want to spawn in more specific place that isn't already identified as a biome it sort of depends on your ability to find the conditions then use the standard way of spawning in the world. Basically if you can identify a position to spawn then you can use following to actually spawn: if (!world.isRemote) { System.out.println("Spawning on server side"); String fullEntityName = WildAnimals.MODID+"."+entityName; // put string for your entity's name here if (EntityList.stringToClassMapping.containsKey(fullEntityName)) { Entity conjuredEntity = EntityList.createEntityByName(fullEntityName, world); conjuredEntity.setPosition(locationX, locationY, locationZ); // put the location here that you want world.spawnEntityInWorld(conjuredEntity); } else { System.out.println("Entity not found"); } I'm not really sure how you'd identify a mine shaft as the location though, but maybe others have suggestion.
    1 point
×
×
  • Create New...

Important Information

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