This commit is contained in:
lcy0x1
2024-06-25 10:04:11 +08:00
parent 71cff815cd
commit f1028dcb31
85 changed files with 211 additions and 1383 deletions

View File

@@ -111,16 +111,6 @@ if (lljij.toBoolean()) {
}
dependencies {
//annotationProcessor "org.spongepowered:mixin:${mixin_version}:processor"
compileOnly "com.tterrag.registrate:Registrate:${registrate_version}"
if (rootMod.toBoolean()) {
//jarJar(group: 'com.tterrag.registrate', name: 'Registrate', version: "[MC1.20,MC1.21)")
}
}
// project specific
repositories {
flatDir {
dirs 'libs'
@@ -148,34 +138,7 @@ repositories {
}
dependencies {
// base dep
implementation "mezz.jei:jei-${jei_minecraft_version}:${jei_version}"
//implementation "top.theillusivec4.curios:curios-neoforge:${curios_version}"
implementation "com.tterrag.registrate:Registrate:${registrate_version}"
implementation "dev.xkmc:l2serial:${l2serial_ver}"
//runtimeOnly fg.deobf("dev.xkmc.l2damagetracker:l2damagetracker:0.2.4")
//runtimeOnly fg.deobf("dev.xkmc.l2backpack:l2backpack:2.4.12-slim")
//runtimeOnly fg.deobf("dev.xkmc.l2complements:l2complements:2.4.18-slim")
//runtimeOnly fg.deobf('dev.xkmc.modulargolems:modulargolems:2.4.16-slim')
//runtimeOnly fg.deobf("dev.xkmc.l2archery:l2archery:2.4.9")
//runtimeOnly fg.deobf("dev.xkmc.l2weaponry:l2weaponry:2.4.18")
//runtimeOnly fg.deobf("dev.xkmc.l2artifacts:l2artifacts:2.4.8-slim")
//runtimeOnly fg.deobf("curse.maven:create-328085:4626108")
//implementation fg.deobf("curse.maven:just-enough-effect-descriptions-jeed-532286:4599236")
//runtimeOnly fg.deobf("curse.maven:badpackets-615134:4438956")
//runtimeOnly fg.deobf("curse.maven:wthit-forge-455982:4596739")
//runtimeOnly fg.deobf("curse.maven:attributefix-280510:4588114")
//runtimeOnly fg.deobf("curse.maven:bookshelf-228525:4581675")
//runtimeOnly fg.deobf("curse.maven:enchantment-descriptions-250419:4587429")
//runtimeOnly fg.deobf("curse.maven:appleskin-248787:4605078")
//implementation fg.deobf("curse.maven:patchouli-306770:4636277")
//runtimeOnly fg.deobf("dev.xkmc.traderefresh:traderefresh:2.1.1-slim")
//runtimeOnly fg.deobf("dev.xkmc.lasertransport:lasertransport:2.2.0.pre5-slim")
//runtimeOnly fg.deobf('curse.maven:max-health-fix-492246:4447240')
//runtimeOnly fg.deobf('curse.maven:the-twilight-forest-227639:4516391')
}

View File

@@ -18,7 +18,7 @@ loader_version_range=[2,)
mod_id=l2core
mod_name=L2Core
mod_license=LGPL-2.1
mod_version=3.0.0-pre0
mod_version=3.0.0
mod_group_id=dev.xkmc
mod_authors=lcy0x1
mod_description=Core Library mod for all L2 mods

Binary file not shown.

View File

@@ -1,6 +0,0 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

View File

@@ -1,31 +0,0 @@
package dev.xkmc.l2core.events;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonElement;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.server.packs.resources.ResourceManager;
import net.minecraft.server.packs.resources.SimpleJsonResourceReloadListener;
import net.minecraft.util.profiling.ProfilerFiller;
import javax.annotation.ParametersAreNonnullByDefault;
import java.util.Map;
import java.util.function.Consumer;
@ParametersAreNonnullByDefault
public class BaseJsonReloadListener extends SimpleJsonResourceReloadListener {
private static final Gson GSON = new GsonBuilder().setPrettyPrinting().disableHtmlEscaping().create();
private final Consumer<Map<ResourceLocation, JsonElement>> consumer;
public BaseJsonReloadListener(String path, Consumer<Map<ResourceLocation, JsonElement>> consumer) {
super(GSON, path);
this.consumer = consumer;
}
@Override
protected void apply(Map<ResourceLocation, JsonElement> map, ResourceManager manager, ProfilerFiller profiler) {
consumer.accept(map);
}
}

View File

@@ -2,10 +2,9 @@ package dev.xkmc.l2core.events;
import dev.xkmc.l2core.base.effects.EffectToClient;
import dev.xkmc.l2core.init.L2Core;
import dev.xkmc.l2core.init.L2TagGen;
import net.minecraft.core.Holder;
import net.minecraft.core.registries.Registries;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.tags.TagKey;
import net.minecraft.world.effect.MobEffect;
import net.minecraft.world.entity.LivingEntity;
import net.neoforged.bus.api.SubscribeEvent;
@@ -16,20 +15,19 @@ import net.neoforged.neoforge.event.entity.player.PlayerEvent;
@EventBusSubscriber(modid = L2Core.MODID, bus = EventBusSubscriber.Bus.GAME)
public class EffectSyncEvents {
public static final TagKey<MobEffect> SYNCED = TagKey.create(Registries.MOB_EFFECT, L2Core.loc("synced"));
private static boolean isTracked(Holder<MobEffect> eff) {
return eff.is(SYNCED);
return eff.is(L2TagGen.TRACKED_EFFECTS);
}
@SubscribeEvent
public static void onPotionAddedEvent(MobEffectEvent.Added event) {
if (isTracked(event.getEffectInstance().getEffect())) {
var ins = event.getEffectInstance();
if (ins == null) return;
if (isTracked(ins.getEffect())) {
onEffectAppear(event.getEffectInstance().getEffect(), event.getEntity(), event.getEffectInstance().getAmplifier());
}
}
@SubscribeEvent
public static void onPotionRemoveEvent(MobEffectEvent.Remove event) {
if (event.getEffectInstance() != null && isTracked(event.getEffectInstance().getEffect())) {
@@ -37,7 +35,6 @@ public class EffectSyncEvents {
}
}
@SubscribeEvent
public static void onPotionExpiryEvent(MobEffectEvent.Expired event) {
if (event.getEffectInstance() != null && isTracked(event.getEffectInstance().getEffect())) {

View File

@@ -3,6 +3,7 @@ package dev.xkmc.l2core.init;
import dev.xkmc.l2core.base.effects.EffectToClient;
import dev.xkmc.l2core.capability.conditionals.TokenToClient;
import dev.xkmc.l2core.capability.player.PlayerCapToClient;
import dev.xkmc.l2core.init.reg.registrate.L2Registrate;
import dev.xkmc.l2serial.network.PacketHandler;
import dev.xkmc.l2serial.serialization.custom_handler.Handlers;
import net.minecraft.resources.ResourceLocation;
@@ -24,7 +25,7 @@ public class L2Core {
public static final String MODID = "l2core";
public static final Logger LOGGER = LogManager.getLogger();
// TODO public static final L2Registrate REGISTRATE = new L2Registrate(MODID);
public static final L2Registrate REGISTRATE = new L2Registrate(MODID);
public static final PacketHandler PACKET_HANDLER = new PacketHandler(MODID, 1,
e -> e.create(EffectToClient.class, PLAY_TO_CLIENT),
@@ -36,6 +37,7 @@ public class L2Core {
Handlers.register();
L2LibReg.register(bus);
REGISTRATE.addDataGenerator(L2TagGen.EFF_TAGS, L2TagGen::onEffectTagGen);
}
@SubscribeEvent

View File

@@ -0,0 +1,32 @@
package dev.xkmc.l2core.init;
import com.tterrag.registrate.providers.ProviderType;
import com.tterrag.registrate.providers.RegistrateTagsProvider;
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.core.registries.Registries;
import net.minecraft.resources.ResourceKey;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.tags.TagKey;
import net.minecraft.world.effect.MobEffect;
public class L2TagGen {
public static final ProviderType<RegistrateTagsProvider.IntrinsicImpl<MobEffect>> EFF_TAGS =
ProviderType.register("tags/mob_effect",
type -> (p, e) -> new RegistrateTagsProvider.IntrinsicImpl<>(p, type, "mob_effects",
e.getGenerator().getPackOutput(), Registries.MOB_EFFECT, e.getLookupProvider(),
ench -> ResourceKey.create(Registries.MOB_EFFECT, BuiltInRegistries.MOB_EFFECT.getKey(ench)),
e.getExistingFileHelper()));
public static final TagKey<MobEffect> TRACKED_EFFECTS = effectTag(ResourceLocation.fromNamespaceAndPath(L2Core.MODID, "tracked_effects"));
public static void onEffectTagGen(RegistrateTagsProvider.IntrinsicImpl<MobEffect> pvd) {
pvd.addTag(TRACKED_EFFECTS);
}
public static TagKey<MobEffect> effectTag(ResourceLocation id) {
return TagKey.create(Registries.MOB_EFFECT, id);
}
}

View File

@@ -0,0 +1,17 @@
package dev.xkmc.l2core.init.reg.registrate;
import com.tterrag.registrate.util.entry.RegistryEntry;
import net.minecraft.resources.ResourceKey;
import net.minecraft.world.effect.MobEffect;
public record EffectEntry<T extends MobEffect>(RegistryEntry<MobEffect, T> val) {
ResourceKey<MobEffect> key() {
return val.getKey();
}
T get() {
return val.get();
}
}

View File

@@ -1,92 +1,151 @@
package dev.xkmc.l2core.init.reg.registrate;
import com.tterrag.registrate.AbstractRegistrate;
import com.tterrag.registrate.builders.AbstractBuilder;
import com.tterrag.registrate.builders.BuilderCallback;
import com.tterrag.registrate.builders.NoConfigBuilder;
import com.tterrag.registrate.providers.RegistrateLangProvider;
import com.tterrag.registrate.util.OneTimeEventReceiver;
import com.tterrag.registrate.util.entry.RegistryEntry;
import com.tterrag.registrate.util.nullness.NonNullSupplier;
import com.tterrag.registrate.util.nullness.NonnullType;
import dev.xkmc.l2core.init.L2Core;
import dev.xkmc.l2serial.serialization.custom_handler.CodecHandler;
import dev.xkmc.l2serial.util.Wrappers;
import net.minecraft.core.Registry;
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.core.registries.Registries;
import net.minecraft.network.chat.Component;
import net.minecraft.network.codec.ByteBufCodecs;
import net.minecraft.resources.ResourceKey;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.effect.MobEffect;
import net.minecraft.world.item.CreativeModeTab;
import net.minecraft.world.item.CreativeModeTabs;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.Items;
import net.minecraft.world.item.alchemy.Potion;
import net.minecraft.world.item.crafting.Recipe;
import net.minecraft.world.item.crafting.RecipeType;
import net.neoforged.fml.ModLoadingContext;
import net.neoforged.neoforge.data.loading.DatagenModLoader;
import net.neoforged.neoforge.registries.NewRegistryEvent;
import net.neoforged.neoforge.registries.RegistryBuilder;
import org.jetbrains.annotations.NotNull;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.TreeMap;
import java.util.function.Consumer;
import java.util.function.Supplier;
@SuppressWarnings("unused")
public class L2Registrate extends AbstractRegistrate<L2Registrate> {
public final NonNullSupplier<Boolean> doDataGen = NonNullSupplier.lazy(DatagenModLoader::isRunningDataGen);
public L2Registrate(String modid) {
super(modid);
registerEventListeners(FMLJavaModLoadingContext.get().getModEventBus());
var bus = ModLoadingContext.get().getActiveContainer().getEventBus();
if (bus != null) registerEventListeners(bus);
else L2Core.LOGGER.error("Failed to register mod {}", modid);
}
public <T extends NamedEntry<T>, P extends T> GenericBuilder<T, P> generic(RegistryInstance<T> cls, String id, NonNullSupplier<P> sup) {
public ResourceLocation loc(String id) {
return ResourceLocation.fromNamespaceAndPath(getModid(), id);
}
public <T, P extends T> GenericBuilder<T, P> generic(RegistryInstance<T> cls, String id, NonNullSupplier<P> sup) {
return entry(id, cb -> new GenericBuilder<>(this, id, cb, cls.key(), sup));
}
public <T extends Recipe<?>> RegistryEntry<RecipeType<T>> recipe(String id) {
return simple(id, ForgeRegistries.Keys.RECIPE_TYPES, () -> new RecipeType<>() {
});
}
@Deprecated
@Override
public <T extends Enchantment> EnchantmentBuilder<T, L2Registrate> enchantment(String name, EnchantmentCategory type, EnchantmentBuilder.EnchantmentFactory<T> factory) {
return super.enchantment(name, type, factory);
}
public <T extends Enchantment> EnchantmentBuilder<T, L2Registrate> enchantment(String name, EnchantmentCategory type, EnchantmentBuilder.EnchantmentFactory<T> factory, String desc) {
addRawLang("enchantment." + getModid() + "." + name + ".desc", desc);
return super.enchantment(name, type, factory);
public <T extends Recipe<?>> RecipeTypeEntry<T> recipe(String id) {
return new RecipeTypeEntry<>(simple(id, Registries.RECIPE_TYPE, () -> new RecipeType<>() {
@Override
public String toString() {
return getModid() + ":" + id;
}
}));
}
public <T extends MobEffect> NoConfigBuilder<MobEffect, T, L2Registrate> effect(String name, NonNullSupplier<T> sup, String desc) {
addRawLang("effect." + getModid() + "." + name + ".description", desc);
return entry(name, cb -> new NoConfigBuilder<>(this, this, name, cb, ForgeRegistries.Keys.MOB_EFFECTS, sup));
addRawLang("effect." + getModid() + "." + name + ".desc", desc);
return entry(name, cb -> new NoConfigBuilder<>(this, this, name, cb, Registries.MOB_EFFECT, sup));
}
@SuppressWarnings({"unchecked", "unsafe"})
public <E extends NamedEntry<E>> RegistryInstance<E> newRegistry(String id, Class<?> cls, Consumer<RegistryBuilder<E>> cons) {
ResourceKey<Registry<E>> key = makeRegistry(id, () -> {
var ans = new RegistryBuilder<E>();
ans.onCreate((r, s) -> new RLClassHandler<>((Class<E>) cls, () -> r));
cons.accept(ans);
return ans;
});
return new RegistryInstance<>(Suppliers.memoize(() -> RegistryManager.ACTIVE.getRegistry(key)), key);
private <T extends Potion> SimpleEntry<Potion> genPotion(String name, NonNullSupplier<T> sup) {
RegistryEntry<Potion, T> ans = entry(name, (cb) -> new NoConfigBuilder<>(this, this, name, cb,
Registries.POTION, sup)).register();
if (doDataGen.get()) {
List<Item> list = List.of(Items.POTION, Items.SPLASH_POTION, Items.LINGERING_POTION, Items.TIPPED_ARROW);
for (Item item : list) {
String pref = item.getDescriptionId();
String[] prefs = pref.split("\\.");
String str = item.getDescriptionId() + ".effect." + name;
String pref_name = RegistrateLangProvider.toEnglishName(prefs[prefs.length - 1]);
if (item == Items.TIPPED_ARROW) pref_name = "Arrow";
addRawLang(str, pref_name + " of " + RegistrateLangProvider.toEnglishName(name));
}
}
return new SimpleEntry<>(ans);
}
public <E extends NamedEntry<E>> RegistryInstance<E> newRegistry(String id, Class<?> cls) {
@SuppressWarnings({"unsafe"})
public <E> RegistryInstance<E> newRegistry(String id, Class<?> cls, Consumer<RegistryBuilder<E>> cons) {
ResourceKey<Registry<E>> key = ResourceKey.createRegistryKey(ResourceLocation.fromNamespaceAndPath(getModid(), id));
var ans = new RegistryBuilder<>(key);
cons.accept(ans);
var reg = ans.create();
new CodecHandler<>(Wrappers.cast(cls), reg.byNameCodec(), ByteBufCodecs.fromCodecWithRegistries(reg.byNameCodec()));
OneTimeEventReceiver.addModListener(this, NewRegistryEvent.class, (e) -> e.register(reg));
return new RegistryInstance<>(reg, key);
}
public <E> RegistryInstance<E> newRegistry(String id, Class<?> cls) {
return newRegistry(id, cls, e -> {
});
}
public synchronized RegistryEntry<CreativeModeTab> buildModCreativeTab(String name, String def, Consumer<CreativeModeTab.Builder> config) {
ResourceLocation id = new ResourceLocation(getModid(), name);
public synchronized SimpleEntry<CreativeModeTab> buildModCreativeTab(String name, String def, Consumer<CreativeModeTab.Builder> config) {
ResourceLocation id = ResourceLocation.fromNamespaceAndPath(getModid(), name);
defaultCreativeTab(ResourceKey.create(Registries.CREATIVE_MODE_TAB, id));
return buildCreativeTabImpl(name, this.addLang("itemGroup", id, def), config);
return buildCreativeTabImpl(name, addLang("itemGroup", id, def), config);
}
public synchronized RegistryEntry<CreativeModeTab> buildL2CreativeTab(String name, String def, Consumer<CreativeModeTab.Builder> config) {
ResourceLocation id = new ResourceLocation(L2Library.MODID, name);
public synchronized SimpleEntry<CreativeModeTab> buildL2CreativeTab(String name, String def, Consumer<CreativeModeTab.Builder> config) {
ResourceLocation id = ResourceLocation.fromNamespaceAndPath(L2Core.MODID, name);
defaultCreativeTab(ResourceKey.create(Registries.CREATIVE_MODE_TAB, id));
TabSorter sorter = new TabSorter(getModid() + ":" + name, id);
return L2Library.REGISTRATE.buildCreativeTabImpl(name, this.addLang("itemGroup", id, def), b -> {
return L2Core.REGISTRATE.buildCreativeTabImpl(name, addLang("itemGroup", id, def), b -> {
config.accept(b);
sorter.sort(b);
});
}
private synchronized RegistryEntry<CreativeModeTab> buildCreativeTabImpl(String name, Component comp, Consumer<CreativeModeTab.Builder> config) {
return this.generic(self(), name, Registries.CREATIVE_MODE_TAB, () -> {
private synchronized SimpleEntry<CreativeModeTab> buildCreativeTabImpl(String name, Component comp, Consumer<CreativeModeTab.Builder> config) {
return new SimpleEntry<>(this.generic(self(), name, Registries.CREATIVE_MODE_TAB, () -> {
var builder = CreativeModeTab.builder().title(comp)
.withTabsBefore(CreativeModeTabs.SPAWN_EGGS);
config.accept(builder);
return builder.build();
}).register();
}).register());
}
public record RegistryInstance<E extends NamedEntry<E>>(Supplier<IForgeRegistry<E>> supplier,
ResourceKey<Registry<E>> key) implements Supplier<IForgeRegistry<E>> {
public record RegistryInstance<E>(
Registry<E> reg,
ResourceKey<Registry<E>> key
) implements Supplier<Registry<E>> {
@Override
public IForgeRegistry<E> get() {
return supplier().get();
public Registry<E> get() {
return reg;
}
}
public static class GenericBuilder<T extends NamedEntry<T>, P extends T> extends AbstractBuilder<T, P, L2Registrate, GenericBuilder<T, P>> {
public static class GenericBuilder<T, P extends T> extends AbstractBuilder<T, P, L2Registrate, GenericBuilder<T, P>> {
private final NonNullSupplier<P> sup;
@@ -101,7 +160,9 @@ public class L2Registrate extends AbstractRegistrate<L2Registrate> {
}
public GenericBuilder<T, P> defaultLang() {
return lang(NamedEntry::getDescriptionId, RegistrateLangProvider.toEnglishName(this.getName()));
var reg = getRegistryKey().location();
String id = reg.getPath() + "." + getOwner().getModid() + "." + getName();
return lang(e -> id, RegistrateLangProvider.toEnglishName(this.getName()));
}
}

View File

@@ -1,21 +1,26 @@
package dev.xkmc.l2core.init.reg.registrate;
/*TODO
import dev.xkmc.l2serial.util.Wrappers;
import net.minecraft.network.chat.Component;
import net.minecraft.network.chat.MutableComponent;
import net.minecraft.resources.ResourceLocation;
public class NamedEntry<T extends NamedEntry<T>> {
private final L2Registrate.RegistryInstance<T> registry;
private String desc = null;
private ResourceLocation id = null;
public NamedEntry(L2Registrate.RegistryInstance<T> registry) {
this.registry = registry;
}
public @NotNull String getDescriptionId() {
public String getDescriptionId() {
if (desc != null)
return desc;
ResourceLocation rl = getRegistryName();
ResourceLocation reg = registry.get().getRegistryName();
ResourceLocation reg = registry.key().location();
desc = reg.getPath() + "." + rl.getNamespace() + "." + rl.getPath();
return desc;
}
@@ -25,7 +30,12 @@ public class NamedEntry<T extends NamedEntry<T>> {
}
public ResourceLocation getRegistryName() {
return Objects.requireNonNull(registry.get().getKey(getThis()));
if (id != null) return id;
id = registry.get().getKey(getThis());
if (id == null) {
throw new IllegalStateException("Entry %s is not registered".formatted(getClass().getSimpleName()));
}
return id;
}
public String getID() {
@@ -37,4 +47,3 @@ public class NamedEntry<T extends NamedEntry<T>> {
}
}
*/

View File

@@ -0,0 +1,18 @@
package dev.xkmc.l2core.init.reg.registrate;
import com.tterrag.registrate.util.entry.RegistryEntry;
import net.minecraft.resources.ResourceKey;
import net.minecraft.world.item.crafting.Recipe;
import net.minecraft.world.item.crafting.RecipeType;
public record RecipeTypeEntry<T extends Recipe<?>>(RegistryEntry<RecipeType<?>, RecipeType<T>> val) {
ResourceKey<RecipeType<?>> key() {
return val.getKey();
}
RecipeType<T> get() {
return val.get();
}
}

View File

@@ -0,0 +1,16 @@
package dev.xkmc.l2core.init.reg.registrate;
import com.tterrag.registrate.util.entry.RegistryEntry;
import net.minecraft.resources.ResourceKey;
public record SimpleEntry<T>(RegistryEntry<T, ? extends T> val) {
ResourceKey<T> key() {
return val.getKey();
}
T get() {
return val.get();
}
}

View File

@@ -2,7 +2,6 @@ package dev.xkmc.l2core.serial.recipe;
import net.minecraft.advancements.Advancement;
import net.minecraft.advancements.AdvancementHolder;
import net.minecraft.core.component.DataComponentType;
import net.minecraft.data.recipes.RecipeOutput;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.ItemStack;
@@ -12,7 +11,7 @@ import net.minecraft.world.item.crafting.ShapelessRecipe;
import net.neoforged.neoforge.common.conditions.ICondition;
import org.jetbrains.annotations.Nullable;
public record NBTRecipeWrapper(RecipeOutput pvd, ItemStack stack) implements RecipeOutput {
public record DataRecipeWrapper(RecipeOutput pvd, ItemStack stack) implements RecipeOutput {
@Override
public Advancement.Builder advancement() {

View File

@@ -1,267 +0,0 @@
package organize;
import com.google.common.io.Files;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import com.google.gson.internal.Streams;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import javax.imageio.ImageIO;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class GUIGenerator {
public static void main(String[] args) throws Exception {
new GUIGenerator("l2library").gen();
}
private class Comp {
private final String name;
private final Item it;
private final int x, y, rx, ry;
private Comp(String str, JsonObject e) {
name = str;
it = ITEM_MAP.get(e.get("sprite").getAsString());
x = e.get("x").getAsInt();
y = e.get("y").getAsInt();
rx = getInt(e, "rx", 1);
ry = getInt(e, "ry", 1);
}
@Override
public String toString() {
return name;
}
private void draw(Graphics g, int cx, int cy) throws IOException {
for (int i = 0; i < rx; i++)
for (int j = 0; j < ry; j++)
g.drawImage(it.getImg(), cx + i * it.w, cy + j * it.h, null);
}
private int gety0() {
return y - it.h / 2;
}
private int gety1() {
return gety0() + ry * it.h;
}
}
private class Item {
private final String name, app;
private final int w, h, dx, dy;
private BufferedImage bimg;
private Item(String str, String appe, JsonObject e) {
ITEM_MAP.put(appe == null ? str : str + appe, this);
name = str;
app = appe;
w = e.get("w").getAsInt();
h = e.get("h").getAsInt();
dx = getInt(e, "dx", 0);
dy = getInt(e, "dy", 0);
}
@Override
public String toString() {
return app == null ? name : name + app;
}
private BufferedImage getImg() throws IOException {
if (bimg != null)
return bimg;
String path = GUI + "-templates/sprites/" + name;
if (app != null)
path += "/" + app;
path += ".png";
return bimg = ImageIO.read(new File(path));
}
}
private final String GUI, DST, CONT, CDST;
GUIGenerator(String modid) {
GUI = "./src/test/resources/" + modid + "/gui/";
DST = "./src/test/resources/" + modid + "/assets/textures/gui/";
CDST = "./src/test/resources/" + modid + "/data/" + modid + "/gui/";
CONT = GUI + "-templates/container/" + modid + "/";
}
private final Map<String, Item> ITEM_MAP = new HashMap<>();
void gen() throws IOException {
readSprites();
File f = new File(CONT);
Item top = ITEM_MAP.get("top");
Item middle = ITEM_MAP.get("middle");
for (File fi : f.listFiles()) {
JsonObject e = readJsonFile(fi.getPath()).getAsJsonObject();
JsonObject out = new JsonObject();
List<Item> side = new ArrayList<>();
List<Comp> comp = new ArrayList<>();
int height = 0;
if (e.has("height")) {
height = e.get("height").getAsInt();
}
Item bottom = ITEM_MAP.get(e.get("isContainer").getAsBoolean() ? "bottom" : "bottom_screen");
e.get("side").getAsJsonArray().forEach(s -> side.add(ITEM_MAP.get(s.getAsString())));
for (Map.Entry<String, JsonElement> ent : e.get("comp").getAsJsonObject().entrySet())
comp.add(new Comp(ent.getKey(), ent.getValue().getAsJsonObject()));
int y0 = 0, y1 = 0;
for (Comp c : comp) {
y0 = Math.min(y0, c.gety0());
y1 = Math.max(y1, c.gety1());
}
if (top.h + y1 - y0 + bottom.h < height) {
y1 = height - bottom.h - top.h + y0;
}
out.addProperty("height", top.h + y1 - y0 + bottom.h);
BufferedImage bimg = new BufferedImage(256, 256, BufferedImage.TYPE_INT_ARGB);
Graphics g = bimg.getGraphics();
g.drawImage(top.getImg(), 0, 0, null);
for (int i = 0; i < y1 - y0; i++)
g.drawImage(middle.getImg(), 0, top.h + i, null);
g.drawImage(bottom.getImg(), 0, top.h + y1 - y0, null);
JsonObject jarr = new JsonObject();
for (Comp c : comp) {
int cx = c.x - c.it.w / 2;
int cy = c.y - c.it.h / 2 - y0 + top.h;
c.draw(g, cx, cy);
JsonObject co = new JsonObject();
co.addProperty("x", cx + c.it.dx);
co.addProperty("y", cy + c.it.dy);
co.addProperty("w", c.it.w);
co.addProperty("h", c.it.h);
co.addProperty("rx", c.rx);
co.addProperty("ry", c.ry);
jarr.add(c.name, co);
}
out.add("comp", jarr);
int dx = 0, dy = 0;
Item pre = null;
JsonObject jside = new JsonObject();
for (Item s : side) {
JsonObject so = new JsonObject();
if (pre != null) {
if (pre.h == s.h && top.w + dx + pre.w + s.w < 256) {
dx += pre.w;
} else {
dx = 0;
dy += pre.h;
}
}
so.addProperty("x", top.w + dx);
so.addProperty("y", dy);
so.addProperty("w", s.w);
so.addProperty("h", s.h);
jside.add(s.toString(), so);
g.drawImage(s.getImg(), top.w + dx, dy, null);
pre = s;
}
out.add("side", jside);
g.dispose();
File fx = new File(DST + "container/" + fi.getName().split("\\.")[0] + ".png");
check(fx);
ImageIO.write(bimg, "PNG", fx);
write(DST + "coords/" + fi.getName(), out);
write(CDST + "coords/" + fi.getName(), out);
}
}
private int getInt(JsonObject e, String key, int def) {
return e.has(key) ? e.get(key).getAsInt() : def;
}
private void readSprites() throws IOException {
JsonElement e = readJsonFile(GUI + "-templates/info.json");
e.getAsJsonObject().entrySet().forEach(ent -> {
String name = ent.getKey();
JsonObject o = ent.getValue().getAsJsonObject();
if (o.has("ids"))
o.get("ids").getAsJsonArray().forEach(ele -> new Item(name, ele.getAsString(), o));
else
new Item(name, null, o);
});
}
private void write(String path, JsonObject obj) throws IOException {
File fy = new File(path);
check(fy);
JsonWriter jw = new JsonWriter(Files.newWriter(fy, Charset.defaultCharset()));
jw.setLenient(true);
jw.setIndent("\t");
Streams.write(obj, jw);
jw.close();
}
public static void check(File f) throws IOException {
if (!f.getParentFile().exists())
f.getParentFile().mkdirs();
if (!f.exists())
f.createNewFile();
}
private static void delete(File f) {
if (!f.exists())
return;
if (f.isDirectory())
for (File fi : f.listFiles())
delete(fi);
f.delete();
}
private static Map<String, List<String>> readJson(String path) throws IOException {
JsonElement e = readJsonFile(path);
Map<String, List<String>> ans = new HashMap<>();
e.getAsJsonObject().entrySet().forEach(ent0 -> ent0.getValue().getAsJsonObject().entrySet().forEach(ent1 -> {
String key = ent1.getKey();
List<String> list;
if (ans.containsKey(key))
list = ans.get(key);
else
ans.put(key, list = new ArrayList<>());
ent1.getValue().getAsJsonObject().entrySet().forEach(ent2 -> {
String group = ent2.getKey();
ent2.getValue().getAsJsonArray().forEach(ent3 -> {
String name = ent3.isJsonObject() ? ent3.toString() : ent3.getAsString();
if (name.startsWith("_") || name.startsWith("^"))
list.add(group + name);
else if (name.endsWith("_"))
list.add(name + group);
else
list.add(name);
});
});
}));
return ans;
}
private static JsonElement readJsonFile(String path) throws IOException {
File f = new File(path);
JsonReader r = new JsonReader(Files.newReader(f, Charset.defaultCharset()));
JsonElement e = new JsonParser().parse(r);
r.close();
return e;
}
}

View File

@@ -1,122 +0,0 @@
package organize;
import com.google.common.io.Files;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import organize.sub.AssetMisc;
import organize.sub.DataMisc;
import organize.sub.LangFileOrganizer;
import java.io.File;
import java.io.PrintStream;
import java.nio.charset.StandardCharsets;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
public abstract class ResourceOrganizer {
public static final Gson GSON = new GsonBuilder().setPrettyPrinting().setLenient().create();
public static final Map<String, ResourceOrganizer> MAP = new LinkedHashMap<>();
public static String MODID;
public final Type type;
public final String folder;
public final String target;
public ResourceOrganizer(Type type, String folder, String target) {
this.type = type;
this.folder = folder;
this.target = target;
MAP.put(folder, this);
}
public static void main(String[] args) throws Exception {
new LangFileOrganizer();
//new ItemFileOrganizer();
//new BlockFileOrganizer();
//new ArmorFileOrganizer();
//new RecipeFileOrganizer();
new AssetMisc();
new DataMisc();
//new ConfigFileOrganizer();
//new GeckoMisc();
File f = new File("./src/test/resources");
for (File fi : f.listFiles()) {
MODID = fi.getName();
if (!fi.isDirectory())
continue;
for (ResourceOrganizer obj : MAP.values()) {
File fo = new File(fi.getPath() + "/" + obj.folder);
if (!fo.exists())
continue;
obj.organize(fo);
}
}
}
public static void delete(File f) throws Exception {
if (f.exists()) {
if (f.isDirectory())
for (File fi : f.listFiles())
delete(fi);
f.delete();
}
}
public static void check(File f) throws Exception {
if (f.exists()) {
f.delete();
}
if (!f.getParentFile().exists())
f.getParentFile().mkdirs();
f.createNewFile();
}
public abstract void organize(File f) throws Exception;
public final String getTargetFolder() {
return getResourceFolder(true) + type + "/" + MODID + "/" + target;
}
public final String getResourceFolder(boolean main) {
return (main ? "./src/main/resources/" : "./src/test/resources/");
}
protected String readFile(String path) {
List<String> list = null;
try {
list = Files.readLines(new File(path), StandardCharsets.UTF_8);
} catch (Exception e) {
e.printStackTrace();
return "";
}
String str = "";
for (String s : list)
str += s + "\n";
return str.replaceAll("\\^m", MODID);
}
protected void write(String name, String cont) throws Exception {
File f = new File(name);
check(f);
PrintStream ps = new PrintStream(f, StandardCharsets.UTF_8);
ps.println(cont);
ps.close();
}
public enum Type {
ASSETS("assets"), DATA("data");
public final String side;
Type(String side) {
this.side = side;
}
public String toString() {
return side;
}
}
}

View File

@@ -1,22 +0,0 @@
package organize.sub;
import com.google.common.io.Files;
import organize.ResourceOrganizer;
import java.io.File;
public class ArmorFileOrganizer extends ResourceOrganizer {
public ArmorFileOrganizer() {
super(Type.ASSETS, "armor", "textures/models/armor/");
}
@Override
public void organize(File f) throws Exception {
for (File fi : f.listFiles()) {
File ti = new File(getResourceFolder(true) + "assets/minecraft/" + target + fi.getName());
check(ti);
Files.copy(fi, ti);
}
}
}

View File

@@ -1,38 +0,0 @@
package organize.sub;
import com.google.common.io.Files;
import organize.ResourceOrganizer;
import java.io.File;
public class AssetMisc extends ResourceOrganizer {
public AssetMisc() {
super(Type.ASSETS, "assets", "");
}
@Override
public void organize(File f) throws Exception {
for (File fi : f.listFiles())
process(fi, getTargetFolder(), "");
}
private void process(File f, String path, String pre) throws Exception {
if (f.getName().startsWith("."))
return;
if (f.isDirectory()) {
for (File fi : f.listFiles()) {
String next = f.getName().startsWith("-") || f.getName().startsWith("@") ? path : path + f.getName() + "/";
String npre = f.getName().startsWith("_") ? pre + f.getName() :
f.getName().endsWith("_") ? f.getName() + pre :
f.getName().startsWith("@") ? f.getName().substring(1)
: pre;
process(fi, next, npre);
}
} else {
File t = new File(path + pre + f.getName());
check(t);
Files.copy(f, t);
}
}
}

View File

@@ -1,44 +0,0 @@
package organize.sub;
import com.google.common.io.Files;
import organize.ResourceOrganizer;
import java.io.File;
public class BlockFileOrganizer extends ResourceOrganizer {
public String texture;
public BlockFileOrganizer() {
super(Type.ASSETS, "blocks", "");
}
@Override
public void organize(File f) throws Exception {
texture = getTargetFolder() + "textures/block/";
process("", f);
}
private void process(String prefix, File f) throws Exception {
String filename = f.getName();
if (filename.startsWith("-") || filename.startsWith("."))
return;
filename = f.isDirectory() ? filename : filename.split("\\.")[0];
String name = filename.startsWith("_") ? prefix + filename : filename.endsWith("_") ? filename + prefix : filename;
if (f.isDirectory()) {
for (File fi : f.listFiles()) {
String file = fi.getName();
if (file.startsWith("-") || file.startsWith("."))
continue;
process(name, fi);
}
return;
}
String ext = f.getName().substring(filename.length());
File ti = new File(texture + name + ext);
check(ti);
Files.copy(f, ti);
}
}

View File

@@ -1,32 +0,0 @@
package organize.sub;
import com.google.common.io.Files;
import organize.ResourceOrganizer;
import java.io.File;
public class DataMisc extends ResourceOrganizer {
public DataMisc() {
super(Type.DATA, "data", "");
}
@Override
public void organize(File f) throws Exception {
for (File fi : f.listFiles())
process(fi, getResourceFolder(true) + type + "/");
}
private void process(File f, String pre) throws Exception {
if (f.getName().startsWith("."))
return;
if (f.isDirectory()) {
for (File fi : f.listFiles())
process(fi, pre + f.getName() + "/");
} else {
File t = new File(pre + f.getName());
check(t);
Files.copy(f, t);
}
}
}

View File

@@ -1,40 +0,0 @@
package organize.sub;
import com.google.common.io.Files;
import organize.ResourceOrganizer;
import java.io.File;
public class GeckoMisc extends ResourceOrganizer {
public GeckoMisc() {
super(Type.ASSETS, "gecko", "");
}
@Override
public void organize(File f) throws Exception {
for (File fi : f.listFiles())
process(fi);
}
private void process(File f) throws Exception {
if (f.getName().startsWith("."))
return;
if (f.isDirectory()) {
for (File fi : f.listFiles()) {
process(fi);
}
} else {
String name = f.getName();
String path = getTargetFolder();
if (name.endsWith("animation.json"))
path += "animations/";
else if (name.endsWith("geo.json"))
path += "geo/";
else path += "textures/gecko/";
File t = new File(path + f.getName());
check(t);
Files.copy(f, t);
}
}
}

View File

@@ -1,43 +0,0 @@
package organize.sub;
import com.google.common.io.Files;
import organize.ResourceOrganizer;
import java.io.File;
public class ItemFileOrganizer extends ResourceOrganizer {
public String texture;
public ItemFileOrganizer() {
super(Type.ASSETS, "items", "");
}
@Override
public void organize(File f) throws Exception {
texture = getTargetFolder() + "textures/item/";
process("", f);
}
private void process(String prefix, File f) throws Exception {
String filename = f.getName();
if (filename.startsWith("-") || filename.startsWith("."))
return;
filename = f.isDirectory() ? filename : filename.split("\\.")[0];
String name = filename.startsWith("_") ? prefix + filename : filename.endsWith("_") ? filename + prefix : filename;
if (f.isDirectory()) {
for (File fi : f.listFiles()) {
String file = fi.getName();
if (file.startsWith("-") || file.startsWith("."))
continue;
process(name, fi);
}
return;
}
File ti = new File(texture + name + ".png");
check(ti);
Files.copy(f, ti);
}
}

View File

@@ -1,82 +0,0 @@
package organize.sub;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import com.mojang.datafixers.util.Pair;
import organize.ResourceOrganizer;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
public class LangFileOrganizer extends ResourceOrganizer {
public LangFileOrganizer() {
super(Type.ASSETS, "lang", "lang/");
}
@Override
public void organize(File f) throws Exception {
for (File fi : f.listFiles()) {
if (!fi.isDirectory())
continue;
String name = fi.getName();
File target = new File(getTargetFolder() + name + ".json");
check(target);
JsonObject dst_json = new JsonObject();
for (File fj : fi.listFiles()) {
if (!fj.getName().endsWith(".json")) continue;
JsonObject json = new JsonParser().parse(new FileReader(fj.getPath(), StandardCharsets.UTF_8)).getAsJsonObject();
inject("", json, dst_json);
if (json.has("-cartesian")) {
JsonObject block_list = json.get("-cartesian").getAsJsonObject();
block_list.entrySet().forEach(ent0 -> {
JsonObject block = ent0.getValue().getAsJsonObject();
String path = block.get("path").getAsString();
boolean reverse = block.has("reverse") && block.get("reverse").getAsBoolean();
boolean dot = block.has("use_dot") && block.get("use_dot").getAsBoolean();
String con = dot ? "." : "_";
List<Pair<String, String>> map = new ArrayList<>();
for (JsonElement vector : block.get("list").getAsJsonArray()) {
if (map.isEmpty()) {
List<Pair<String, String>> finalMap = map;
vector.getAsJsonObject().entrySet().forEach(ent1 ->
finalMap.add(Pair.of(ent1.getKey(), ent1.getValue().getAsString())));
} else {
map = map.stream().flatMap(ent1 -> vector.getAsJsonObject().entrySet().stream()
.map(ent2 -> Pair.of(ent1.getFirst() + con + ent2.getKey(),
reverse ? ent2.getValue().getAsString() + ent1.getSecond() :
ent1.getSecond() + ent2.getValue().getAsString())))
.collect(Collectors.toList());
}
}
for (Pair<String, String> pair : map) {
dst_json.addProperty(path + "." + pair.getFirst(), pair.getSecond());
}
});
}
}
FileWriter w = new FileWriter(target, StandardCharsets.UTF_8);
w.write(GSON.toJson(dst_json));
w.close();
}
}
private void inject(String path, JsonObject src, JsonObject dst) {
for (Map.Entry<String, JsonElement> ent : src.entrySet()) {
if (ent.getKey().startsWith("-")) continue;
if (ent.getValue().isJsonObject()) {
inject(path + ent.getKey() + ".", ent.getValue().getAsJsonObject(), dst);
} else {
dst.add(path + ent.getKey(), ent.getValue());
}
}
}
}

View File

@@ -1,118 +0,0 @@
package organize.sub;
import com.google.common.io.Files;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonParser;
import organize.ResourceOrganizer;
import java.io.File;
import java.io.FileReader;
import java.io.PrintStream;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class RecipeFileOrganizer extends ResourceOrganizer {
public RecipeFileOrganizer() {
super(Type.DATA, "recipes", "recipes/");
}
@Override
public void organize(File f) throws Exception {
generate(new File(f.getPath() + "/-template"));
process("", "", f, (name, file) -> {
String fs = getTargetFolder() + name;
File ti = new File(fs + ".json");
check(ti);
Files.copy(file, ti);
}, false);
}
private void generate(File file) throws Exception {
if (!file.exists())
return;
File info = new File(file.getPath() + "/-info.json");
if (!info.exists())
return;
Map<String, String> map = new HashMap<>();
process("", "", file, (name, f) -> {
map.put(name, readFile(f.getPath()));
}, false);
JsonElement elem = new JsonParser().parse(new FileReader(info));
for (Map.Entry<String, JsonElement> layer_0 : elem.getAsJsonObject().entrySet()) {
List<Pair> list = new ArrayList<>();
if (layer_0.getKey().startsWith("-")) {
JsonArray arr = layer_0.getValue().getAsJsonObject().get("-list").getAsJsonArray();
for (JsonElement e : arr) {
list.add(new Pair(e.getAsString(), map));
}
} else {
list.add(new Pair(layer_0.getKey(), map));
}
for (Map.Entry<String, JsonElement> layer_1 : layer_0.getValue().getAsJsonObject().entrySet()) {
String _name = layer_1.getKey();
if (_name.startsWith("-"))
continue;
for (Pair pair : list) {
String name = _name;
if (name.endsWith("_"))
name = name + pair.name;
else if (name.startsWith("_"))
name = pair.name + name;
else name = name + "_" + pair.name;
File dst = new File(getTargetFolder() + name + ".json");
check(dst);
String ans = pair.template;
for (Map.Entry<String, JsonElement> layer_2 : layer_1.getValue().getAsJsonObject().entrySet()) {
ans = ans.replaceAll("\\^" + layer_2.getKey(), layer_2.getValue().getAsString());
}
ans = ans.replaceAll("\\^m", MODID);
ans = ans.replaceAll("\\^n", _name);
PrintStream ps = new PrintStream(dst);
ps.println(ans);
ps.close();
}
}
}
}
private void process(String folder, String prefix, File f, ExcCons cons, boolean skip_dash) throws Exception {
String filename = f.getName();
if (skip_dash && filename.startsWith("-") || filename.startsWith("."))
return;
filename = f.isDirectory() ? filename : filename.split("\\.")[0];
String name = filename.startsWith("_") ? prefix + filename : filename.endsWith("_") ? filename + prefix : filename;
String subfolder = skip_dash && !prefix.startsWith("-") && name.equals(filename) ? folder.length() == 0 ? prefix : folder + "/" + prefix : folder;
if (f.isDirectory()) {
for (File fi : f.listFiles()) {
String file = fi.getName();
if (file.startsWith("-") || file.startsWith("."))
continue;
process(subfolder, skip_dash ? name : "", fi, cons, true);
}
return;
}
cons.accept(subfolder.length() == 0 ? name : subfolder + "/" + name, f);
}
private static class Pair {
private final String name;
private final String template;
private Pair(String name, Map<String, String> map) {
this.name = name;
this.template = map.get(name);
}
}
private interface ExcCons {
void accept(String name, File file) throws Exception;
}
}

View File

@@ -1,65 +0,0 @@
package util;
import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
public class ScalePic {
public static void main(String[] args) throws IOException {
//scale(4, "logo1", "logo1");
//scale(18, "run_bow");
//scale(16, "sonic_shooter");
//resize(64, 0,0,"iron");
scale(25, "curse_of_spell", "curse_of_spell");
//resize(18, 1,1,"moonwalk");
}
private static void scale(String name) throws IOException {
scale(2, name, name);
scale(8, name, name + "_large");
}
private static void resize(int size, int x0, int y0, String name) throws IOException {
File in = new File("./temp/in/" + name + ".png");
File out = new File("./temp/out/" + name + ".png");
BufferedImage img = ImageIO.read(in);
int sx = img.getWidth();
int sy = img.getHeight();
BufferedImage ans = new BufferedImage(size, size, BufferedImage.TYPE_INT_ARGB);
for (int x = 0; x < sx; x++)
for (int y = 0; y < sy; y++) {
int col = img.getRGB(x, y);
ans.setRGB(x0 + x, y0 + y, col);
}
if (!out.exists()) {
out.createNewFile();
}
ImageIO.write(ans, "PNG", out);
}
private static void scale(int scale, String name, String out_name) throws IOException {
File in = new File("./temp/in/" + name + ".png");
File out = new File("./temp/out/" + out_name + ".png");
BufferedImage img = ImageIO.read(in);
int sx = img.getWidth();
int sy = img.getHeight();
BufferedImage ans = new BufferedImage(sx * scale, sy * scale, BufferedImage.TYPE_INT_ARGB);
for (int x = 0; x < sx; x++)
for (int y = 0; y < sy; y++) {
int col = img.getRGB(x, y);
for (int i = 0; i < scale; i++)
for (int j = 0; j < scale; j++) {
ans.setRGB(x * scale + i, y * scale + j, col);
}
}
if (!out.exists()) {
out.createNewFile();
}
ImageIO.write(ans, "PNG", out);
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

View File

@@ -1,21 +0,0 @@
{
"height": 166,
"comp": {
"grid": {
"x": 8,
"y": 17,
"w": 18,
"h": 18,
"rx": 9,
"ry": 3
}
},
"side": {
"slot": {
"x": 176,
"y": 0,
"w": 18,
"h": 18
}
}
}

View File

@@ -1,21 +0,0 @@
{
"height": 184,
"comp": {
"grid": {
"x": 8,
"y": 17,
"w": 18,
"h": 18,
"rx": 9,
"ry": 4
}
},
"side": {
"slot": {
"x": 176,
"y": 0,
"w": 18,
"h": 18
}
}
}

View File

@@ -1,21 +0,0 @@
{
"height": 202,
"comp": {
"grid": {
"x": 8,
"y": 17,
"w": 18,
"h": 18,
"rx": 9,
"ry": 5
}
},
"side": {
"slot": {
"x": 176,
"y": 0,
"w": 18,
"h": 18
}
}
}

View File

@@ -1,21 +0,0 @@
{
"height": 220,
"comp": {
"grid": {
"x": 8,
"y": 17,
"w": 18,
"h": 18,
"rx": 9,
"ry": 6
}
},
"side": {
"slot": {
"x": 176,
"y": 0,
"w": 18,
"h": 18
}
}
}

View File

@@ -1,21 +0,0 @@
{
"height": 166,
"comp": {
"grid": {
"x": 8,
"y": 17,
"w": 18,
"h": 18,
"rx": 9,
"ry": 3
}
},
"side": {
"slot": {
"x": 176,
"y": 0,
"w": 18,
"h": 18
}
}
}

View File

@@ -1,21 +0,0 @@
{
"height": 184,
"comp": {
"grid": {
"x": 8,
"y": 17,
"w": 18,
"h": 18,
"rx": 9,
"ry": 4
}
},
"side": {
"slot": {
"x": 176,
"y": 0,
"w": 18,
"h": 18
}
}
}

View File

@@ -1,21 +0,0 @@
{
"height": 202,
"comp": {
"grid": {
"x": 8,
"y": 17,
"w": 18,
"h": 18,
"rx": 9,
"ry": 5
}
},
"side": {
"slot": {
"x": 176,
"y": 0,
"w": 18,
"h": 18
}
}
}

View File

@@ -1,21 +0,0 @@
{
"height": 220,
"comp": {
"grid": {
"x": 8,
"y": 17,
"w": 18,
"h": 18,
"rx": 9,
"ry": 6
}
},
"side": {
"slot": {
"x": 176,
"y": 0,
"w": 18,
"h": 18
}
}
}

View File

@@ -1,15 +0,0 @@
{
"side": [
"slot"
],
"comp": {
"grid": {
"sprite": "empty_slot",
"x": 16,
"y": 0,
"rx": 9,
"ry": 3
}
},
"isContainer": true
}

View File

@@ -1,15 +0,0 @@
{
"side": [
"slot"
],
"comp": {
"grid": {
"sprite": "empty_slot",
"x": 16,
"y": 0,
"rx": 9,
"ry": 4
}
},
"isContainer": true
}

View File

@@ -1,15 +0,0 @@
{
"side": [
"slot"
],
"comp": {
"grid": {
"sprite": "empty_slot",
"x": 16,
"y": 0,
"rx": 9,
"ry": 5
}
},
"isContainer": true
}

View File

@@ -1,15 +0,0 @@
{
"side": [
"slot"
],
"comp": {
"grid": {
"sprite": "empty_slot",
"x": 16,
"y": 0,
"rx": 9,
"ry": 6
}
},
"isContainer": true
}

View File

@@ -1,148 +0,0 @@
{
"toggle_slot": {
"ids": [
"_0",
"_1",
"_2"
],
"w": 18,
"h": 18,
"dx": 1,
"dy": 1
},
"altas": {
"ids": [
"_boost_main",
"_boost_sub",
"_stat_container",
"_head",
"_necklace",
"_body",
"_bracelet",
"_belt",
"_disabled"
],
"w": 16,
"h": 16
},
"button": {
"ids": [
"_1",
"_1p",
"_2",
"_2p"
],
"w": 8,
"h": 8
},
"sort": {
"ids": [
"_1",
"_1p"
],
"w": 9,
"h": 11
},
"delete": {
"ids": [
"_on",
"_off"
],
"w": 18,
"h": 18
},
"upgrade": {
"ids": [
"_on",
"_off"
],
"w": 18,
"h": 18
},
"slider/_top": {
"w": 14,
"h": 1,
"dx": 1,
"dy": 1
},
"slider/_bottom": {
"w": 14,
"h": 1,
"dx": 1,
"dy": -1
},
"slider/_middle": {
"w": 14,
"h": 1,
"dx": 1,
"dy": 0
},
"slider": {
"ids": [
"_light",
"_dark"
],
"w": 12,
"h": 15
},
"exchange": {
"ids": [
"_in",
"_out"
],
"w": 31,
"h": 14
},
"slot": {
"w": 18,
"h": 18,
"dx": 1,
"dy": 1
},
"empty_slot": {
"w": 18,
"h": 18,
"dx": 1,
"dy": 1
},
"result_slot": {
"w": 26,
"h": 26,
"dx": 5,
"dy": 5
},
"arrow": {
"ids": [
"_0",
"_1",
"_2",
"_3"
],
"w": 22,
"h": 16
},
"fire": {
"ids": [
"_0",
"_1"
],
"w": 14,
"h": 14
},
"top": {
"w": 176,
"h": 16
},
"bottom": {
"w": 176,
"h": 96
},
"bottom_screen": {
"w": 176,
"h": 7
},
"middle": {
"w": 176,
"h": 1
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 118 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 124 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 141 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 116 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 134 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 133 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 128 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 150 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 189 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 191 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 189 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 206 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 188 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 549 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 150 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 154 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 160 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 160 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 224 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 223 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 105 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 157 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 164 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 166 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 318 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 111 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 135 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 88 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 131 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 141 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 96 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 93 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 123 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 116 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 120 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 123 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 129 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 129 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 192 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 184 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 179 B