Recent Events Discussion (RED) Thread

  • The FTB Forum is now read-only, and is here as an archive. To participate in our community discussions, please join our Discord! https://ftb.team/discord
Isn't Forge open source though?
I was going to add a small feature to forge for a small enhancement with the Configuration class (but I needed it on 1.7) however I was stopped by lex because he didn't want any new features into 1.7, all new features need to be in 1.8
 
I never ever copy paste. Never! Not even ideas. I don't care about the license, it makes me feel bad to copy... I will learn it in some way though. Probably through looking at some open source stuff. But never copying!
You will learn it much faster if you copy and modify the code until it works, unless you somehow learn faster by just reading on how to do it. I, and I'm sure other modders do this too, will run into something I have no idea how to do, but someone else has done something similar. I'll look at their code, copy paste what I need, and modify the crap out of it. It's faster than looking up resources to learn what you need to know, and sticks better in your brain (for me at least).
 
I generally try to copy code by typing it myself. I seem to learn better that way.
Then more power to you. I just don't like the notion that copying and modifying/reworking someone else's code is an awful thing to do. It kind of defeats the point of having source code available to the public.
 
I would look at someone else's code and find out the idea behind their implementation. I often look at repositories and see how people do things roughly.
 
Well, it depends on what you want to catch; and reflection is SLOW. You don't want to do that on anything that gets called multiple times per tick or anything that has to do with rendering.
Most of the time an Access Transformer will work much better.
It isn't that slow. Although, it will be for multiple times per tick or rendering. However, you can use some tricks to make events run using Forge events
 
It isn't that slow. Although, it will be for multiple times per tick or rendering. However, you can use some tricks to make events run using Forge events
Just quoting the docs here about Reflection
Because reflection involves types that are dynamically resolved, certain Java virtual machine optimizations can not be performed. Consequently, reflective operations have slower performance than their non-reflective counterparts, and should be avoided in sections of code which are called frequently in performance-sensitive applications.
 
Yeah it is slower, but it isn't absurdly slow.
We're talking about a game engine that allocates and discards hundreds of thousands of objects willy nilly. Until someone benchmarks two realistic implementations in-game and demonstrates a statistically significant difference between the two, I think it's just noise.
 
We're talking about a game engine that allocates and discards hundreds of thousands of objects willy nilly. Until someone benchmarks two realistic implementations in-game and demonstrates a statistically significant difference between the two, I think it's just noise.
I like your style ;)

Also, ASMing all over the place is a terrible idea. Reflecting isn't really bad, but doing ASM in the same place as others can be very very bad...
 
I like your style ;)

Also, ASMing all over the place is a terrible idea. Reflecting isn't really bad, but doing ASM in the same place as others can be very very bad...
I think the point I am making here is that you should make an access transformer anyways, it might not make a lot of difference, but overall you will have an easier time managing your code since you just put in a field you want to be public into your access transformer and forge makes it public, reflection means you have to deal with the extra step of going through the whole Field system which is ok but its easier to simply just say EntityPlayer.sleeping than 3 lines to get the field, set it accessible, and get the value. Access Transformers are completely safe, but the Class Transformers are where the issues arise
 
  • Like
Reactions: Strikingwolf
I was going to add a small feature to forge for a small enhancement with the Configuration class (but I needed it on 1.7) however I was stopped by lex because he didn't want any new features into 1.7, all new features need to be in 1.8

Just add it anyway.
Its an open source public api designed to help modders by providing these sorts of functions- the version of MC shouldn't matter.
(given the vast majority of modders are using 1.7, this kind of behaviour somewhat detrimental to the modding community as a whole.)

Kinda makes me wonder if Lex is actually up to the job.
 
Just add it anyway.
Its an open source public api designed to help modders by providing these sorts of functions- the version of MC shouldn't matter.
(given the vast majority of modders are using 1.7, this kind of behaviour somewhat detrimental to the modding community as a whole.)

Kinda makes me wonder if Lex is actually up to the job.

I wouldn't go that far. He is only one person. Maybe he needs a lieutenant to maintain a 1.7 branch with minor things like this in it. Kind of like how Linus Torvalds is in charge of the latest main Linux kernel, but there are a few people who maintain a few versions back for a while.
 
Which brings up a good question: How would one set a convention for the ore dictionary and enforce it? Perhaps have some type of official panel at a con.

I wouldn't say enforce it. Everyone codes somewhat differently, and given the range of mods available it could be somewhat inappropriate to force it all to be the same. Think of it like RF.api- its optional, but within mods thats appropriate to adopt it; it works.
(thats the theory, I have no idea how it could actually work in practice)
 
I wouldn't say enforce it. Everyone codes somewhat differently, and given the range of mods available it could be somewhat inappropriate to horse it all to be the same. Think of it like RF.api- its optional, but within mods thats appropriate to adopt it; it works.
(thats the theory, I have no idea how it could actually work in practice)
Reading with the xkcd plugin is great :P