From 4f4baef9972ea03569af72a581cef52cc5fa8b83 Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Wed, 29 Mar 2023 12:24:12 +0700 Subject: [PATCH] =?UTF-8?q?=D0=A0=D0=B0=D0=B7=D0=B4=D0=B5=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20=D0=BE=D0=B4=D0=BD=D0=BE=D0=B3=D0=BE=20?= =?UTF-8?q?=D0=BF=D0=B0=D0=BA=D0=B5=D1=82=D0=B0=20item=20=D0=BD=D0=B0=20ap?= =?UTF-8?q?i=20=D0=B8=20impl=20=D0=B4=D0=BB=D1=8F=20=D1=83=D0=B4=D0=BE?= =?UTF-8?q?=D0=B1=D1=81=D1=82=D0=B2=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ru/dbotthepony/kstarbound/Starbound.kt | 25 +++++++++---------- .../kstarbound/defs/ItemReference.kt | 2 +- .../ru/dbotthepony/kstarbound/defs/Species.kt | 2 +- .../defs/item/DynamicItemDefinition.kt | 1 + .../item/{ => api}/IArmorItemDefinition.kt | 4 +-- .../item/{ => api}/ICurrencyItemDefinition.kt | 2 +- .../item/{ => api}/IFlashlightDefinition.kt | 2 +- .../{ => api}/IHarvestingToolDefinition.kt | 2 +- .../defs/item/{ => api}/IItemDefinition.kt | 4 ++- .../item/{ => api}/IItemInHandDefinition.kt | 3 ++- .../item/{ => api}/ILeveledItemDefinition.kt | 4 ++- .../defs/item/{ => api}/ILiquidItem.kt | 3 ++- .../defs/item/{ => api}/IMaterialItem.kt | 3 ++- .../{ => api}/IScriptableItemDefinition.kt | 3 ++- .../item/{ => impl}/ArmorItemPrototype.kt | 5 ++-- .../item/{ => impl}/CurrencyItemPrototype.kt | 7 ++---- .../item/{ => impl}/FlashlightPrototype.kt | 5 ++-- .../{ => impl}/HarvestingToolPrototype.kt | 5 ++-- .../defs/item/{ => impl}/ItemPrototype.kt | 6 +++-- .../item/{ => impl}/LiquidItemPrototype.kt | 3 ++- .../item/{ => impl}/MaterialItemPrototype.kt | 3 ++- .../defs/player/BlueprintLearnList.kt | 2 +- .../defs/player/DeploymentConfig.kt | 2 +- .../defs/player/PlayerDefinition.kt | 2 +- .../dbotthepony/kstarbound/util/ItemStack.kt | 2 +- .../kstarbound/world/entities/ItemEntity.kt | 2 +- 26 files changed, 55 insertions(+), 49 deletions(-) rename src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/{ => api}/IArmorItemDefinition.kt (93%) rename src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/{ => api}/ICurrencyItemDefinition.kt (84%) rename src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/{ => api}/IFlashlightDefinition.kt (87%) rename src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/{ => api}/IHarvestingToolDefinition.kt (93%) rename src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/{ => api}/IItemDefinition.kt (95%) rename src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/{ => api}/IItemInHandDefinition.kt (68%) rename src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/{ => api}/ILeveledItemDefinition.kt (75%) rename src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/{ => api}/ILiquidItem.kt (72%) rename src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/{ => api}/IMaterialItem.kt (73%) rename src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/{ => api}/IScriptableItemDefinition.kt (51%) rename src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/{ => impl}/ArmorItemPrototype.kt (88%) rename src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/{ => impl}/CurrencyItemPrototype.kt (51%) rename src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/{ => impl}/FlashlightPrototype.kt (77%) rename src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/{ => impl}/HarvestingToolPrototype.kt (83%) rename src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/{ => impl}/ItemPrototype.kt (91%) rename src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/{ => impl}/LiquidItemPrototype.kt (87%) rename src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/{ => impl}/MaterialItemPrototype.kt (87%) diff --git a/src/main/kotlin/ru/dbotthepony/kstarbound/Starbound.kt b/src/main/kotlin/ru/dbotthepony/kstarbound/Starbound.kt index 63b6d093..2895ee5c 100644 --- a/src/main/kotlin/ru/dbotthepony/kstarbound/Starbound.kt +++ b/src/main/kotlin/ru/dbotthepony/kstarbound/Starbound.kt @@ -2,7 +2,6 @@ package ru.dbotthepony.kstarbound import com.github.benmanes.caffeine.cache.Cache import com.github.benmanes.caffeine.cache.Caffeine -import com.google.common.cache.CacheBuilder import com.google.common.collect.Interner import com.google.common.collect.Interners import com.google.gson.* @@ -19,19 +18,19 @@ import ru.dbotthepony.kstarbound.api.explore import ru.dbotthepony.kstarbound.defs.* import ru.dbotthepony.kstarbound.defs.image.AtlasConfiguration import ru.dbotthepony.kstarbound.defs.image.ImageReference -import ru.dbotthepony.kstarbound.defs.item.BackArmorItemPrototype -import ru.dbotthepony.kstarbound.defs.item.ChestArmorItemPrototype -import ru.dbotthepony.kstarbound.defs.item.CurrencyItemPrototype -import ru.dbotthepony.kstarbound.defs.item.FlashlightPrototype -import ru.dbotthepony.kstarbound.defs.item.HarvestingToolPrototype -import ru.dbotthepony.kstarbound.defs.item.HeadArmorItemPrototype -import ru.dbotthepony.kstarbound.defs.item.IArmorItemDefinition -import ru.dbotthepony.kstarbound.defs.item.IItemDefinition +import ru.dbotthepony.kstarbound.defs.item.impl.BackArmorItemPrototype +import ru.dbotthepony.kstarbound.defs.item.impl.ChestArmorItemPrototype +import ru.dbotthepony.kstarbound.defs.item.impl.CurrencyItemPrototype +import ru.dbotthepony.kstarbound.defs.item.impl.FlashlightPrototype +import ru.dbotthepony.kstarbound.defs.item.impl.HarvestingToolPrototype +import ru.dbotthepony.kstarbound.defs.item.impl.HeadArmorItemPrototype +import ru.dbotthepony.kstarbound.defs.item.api.IArmorItemDefinition +import ru.dbotthepony.kstarbound.defs.item.api.IItemDefinition import ru.dbotthepony.kstarbound.defs.item.InventoryIcon -import ru.dbotthepony.kstarbound.defs.item.ItemPrototype -import ru.dbotthepony.kstarbound.defs.item.LegsArmorItemPrototype -import ru.dbotthepony.kstarbound.defs.item.LiquidItemPrototype -import ru.dbotthepony.kstarbound.defs.item.MaterialItemPrototype +import ru.dbotthepony.kstarbound.defs.item.impl.ItemPrototype +import ru.dbotthepony.kstarbound.defs.item.impl.LegsArmorItemPrototype +import ru.dbotthepony.kstarbound.defs.item.impl.LiquidItemPrototype +import ru.dbotthepony.kstarbound.defs.item.impl.MaterialItemPrototype import ru.dbotthepony.kstarbound.defs.npc.NpcTypeDefinition import ru.dbotthepony.kstarbound.defs.tile.LiquidDefinition import ru.dbotthepony.kstarbound.defs.particle.ParticleDefinition diff --git a/src/main/kotlin/ru/dbotthepony/kstarbound/defs/ItemReference.kt b/src/main/kotlin/ru/dbotthepony/kstarbound/defs/ItemReference.kt index 0f3dd000..8b0d027b 100644 --- a/src/main/kotlin/ru/dbotthepony/kstarbound/defs/ItemReference.kt +++ b/src/main/kotlin/ru/dbotthepony/kstarbound/defs/ItemReference.kt @@ -9,7 +9,7 @@ import com.google.gson.reflect.TypeToken import com.google.gson.stream.JsonReader import com.google.gson.stream.JsonToken import com.google.gson.stream.JsonWriter -import ru.dbotthepony.kstarbound.defs.item.IItemDefinition +import ru.dbotthepony.kstarbound.defs.item.api.IItemDefinition import ru.dbotthepony.kstarbound.io.json.builder.FactoryAdapter import ru.dbotthepony.kstarbound.io.json.builder.JsonFactory import ru.dbotthepony.kstarbound.io.json.consumeNull diff --git a/src/main/kotlin/ru/dbotthepony/kstarbound/defs/Species.kt b/src/main/kotlin/ru/dbotthepony/kstarbound/defs/Species.kt index 0b95113a..6a1571cb 100644 --- a/src/main/kotlin/ru/dbotthepony/kstarbound/defs/Species.kt +++ b/src/main/kotlin/ru/dbotthepony/kstarbound/defs/Species.kt @@ -3,7 +3,7 @@ package ru.dbotthepony.kstarbound.defs import com.google.common.collect.ImmutableList import com.google.common.collect.ImmutableSet import ru.dbotthepony.kstarbound.defs.image.ImageReference -import ru.dbotthepony.kstarbound.defs.item.IItemDefinition +import ru.dbotthepony.kstarbound.defs.item.api.IItemDefinition import ru.dbotthepony.kstarbound.defs.player.BlueprintLearnList import ru.dbotthepony.kstarbound.io.json.builder.JsonFactory diff --git a/src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/DynamicItemDefinition.kt b/src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/DynamicItemDefinition.kt index d23fd401..c69ea663 100644 --- a/src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/DynamicItemDefinition.kt +++ b/src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/DynamicItemDefinition.kt @@ -3,6 +3,7 @@ package ru.dbotthepony.kstarbound.defs.item import com.google.gson.JsonObject import ru.dbotthepony.kstarbound.RegistryObject import ru.dbotthepony.kstarbound.defs.DynamicDefinition +import ru.dbotthepony.kstarbound.defs.item.api.IItemDefinition class DynamicItemDefinition(def: RegistryObject) : DynamicDefinition(def) { override fun sanitize(saveInput: JsonObject) { diff --git a/src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/IArmorItemDefinition.kt b/src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/api/IArmorItemDefinition.kt similarity index 93% rename from src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/IArmorItemDefinition.kt rename to src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/api/IArmorItemDefinition.kt index 58476d9e..dc66bcf5 100644 --- a/src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/IArmorItemDefinition.kt +++ b/src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/api/IArmorItemDefinition.kt @@ -1,4 +1,4 @@ -package ru.dbotthepony.kstarbound.defs.item +package ru.dbotthepony.kstarbound.defs.item.api import com.google.gson.Gson import com.google.gson.TypeAdapter @@ -7,11 +7,9 @@ import com.google.gson.reflect.TypeToken import com.google.gson.stream.JsonReader import com.google.gson.stream.JsonToken import com.google.gson.stream.JsonWriter -import ru.dbotthepony.kstarbound.defs.image.AtlasConfiguration import ru.dbotthepony.kstarbound.defs.image.ImageReference import ru.dbotthepony.kstarbound.io.json.builder.FactoryAdapter import ru.dbotthepony.kstarbound.io.json.builder.JsonImplementation -import ru.dbotthepony.kstarbound.util.PathStack interface IArmorItemDefinition : ILeveledItemDefinition, IScriptableItemDefinition { /** diff --git a/src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/ICurrencyItemDefinition.kt b/src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/api/ICurrencyItemDefinition.kt similarity index 84% rename from src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/ICurrencyItemDefinition.kt rename to src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/api/ICurrencyItemDefinition.kt index 6574bd82..633751e5 100644 --- a/src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/ICurrencyItemDefinition.kt +++ b/src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/api/ICurrencyItemDefinition.kt @@ -1,4 +1,4 @@ -package ru.dbotthepony.kstarbound.defs.item +package ru.dbotthepony.kstarbound.defs.item.api interface ICurrencyItemDefinition : IItemDefinition { /** diff --git a/src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/IFlashlightDefinition.kt b/src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/api/IFlashlightDefinition.kt similarity index 87% rename from src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/IFlashlightDefinition.kt rename to src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/api/IFlashlightDefinition.kt index 5f16fa41..771b3dfa 100644 --- a/src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/IFlashlightDefinition.kt +++ b/src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/api/IFlashlightDefinition.kt @@ -1,4 +1,4 @@ -package ru.dbotthepony.kstarbound.defs.item +package ru.dbotthepony.kstarbound.defs.item.api import ru.dbotthepony.kvector.vector.Color import ru.dbotthepony.kvector.vector.ndouble.Vector2d diff --git a/src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/IHarvestingToolDefinition.kt b/src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/api/IHarvestingToolDefinition.kt similarity index 93% rename from src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/IHarvestingToolDefinition.kt rename to src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/api/IHarvestingToolDefinition.kt index 2d37a573..a2ba6e3f 100644 --- a/src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/IHarvestingToolDefinition.kt +++ b/src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/api/IHarvestingToolDefinition.kt @@ -1,4 +1,4 @@ -package ru.dbotthepony.kstarbound.defs.item +package ru.dbotthepony.kstarbound.defs.item.api import ru.dbotthepony.kstarbound.defs.animation.IAnimated diff --git a/src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/IItemDefinition.kt b/src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/api/IItemDefinition.kt similarity index 95% rename from src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/IItemDefinition.kt rename to src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/api/IItemDefinition.kt index 305a85e7..49b97fb4 100644 --- a/src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/IItemDefinition.kt +++ b/src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/api/IItemDefinition.kt @@ -1,7 +1,9 @@ -package ru.dbotthepony.kstarbound.defs.item +package ru.dbotthepony.kstarbound.defs.item.api import ru.dbotthepony.kstarbound.defs.IThingWithDescription import ru.dbotthepony.kstarbound.defs.RegistryReference +import ru.dbotthepony.kstarbound.defs.item.IInventoryIcon +import ru.dbotthepony.kstarbound.defs.item.ItemRarity interface IItemDefinition : IThingWithDescription { /** diff --git a/src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/IItemInHandDefinition.kt b/src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/api/IItemInHandDefinition.kt similarity index 68% rename from src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/IItemInHandDefinition.kt rename to src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/api/IItemInHandDefinition.kt index a6131bee..bcca7fe0 100644 --- a/src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/IItemInHandDefinition.kt +++ b/src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/api/IItemInHandDefinition.kt @@ -1,5 +1,6 @@ -package ru.dbotthepony.kstarbound.defs.item +package ru.dbotthepony.kstarbound.defs.item.api +import ru.dbotthepony.kstarbound.defs.item.api.IItemDefinition import ru.dbotthepony.kvector.vector.ndouble.Vector2d interface IItemInHandDefinition : IItemDefinition { diff --git a/src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/ILeveledItemDefinition.kt b/src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/api/ILeveledItemDefinition.kt similarity index 75% rename from src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/ILeveledItemDefinition.kt rename to src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/api/ILeveledItemDefinition.kt index 0e6ed158..8b9f69e8 100644 --- a/src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/ILeveledItemDefinition.kt +++ b/src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/api/ILeveledItemDefinition.kt @@ -1,4 +1,6 @@ -package ru.dbotthepony.kstarbound.defs.item +package ru.dbotthepony.kstarbound.defs.item.api + +import ru.dbotthepony.kstarbound.defs.item.ILeveledStatusEffect interface ILeveledItemDefinition : IItemDefinition { /** diff --git a/src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/ILiquidItem.kt b/src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/api/ILiquidItem.kt similarity index 72% rename from src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/ILiquidItem.kt rename to src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/api/ILiquidItem.kt index d927f0a8..0faf105a 100644 --- a/src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/ILiquidItem.kt +++ b/src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/api/ILiquidItem.kt @@ -1,5 +1,6 @@ -package ru.dbotthepony.kstarbound.defs.item +package ru.dbotthepony.kstarbound.defs.item.api +import ru.dbotthepony.kstarbound.defs.item.api.IItemDefinition import ru.dbotthepony.kstarbound.util.Either interface ILiquidItem : IItemDefinition { diff --git a/src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/IMaterialItem.kt b/src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/api/IMaterialItem.kt similarity index 73% rename from src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/IMaterialItem.kt rename to src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/api/IMaterialItem.kt index 3c56c6e2..d78570eb 100644 --- a/src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/IMaterialItem.kt +++ b/src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/api/IMaterialItem.kt @@ -1,5 +1,6 @@ -package ru.dbotthepony.kstarbound.defs.item +package ru.dbotthepony.kstarbound.defs.item.api +import ru.dbotthepony.kstarbound.defs.item.api.IItemDefinition import ru.dbotthepony.kstarbound.util.Either interface IMaterialItem : IItemDefinition { diff --git a/src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/IScriptableItemDefinition.kt b/src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/api/IScriptableItemDefinition.kt similarity index 51% rename from src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/IScriptableItemDefinition.kt rename to src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/api/IScriptableItemDefinition.kt index f9c6c0bf..cde5c4c8 100644 --- a/src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/IScriptableItemDefinition.kt +++ b/src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/api/IScriptableItemDefinition.kt @@ -1,5 +1,6 @@ -package ru.dbotthepony.kstarbound.defs.item +package ru.dbotthepony.kstarbound.defs.item.api import ru.dbotthepony.kstarbound.defs.IScriptable +import ru.dbotthepony.kstarbound.defs.item.api.IItemDefinition interface IScriptableItemDefinition : IItemDefinition, IScriptable diff --git a/src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/ArmorItemPrototype.kt b/src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/impl/ArmorItemPrototype.kt similarity index 88% rename from src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/ArmorItemPrototype.kt rename to src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/impl/ArmorItemPrototype.kt index d353e11d..1e8ab957 100644 --- a/src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/ArmorItemPrototype.kt +++ b/src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/impl/ArmorItemPrototype.kt @@ -1,9 +1,10 @@ -package ru.dbotthepony.kstarbound.defs.item +package ru.dbotthepony.kstarbound.defs.item.impl import com.google.common.collect.ImmutableList import ru.dbotthepony.kstarbound.defs.DirectAssetReference +import ru.dbotthepony.kstarbound.defs.item.api.IArmorItemDefinition +import ru.dbotthepony.kstarbound.defs.item.LeveledStatusEffect import ru.dbotthepony.kstarbound.io.json.builder.JsonBuilder -import ru.dbotthepony.kstarbound.io.json.builder.JsonIgnoreProperty @JsonBuilder abstract class ArmorItemPrototype : ItemPrototype(), IArmorItemDefinition { diff --git a/src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/CurrencyItemPrototype.kt b/src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/impl/CurrencyItemPrototype.kt similarity index 51% rename from src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/CurrencyItemPrototype.kt rename to src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/impl/CurrencyItemPrototype.kt index 1821f927..b4169faf 100644 --- a/src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/CurrencyItemPrototype.kt +++ b/src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/impl/CurrencyItemPrototype.kt @@ -1,10 +1,7 @@ -package ru.dbotthepony.kstarbound.defs.item +package ru.dbotthepony.kstarbound.defs.item.impl -import com.google.common.collect.ImmutableList -import ru.dbotthepony.kstarbound.defs.util.enrollMap -import ru.dbotthepony.kstarbound.io.json.builder.BuilderAdapter +import ru.dbotthepony.kstarbound.defs.item.api.ICurrencyItemDefinition import ru.dbotthepony.kstarbound.io.json.builder.JsonBuilder -import ru.dbotthepony.kstarbound.util.NotNullVar @JsonBuilder class CurrencyItemPrototype : ItemPrototype(), ICurrencyItemDefinition { diff --git a/src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/FlashlightPrototype.kt b/src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/impl/FlashlightPrototype.kt similarity index 77% rename from src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/FlashlightPrototype.kt rename to src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/impl/FlashlightPrototype.kt index 84fa7f4e..1d935b44 100644 --- a/src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/FlashlightPrototype.kt +++ b/src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/impl/FlashlightPrototype.kt @@ -1,8 +1,7 @@ -package ru.dbotthepony.kstarbound.defs.item +package ru.dbotthepony.kstarbound.defs.item.impl -import ru.dbotthepony.kstarbound.defs.util.enrollMap +import ru.dbotthepony.kstarbound.defs.item.api.IFlashlightDefinition import ru.dbotthepony.kstarbound.io.json.builder.JsonBuilder -import ru.dbotthepony.kstarbound.util.NotNullVar import ru.dbotthepony.kvector.vector.Color import ru.dbotthepony.kvector.vector.ndouble.Vector2d diff --git a/src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/HarvestingToolPrototype.kt b/src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/impl/HarvestingToolPrototype.kt similarity index 83% rename from src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/HarvestingToolPrototype.kt rename to src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/impl/HarvestingToolPrototype.kt index 334128fe..90d5ee42 100644 --- a/src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/HarvestingToolPrototype.kt +++ b/src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/impl/HarvestingToolPrototype.kt @@ -1,9 +1,8 @@ -package ru.dbotthepony.kstarbound.defs.item +package ru.dbotthepony.kstarbound.defs.item.impl import com.google.common.collect.ImmutableList -import ru.dbotthepony.kstarbound.defs.util.enrollMap +import ru.dbotthepony.kstarbound.defs.item.api.IHarvestingToolDefinition import ru.dbotthepony.kstarbound.io.json.builder.JsonBuilder -import ru.dbotthepony.kstarbound.util.NotNullVar import ru.dbotthepony.kvector.vector.ndouble.Vector2d @JsonBuilder diff --git a/src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/ItemPrototype.kt b/src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/impl/ItemPrototype.kt similarity index 91% rename from src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/ItemPrototype.kt rename to src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/impl/ItemPrototype.kt index a55f3b0b..b533fd8b 100644 --- a/src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/ItemPrototype.kt +++ b/src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/impl/ItemPrototype.kt @@ -1,13 +1,15 @@ -package ru.dbotthepony.kstarbound.defs.item +package ru.dbotthepony.kstarbound.defs.item.impl import com.google.common.collect.ImmutableList import ru.dbotthepony.kstarbound.defs.FreezableDefintionBuilder import ru.dbotthepony.kstarbound.defs.RegistryReference import ru.dbotthepony.kstarbound.defs.ThingDescription +import ru.dbotthepony.kstarbound.defs.item.api.IItemDefinition +import ru.dbotthepony.kstarbound.defs.item.InventoryIcon +import ru.dbotthepony.kstarbound.defs.item.ItemRarity import ru.dbotthepony.kstarbound.io.json.builder.JsonBuilder import ru.dbotthepony.kstarbound.io.json.builder.JsonPropertyConfig import ru.dbotthepony.kstarbound.io.json.builder.JsonIgnoreProperty -import ru.dbotthepony.kstarbound.util.NotNullVar @JsonBuilder open class ItemPrototype : FreezableDefintionBuilder(), IItemDefinition { diff --git a/src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/LiquidItemPrototype.kt b/src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/impl/LiquidItemPrototype.kt similarity index 87% rename from src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/LiquidItemPrototype.kt rename to src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/impl/LiquidItemPrototype.kt index 2322cb5d..615a84fb 100644 --- a/src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/LiquidItemPrototype.kt +++ b/src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/impl/LiquidItemPrototype.kt @@ -1,5 +1,6 @@ -package ru.dbotthepony.kstarbound.defs.item +package ru.dbotthepony.kstarbound.defs.item.impl +import ru.dbotthepony.kstarbound.defs.item.api.ILiquidItem import ru.dbotthepony.kstarbound.io.json.builder.JsonBuilder import ru.dbotthepony.kstarbound.util.Either diff --git a/src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/MaterialItemPrototype.kt b/src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/impl/MaterialItemPrototype.kt similarity index 87% rename from src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/MaterialItemPrototype.kt rename to src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/impl/MaterialItemPrototype.kt index 175494ad..1efa833f 100644 --- a/src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/MaterialItemPrototype.kt +++ b/src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/impl/MaterialItemPrototype.kt @@ -1,5 +1,6 @@ -package ru.dbotthepony.kstarbound.defs.item +package ru.dbotthepony.kstarbound.defs.item.impl +import ru.dbotthepony.kstarbound.defs.item.api.IMaterialItem import ru.dbotthepony.kstarbound.io.json.builder.JsonBuilder import ru.dbotthepony.kstarbound.util.Either diff --git a/src/main/kotlin/ru/dbotthepony/kstarbound/defs/player/BlueprintLearnList.kt b/src/main/kotlin/ru/dbotthepony/kstarbound/defs/player/BlueprintLearnList.kt index 2a404731..8e141d5e 100644 --- a/src/main/kotlin/ru/dbotthepony/kstarbound/defs/player/BlueprintLearnList.kt +++ b/src/main/kotlin/ru/dbotthepony/kstarbound/defs/player/BlueprintLearnList.kt @@ -11,7 +11,7 @@ import com.google.gson.stream.JsonToken import com.google.gson.stream.JsonWriter import it.unimi.dsi.fastutil.ints.Int2ObjectArrayMap import ru.dbotthepony.kstarbound.defs.RegistryReference -import ru.dbotthepony.kstarbound.defs.item.IItemDefinition +import ru.dbotthepony.kstarbound.defs.item.api.IItemDefinition import ru.dbotthepony.kstarbound.io.json.builder.JsonFactory class BlueprintLearnList private constructor(private val tiers: Int2ObjectArrayMap>) { diff --git a/src/main/kotlin/ru/dbotthepony/kstarbound/defs/player/DeploymentConfig.kt b/src/main/kotlin/ru/dbotthepony/kstarbound/defs/player/DeploymentConfig.kt index 166e088c..0543b1e0 100644 --- a/src/main/kotlin/ru/dbotthepony/kstarbound/defs/player/DeploymentConfig.kt +++ b/src/main/kotlin/ru/dbotthepony/kstarbound/defs/player/DeploymentConfig.kt @@ -5,7 +5,7 @@ import com.google.common.collect.ImmutableMap import ru.dbotthepony.kstarbound.defs.DirectAssetReference import ru.dbotthepony.kstarbound.defs.IScriptable import ru.dbotthepony.kstarbound.defs.RegistryReference -import ru.dbotthepony.kstarbound.defs.item.IItemDefinition +import ru.dbotthepony.kstarbound.defs.item.api.IItemDefinition import ru.dbotthepony.kstarbound.io.json.builder.JsonFactory @JsonFactory diff --git a/src/main/kotlin/ru/dbotthepony/kstarbound/defs/player/PlayerDefinition.kt b/src/main/kotlin/ru/dbotthepony/kstarbound/defs/player/PlayerDefinition.kt index cd103a00..62e40649 100644 --- a/src/main/kotlin/ru/dbotthepony/kstarbound/defs/player/PlayerDefinition.kt +++ b/src/main/kotlin/ru/dbotthepony/kstarbound/defs/player/PlayerDefinition.kt @@ -9,7 +9,7 @@ import ru.dbotthepony.kstarbound.defs.RegistryReference import ru.dbotthepony.kstarbound.defs.Species import ru.dbotthepony.kstarbound.util.SBPattern import ru.dbotthepony.kstarbound.defs.animation.AnimationDefinition -import ru.dbotthepony.kstarbound.defs.item.IItemDefinition +import ru.dbotthepony.kstarbound.defs.item.api.IItemDefinition import ru.dbotthepony.kstarbound.io.json.builder.JsonFactory import ru.dbotthepony.kvector.util2d.AABB import ru.dbotthepony.kvector.vector.Color diff --git a/src/main/kotlin/ru/dbotthepony/kstarbound/util/ItemStack.kt b/src/main/kotlin/ru/dbotthepony/kstarbound/util/ItemStack.kt index 48b692e8..64d8b753 100644 --- a/src/main/kotlin/ru/dbotthepony/kstarbound/util/ItemStack.kt +++ b/src/main/kotlin/ru/dbotthepony/kstarbound/util/ItemStack.kt @@ -9,7 +9,7 @@ import com.google.gson.stream.JsonToken import com.google.gson.stream.JsonWriter import ru.dbotthepony.kstarbound.RegistryObject import ru.dbotthepony.kstarbound.Starbound -import ru.dbotthepony.kstarbound.defs.item.IItemDefinition +import ru.dbotthepony.kstarbound.defs.item.api.IItemDefinition class ItemStack private constructor(item: RegistryObject?, count: Long, val parameters: JsonObject, marker: Unit) { constructor(item: RegistryObject, count: Long = 1L, parameters: JsonObject = JsonObject()) : this(item, count, parameters, Unit) diff --git a/src/main/kotlin/ru/dbotthepony/kstarbound/world/entities/ItemEntity.kt b/src/main/kotlin/ru/dbotthepony/kstarbound/world/entities/ItemEntity.kt index 1531ab4f..1560d9c2 100644 --- a/src/main/kotlin/ru/dbotthepony/kstarbound/world/entities/ItemEntity.kt +++ b/src/main/kotlin/ru/dbotthepony/kstarbound/world/entities/ItemEntity.kt @@ -5,7 +5,7 @@ import ru.dbotthepony.kbox2d.api.FixtureDef import ru.dbotthepony.kbox2d.api.Manifold import ru.dbotthepony.kbox2d.collision.shapes.PolygonShape import ru.dbotthepony.kbox2d.dynamics.contact.AbstractContact -import ru.dbotthepony.kstarbound.defs.item.IItemDefinition +import ru.dbotthepony.kstarbound.defs.item.api.IItemDefinition import ru.dbotthepony.kstarbound.world.World class ItemEntity(world: World<*, *>, val def: IItemDefinition) : Entity(world) {