
UberAffe
Forge Modder-
Posts
316 -
Joined
-
Last visited
Everything posted by UberAffe
-
Change vanilla item model based off of name/lore
UberAffe replied to Miclebrick's topic in Modder Support
If you know what the model should be during pre-post Initialization you should be able to just over write the original locations. -
Change vanilla item model based off of name/lore
UberAffe replied to Miclebrick's topic in Modder Support
I haven't done that myself but minecrafts model loader also implements ICustomModelLoader so if you look around through that you should be able to see how they do it. In case you don't know: right click -> the 3 opens are a great way to trace through classes and method calls. -
Change vanilla item model based off of name/lore
UberAffe replied to Miclebrick's topic in Modder Support
The difference for you is that you have a texture to return and you will probably be using IBakedModle instead of ISmartItemModel -
Change vanilla item model based off of name/lore
UberAffe replied to Miclebrick's topic in Modder Support
There is a new way handling models in 1.9. Here is a thread I made that helped me figure it out, might have what you are looking for. -
(fixed) (1.8.9)Model definition for location *item* #inventory not found
UberAffe replied to Anora's topic in Modder Support
pretty sure you have to manually register ItemBlocks. I don't remember if this part was in 1.8.9 or if it was introduced in 1.9 but I think you need to make a class that implements ICustomModelLoader. -
Well apparently I just needed to restart for it to start working since it now works and I haven't touched it since yesterday. -------------------------------------------------------------------------------------------------- this is what I am getting in the log: FAILURE: Build failed with an exception. * Where: Build file 'F:\Minecraft Mods\MinecraftForge\build.gradle' line: 357 * What went wrong: A problem occurred evaluating root project 'forge'. > Cannot run program "git": CreateProcess error=2, The system cannot find the file specified * Try: Run with --stacktrace option to get the stack trace. BUILD FAILED Total time: 8.437 secs I have set up git in sysVars (I can use git command in cmd from anywhere in C:\), the problem is that the git command doesn't work on me secondary drive(F:\) which is where I have all of my coding stuff setup. I haven't been able to find anything helpful. Things I have tried: copy github folder to F drive and setup and add that location to Path Putting the paths in both system Path and user Path variable Combinations of the two altering line 357 to the static path for git manually setting a GIT_BRANCH variable using the contents of line 357 also tried with contents of line 357 but with the static path to git
-
[1.8.9] [Solved] Making an Autoclicker in Minecraft
UberAffe replied to Aulig's topic in Modder Support
That aside there is no need to create a new thread. You can just make a class that implements ITickable(iirc) -
A good starting point would be to figure out how you want a player to "claim" an area The most extreme form of anti-griefing (not letting intruders impact anything) is pretty easy to implement the harder part is determining when someone is intruding and if you want to allow "permission levels".
-
[1.8.9] [Solved] Need help making an automated method
UberAffe replied to Erfurt's topic in Modder Support
All you would need to do is make that method a ClientSide only method and then only call it from the the clientproxy class. -
[1.8.9] [Solved] Need help making an automated method
UberAffe replied to Erfurt's topic in Modder Support
Easiest would probably be to have all of your blocks extend some Abstract class that you make that with a method that contains that line of code. (this class also extends block or whatever you need) Then where ever you need it just call that method. Example: public abstract class InBetween extends block{ public void commonMethod(){ //TODO add your code } } public class MyWall extends InBetween{ //TODO wall code } When you register your walls just add myWallInstance.commonMethod() -
I would only include the armor in the livingAttackEvent for the sake of something like evasion or deflection that completely stops damage and doesn't do the damage animation. I suppose I can increase the damage by the amount the armor would block for the case where the armor is ineffective.
-
What I am planning on doing is have any Resistance capability implement a method for LivingHurtEvent and a method for LivingAttackEvent. In my event handler I will check the Armor slots of the target entity and if any of those have one of the capabilities I will call the respective methods. In the LivingAttackEvent I will check the item/entity that is attacking and if it has on of my damage capabilities and if so I will cancel the event(before checking armor) and re post the event but with the new DamageSource. Since enchantments/ armor value get applied after this event I might just cancel the livingHurtEvent and apply the damage directly.
-
Thats what I was think, I was just hoping I was wrong. I am trying to minorly overhaul the damage system. By adding capabilites to items (tools/weapons/armor) that alter damage done based on Resistances and damage types. For example leather would help against a cutting edge but would do nothing against a hammer. This means that essentially any item or armor could have one of these capabilities regardless of the entity that is using/wearing it. Next question: Since it seems I will likely need to use events for this primarily LivingHurtEvent, when does armor and enchantments get applied to the damage relative to this event?
-
Is there an existing or accepted way of calling a method on a capability that is attached to armor or items based on update. For instance, armor has an update method that gets called while the player is wearing it. If I want the update method on my capability called whenever that updated gets called is there an existing or accepted way of doing so or do I need to come up with something?
-
[1.7.10] Send files between server and client
UberAffe replied to Dijkstra's topic in Modder Support
Depends on how your packet is set up. If you have a single value that is too large, which you might for a serialized image, it won't split up the packet and will throw errors. -
Well then, I wish I had seen that before digging through minecraft code to figure that out. I came to almost the exact same implementation. Would have saved me so much time.
-
lets see if I can explain this in a coherent way All usable parts get registered during initilization on both client and server side. A Part has a SideOnly(Side.Client) method that returns a list of BakedQuads that describe the part. An item (Draftable) has a hashmap of string (relative x,y,z) and part that describes the relative layout of parts. The BakedQuad method in Part takes the relative x,y,z location and applies the offset before returning the BakedQuads. When a Draftable gets registered on the client side a BakedModel gets generated from the compiled list of BakeQuads from the parts. Each Draftable gets registered on the server and then updates the client if needed. Each Draftable is an instance of a CoreType. Each CoreType has a default instance that acts as the item registered with minecraft. I maintain a registry of CoreTypes that a Draftable can be created with and the are all known during initilization. CoreTypes are what house the item code (behave like sword/bow/etc). I have customModelLoader that I assume is working since the items are not purple and black cubes. (On a strange side note when I had another player connect via lan and my item model changed as they walked around me, it ranged from a series of chickens with flapping wings to a giant red circle on the ground) With my admittedly limited understanding of the JSON model system I didn't believe it would be able to handle all the possible combinations of parts + the potential addition of parts from add-ons. Either way I will need to send sync the available Draftables between client and server. I'm also pretty sure that Pre-generating them is out of the question, that would increase load time by a ridiculous amount. As for file size my serialization of items with {5, 16, 32, 64, 256, 512, 1024, 2048, 4096}# of parts is 202KB total so an item with 4096 parts should be around 103KB minus some overhead because that was calculated from a file that was a serialization of a hashmap of draftables. Whereas the 8192 ints (assuming the ByteBufUtils is not compressing it) would be 262KB.
-
I know I can't get away from syncing item information to the player but I'm wondering if the information could be simplified if I could use the model system. Knowing that each part fits within a 1/16th block size and every part has a specific model that is known during pre-postInit. Parts might be added through an api. Is the model system robust enough to handle conditions like this?
-
Yes it is. Players design items using a list of parts and colors (or load a design from a file) and register it with the server. There will be items available by default also. When a player first connects to a server the server will send 1 packet per registered item to the player. After that any time a new item gets registered all connected players will get a packet to sync that item. I am working on a way to store all synced items on the client side so they wont need to be synced again, I still don't have everything figured out everything to make this safe. The information that is getting sent in the sync packet is: name of the item, type of the item(pick,sword, etc) partmap(hashmap<relativeLocationOfPart, part>) part information: color, type of part The partmap is analyzed to determine the properties of the item as well as the model for the item.
-
Title? I have a lot of information that needs to be synced between the player and the server. It isn't essential to sync everything before the player loads. This is essentially a db of item models, I'm still working on a method to only require a full sync the first time a player connects and subsequent connections would only sync the changes since the last sync. But I still need to do the initial sync. So far I have tried two methods of syncing using nbt the first one was just saving the information to nbt normally and the second way was by serializing the information into a byte array and then storing it as a string but both methods exceed the max packet size in more cases than I am willing to cut out. This leads me to believe that I should revisit my method for handling the models. So question 2: If anyone knows the in's out's of the json modeling system, maybe you can help me understand if it can handle what I need. Edit: I was definitely being dumb with the packets, When I sent them as byte arrays it fit into a packet size just fine. However I still would like to avoid syncing so much information so the second question still stands.
-
as far as I know you cannot extend the players attack range with existing methods. You have to write your own left click handler.
-
Still haven't figured out how this is getting all these different models. If anyone has the time and is willing to I would appreciate getting into some kind of chat/screen share to step through this and hopefully get it solved.
-
when you use GameRegistry#addRecipe you should be giving a new ItemStack as result of the recipe (first parameter in addRecipe). There are three params to the ItemStack constructor, instance of the item, number of items in the stack, and metadata(damage).
-
I am confused beyond expression ... I build my mod and made a lan world and had another player connect, this is what my item looks like (yes it includes those chickens in the background) as she moves around it changes. sometimes its chickens sometimes there are bows, once there was even a giant bat. imgur (The guy in red is holding a MeleeCore item that is generated with the name Bluex5 which gets registered during world load event in LiDrEvents.class) Nothing shows up on my client when I am holding the item. (btw I am expecting a small series of 5 blue cubes extended in a single direction) Here is my current project If you want to know where a specific thing is let me know.
-
I am trying to choose the rgba color for the quad to be during runtime. I followed the calls in RenderItem to method in TextureUtil: public static int anaglyphColor(int p_177054_0_) { int i = p_177054_0_ >> 24 & 255; int j = p_177054_0_ >> 16 & 255; int k = p_177054_0_ >> 8 & 255; int l = p_177054_0_ & 255; int i1 = (j * 30 + k * 59 + l * 11) / 100; int j1 = (j * 30 + k * 70) / 100; int k1 = (j * 30 + l * 70) / 100; return i << 24 | i1 << 16 | j1 << 8 | k1; } Which seems to be getting the rgba information correctly and then completely destroying the information ... If my item doesn't have a texture will the tintIndexIn do anything?