Jump to content

UntouchedWagons

Members
  • Posts

    156
  • Joined

  • Last visited

Everything posted by UntouchedWagons

  1. Why did I think that sender in a single player environment is an instance of DedicatedServer? PEBKAC I guess.
  2. The subject bar is not long enough for my question In CommandBase.execute, the sender argument can be an instance of EntityPlayerMP or DedicatedServer depending on where the command is run. If the command is ran from the server command line, sender is DedicatedServer but if the command is ran from single player chat, sender is also DedicatedServer. How can I discriminate between these two? My command can't be ran from the server cli because the server sends a message to the client to do some rendering that wouldn't be available server-side.
  3. Yeah because I haven't pushed any code that uses the packet system to my github because I have a jenkins server that autocompiles whenever I do a push and I didn't want people to download builds that would compile but not run.
  4. I'm sending the packet via a SimpleNetworkWrapper object. Originally my mod was to be all client side and it was working fine, the items and blocks were being rendered without a GUI but when I tried to add IndustrialCraft 2 support, none of its machine recipes were available so I'm making my mod require a server component to accurately get all the recipes.
  5. I plan to update to 1.10.2. My mod exports item, recipe and mod information to JSON files to be used by a web application which also uses the item/blocks' icons to make it easier to tell what it is you're choosing which I use some OpenGL for. The recipes are collected server-side and then sent to the client. When this is done the server sends a recipe list completion packet then the client exports item, block and mod info then renders all the icons and saves them to files.
  6. I need to do some OpenGL stuff in one of my packets (rendering items/blocks and saving them to files) but the OpenGL calls fail because there's no opengl thing associated with the thread, so I need to do this stuff on the main thread. I know you have to schedule an object through the World object or something but I'm not sure how to actually do it.
  7. I might need a hint as to what classes I should look at. I suspect the I18n class and LanguageMap class in net.minecraft.util.text.translation
  8. I tried passing in an ItemStack, that wasn't it List<String> languages = new ArrayList<String>(); languages.add("en_US"); Locale testLocale = new Locale(); testLocale.loadLocaleDataFiles(Minecraft.getMinecraft().getResourceManager(), languages); ItemStack stack = new ItemStack(Items.IRON_INGOT); FMLLog.bigWarning(testLocale.formatMessage("%s", new Object[]{stack.getUnlocalizedName() + ".name"}));
  9. Is it possible to get a list/array of all available languages and the display names of every item in every language without having to change the set language of Minecraft?
  10. For my resource dumper mod I'll need to add support for potions. In a previous iteration I had to hard code due to how horrendously bad potions were handled in 1.7. However now, potion sub types are handled through NBT tags and getting all the subtypes actually works properly now. But is there a way for getting the potion recipes yet? How do mods add custom potions?
  11. For my Resource Dumper mod I'm working on, I loop through the Item Registry then loop through each sub-type given by the getSubItems method and save each ItemStack in an ArrayList assigning it a random UUID. Then as I go through each recipe I look for the ingredient and the aforementioned arraylist to get the UUID. All of this info is stored in JSON files, the items (dubbed resources) in its own file and the recipes in its own file with the ingredients referencing items in the resources file. Now for the most part this system works perfectly. However my mod is not able to find information about certain blocks like slime blocks, hay bales, blocks of coal; redstone; lapis; emerald, etc. I suspected this to be because when a Block is given to an ItemStack, the block is wrapped in an ItemBlock instance and this would cause ItemStack.isItemEqual to give a false negative. I ruled this out because my resource dumper is able to equate Quartz Slabs and Chiseled Quartz Slabs when using the former to make the later in a recipe. This leads me to believe the cause is a metadata/nbt quirk which leads me to my question: Where does Minecraft (and Forge I suppose) create the recipes for all its blocks and items so that I could rule that out as a possibility?
  12. Not so. Botania lets you transmute one type of fish into another, and some fish are used as ingredients in recipes. For example to make Thaumcraft's Boots of the Traveller you need some sort of fish. So my mod would need to know about all the different sorts of fish for those recipes to be valid. Although I'd probably cull the transmutation recipes because those would cause infinite recursion issues. Yes this is correct and why I wanted to get all the stuff server side since it's authoritative. The main problem is that the recipe list could get quite large and would need to be split up across multiple packets since packets have a limit of 1 megabyte. I'd need a way to break the big recipe list into 1048572B blocks and somehow make the receiver smart enough to rebuild the list client side.
  13. Would I register one of these in preInit, postInit, or someplace else?
  14. I guess I really don't have much of a choice in the matter. Is it possible to have client-side only commands or some sort of manual trigger that doesn't require that my mod be installed server side that can kick the whole process off?
  15. On previous servers I've played on, we've tweaked the pack by simply disabling mods server side and leaving them installed client side. If an admin were to use my mod in such a setup, the mods that have been removed server-side would have their items and recipes show up in the data files which I wouldn't want. Filtering the items I would be easy if I could get the server-side list of installed mods, but filtering recipes I suspect would be difficult.
  16. I'm making a mod that gets all the available items and their recipes and send them to the client to be stored in text files as JSON. This mod will be part of my replacement to my http://mcresourcecalculator.info/ website which I made ~2 years ago. Now I know I could collect the items and recipes client side but I considered that to be potentially problematic because a client can have more mods installed than the server it is connected to and I'm not sure how I'd deal with that. The whole process is kicked off by a chat command rather than at startup in the postInit event (or similar) because of mods like MineTweaker.
  17. Part of my mod requires iterating through the Item Registry and getting all their subtypes and I was planning on using the Item object's getSubItems method, but that doesn't exist server side. Is there something I can use server-side to get all the subtypes of an Item object?
  18. In 1.7.10 I did this to get the modid that added the given Item: public static String getModId(Item item) { GameRegistry.UniqueIdentifier id = GameRegistry.findUniqueIdentifierFor(item); return id == null || id.modId.equals("") ? "minecraft" : id.modId; } public static String getModId(ItemStack key) { return getModId(key.getItem()); } However in 1.9 the GameRegistry class does not have the `findUniqueIdentifierFor` method anymore it seems. What's the correct way in 1.9?
×
×
  • Create New...

Important Information

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