Jump to content

Lhykos

Members
  • Posts

    32
  • Joined

  • Last visited

Everything posted by Lhykos

  1. That's a good point, but I don't thing the forge team make things worse, they try to optimize things. I think only in 1.13 the loading could change, but more from the reason that minecraft updates to lwjgl 3. So you have to change it in your code anyways. At the end it's up to you, if you know what you do, it's fine.
  2. You could do your own implementation, but what would be the advantage? Minecraft does the same thing for you when you call 'TextureManager::bindTexture': Personal I see no reasonable benefit from doing like it. It's just a: "I don't like how Minecraft it does" thing. But correct me if someone think this is better.
  3. Heya! I currently work on the serialization of a nbt tag to a json file and I struggle at the point of saving an nbt array like NBTTagByteArray. There is no problem for me to do that, but i want to use the class JsonToNBT for the deserialisation. And here is the thing: For me there is no possbile way to do that. Minecraft wants for the deserialization a struct that looks like that: { "byte_array_name": [B;2B,4B,6B,9B] } For me that is no known or valid json format. Did I miss something or did minecraft something stupid here?
  4. For that you should use a custom state mapper, right. You use for the ModelResourceLocation a ResourceLocation of the blockstate file you want, e.g. dirt and the variant you want to use. So that you have a ModelResourceLocation for your StateMapper like this: return new ModelResourceLocation(new ResourceLocation("dirt"), "normal"); Now your block looks like dirt. But If you have properties in your block that the block state file not have, you will get an error.
  5. That are two things I will keep in mind for the future. Always good to know that. At the end I took the "File->Export->Save for Web..." option from Photoshop. I selected "PNG-8" and there is the option to set the transparency color. If I had known that the solution is that simple, then this thread wouldn't exist. Thanks!
  6. That's something I didn't know. Would be explain many problems in the past. I use Photoshop, but I never saw a option to set this.
  7. Heya! I know that minecraft renders transparency black, if the block model is solid. (Like the leaves if the graphic settings is set to 'Fast') The same I do for one of my blocks. The strange thing is that the transparency is rendered white instead of black and I don't know why. Everything works just fine, because if I replace my block texture with the default oak leaves texture the transparency is rendered black. That means my blockstate file, model file and block class work like it should. I think there is something wrong with my texture. Do I have to pay attention to something special? Maybe the color space? SOLUTION
  8. You should initialize your Entity AI in: protected void initEntityAI() {} or make sure the world is a server before you add the tasks. Like Minecraft it does in the EntityLiving Constructor. You also can debug the code in the EntityAIFollowOwner to see where the problem is.
  9. Your color is 0. That means the alpha is 0 too. The drawRect method want a ARGB-Value: "0xFF000000" That would be a black color with a alpha of 1.0F.
  10. This could be everything. Can you post the full log?
  11. Did you pass the correct values to getMetafromState() and getStateFromMeta() ? If you have still set it to "0" and "getDefaultState()" it won't save anything. Draco18s explained it in a good example.
  12. You need to call your actions on the main thread. From the Forge Documentation:
  13. I think you call a client method in your "onMessage" method in the handler class. Can you post the code of you "MessageSyncClientHandler" class?
  14. Maybe I thought too complicated I think the best solution is doing it like minecraft. Simple and works perfect for me.
  15. What is 'gainTimer', it is the color? It where important to understand how bit shifting is working. For me you try to set the alpha by shifting 24 in a timer value. This doesn't work. The better question is, why you want to display the item name twice? It's showing you the name already above the hotbar.
  16. You should use the fontRendererObj directly: mc.fontRendererObj.drawString("fade string", sr.getScaledWidth() / 2 - mc.fontRendererObj.getStringWidth("fade string") / 2 , sr.getScaledHeight() - 97, color); And don't forget to add the alpha: int color += (alpha << 24) That's how you get the transparency. For the fade-out you still need to setup a timer or use the partialTicks like in the GuiIngame.
  17. You could also work with the BiomeProvider. It has similar methods to get a biome. And if you worry about the time to find that biome you could also spread the search over ticks.
  18. You have not to link them. You call 'GlStateManager.enableBlend()' before you draw the string with 'fontrenderer.drawCenteredString(...)' to enable the transparency. And don't forget to call 'GlStateManager.disableBlend()') when you are finished. And to your color you have to add the alpha via "bit shifting": int color = alpha << 24 + color; Btw. here is a link to understand the bit shifting. For a "really good" transparency you call this: GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO); to tell OpenGL how to handle the blending mode. It's more copy & paste from the source code, but that should explain it.
  19. I totally forgot about the subtitles and overlay messages from Minecraft! In the GuiIngame class by line 241. Here is handled how to fade out and display a overlay message for a specific time. (When a record is played. In that fancy, colored way) But like Matryoshika already said. Here you have to know how to use OpenGL.
  20. I'm not sure if you can fade out a text in Minecraft on a normal way. I never done that before
  21. Have you already tried something? Basically it is: You simply set a timer variable which will decrements in each client tick. And if the timer is expired you will not render the text anymore.
  22. BiomesOPlenty did that for the BiomeFinder: BiomesOPlenty Github On line 72: public static BlockPos spiralOutwardsLookingForBiome(World world, Biome biomeToFind, double startX, double startZ) I think it is an easy solution.
  23. That's a neat way to check that. I will do this in the future too.
  24. Hmm. One thing I see is you have to multiply your chunkX and chunkZ with 16, because these define the chunk coordinates, not the ones of the blocks.
  25. Try to override: public boolean shouldSideBeRendered(IBlockState blockState, IBlockAccess blockAccess, BlockPos pos, EnumFacing side) {} In the BlockGlass class you can see its extends from BlockBreakable which override this too.
×
×
  • Create New...

Important Information

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