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

bkvaluemeal

Members
  • Content Count

    28
  • Joined

  • Last visited

Community Reputation

0 Neutral

About bkvaluemeal

  • Rank
    Tree Puncher

Converted

  • Gender
    Male
  1. I took that out and instead told it to write the pixel black. There was an issue with the map looking like an acid trip. Everything was kinda... melting.
  2. I have the minimap updating at 5 FPS. This seems to work a lot better, but only appears to be delaying the inevitable. This was mainly a proof of concept for me. I may decide to work on this more later, but for now I am finished.
  3. Even when I take out the for loops and render a black box, I still lag and break the game. I have no doubt that all that cleanup is a problem, but there has to be a way to reuse the dynamic texture. Unless, I'm approaching this in entirely the wrong way.
  4. No, it "crashes" because Java's memory fills up and the server shuts down. I get messages saying the server jumped ahead X number of ticks. I'm not handling the dynamic textures properly. I don't exactly know how other than to create a new one and load it.
  5. That's true. Haha! Could you suggest a way to get the topmost block or perhaps a better way to draw the map without crashing my client? I'm most concerned about the latter. Edit: I made the map look better. It checks blocks above and below the player. public class MiniMapHandler { private static final Minecraft MC = Minecraft.getMinecraft(); public static final BufferedImage MAP = new BufferedImage(75, 75, BufferedImage.TYPE_INT_RGB); @SubscribeEvent public void onTick(PlayerTickEvent event) { BlockPos center = MC.thePlayer.getPosition(); MAP.flush(); for (int z = center.get
  6. I knew that creating this wasn't going to be easy, but this is a lot of work! With The Division launching soon, I honestly don't think I'll be working on this much longer. I've opted to use getMapColor() (despite what I said) in lieu of starting a huge project. I have created a much better way to draw the map, although is there a way to update the DynamicTexture without making a new one every time? My game starts to lag after a while and updateDynamicTexture() doesn't seem to do the trick. MiniMapHandler: public class MiniMapHandler { private static final Minecraft MC = Minecraft.g
  7. This works, but I get tons of errors. What is the right way to do this? I really don't even want to use the getMapColor() function because it flickers between black and green. I don't know why. public class MiniMapHandler { private static final Minecraft MC = Minecraft.getMinecraft(); private static final BufferedImage MAP = new BufferedImage(75, 75, BufferedImage.TYPE_INT_RGB); private static DynamicTexture TEXTURE = new DynamicTexture(MAP); @SubscribeEvent public void onTick(PlayerTickEvent event) { // (Y, X) They're swapped. Don't feel like retyping. BlockPos zero_zero = MC.thePla
  8. Right, my question is how do they get that texture? The default Minecraft blocks are easy enough, but how do you grab the textures of custom blocks? Edit: Let me clarify, I can use the loadTexture() function I mentioned before only if I know where the resource location is, correct? I will assume I don't know that. Some modder may decide not to follow convention. I can't seem to find a way to pull a texture from an arbitrary block.
  9. Well, no, but what I'm saying is that Xaero's map, for instance, looks nothing like the item you can craft in game. It is much more detailed. I don't think the getMapColor() function has the ability to yield that level of detail. So, how do they do it? I'll play around with the getMapColor() function and see what I get. I'll post that when I'm done.
  10. Cool, that works too. IBlockState state = MC.theWorld.getBlockState(MC.thePlayer.getPosition()); int color = 0xFF000000 | state.getBlock().getMapColor(state).colorValue; drawRect(50, 50, 100, 100, color); Although, it's not the level of detail I was looking for. It swaps between black and the actual color for whatever reason. Xaero's map mod doesn't work like this, right?
  11. At first I tried this: IBlockState state = MC.theWorld.getBlockState(MC.thePlayer.getPosition()); int color = state.getBlock().getMapColor(state).colorValue; drawRect(0, 0, 100, 100, color); That didn't work. So then I found a thread talking about getting the textures from the jar like so: MC.getTextureManager().bindTexture(new ResourceLocation("textures/blocks/grass_side.png")); drawModalRectWithCustomSizedTexture(0, 0, 0, 0, 64, 64, 64, 64); This does work, and I could get the RGB values like this: static int[] loadTexture(String block) { try { final Resou
  12. I'm trying to understand how minimap mods actually work. I found the open source MapWriter and have browsed the source code for other popular minimaps, but what I can't seem to figure out is how they actually get the colors for the map. I've tried something like how the map item works (getting the color of the block I'm standing on and drawing a rectangle on screen with that integer), but nothing happened. Could someone explain this to me please? This is what I've got so far, and you can see where I'd like to add the minimap. The zone your in (top left) will change based on a text file st
  13. Good news! I made it work, and it is working just like I imagined. Although, the player gets spammed constantly with "your game mode has been changed" because of the tick handler. Any ideas how I could make it silent? This is how I change the player's game mode. MinecraftServer.getServer().getConfigurationManager().getPlayerForUsername("username").setGameType(EnumGameType.SURVIVAL)
  14. MinecraftServer.getServer() is the server, yes? How do you select a player? I was expecting a MinecraftServer.getServer().getPlayer(playerName) FOUND IT
  15. I knew I would have to do that soon. I was planning on getting an array of all the online players and sorting through them one by one. I have it set to every 20 ticks to get the player's coordinates and compare them with a polygon. If you're inside it, then set the game mode to X.
×
×
  • Create New...

Important Information

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