push again mostly to get the new toml file
|
@ -1,11 +1,19 @@
|
|||
# The version of night-config Forge packages still has this bug:
|
||||
# https://github.com/TheElectronWill/night-config/issues/96
|
||||
# So we use int codes. aa.
|
||||
|
||||
[petra_the_kat]
|
||||
colorizer = [0xebad1c, 0xc7c7bd, 0x7c2e94, 0x2e060f]
|
||||
# colorizer = [0xebad1c, 0xc7c7bd, 0x7c2e94, 0x2e060f]
|
||||
colorizer = [15445276, 13092797, 8137012, 3016207]
|
||||
|
||||
[Hudeler]
|
||||
colorizer = [0x825ec2]
|
||||
#colorizer = [0x825ec2]
|
||||
colorizer = [8543938]
|
||||
|
||||
[AmyMiyalee]
|
||||
colorizer = [0xb992ff]
|
||||
#colorizer = [0xb992ff]
|
||||
colorizer = [12161791]
|
||||
|
||||
[Alwinfy]
|
||||
colorizer = [0x327e3]
|
||||
#colorizer = [0x3327e3]
|
||||
colorizer = [3352547]
|
||||
|
|
|
@ -4,6 +4,22 @@ df940dd798240fac6fde700c57f8ae6aa43d1c9e assets/hexcasting/models/item/artifact.
|
|||
dc72e3345c4375b37f3624040c9a8df435c958d1 assets/hexcasting/models/item/charged_amethyst.json
|
||||
b9916a82d647db5d3c505de2eb5f0a528169e1db assets/hexcasting/models/item/cypher.json
|
||||
5082df8eee8f56f8c0d74db71ccda37a165bc76f assets/hexcasting/models/item/cypher_filled.json
|
||||
871088f514f06b0bde81d644e381a6e98c5daf61 assets/hexcasting/models/item/dye_colorizer_black.json
|
||||
194a21d3af84bea004c9a55cb153325bed7e4bf9 assets/hexcasting/models/item/dye_colorizer_blue.json
|
||||
caa448cd4f9db090d08831d0524c486d0ca01c1c assets/hexcasting/models/item/dye_colorizer_brown.json
|
||||
d08956a36c1e60bf30033f501e31aba0347ca9ba assets/hexcasting/models/item/dye_colorizer_cyan.json
|
||||
337b854474dc9a580f56168db0baa74bb40d605c assets/hexcasting/models/item/dye_colorizer_gray.json
|
||||
622a72cc97b9a2a2670111bb39a715bf8014fcf2 assets/hexcasting/models/item/dye_colorizer_green.json
|
||||
cb810c9d9e9b36c918a397436d16d6abf477ca72 assets/hexcasting/models/item/dye_colorizer_light_blue.json
|
||||
4ae96d4cb2cc02447f32eaaaae29c225d40bcc1e assets/hexcasting/models/item/dye_colorizer_light_gray.json
|
||||
3d8b6e5ecb91efce442868fb04d30c9c939614f6 assets/hexcasting/models/item/dye_colorizer_lime.json
|
||||
a0589219f69c6d5f22e653311979291769ecd14f assets/hexcasting/models/item/dye_colorizer_magenta.json
|
||||
0ec3bdf3e10b4580bcaba39f6c1b536c8fa73039 assets/hexcasting/models/item/dye_colorizer_orange.json
|
||||
c2ceb08a8662a7e4a311401b0baced1add6f2e35 assets/hexcasting/models/item/dye_colorizer_pink.json
|
||||
48ea52ff40c7b65064ca0f67eac5aa97c743eb12 assets/hexcasting/models/item/dye_colorizer_purple.json
|
||||
f41fb9405b869644333872cd1ece40b1b07410d2 assets/hexcasting/models/item/dye_colorizer_red.json
|
||||
5894e7a1cc38ae5b09c651791c65c983d984d20c assets/hexcasting/models/item/dye_colorizer_white.json
|
||||
07959b86ed25559b4960c5f4aa7bab88bf9b5bf1 assets/hexcasting/models/item/dye_colorizer_yellow.json
|
||||
5ee629510cbd0058a5736be2bf426d3a1b6717a0 assets/hexcasting/models/item/focus.json
|
||||
0146e90177ed71b25d2936ff3b2d9975e47c5142 assets/hexcasting/models/item/focus_double.json
|
||||
167b8e3f3367f12f8045369bea26d7a48e59b0d0 assets/hexcasting/models/item/focus_double_sealed.json
|
||||
|
@ -42,7 +58,7 @@ e0954b5771ab64014fe3a0269db6ab0699e3e6f8 data/hexcasting/advancements/recipes/he
|
|||
cfd93238a1774a30a9da7c6b84e66c2e1e22f243 data/hexcasting/advancements/recipes/hexcasting/wand.json
|
||||
d31956749bebbcb3f0d3c37f89b569642ac8c2fb data/hexcasting/advancements/root.json
|
||||
739cbdf7f204132f2acfab4df8d21c6197aa1456 data/hexcasting/advancements/y_u_no_cast_angy.json
|
||||
865ddd908e95e171f80e8f051987d68c52af987e data/hexcasting/loot_modifiers/amethyst_cluster.json
|
||||
0026293d7365142676971a5c786005b00171c765 data/hexcasting/loot_modifiers/amethyst_cluster.json
|
||||
e04be385fa9daa422e41a38ddd70fdd065107968 data/hexcasting/loot_modifiers/scroll_bastion.json
|
||||
6569766d1579114149eb0a1154d05ec3c964b2a3 data/hexcasting/loot_modifiers/scroll_cartographer.json
|
||||
afecba3144e00505977a4ab4de7940f949ab7818 data/hexcasting/loot_modifiers/scroll_dungeon.json
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"parent": "minecraft:item/generated",
|
||||
"textures": {
|
||||
"layer0": "hexcasting:item/colorizer/dye15"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"parent": "minecraft:item/generated",
|
||||
"textures": {
|
||||
"layer0": "hexcasting:item/colorizer/dye11"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"parent": "minecraft:item/generated",
|
||||
"textures": {
|
||||
"layer0": "hexcasting:item/colorizer/dye12"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"parent": "minecraft:item/generated",
|
||||
"textures": {
|
||||
"layer0": "hexcasting:item/colorizer/dye9"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"parent": "minecraft:item/generated",
|
||||
"textures": {
|
||||
"layer0": "hexcasting:item/colorizer/dye7"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"parent": "minecraft:item/generated",
|
||||
"textures": {
|
||||
"layer0": "hexcasting:item/colorizer/dye13"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"parent": "minecraft:item/generated",
|
||||
"textures": {
|
||||
"layer0": "hexcasting:item/colorizer/dye3"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"parent": "minecraft:item/generated",
|
||||
"textures": {
|
||||
"layer0": "hexcasting:item/colorizer/dye8"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"parent": "minecraft:item/generated",
|
||||
"textures": {
|
||||
"layer0": "hexcasting:item/colorizer/dye5"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"parent": "minecraft:item/generated",
|
||||
"textures": {
|
||||
"layer0": "hexcasting:item/colorizer/dye2"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"parent": "minecraft:item/generated",
|
||||
"textures": {
|
||||
"layer0": "hexcasting:item/colorizer/dye1"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"parent": "minecraft:item/generated",
|
||||
"textures": {
|
||||
"layer0": "hexcasting:item/colorizer/dye6"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"parent": "minecraft:item/generated",
|
||||
"textures": {
|
||||
"layer0": "hexcasting:item/colorizer/dye10"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"parent": "minecraft:item/generated",
|
||||
"textures": {
|
||||
"layer0": "hexcasting:item/colorizer/dye14"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"parent": "minecraft:item/generated",
|
||||
"textures": {
|
||||
"layer0": "hexcasting:item/colorizer/dye0"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"parent": "minecraft:item/generated",
|
||||
"textures": {
|
||||
"layer0": "hexcasting:item/colorizer/dye4"
|
||||
}
|
||||
}
|
|
@ -18,6 +18,6 @@
|
|||
}
|
||||
}
|
||||
],
|
||||
"chargedChance": 0.95,
|
||||
"chargedChance": 0.9,
|
||||
"type": "hexcasting:amethyst_cluster"
|
||||
}
|
|
@ -1,5 +1,6 @@
|
|||
package at.petrak.hexcasting.client;
|
||||
|
||||
import at.petrak.hexcasting.common.casting.colors.CapPreferredColorizer;
|
||||
import at.petrak.hexcasting.common.casting.operators.spells.sentinel.CapSentinel;
|
||||
import at.petrak.hexcasting.common.lib.HexCapabilities;
|
||||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
|
@ -13,6 +14,7 @@ import net.minecraft.client.Minecraft;
|
|||
import net.minecraft.client.player.LocalPlayer;
|
||||
import net.minecraft.client.renderer.GameRenderer;
|
||||
import net.minecraft.util.Mth;
|
||||
import net.minecraft.world.phys.Vec3;
|
||||
import net.minecraftforge.client.event.RenderLevelLastEvent;
|
||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
|
||||
|
@ -66,11 +68,24 @@ public class HexAdditionalRenderers {
|
|||
RenderSystem.disableCull();
|
||||
RenderSystem.lineWidth(5f);
|
||||
|
||||
// we have to put *something* in the normal lest flickering
|
||||
Consumer<float[]> v = (point) -> buf.vertex(neo, point[0], point[1], point[2])
|
||||
.color(sentinel.color)
|
||||
.normal(point[0], point[1], point[2])
|
||||
.endVertex();
|
||||
var maybeColorizerCap = owner.getCapability(HexCapabilities.PREFERRED_COLORIZER).resolve();
|
||||
CapPreferredColorizer cap = null;
|
||||
if (maybeColorizerCap.isPresent()) {
|
||||
cap = maybeColorizerCap.get();
|
||||
}
|
||||
|
||||
CapPreferredColorizer finalCap = cap;
|
||||
Consumer<float[]> v = (point) -> {
|
||||
var color = -1;
|
||||
if (finalCap != null) {
|
||||
color = finalCap.getColor(owner, time, new Vec3(point[0], point[1], point[2]));
|
||||
}
|
||||
buf.vertex(neo, point[0], point[1], point[2])
|
||||
.color(color)
|
||||
// we have to put *something* in the normal lest flickering
|
||||
.normal(point[0], point[1], point[2])
|
||||
.endVertex();
|
||||
};
|
||||
|
||||
// Icosahedron inscribed inside the unit sphere
|
||||
for (int side = 0; side <= 1; side++) {
|
||||
|
|
|
@ -11,6 +11,11 @@ object ContributorList {
|
|||
private val contributors = ConcurrentHashMap<String, ContributorInfo>()
|
||||
private var startedLoading = false
|
||||
|
||||
@JvmStatic
|
||||
fun getContributor(name: String): ContributorInfo? =
|
||||
this.contributors[name]
|
||||
|
||||
|
||||
fun loadContributors() {
|
||||
if (!startedLoading) {
|
||||
val thread = Thread(this::fetch)
|
||||
|
@ -30,13 +35,18 @@ object ContributorList {
|
|||
|
||||
val keys = toml.valueMap().keys
|
||||
for (key in keys) {
|
||||
val info: ContributorInfo = toml.get(key)
|
||||
val infoRaw: ContributorInfoInner = toml.get(key)
|
||||
val info = ContributorInfo(
|
||||
infoRaw.colorizer.stream().mapToInt { i -> i or 0xff_000000.toInt() }.toArray()
|
||||
)
|
||||
contributors[key] = info
|
||||
}
|
||||
HexMod.getLogger().info("Loaded ${contributors.size} contributors!")
|
||||
} catch (e: IOException) {
|
||||
HexMod.getLogger().info("Couldn't load contributors.toml. Nothing to be done, carry on...")
|
||||
HexMod.getLogger().info("Couldn't load contributors.toml. Nothing to be done, carry on...\n$e")
|
||||
}
|
||||
}
|
||||
|
||||
data class ContributorInfo(val colorizer: List<Int>)
|
||||
private data class ContributorInfoInner(val colorizer: List<Int>)
|
||||
data class ContributorInfo(val colorizer: IntArray)
|
||||
}
|
|
@ -18,7 +18,10 @@ import at.petrak.hexcasting.common.casting.operators.spells.great.OpCreateLava;
|
|||
import at.petrak.hexcasting.common.casting.operators.spells.great.OpFlight;
|
||||
import at.petrak.hexcasting.common.casting.operators.spells.great.OpLightning;
|
||||
import at.petrak.hexcasting.common.casting.operators.spells.great.OpTeleport;
|
||||
import at.petrak.hexcasting.common.casting.operators.spells.sentinel.*;
|
||||
import at.petrak.hexcasting.common.casting.operators.spells.sentinel.OpCreateSentinel;
|
||||
import at.petrak.hexcasting.common.casting.operators.spells.sentinel.OpDestroySentinel;
|
||||
import at.petrak.hexcasting.common.casting.operators.spells.sentinel.OpGetSentinelPos;
|
||||
import at.petrak.hexcasting.common.casting.operators.spells.sentinel.OpGetSentinelWayfind;
|
||||
import at.petrak.hexcasting.common.items.magic.ItemArtifact;
|
||||
import at.petrak.hexcasting.common.items.magic.ItemCypher;
|
||||
import at.petrak.hexcasting.common.items.magic.ItemTrinket;
|
||||
|
@ -99,15 +102,9 @@ public class RegisterPatterns {
|
|||
OpBreakBlock.INSTANCE);
|
||||
PatternRegistry.mapPattern(HexPattern.FromAnglesSig("eeeeede", HexDir.SOUTH_WEST), prefix("place_block"),
|
||||
OpPlaceBlock.INSTANCE);
|
||||
PatternRegistry.mapPattern(HexPattern.FromAnglesSig("waqqqqq", HexDir.EAST), prefix("craft/cypher"),
|
||||
new OpMakePackagedSpell<>(ItemCypher.class, 100_000));
|
||||
PatternRegistry.mapPattern(HexPattern.FromAnglesSig("wwaqqqqqeaqeaeqqqeaeq", HexDir.EAST),
|
||||
prefix("craft/trinket"),
|
||||
new OpMakePackagedSpell<>(ItemTrinket.class, 500_000));
|
||||
PatternRegistry.mapPattern(
|
||||
HexPattern.FromAnglesSig("wwaqqqqqeawqwqwqwqwqwwqqeadaeqqeqqeadaeqq", HexDir.EAST),
|
||||
prefix("craft/artifact"),
|
||||
new OpMakePackagedSpell<>(ItemArtifact.class, 1_000_000));
|
||||
PatternRegistry.mapPattern(HexPattern.FromAnglesSig("awdwqawqwawq", HexDir.EAST),
|
||||
prefix("colorize"),
|
||||
OpColorize.INSTANCE, false);
|
||||
PatternRegistry.mapPattern(HexPattern.FromAnglesSig("aqawqadaq", HexDir.SOUTH_EAST), prefix("create_water"),
|
||||
OpCreateWater.INSTANCE);
|
||||
PatternRegistry.mapPattern(HexPattern.FromAnglesSig("dedwedade", HexDir.SOUTH_WEST),
|
||||
|
@ -118,6 +115,16 @@ public class RegisterPatterns {
|
|||
prefix("recharge"),
|
||||
OpRecharge.INSTANCE);
|
||||
|
||||
PatternRegistry.mapPattern(HexPattern.FromAnglesSig("waqqqqq", HexDir.EAST), prefix("craft/cypher"),
|
||||
new OpMakePackagedSpell<>(ItemCypher.class, 100_000));
|
||||
PatternRegistry.mapPattern(HexPattern.FromAnglesSig("wwaqqqqqeaqeaeqqqeaeq", HexDir.EAST),
|
||||
prefix("craft/trinket"),
|
||||
new OpMakePackagedSpell<>(ItemTrinket.class, 500_000));
|
||||
PatternRegistry.mapPattern(
|
||||
HexPattern.FromAnglesSig("wwaqqqqqeawqwqwqwqwqwwqqeadaeqqeqqeadaeqq", HexDir.EAST),
|
||||
prefix("craft/artifact"),
|
||||
new OpMakePackagedSpell<>(ItemArtifact.class, 1_000_000));
|
||||
|
||||
PatternRegistry.mapPattern(HexPattern.FromAnglesSig("qqqqqaqwawaw", HexDir.NORTH_WEST),
|
||||
prefix("potion/weakness"),
|
||||
new OpPotionEffect(MobEffects.WEAKNESS, 10_000 / 10, true));
|
||||
|
@ -153,9 +160,6 @@ public class RegisterPatterns {
|
|||
PatternRegistry.mapPattern(HexPattern.FromAnglesSig("waeawae", HexDir.EAST),
|
||||
prefix("sentinel/create"),
|
||||
new OpCreateSentinel(false));
|
||||
PatternRegistry.mapPattern(HexPattern.FromAnglesSig("waeawaeqqqwqwqqwq", HexDir.EAST),
|
||||
prefix("sentinel/create/great"),
|
||||
new OpCreateSentinel(true), true);
|
||||
PatternRegistry.mapPattern(HexPattern.FromAnglesSig("qdwdqdw", HexDir.NORTH_EAST),
|
||||
prefix("sentinel/destroy"),
|
||||
OpDestroySentinel.INSTANCE);
|
||||
|
@ -165,9 +169,6 @@ public class RegisterPatterns {
|
|||
PatternRegistry.mapPattern(HexPattern.FromAnglesSig("waeawaedwa", HexDir.EAST),
|
||||
prefix("sentinel/wayfind"),
|
||||
OpGetSentinelWayfind.INSTANCE);
|
||||
PatternRegistry.mapPattern(HexPattern.FromAnglesSig("waeawaeqqqwqwqqwq", HexDir.EAST),
|
||||
prefix("sentinel/colorize"),
|
||||
OpColorizeSentinel.INSTANCE);
|
||||
|
||||
|
||||
PatternRegistry.mapPattern(HexPattern.FromAnglesSig("waadwawdaaweewq", HexDir.EAST),
|
||||
|
@ -179,6 +180,10 @@ public class RegisterPatterns {
|
|||
PatternRegistry.mapPattern(
|
||||
HexPattern.FromAnglesSig("wwwqqqwwwqqeqqwwwqqwqqdqqqqqdqq", HexDir.EAST),
|
||||
prefix("teleport"), OpTeleport.INSTANCE, true);
|
||||
PatternRegistry.mapPattern(HexPattern.FromAnglesSig("waeawaeqqqwqwqqwq", HexDir.EAST),
|
||||
prefix("sentinel/create/great"),
|
||||
new OpCreateSentinel(true), true);
|
||||
|
||||
|
||||
// == Meta stuff ==
|
||||
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
package at.petrak.hexcasting.common.casting.colors;
|
||||
|
||||
import at.petrak.hexcasting.common.ContributorList;
|
||||
import at.petrak.hexcasting.common.items.HexItems;
|
||||
import at.petrak.hexcasting.common.items.colorizer.ItemDyeColorizer;
|
||||
import at.petrak.hexcasting.common.items.colorizer.ItemPoliticalColorizer;
|
||||
import at.petrak.hexcasting.common.lib.HexCapabilities;
|
||||
import net.minecraft.client.player.LocalPlayer;
|
||||
import net.minecraft.core.Direction;
|
||||
|
@ -9,6 +11,7 @@ import net.minecraft.nbt.CompoundTag;
|
|||
import net.minecraft.util.FastColor;
|
||||
import net.minecraft.util.Mth;
|
||||
import net.minecraft.world.item.DyeColor;
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.phys.Vec3;
|
||||
import net.minecraftforge.common.capabilities.Capability;
|
||||
|
@ -30,6 +33,12 @@ public class CapPreferredColorizer implements ICapabilitySerializable<CompoundTa
|
|||
this.colorizer = colorizer;
|
||||
}
|
||||
|
||||
public static boolean isColorizer(Item item) {
|
||||
return item instanceof ItemDyeColorizer
|
||||
|| item instanceof ItemPoliticalColorizer
|
||||
|| item == HexItems.UUID_COLORIZER.get();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param time absolute world time in ticks
|
||||
* @param position a position for the icosahedron, a randomish number for particles.
|
||||
|
@ -38,9 +47,22 @@ public class CapPreferredColorizer implements ICapabilitySerializable<CompoundTa
|
|||
public int getColor(LocalPlayer asker, float time, Vec3 position) {
|
||||
var proto = this.colorizer.getItem();
|
||||
if (proto instanceof ItemDyeColorizer dye) {
|
||||
return DyeColor.values()[dye.getDyeIdx()].getTextColor();
|
||||
return DyeColor.values()[dye.getDyeIdx()].getTextColor() | 0xff_000000;
|
||||
} else if (proto instanceof ItemPoliticalColorizer politics) {
|
||||
var colors = politics.getColors();
|
||||
return morphBetweenColors(colors, new Vec3(0.1, 0.1, 0.1), time / 20 / 20, position);
|
||||
} else if (proto == HexItems.UUID_COLORIZER.get()) {
|
||||
|
||||
var playerName = asker.getName().getContents();
|
||||
var info = ContributorList.getContributor(playerName);
|
||||
if (info != null) {
|
||||
return morphBetweenColors(info.getColorizer(), new Vec3(0.1, 0.1, 0.1), time / 20 / 20, position);
|
||||
} else {
|
||||
var uuid = asker.getUUID();
|
||||
return FastColor.ARGB32.color(255,
|
||||
(int) (uuid.getLeastSignificantBits() & 0xff),
|
||||
(int) (uuid.getLeastSignificantBits() >>> 32 & 0xff),
|
||||
(int) (uuid.getMostSignificantBits() & 0xff));
|
||||
}
|
||||
}
|
||||
|
||||
return 0xff_ff00dc; // missing color
|
||||
|
|
|
@ -1,4 +1,41 @@
|
|||
package at.petrak.hexcasting.common.casting.operators.spells
|
||||
|
||||
object OpColorize {
|
||||
import at.petrak.hexcasting.api.RenderedSpell
|
||||
import at.petrak.hexcasting.api.SpellDatum
|
||||
import at.petrak.hexcasting.api.SpellOperator
|
||||
import at.petrak.hexcasting.common.casting.CastingContext
|
||||
import at.petrak.hexcasting.common.casting.colors.CapPreferredColorizer
|
||||
import at.petrak.hexcasting.common.lib.HexCapabilities
|
||||
import at.petrak.hexcasting.common.network.HexMessages
|
||||
import at.petrak.hexcasting.common.network.MsgColorizerUpdateAck
|
||||
import net.minecraft.world.item.ItemStack
|
||||
import net.minecraftforge.network.PacketDistributor
|
||||
|
||||
object OpColorize : SpellOperator {
|
||||
override val argc = 0
|
||||
|
||||
override fun execute(args: List<SpellDatum<*>>, ctx: CastingContext): Pair<RenderedSpell, Int> {
|
||||
return Pair(
|
||||
Spell,
|
||||
10_000
|
||||
)
|
||||
}
|
||||
|
||||
private object Spell : RenderedSpell {
|
||||
override fun cast(ctx: CastingContext) {
|
||||
val maybeCap = ctx.caster.getCapability(HexCapabilities.PREFERRED_COLORIZER).resolve()
|
||||
if (!maybeCap.isPresent)
|
||||
return
|
||||
val cap = maybeCap.get()
|
||||
|
||||
val otherHandItem = ctx.caster.getItemInHand(ctx.otherHand)
|
||||
if (CapPreferredColorizer.isColorizer(otherHandItem.item)) {
|
||||
val copied = ItemStack(otherHandItem.item, 1)
|
||||
otherHandItem.shrink(1)
|
||||
cap.colorizer = copied
|
||||
|
||||
HexMessages.getNetwork().send(PacketDistributor.PLAYER.with { ctx.caster }, MsgColorizerUpdateAck(cap))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,41 +0,0 @@
|
|||
package at.petrak.hexcasting.common.casting.operators.spells.sentinel
|
||||
|
||||
import at.petrak.hexcasting.api.RenderedSpell
|
||||
import at.petrak.hexcasting.api.SpellDatum
|
||||
import at.petrak.hexcasting.api.SpellOperator
|
||||
import at.petrak.hexcasting.common.casting.CastingContext
|
||||
import at.petrak.hexcasting.common.lib.HexCapabilities
|
||||
import at.petrak.hexcasting.common.network.HexMessages
|
||||
import at.petrak.hexcasting.common.network.MsgSentinelStatusUpdateAck
|
||||
import net.minecraft.world.item.DyeColor
|
||||
import net.minecraftforge.network.PacketDistributor
|
||||
|
||||
object OpColorizeSentinel : SpellOperator {
|
||||
override val argc = 0
|
||||
override fun execute(args: List<SpellDatum<*>>, ctx: CastingContext): Pair<RenderedSpell, Int> {
|
||||
return Pair(
|
||||
Spell,
|
||||
10_000
|
||||
)
|
||||
}
|
||||
|
||||
private object Spell : RenderedSpell {
|
||||
override fun cast(ctx: CastingContext) {
|
||||
val maybeCap = ctx.caster.getCapability(HexCapabilities.SENTINEL).resolve()
|
||||
if (!maybeCap.isPresent)
|
||||
return
|
||||
|
||||
val cap = maybeCap.get()
|
||||
|
||||
val otherHandItem = ctx.caster.getItemInHand(ctx.otherHand)
|
||||
val color = DyeColor.getColor(otherHandItem)
|
||||
if (color != null) {
|
||||
otherHandItem.shrink(1)
|
||||
cap.color = color.textColor or 0xff_000000u.toInt()
|
||||
|
||||
HexMessages.getNetwork()
|
||||
.send(PacketDistributor.PLAYER.with { ctx.caster }, MsgSentinelStatusUpdateAck(cap))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -2,6 +2,7 @@ package at.petrak.hexcasting.common.items;
|
|||
|
||||
import at.petrak.hexcasting.HexMod;
|
||||
import at.petrak.hexcasting.common.items.colorizer.ItemDyeColorizer;
|
||||
import at.petrak.hexcasting.common.items.colorizer.ItemPoliticalColorizer;
|
||||
import at.petrak.hexcasting.common.items.magic.ItemArtifact;
|
||||
import at.petrak.hexcasting.common.items.magic.ItemCypher;
|
||||
import at.petrak.hexcasting.common.items.magic.ItemTrinket;
|
||||
|
@ -55,16 +56,22 @@ public class HexItems {
|
|||
() -> new ItemScroll(unstackable()));
|
||||
|
||||
public static final RegistryObject<Item>[] DYE_COLORIZERS = new RegistryObject[16];
|
||||
public static final RegistryObject<Item>[] POLITICAL_COLORIZERS = new RegistryObject[14];
|
||||
public static final RegistryObject<Item> UUID_COLORIZER = ITEMS.register(HexItemNames.UUID_COLORIZER,
|
||||
() -> new Item(unstackable()));
|
||||
|
||||
static {
|
||||
for (int i = 0; i < 16; i++) {
|
||||
for (int i = 0; i < DYE_COLORIZERS.length; i++) {
|
||||
var dye = DyeColor.values()[i];
|
||||
final var finalI = i;
|
||||
DYE_COLORIZERS[i] = ITEMS.register(HexItemNames.DYE_COLORIZER_STUB + dye.getName(),
|
||||
() -> new ItemDyeColorizer(finalI, unstackable()));
|
||||
}
|
||||
for (int i = 0; i < POLITICAL_COLORIZERS.length; i++) {
|
||||
final var finalI = i;
|
||||
POLITICAL_COLORIZERS[i] = ITEMS.register(HexItemNames.POLITICAL_COLORIZER_STUB + i,
|
||||
() -> new ItemPoliticalColorizer(finalI, unstackable()));
|
||||
}
|
||||
}
|
||||
|
||||
public static Item.Properties props() {
|
||||
|
|
|
@ -0,0 +1,42 @@
|
|||
package at.petrak.hexcasting.common.items.colorizer;
|
||||
|
||||
import net.minecraft.world.item.Item;
|
||||
|
||||
public class ItemPoliticalColorizer extends Item {
|
||||
private int idx;
|
||||
|
||||
public ItemPoliticalColorizer(int idx, Properties pProperties) {
|
||||
super(pProperties);
|
||||
this.idx = idx;
|
||||
}
|
||||
|
||||
public int[] getColors() {
|
||||
return COLORS[this.idx];
|
||||
}
|
||||
|
||||
private static final int[][] COLORS;
|
||||
|
||||
static {
|
||||
COLORS = new int[][]{
|
||||
{0xeb92ea, 0xffffff, 0x6ac2e4},
|
||||
{0xd82f3a, 0xe0883f, 0xebf367, 0x2db418, 0x2f4dd8},
|
||||
{0x16a10c, 0x82eb8b, 0xffffff, 0x7a8081},
|
||||
{0x333233, 0x9a9fa1, 0xffffff, 0x7210bc},
|
||||
{0xdb45ff, 0x9c2bd0, 0x6894d4},
|
||||
{0xe278ef, 0xebf367, 0x6ac2e4},
|
||||
{0xca78ef, 0xffffff, 0x2db418},
|
||||
{0x9a9fa1, 0xfcb1ff, 0xffffff},
|
||||
{0xebf367, 0xffffff, 0x7210bc, 0x333233},
|
||||
{0xd82f3a, 0xefb87d, 0xffffff, 0xfbacf9},
|
||||
{0x9a9fa1, 0xa9ffff, 0xffffff},
|
||||
{0xfbacf9, 0xffffff, 0x9c2bd0, 0x333233, 0x2f4dd8},
|
||||
{0xebf367, 0x7210bc}, // how to do an intersex gradient escapes me
|
||||
{0x7210bc, 0xebf367, 0xffffff, 0x82dceb, 0x2f4dd8}
|
||||
};
|
||||
for (int[] color : COLORS) {
|
||||
for (int i = 0; i < color.length; i++) {
|
||||
color[i] |= 0xff_000000;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -13,5 +13,6 @@ public class HexItemNames {
|
|||
public static final String LENS = "lens";
|
||||
public static final String SCROLL = "scroll";
|
||||
public static final String DYE_COLORIZER_STUB = "dye_colorizer_";
|
||||
public static final String POLITICAL_COLORIZER_STUB = "political_colorizer_";
|
||||
public static final String UUID_COLORIZER = "uuid_colorizer";
|
||||
}
|
||||
|
|
|
@ -35,5 +35,7 @@ public class HexMessages {
|
|||
MsgBlinkAck::deserialize, MsgBlinkAck::handle);
|
||||
NETWORK.registerMessage(messageIdx++, MsgSentinelStatusUpdateAck.class, MsgSentinelStatusUpdateAck::serialize,
|
||||
MsgSentinelStatusUpdateAck::deserialize, MsgSentinelStatusUpdateAck::handle);
|
||||
NETWORK.registerMessage(messageIdx++, MsgColorizerUpdateAck.class, MsgColorizerUpdateAck::serialize,
|
||||
MsgColorizerUpdateAck::deserialize, MsgColorizerUpdateAck::handle);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,49 @@
|
|||
package at.petrak.hexcasting.common.network;
|
||||
|
||||
import at.petrak.hexcasting.common.casting.colors.CapPreferredColorizer;
|
||||
import at.petrak.hexcasting.common.lib.HexCapabilities;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.network.FriendlyByteBuf;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.Items;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.fml.DistExecutor;
|
||||
import net.minecraftforge.network.NetworkEvent;
|
||||
|
||||
import java.util.function.Supplier;
|
||||
|
||||
/**
|
||||
* Sent server->client to synchronize the status of the sentinel.
|
||||
*/
|
||||
public record MsgColorizerUpdateAck(CapPreferredColorizer update) {
|
||||
public static MsgColorizerUpdateAck deserialize(ByteBuf buffer) {
|
||||
var buf = new FriendlyByteBuf(buffer);
|
||||
|
||||
var tag = buf.readAnySizeNbt();
|
||||
var sentinel = new CapPreferredColorizer(new ItemStack(Items.AIR));
|
||||
sentinel.deserializeNBT(tag);
|
||||
return new MsgColorizerUpdateAck(sentinel);
|
||||
}
|
||||
|
||||
public void serialize(ByteBuf buffer) {
|
||||
var buf = new FriendlyByteBuf(buffer);
|
||||
buf.writeNbt(this.update.serializeNBT());
|
||||
}
|
||||
|
||||
public void handle(Supplier<NetworkEvent.Context> ctx) {
|
||||
ctx.get().enqueueWork(() ->
|
||||
DistExecutor.unsafeRunWhenOn(Dist.CLIENT, () -> () -> {
|
||||
var player = Minecraft.getInstance().player;
|
||||
var maybeCap = player.getCapability(HexCapabilities.PREFERRED_COLORIZER).resolve();
|
||||
if (!maybeCap.isPresent()) {
|
||||
return;
|
||||
}
|
||||
|
||||
var cap = maybeCap.get();
|
||||
cap.colorizer = update().colorizer;
|
||||
})
|
||||
);
|
||||
ctx.get().setPacketHandled(true);
|
||||
}
|
||||
}
|
|
@ -20,7 +20,7 @@ public record MsgSentinelStatusUpdateAck(CapSentinel update) {
|
|||
var buf = new FriendlyByteBuf(buffer);
|
||||
|
||||
var tag = buf.readAnySizeNbt();
|
||||
var sentinel = new CapSentinel(false, false, Vec3.ZERO, 0);
|
||||
var sentinel = new CapSentinel(false, false, Vec3.ZERO);
|
||||
sentinel.deserializeNBT(tag);
|
||||
return new MsgSentinelStatusUpdateAck(sentinel);
|
||||
}
|
||||
|
@ -43,7 +43,6 @@ public record MsgSentinelStatusUpdateAck(CapSentinel update) {
|
|||
cap.hasSentinel = update().hasSentinel;
|
||||
cap.extendsRange = update().hasSentinel;
|
||||
cap.position = update().position;
|
||||
cap.color = update().color;
|
||||
})
|
||||
);
|
||||
ctx.get().setPacketHandled(true);
|
||||
|
|
|
@ -69,6 +69,15 @@ public class ItemModels extends ItemModelProvider {
|
|||
.model(new ModelFile.UncheckedModelFile(modLoc("item/" + p.getSecond() + "_filled")))
|
||||
.end();
|
||||
}
|
||||
|
||||
for (int i = 0; i < 16; i++) {
|
||||
singleTexture(HexItems.DYE_COLORIZERS[i].getId().getPath(), new ResourceLocation("item/generated"),
|
||||
"layer0", new ResourceLocation(HexMod.MOD_ID, "item/colorizer/dye" + i));
|
||||
}
|
||||
for (int i = 0; i < 14; i++) {
|
||||
singleTexture(HexItems.DYE_COLORIZERS[i].getId().getPath(), new ResourceLocation("item/generated"),
|
||||
"layer0", new ResourceLocation(HexMod.MOD_ID, "item/colorizer/political" + i));
|
||||
}
|
||||
}
|
||||
|
||||
public void simpleItem(Item item) {
|
||||
|
|
|
@ -12,7 +12,38 @@
|
|||
"item.hexcasting.scroll.of": "Scroll of %s",
|
||||
"item.hexcasting.scroll.empty": "Empty Scroll",
|
||||
"item.hexcasting.sub_sandwich": "Submarine Sandwich",
|
||||
"itemGroup.hexcasting": "hexcasting",
|
||||
"item.hexcasting.dye_colorizer_white": "White Pigment",
|
||||
"item.hexcasting.dye_colorizer_orange": "Orange Pigment",
|
||||
"item.hexcasting.dye_colorizer_magenta": "Magenta Pigment",
|
||||
"item.hexcasting.dye_colorizer_light_blue": "Light Blue Pigment",
|
||||
"item.hexcasting.dye_colorizer_yellow": "Yellow Pigment",
|
||||
"item.hexcasting.dye_colorizer_lime": "Lime Pigment",
|
||||
"item.hexcasting.dye_colorizer_pink": "Pink Pigment",
|
||||
"item.hexcasting.dye_colorizer_gray": "Gray Pigment",
|
||||
"item.hexcasting.dye_colorizer_light_gray": "Light Gray Pigment",
|
||||
"item.hexcasting.dye_colorizer_cyan": "Cyan Pigment",
|
||||
"item.hexcasting.dye_colorizer_purple": "Purple Pigment",
|
||||
"item.hexcasting.dye_colorizer_blue": "Blue Pigment",
|
||||
"item.hexcasting.dye_colorizer_brown": "Brown Pigment",
|
||||
"item.hexcasting.dye_colorizer_green": "Green Pigment",
|
||||
"item.hexcasting.dye_colorizer_red": "Red Pigment",
|
||||
"item.hexcasting.dye_colorizer_black": "Black Pigment",
|
||||
"item.hexcasting.political_colorizer_0": "Trans Pigment",
|
||||
"item.hexcasting.political_colorizer_1": "Gay Pigment",
|
||||
"item.hexcasting.political_colorizer_2": "Agender Pigment",
|
||||
"item.hexcasting.political_colorizer_3": "Asexual Pigment",
|
||||
"item.hexcasting.political_colorizer_4": "Bisexual Pigment",
|
||||
"item.hexcasting.political_colorizer_5": "Pansexual Pigment",
|
||||
"item.hexcasting.political_colorizer_6": "Genderqueer Pigment",
|
||||
"item.hexcasting.political_colorizer_7": "Demigirl Pigment",
|
||||
"item.hexcasting.political_colorizer_8": "Non-binary Pigment",
|
||||
"item.hexcasting.political_colorizer_9": "Lesbian Pigment",
|
||||
"item.hexcasting.political_colorizer_10": "Demiboy Pigment",
|
||||
"item.hexcasting.political_colorizer_11": "Genderfluid Pigment",
|
||||
"item.hexcasting.political_colorizer_12": "Intersex Pigment",
|
||||
"item.hexcasting.political_colorizer_13": "Aroace Pigment",
|
||||
"item.hexcasting.uuid_colorizer": "Soulglimmer Pigment",
|
||||
"itemGroup.hexcasting": "Hexcasting",
|
||||
|
||||
"hexcasting.spellbook.tooltip.page": "Selected Page %d/%d",
|
||||
"hexcasting.spelldata.desc.entity": "Entity %s",
|
||||
|
@ -90,12 +121,11 @@
|
|||
"hexcasting.spell.hexcasting:recharge": "Recharge Item",
|
||||
"hexcasting.spell.hexcasting:create_water": "Create Water",
|
||||
"hexcasting.spell.hexcasting:destroy_water": "Destroy Water",
|
||||
"hexcasting.spell.hexcasting:colorize": "Internalize Pigment",
|
||||
"hexcasting.spell.hexcasting:sentinel/create": "Summon Sentinel",
|
||||
"hexcasting.spell.hexcasting:sentinel/create/great": "Summon Greater Sentinel",
|
||||
"hexcasting.spell.hexcasting:sentinel/destroy": "Banish Sentinel",
|
||||
"hexcasting.spell.hexcasting:sentinel/get_pos": "Locate Sentinel",
|
||||
"hexcasting.spell.hexcasting:sentinel/wayfind": "Wayfind Sentinel",
|
||||
"hexcasting.spell.hexcasting:sentinel/colorize": "Colorize Sentinel",
|
||||
"hexcasting.spell.hexcasting:potion/weakness": "White Sun's Nadir",
|
||||
"hexcasting.spell.hexcasting:potion/levitation": "Blue Sun's Nadir",
|
||||
"hexcasting.spell.hexcasting:potion/wither": "Black Sun's Nadir",
|
||||
|
@ -110,6 +140,7 @@
|
|||
"hexcasting.spell.hexcasting:lightning": "Summon Lightning",
|
||||
"hexcasting.spell.hexcasting:create_lava": "Create Lava",
|
||||
"hexcasting.spell.hexcasting:teleport": "Greater Teleport",
|
||||
"hexcasting.spell.hexcasting:sentinel/create/great": "Summon Greater Sentinel",
|
||||
"hexcasting.spell.hexcasting:open_paren": "Introspection",
|
||||
"hexcasting.spell.hexcasting:close_paren": "Retrospection",
|
||||
"hexcasting.spell.hexcasting:escape": "Consideration",
|
||||
|
|
After Width: | Height: | Size: 428 B |
After Width: | Height: | Size: 424 B |
After Width: | Height: | Size: 425 B |
After Width: | Height: | Size: 435 B |
After Width: | Height: | Size: 432 B |
After Width: | Height: | Size: 418 B |
After Width: | Height: | Size: 422 B |
After Width: | Height: | Size: 419 B |
After Width: | Height: | Size: 429 B |
After Width: | Height: | Size: 424 B |
After Width: | Height: | Size: 441 B |
After Width: | Height: | Size: 430 B |
After Width: | Height: | Size: 432 B |
After Width: | Height: | Size: 421 B |
After Width: | Height: | Size: 426 B |
After Width: | Height: | Size: 433 B |
After Width: | Height: | Size: 457 B |
After Width: | Height: | Size: 496 B |
After Width: | Height: | Size: 468 B |
After Width: | Height: | Size: 471 B |
After Width: | Height: | Size: 452 B |
After Width: | Height: | Size: 482 B |
After Width: | Height: | Size: 466 B |
After Width: | Height: | Size: 484 B |
After Width: | Height: | Size: 490 B |
After Width: | Height: | Size: 475 B |
After Width: | Height: | Size: 483 B |
After Width: | Height: | Size: 471 B |
After Width: | Height: | Size: 473 B |
After Width: | Height: | Size: 484 B |
After Width: | Height: | Size: 277 B |
|
@ -0,0 +1,18 @@
|
|||
{
|
||||
"name": "Internalizing Pigment",
|
||||
"category": "hexcasting:patterns",
|
||||
"icon": "hexcasting:political_colorizer_1",
|
||||
"sortnum": 8,
|
||||
"advancement": "hexcasting:root",
|
||||
"read_by_default": true,
|
||||
"pages": [
|
||||
{
|
||||
"type": "hexcasting:pattern",
|
||||
"op_id": "hexcasting:colorize",
|
||||
"anchor": "hexcasting:colorize",
|
||||
"input": "",
|
||||
"output": "",
|
||||
"text": "I must be holding a $(item)Pigment/$ in my other hand to cast this spell. When I do, it will consume the dye and permanently change my internal pigment (at least, until I cast the spell again). Costs about 1 $(item)Amethyst Dust/$."
|
||||
}
|
||||
]
|
||||
}
|