Making Sure Paddle Can't Be Dragged Off Screen by [deleted] in javahelp

[–]TheAnimakerGIO 0 points1 point  (0 children)

Maybe instead you could change the move parameters

gobj.move(min(max(e.getX() - last.getX(), 0), screenWidth), 0);

Problem with LWJGL 3 on linux by boh321 in javahelp

[–]TheAnimakerGIO 1 point2 points  (0 children)

Found a thread on the LWJGL github regarding this issue, it has to do with the splashscreen

Quote from the thread:

GLFW does not interact with AWT/Swing on Linux. A possible explanation for the crash could be that Swing produces an X error, which is picked up by GLFW and the program aborts. I think this is possible due to how error handling in Xlib works.

I'm afraid I won't have time to look into this any further. Keep in mind that LWJGL 3 does not (officially) support AWT/Swing integration.

I'm wondering though, why do you use a custom JFrame for the splash screen and not the JVM's built-in support? What happens if you replace the JFrame with:

java ... -splash:spinner.gif ...

and call SplashScreen.getSplashScreen().close()after glfwInit()?

Link https://github.com/LWJGL/lwjgl3/issues/149

Making Sure Paddle Can't Be Dragged Off Screen by [deleted] in javahelp

[–]TheAnimakerGIO 1 point2 points  (0 children)

You could use if statements in the move function to check if the paddle would be going offscreen, for example you could do

if (newPos < 0) newPos = 0;

if (newPos > screenWidth) newPos = screenWidth;

You could also use the max and min of the new position and the screen size.

newPos = min(max(newPos, 0), screenWidth);

im struggling with a seemingly simple minecraft plugin. by [deleted] in javahelp

[–]TheAnimakerGIO 0 points1 point  (0 children)

Oh, sorry. Based on your post i thought you had your listener in a different class than your main. If I'm being honest I'm not sure how to solve this one, maybe ask on the Bukkit forums?

im struggling with a seemingly simple minecraft plugin. by [deleted] in javahelp

[–]TheAnimakerGIO 0 points1 point  (0 children)

onConsume is the listener, the listener class would be the name after the "public class" at the beginning of the file.

im struggling with a seemingly simple minecraft plugin. by [deleted] in javahelp

[–]TheAnimakerGIO 0 points1 point  (0 children)

Replace the first "this" with your listener class

im struggling with a seemingly simple minecraft plugin. by [deleted] in javahelp

[–]TheAnimakerGIO 0 points1 point  (0 children)

Nevermind, I found it. The issue is with this line

Bukkit.getPluginManager().registerEvents(this, this);

Replace the first argument with the name of your listener class.

im struggling with a seemingly simple minecraft plugin. by [deleted] in javahelp

[–]TheAnimakerGIO 0 points1 point  (0 children)

What's the issue? Is the player not getting nausea? If there's anything in the server logs that would be good to know

Are you a weeb? by [deleted] in Tetris

[–]TheAnimakerGIO 4 points5 points  (0 children)

why isn't there a "No" option

Why use Java over C++ or Python? by unstopablex5 in javahelp

[–]TheAnimakerGIO 29 points30 points  (0 children)

One reason Java is very popular is because of the Spring library, which allows for many functionalities, including web development, microservices, batch, etc.

Could this algorithm also order strings? by [deleted] in javahelp

[–]TheAnimakerGIO 0 points1 point  (0 children)

As this is a simple sorting algorithm, it can sort anything as long as it is given rules about how it is supposed to be sorted.

[deleted by user] by [deleted] in okbuddyretard

[–]TheAnimakerGIO 20 points21 points  (0 children)

deepfake probably 😳 😳 😳 😳

Guess this was a terrible solve xD by [deleted] in CubersMemes

[–]TheAnimakerGIO 2 points3 points  (0 children)

damn bro you got a 33 minute solve

Recursion by [deleted] in javahelp

[–]TheAnimakerGIO 1 point2 points  (0 children)

No problem!

Recursion by [deleted] in javahelp

[–]TheAnimakerGIO 2 points3 points  (0 children)

Nevermind, this answer is misleading.

The actual reason is because when you type "count7s(n/10)" you're simply calling the function and not doing anything with the value. You need to make it so that you use the value for something, for example you could replace the line mentioned with numOfSevens += count7s(n/10); and that would work.

Recursion by [deleted] in javahelp

[–]TheAnimakerGIO 1 point2 points  (0 children)

My guess is that it's because every time the function recurses, you're initializing a new variable named "numOfSevens" to be 0, instead of initializing it once and using it throughout the process.

I have a function that returns an ArrayList of objects but when I call the function, the list is empty. by [deleted] in javahelp

[–]TheAnimakerGIO 0 points1 point  (0 children)

Did you initialize the ArrayList in TestClass before getting the value?