• Recently Browsing

    No registered users viewing this page.

  • Posts

    • The IStorage is for when your capability is used by other mods. The serialization in your capability provider (this is only for attached capabilities!) is for saving your capability data to disk.
    • I still don't know what causes this to happen, but I overrode the rendering method and manually checked for render indexes to call the appropriate limbs, and it all works now.
    • I tried to spawn a bush inside the nether I had many different tries but i can't get it to work.    I tried it with the BlockClusterFeatureConfig public static final BlockClusterFeatureConfig NETHER_QUARTZ_BUSH = (new BlockClusterFeatureConfig.Builder( new SimpleBlockStateProvider(BlockInit.NETHER_QUARTZ_BUSH.get().getDefaultState()), new SimpleBlockPlacer())).whitelist(ImmutableSet.of(Blocks.NETHERRACK)).tries(1).build();   and here is the code where it should generate the bush public static void generateBushesNether() { for (Biome biome : ForgeRegistries.BIOMES) { if (biome.getCategory() == Biome.Category.NETHER) { biome.addFeature(GenerationStage.Decoration.UNDERGROUND_DECORATION, Feature.FLOWER .withConfiguration(BiomeFeatures.NETHER_QUARTZ_BUSH) .withPlacement(Placement.COUNT_EXTRA_HEIGHTMAP.configure(new AtSurfaceWithExtraConfig((int)0.4F, 0.1F, 1))) ); } } }   I also don't know if there is a better way to generate things like flowers or bushes.   Any Ideas? Thanks in advance!
    • Ah okay so here's what I have on a custom class implementing ICapabilityProvider. The serializers confuse me and I'm not sure what they are for. Is it this when the capability is used in other mods, between server/client, or save/load? public class FissionProvider implements ICapabilitySerializable<CompoundNBT> { private LazyOptional<IFission> instance = LazyOptional.of(CapabilityRegister.FISSION::getDefaultInstance); @Override public <T> LazyOptional<T> getCapability(Capability<T> cap, Direction side) { return CapabilityRegister.FISSION.orEmpty(cap, instance); } @Override public CompoundNBT serializeNBT() { IFission fission = instance.orElseThrow(() -> new IllegalArgumentException("at serialize")); CompoundNBT nbt = new CompoundNBT(); nbt.putFloat("temperature", fission.getTemperature()); nbt.putLong("neutrons", fission.getNeutrons()); return nbt; } @Override public void deserializeNBT(CompoundNBT nbt) { //IFission fission = instance.orElseThrow(() -> new IllegalArgumentException("at serialize")); } } I'm confused on the serializers on the register as well.   public class CapabilityRegister { @CapabilityInject(IFission.class) public static Capability<IFission> FISSION = null; public static void init() { CapabilityManager.INSTANCE.register(IFission.class, new IStorage<IFission>() { @Override public INBT writeNBT(Capability<IFission> capability, IFission instance, Direction side) { return null; } @Override public void readNBT(Capability<IFission> capability, IFission instance, Direction side, INBT nbt) { } }, Fission::new); } }  
    • 1.12 is no longer supported on this forum. Please update to a modern version of Minecraft to receive support.
  • Topics

  • Who's Online (See full list)