FarLandsMC / FarLands

The official plugin of the FarLands Minecraft server.
Apache License 2.0
7 stars 3 forks source link

Convert struct classes to records #3

Closed Majekdor closed 3 years ago

Majekdor commented 3 years ago

Our "object" classes are stored here. Not all of them can be, but the ones that can should be converted to records.

ReyhanPatria commented 3 years ago

Hi! I'd like to contribute, I'm pretty new to contributing, I'd like to try this issue as it involves more code. But can I get a clarification on what records actually are? What do you want to be converted exactly?

funnyboy-roks commented 3 years ago

Hello! Thank you for your interest in contributing! Java records are a feature added in version 15, you can view more about them here. The idea is to replace things that can be replaced in the package net.farlands.sanctuary.data.struct

ReyhanPatria commented 3 years ago

Would the converted classes be in the same package?

This seems simple enough I think, I'd like to work on this if you'd assign me to it. Thanks!

funnyboy-roks commented 3 years ago

Yes. You'd be replacing the classes that are currently there if it can be replaced with a record. Thank you again for your interest :D

ReyhanPatria commented 3 years ago

I'm having trouble downloading the RegionProtection depedency, it spits out this error

Authentication failed for https://maven.pkg.github.com/FarLandsMC/mavenpackages/com/kicas/rp/regionprotection/1.2.0-SNAPSHOT/regionprotection-1.2.0-SNAPSHOT.pom 401 Unauthorized
funnyboy-roks commented 3 years ago

Ah, you'll need to modify your ~/.m2/settings.xml if on Linux. If you're on WIndows, I think it'll be in your user directory.

You'll need to set it to:

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 https://maven.apache.org/xsd/settings-1.0.0.xsd">
  <servers>
    <server>
      <id>github</id>
      <username>GITHUB USERNAME</username>
      <password>TOKEN</password>
    </server>
  </servers>
</settings>

Where TOKEN is a personal access token generated in GitHub

ReyhanPatria commented 3 years ago

Thanks, that fixed it!

funnyboy-roks commented 3 years ago

Thank you for your contribution! :D