
Sgmjscorp
Members-
Posts
25 -
Joined
-
Last visited
Everything posted by Sgmjscorp
-
[1.9] [Solved] Adaptable Block color via int/hex?
Sgmjscorp replied to Sgmjscorp's topic in Modder Support
Oh, well that's both useful and mildly complex. I like it! Thank you very much. -
I'd like to start off with what I think is an obvious statement: I am an idiot. I have a bad habit of looking over the obvious and not finding the simple. That being said, I have a block that adapts its color based on the element it is, but I have set it up in such a way that certain colors are brightened and others are darkened based on various events. I used to utilize the getRenderColor(BlockState) function, but it seems to now be missing. I was wondering if there is a way of doing a block coloring without the recolorBlock function as it only takes an EnumDye. (Or a way to trick EnumDye into taking an adaptive color...) Thank you in advance!
-
Those are generated by Eclipse when bringing in methods from an interface/super/etc. They're considered comments by java's code. I think he knows what a comment is... I guess his point is that you might want to implement them. I don't doubt he knows what a comment is, but I elaborated because I have no idea if he uses Eclipse or not. Also, they are implemented from the MinecraftByExample ( MBE15 ) Model Names and such are registered via AlchItems... I also threw in an addVariantName just to see if it would help, but it didn't...
-
Those are generated by Eclipse when bringing in methods from an interface/super/etc. They're considered comments by java's code. This just grabs the recorded baked model of the part, this case being the chase. It's returning a model, I know that much, but here's the ModelMapper and Event manager classes. ModelMapper: Event Manager:
-
Firstly, for anyone wondering, forge version: 1.8-11.14.3.1521 Images and title says it all. For some reason, my Smart Item Model class is no longer rendering the proper textures, and I believe it is related to the forge update to version 1519. Attached is the class code, and the only real change is getGeneralQuads() can be changed from chase to base and it'll render the base properly. (Both have identical JSon's so I know it's not the JSON itself.) In the images, the left is the chase and the right is the smart item. If anyone has any idea what I can do to fix/work-around this it would be greatly appreciated! Thank you!
-
I got it! It was actually surprisingly simple, if a little tedious. For those who are curious, hunt down the JsonParser class in the dev environment, and remember JsonObject, JsonElement, and JsonArray. Good luck!
-
Because translations and rotations won't persist with my current item. Individually it would but the design I worked on is a compilation of multiple item models, unless ISmartItemModel has some rotation voodoo I haven't found. As for a JSON file reader, I feel like an idiot now. Thank you! (Will update with results.)
-
Basically it's going to be a model JSON file for an item, but I want to add in additional data like offsets applied to the modular item it will be a part of. My current system stores this offset separately but I'd like to make it so users can make a JSON and have the internal system update from the file rather than hard-coding everything. This would also allow people to make additional models without needing to make a new mod and still be compatible with the current design.
-
Hi everyone! I was wondering if there was a way in Forge to pull additional data from a JSON file on top of what Minecraft normally pulls. All of my current searches kept pulling up nada to help me here. Any help would be appreciated! Thank you!
-
Thank you for answering and pointing me in a direction. Now I shall dive into the depths of silence once again! And maybe come out with a mediocre item! (Got to start somewhere, right?)
-
Hi everyone! I wanted to poke around and see if anyone knew where/how to handle Modular Item Models. The item I'm considering is going to have 3 required parts and a 4th optional, preferably with 3D models for each individual part. My problem is I have no idea where to start looking at 3D Item models (similar to grav-gun and portal-gun mods) and I wanted to know if anyone else knew where to begin and could point me in the right direction. Many thanks beforehand! -Scors
-
[SOLVED][1.8]Attempting to create dynamic item textures, failing.
Sgmjscorp replied to Sgmjscorp's topic in Modder Support
Thank you, GreyGhost! It was registration, as such I forgot to actually register the alternate textures... registerBakery(), when I did a call hierarchy, had nothing calling it. Thank you, as I doubt I'd have noticed that without your pointing out it was a registration error. Now to try to make the actual item texture change... That's gonna be fun > Thank you again! -
[SOLVED][1.8]Attempting to create dynamic item textures, failing.
Sgmjscorp replied to Sgmjscorp's topic in Modder Support
It's not an animation, it's supposed to change its texture based on how filled it is, thus why I showed the tooltips in the screenshots as well. I based my code off of animation because that was the closest example I could find to a dynamic texture. I receive no missing texture or missing model messages, and even put in a bit of code to verify that. They load fine! Just not when rendering .-. -
[SOLVED][1.8]Attempting to create dynamic item textures, failing.
Sgmjscorp replied to Sgmjscorp's topic in Modder Support
Bump-- I've updated to the latest forge version (11.14.1.1336) and it still has the same issues. Any help would be greatly appreciated! -
[SOLVED][1.8]Attempting to create dynamic item textures, failing.
Sgmjscorp replied to Sgmjscorp's topic in Modder Support
Basically a black and purple box being held while the item slot still holds its original texture. Edit: That could've taken less time... -
Hello there! I'm trying to make an item that changes its texture dynamically but have so far made no progress into figuring out how, even after going through a few tutorial codes that are supposed to do "animation". No luck, so I want to see if anyone out there can see what I'm missing and help me fix it. Posted is the relevant coding, and if you need anything more please let me know. Main Class package com.scors4.bioframe.common; import java.util.ArrayList; import java.util.List; import com.scors4.bioframe.common.items.*; import com.scors4.bioframe.common.proxy.CommonProxy; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.ItemModelMesher; import net.minecraft.client.renderer.entity.RenderItem; import net.minecraft.client.resources.model.ModelResourceLocation; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod.EventHandler; import net.minecraftforge.fml.common.Mod.Instance; import net.minecraftforge.fml.common.SidedProxy; import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; import net.minecraftforge.fml.common.registry.GameRegistry; @Mod(modid=References.MODID, name=References.MODNAME, version=References.VERSION) public class BioFrame { @Instance("bioframe") public static BioFrame instance = new BioFrame(); @SidedProxy(clientSide = References.CLIENT_PROXY_CLASS, serverSide = References.COMMON_PROXY_CLASS) public static CommonProxy proxy; public static final String modID = "bioframe"; public static boolean active = false; public static List<String> enabledMods = new ArrayList<String>(); public static Item itemExtractor; static public CreativeTabs tabBioFrame = null; public static void registerMod(String st) { if(!enabledMods.contains(st)) { enabledMods.add(st); System.out.println("Frame is now adding "+st); } } @EventHandler public void preInit(FMLPreInitializationEvent preEvent) { } @EventHandler public void init(FMLInitializationEvent event) { if(enabledMods.size() > 0) { BioFrame.active = true; initObjects(); registerObjects(); proxy.registerModels(); } } @EventHandler public void postInit(FMLPostInitializationEvent postEvent) { } private void initObjects() { tabBioFrame = new CreativeTabs("tabBioFrame") { @Override public Item getTabIconItem() { return itemExtractor; } }; initBlocks(); initItems(); } private void initBlocks() { } private void initItems() { itemExtractor = new ItemExtractor().setUnlocalizedName("extractor").setCreativeTab(tabBioFrame); } private void registerObjects() { registerBlocks(); registerItems(); } private void registerBlocks() { } private void registerItems() { GameRegistry.registerItem(itemExtractor, "extractor"); } } Client Proxy package com.scors4.bioframe.client.proxy; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.ItemModelMesher; import net.minecraft.client.renderer.entity.RenderItem; import net.minecraft.client.resources.model.ModelBakery; import net.minecraft.client.resources.model.ModelResourceLocation; import net.minecraft.item.Item; import com.scors4.bioframe.common.BioFrame; import com.scors4.bioframe.common.proxy.CommonProxy; public class ClientProxy extends CommonProxy { public void registerBakery() { ModelBakery.addVariantName(BioFrame.itemExtractor, BioFrame.modID+":extractor", BioFrame.modID+":extractor1", BioFrame.modID+":extractor2", BioFrame.modID+":extractor3", BioFrame.modID+":extractor4"); } @Override public void registerModels() { registerModelItem(BioFrame.itemExtractor); } public void registerModelItem(Item item) { ModelResourceLocation model = new ModelResourceLocation(BioFrame.modID+":"+item.getUnlocalizedName().substring(5),"inventory"); System.out.println("Registering: "+model); Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, model); } public void registerModelSubsets(Item item, String[] subSets) { ModelBakery.addVariantName(item, subSets); } } Item Class package com.scors4.bioframe.common.items; import java.util.List; import com.scors4.bioframe.common.BioFrame; import com.scors4.bioframe.common.References; import com.scors4.bioframe.common.elements.EnumElement; import net.minecraft.client.resources.model.ModelResourceLocation; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; public class ItemExtractor extends Item { private static int maxLoad = 100; public ItemExtractor() { super(); this.setMaxDamage(0); this.setMaxStackSize(1); this.setHasSubtypes(false); } public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) { if(!isLoaded(stack)) { setLoaded(stack, true); setElement(stack, EnumElement.FIRE); } loadAmount(stack, 25); return stack; } @Override @SideOnly(Side.CLIENT) public ModelResourceLocation getModel(ItemStack stack, EntityPlayer player, int useRemaining) { if(!isLoaded(stack)) { return null; } else { System.out.println(ItemMultiModels.getInstance().getExtractor(0)); return ItemMultiModels.getInstance().getExtractor(0); } } public void addInformation(ItemStack stack, EntityPlayer player, List tooltip, boolean advanced) { tooltip.add("Element loaded: "+getElement(stack).getLocalName()); tooltip.add("Amount: "+getAmountLoaded(stack)); } public boolean isLoaded(ItemStack stack) { NBTTagCompound tag = getTag(stack); return tag.getBoolean("IsLoaded"); } public boolean setLoaded(ItemStack stack, boolean value) { NBTTagCompound tag = getTag(stack); tag.setBoolean("IsLoaded", value); writeTag(stack, tag); return value; } public void loadAmount(ItemStack stack, int amt) { NBTTagCompound tag = getTag(stack); int lAmt = tag.getInteger("Amount"); if(lAmt + amt > 100){tag.setInteger("Amount",100);} else tag.setInteger("Amount", lAmt + amt); writeTag(stack, tag); } public void onCreated(ItemStack stack, World world, EntityPlayer player) { NBTTagCompound tag = getTag(stack); tag.setBoolean("IsLoaded", false); writeTag(stack, tag); } public int getColorFromItemStack(ItemStack stack, int renderPass) { NBTTagCompound tag = getTag(stack); if(renderPass > 0 && tag.getBoolean("IsLoaded")) { EnumElement element = EnumElement.valueOf(tag.getString("Element")); return element.getHexColor(); } else return 0xFFFFFF; } public void setElement(ItemStack stack, EnumElement element) { NBTTagCompound tag = getTag(stack); tag.setString("Element", element.toString()); } public EnumElement getElement(ItemStack stack) { NBTTagCompound tag = getTag(stack); if(tag.getBoolean("IsLoaded")) { return EnumElement.valueOf(tag.getString("Element")); } else return EnumElement.BASIC; } public int getAmountLoaded(ItemStack stack) { NBTTagCompound tag = getTag(stack); if(isLoaded(stack)) return tag.getInteger("Amount"); else return 0; } public NBTTagCompound getTag(ItemStack stack) { NBTTagCompound tag = stack.getTagCompound(); if(tag == null) { tag = new NBTTagCompound(); stack.setTagCompound(tag); } return tag; } public void writeTag(ItemStack stack, NBTTagCompound tag) { stack.setTagCompound(tag); } } MultiModel storage based on MinecraftByExample package com.scors4.bioframe.common.items; import java.util.ArrayList; import com.scors4.bioframe.common.References; import net.minecraft.client.resources.model.ModelResourceLocation; public class ItemMultiModels { public static ItemMultiModels getInstance(){ if(instance==null){instance = new ItemMultiModels();} return instance; } private static ItemMultiModels instance; private ArrayList<ModelResourceLocation> extractors = new ArrayList<ModelResourceLocation>(); public ItemMultiModels() { extractors.add(new ModelResourceLocation(BioFrame.modID+":extractor1", "inventory")); } public ModelResourceLocation getExtractor(int id) { return extractors.get(id); } } Base JSON file - Extractor # THIS IS THE ITEM FILE. IT GOES IN THE assets/bioframe/models/item/ folder. # Generated using sheenrox82's JSON File Generator for Minecraft 1.8. { "parent": "builtin/generated", "textures": { "layer0": "bioframe:items/extractor" }, "display": { "thirdperson": { "rotation": [ -90, 0, 0 ], "translation": [ 0, 1, -3 ], "scale": [ 0.55, 0.55, 0.55 ] }, "firstperson": { "rotation": [ 0, -135, 25 ], "translation": [ 0, 4, 2 ], "scale": [ 1.7, 1.7, 1.7 ] } } } Example JSON file - Extractor 25% filled # THIS IS THE ITEM FILE. IT GOES IN THE assets/bioframe/models/item/ folder. # Generated using sheenrox82's JSON File Generator for Minecraft 1.8. { "parent": "builtin/generated", "textures": { "layer0": "bioframe:items/extractor" "layer1": "bioframe:items/extractor1" }, "display": { "thirdperson": { "rotation": [ -90, 0, 0 ], "translation": [ 0, 1, -3 ], "scale": [ 0.55, 0.55, 0.55 ] }, "firstperson": { "rotation": [ 0, -135, 25 ], "translation": [ 0, 4, 2 ], "scale": [ 1.7, 1.7, 1.7 ] } } } I would like to have multi-layer rendering as the second layer is going to have a dynamic color based on... well, you can see that in the item code. If anyone could lend a hand or point out where my stupid struck, please let me know! (Preferably in detail . I'm bright, but a little dense.)
-
Well, I'm tapping out with one last thought: Have you refreshed Eclipse's "Resource" folder? (F5 with it selected.) That's a common overlook for me which is why I ask.
-
What diesieben07 means is one of these: ResourceLocation texture = new ResourceLocation(Mod.modName, "textures/models/modelOrb.png") Then bind texture to the model. In your case, the location would be "textures/tools/ObsidianPickaxe.png"
-
[1.7.2] Partial Render/Render Clipping - can and how?
Sgmjscorp replied to Sgmjscorp's topic in Modder Support
Exactly, except most ways I can think of wouldn't work with anything more complex than a cube. My orb is roughly 7 pieces, though I'm debating on upping that to 13, pending the results of my findings with OpenGL clipping. Now, I can do really basic scaling on the z axis for individual pieces and probably get them to sync up but I was hoping I could find a simpler way, thus the partial rendering / render clipping. Render clipping planes would technically allow me to "fill" an orb by cutting off the top of a pre-rendered model and slowly raising that cut, rat hater than individual renders of each piece being synced up. -
[1.7.2] Partial Render/Render Clipping - can and how?
Sgmjscorp replied to Sgmjscorp's topic in Modder Support
Unfortunately, it's not a cube. As a cube, I'd consider it simply scaling from 0 to 1 in one of the axis. I can't seem to find any data specifically on clipping planes, but I'm still looking around. Thank you for the links, however. They'll help once I evolve from using Techne. -
Hi there. I'm wondering if it's possible (I believe it is) to create a model in minecraft and then have it partially render, like from the bottom to the top, gradually. I've Googled both of the terms in the title and can't think of any others that people would use to describe this. If it is possible, could someone point me in a direction or tell me what function(s) to look at? I honestly can't think of any vanilla models that do what I'm looking for without using the texture animation or textures based on damage. If it helps, the idea is making an orb that "fills" with liquid, but as we all know scaling a model from the center is more an air sort of thing. Any help would be appreciated. Thank you!
-
Conflicting Block ID - not your usual issue.
Sgmjscorp replied to Sgmjscorp's topic in Support & Bug Reports
dot... dot... dot... I don't have a comment now... Thank you. -
First off, before I even begin, I want to point out that yes I realize this COULD be IC2's bug, but I wanted to start here to make sure it isn't a forge-related issue that could affect more than just IC2. That being said when I launch my minecraft 1.6.2 with 1.6.2-Forge9.10.0.804 I get a pop-up regarding a block id conflict with IC2... Client> A conflicting block ID has been detected on your IndustrialCraft 2 Client> configuration file. Block IDs cannot be used more than once. Client> Client> Block with invalid ID: blockOreCopper Client> Invalid ID: 349 Client> Already occupied by: block net.minecraftforge.common.MinecraftForge$1@380e4452 (tile.ForgeFiller) I have tried changing this in the config, and the Invalid ID changes with it. I've narrowed my mods list down to forge and IC2, so I know it's one or the other. I'm hoping I can get clarification if it's Forge-caused, or if it's IC2-caused or if I'm just an idiot with too much time on his hands. Log from Forge Mod Loader's identifying mods to final line.
-
Yes! Forge compatibility good! I foresee a miniature manor in a cloud of wool! Even if it's only 20x20x20, that's 160x160x160 with little blocks and with Gulliver it's a mansion for kings and queens and many, many sheep. This is going to be so much fun