diff --git a/README.md b/README.md index 08a5293..dc4003e 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,11 @@ some type of mob data model. Once your data models have reached higher tiers you can use them in the simulation chamber to get loot. +## Current mod support +- Thermal Foundation +- Twilight Forest +- Tinker's Construct + ## Beta guidelines Grab the latest release and drop the jar in your mods folder, make sure you use some other mod for RF generation. Use the Creative Model Learner if you want to level models quickly. diff --git a/build.gradle b/build.gradle index 879a325..98c6e8f 100644 --- a/build.gradle +++ b/build.gradle @@ -66,6 +66,7 @@ dependencies { compile files("deps/ThermalFoundation-1.12.2-2.3.7.18-universal.jar") compile files("deps/twilightforest-1.12.2-3.5.263-universal.jar") + compile files("deps/TConstruct-1.12-2.8.1.49.jar") } processResources { diff --git a/changelog.md b/changelog.md index 4ad0c9a..b948185 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,9 @@ # 1.12.2 +### 1.2 +- Added more configurable positions for the Experience gui (The bars that show up when holding the deep learner) +- Added support for the Tinker's construct blue slime. + ### 1.1 - Flattened item structure before the 1.13 removal of metadata (Breaking change) - New machine, The Loot Fabricator. All the existing pristine -> item recipes was moved to this machine diff --git a/src/main/java/xt9/deepmoblearning/DeepConstants.java b/src/main/java/xt9/deepmoblearning/DeepConstants.java index c8f9a4c..f77eb79 100644 --- a/src/main/java/xt9/deepmoblearning/DeepConstants.java +++ b/src/main/java/xt9/deepmoblearning/DeepConstants.java @@ -35,6 +35,7 @@ public class DeepConstants { // Loaded mod booleans public static final boolean MOD_TE_LOADED = Loader.isModLoaded("thermalfoundation"); public static final boolean MOD_TWILIGHT_LOADED = Loader.isModLoaded("twilightforest"); + public static final boolean MOD_TCON_LOADED = Loader.isModLoaded("tconstruct"); public static final class LOOT { public static final String[] CREEPER = { @@ -88,6 +89,15 @@ public static final class LOOT { "thermalfoundation:material,8,2048" }; + public static final String[] TINKERSLIME = { + "tconstruct:edible,18,1", + "tconstruct:edible,18,2", + "tconstruct:edible,18,4", + "tconstruct:slime_sapling,4,0", + "tconstruct:slime_sapling,4,1", + "tconstruct:slime_sapling,4,2", + }; + public static final String[] TWILIGHTFOREST = { "twilightforest:naga_scale,16,0", "twilightforest:charm_of_life_1,2,0", diff --git a/src/main/java/xt9/deepmoblearning/DeepMobLearning.java b/src/main/java/xt9/deepmoblearning/DeepMobLearning.java index 883348c..ff438e7 100644 --- a/src/main/java/xt9/deepmoblearning/DeepMobLearning.java +++ b/src/main/java/xt9/deepmoblearning/DeepMobLearning.java @@ -25,7 +25,7 @@ import xt9.deepmoblearning.common.network.LevelUpModelMessage; @Mod(modid = DeepConstants.MODID, version = DeepConstants.VERSION, useMetadata = true, guiFactory = "xt9.deepmoblearning.client.gui.config.GuiFactory", - dependencies = "after:jei;after:thermalfoundation;after:twilightforest", acceptedMinecraftVersions = "[1.12,1.12.2]") + dependencies = "after:jei;after:thermalfoundation;after:twilightforest;after:tconstruct", acceptedMinecraftVersions = "[1.12,1.12.2]") @Mod.EventBusSubscriber public class DeepMobLearning { diff --git a/src/main/java/xt9/deepmoblearning/client/gui/DataModelExperienceGui.java b/src/main/java/xt9/deepmoblearning/client/gui/DataModelExperienceGui.java index 017d2fe..bc14382 100644 --- a/src/main/java/xt9/deepmoblearning/client/gui/DataModelExperienceGui.java +++ b/src/main/java/xt9/deepmoblearning/client/gui/DataModelExperienceGui.java @@ -31,6 +31,8 @@ public class DataModelExperienceGui extends GuiScreen { private ItemStack deepLearner; private NonNullList chipStackList; private PlayerHelper playerH; + private int componentHeight = 26; + private int barSpacing = 12; private static final ResourceLocation experienceBar = new ResourceLocation(DeepConstants.MODID, "textures/gui/experience_gui.png"); @@ -67,11 +69,31 @@ public void renderOverlay(RenderGameOverlayEvent.Post event) { } - int x = getLeftCornerX() + 18; - if(Config.guiOverlaySide.getString().equals("right")) { - x = getRightCornerX(); + int x; + int y; + String position = Config.guiOverlaySide.getString(); + switch (position) { + case "topleft": + x = getLeftCornerX() + 18; + y = 5; + break; + case "topright": + x = getRightCornerX(); + y = 5; + break; + case "bottomleft": + x = getLeftCornerX() + 18; + y = getBottomY(chipStackList.size()) - 5; + break; + case "bottomright": + x = getRightCornerX(); + y = getBottomY(chipStackList.size()) - 5; + break; + default: + x = getLeftCornerX() + 18; + y = 5; + break; } - int y = 5; for (int i = 0; i < chipStackList.size(); i++) { ItemStack stack = chipStackList.get(i); @@ -85,23 +107,21 @@ public void renderOverlay(RenderGameOverlayEvent.Post event) { } private void drawExperienceBar(int x, int y, int index, String tierName, int tier, double killsToNextTier, double currenKillCount, int tierRoof, ItemStack stack) { - int componentHeight = 26; - int spacing = 12; DecimalFormat f = new DecimalFormat("0.#"); - drawItemStack(x - 18, y - 2 + spacing + (index * componentHeight), stack); + drawItemStack(x - 18, y - 2 + barSpacing + (index * componentHeight), stack); drawString(renderer, tierName + " Model", x - 14, y + (index * componentHeight) + 2, 16777215); // Draw the bar mc.getTextureManager().bindTexture(experienceBar); - drawTexturedModalRect(x, y + spacing + (index * componentHeight), 0, 0, 89, 12); + drawTexturedModalRect(x, y + barSpacing + (index * componentHeight), 0, 0, 89, 12); if(tier == DeepConstants.MOB_CHIP_MAXIMUM_TIER) { - drawTexturedModalRect(x + 1, y + 1 + spacing + (index * componentHeight), 0, 12, 89, 11); + drawTexturedModalRect(x + 1, y + 1 + barSpacing + (index * componentHeight), 0, 12, 89, 11); } else { - drawTexturedModalRect(x + 1, y + 1 + spacing + (index * componentHeight), 0, 12, + drawTexturedModalRect(x + 1, y + 1 + barSpacing + (index * componentHeight), 0, 12, (int) (((float) currenKillCount / tierRoof * 89)), 11); - drawString(renderer, f.format(killsToNextTier) + " to go", x + 3, y + 2 + spacing + (index * componentHeight), 16777215); + drawString(renderer, f.format(killsToNextTier) + " to go", x + 3, y + 2 + barSpacing + (index * componentHeight), 16777215); } } @@ -114,6 +134,11 @@ private int getRightCornerX() { return scaledResolution.getScaledWidth() - width - 5; } + private int getBottomY(int numberOfBars) { + ScaledResolution scaledResolution = new ScaledResolution(mc); + return scaledResolution.getScaledHeight() - (numberOfBars * componentHeight); + } + private void drawItemStack(int x, int y, ItemStack stack) { GlStateManager.translate(0.0F, 0.0F, 32.0F); diff --git a/src/main/java/xt9/deepmoblearning/common/Registry.java b/src/main/java/xt9/deepmoblearning/common/Registry.java index ee717aa..312d0da 100644 --- a/src/main/java/xt9/deepmoblearning/common/Registry.java +++ b/src/main/java/xt9/deepmoblearning/common/Registry.java @@ -50,11 +50,12 @@ public class Registry { public static ItemDataModel.TwilightSwamp dataModelTwilightSwamp = new ItemDataModel.TwilightSwamp(); public static ItemDataModel.TwilightDarkwood dataModelTwilightDarkwood = new ItemDataModel.TwilightDarkwood(); public static ItemDataModel.TwilightGlacier dataModelTwilightGlacier = new ItemDataModel.TwilightGlacier(); + public static ItemDataModel.TinkerSlime dataModelTinkerSlime = new ItemDataModel.TinkerSlime(); + // Living matter public static ItemLivingMatter.Overworldian livingMatterOverworldian = new ItemLivingMatter.Overworldian(); public static ItemLivingMatter.Hellish livingMatterHellish = new ItemLivingMatter.Hellish(); public static ItemLivingMatter.Extraterrestrial livingMatterExtraterrestrial = new ItemLivingMatter.Extraterrestrial(); - public static ItemLivingMatter.Twilight livingMatterTwilight = new ItemLivingMatter.Twilight(); // Pristine matter @@ -75,6 +76,7 @@ public class Registry { public static ItemPristineMatter.TwilightSwamp pristineMatterTwilightSwamp = new ItemPristineMatter.TwilightSwamp(); public static ItemPristineMatter.TwilightDarkwood pristineMatterTwilightDarkwood = new ItemPristineMatter.TwilightDarkwood(); public static ItemPristineMatter.TwilightGlacier pristineMatterTwilightGlacier = new ItemPristineMatter.TwilightGlacier(); + public static ItemPristineMatter.TinkerSlime pristineMatterTinkerSlime = new ItemPristineMatter.TinkerSlime(); /* Init the list of data models */ private static void populateDataModelList() { @@ -102,6 +104,10 @@ private static void populateDataModelList() { dataModels.add(dataModelTwilightGlacier); } + + if(DeepConstants.MOD_TCON_LOADED) { + dataModels.add(dataModelTinkerSlime); + } } private static void populateLivingMatterList() { @@ -131,7 +137,9 @@ private static void populatePristineMatterList() { if(DeepConstants.MOD_TE_LOADED) { pristineMatter.add(pristineMatterTE); } - + if(DeepConstants.MOD_TCON_LOADED) { + pristineMatter.add(pristineMatterTinkerSlime); + } if(DeepConstants.MOD_TWILIGHT_LOADED) { pristineMatter.add(pristineMatterTwilightForest); pristineMatter.add(pristineMatterTwilightSwamp); diff --git a/src/main/java/xt9/deepmoblearning/common/config/Config.java b/src/main/java/xt9/deepmoblearning/common/config/Config.java index 8d590da..d865137 100644 --- a/src/main/java/xt9/deepmoblearning/common/config/Config.java +++ b/src/main/java/xt9/deepmoblearning/common/config/Config.java @@ -40,7 +40,7 @@ public static void initConfigValues() { initPristineOutputs(); rfCostExtractionChamber = config.get(Configuration.CATEGORY_GENERAL, "rfCostLootFabricator", 256, "RF/t cost for the Loot Fabricator, roof is 18k RF/t"); - guiOverlaySide = config.get(Configuration.CATEGORY_GENERAL, "guiOverlaySide", "left", "Which side of the screen the Deep learner gui will appear on. [values: left/right]"); + guiOverlaySide = config.get(Configuration.CATEGORY_GENERAL, "guiOverlaySide", "topleft", "Which position on the screen the Deep learner gui will appear on. (bottomleft will clash with the chat) [values: topleft/topright/bottomleft/bottomright]"); config.save(); } @@ -74,10 +74,14 @@ private static void initDataModelRFCost() { dataModel.put("witherskeleton", config.get(dataModel.getName(), "witherskeleton", 880,null, 1, 6666)); dataModel.put("slime", config.get(dataModel.getName(), "slime", 180, null, 1, 6666)); dataModel.put("dragon", config.get(dataModel.getName(), "dragon", 2560, null, 1, 6666)); + /* Extension models */ if(DeepConstants.MOD_TE_LOADED) { dataModel.put("thermalelemental", config.get(dataModel.getName(), "thermalelemental", 256,null, 1, 6666)); } + if(DeepConstants.MOD_TCON_LOADED) { + dataModel.put("tinkerslime", config.get(dataModel.getName(), "tinkerslime", 256,null, 1, 6666)); + } if(DeepConstants.MOD_TWILIGHT_LOADED) { dataModel.put("twilightforest", config.get(dataModel.getName(), "twilightforest", 256,null, 1, 6666)); dataModel.put("twilightswamp", config.get(dataModel.getName(), "twilightswamp", 256,null, 1, 6666)); @@ -132,6 +136,10 @@ private static void initPristineOutputs() { pristineOutputs.put("thermalelemental", new Property("thermalelemental", config.getStringList("thermalelemental", pristineOutputs.getName(), DeepConstants.LOOT.THERMALELEMENTAL, "Thermal Elemental"), Property.Type.STRING)); } + if(DeepConstants.MOD_TCON_LOADED) { + pristineOutputs.put("tinkerslime", new Property("tinkerslime", config.getStringList("tinkerslime", pristineOutputs.getName(), DeepConstants.LOOT.TINKERSLIME, "Tinker construct slime"), Property.Type.STRING)); + } + if(DeepConstants.MOD_TWILIGHT_LOADED) { pristineOutputs.put("twilightforest", new Property("twilightforest", config.getStringList("twilightforest", pristineOutputs.getName(), DeepConstants.LOOT.TWILIGHTFOREST, "Twilight Forest(Biome, not the whole mod)"), Property.Type.STRING)); pristineOutputs.put("twilightswamp", new Property("twilightswamp", config.getStringList("twilightswamp", pristineOutputs.getName(), DeepConstants.LOOT.TWILIGHTSWAMP, "Twilight Swamp creatures"), Property.Type.STRING)); diff --git a/src/main/java/xt9/deepmoblearning/common/inventory/ContainerExtractionChamber.java b/src/main/java/xt9/deepmoblearning/common/inventory/ContainerExtractionChamber.java index a6a14ed..fa8f7b5 100644 --- a/src/main/java/xt9/deepmoblearning/common/inventory/ContainerExtractionChamber.java +++ b/src/main/java/xt9/deepmoblearning/common/inventory/ContainerExtractionChamber.java @@ -6,11 +6,9 @@ import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; import net.minecraft.world.World; -import net.minecraftforge.energy.CapabilityEnergy; import net.minecraftforge.items.CapabilityItemHandler; import net.minecraftforge.items.IItemHandler; import xt9.deepmoblearning.DeepConstants; -import xt9.deepmoblearning.common.energy.DeepEnergyStorage; import xt9.deepmoblearning.common.tiles.TileEntityExtractionChamber; /** diff --git a/src/main/java/xt9/deepmoblearning/common/items/ItemDataModel.java b/src/main/java/xt9/deepmoblearning/common/items/ItemDataModel.java index 814717d..afeca0a 100644 --- a/src/main/java/xt9/deepmoblearning/common/items/ItemDataModel.java +++ b/src/main/java/xt9/deepmoblearning/common/items/ItemDataModel.java @@ -229,4 +229,15 @@ public void addInformation(ItemStack stack, @Nullable World worldIn, List list, ITooltipFlag flagIn) { + super.addInformation(stack, worldIn, list, flagIn); + } + } } diff --git a/src/main/java/xt9/deepmoblearning/common/items/ItemPristineMatter.java b/src/main/java/xt9/deepmoblearning/common/items/ItemPristineMatter.java index c48ca9d..b0ee818 100644 --- a/src/main/java/xt9/deepmoblearning/common/items/ItemPristineMatter.java +++ b/src/main/java/xt9/deepmoblearning/common/items/ItemPristineMatter.java @@ -131,4 +131,10 @@ public TwilightGlacier() { super("pristine_matter_twilight_glacier", "twilightglacier"); } } + + public static class TinkerSlime extends ItemPristineMatter { + public TinkerSlime() { + super("pristine_matter_tinker_slime", "tinkerslime"); + } + } } diff --git a/src/main/java/xt9/deepmoblearning/common/mobs/MobMetaFactory.java b/src/main/java/xt9/deepmoblearning/common/mobs/MobMetaFactory.java index cee9b36..da232c3 100644 --- a/src/main/java/xt9/deepmoblearning/common/mobs/MobMetaFactory.java +++ b/src/main/java/xt9/deepmoblearning/common/mobs/MobMetaFactory.java @@ -164,6 +164,10 @@ public static MobMetaData createMobMetaData(ItemStack stack) { meta = new ThermalElementalMeta("thermalelemental", "Thermal Elementals", "Elementals", 10, 48, 10, 20, Registry.livingMatterOverworldian, Registry.pristineMatterTE); } + if(DeepConstants.MOD_TCON_LOADED && stack.getItem() instanceof ItemDataModel.TinkerSlime) { + meta = new TinkerSlimeMeta("tinkerslime", "Blue slime", "Blue slimes", 8, 60, 10, -16, Registry.livingMatterOverworldian, Registry.pristineMatterTinkerSlime); + } + if(DeepConstants.MOD_TWILIGHT_LOADED) { if(stack.getItem() instanceof ItemDataModel.TwilightForest) { meta = new TwilightForestMeta( diff --git a/src/main/java/xt9/deepmoblearning/common/mobs/TinkerSlimeMeta.java b/src/main/java/xt9/deepmoblearning/common/mobs/TinkerSlimeMeta.java new file mode 100644 index 0000000..9e242fd --- /dev/null +++ b/src/main/java/xt9/deepmoblearning/common/mobs/TinkerSlimeMeta.java @@ -0,0 +1,26 @@ +package xt9.deepmoblearning.common.mobs; + +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.item.Item; +import net.minecraft.world.World; +import slimeknights.tconstruct.world.entity.EntityBlueSlime; + +/** + * Created by xt9 on 2018-03-21. + */ +public class TinkerSlimeMeta extends MobMetaData { + static String[] mobTrivia = {"The elusive blue slime. Seemingly a", "part of some sort of power hierarchy", "since there's a bunch of \"King slimes\" around."}; + + TinkerSlimeMeta(String key, String name, String pluralName, int numberOfHearts, int interfaceScale, int interfaceOffsetX, int interfaceOffsetY, Item livingMatter, Item pristineMatter) { + super(key, name, pluralName, numberOfHearts, interfaceScale, interfaceOffsetX, interfaceOffsetY, livingMatter, pristineMatter, mobTrivia); + } + + @Override + public boolean entityLivingMatchesMob(EntityLivingBase entityLiving) { + return entityLiving instanceof EntityBlueSlime; + } + + public EntityBlueSlime getEntity(World world) { + return new EntityBlueSlime(world); + } +} diff --git a/src/main/resources/assets/deepmoblearning/lang/en_us.lang b/src/main/resources/assets/deepmoblearning/lang/en_us.lang index 3458383..3990a50 100644 --- a/src/main/resources/assets/deepmoblearning/lang/en_us.lang +++ b/src/main/resources/assets/deepmoblearning/lang/en_us.lang @@ -34,6 +34,7 @@ item.deepmoblearning.data_model_twilight_forest.name=§bTwilight Forest Data Mod item.deepmoblearning.data_model_twilight_swamp.name=§bTwilight Swamp Data Model§r item.deepmoblearning.data_model_twilight_darkwood.name=§bTwilight Darkwood Data Model§r item.deepmoblearning.data_model_twilight_glacier.name=§bTwilight Glacier Data Model§r +item.deepmoblearning.data_model_tinker_slime.name=§bBlue Slime Data Model§r # # Living matter @@ -63,6 +64,7 @@ item.deepmoblearning.pristine_matter_twilight_forest.name=Pristine Twilight Fore item.deepmoblearning.pristine_matter_twilight_swamp.name=Pristine Twilight Swamp Matter item.deepmoblearning.pristine_matter_twilight_darkwood.name=Pristine Twilight Darkwood Matter item.deepmoblearning.pristine_matter_twilight_glacier.name=Pristine Twilight Glacier Matter +item.deepmoblearning.pristine_matter_tinker_slime.name=Pristine Blue Slime Matter # # Creative tab diff --git a/src/main/resources/assets/deepmoblearning/models/item/data_model_tinker_slime.json b/src/main/resources/assets/deepmoblearning/models/item/data_model_tinker_slime.json new file mode 100644 index 0000000..174dd95 --- /dev/null +++ b/src/main/resources/assets/deepmoblearning/models/item/data_model_tinker_slime.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "deepmoblearning:items/data_model_tinker_slime" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/deepmoblearning/models/item/pristine_matter_tinker_slime.json b/src/main/resources/assets/deepmoblearning/models/item/pristine_matter_tinker_slime.json new file mode 100644 index 0000000..96ff831 --- /dev/null +++ b/src/main/resources/assets/deepmoblearning/models/item/pristine_matter_tinker_slime.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "deepmoblearning:items/pristine_matter_tinker_slime" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/deepmoblearning/textures/items/data_model_tinker_slime.png b/src/main/resources/assets/deepmoblearning/textures/items/data_model_tinker_slime.png new file mode 100644 index 0000000..c010ff8 Binary files /dev/null and b/src/main/resources/assets/deepmoblearning/textures/items/data_model_tinker_slime.png differ diff --git a/src/main/resources/assets/deepmoblearning/textures/items/pristine_matter_tinker_slime.png b/src/main/resources/assets/deepmoblearning/textures/items/pristine_matter_tinker_slime.png new file mode 100644 index 0000000..105b09b Binary files /dev/null and b/src/main/resources/assets/deepmoblearning/textures/items/pristine_matter_tinker_slime.png differ