Jump to content

Ernio

Forge Modder
  • Posts

    2638
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by Ernio

  1. If I'd have to keep it short: 1. Yes - rendering easy, colision boxes harder, will require ASM or if you can't do that - there is "Player API" and "Render Player API" that would give you full access to player classes. 2. As long as you keep your planets in 256 height - it's just a mattrer of writing good WorldGen. If you want to have "higher" maps then I will stop you right here: Minecraft's chunks are verticall, with more height - more data needs to be loaded/generated when you load new chunk. It was even possible in some beta version (1.9?) to have like 2k height - lagged shit out of game. So BIG NOPE if you want that. You would have to rewrite whole world loaders to work in cubes (so chunks are 16x16x16, not 16xheightx16) for it to work well. There is mod that does it (is there still?) lookup Cubic Chunks (something like that). 3. Easy. Oh and if you want "round" worlds - you probably also want for entites to rotate to stand on ground, no matter what side. There was also mod like that (entities could walk on walls, or ceiling). SO just sayin - it is all possilbe. Tons of engine changes tho. Still less than writing own game - but you know, sometimes it's for the best to write game like it should, not change what was made before. Also - making whole game takes at least 2 years to be even considered good, so just saying.
  2. What do you mean you can't? http://files.minecraftforge.net/ recommended, latest, "show all" - everything that has ever been released is there.
  3. Just a wild idea: We've been talking about X/Z->Y maps and "computation" methods. I think it's worth to mention: I honestly have no clue (never used) about this event but: ChunkDataEvent As jabelar suggested - you could grab highest point once and save it directly to chunk, that is merely 256 (16x16) short values or if you try hard - you can fit that into one byte ("unsigned"). Basically - store 256 byte values with keys "x,z" and one boolean that will tel if this chunk has been ever loaded before (so if not - generate values). chunkData.setByte("15,9", (byte) -60) // obviously -60 is y=68 Then chunk would nicely save its highest points and then you use Load/Save events to get that data in/out of memory. That way you could make everything very clean and make sure data is nicely saved and removed from memory on chunk unload).
  4. A wild guess - you want to auto-send crashes of your beta-testers to your repo somewhere? I suggest reading about JVM itself. MC is running 4 threads (maybe even more, like skin downloads, not sure, never looked). Crashing one thread (e.g running into infinite loop on Server thread) won't necessarily crash others. Program != Thread. Lookup on google on how to deal with it, there is plenty of it, it's just not shipped as forge event, because that is not forge's job. Thread.class itself has exception handlers of some sorts. You could e.g run background thread that will be catching errors from other threads for you and doing stuff with them. Disclaimer:
  5. Hey man, just an opinion passing by. I've been here for a while and I remember, when I started, that I was all about mod/source security. I even tried obfuscating source or trimming it from server classes (2nd I still have leftovers). There is just NO POINT in doing it. Seriously. Release beta, if they spread it - what's the big deal? I mean, there is no real way of providing 100% "safety". Not possible. As to problem - it's really easy if you step outside Java and GitHub. Get hosting, place php script, set keys in secured file. Make http request/response. Literally 1h of work. If you really want to key-checking systems like that I don't think GitHub is right place to do it (opinion).
  6. https://en.wikipedia.org/wiki/Crash_%28computing%29 "...computer program stops functioning properly." That's the thing about crashes, you can't expect them to say: "hey, I just crashed". If you are basing anything on crashes then you are probably doing it wrong. If you want to make anti-crash system: there is no such thing, you would have to save everything per-tick or use direct-memory manipulation and data restoration (which I can't say if is possible in Java, maybe in deep java internals like unsafe). I'll just note that there are ways of making sure stuff is saved when program crashes, but that is ouside Forge (and I am not that good with Java to be smartass here).
  7. PlayerLoggedInEvent Fired by FML on server only.
  8. 1. Why are you storing facing in TE? 2. Post full code and full log (where is it logging this error)?
  9. Client side: 1. Subscribe MouseEvent 2. Check if mouse event == left/right click. 3. Check if you are mounting mech entity 4. If yes - send packet to server using SimpleNetworkWrapper with simple "action ID", nothing more, nothing less (it can even be empty packet in this case). Server side: 1. Receive and hanlde packet: - Check AGAIN if player who send packet is mounting mech. - Check any other requirements (server decides if you can shoot). - Get that mech, use math to calculate arm position. - Offset created bullet entity to position of hand. - Spawn new bullet entity with some velocity at mech's entity (entities have constructor taking entity-to-spawn-on argument) - BOOM, you spawned bullet from hand of mech!
  10. Not really in means of simple "do this" coding. Something like this would certainly require you to store "highest generated Y coord on this X/Z". If you want to go this way you will need to store mapping of X/Z to Y and when block is mined at some coord - add mapping of its X/Z with value of highest Y block. Data would be stored in WorldSaveData. To make map as little as possible you can add mapping only when digged block is actually top-block (the highest in X/Z). Other way to do it would be a PURE computation, which would be quite slow (compared to previous way) When world is generated its seed is set and stays that way. You THEORETICALLY could actually regenerate a chunk in which you dig and check highest block in X/Z pos which then you can compare to one actually mined. Obviously - you do not want to regenerate chunk, but rather simulate it using world's seed, just to see top block in given x/z. Much math and byte manipulations if you actually want to do it well (and not slow). Hope it helps in any way. Just an opinion - 2nd way is actually NOT bad (for me). I personally don't like storing stuff, unless its being hashed (which is fast in future usage). Doing real time computation is not that bad if used only during harvest event and when written well.
  11. You didn't answer all questions, and yes - they are all important and will decide how to code it. If the mech would shoot, the mech will be the one spawning enitity, if it's player - it would be player. Both would trigger differently. Does mech have same rotation as player? What are height differences? Do you want to shoot from mech's arm, or center?
  12. Reflection. Note that MC uses obf names. Use ObfuscationReflectionHelper. To get obf name search srg files (or whatever they are called). Example of getting resourcePack list from Minecraft.class. List<IResourcePack> defaultResourcePacks = ObfuscationReflectionHelper.getPrivateValue(Minecraft.class, Minecraft.getMinecraft(), "defaultResourcePacks", "field_110449_ao"); Note that reflection is few times slower. You most certailny don't want to use it per-tick. Use it as litle as possible. Btw - u sure there is no getter for that? Check callbacks on those fields (where thay are used).
  13. I would never use word "allow" in this case or probably any other. API is just an api. LLib is an API build on top of Forge so basically an extension. It gives you pack of pre-made interfaces and methods that are then handled internally, so you don't have to go through mess of making nice abstraction (it's done for you). Just look at the classes, see what they offer (there are some animation classes). And direct answer - yes, they make is SIMPLER to make animations like in JurassiCraft (I mean, the mod itself uses LLib for a reason).
  14. I just went through whole LLib code and to be honest - there is nothing impressive there (nothing that steps in front of any other API). In my opinion only thing that deserves attention is EntityMultipart. Might be useful, yet still - very easy to implement on your own. Might save reinventing the wheel if by any means your mod would be used with other mods that use LLib, but looking at it - there are only few. Personally I don't like "little" dependecies, your choice tho (it's only an opinion).
  15. 1. NBTs can be null (1st check if stack has nbt) 2. If you have your own sword - do NOT use events. Events are for vanilla (and maybe other mods) only. If it doesn't crash: Make prints after each line - at which it stops?
  16. I don't think that it is. Skins are stored in their own weird way, for one i know that there is hashing involved so even if you could actually pull out .png from somewhere (which you can't?) you would have to know the exact hash of file. In manners of Forge, you do this: AbstractClientPlayer acp = (AbstractClientPlayer) player; acp.getLocationSkin();
  17. That is a double NOPE. 2-arguments constructor of ItemStack is (Item, amount), not (Item, meta). 2nd "NOPE" is that you can apply ANY meta to given itemStack. Meta (also known as ItemStack's itemDamage field) is nothing but a simple integer (saved to NBT as short) that tells you "oh this item has some meta OR some damage". As to real problem, looking for it now (await edit if found). EDIT You messaed up items. In your main class you declared: public static Item item1; public static Item item2; And then, while never initializing them, you used them as result in recipes (nulls). What you did is initialize wrong ones here: (In TestItems) public static Item item1; public static Item item2; public static void init(){ item1 = new Item().setUnlocalizedName("item1"); item2 = new Item().setUnlocalizedName("item2"); } Pick one, init and use them.
  18. https://github.com/TheGreyGhost/MinecraftByExample/tree/master/src/main/java/minecraftbyexample/mbe15_item_smartitemmodel Will require you to spend some time to utilize its full potential. Deal is quite simple: You will need to bake whatever number of items (models) during initialization and then use them in SmartItemModel by pulling them out of registry. Post any questions, but everything you need is in that tutorial EDIT About that "full potential" - in past weeks there has been a lot of additions to model code (net.minecraftforge.client.model). Check them out - they are quite nice.
  19. You have no clue about what are you doing, do you? Please learn basic java (or logic), because if you can't see the the fact that you are using nulls, then I really can't help you, even if I tried REALLY hard, sorry. public Entity p_149670_5_; Also: "decode" your code (names).
  20. Tried to find something, but really can't, Sorry. Obviously I didn't come here to just say that. What I want is to note that you should check out proxies. There are a lot of tutorials on how to work with them. Best simple solutions: http://www.minecraftforge.net/forum/index.php/topic,26267.0.html
  21. Jar modding is not supported as of very long ago (pre-1.6?) Lookup Forge Events, particularly: RenderGameOverlayEvent Note: Mind that this event has phases - always choose a phase, otherwise code will run multiple times.
  22. Always use itemStack.copy() when editing it. (stacks are mutable) When pulling ItemStack from any kind of registry or something - 1st do something like ItemStack tempStack = stack.copy(); Also: HarvestDropsEvent event = (HarvestDropsEvent) baseEvent; Wtf? I really hope you are actually doing it as event, not like this. And: ItemStack drop = event.drops.size() == 0 ? null : event.drops.get(0); drops can be bigger than just size==1 and then you do event.drops.clear(); which clears them all, kinda bad design in my opinion.
  23. Show code and make sure you are calling setBlock only on server (!world.isRemote).
  24. This check is pointless: event.side == Side.SERVER You are alredy on server. ServerTickEvent runs for WHOLE server, twice per tick (phases). 1. You cant use Minecraft.class for server tick event. Minecraft.class in client-side. 2. If you want to check all players - use world#playerList or something (look into world class, there is list of all online players in given world). Overally - you are missing the point of sided methods. world/player in Minecraft is the object of CLIENT, not server. E.g: this check; !Minecraft.getMinecraft().theWorld.isRemote Is literally stupid. Please read more about logical sides and tick events. Also: consider using WorldTickEvent - it runs like server tick, but per-world.
  25. I just updated from ~1420 to 1483 and looked at dem new IModels and all that new stuff... And I am like dis: http://d3dsacqprgcsqh.cloudfront.net/photo/a3YXVe3_460sa_v1.gif[/img] Half of solutions I made in old version seem (only took glance) to be now in Forge - and yeah, I am very happy about that. Rest is replaced by some "what is happening", that I suppose will be nice once I figure it out, but right now I am totally LOST. So basically - I would be glad to hear what class should be used to do what (examples please) and what's with all those retexturing models or layered models? Just not "PerspectiveAware is for perspectives", rather some real examples and usage of special methods like IRetexturableModel#retexture(ImmutableMap<String, String> textures); - I read docs and still don't get how to use it (and when?). Thanks for any info. As of now there is nothing (couldn't find) on net about new updates and models so maybe someone (we) could make some knowledge base of it somewhere? Developers are like "let's make it rain gold" with all this new models code, but in all that "gold" it's easy to miss cool features/solutions. Btw. I fkn LOVE new texture-debug msgs.
×
×
  • Create New...

Important Information

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