Jump to content

Recommended Posts

Posted

Hello! the mod I'm working on requires me to generate an image based on the player's perspective - similar (but not exactly like) a screenshot, in order to be used to generate a texture for a block (or entity, haven't figured out which is ideal to use yet)

However, I've already hit a standstill, as I simply can not figure out a good way of doing this. the image is generated once, and simply instructing the client to take a screenshot, crop it, and send it to the server to assign the texture doesn't seem like the best idea for a few reasons:

1. if it's a screenshot, the player's texture pack will be taken into account - not ideal, but I can live with it arguably a good thing, but the potential for art-style clashes concerns me.
2. UI would be on the painting, and I don't believe for a second that there isn't a better way to circumvent that issue than disabling UI for a frame, taking the screenie, and reenabling UI before sending it to the server.


Note that I am for lack of a better word, a Peabrain - and this is my first serious attempt at making a mod. Yes, I know Java.

Posted

Check out ScreenShotHelper to see how screenshots are made. Thankfully it's a pretty painless process there. You may have to transfer pixel data from a NativeImage to a BufferedImage to do more complex image editing operations, however. I'd need to experiment with it to figure out the exact method for that.

As for your concerns:

  1. Sadly I don't know of any clean workarounds for texture packs. Shaders and other client-side graphical mods would also be hard to work around. The process for any such workaround would certainly be way out of my skill set.
  2. To take a screenshot without the hud, use RenderGameOverlayEvent.Pre filtered by the ALL type and run the code there. It will also work when an overlay screen (like the inventory or pause menu) is being displayed since the event triggers before they render. You may want to use a higher event priority to ensure your code is run before other mods' code.

I'm eager to learn and am prone to mistakes. Don't hesitate to tell me how I can improve.

Posted
9 hours ago, Pacmandevil said:

and send it to the server to assign the texture

Why are you sending the texture to the server anyways? The server doesn't deal with assets at all. Are you trying to make this image the same across all players?

 

9 hours ago, Pacmandevil said:

Hello! the mod I'm working on requires me to generate an image based on the player's perspective - similar (but not exactly like) a screenshot, in order to be used to generate a texture for a block (or entity, haven't figured out which is ideal to use yet)

What exactly are you trying to do. Why are you needing to generate an image? More specifically why can't this be done before runtime? What is the exact thing you want to do from a users perspective?

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Posted
14 hours ago, Animefan8888 said:

Why are you sending the texture to the server anyways? The server doesn't deal with assets at all. Are you trying to make this image the same across all players?

 

What exactly are you trying to do. Why are you needing to generate an image? More specifically why can't this be done before runtime? What is the exact thing you want to do from a users perspective?

Yes, the image should be the same across all players.

It can't generate the image pre runtime, as there wouldn't be an image to generate - it's decided on runtime. I'm trying to Make a portal that renders the opposite side once, and does an effect when it's used akin to mario 64's paintings.

From a user's perspective:

Right click with magic paintbrush, Magic paintbrush gets an image based on the user's perspective (without GUI.), and stores it on a painting item which is created.

When placed, this painting item uses that image as a texture - and when collided with, teleports the entitiy to where the image was taken/paintbrush was right clicked.

An alternative method would be having a GUI which asks for an image to be uploaded, but I'd prefer to have the "Screenshot" functionality either way.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Hello! I have been having a problem with Forgematica, Embeddium, Oculus, and create. I wanted to download litematica so I could see which blocks are in my creative mode build, so that I could collect them all in survival. However, litematica is a fabric mod. I found a port called forgematica, which I added (along with it's dependency) to my mods folder. I loaded into a new world, and built a structure. Then, I added a part from the create mod, and the game crashed instantly, with exit code -1. Thanks for any help! Crash Report and mods list: https://pastebin.com/rtzh6LAi
    • To say that losing 40,000 BTC was a devastating blow would be an understatement. It was an emotional and financial crisis that left me feeling hopeless and utterly lost. For weeks, I was trapped in a whirlwind of regret, second-guessing every decision that led me to that point. The fear that I would never be able to recover such a significant sum of cryptocurrency consumed me, and with each passing day, my despair deepened. I had all but given up on ever regaining my wealth. Then I happened to stumble onto Tech Cyber Force Recovery. In the beginning, I was hesitant. It looked too good to be true: could someone get back so much of their lost Bitcoin? After trying several different approaches and programs without success, I was hesitant to put my trust in another recovery agency. However, I changed my mind after reading Tech Cyber Force Recovery's stellar reviews and reputation. Reaching out to their team was a risk I made. They were courteous and professional from the first time I got in touch with them. I felt like I wasn't just another case to be solved by the staff at Tech Cyber Force Recovery; they truly cared about getting me my lost Bitcoin back. They listened carefully to my circumstances and guided me through each stage, giving me succinct and understandable explanations as I went. Their passion gave me new hope, and their openness instantly made me feel better. As the recovery process began, I still had my doubts, but I knew I had placed my trust in the right hands. The Tech Cyber Force Recovery team kept me informed and updated on their progress, ensuring I never felt in the dark. Despite the complexity of my case, they worked tirelessly, and their expertise became evident at every turn. The level of professionalism and attention to detail they demonstrated throughout the process was beyond impressive. And then, after what felt like an eternity of anticipation, the moment I had been waiting for arrived. I received the news that my 40,000 BTC had been successfully recovered. It was hard to believe at first—it felt like a dream. The weight that had been dragging me down for so long was suddenly lifted, and I could breathe again. The financial loss I had feared would define my future was no longer a reality. I can’t fully express the emotions I felt during that moment. It was a mix of relief, joy, and an overwhelming sense of gratitude. I had gone from a place of utter despair to a complete resurgence of wealth, both emotionally and financially. The Tech Cyber Force Recovery team didn’t just restore my Bitcoin—they restored my faith in the possibility of recovery and gave me back something far more valuable: peace of mind. I will urge anyone in this same predicament to.  
    • Have you found a modder for this vehicle project? Because it will be really hard and I want to know that hero who can create all this
    • and what?????????
  • Topics

  • Who's Online (See full list)

    • There are no registered users currently online
×
×
  • Create New...

Important Information

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