Jump to content

DimChig

Members
  • Posts

    7
  • Joined

  • Last visited

Converted

  • Gender
    Male

DimChig's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. Okay, i solved it. So i just splitted my "scan zone" into small zones, and scan each zone every tick. So in 1-3 seconds it scans 60 small zones, and i have no lag. So after i find my block in "small scan zone" i add it to an array (and save new Date().getTime()) so than each tick i clear all my blocks from array that have time diffrence more that 3 seconds. And minimap reaction time is fine, around 3 seconds.
  2. Well, i guess you can add text to mcmod.info, but actually nobody cares) If you using a mod and see other players with same mod, it must have some kind of data collection And also nobody sees what queries are sent to api, so they can't abuse it if done correctly
  3. Yea, I know, that's why it is lagging. I need it for my custom minimap. I want to show specific blocks on it, but I need to loop through all of them to find them. Also, blocks can be destroyed, so I need to scan them frequently. I was wondering if forge has some methods for finding blocks in rendered world
  4. I figured out how to do this by myself, so I will post it here for everybody. So basically what I did is I created a RestApi with python, and a database on mysql. Than on ServerJoinEvent (and once in 5 minutes in-game) i send a query to my restapi (like domain/userTick?=[uuid, player_name]), that's adding a row to my table. And every player also every 5 minutes requests a query (like domain/getActiveUsers), that returns all rows in database where TIMEDIFF <= 5 minutes. So than i just change tab list and display name of every player that is in my ActiveUsers list. It is a little bit tricky, but works well enough! No server support needed!
  5. My goal is to every tick scan for a "diamond block" for example in loaded chunks from client-side. I already did something like looping all surrounding blocks in a radius, and taking a block by world.getBlockState(new BlockPos(x, y, z)).getBlock() == Blocks.diamond_block and my loop is like this: int range = 100; for (int xi = -range; xi < range; xi++) { for (int yi = -3; yi < 3; yi++) { for (int zi = -range; zi < range; zi++) { double x = Math.floor(xi + player.posX); double y = Math.floor(yi + player.posY); double z = Math.floor(zi + player.posZ); if (world.getBlockState(new BlockPos(x, y, z)).getBlock() == Blocks.diamond_block) { //do something } } } } It is working, BUT. It is lagging so much (i use it every tick, and i need to use it so often). My fps drops from 200 to 50. I need a faster way of doing this, please help!
  6. Hello everyone, i am a beginner mod developer, and i made a client-sided mod for a multiplayer server. And i was wondering, can i add a feature, that shows other players, that uses my mod? Like in lunar client, you can see a tiny logo near a player name. I don't know, how can it be realised (maybe put some information in player entity, like nbt, that others mod users can read), please help!
×
×
  • Create New...

Important Information

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