Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Thorius

Members
  • Posts

    39
  • Joined

  • Last visited

  • Days Won

    1

Thorius last won the day on April 9

Thorius had the most liked content!

Converted

  • Gender
    Male

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Thorius's Achievements

Tree Puncher

Tree Puncher (2/8)

4

Reputation

  1. Hi, I started porting my mod to 1.16.5 (getting zero downloads of the newest version was a strong indicator it's time to move on) and I noticed that many of the RenderSystem methods are deprecated. For example: RenderSystem.color4f(float, float, float, float); RenderSystem.pushMatrix(); RenderSystem.popMatrix(); After some research, I found that the new way of doing things is batch rendering. However, I can't find any good examples or tutorials on what methods I should use. So my question would be: is there any documentation or summary on the topic and does this change also affect other things like, for example, entity rendering?
  2. Today I started Eclipse and I got this error message: Project 'MyProject' is missing required library: 'C:\Users\MyUsername\.gradle\caches\modules-2\files-2.1\cpw.mods\grossjava9hacks\1.3.0\1a922de964d0c19d864fbcba2678c1a1c4602c35\grossjava9hacks-1.3.0.jar' The only thing I did yesterday was writing some code and running 'gradlew build'. I didn't change any settings or touch anything java related. Why did this error appear? The only thing I can think of being responsible is some weird shortcut.
  3. That shouldn't happen because of the sinus and cosinus, at least it didn't happen in my tests.
  4. The easiest solution is to change the position of the bullet before it is spawned. It will however slightly mess with your aim, so take that into consideration. An example code written in 1.15.2 (in 1.16.5 it is propably something similar): float rot = playerEntity.rotationYaw/180.f*3.14159f; //Converts the player rotation to radians float z = MathHelper.sin(rot) * 0.3f; //the multiplier (0.3f) defines how much is the bullet moved to the right float x = MathHelper.cos(rot) * 0.3f; //this and the former equation localizes the bullet to the rotation of the player //the subtrahend 0.5f controlls the height of the bullet //changing the minus sign before x and z to plus moves the bullet to the left anEntity.setPosition(playerEntity.getPosX() - x, playerEntity.getPosYEye() - (double)0.5f, playerEntity.getPosZ() - z); //add the bullet to the world after this
  5. I mostly saw this issue with modpacks that were missing dependencies. The problem is, the crash is not Botania's fault. It might still crash with other mods. A modlist might be usefull.
  6. The crash might be related to ctm or ctm dependent mods.
  7. What do you mean by opening? Are using it in the Minecraft launcher or are you trying to run the installer?
  8. Does it work without Botania? Some configurations might randomly change the data sent to botania which then causes an exception.
  9. I managed to find a solution. Instead of the above method i do this: private static final ResourceLocation MOLTEN_METAL_TEXTURE = new ResourceLocation("textures/block/lava_still.png"); private static final RenderType RENDER_TYPE = RenderType.getEntitySolid(MOLTEN_METAL_TEXTURE);
  10. Well if you (Tatuck) want to know more about the subject, look into trigonometry. (in case you're not familiar with it) I think you can find many good explanations on the internet, maybe videos will be helpfull. I think you can learn the basics of trigonometry pretty fast and then you can do so much more with 3D coordinates.
  11. I wrote this in 1.15.2. The angle is given in radians. In any case you should test this solution whether or not it creates some errors in some special cases.
  12. @SubscribeEvent public static void soundAngle(PlaySoundEvent e){ ClientPlayerEntity player = Minecraft.getInstance().player; if(player != null) { //the event also triggers in the main menu, so this avoids crash ISound sound = e.getResultSound(); double x = sound.getX() - player.getPosX(); //gets the position relative to the player double y = sound.getZ() - player.getPosZ(); double angle = Math.atan2(y, x); //converts two sides of a rectangle to an angle given in radians player.sendChatMessage(String.valueOf(angle)); } } Something like this should work. In this code you get the angle relative to the world and not the player.
  13. Sorry for the delayed response, but i still have issues. I managed to render the face, however, what I get is a collection of all the textures. Changing the texture location (for the material) does nothing and although i could display my texture with some magic numbers, it would be a terrible and unstable solution. So my question is, how do i get the texture dependent UV coordinates or in case the texture is bound the wrong way, how do i do it correctly? My code: @SuppressWarnings("deprecation") public class CrucibleRenderer extends TileEntityRenderer<CrucibleTileEntity>{ //vanilla texture for testing purposes public static final Material MOLTEN_METAL_TEXTURE = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE, new ResourceLocation("block/stone")); public CrucibleRenderer(TileEntityRendererDispatcher rendererDispatcherIn) { super(rendererDispatcherIn); } @Override public void render(CrucibleTileEntity tileEntityIn, float partialTicks, MatrixStack matrixStackIn, IRenderTypeBuffer bufferIn, int combinedLightIn, int combinedOverlayIn) { //The issue is here int fluid = tileEntityIn.getFluid(); if(fluid > 0) { float f = 0.375f + fluid * 0.015f; Matrix4f matrix4f = matrixStackIn.getLast().getMatrix(); IVertexBuilder vertexBuilder = MOLTEN_METAL_TEXTURE.getBuffer(bufferIn, RenderType::getEntitySolid); this.renderFace(tileEntityIn, f, combinedOverlayIn, combinedLightIn, matrix4f, vertexBuilder); } //Some other rendering stuff (hopefully) unrelated to the issue ItemStack item = tileEntityIn.getItem(); if(!item.isEmpty()) { matrixStackIn.push(); matrixStackIn.scale(0.5f, 0.5f, 0.5f); double height = 1.5D; if(item.getItem() instanceof BlockItem) height = 1.0D; height += fluid * 0.025D; matrixStackIn.translate(1.0D, height, 1.0D); //Animation matrixStackIn.rotate(Vector3f.YP.rotationDegrees(90.f)); //Rendering renderItem(item, matrixStackIn, bufferIn, combinedLightIn, combinedOverlayIn); matrixStackIn.pop(); } } private void renderFace(CrucibleTileEntity tileEntityIn, float height, int combinedOverlayIn, int combinedLightIn, Matrix4f matrix, IVertexBuilder iVertexBuilder) { this.renderFace(matrix, iVertexBuilder, 0.25F, 0.75F, height, 0.25F, 0.75F, 1.f, 1.f, 1.f, combinedOverlayIn, combinedLightIn); } private void renderFace(Matrix4f matrix, IVertexBuilder vertexBuilder, float minX, float maxX, float height, float minZ, float maxZ, float red, float green, float blue, int combinedOverlayIn, int combinedLightIn) { //Right now i use some testing values fo the UV coordinates vertexBuilder.pos(matrix, minX, height, maxZ).color(red, green, blue, 1.0F).tex(0.5f, 0.40f) .overlay(combinedOverlayIn).lightmap(combinedLightIn).normal(0.f, 1.f, 0.f).endVertex(); vertexBuilder.pos(matrix, maxX, height, maxZ).color(red, green, blue, 1.0F).tex(0.5f, 0.5f) .overlay(combinedOverlayIn).lightmap(combinedLightIn).normal(0.f, 1.f, 0.f).endVertex(); vertexBuilder.pos(matrix, maxX, height, minZ).color(red, green, blue, 1.0F).tex(0.40f, 0.5f) .overlay(combinedOverlayIn).lightmap(combinedLightIn).normal(0.f, 1.f, 0.f).endVertex(); vertexBuilder.pos(matrix, minX, height, minZ).color(red, green, blue, 1.0F).tex(0.40f, 0.40f) .overlay(combinedOverlayIn).lightmap(combinedLightIn).normal(0.f, 1.f, 0.f).endVertex(); } private void renderItem(ItemStack stack, MatrixStack matrixStackIn, IRenderTypeBuffer bufferIn, int combinedLightIn, int combinedOverlayIn) { Minecraft.getInstance().getItemRenderer().renderItem(stack, TransformType.FIXED, combinedLightIn, combinedOverlayIn, matrixStackIn, bufferIn); } }
  14. Hello, actually i would like to know two things about TER. My first issue is that unless i use a VoxelShape that is not a full block, the models that i render are dark. I tried many things to solve the problem, but none of them worked. In any case, it would be better if didn't have to change the VoxelShape of the block. My other issue is that i don't know how to attach a texture to a face drawn with the vertex builder. I can't find any good examples. Thanks in advance!
×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.