• Recently Browsing

    No registered users viewing this page.

  • Posts

    • https://forums.minecraftforge.net/topic/91712-supported-version-directory/
    • Hi all, I'm looking to find the 1.12.2 versions of the following imports. Thanks!   net.minecraft.util.ChunkCoordinates net.minecraft.server.management.ServerConfigurationManager net.minecraft.util.Vec3 net.minecraftforge.client.model.IModelCustom net.minecraftforge.client.IItemRenderer net.minecraftforge.event.entity.player.EntityInteractEvent net.minecraft.util.IChatComponent net.minecraft.client.entity.EntityClientPlayerMP net.minecraft.util.MovingObjectPosition net.minecraft.util.EnumChatFormatting net.minecraft.util.ChatComponentText net.minecraft.util.ChatComponentTranslation Thank you in advance!
    • Okay, I thought I had solved it but the the way I did it is very innefective I tried getting the loadedPositions from ChunkManager, and pass it into a method that returns the Chunk from the pos as a long: public void onTick(final TickEvent.WorldTickEvent event) { ChunkManager chunkManager = ((ServerChunkProvider) event.world.getChunkProvider()).chunkManager; LongSet loadedPositions; try { loadedPositions = (LongSet)loadedPositionsField.get(chunkManager); } catch (Exception e) { LOGGER.error("Error on TickEvent Handler (loadedPositions): " + e.getMessage()); return; } for (Long pos : loadedPositions) { ChunkHolder chunkHolder; try { chunkHolder = (ChunkHolder)getLoadedChunkMethod.invoke(chunkManager, pos); } catch (Exception e) { LOGGER.error("Error on TickEvent Handler (getLoadedChunk): " + e.getMessage()); continue; } Chunk chunk = chunkHolder.getChunkIfComplete(); if (chunk == null) continue; ChunkValue chunkValue = chunk.getCapability(ModCapabilities.CHUNK_VALUE_CAP, null).orElse(null); if (chunkValue == null) { LOGGER.error("chunkValue is null"); continue; } chunkValue.incrementValue(RANDOM.nextInt(200) == 0 ? 1 : 0); } } But it erroed when trying to get the loadedPositions   can anyone help with this? or additionally, is there a better way to do this? that doesn't require getting the loaded chunks at all?
    • 1.7 is no longer supported on this forum. Please update to a modern version of Minecraft to receive support.
    • Can't you make the method generic? make it receive a EntityType<T> and then return the entity from it It also seems very redundant, why do you need a method for this, isn't it easier to call EntityRegistry.RANDOM_ENTITY_TYPE.get().create()?   I also don't get why you are using reflections. I suppose you're using Deferred Registries, and the Deferred Regsitry has a method that returns all entries. And if you're not using Deferred Registries, you should
  • Topics

  • Who's Online (See full list)