Skip to content

Commit

Permalink
bruh
Browse files Browse the repository at this point in the history
  • Loading branch information
AViewFromTheTop committed Dec 31, 2024
1 parent 97285b2 commit abcd2bd
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 74 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
min_loader_version=0.16.0

# Mod Properties
mod_version = 1.9.7
mod_version = 1.9.9
maven_group = net.frozenblock
archives_base_name = FrozenLib

Expand Down
10 changes: 4 additions & 6 deletions src/main/java/net/frozenblock/lib/gravity/api/GravityAPI.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,7 @@
import org.jetbrains.annotations.NotNull;

public final class GravityAPI {
private GravityAPI() {}

public static final Vec3 DEFAULT_GRAVITY = new Vec3(0.0, 1.0, 0.0);
public static final double DEFAULT_GRAVITY = 1D;

public static final Event<GravityModification> MODIFICATIONS = FrozenEvents.createEnvironmentEvent(GravityModification.class, callbacks -> context -> {
for (GravityModification callback : callbacks) {
Expand All @@ -53,7 +51,7 @@ public static List<GravityBelt<?>> getAllBelts(ResourceKey<Level> dimension) {
return GRAVITY_BELTS.computeIfAbsent(dimension, dimension1 -> new ArrayList<>());
}

public static List<GravityBelt<?>> getAllBelts(Level level) {
public static @NotNull List<GravityBelt<?>> getAllBelts(@NotNull Level level) {
return getAllBelts(level.dimension());
}

Expand All @@ -75,11 +73,11 @@ public static Vec3 calculateGravity(ResourceKey<Level> dimension, double y) {
return context.gravity;
}

public static Vec3 calculateGravity(Level level, double y) {
public static Vec3 calculateGravity(@NotNull Level level, double y) {
return calculateGravity(level.dimension(), y);
}

public static Vec3 calculateGravity(Entity entity) {
public static Vec3 calculateGravity(@NotNull Entity entity) {
ResourceKey<Level> dimension = entity.level().dimension();
double y = entity.getY();
GravityContext context = new GravityContext(dimension, y, entity);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,11 @@
import org.jetbrains.annotations.Nullable;

public record AbsoluteGravityFunction(Vec3 gravity) implements SerializableGravityFunction<AbsoluteGravityFunction> {

public static final Codec<AbsoluteGravityFunction> CODEC = RecordCodecBuilder.create(instance ->
instance.group(
Vec3.CODEC.fieldOf("gravity").forGetter(AbsoluteGravityFunction::gravity)
).apply(instance, AbsoluteGravityFunction::new)
);

public static final Codec<GravityBelt<AbsoluteGravityFunction>> BELT_CODEC = GravityBelt.codec(CODEC);

@Override
Expand Down

This file was deleted.

0 comments on commit abcd2bd

Please sign in to comment.