Jump to content

DoctorLOGiQ

Members
  • Posts

    34
  • Joined

Everything posted by DoctorLOGiQ

  1. Okay, so after figuring out how to set up a project with 1.13.2 so I can port my mod as planned, I am now finding that the example mod won't even launch, and crashes with an exception: If the example mod won't work, then how is an *actual* mod going to work? I have tried cleaning my .gradle folder and deleting the project folder and re-extracting the .ZIP to try again, each time to no avail. What do I have to do to get this to work?
  2. The whole capability workflow. I don't understand any of it any more. I just need help understanding how to get this working, from start to finish, so that I can actually make full sense of this and be able to do it again from memory in the future.
  3. Yes, I have overridden initCapabilities() and added the ItemHandler capability to it already. It's the rest that's giving me a hard time. There was some stuff involving providers in one person's post, but I don't remember ever having to do that last time. I'm having a very hard time remembering how I did this previously, and I don't have the project files any more thanks to Windows deciding to lock and wipe my HDD once.
  4. Yes, I am aware that the container is the server-side item handling system and the GUI is the client-side textures and text. So I've searched around for days and cannot find a reference or a guide to help me get the ItemStack to hold and store data, I'm not even getting close. This capability nonsense it confusing, and with no examples I can't make sense of it. And I've done this before, a long time ago So if one of you could be so kind as to provide a brief and to-the-point run-down of exactly HOW I can set up this system, I think it would help others too. I do not ask this without having spent a lot of time trying my best to figure it out and looking at a LOT of code. And just to be clear, this item has a max stack size of 1, and the item I want it to store is the same. I would like players to be able to have multiple items of the same type with their respective inventories being unique. And thank you for your responses.
  5. Hello peeps. I have found myself facing an issue that requires some assistance. I am making a class that extends GuiScreen which is the GUI for an item. I need to accomplish 2 things, which *should* be fairly straightforward (he says). 1st: I need the item to be able to store an item. I'm fairly sure this can be done with NBTData, I just need pointing in he right direction, it's been a very long while since I've done anything like that, and I had help. 2nd: I need the GUI to have slots. Now, the item isn't a block, so I'm pretty sure a container is out of the question. I only need 1 slot, and then the hotbar slots (possibly moved to be vertical next to the GUI, possibly not, depends on design choices). That way, the player can insert an item into the slot, and have it stored in the holding item. If anybody can be kind enough to shed light on how to go about doing this, I would greatly appreciate it.
  6. Sure. This is the function. Upon testing, nothing happens, the System.out.println() doesn't even print. I have tested this by killing the Dragon. Each time a new end gateway is spawned, but nothing shows up in the console (and yes, I know Systmem.out.println() isn't the proper way to log, it's only temporary, and works with IDEA). Function: @SubscribeEvent public static void onChunkPopulate(PopulateChunkEvent.Post event) { System.out.println("End chunk population event"); if (!event.getWorld().isRemote && event.getGen() instanceof ChunkGeneratorEnd) { World world = event.getWorld(); ChunkGeneratorEnd generator = (ChunkGeneratorEnd) event.getGen(); int chunkX = event.getChunkX(), chunkZ = event.getChunkZ(); for (int x = 0; x < 16; x++) { for (int y = 8; y < 128; y++) { for (int z = 0; z < 16; z++) { if (world.getChunkFromChunkCoords(chunkX, chunkZ).getBlockState(new BlockPos(x, y, z)).getBlock() == Blocks.END_GATEWAY) { System.out.println("Located gateway! Chunk X: " + chunkX + ", Chunk Z: " + chunkZ + ", Block X: " + x + ", Block Y: " + y + ", Block Z: " + z); } } } } } } Registration (during FMLInitializationEvent? MinecraftForge.EVENT_BUS.register(new VppChunkGeneratorEnd());
  7. Furthermore I have the inability to count to 5, apparently But in all seriousness, why is that a bad idea? Because it works very well.
  8. It depends what Forge version you're using, and how you've done it. For creating items in 1.12, this is my method (not saying it's the best): 1) Create a registration class annotated with: @Mod.EventBusSubscriber 2) Create an object holder annotation and constant for each item: @GameRegistry.ObjectHolder(MOD_ID + ":your_item_name") public static final YourItemClass YOUR_ITEM = new YourItemClass(); 3) Create an array of items and store each item in it. I know this isn't ideal but it works: private static final Item[] ITEMS = { YOUR_ITEM, ANOTHER_ITEM, ETC }; 4) Subscribe to the item registration event and register your items: @SubscribeEvent protected static void registerItems(RegistryEvent.Register<Item> event) { final IForgeRegistry<Item> registry = event.getRegistry(); registry.registerAll(ITEMS); } 3) Subscribe to the model registration event and register your item models: @SubscribeEvent protected static void registerItemRenderers(ModelRegistryEvent event) { for (Item item : ITEMS) { ModelLoader.setCustomModelResourceLocation(item, 0, new ModelResourceLocation(item.getRegistryName(), "inventory")); } } And that's it! For blocks it's a similar process, except you also need to create and register an ItemBlock for each block. Your blocks class should subscribe to the RegistryEvent.Register<Item> event to do this. Make sure for blocks you change the <Item> to <Block>. I hope you find this helpful.
  9. Hey guys. So I have a query, which doesn't come without much code-digging prior to asking. I'm looking for the best way to have my mod detect when an end gateway is spawned. I have tried listening for the event net.minecraftforge.event.ForgeEventFactory.onChunkPopulate(false, this, this.world, this.rand, x, z, false); which is called right after (new WorldGenEndGateway()).generate(this.world, this.rand, blockpos1); in Vanilla's ChunkGeneratorEnd script... but my mod isn't detecting this event. I am using @SubscribeEvent public static void onChunkPopulate(PopulateChunkEvent.Post event) to listen for the event, and I have tried annotating the class with @Mod.EventBusSubscriber and registering it with MinecraftForge.EVENT_BUS.register(...) but to no avail. Am I doing something wrong? How can I detect when the gateways are spawned, preferably with access to the generation code? Many thanks. - Logiq
×
×
  • Create New...

Important Information

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