
UberAffe
Forge Modder-
Posts
316 -
Joined
-
Last visited
Everything posted by UberAffe
-
[1.9] [Solved] IExtendedEntityProperties in Minecraft 1.9
UberAffe replied to RainbowLuigi281's topic in Modder Support
As far as I am aware IEEP is getting phased out completely. It only took about 1 day for me to switch over to capabilities from IEEP, and that includes the time it took me to understand most of what can be done with them. -
[SOLVED] Error com.google.common.collect.Multimap cannot be resolved
UberAffe replied to Daeruin's topic in Modder Support
sounds like you are missing a library, try fixing your build path and look for that library to see if is part of the build path. -
What happens when I come back from coding 2 months later...
UberAffe replied to SapFireMC's topic in Modder Support
java.lang.NullPointerException: Rendering item at net.minecraft.item.ItemStack.getItemDamage(ItemStack.java:265) seems like you might be registering something wrong, or something is wrong your constructor. -
With what you have you shouldn't need to handle syncing, but if you do want to display the spell costs(great idea) you will need to sync information.
-
[1.8.9/Solved] PluginChannel is only working on first login.
UberAffe replied to sirati97's topic in Modder Support
Pretty sure it is because the message you register network.registerMessage(handler, InitMessage.class, 0, Side.CLIENT); can only send messages from the server to the client. You either need to make it a bidirectional packet, which I think you just register twice, once with side.client and once with side.server, or make a second message that you register with side.server and use that one to send information from the client to the server. -
vanilla exp is automatically synced, provided that you are only adding and removing exp using existing methods. For example if you look at what the CommandXP.class they use entityplayer.addExperienceLevel(<int>); but that is working with levels directly not with the amount of exp. If you want to work with exp but not on a level basis, then you would want to look for how exp orbs do it and see if the method they use will handle syncing for you.
-
Project 'MDKExample' is missing required library
UberAffe replied to Werns's topic in Modder Support
I recommend try 1764, I just started a new project with that one a week ago and everything worked with it. Also I've had more luck splitting up the commands into gradlew setupdecompworkspace and gradlew eclipse. -
The easiest way would be to just always send the packet in the playerjoinedWorld event.
-
Ah, I thought EXIT_ON_CLOSE would just close the thread it was in. And I didn't know that I could run it in the same thread, that will make things a little easier.
-
I am trying to launch a JFrame in a new thread when the client presses a key. In the constructor for my window it fails on this line setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); with this as the stacktrace [18:51:14] [Thread-15/INFO] [sTDERR]: [main.java.lidr.thread.LiDrThread:run:23]: java.lang.ArrayIndexOutOfBoundsException: 5 [18:51:14] [Thread-15/INFO] [sTDERR]: [main.java.lidr.thread.LiDrThread:run:23]: at net.minecraftforge.fml.relauncher.FMLSecurityManager.checkPermission(FMLSecurityManager.java:21) [18:51:14] [Thread-15/INFO] [sTDERR]: [main.java.lidr.thread.LiDrThread:run:23]: at java.lang.SecurityManager.checkExit(Unknown Source) [18:51:14] [Thread-15/INFO] [sTDERR]: [main.java.lidr.thread.LiDrThread:run:23]: at javax.swing.JFrame.setDefaultCloseOperation(Unknown Source) [18:51:14] [Thread-15/INFO] [sTDERR]: [main.java.lidr.thread.LiDrThread:run:23]: at main.java.lidr.thread.LightDrafterWindow.<init>(LightDrafterWindow.java:48) [18:51:14] [Thread-15/INFO] [sTDERR]: [main.java.lidr.thread.LiDrThread:run:23]: at main.java.lidr.thread.LiDrThread.run(LiDrThread.java:18) if I remove that line nothing errors but the window doesn't display. I can add more code here if people want to see it but otherwise you can see it on my github
-
you will need to use IMessage and IMessageHandler to send information between the server and client, although you can still use the nbt methods of the class to create and read your message contents.
-
almost, you can't send a packet to the client during any of the init events (seeing as the player/client doesn't exist yet either). You could probably hook into the world load event and send the packet from there, you will just need to have getter/setter methods for those arrays.
-
That was actually helpful, this is what I have come up with since then: IFlexibleBakedModel Vertices I know this would still generate every quad, even unnecessary ones but I'll optimize that after I get it working. 1. Is it ok to leave u,v as 0 since I don't need anything from an actual texture file? 2. What is the scale of a block? Will 16 quads like I have reach up to a full block height?
-
What is likely to happen if you don't sync the config changes is that the client will see two summonings and only one of them will persist. At worst it would require the user to leave the server and reconnect.
-
it looks like you are using the onUpdate of an item, I'm not sure since I haven't done config on items yet, but I think that would cause a desync between client and server. For many things like that the client is allowed to process things on its own for a short amount of time with periodic updates from the server. It shouldn't cause any lasting or major problems, it would just be a stuttering effect as the client thinks it is so far along and then the server says nope your are here. Again not sure if that is true for items.
-
I'm pretty sure you will have to get into packets if you want to sync the information. But honestly packets are not scary once have made your first one. They follow a pretty simple formula that you can practically copy paste whenever you need a new one..
-
Tutorials Tutorials 2 but if you are just starting you should really learn in 1.8.9, by the time you are ready to release anything 1.8.9 will be the standard MC version.
-
I am planning something like this: DraftableBakedModel implements IFlexibleBakedModel{ private List<BakedQuad> quads = new ArrayList<BakedQuad>(); public DraftableBakedModel(IDraftable draft){ HashMap<String, IPartType> parts = draft.getParts(); for(int i = x; x < 16; x++) for(int y = 0; y < 16; y++) for(int z = 0; z < 16; z++) if(parts.contain(x + "," + y + "," z)) quads.addAll(getQuadFrom(parts.get(x + "," + y + "," z), x, y, z); } //x, y, z specify the relative top, left, front, for the part to base it's vertices from. private List<BakedQuad> getQuadFrom(IPartType part,int x, int y, int z){ // part has relative vertex information and RGBA for the color and transparency // that this part should render with. // each part can be thought of as a semi transparent, single color cube // although they may not actually be cubes } } 1. is this the correct place to be specifying a color to render with? 2. it seems like each vertex of Baked Quad only has 1 variable for color, so how do I store the color? 3. if this isn't the way to generate a texture how should I be doing it?
-
1.8.9 trying to understand ISmartItemModel[solved]
UberAffe replied to UberAffe's topic in Modder Support
Alright. Well now that I have boiled it down to generating a BakeQuad I might split that into a new question. Thanks for the help up to now. -
1.8.9 trying to understand ISmartItemModel[solved]
UberAffe replied to UberAffe's topic in Modder Support
I am planning something like this: DraftableBakedModel implements IFlexibleBakedModel{ private List<BakedQuad> quads = new ArrayList<BakedQuad>(); public DraftableBakedModel(IDraftable draft){ HashMap<String, IPartType> parts = draft.getParts(); for(int i = x; x < 16; x++) for(int y = 0; y < 16; y++) for(int z = 0; z < 16; z++) if(parts.contain(x + "," + y + "," z)) quads.addAll(getQuadFrom(parts.get(x + "," + y + "," z), x, y, z); } //x, y, z specify the relative top, left, front, for the part to base it's vertices from. private List<BakedQuad> getQuadFrom(IPartType part,int x, int y, int z){ // part has relative vertex information and RGBA for the color and transparency // that this part should render with. // each part can be thought of as a semi transparent, single color cube // although they may not actually be cubes } } 1. is this the correct place to be specifying a color to render with? 2. it seems like each vertex of Baked Quad only has 1 variable for color, so how do I store the color? -
Logical Minecraft server is single threaded, and actual server can literally have hundreds of threads
-
1.8.9 trying to understand ISmartItemModel[solved]
UberAffe replied to UberAffe's topic in Modder Support
Ok, so right now I have a registry of all available Draftable items that gets maintained server side and a client side registry that gets updated by the server. So I will probably want to generate my model for each Draftable when it gets updated from the server. public DraftableSmartItemModel implements ISmartItemModel{ @Override public IFlexibleBakedModel handleItemState(ItemStack stack) { IFlexibleBakedModel model = null; if(stack.getTagCompound().hasKey(Refs.DRAFTABLE) && stack.model == null) model = DraftableReg.GetModel(stack.getTagCompound().getString(Refs.DRAFTABLE)); return model; } } I assume that this is not unique per ItemStack, meaning that I would have to do it this way and not have model as a private class variable. Next part: From what I can tell I will still need to used BakedQuads for my model. So I looked into BakedQuads and FaceBakery for the vertex information, but what is happing with shadecolor and is this where I would store my RGBA information? This is what is getting stored in shade color from FaceBakery, which appears to be a range of magenta - blue but I really don't know what is going on in that return. I recognize the shift left but thats it. private int getFaceShadeColor(EnumFacing facing) { float f = this.getFaceBrightness(facing); int i = MathHelper.clamp_int((int)(f * 255.0F), 0, 255); return -16777216 | i << 16 | i << 8 | i; } -
I've been looking at examples and reading any tutorials I can find but it's just not clicking for me. I am trying to generate an ItemModel from nbt. I have a set of parts, each part has information about its location(relative to a 16x16x16 cube), it's RGBA and eventually its quad once I figure out how this works. I am trying to stitch this information together to create the model. I am unsure what other information would be need to for someone to actually help, so I will either provide whatever people ask for or do my best implement what I am missing and then bring it back here.
-
[1.8.9] Using capabilities to have a file that serializes data to NBT
UberAffe replied to GalianRyu's topic in Modder Support
If your classes are only using simple types: public class example{ String string; int val; Helper help; } public class Helper{ String info } you can use Example ex = new Example(); String json = GsonBuilder.prettyPrinting().create().toJson(ex. Example.class); and it will give you JSON as a string that you can then write to a file. Reading from the file is just as easy. String json = //from file Example ex = GsonBuilder.prettyPrinting().create().fromJson(json, Example.class);