Dev Log #1 - Map Copyright

Discussion in 'General' started by Saber, May 25, 2023.

  1. Saber

    Saber Member
    Developer Community Teams Rules Committee

    Joined:
    Jan 6, 2023
    Messages:
    71
    Likes Received:
    53
    Butters contemplated doing a dev log a while back but never followed through but there seemed to be interest so I thought I'd just go ahead and write one. I'll only be writing about things that aren't secret though or I'll be vague. Only fitting to use the first log to write about the first plugin of mine that made it to beta, MapCopyright.

    Ah yes, the memory is coming back to me now, it was back in the year 2023, I was just a young prestige 4 in the prime of his youth. I was in the process of learning how to make minecraft plugins with the goal of becoming dev on the server. In the meantime though I was just another player going about their farming and goofing around.

    I was planning on making pb go bankrupt so I headed over to SandwichShop looking for items I could sell. When I arrived, I noticed a sign, it read something along the lines of "Maps will not be sold until /copyright". This was the first time I ever heard of such a command so I rang up the Peaceful Farms head office and asked what in the blazes I was reading. As it turns out, /copyright was not in the process of being made or even in the server roadmap at all. Pb just wanted it and was hoping it would come soon.

    While online with both pb and butters, I asked if I made such a plugin as practice would there be any chance it would be used. Butters responded with a resounding yes so I set to work.

    The first step was to determine the scope, originally I only planned on making the plugin protect against making copies of maps without the creator's permission. I went ahead and began the coding, a simple /copyright trust list, should be enough right? After all it works great for land claims in grief prevention. Once that was done and working great I noticed an issue. What--What if someone just makes a new map in the same area as the first one?

    This problem wouldn't affect every player as some destroy maps after creation and reuse the same area to make another map but for the players who like to keep their maps, this could be a major issue. So I started thinking up ideas. My first thought was to make a hash of the map image and store that. Meaning any map that looks the same would apply to the same copyright but that brings the issue of simply changing a single block completely changing the hash. Another issue would be wall papers. Since multiple people make identical maps of black concrete, they would all have the same copyright.

    That's when I settled on simply allowing players to mark chunks as their own for map making purposes. The chunk itself would be claimed and have a trust list of it's own. I quite liked this solution and got to coding. I made it so it took your coordinates then asked bukkit for the chunk at your x and your y and marked the chunk with it's new owner. Any coders reading may have spotted the issue, I only noticed after the lag each time I tried to access or store such data. You see, chunk coordinates are not the same as player coordinates, to get the chunk you are standing in, I have to divide your coordinates by 16. Luckily I noticed this pretty quickly and fixed it.

    But wait, maps are 8 chunks x 8 chunks, that means I have to claim 64 chunks just to stop people making maps?

    Why yes, yes you do. Wait, that's dumb, I know! I'll just make it claim the whole 8 chunk x 8 chunk area when you claim it! And so the change was made, when you claim an area you claim the whole map area rather than just the chunk you are standing in.

    "But wait!" pb said, "I have friends who mapart with me, it would be a pain to trust them on every map and area individually!"

    You make a good point pb. I know! I'll add a full trust list! A list of people who have access to all your copyrights and areas!

    Wait, this sounds like a lot of data that has to be stored now... I guess I'll flex my coding muscles and make not 1 but 2 storage options!

    The file default: bruv, I stored all your copyrights and such in these here .yml files.

    The database option: oi chap, I called up me mate the database and they say they'll hold on to all this data for ya.

    Oh happy days! The plugin is complete! What ever else could need to be done!

    *incoming call from Rocker*
    Saber: uh hello?
    Rocker: I put a banner on my map and when anyone clicks it, it gets added to all copies of the map.
    Saber: oh noo
    *click*

    I know! if someone right clicks a banner with a copyrighted map, I'll check the trust list and stop them from messin it up! Genius! To the codemobile!

    Right, now that that's sorted, time to ship this here plugin off to butters.
    Butters: Saber your so awesome, the best developer I've ever seen! I've added MapCopyright to beta

    Well now that it's on beta it'll be tested and we'll see if my child is as perfect as I raised them to be! We'll have to wait for the tester Rimon to see if they can break it.
    Rimon: This plugin so solid, I can't break it at all! Saber, you truly are amazing!

    whoop, gimme a sec my phone is ringing again. Oh it's butters, probably just calling to praise me again.
    Butters: your plugin needs a help menu
    Saber: But I damn near failed english but dw, I know just the man for the job!

    It's Burnabull to the rescue!
    Burnabull: Do not fear for Burnabull is here! I shall take your trash, unreadable and, confusing help menu and make it somewhat reasonable!
    Saber: little harsh but thanks? I guess?

    And that is the story of how I made MapCopyright and got it added to beta before becoming a developer. Some say if you listen close you can still here butters saying soon™ when asked if MapCopyright will ever be added to the main servers.
     
    WildSkyGalaxy likes this.
  2. GodOfSandwiches

    Community Teams

    Joined:
    Jul 2, 2022
    Messages:
    316
    Likes Received:
    20
    Accurate Representation Of This Conversation.
     
  3. WildSkyGalaxy

    WildSkyGalaxy Staff Member
    Moderator Community Teams

    Joined:
    Nov 23, 2022
    Messages:
    10
    Likes Received:
    7
    I love this. This made me laugh this made my day. Gj sabs
     
  4. GodOfSandwiches

    Community Teams

    Joined:
    Jul 2, 2022
    Messages:
    316
    Likes Received:
    20
    upload_2023-5-24_22-35-58.png
    as you can see its super accurate
     
  5. AshesRevamp

    AshesRevamp Staff Member
    Moderator Community Teams

    Joined:
    May 21, 2022
    Messages:
    596
    Likes Received:
    62
    Saber is just built different lmao
     
    #5 AshesRevamp, May 25, 2023
    Last edited: May 29, 2023