Jump to content

Sleepwalkerx

Members
  • Posts

    21
  • Joined

  • Last visited

Everything posted by Sleepwalkerx

  1. Hello. I want to make a custom render of an item in the inventory. I need its texture to crawl out of the inventory slots. To make it clearer, I have provided a screenshot. I do not quite understand how to do this, please tell me. If you're wondering why I'm doing this. I do this to create some kind of animation effect on the subject and without going beyond the inventory I cannot do the way I want. In principle, if I understand how it all works, it will get better.
  2. Thank you very much for your answer, but while I was waiting for the answer I figured it out myself. Thanks to the developer Botania, I took an example from there. However, I have another question about the GUI, I have already posted it on the forum. Thank you very much for your help!
  3. List scroll button not working in my Scene. As an example, I took "ModListSceen" and did everything the same as there, but when I click on the scroll bar, nothing works. Please, help. Here is my code: public class EntityListWidget extends ExtendedList<EntityListWidget.Entry>{ private final ResourceLocation img = new ResourceLocation(ArchitectsDream.MODID, "textures/item/dark_dust.png"); //private final int listWidth; public EntityListWidget(Minecraft mcIn, int width, int height, int top, int bottom) { super(mcIn, width, height, top, bottom, mcIn.fontRenderer.FONT_HEIGHT * 2 + 8); //this.listWidth = listWidth; } public void addEntryTo(String str){ addEntry(new Entry(str)); } public class Entry extends ExtendedList.AbstractListEntry<Entry> { private final String text; public Entry(String text){ this.text = text; } @Override public void render( int entryIdx, int top, int left, int entryWidth, int entryHeight, int mouseX, int mouseY, boolean p_194999_5_, float partialTicks ){ minecraft.fontRenderer.drawString(text, left + 2f, top + 2f, 0xFFFFFF); //AbstractGui.blit(getLeft() + 10, top + 20, 0, 0, 16, 16, 64, 16); } } } I also initialize and render my list. It's worth noting that scrolling the mouse wheel works.
  4. Hello. In my mod, I need my item to open the gui when the left mouse button is pressed and change the properties of the same item. I figured out how to open my gui with -> NetworkHooks :: openGui. However, I have 2 questions. 1) How to transfer the subject on which I opened? 2) How the client and server parts work. That is, I do not understand how to change the nbt tag of an item from Sceen(such as pressing a button), which works on the client, and so that this is on the server? Also, I essentially need to register my Container with Forge, but this registration is done through the IFactory method, which forces it to adhere to one pattern. In general, please help me to understand this all in advance thanks. I also wanted to ask for a bonus, is it possible to open Gui by their registration id? MC version ->1.15.2
  5. Thank you more for your help, I don't even know how to thank you However, in "gratitude" I would like to ask one more question. The fact is that my Manager supports 3 types of files and for each I have my own deserializer. And this order of events does not quite fit in with the Forge ReloadListener, where the T type is essentially the file extension that is obtained after preparation. (like for example the same RecipeManager passes keys and JsonObject). In this case, is it better to inherit from IFutureReloadListener or can you do something differently? (To put it simply, I wanted to say that the apply and prepare methods and the type T are not entirely appropriate and unnecessary). I hope you understand what I mean
  6. public ArchitectsDream() { final IEventBus eventBus = FMLJavaModLoadingContext.get().getModEventBus(); eventBus.addListener(this::commonRegistry); eventBus.addListener(this::clientRegistry); eventBus.addListener(this::server); } "clientRegistry" and "commonRegistry" work
  7. No, nothing starts. As I described the problem, I need a recipe file reloader. A very similar class -> RecipeManager. You gave a class that is not present in 1.15.2. How to be in this version?
  8. Oh sorry i forgot to provide the version. my version is 1.15.2. as far as I know, what you anticipated for 1.16.x
  9. my mod has a "StructureManager" that overrides the ReloadListener <?> method. How do I register this listener correctly? I created a Listener based on RecipeManager and saw that it registers to MinecraftServer. However, nothing works for me. Here is an example of my registration code: private void server(final FMLServerAboutToStartEvent event){ LOGGER.info("SERVER ^>>>"); event.getServer().getResourceManager().addReloadListener(structureManager); } Thank you in advance for your cooperation.
  10. my mod contains its resource files. For example, as FORGE has "recipes", which is taken from all mods, I also have a similar folder. How to get it from all loaded mods, if any?
  11. How to get the "data" folder from all mods that are registered with FORGE(and if it exists)? I know the ModList class, but I don't quite understand how to use it. It is desirable that "Path" be returned to me.
  12. By scripts, I mean the mods folder, from where all mods are loaded. I do not want to clog it up and my mod will create a separate folder in the game directory from where I will take the files. However, I need to somehow, in addition to the main catalog of the language file, load files from another folder. So I would like to know how to add my own language file? (Deserialization is familiar to me, the question is in the FORGE method). Yes, I was told that it is better not to do this, but I just do not see a better way.
  13. Okay, then I have a different question. Will Forge load the mod without scripts, only with asset or data folders?
  14. Hello, I am faced with the problem of connecting my own language files to the rest loaded from my mod (assets / modid / lang /). I want to, in addition to the folder of the main language files of my mod, also download files from another location, which I myself will prescribe. This is necessary for my mod, please help me with this, I cannot understand how the standard FORGE implementation of this works. Written with the help of a translator, there may be errors. Minecraft version 1.15.x - 1.16.x
  15. I want to create a function to rotate a block while holding the mouse (component renderItemAndEffectIntoGUI). However, when I try to change the position of the object along the x axis with the function -> [GlStateManager.rotate] for some reason the position of the object along the Y axis changes. I realized that this is due to the fact that the coordinate reporting point is not in the center of the object. The question is, how to rotate an object so that it stays in the same place? The GlStateManager class is quite large and I just don't understand some of the functions, since there is no tutorial on this, but maybe you can help me with this. Thank you!
  16. Yes, that is right. But I want to implement it exactly on the example of loading the structure. Let's say there is a house structure (this is a separate file, where everything is written, where is which block), then the file is deserialized and you need to display this structure. It really looks like the player model in the inventory, but differs in that you need to somehow connect all the blocks together.
  17. Yes, that is right. But I want to implement it exactly on the example of loading the structure. Let's say there is a house structure (this is a separate file, where everything is written, where is which block), then the file is deserialized and you need to display this structure. It really looks like the player model in the inventory, but differs in that you need to somehow connect all the blocks together.
  18. Hello. I want to implement the display of a three-dimensional multi-block structure in the GUI, which the player can rotate as he wants. At the moment the problem is in the implementation of the display of this, since I want to implement it on the example of rendering the world and chunks. That is, my structure essentially consists of blocks, which are also reduced by the player on the GUI. The implementation method via itemRender ("inventory") does not suit me. I've been digging into the game code for a very long time and I just can't find what I want. I ask you to show me exactly where I can find out the implementation of what I want from the source (well, or your ideas) P.s -> wrote through a translator, there may be mistakes ^)
×
×
  • Create New...

Important Information

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