Jump to content

Recommended Posts

Posted

Firstly I want to make my new custom block have a transparent section http://puu.sh/72piA/a97662d114.jpg

I want the blue part to be transparent, but im 99% sure I'm missing a step with minecraft because when i was modeling in techne it was exactly how I wanted it.

 

I'm currently running 1.6.4 forge, used techne to model the block and import into java.

 

This is the custom renderer.

 

import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import bigbaddevil7.supernova.SuperNovaInfo;
import bigbaddevil7.supernova.model.ModelCarbonGenerator;


public class RendererCarbonGenerator extends TileEntitySpecialRenderer{
    private static final ResourceLocation texture = new ResourceLocation(SuperNovaInfo.ID.toLowerCase(), "textures/model/generator.png");

    private ModelCarbonGenerator model;

    public RendererCarbonGenerator()
    {
        this.model = new ModelCarbonGenerator();
    }

    @Override    
    public void renderTileEntityAt(TileEntity tileentity, double x, double y, double z, float f)
    {
        GL11.glPushMatrix();
        GL11.glTranslatef((float)x + 0.5F, (float)y + 1.5F, (float)z + 0.5F);
        GL11.glRotatef(180, 0F, 0F, 1F);
        this.bindTexture(texture);
        GL11.glPushMatrix();
        model.renderModel(0.0625F);
        GL11.glPopMatrix();
        GL11.glPopMatrix();
    }
    
}

 

 

And yes i have done all of the getRenderType(), isOpaquecube() {return false;}, and renderAsNormalBlock{ return false;}.

 

Second question is since this is 2 blocks tall I made the setBlockBounds()

 this.setBlockBounds(0F, 0F, 0F, 1F, 2F, 1F); 

to mach accordingly, but the top part of the structure can still have blocks placed through this. How do I fix that problem as well

Posted

GL11.glEnable(GL11.GL_BLEND)

 

See line 95.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted

Alright I looked at the code and saw what you were taking about (by the way interesting model). It now renders see through how I wanted. When you look at the block out of the corner of your screen it gets the transparent part becomes brighter.

Posted

Alright I looked at the code and saw what you were taking about. It now renders see through how I wanted. When you look at the block out of the corner of your screen it gets the transparent part becomes brighter.

 

Not sure what's up with that.  Things near the edge of the view cone generally behave oddly anyway.

 

(by the way interesting model)

 

Thanks!

Here's a screenshot of it in the world.

(Hmm.  Need to double check the glass edges.  I think I saw them missing the edging the other day...)

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted

So does that case render the item that is placed in the slot? If so how did you go about doing it. I want some of my machines to render items hovering in locations. For example this machine here. http://puu.sh/72wvz/16f6819567.jpg

I would like for items to hover there to give the machine more of an effect that its working on its items.

 

It happens there in model class.  See line 60.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted

I need to learn more about openGL. At this point I think it's slightly out of my league.

 

The OGL code there just rotates the item entity so it lays flat instead of standing upright.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted

Let me see if I understand this properly then. 1st you do a check to make sure that there is something there, if so you do some math to rotate it flat, and this

RenderManager.instance.renderEntityWithPosYaw(es.itemEnt, 0, 0, 0, 0, 0);

is the piece of code that actually displays the item?

 

The item you check gets passed from what I assume is the TileEntityClass for your pedestal that has a method called itemEnt()

Posted

Let me see if I understand this properly then. 1st you do a check to make sure that there is something there, if so you do some math to rotate it flat, and this

RenderManager.instance.renderEntityWithPosYaw(es.itemEnt, 0, 0, 0, 0, 0);

is the piece of code that actually displays the item?

 

The item you check gets passed from what I assume is the TileEntityClass for your pedestal that has a method called itemEnt()

 

All correct.

(Except that it's a field, not a method)

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted

hmmm. Will have to tinker with that. I was looking through the forums and you answered someones question which I have the same problem and it was the boundbox/hitbox post. You said in or order to properly make 2 tall hit boxes you should use two blocks like pistons. Can you describe how to go about doing that?

Posted

hmmm. Will have to tinker with that. I was looking through the forums and you answered someones question which I have the same problem and it was the boundbox/hitbox post. You said in or order to properly make 2 tall hit boxes you should use two blocks like pistons. Can you describe how to go about doing that?

 

Creating a new block, not putting it in the creative menu or giving it a recipe or anything (it's a technical block).  When your block is added to the world it checks the space above it for Material.air (this is better than checking for actually air, as some mods add blocks that should be treated like air).

If air: replace it with the technical block

If not air: drop self / prevent placement

 

Then when either block is broken it breaks the other block.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted

so I would create a new block and not give it anything except what I need to register it to minecraft such as id and unlocalized name and in the onBlockAdded() have it places the block one above it? Minecraft differently has some interesting mechanics.

 

 

EDIT

Ive been looking on how doors does it's update and they use an onNeighborBlockChange() for its updates when the top or bottom block is destroyed.

And the canPlaceBlockAt() it checks to make sure its below y lvl 255 and then checks both the block below and the block up 1 above.

 

Is that correct? I'm missing the part where it adds the block above upon initial placement of the door.

 

The trickiest machine im going to have to do will be something like this

 

Looking from the top(S = source block, T = technical block, A = air block)

 

Layer 1:

ATA

TST

ATA

 

Layer 2: (Ycoord + 1)

ATA

TTT

ATA

 

I wasn't planning on working with the onNeighborBlockChange() until after this when I would learn how to make multiblock structures, but that kinda didn't go as planned, so I'm fuzzy to this here.

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

    • Reach Out To Rapid Digital: What sapp Info: +1 41 4 80 7 14 85 Email INFO: rap iddi gita lrecov ery @ exe cs. com Hello, my name is Jayson, and I’m 35 years old from the United Kingdom. My family and I recently endured an incredibly challenging experience that I wouldn’t wish on anyone. We became victims of a cryptocurrency investment fraud scheme that saw us lose a staggering $807,000 in USDT and Bitcoins. The fraudsters had created a convincing facade, and we were lured into investing, only to discover later that the platform was a complete scam. We were left devastated, not just financially, but emotionally, as we had trusted these people and believed in the legitimacy of the investment. After the initial shock wore off, we desperately searched for ways to recover the lost funds. It seemed like an impossible task, and we felt as though there was no hope. That’s when, by sheer luck, we stumbled across a post about Rapid Digital Recovery, a cryptocurrency and funds recovery organization with a proven track record in cybersecurity and fraud recovery. We decided to reach out to them, and from the first interaction, we were impressed with their professionalism and transparency. They explained the recovery process in detail and reassured us that they had the skills and expertise to track down the perpetrators and recover our funds. This gave us a renewed sense of hope, something we hadn’t felt in months. What truly stood out during our experience with Rapid Digital Recovery was their dedication to the recovery process. The team went above and beyond, using sophisticated tracking tools and cyber forensics to gather critical information. Within a matter of weeks, they had successfully located the funds and traced the scam back to the fraudsters responsible. They worked with the authorities to ensure the criminals were held accountable for their actions. To our relief, the team at Rapid Digital Recovery was able to recover every single penny we had lost. The funds were returned in full, and the sense of closure we felt was invaluable. We couldn’t have imagined such a positive outcome in the early stages of our recovery journey, and we are deeply grateful for the work they did. If you ever find yourself in a similar situation, I highly recommend contacting Rapid Digital Recovery. Their expertise, transparency, and dedication to their clients make them the go-to choice for anyone seeking to recover lost cryptocurrency or funds. They truly gave us back our financial future.  
    • This is my first time modding anything, so maybe just skill issue. I'm using Forge 54.0.12 and Temurin 21.0.5+11-LTS I wanted to create a custom keybind and to check whether it works I'd like to send a chat message. I tried using Minecraft.getInstance().player.sendSystemMessage(Component.literal("test")); but IntelliJ couldnt resolve sendSystemMessage(...). Since I saw people using it in earlier versions, I tried the same thing with 1.20.6(- 50.1.0), where it works fine, now I can't figure out if this is intentional and whether there are other options for sending chat messages. On that note, is there more documentation than https://docs.minecraftforge.net/en/1.21.x/? It seems very incomplete compared to something like the Oracle Java docs
    • Hi, i'm having this error and I wanna fix it. we try: -Reload drivers -Eliminate .minecraft -Eliminate Java -Restart launcher -Verify if minecraft is using gpu -Mods  in .minecraft is empty -Install the latest and recomended version of forge idk what i have to do, help me pls. the lastest log is: https://mclo.gs/WAMao8x  
    • Read the FAQ, Rule #2. (https://forums.minecraftforge.net/topic/125488-rules-and-frequently-asked-questions-faq/)  
  • Topics

×
×
  • Create New...

Important Information

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