-
Posts
76 -
Joined
-
Last visited
Everything posted by Zane49er
-
Yes, thank you. Everything seems to be working.
-
"Team" doesn't seem to even be an option, and thanks for the suggestion, but sorry, I'm going to take that as a last resort.
-
Ok, it's sort of working now... it has stupid git repository reminders EVERYWHERE, but it runs... Do you know how to remove those? as well as being annoying, they obstruct the error reminders.
-
I agree that the "Oxygen" update is stupid. I wish I could go back, but there is zero back-compatibility so I'd have to reset everything... I'll try that then.
-
Yes... though it isn't out of the question that the repository was improperly configured...
-
It says that "either they already exist in this workspace or their project description file is corrupt."
-
https://snag.gy/nC2Rrq.jpg
-
Alright, those worked, but it still shows as empty.
-
It seems that I'll have to install or find JDK... Thought I did that already, but apparently not...
-
Nope, the build failed and the window closed before I could see why.
-
I think this might actually be the problem - it was downloaded to a profile that doesn't exist on the new computer. I'll move it somewhere sensible.
-
Sorry for yet another newbie question, but... I just replaced my computer, and can't figure out how to re-add my code from the repository to my new eclipse install. The code probably isn't necessary, but it's here: https://github.com/zane49er2/VMC I have already tried downloading it and selecting the main folder as a workspace, but that showed an empty workspace with no projects.
-
May be deleted for uselessness, but this path isn't working
Zane49er replied to Zane49er's topic in Modder Support
Thanks. I'm surprised I didn't notice that. The first slash was the cause of the crash, removing it gives the exact result I want: String resourceName = "assets/vmc/BookPages/" + pageID + ".json"; BufferedReader pageScan = new BufferedReader(new InputStreamReader(getClass().getClassLoader ().getResourceAsStream(resourceName), "UTF-8")); JsonObject pageData = new Gson().fromJson(pageScan, JsonObject.class); pageName = pageData.get("name").getAsString(); -
May be deleted for uselessness, but this path isn't working
Zane49er replied to Zane49er's topic in Modder Support
String resourceName = "/assets/vmc/BookPages/" + pageID + ".json"; BufferedReader pageScan = new BufferedReader(new InputStreamReader(getClass().getClassLoader ().getResourceAsStream(resourceName), "UTF-8")); String pageString = ""; while(pageScan.ready()){ pageString += pageScan.readLine(); } JsonObject pageData = new Gson().fromJson(ResourceManager.getString(pageString), JsonObject.class); pageName = pageData.get("name").getAsString(); I guess I should explain why I'm doing this. Before attempting to make this .json file into a string, I was reading a plain text file and reading each line into a variable in an object in an array. The text files obviously started to get really ugly, so I wanted to format it as JSON, which is exactly the format that I was emulating with the arrays. GSON made this mostly easy except that it needs a string for an input. Is there a way I can get this JSON document into a string, or am I missing something that would make this much easier? The code above causes nullpointerexception crash from the inputStreamReader on the second line, which was previously working fine. -
May be deleted for uselessness, but this path isn't working
Zane49er replied to Zane49er's topic in Modder Support
I'm having a hard time understanding what this is doing. What is HardLib and why are you getting its runtime class? How do you go from byte array to something usable? I see the toString method there, but also on the bufferedReader. -
I'm trying to load a text file into a large string variable instead of hard-coding it. That seemed straightforward until no paths worked. I'm trying to use this: String pageString = new String(Files.readAllBytes(Paths.get("/assets/vmc/BookPages/" + pageID + ".json"))); and I'm pretty sure there's a file there, but it's telling me that there isn't. I've also tried the following: "/assets/vmc/BookPages/" + pageID + ".json" MODID + "/BookPages/" + pageID + ".json" "assets/vmc/BookPages/" + pageID + ".json" I've been trying at this for way too long now, and need some sleep. I'll be back to respond tomorrow.
-
Wow, that was the entire problem. I moved the lighting, cull, and blendfunction lines to the top and now it works.
-
Sorry, I am using an old version (1.10.2), but I've seen this issue in other mods, 1.12 is similar in many ways, and I'm too lazy to update at the moment so... If it's absolutely required then let me know, I guess. Using DrawHoveringText makes items drawn afterward appear darker, despite the use of push/pop matrices. Github for my mod is here: https://github.com/zane49er2/VMC but the relevant code is likely here: // Page links/items for (int i = 0; i < bItems.size(); i++) { BookItem b = bItems.get(i); int Tx = (int) (b.x) + xScroll; int Ty = (int) (b.y) + yScroll; float selSpeed = 0.05f; // draw GlStateManager.pushMatrix(); if (Tx >= left && Ty >= top && Tx <= left + GUIWidth - 36 * b.scale && (float) Ty <= top + GUIHeight - 36 * b.scale) { // selection detection if (mouseX > Tx && mouseY > Ty && mouseX < Tx + 36 * b.scale && mouseY < Ty + 36 * b.scale) { b.hovering = true; b.r += selSpeed * (b.rSel - b.r); b.g += selSpeed * (b.gSel - b.g); b.b += selSpeed * (b.bSel - b.b); } else { b.hovering = false; b.r += selSpeed * (b.rn - b.r); b.g += selSpeed * (b.gn - b.g); b.b += selSpeed * (b.bn - b.b); } this.mc.getTextureManager().bindTexture(texture); GlStateManager.enableBlend(); GlStateManager.translate(Tx, Ty, 0); GlStateManager.color(b.r, b.g, b.b, 1.0F); float borderSize = 1f; switch (b.bgType) { case 0: borderSize = 2f; break; case 1: borderSize = 1.3f; break; case 2: borderSize = 1f; break; case 3: borderSize = 1.5f; break; } GlStateManager.scale(b.scale, b.scale, b.scale); this.drawTexturedModalRect(0, 0, 36 * b.bgType, GUIHeight, 36, 36); GlStateManager.disableLighting(); GlStateManager.enableCull(); GlStateManager.translate(36 / 2, 36 / 2, 0); GlStateManager.scale(borderSize, borderSize, borderSize); GlStateManager.translate(-16 / 2, -16 / 2, 0); this.itemRender.renderItemAndEffectIntoGUI(new ItemStack(b.item), 0, 0); GlStateManager.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA); GlStateManager.disableLighting(); } else { b.hovering = false; // explode int Px = (int) (b.x) + pxScroll; int Py = (int) (b.y) + pyScroll; if (Px >= left && Py >= top && Px <= left + GUIWidth - 36 * b.scale && (float) Py <= top + GUIHeight - 36 * b.scale) { for (int j = 0; j < (random.nextInt(100) + 15) * b.scale; j++) { BookSymbol s = new BookSymbol(); s.u = (random.nextInt(5) * 16) + 170; s.v = random.nextInt(3) * 16; s.xv = (xScroll - pxScroll) * 10 + random.nextInt(50) - 25; s.yv = (yScroll - pyScroll) * 10 + random.nextInt(50) - 25; s.x = Px + random.nextInt((int) (36 * b.scale)); s.y = Py + random.nextInt((int) (36 * b.scale)); s.r = b.r; s.g = b.g; s.b = b.b; s.age = 1; s.noFadeIn = true; particles.add(s); } } } GlStateManager.popMatrix(); // tooltip if (b.hovering) { List<String> j = new ArrayList<String>(); j.add(b.name); GlStateManager.pushMatrix(); drawHoveringText(j, mouseX, mouseY, fontRendererObj); GlStateManager.popMatrix(); } // update previous scroll this.pxScroll = xScroll; this.pyScroll = yScroll; }
-
Yep, that was it! thanks again for all the help.
-
good point, I'm still not really used to having access to them... I just managed to decompile Minecraft on Wednesday. edit: hmmm, this: public boolean isGlobalRenderer(TileEntityRift te) { return true; } doesn't work...
-
Alright, I think adding a tileEntity will solve all my problems with the destabilizer. I still have a problem with the GUI, and saving my new rift NBT. The color (eventually it'll be the essences that determine color) is randomly generated, but should, for obvious reasons, only be generated once. Instead, It seems to be determined twice, once when it is placed/generated, and one when it is loaded. This means that the first time you see one, it won't be accurate, but if you relog, no matter how many times, it will be. edit: I'll prob. move this to another thread, since it is a separate and helpful topic to understand. I think the client isn't being updated about the blockata and is rendering its own randoms, but re-logging sends the correct value. This is supported by the fact that using /blockdata also causes the desync.
-
This is what I meant - I had already set the particles to not be distance-related, but the method is called at varying rates as the player moves further away. I found that standing 20 blocks away for a minute will eventually show the sphere, but it fades again and you have to wait. I don't know of any other client-side method that occasionally gets run for every block, so I might have to use another TileEntity? The gold are 5 blocks apart.
-
Currently they immediately stop spawning at a certain distance from the block. I've already made the render not distance related, but the issue is spawning, I think RandomDisplayTick is the problem, but I think the only alternative is making it a TileEntity, which, as I said, are becoming an invasive element of almost everything I'm planning.
-
Is there a way to make the particles spawn even when the player is slightly far away? I don't necesarilly need them when the nearest player is 50+ blocks away, but the point of it is that it outlines an area... I'd like them to render about 20 blocks away.
-
Okay, one more thing: can I make it so it renders no matter how far away you are? Like a beacon, instead of a sign, it is still visible when you are several chunks away. There are a few rifts, signs, and chests surrounding the beam.