• Recently Browsing

    No registered users viewing this page.

  • Posts

    • I got a crash again because of  java.lang.NullPointerException: Rendering screen I think it's becaue of null in registries but I don't kow what to put there
    • ContainerType registration: @SubscribeEvent public static void onContainerEntityRegistry(RegistryEvent.Register<ContainerType<?>> event) { // register a new container here event.getRegistry().register(IForgeContainerType.create((id, inv, data) -> new CheeseGeneratorContainer(id, inv, null)).setRegistryName("cheese_generator")); } GUI opening: @Override public boolean onBlockActivated(BlockState state, World worldIn, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) { if (!worldIn.isRemote()) { TileEntity tileEntity = worldIn.getTileEntity(pos); if (tileEntity instanceof INamedContainerProvider) { NetworkHooks.openGui((ServerPlayerEntity) player, (INamedContainerProvider) tileEntity, pos); } return true; } return super.onBlockActivated(state, worldIn, pos, player, handIn, hit); } Factory registration: ScreenManager.registerFactory(ModContainers.CHEESE_GENERATOR_CONTAINER, CheeseGeneratorScreen::new);  
    • Thanks, it now works For anyone else trying to do this, the final code is: package com.chaoticsoul.evolate.events; import com.chaoticsoul.evolate.Evolate; import net.minecraft.entity.item.ArmorStandEntity; import net.minecraft.nbt.CompoundNBT; import net.minecraft.network.datasync.DataParameter; import net.minecraft.network.datasync.DataSerializers; import net.minecraft.network.datasync.EntityDataManager; import net.minecraftforge.event.entity.EntityJoinWorldEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod.EventBusSubscriber.Bus; @Mod.EventBusSubscriber(modid = Evolate.MOD_ID, bus = Bus.FORGE) public class SpawnArmorStandEvent { public static final DataParameter<Byte> STATUS = EntityDataManager.createKey(ArmorStandEntity.class, DataSerializers.BYTE); @SubscribeEvent public static void spawnArmorStandEvent(EntityJoinWorldEvent event) { if (event.getEntity() instanceof ArmorStandEntity) { ArmorStandEntity stand = (ArmorStandEntity) event.getEntity(); CompoundNBT compound = new CompoundNBT(); compound.putBoolean("ShowArms", true); stand.readAdditional(compound); } } }  
    • by importing build.gradle and run ide/eclipse and fg_runs/genEclipseRuns
    • We also need to see your ContainerType registration, your screen factory registration (and the factory itself) and the code where you open the GUI.
  • Topics

  • Who's Online (See full list)