Skip to content

Commit

Permalink
Merge and build 0.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Rainyaphthyl committed Oct 23, 2023
2 parents b8c9817 + 554ce47 commit 45ddfd0
Show file tree
Hide file tree
Showing 15 changed files with 818 additions and 26 deletions.
31 changes: 14 additions & 17 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ This is a **pre-release** version.

### Mod Versions

- Current version: `0.1.6`
- Previous version: `0.1.5`
- Previous annotated version: `0.1.4`
- Current version: `0.2.0`
- Previous version: `0.1.6`
- Previous annotated version: `0.1.6`
- Previous release version: `null`

## Abstract
Expand All @@ -21,23 +21,20 @@ This is a **pre-release** version.

### Description

- Chunk Loading Captor captures chunk populating and saving.
- Chunk event messages can be filtered according to a list of rules.
- Savestate Logger.
- Logger of invalid End Cities.
- A new option, fixing an Optifine bug about players joining the world.
- New Tab of Configs:
- Visual

### New Configs

1. Meters
1. Chunk Message Filter List
2. Chunk Message Filter Switch
3. Savestate Logger
4. Invalid End City Logger
2. Fixes
1. Optifine Joining Game Fix
3. Generic
1. Optifine Joining Game Debug
1. Meters:
1. Projectile Aim Indicator
2. Tweaks:
1. Projectile Aim Adjust Sensitivity
3. Actions:
1. Projectile Aim Indicator
4. Visual:
1. Projectile Center Color
2. Projectile Range Color

## Modified Features

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ modId=potato_tech_kit
modName=Potato Tech Kit
# lowercase, without hyphens
modPureName=potteckit
modVersion=0.1.6
modVersion=0.2.0

malilibVersion=0.54.0

Expand Down
20 changes: 15 additions & 5 deletions src/main/java/io/github/rainyaphthyl/potteckit/config/Configs.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,17 @@

import com.google.common.collect.ImmutableList;
import fi.dy.masa.malilib.config.JsonModConfig;
import fi.dy.masa.malilib.config.option.HotkeyConfig;
import fi.dy.masa.malilib.config.option.HotkeyedBooleanConfig;
import fi.dy.masa.malilib.config.option.IntegerConfig;
import fi.dy.masa.malilib.config.option.OptionListConfig;
import fi.dy.masa.malilib.config.option.*;
import fi.dy.masa.malilib.config.option.list.BlockListConfig;
import fi.dy.masa.malilib.input.KeyBindSettings;
import fi.dy.masa.malilib.registry.Registry;
import io.github.rainyaphthyl.potteckit.config.annotation.Config;
import io.github.rainyaphthyl.potteckit.config.annotation.Domain;
import io.github.rainyaphthyl.potteckit.config.annotation.Type;
import io.github.rainyaphthyl.potteckit.config.option.EnumRealmStatus;
import io.github.rainyaphthyl.potteckit.config.option.InvIntegerConfig;
import io.github.rainyaphthyl.potteckit.config.option.multipart.ChunkFilterListConfig;
import io.github.rainyaphthyl.potteckit.entities.Renderers;
import io.github.rainyaphthyl.potteckit.gui.ChunkFilterListConfigWidget;
import io.github.rainyaphthyl.potteckit.gui.GuiConfigScreen;
import io.github.rainyaphthyl.potteckit.gui.InvIntegerConfigWidget;
Expand Down Expand Up @@ -61,7 +60,7 @@ public class Configs {
@Config(types = Type.TOGGLE, domains = Domain.FIX, serverSide = true)
public static final HotkeyedBooleanConfig fixLanSkinAbsence = new HotkeyedBooleanConfig("fix_lan_skin_absence", true, "", "fix_lan_skin_absence", "fix_lan_skin_absence");
@Config(types = Type.ENUM, domains = Domain.YEET)
public static final OptionListConfig<EnumRealmStatus> yeetRealmPage = new OptionListConfig<>("yeet_realm_page", EnumRealmStatus.DISABLED, EnumRealmStatus.list, "yeet_realm_page", "yeet_realm_page");
public static final OptionListConfig<EnumRealmStatus> yeetRealmPage = new OptionListConfig<>("yeet_realm_page", EnumRealmStatus.DISABLED, EnumRealmStatus.LIST, "yeet_realm_page", "yeet_realm_page");
@Config(types = Type.LIST, domains = Domain.METER)
public static final ChunkFilterListConfig chunkLoadFilterList = ChunkFilterListConfig.create("chunk_load_filter", ImmutableList.of());
@Config(types = Type.TOGGLE, domains = Domain.METER)
Expand All @@ -74,6 +73,16 @@ public class Configs {
public static final HotkeyedBooleanConfig optifineJoiningGameFix = new HotkeyedBooleanConfig("optifine_joining_game_fix", false, "", "optifine_joining_game_fix", "optifine_joining_game_fix");
@Config(types = Type.TOGGLE, domains = Domain.GENERIC, serverSide = true)
public static final HotkeyedBooleanConfig optifineJoiningGameDebug = new HotkeyedBooleanConfig("optifine_joining_game_debug", false, "", "optifine_joining_game_debug", "optifine_joining_game_debug");
@Config(types = Type.TOGGLE, domains = Domain.METER)
public static final HotkeyedBooleanConfig projectileAimIndicator = new HotkeyedBooleanConfig("projectile_aim_indicator", false, "", "projectile_aim_indicator", "projectile_aim_indicator");
@Config(types = Type.HOTKEY, domains = Domain.ACTION)
public static final HotkeyConfig projectileAimTrigger = new HotkeyConfig("projectile_aim_indicator", "", KeyBindSettings.INGAME_MODIFIER);
@Config(types = Type.NUMBER, domains = Domain.VISUAL)
public static final DualColorConfig projectileCenterColor = new DualColorConfig("arrow_color_center", "0xFF3CFF", "0x3CFFFF", "arrow_color_center").setFirstColorHoverInfoKey("potteckit.label.arrow_color.hit").setSecondColorHoverInfoKey("potteckit.label.arrow_color.miss");
@Config(types = Type.NUMBER, domains = Domain.VISUAL)
public static final DualColorConfig projectileRangeColor = new DualColorConfig("arrow_color_range", "0xFF3C3C", "0x3CFF3C", "arrow_color_range").setFirstColorHoverInfoKey("potteckit.label.arrow_color.hit").setSecondColorHoverInfoKey("potteckit.label.arrow_color.miss");
@Config(types = Type.TOGGLE, domains = Domain.TWEAK)
public static final BooleanAndDoubleConfig projectileAccurateAim = new BooleanAndDoubleConfig("projectile_accurate_aim", false, 80.0, 0.0, 200.0, "projectile_accurate_aim");

public static void registerOnInit() {
JsonModConfig jsonModConfig = new JsonModConfig(Reference.MOD_INFO, Reference.CONFIG_VERSION, ConfigHandler.optionCategoryList);
Expand All @@ -85,5 +94,6 @@ public static void registerOnInit() {
Registry.HOTKEY_MANAGER.registerHotkeyProvider(new PotteckitHotkeyProvider());
Actions.init();
Callbacks.init();
Renderers.init();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public enum Category {
* Helping players with game operations
*/
ACTION("Actions", "action"),
VISUAL("Visual", "visual"),
WITH_SERVER("NeedServer", "server"),
/**
* Making some manual operations so convenient that players refuse to design automatic machines for them.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ public enum Domain {
ACTION(Category.ACTION),
FIX(Category.FIX),
TWEAK(Category.TWEAK),
YEET(Category.YEET);
YEET(Category.YEET),
VISUAL(Category.VISUAL);
public final Category category;

Domain(Category category) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public enum EnumRealmStatus implements OptionListConfigValue {
VANILLA("vanilla", "Vanilla"),
DISABLED("disabled", "Disabled"),
INVISIBLE("invisible", "Invisible");
public static final ImmutableList<EnumRealmStatus> list = ImmutableList.copyOf(values());
public static final ImmutableList<EnumRealmStatus> LIST = ImmutableList.copyOf(values());
public final String name;
public final String description;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
package io.github.rainyaphthyl.potteckit.entities;

import it.unimi.dsi.fastutil.doubles.Double2ObjectAVLTreeMap;
import it.unimi.dsi.fastutil.doubles.Double2ObjectMap;
import it.unimi.dsi.fastutil.doubles.Double2ObjectSortedMap;
import net.minecraft.util.math.Vec3d;

import javax.annotation.Nonnull;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

public class AimRangePacket implements Iterable<Double2ObjectMap.Entry<AimRangePacket.Range>> {
private final Double2ObjectSortedMap<Range> vertexCircleMap = new Double2ObjectAVLTreeMap<>();
private boolean completed = false;

{
vertexCircleMap.defaultReturnValue(null);
}

public AimRangePacket() {
}

@Override
public boolean equals(Object obj) {
if (obj == this) return true;
if (!(obj instanceof AimRangePacket)) return false;
AimRangePacket that = (AimRangePacket) obj;
if (!completed || !that.completed) return false;
return super.equals(obj);
}

public void addVertexAtLevel(double level, Vec3d position, boolean atEntity) {
Vertex vertex = new Vertex(position, atEntity);
double absLevel = Math.abs(level);
addVertexAtLevel(absLevel, vertex);
}

public void setCompleted() {
synchronized (vertexCircleMap) {
if (completed) return;
for (Double2ObjectMap.Entry<Range> entry : vertexCircleMap.double2ObjectEntrySet()) {
Range range = entry.getValue();
range.setCompleted();
}
completed = true;
}
}

public void addVertexAtLevel(double level, Vertex vertex) {
if (completed) {
return;
}
synchronized (vertexCircleMap) {
Range range = vertexCircleMap.get(level);
if (range == null) {
range = new Range();
vertexCircleMap.put(level, range);
}
range.add(vertex);
}
}

@Override
@Nonnull
public Iterator<Double2ObjectMap.Entry<Range>> iterator() {
return vertexCircleMap.double2ObjectEntrySet().iterator();
}

public static class Range implements Iterable<Vertex> {
private final List<Vertex> vertexList = new ArrayList<>();
private boolean atEntity = true;
private boolean completed = false;

public Range() {
}

@Override
@Nonnull
public Iterator<Vertex> iterator() {
return vertexList.listIterator();
}

public void setCompleted() {
completed = true;
}

public void add(Vertex vertex) {
if (completed) {
return;
}
if (vertex != null && vertex.position != null) {
synchronized (vertexList) {
atEntity &= vertex.atEntity;
vertexList.add(vertex);
}
}
}

public int size() {
synchronized (vertexList) {
return vertexList.size();
}
}

public boolean isAtEntity() {
return atEntity && size() > 0;
}
}

public static class Vertex {
public final Vec3d position;
public final boolean atEntity;

public Vertex(Vec3d position, boolean atEntity) {
this.position = position;
this.atEntity = atEntity;
}
}
}
Loading

0 comments on commit 45ddfd0

Please sign in to comment.