Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
143 changes: 38 additions & 105 deletions src/main/java/io/github/pingisfun/hitboxplus/ModConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,39 +29,39 @@ public class ModConfig implements ConfigData {

@ConfigEntry.Category(value = "players")
@ConfigEntry.Gui.CollapsibleObject
public Player.FriendPlayer friend = new Player.FriendPlayer();
public PlayerListConfig friend = new PlayerListConfig(0x20FF00);

@ConfigEntry.Category(value = "players")
@ConfigEntry.Gui.CollapsibleObject
public Player.EnemyPlayer enemy = new Player.EnemyPlayer();
public PlayerListConfig enemy = new PlayerListConfig(0xD40000);

@ConfigEntry.Category(value = "players")
@ConfigEntry.Gui.CollapsibleObject
public Player.NeutralPlayer neutral = new Player.NeutralPlayer();
public PlayerSingleConfig neutral = new PlayerSingleConfig();

@ConfigEntry.Category(value = "players")
@ConfigEntry.Gui.CollapsibleObject
public Player.SelfPlayer self = new Player.SelfPlayer();
public PlayerSingleConfig self = new PlayerSingleConfig();

@ConfigEntry.Category(value = "entity")
@ConfigEntry.Gui.CollapsibleObject
public Entity passive = Entity.passive();
public Entity passive = new Entity();

@ConfigEntry.Category(value = "entity")
@ConfigEntry.Gui.CollapsibleObject
public Entity hostile = Entity.hostile();
public Entity hostile = new Entity();

@ConfigEntry.Category(value = "entity")
@ConfigEntry.Gui.CollapsibleObject
public Entity decoration = Entity.decoration();
public Entity decoration = new Entity();

@ConfigEntry.Category(value = "entity")
@ConfigEntry.Gui.CollapsibleObject
public Entity projectile = Entity.projectile();
public Entity projectile = new Entity();

@ConfigEntry.Category(value = "entity")
@ConfigEntry.Gui.CollapsibleObject
public Entity vehicle = Entity.vehicle();
public Entity vehicle = new Entity();

@ConfigEntry.Category(value = "entity")
@ConfigEntry.Gui.CollapsibleObject
Expand All @@ -75,90 +75,29 @@ public static class MiscEntityDropdown {
public boolean isEnabled = false;

@ConfigEntry.Gui.CollapsibleObject
public MiscEntity areaEffectCloud = MiscEntity.areaEffectCloud();
public MiscEntity areaEffectCloud = new MiscEntity();

@ConfigEntry.Gui.CollapsibleObject
public MiscEntity experienceOrb = MiscEntity.experienceOrb();
public MiscEntity experienceOrb = new MiscEntity();

@ConfigEntry.Gui.CollapsibleObject
public MiscEntity eyeOfEnder = MiscEntity.eyeOfEnder();
public MiscEntity eyeOfEnder = new MiscEntity();

@ConfigEntry.Gui.CollapsibleObject
public MiscEntity fallingBlock = MiscEntity.fallingBlock();
public MiscEntity fallingBlock = new MiscEntity();

@ConfigEntry.Gui.CollapsibleObject
public MiscEntity item = MiscEntity.item();
public MiscEntity item = new MiscEntity();

@ConfigEntry.Gui.CollapsibleObject
public MiscEntity tnt = MiscEntity.tnt();
public MiscEntity tnt = new MiscEntity();

@ConfigEntry.Gui.CollapsibleObject
public MiscEntity endCrystalEntity = MiscEntity.endCrystalEntity();
public MiscEntity endCrystalEntity = new MiscEntity();


}

public static class Player {
public static class FriendPlayer {
public List<String> list = new ArrayList<>();

@ConfigEntry.ColorPicker()
public int color = 0x20FF00;

@ConfigEntry.BoundedDiscrete(max = 10, min = 0)
public int alpha = 10;
}

public static class EnemyPlayer {
public List<String> list = new ArrayList<>();

@ConfigEntry.ColorPicker()
public int color = 0xD40000;

@ConfigEntry.BoundedDiscrete(max = 10, min = 0)
public int alpha = 10;
}

public static class SelfPlayer {
@ConfigEntry.ColorPicker()
public int color = 0xFFFFFF;

@ConfigEntry.BoundedDiscrete(max = 10, min = 0)
public int alpha = 10;
}

public static class NeutralPlayer {

@ConfigEntry.ColorPicker()
public int color = 0xFFFFFF;

@ConfigEntry.BoundedDiscrete(max = 10, min = 0)
public int alpha = 10;
}

}

public static class Entity {
public static Entity passive() {
return new Entity();
}

public static Entity hostile() {
return new Entity();
}

public static Entity decoration() {
return new Entity();
}

public static Entity projectile() {
return new Entity();
}

public static Entity vehicle() {
return new Entity();
}

public boolean isEnabled = false;

@ConfigEntry.ColorPicker()
Expand All @@ -169,34 +108,6 @@ public static Entity vehicle() {
}

public static class MiscEntity {
public static MiscEntity areaEffectCloud() {
return new MiscEntity();
}

public static MiscEntity experienceOrb() {
return new MiscEntity();
}

public static MiscEntity eyeOfEnder() {
return new MiscEntity();
}

public static MiscEntity fallingBlock() {
return new MiscEntity();
}

public static MiscEntity item() {
return new MiscEntity();
}

public static MiscEntity tnt() {
return new MiscEntity();
}

public static MiscEntity endCrystalEntity() {
return new MiscEntity();
}

@ConfigEntry.ColorPicker()
public int color = 0xFFFFFF;

Expand Down Expand Up @@ -224,4 +135,26 @@ public static class EnderDragonEntity {
public int part_alpha = 10;
}

public static class PlayerSingleConfig {
@ConfigEntry.ColorPicker()
public int color = 0xFFFFFF;

@ConfigEntry.BoundedDiscrete(max = 10, min = 0)
public int alpha = 10;
}

public static class PlayerListConfig {

public PlayerListConfig(int color) {
this.color = color;
}

public List<String> list = new ArrayList<>();

@ConfigEntry.ColorPicker()
public int color;

@ConfigEntry.BoundedDiscrete(max = 10, min = 0)
public int alpha = 10;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
import net.minecraft.entity.decoration.AbstractDecorationEntity;
import net.minecraft.entity.decoration.ArmorStandEntity;
import net.minecraft.entity.decoration.EndCrystalEntity;
import net.minecraft.entity.mob.AmbientEntity;
import net.minecraft.entity.mob.HostileEntity;
import net.minecraft.entity.passive.AllayEntity;
import net.minecraft.entity.passive.BatEntity;
import net.minecraft.entity.passive.PassiveEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.projectile.ProjectileEntity;
Expand Down Expand Up @@ -41,7 +41,7 @@ public static Color getEntityColor(Entity entity) {
return ColorUtil.decode(config.ender_dragon.color, config.ender_dragon.alpha);
} else if (entity instanceof HostileEntity && config.hostile.isEnabled) {
return ColorUtil.decode(config.hostile.color, config.hostile.alpha);
} else if ((entity instanceof PassiveEntity || entity instanceof AllayEntity || entity instanceof BatEntity) && config.passive.isEnabled) {
} else if ((entity instanceof PassiveEntity || entity instanceof AllayEntity || entity instanceof AmbientEntity) && config.passive.isEnabled) {
return ColorUtil.decode(config.passive.color, config.passive.alpha);
} else if ((entity instanceof ProjectileEntity) && config.projectile.isEnabled) {
return ColorUtil.decode(config.projectile.color, config.projectile.alpha);
Expand Down