Skip to content

Commit

Permalink
Remove Lombok
Browse files Browse the repository at this point in the history
  • Loading branch information
rubensworks committed Dec 26, 2024
1 parent 467db6d commit 20dff5e
Show file tree
Hide file tree
Showing 12 changed files with 448 additions and 158 deletions.
9 changes: 1 addition & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,7 @@ While again making sure that you fill in the required Minecraft and CyclopsCore

### Branching Strategy

For every major Minecraft version, two branches exist:

* `master-{mc_version}`: Latest (potentially unstable) development.
* `release-{mc_version}`: Latest stable release for that Minecraft version. This is also tagged with all mod releases.

### Building and setting up a development environment

This mod uses [Project Lombok](http://projectlombok.org/) -- an annotation processor that allows us you to generate constructors, getters and setters using annotations -- to speed up recurring tasks and keep part of our codebase clean at the same time. Because of this it is advised that you install a plugin for your IDE that supports Project Lombok. Should you encounter any weird errors concerning missing getter or setter methods, it's probably because your code has not been processed by Project Lombok's processor. A list of Project Lombok plugins can be found [here](http://projectlombok.org/download.html).
For every major Minecraft version, a `master-{mc_version}` branch exists.

### License
All code and images are licenced under the [MIT License](https://github.com/CyclopsMC/CyclopsCore/blob/master-1.8/LICENSE.txt)
8 changes: 1 addition & 7 deletions loader-neoforge/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import net.darkhax.curseforgegradle.TaskPublishCurseForge
import net.darkhax.curseforgegradle.Constants as CFG_Constants
import net.darkhax.curseforgegradle.TaskPublishCurseForge

plugins {
id 'multiloader-loader-neoforge'
Expand Down Expand Up @@ -42,12 +42,6 @@ dependencies {

//runtimeOnly fg.deobf("top.theillusivec4.curios:curios-neoforge:${curios_version}") // https://maven.theillusivec4.top/top/theillusivec4/curios/curios-neoforge/
compileOnly "top.theillusivec4.curios:curios-neoforge:${neoforge_curios_version}:api"

// Project lombok
compileOnly 'org.projectlombok:lombok:1.18.30'
annotationProcessor 'org.projectlombok:lombok:1.18.30'
testCompileOnly 'org.projectlombok:lombok:1.18.30'
testAnnotationProcessor 'org.projectlombok:lombok:1.18.30'
}

runs {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
import com.google.common.cache.CacheBuilder;
import com.google.common.cache.CacheLoader;
import com.google.common.cache.LoadingCache;
import lombok.Data;
import lombok.SneakyThrows;
import net.minecraft.client.Minecraft;
import net.minecraft.client.multiplayer.ClientLevel;
import net.minecraft.core.BlockPos;
Expand All @@ -17,13 +15,14 @@

import javax.annotation.Nullable;
import java.lang.ref.WeakReference;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;

/**
* A simple data class for a block position inside a world.
*
* @author rubensworks
*/
@Data(staticConstructor = "of")
public class DimPos implements Comparable<DimPos> {

private final String level;
Expand All @@ -49,9 +48,16 @@ private DimPos(String world, BlockPos blockPos) {
this(world, blockPos, null);
}

@SneakyThrows
public static DimPos of(String level, BlockPos blockPos) {
return new DimPos(level, blockPos);
}

public ResourceKey<Level> getLevelKey() {
return CACHE_WORLD_KEYS.get(getLevel());
try {
return CACHE_WORLD_KEYS.get(getLevel());
} catch (ExecutionException e) {
throw new RuntimeException(e);
}
}

@Nullable
Expand Down Expand Up @@ -84,7 +90,7 @@ public boolean isLoaded() {
@Override
public int compareTo(DimPos o) {
int compareDim = getLevel().compareTo(o.getLevel());
if(compareDim == 0) {
if (compareDim == 0) {
return IModHelpers.get().getMinecraftHelpers().compareBlockPos(getBlockPos(), o.getBlockPos());
}
return compareDim;
Expand Down Expand Up @@ -112,4 +118,23 @@ public static DimPos of(ResourceKey<Level> world, BlockPos blockPos) {
return new DimPos(world.location().toString(), blockPos);
}

public String getLevel() {
return this.level;
}

public BlockPos getBlockPos() {
return this.blockPos;
}

public WeakReference<Level> getWorldReference() {
return this.worldReference;
}

public void setWorldReference(WeakReference<Level> worldReference) {
this.worldReference = worldReference;
}

public String toString() {
return "DimPos(level=" + this.getLevel() + ", blockPos=" + this.getBlockPos() + ", worldReference=" + this.getWorldReference() + ")";
}
}
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
package org.cyclops.cyclopscore.infobook;

import lombok.Getter;

/**
* A link wrapper targeted at other sections.
*
* @author rubensworks
*/
public class HyperLink {

@Getter private int x, y;
@Getter private InfoSection target;
@Getter private String translationKey;
private int x, y;
private InfoSection target;
private String translationKey;

public HyperLink(int x, int y, InfoSection target, String translationKey) {
this.x = x;
Expand All @@ -19,4 +18,19 @@ public HyperLink(int x, int y, InfoSection target, String translationKey) {
this.translationKey = translationKey;
}

public int getX() {
return this.x;
}

public int getY() {
return this.y;
}

public InfoSection getTarget() {
return this.target;
}

public String getTranslationKey() {
return this.translationKey;
}
}
Loading

0 comments on commit 20dff5e

Please sign in to comment.