From 8cd08649778dca09d17a0a7ff6153a99b8443036 Mon Sep 17 00:00:00 2001 From: xt9 Date: Wed, 27 Dec 2017 00:44:42 +0100 Subject: [PATCH] 0.10 - Buffed the pristine spider matter (spider eyes) - Added creative item for data model leveling - The deep learner now only opens while not holding shift or ctrl (to avoid screwing up sneaking/block placing scenarios) - Bumped the max input rf/t for the Simulation chamber to 25k rf/t - Bumped the internal rf buffer of the Simulation chamber to 2 million - Slightly changed the Polymer clay recipe --- build.gradle | 4 +- changelog.md | 19 +++- .../client/gui/SimulationChamberGui.java | 1 - .../xt9/deepmoblearning/common/Registry.java | 5 +- .../common/blocks/ItemBlockBase.java | 1 - .../common/events/DevSpawn.java | 28 ------ .../common/events/DevTooltip.java | 1 - .../common/events/EntityDeathHandler.java | 1 - .../items/ItemCreativeModelLearner.java | 82 ++++++++++++++++++ .../common/items/ItemDeepLearner.java | 4 +- .../common/items/ItemMobChip.java | 2 +- .../tiles/TileEntitySimulationChamber.java | 2 +- .../assets/deepmoblearning/lang/en_us.lang | 1 + .../models/item/creative_model_learner.json | 6 ++ .../metadata6_spider/recipe2_spider_eye.json | 2 +- .../inputs/recipe1_polymer_clay.json | 6 +- .../textures/items/creative_model_learner.png | Bin 0 -> 518 bytes 17 files changed, 121 insertions(+), 44 deletions(-) delete mode 100644 src/main/java/xt9/deepmoblearning/common/events/DevSpawn.java create mode 100644 src/main/java/xt9/deepmoblearning/common/items/ItemCreativeModelLearner.java create mode 100644 src/main/resources/assets/deepmoblearning/models/item/creative_model_learner.json create mode 100644 src/main/resources/assets/deepmoblearning/textures/items/creative_model_learner.png diff --git a/build.gradle b/build.gradle index 16b3cc4..853029b 100644 --- a/build.gradle +++ b/build.gradle @@ -12,7 +12,8 @@ apply plugin: 'net.minecraftforge.gradle.forge' def mcVersion = "1.12.2" def modMajor = "0" -def modMinor = "9" +def modMinor = "10" + version = "${mcVersion}-${modMajor}.${modMinor}" group = "xt9.deepmoblearning" // http://maven.apache.org/guides/mini/guide-naming-conventions.html @@ -87,7 +88,6 @@ processResources { sourceSets { main { java { - exclude '**/DevSpawn.java' exclude '**/DevTooltip.java' } } diff --git a/changelog.md b/changelog.md index f51d090..5de9a30 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,18 @@ # 1.12.2 -## 0.9 -First beta version. \ No newline at end of file + + +### 0.10 +- Buffed the pristine spider matter (spider eyes) +- Added creative item for data model leveling +- The deep learner now only opens while not holding shift or ctrl + (to avoid screwing up sneaking/block placing scenarios) +- Bumped the max input rf/t for the Simulation chamber to 25k rf/t +- Bumped the internal rf buffer of the Simulation chamber to 2 million +- Slightly changed the Polymer clay recipe + +### 0.9.0 +- Added the remaining textures needed +- Mob chips now have different rf/t simulation costs in the simulation chamber +- Added charred redstone/plates to avoid mod recipe collisions +- Added more transmution recipes +- Data model leveling tweaked to be easier \ No newline at end of file diff --git a/src/main/java/xt9/deepmoblearning/client/gui/SimulationChamberGui.java b/src/main/java/xt9/deepmoblearning/client/gui/SimulationChamberGui.java index 4712004..8a90bed 100644 --- a/src/main/java/xt9/deepmoblearning/client/gui/SimulationChamberGui.java +++ b/src/main/java/xt9/deepmoblearning/client/gui/SimulationChamberGui.java @@ -6,7 +6,6 @@ import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; diff --git a/src/main/java/xt9/deepmoblearning/common/Registry.java b/src/main/java/xt9/deepmoblearning/common/Registry.java index c6ca6bf..0588c18 100644 --- a/src/main/java/xt9/deepmoblearning/common/Registry.java +++ b/src/main/java/xt9/deepmoblearning/common/Registry.java @@ -17,6 +17,7 @@ public class Registry { public static BlockSimulationChamber blockSimulationChamber; public static NonNullList items = NonNullList.create(); + public static Item simulationChamber; public static ItemPolymerClay polymerClay; public static ItemCharredRedstone charredRedstone; public static ItemCharredPlate charredPlate; @@ -24,7 +25,7 @@ public class Registry { public static ItemPristineMatter pristineMatter; public static ItemDeepLearner deepLearner; public static ItemMobChip mobChip; - public static Item simulationChamber; + public static ItemCreativeModelLearner cml; public static void registerBlocks(IForgeRegistry registry) { blockSimulationChamber = new BlockSimulationChamber(); @@ -55,6 +56,8 @@ public static void registerItems(IForgeRegistry registry) { items.add(livingMatter); pristineMatter = new ItemPristineMatter(); items.add(pristineMatter); + cml = new ItemCreativeModelLearner(); + items.add(cml); for (Item item : items) { registry.register(item); diff --git a/src/main/java/xt9/deepmoblearning/common/blocks/ItemBlockBase.java b/src/main/java/xt9/deepmoblearning/common/blocks/ItemBlockBase.java index 3fa8b4c..3e0288a 100644 --- a/src/main/java/xt9/deepmoblearning/common/blocks/ItemBlockBase.java +++ b/src/main/java/xt9/deepmoblearning/common/blocks/ItemBlockBase.java @@ -4,7 +4,6 @@ import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; import xt9.deepmoblearning.DeepMobLearning; -import xt9.deepmoblearning.common.items.ItemBase; /** * Created by xt9 on 2017-06-15. diff --git a/src/main/java/xt9/deepmoblearning/common/events/DevSpawn.java b/src/main/java/xt9/deepmoblearning/common/events/DevSpawn.java deleted file mode 100644 index 1eac0ac..0000000 --- a/src/main/java/xt9/deepmoblearning/common/events/DevSpawn.java +++ /dev/null @@ -1,28 +0,0 @@ -package xt9.deepmoblearning.common.events; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.launchwrapper.Launch; -import net.minecraft.util.text.TextComponentString; -import net.minecraftforge.fml.common.Mod; -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; -import net.minecraftforge.fml.common.gameevent.PlayerEvent; -import xt9.deepmoblearning.common.Registry; -import xt9.deepmoblearning.common.items.ItemMobChip; - -/** - * Created by xt9 on 2017-06-15. - */ -@Mod.EventBusSubscriber -public class DevSpawn { - - @SubscribeEvent - public static void addTestChips(PlayerEvent.PlayerLoggedInEvent event) { - EntityPlayer p = event.player; - ItemStack stack = new ItemStack(Registry.mobChip, 1, 2); - ItemMobChip.setTier(stack, 4); - ItemMobChip.setTotalKillCount(stack, 98); - - p.inventory.addItemStackToInventory(stack); - } -} \ No newline at end of file diff --git a/src/main/java/xt9/deepmoblearning/common/events/DevTooltip.java b/src/main/java/xt9/deepmoblearning/common/events/DevTooltip.java index 497139c..ba150fb 100644 --- a/src/main/java/xt9/deepmoblearning/common/events/DevTooltip.java +++ b/src/main/java/xt9/deepmoblearning/common/events/DevTooltip.java @@ -2,7 +2,6 @@ import net.minecraft.client.resources.I18n; import net.minecraft.item.ItemStack; -import net.minecraft.launchwrapper.Launch; import net.minecraftforge.event.entity.player.ItemTooltipEvent; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; diff --git a/src/main/java/xt9/deepmoblearning/common/events/EntityDeathHandler.java b/src/main/java/xt9/deepmoblearning/common/events/EntityDeathHandler.java index 4e75d34..9aa0ed2 100644 --- a/src/main/java/xt9/deepmoblearning/common/events/EntityDeathHandler.java +++ b/src/main/java/xt9/deepmoblearning/common/events/EntityDeathHandler.java @@ -4,7 +4,6 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.NonNullList; import net.minecraftforge.event.entity.living.LivingDeathEvent; -import net.minecraftforge.event.entity.player.PlayerInteractEvent; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import xt9.deepmoblearning.common.items.ItemDeepLearner; diff --git a/src/main/java/xt9/deepmoblearning/common/items/ItemCreativeModelLearner.java b/src/main/java/xt9/deepmoblearning/common/items/ItemCreativeModelLearner.java new file mode 100644 index 0000000..7551738 --- /dev/null +++ b/src/main/java/xt9/deepmoblearning/common/items/ItemCreativeModelLearner.java @@ -0,0 +1,82 @@ +package xt9.deepmoblearning.common.items; + +import net.minecraft.client.resources.I18n; +import net.minecraft.client.util.ITooltipFlag; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.EntityEquipmentSlot; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.util.ActionResult; +import net.minecraft.util.EnumActionResult; +import net.minecraft.util.EnumHand; +import net.minecraft.util.NonNullList; +import net.minecraft.util.text.TextComponentString; +import net.minecraft.world.World; +import net.minecraftforge.common.util.Constants; +import xt9.deepmoblearning.DeepConstants; +import xt9.deepmoblearning.common.CommonProxy; +import xt9.deepmoblearning.common.util.KeyboardHelper; + +import javax.annotation.Nullable; +import java.util.List; + +public class ItemCreativeModelLearner extends ItemBase { + public ItemCreativeModelLearner() { + super("creative_model_learner", 1); + } + + @Override + public ActionResult onItemRightClick(World worldIn, EntityPlayer player, @Nullable EnumHand hand) { + NonNullList inv1 = player.inventory.mainInventory; + NonNullList inv2 = player.inventory.offHandInventory; + + if(!player.world.isRemote) { + if(KeyboardHelper.isHoldingShift()) { + findAndLevelUpModels(inv1, player, true); + findAndLevelUpModels(inv2, player, true); + } else if(KeyboardHelper.isHoldingCTRL()) { + findAndLevelUpModels(inv1, player, false); + findAndLevelUpModels(inv2, player, false); + } + } + + + return new ActionResult(EnumActionResult.PASS, player.getHeldItem(hand)); + } + + public void findAndLevelUpModels(NonNullList inventory, EntityPlayer player, boolean increaseWholeTier) { + for(ItemStack inventoryStack : inventory) { + if (inventoryStack.getItem() instanceof ItemDeepLearner) { + NonNullList deepLearnerInternalInv = ItemDeepLearner.getContainedItems(inventoryStack); + for (ItemStack stack : deepLearnerInternalInv) { + if (stack.getItem() instanceof ItemMobChip) { + int tier = ItemMobChip.getTier(stack); + if(tier != DeepConstants.MOB_CHIP_MAXIMUM_TIER) { + if(increaseWholeTier) { + ItemMobChip.setTier(stack, (tier + 1)); + } else { + ItemMobChip.increaseMobKillCount(stack, player); + } + } + + } + ItemDeepLearner.setContainedItems(inventoryStack, deepLearnerInternalInv); + } + } + } + } + + @Override + public void addInformation(ItemStack stack, @Nullable World worldIn, List list, ITooltipFlag flagIn) { + if(!KeyboardHelper.isHoldingShift()) { + list.add(I18n.format("deepmoblearning.holdshift")); + } else { + list.add("A creative item that levels up data models inside the Deep Learner." ); + list.add("§r§oSHIFT§r§7 + §r§oRIGHT§r§7 click to increase tier.§r" ); + list.add("§r§oCTRL§r§7 + §r§oRIGHT§r§7 click to simulate kills.§r" ); + } + + } +} \ No newline at end of file diff --git a/src/main/java/xt9/deepmoblearning/common/items/ItemDeepLearner.java b/src/main/java/xt9/deepmoblearning/common/items/ItemDeepLearner.java index c8c93b7..6bcd800 100644 --- a/src/main/java/xt9/deepmoblearning/common/items/ItemDeepLearner.java +++ b/src/main/java/xt9/deepmoblearning/common/items/ItemDeepLearner.java @@ -28,7 +28,9 @@ public ItemDeepLearner() { @Override public ActionResult onItemRightClick(World worldIn, EntityPlayer player, @Nullable EnumHand hand) { - CommonProxy.openItemGui(player, hand == EnumHand.MAIN_HAND ? EntityEquipmentSlot.MAINHAND : EntityEquipmentSlot.OFFHAND); + if(!KeyboardHelper.isHoldingShift() && !KeyboardHelper.isHoldingCTRL()) { + CommonProxy.openItemGui(player, hand == EnumHand.MAIN_HAND ? EntityEquipmentSlot.MAINHAND : EntityEquipmentSlot.OFFHAND); + } return new ActionResult(EnumActionResult.PASS, player.getHeldItem(hand)); } diff --git a/src/main/java/xt9/deepmoblearning/common/items/ItemMobChip.java b/src/main/java/xt9/deepmoblearning/common/items/ItemMobChip.java index fc6f6e8..df36b75 100644 --- a/src/main/java/xt9/deepmoblearning/common/items/ItemMobChip.java +++ b/src/main/java/xt9/deepmoblearning/common/items/ItemMobChip.java @@ -185,7 +185,7 @@ public static String getTierName(ItemStack stack, boolean getNextTierName) { } } - // Called by deep learners + // Called by Deep learners public static void increaseMobKillCount(ItemStack stack, EntityPlayer player) { // Get our current tier before increasing the kill count; int tier = getTier(stack); diff --git a/src/main/java/xt9/deepmoblearning/common/tiles/TileEntitySimulationChamber.java b/src/main/java/xt9/deepmoblearning/common/tiles/TileEntitySimulationChamber.java index d53ec9c..f8c25f2 100644 --- a/src/main/java/xt9/deepmoblearning/common/tiles/TileEntitySimulationChamber.java +++ b/src/main/java/xt9/deepmoblearning/common/tiles/TileEntitySimulationChamber.java @@ -29,7 +29,7 @@ public class TileEntitySimulationChamber extends TileEntity implements ITickable, IGuiTile { private SimulationChamberHandler inventory = new SimulationChamberHandler(); // Attach a DeepEnergyStorage, don't let it extract energy (It's not a generator) - private DeepEnergyStorage energyStorage = new DeepEnergyStorage(1000000, 1024 , 0, 0); + private DeepEnergyStorage energyStorage = new DeepEnergyStorage(2000000, 25600 , 0, 0); public HashMap simulationAnimations = new HashMap<>(); public HashMap simulationText = new HashMap<>(); diff --git a/src/main/resources/assets/deepmoblearning/lang/en_us.lang b/src/main/resources/assets/deepmoblearning/lang/en_us.lang index 74dee8c..955d3a4 100644 --- a/src/main/resources/assets/deepmoblearning/lang/en_us.lang +++ b/src/main/resources/assets/deepmoblearning/lang/en_us.lang @@ -7,6 +7,7 @@ item.deepmoblearning.polymer_clay.name=Polymer Clay item.deepmoblearning.charred_redstone.name=Charred Redstone item.deepmoblearning.charred_plate.name=Charred Plate item.deepmoblearning.deep_learner.name=§bDeep Learner§r +item.deepmoblearning.creative_model_learner.name=Creative Model Learner item.deepmoblearning.mob_chip.default.name=Data Model Chip item.deepmoblearning.mob_chip.zombie.name=§bZombie Data Model§r diff --git a/src/main/resources/assets/deepmoblearning/models/item/creative_model_learner.json b/src/main/resources/assets/deepmoblearning/models/item/creative_model_learner.json new file mode 100644 index 0000000..fddb58c --- /dev/null +++ b/src/main/resources/assets/deepmoblearning/models/item/creative_model_learner.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "deepmoblearning:items/creative_model_learner" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/deepmoblearning/recipes/pristine_matter/metadata6_spider/recipe2_spider_eye.json b/src/main/resources/assets/deepmoblearning/recipes/pristine_matter/metadata6_spider/recipe2_spider_eye.json index ed0f601..4ec0800 100644 --- a/src/main/resources/assets/deepmoblearning/recipes/pristine_matter/metadata6_spider/recipe2_spider_eye.json +++ b/src/main/resources/assets/deepmoblearning/recipes/pristine_matter/metadata6_spider/recipe2_spider_eye.json @@ -6,6 +6,6 @@ ], "result": { "item": "minecraft:spider_eye", - "count": 8 + "count": 16 } } \ No newline at end of file diff --git a/src/main/resources/assets/deepmoblearning/recipes/simulation_chamber/inputs/recipe1_polymer_clay.json b/src/main/resources/assets/deepmoblearning/recipes/simulation_chamber/inputs/recipe1_polymer_clay.json index abc1816..c3a6530 100644 --- a/src/main/resources/assets/deepmoblearning/recipes/simulation_chamber/inputs/recipe1_polymer_clay.json +++ b/src/main/resources/assets/deepmoblearning/recipes/simulation_chamber/inputs/recipe1_polymer_clay.json @@ -1,9 +1,9 @@ { "type": "minecraft:crafting_shaped", "pattern": [ - "RDR", - "GCI", - "RDR" + "GCR", + "CDC", + "RCI" ], "key": { "R": { "item": "deepmoblearning:charred_redstone", "data": 0 }, diff --git a/src/main/resources/assets/deepmoblearning/textures/items/creative_model_learner.png b/src/main/resources/assets/deepmoblearning/textures/items/creative_model_learner.png new file mode 100644 index 0000000000000000000000000000000000000000..0801e0929f5cfb23606768509b5cf55ea5b1d273 GIT binary patch literal 518 zcmV+h0{Q)kP)WFU8GbZ8()Nlj2>E@cM*00C-AL_t(I%f*ttOT$nU z#eb1RinWRsA%!}Zkalqvy1R>`Qzq@;;vxl-5}K zK_t;Qq@^lrXf#e02Gh6_}4+Z-3Gv$ z?gkF#+f`K+4*LCm{2!QEkNkK_tJOkP)u35=2f(%wz0g6YmhiQrBgxSSufW68Bl2Xn zkTvXugdl