Skip to content

Commit

Permalink
### 1.2
Browse files Browse the repository at this point in the history
- 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.
  • Loading branch information
xt9 committed Mar 21, 2018
1 parent 716a51c commit 5fba7ca
Show file tree
Hide file tree
Showing 18 changed files with 137 additions and 17 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 4 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
10 changes: 10 additions & 0 deletions src/main/java/xt9/deepmoblearning/DeepConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/xt9/deepmoblearning/DeepMobLearning.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ public class DataModelExperienceGui extends GuiScreen {
private ItemStack deepLearner;
private NonNullList<ItemStack> 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");

Expand Down Expand Up @@ -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);
Expand All @@ -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);
}
}

Expand All @@ -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);
Expand Down
12 changes: 10 additions & 2 deletions src/main/java/xt9/deepmoblearning/common/Registry.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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() {
Expand Down Expand Up @@ -102,6 +104,10 @@ private static void populateDataModelList() {
dataModels.add(dataModelTwilightGlacier);

}

if(DeepConstants.MOD_TCON_LOADED) {
dataModels.add(dataModelTinkerSlime);
}
}

private static void populateLivingMatterList() {
Expand Down Expand Up @@ -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);
Expand Down
10 changes: 9 additions & 1 deletion src/main/java/xt9/deepmoblearning/common/config/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down Expand Up @@ -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));
Expand Down Expand Up @@ -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));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
Expand Down
11 changes: 11 additions & 0 deletions src/main/java/xt9/deepmoblearning/common/items/ItemDataModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -229,4 +229,15 @@ public void addInformation(ItemStack stack, @Nullable World worldIn, List<String
super.addInformation(stack, worldIn, list, flagIn);
}
}

public static class TinkerSlime extends ItemDataModel {
public TinkerSlime() {
super("data_model_tinker_slime");
}

@SideOnly(Side.CLIENT)
public void addInformation(ItemStack stack, @Nullable World worldIn, List<String> list, ITooltipFlag flagIn) {
super.addInformation(stack, worldIn, list, flagIn);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
26 changes: 26 additions & 0 deletions src/main/java/xt9/deepmoblearning/common/mobs/TinkerSlimeMeta.java
Original file line number Diff line number Diff line change
@@ -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);
}
}
2 changes: 2 additions & 0 deletions src/main/resources/assets/deepmoblearning/lang/en_us.lang
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "deepmoblearning:items/data_model_tinker_slime"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "deepmoblearning:items/pristine_matter_tinker_slime"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 5fba7ca

Please sign in to comment.