Jump to content

Major Squirrel

Members
  • Posts

    117
  • Joined

  • Last visited

Everything posted by Major Squirrel

  1. Did you re-syncronize the gradle build ? Also, try to run genIntellijRuns task if you didn't do it.
  2. Did you try adding the line diesieben07 pointed out into the builde.gradle file ?
  3. @SideOnly=Server will not keep the annotated code out of the compiled jar, so it will not work for the public version of the mod and it's not needed for the private version @Major Squirrel: I don't know how much code you will actually have in common between the "public" and "private" version of the mod but, again, I'll suggest to go with 2 distinct and separate mods (and 2 separate projects) to keep things clean and separate and to define an API to let the 2 mods interact with each other (if you end up with more than a couple of interfaces see the @API annotation) Z Hey guys, Thank you for you replies. It helps me to understand better the way Minecraft Forge works. I think I'll go for 2 separated projects for now because of the lack of knowledge. But if I had to create two separated jars from the same project, how could I accomplish this ? I thought about two maven tasks but I suppose this isn't the best way to do this here...
  4. I'm not an expert on log4j, but I don't think it's possible to configure an individual Logger . You can include a log4j config file in your mod, but this overwrites the existing configuration provided by Forge. That's right ! For about 1 hour I did some tests : if you put a config file into the classpath (ex. the resources folder), the config is loaded automatically at start. Apparently, the version provided for FML is log4j 2.x which means that the config file must be called "log4j2". Sadly, I couldn't make it so that the config I provided does not overwrite Forge's config and goes on my own Logger ... (I work on console, not files) If someone succeeded on this task, I would be grateful to share the answer.
  5. Hello Choonster, Does this mean that we can't configure our own Logger anymore?
  6. Good morning, I would like to configure my own logger so that I can display some color into my console. I managed to get a Logger according to the FMLPreInitializationEvent : /** * Get a logger instance configured to write to the FML Log as a parent, identified by modid. Handy for mod logging! * Configurations can be applied through the <code>config/logging.properties</code> file, specifying logging levels * for your ModID. Use this! * * @return A logger */ public Logger getModLog() { Logger log = LogManager.getLogger(modContainer.getModId()); return log; } The doc tells us to configure through a logging.properties file. However, it seems that it doesn't take the file into account. This is the logging.properties file. Have you ever done this ? If yes, could you show me the way ? EDIT : sorry, forgot to tell --> using Windows & Intellij IDEA 15.0.3. I'm aware that IDEA console is independent, which requires a lil' plugin to work with colors. I'm just trying to do this on windows console.
  7. Hi KriszDev, Did you take a look at MineMaarten's YouTube channel and his multiblocks tutorials ? Do you think they still work for 1.8 ?
  8. Hello jeffry, Thank you for you tip, I'll try to organize my code there are two separated packages, client and server. However, I don't really understand well what are you meaning by "use-case for @SideOnly server files and a serverProxy to ref them" ?
  9. Hey guys, Exactly, I don't really mind if clients want to take a look at the client mod code. I just don't want to expose the server part publicly. For the moment (just for infos), I'm adding a connection pool for the server part but I'm having problems adding the lib to the jar using Forge Gradle. In fact, I don't really know how to create my own gradle tasks so that I can generate client build and server build at the same time (or separately), using Forge Gradle.
  10. Thank you Ernio for your answer ! Yup, the client has not to work in singleplayer on purpose, it is for a private server. I will do some extensive researches about Minecraft/Forge networking. Why do I want to do this way ? This is a goal I set myself and that I would like to accomplish. Thank you guys for your answers, I will keep you informed and surely will need your help later.
  11. I'd like to make a mod that handles client stuff for modded client, and a mod that handles server stuff (including quest system and database system) for the modded server : in itself, it is the same mod but separated in two versions: one for the client and one for the server. The thing that I would like to achieve is to separate the tasks so that the dedicated server hasn't the client code and the modded client haven't the server part. The client shouldn't have the packet handling that the dedicated server do. The server aswell shouldn't have the client handling (like input or gui rendering) that is reserved for clients. Hell, well you gave your explanation, my prev post is quite irrelevand aside from fact that modding has been made SIDE-UNIVERSAL. Do tell - do you want to achieve what you want to achieve because: 1. Privatization of code (e.g coding for private server). 2. Lowering size of files for players to download. 3. Don't know why and you think that it will be better, when in reality - it really won't. 4. When you say "database" you actually mean embedded DB engine that you think is useless for clients, thus you go back to point 2. with addition of "useless code". Good morning, The first thing you point out is exactly what I would like to accomplish : privatize the code so that the client can't be aware of the embedded DB engine. (and yes, by database I meant embedded DB engine) This is really easy for a player to be aware of the code by opening the jar file and exploring some classes. That is why I absolutely wanted to separate client and server tasks into two different jars. Unless you know a cleaner way to achieve this, do you think it is still possible to do this ? EDIT: That is, you understand where I was getting !
  12. Hello @Failender, Is this the only constraint to connect a modded client to a modded server ? For TL;DR, I'd like to make a mod that handles client stuff for modded client, and a mod that handles server stuff (including quest system and database system) for the modded server : in itself, it is the same mod but separated in two versions: one for the client and one for the server. The thing that I would like to achieve is to separate the tasks so that the dedicated server hasn't the client code and the modded client haven't the server part. The client shouldn't have the packet handling that the dedicated server do. The server aswell shouldn't have the client handling (like input or gui rendering) that is reserved for clients. I don't know if I can make myself understood in fact. EDIT : is there any documentation that explains the forge versioning/compatibility that you point out ?
  13. Good evening, I'd apologize in advance for the lack of visual code, my problem is purely based on concept understanding that I need to clarify in my mind. It has been about one year that I have "forge modding times", all repressed by studies or a lack of understanding : I'd like to correct the latter. Doing some research on google, I have found a good explanation of "how client and server sides" are separated in Minecraft thanks to The Grey Ghost. (This topic is dated on 2013 but it seems to be still valid) From what I understood, a modder is able to create a mod with client side and server side for both dedications : when launched in singleplayer, the server side is still handled by the "client program" while in multiplayer, the server side is nicely handled by the "server program" but putting client code in it is kind of useless. Let's say that a modder would like to open a forge modded server. Within, he would like to create a "quest system" where data are stored in a database. The modded clients can access to this server and use the quest system : the modded client asks for a quest (e.g pressing a button) and the servers responds using packets to the client. In this hypothesis, the modded client just has to handle client input (button), packet requests (and responses obviously) and quest rendering (gui) while the modded server has to handle the research (specific quest in db), and packets req/res. In this case, all tasks are well distributed to their dedication. The point that I don't understand very well is : how to achieve this, knowing client and server have to get the same mod so that the client can connect to the server. I might be wrong for the last sentence, in which case I'd like some explanations on it, but I already encountered some errors where I couldn't connect to the server due to mods difference. For maintainability and common sense reasons, it would be obvious to not put all the database system in the modded client. Furthermore, I would like to clarify that modded clients cannot play in singleplayer (which is a little bit obvious, without database system it would be pointless). I think I have a clue but I'm not sure : the solution would be to implement the packets differently in both client and server, so that client and server would be compatible and the quest system would be well done at packets implementation. I would thank you in advance for any help or clarification on this, that would be valuable to me, to better understand this principle.
  14. Let's say you have an AwesomeBlock that extends Block. The following class prototyping is : public class AwesomeBlock extends Block The class Block contains a method called getBlockName(), that displays the name of the Block. By default, it displays "Block !". Because you extended Block to your AwesomeBlock, you can call the getBlockName() method from an AwesomeBlock object. AwesomeBlock block = new AwesomeBlock(); block.getBlockName(); This will display : "Block !". Why ? Because you have not overriden the getBlockName() into your AwesomeBlock class. After all, you want the getBlockName() function to display "Awesome Block !", so you have to @Override the getBlockName() method into your AwesomeBlock to let it display "AwesomeBlock !". In your AwesomeBlock class, you have : @Override public void getBlockName() { System.out.println("AwesomeBlock !"); } and then, if you call the getBlockName() method from your AwesomeBlock, it will now display "AwesomeBlock !". This is "overriding". See this link for more infos.
  15. Hey there, I'm using Forge 11.14.3.1502. I'd like to justify text in Minecraft (not left or right, justified), and it seems that it's not possible due to char width variation. I created a function that breaks a String into lines (visually), from char width : public void drawQuestText() { String currentLine = ""; int currentWidth = 0, offset = 5; int index = 0; while (index < this.string.length()) { if ((currentWidth + this.fontRendererObj.getCharWidth(this.string.charAt(index))) <= this.maxPixelsPerLine && this.string.charAt(index) != '\n') { currentLine += this.string.charAt(index); currentWidth += this.fontRendererObj.getCharWidth(this.string.charAt(index)); ++index; } else { this.fontRendererObj.drawString(I18n.format(currentLine, new Object[0]), (this.width - this.bgWidth) / 2 + 5, (this.height - this.bgHeight) / 2 + offset, 4210752); currentLine = ""; currentWidth = 0; offset += this.fontRendererObj.FONT_HEIGHT; if (this.string.charAt(index) == '\n') ++index; } } if (currentWidth != 0) this.fontRendererObj.drawString(I18n.format(currentLine, new Object[0]), (this.width - this.bgWidth) / 2 + 5, (this.height - this.bgHeight) / 2 + offset, 4210752); } Result : where this.string could be any string/text you want and this.maxPixelsPerLine is equal to 238 pixels. this.bgWidth and this.bgHeight are equals to 248 and 166. This is not really efficient. Do you guys have any ideas to accomplish this ?
×
×
  • Create New...

Important Information

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