Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 05/12/21 in all areas

  1. should work... show the complete class Edit: Do you use DeferredRegister to register your items? if yes add .get() behind ModItems.SNG_INGOT
    1 point
  2. The process requires a bit more work then. All worldgen stuff is handled through jsons now. You could probably find how they need to be formatted on the mc wiki. So, just format them according to that. You can also look at slicedlime's vanilla world gen extraction for examples. As for getting it in the overworld. You need to do a few things. Existing dimensions use entries hardcoded to be in code instead of through json making them inaccessible from pure json. To get around this, you have to supply a dummy entry and handle it that way. So, register the biome using any forge registry process and supply some dummy biome to the instance. It will be replaced by the json when the server is loaded. Finally, you will need to call BiomeManager#addAdditionalOverworldBiomes within the synchronous work queue of FMLCommonSetupEvent. This adds your biome to the overworld biomes. Note, that this takes a registry key which can be gotten using RegistryKey#get and supplying Registry#BIOME_REGISTRY as the first parameter and the resource location of your biome as the second. In summary: 1. Create biome json. 2. Registry dummy biome to forge registry. 3. Add biome to overworld biomes within common setup. Any other information can be derived from the primer.
    1 point
  3. List<EntityType<?>> MONSTERS = new ArrayList<>(); void summonRandomMonster() { if (MONSTERS.isEmpty()) MONSTERS.addAll(ForgeRegistries.ENTITIES.getValues().filter((type) -> is type classification monster)) Entity entity = (random EntityType from MONSTERS).create(world); if (entity != null) { entity.setPosition(x, y, z); world.addEntity(entity); } }
    1 point
  4. After tonnes of testings it seems like you CAN'T edit the config file through notepad++, try windows notepad or some other text editor as this works on my side. Hopefully this works for people who has the same problem!
    1 point
  5. It seem that I solve my problem in someway. I still don't know how IModelConfiguration#resolveTexture worked, and I can't get a Material from it now too. But, now I found I can directly call new Material to solve my need. I tried new Material before but it fail at that point in time, because I missed a thing. I need to subscribe TextureStitchEvent, so that I can add my texture to AtlasTexture. @SubscribeEvent public static void onTextureStitch(TextureStitchEvent.Pre event){ if(event.getMap().func_229223_g_().equals(AtlasTexture.LOCATION_BLOCKS_TEXTURE)){ event.addSprite(new ResourceLocation(FoodPower.MODID, "meals/salad/salad_base")); } } So now directly new a Material and transform it to TextureAtlasSprite will work. Material m = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE, new ResourceLocation(FoodPower.MODID, "meals/salad/salad_base")); Thx from everyone who replied this post. But I still open for any better suggestion
    1 point
×
×
  • Create New...

Important Information

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