Jump to content
Search In
  • More options...
Find results that contain...
Find results in...


  • Posts

  • Joined

  • Last visited

Sataniq's Achievements

Tree Puncher

Tree Puncher (2/8)



  1. I shouldn't need to provide code. Anybody with half a brain can see what information I'm in need of by simply reading the post. I mentioned that I am unable to figure out how to programatically place a block facing a direction - self-explanatory. I need to place a block facing a specified direction, and I don't know how to do this. The model displays big black blotches, if you know about Minecraft's lighting system you would be able to provide some helpful insight into what causes that and how to get around it. And finally the model displays too large in the inventory. Again, fairly self explanatory. Just telling me my post isn't informative enough for you is not helpful, so therefore what was the purpose of your reply? My point being, I don't need to provide code. This isn't a "help me program my mod" thread, this is a simple "please help with this generic issue".
  2. So, I'm back with yet more problems To cut a long story short, I have a block which uses an OBJ model. I've got OBJ models figured out now for the most part. The issues are as follows: 1. I cannot for the life of me figure out this stupid BlockState nonsense, so I'm unable to programatically place a block facing a direction. 2. The model is larger than 1 block space, it's several block spaces large. This causes lighting issues (big dark blotches in seemingly random places). 3. The model is HUGE in the inventory. I would rather it was either invisible or used a different texture. This is a block that should not be obtainable by players anyway, and it doesn't need to show in mods like NEI. Does anyone have any advise to offer on how I can solve any/all of these problems? If so, you're a legend.
  3. Thanks, so I changed the code around a little, and now it works! I don't know why Forge's own events weren't loading the model properly, but it looks like I will be using your way of registering things from now on! You sir, are a legend, take 100 cookies Here's how I'm now registering the blocks: public static void RegisterAll() { RegisterBlock(CEILING_VENT, new ItemBlock(CEILING_VENT)); } @SideOnly(Side.CLIENT) public static void RegisterRenderers() { ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(CEILING_VENT), 0, new ModelResourceLocation(new ResourceLocation(DLIM.MODID, "block_ceiling_vent"), "inventory")); } private static void RegisterBlock(Block block, ItemBlock item) { ForgeRegistries.BLOCKS.register(block); ForgeRegistries.ITEMS.register(item.setRegistryName(block.getRegistryName())); }
  4. It seems to be accepting the file with/without the brackets now, and with/without the "default" section. I just don't see why it won't load the inventory item. I wish I knew how to override the inventory display item for it and just render a texture.
  5. I have tried that, same result this is really frustrating, the lack of errors in the log makes it a whole lot worse. If it could tell me what it's failing to find/load, that would be great.
  6. Without the brackets in the blockstate JSON file, that's what it was telling me. I changed the file to look like this: No errors, but still the same result - block renders fine, inventory item is a huge purple and black square. EDIT: It seems I can now remove the square brackets after adding the model definition for the "normal" variant, but the overall issue still remains
  7. Sure, be warned: I do it in a (slightly) strange way, however it's the way I prefer to do things and simplifies my job quite a lot. In my blocks class, I have the block defined: @GameRegistry.ObjectHolder(DLIM.MODID + ":block_ceiling_vent") public static final BlockCeilingVent CEILING_VENT = new BlockCeilingVent("block_ceiling_vent"); The block is then put into an array (all blocks will go here): public static final DBlock[] BLOCKS = { CEILING_VENT }; The blocks are then registered: public static void RegisterBlocks(final RegistryEvent.Register<Block> event) { final IForgeRegistry<Block> REGISTRY = event.getRegistry(); REGISTRY.registerAll(BLOCKS); } public static void RegisterItemBlocks(final RegistryEvent.Register<Item> event) { for (DBlock block : BLOCKS) block.RegisterItemBlock(event); } public static void InitializeModels(ModelRegistryEvent event) { for (DBlock block : BLOCKS) block.InitializeModel(); } DBlock is a custom class extending Block in which all my blocks will extend, and it looks like this (simplified, other stuff goes here but it's not relevant): public DBlock(String name, CreativeTabs tab, float hardness, float resistance, Material material, SoundType placeSound, MapColor mapColour) { super(material, mapColour); this.setUnlocalizedName(DLIM.MODID + ":" + name); this.setRegistryName(new ResourceLocation(DLIM.MODID, name)); this.setHardness(hardness); this.setResistance(resistance); this.setSoundType(placeSound); this.setCreativeTab(tab); } @SuppressWarnings("ConstantConditions") @Override public void RegisterItemBlock(final RegistryEvent.Register<Item> event) { System.out.println("Registering ItemBlock for " + getUnlocalizedName()); event.getRegistry().register(new ItemBlock(this).setRegistryName(this.getRegistryName())); } @SuppressWarnings("ConstantConditions") @Override @SideOnly(Side.CLIENT) public void InitializeModel() { ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(this), 0, new ModelResourceLocation(getRegistryName(), "inventory")); } The register events are called: @SubscribeEvent public static void registerItems(final RegistryEvent.Register<Item> event) { DBlocks.RegisterItemBlocks(event); } @SubscribeEvent public static void registerBlocks(final RegistryEvent.Register<Block> event) { DBlocks.RegisterBlocks(event); } And from the Client proxy: @Override public void PreInitialization(FMLPreInitializationEvent event) { OBJLoader.INSTANCE.addDomain(DLIM.MODID); super.PreInitialization(event); } @SubscribeEvent public static void RegisterModels(ModelRegistryEvent event) { DBlocks.InitializeModels(event); }
  8. After putting the brackets back in, I have noticed this: This is odd. Also after making the changes suggested, I am still met with the same results.
  9. I think it should have been mentioned that yes, I have an ItemBlock being registered for the block. Yes, it seems the mtlib had been replaced by usemtl, probably in my confusion while trying to fix the problem. As I said, I am following Forge's example, so as for why I am using brackets, and did the "inventory" part the way I did, see this. After removing the brackets, ALL of the errors have appeared. I'm specifically concerned by the fact that it's now looking in the ITEMS directory It also doesn't seem to want to find the material definition within the .mtl file (and yes, it's spelt correctly). Any ideas? Or could you possibly provide some of your code for how you get .OBJ files to work? (I think that'd be easier than me pestering you all night)
  10. Hello. So, I've started to dabble in the wonderful world of .OBJ. As someone who uses 3D modelling software, and has experience with .OBJ, this is how I'd rather create my models. I have created a block, that uses a .OBJ model. The block renders in the world just fine, but it does not render in the inventory. I've looked at Forge's example and made sure everything's done the same way, to no avail. (Image SHOULD be attached) I am getting only 2 errors in the log: and that's all. And this shouldn't be happening, because the .mtl file is right next to the .obj file, just as it is in the Forge example here. So I am made of questions. Here is the blockstate JSON: { "forge_marker": 1, "defaults": { "textures": {}, "model": "dlim:ceilingvent.obj" }, "variants": { "normal": [{}], "inventory": [{ "transform": "forge:default-block" }] } } The .OBJ file: The .MTL file: newmtl main map_Kd dlim:block_ceiling_vent Does anybody know how to either: Fix the item in the inventory OR for the inventory item, render a texture from the assets, preferrably without creating an item for it?
  11. Hello. So it seems to me, a TileEntity that implements ITickable and overrides the update() function is having some side-related issues. When I open a GUI on the client side my custom Gui class renders the background and overlays as expected. The problem arises if I make the TileEntity update check if the world.isRemote(). If I put the whole update code inside a if (!world.isRemote()) { ... } the TileEntity seems to update just fine, but the GUI; which is pulling values from a reference to the TileEntity; seems to not be getting those values. I would very much like to only have my machine updating on the server side, and have the GUI be able to display it's power level, status etc like it does just fine with no side checking. How would you reccommend I go about fixing this issue? And an explanation as to what causes it would be appreciated, because it makes no sense to me as the values are being set and read from in a normal manner, so I would assume all the values in the TileEntity are being created as copies on both the client and server sides? Please enlighten me, it's been a long week!
  12. Ooookayyy then... so putting a System.out.println() at the top of the read and write to NBT functions has fixed the issue. I will not question it, I will just go with it and assume major-league B.S. Did I facedesk? You bet I did!
  13. Well, the title says it all, really. I have a TileEntity which is saving its NBT data (supposedly), but it won't load anything. Here's the code (only the parts you need to see): private static final String NBTTAG_INVENTORY = "inventory"; private ItemStackHandler inventory = new ItemStackHandler(4) { @Override protected void onContentsChanged (int slot) { TileEntityCrusher.this.markDirty(); } }; @Override public NBTTagCompound writeToNBT (NBTTagCompound compound) { super.writeToNBT(compound); compound.setTag(NBTTAG_INVENTORY, this.inventory.serializeNBT()); System.out.println("Saved crusher inventory"); return compound; } @Override public void readFromNBT (NBTTagCompound compound) { if (compound.hasKey(NBTTAG_INVENTORY)) { this.inventory.deserializeNBT(compound.getCompoundTag(NBTTAG_INVENTORY)); System.out.println("Loaded crusher inventory"); } else { System.err.println("ERROR: Could not load crusher inventory"); } super.readFromNBT(compound); } As you can see, I'm using the output stream to log when the inventory is saved/loaded. All I see in the console is that it has saved, so the writeToNBT() is working. But then if I leave and re-join the world, I see NOTHING about loading, not a message saying it's loaded the inventory OR an error message saying it couldn't... nothing. The TileEntity loses its inventory every time. This is very frustrating, and I'm using the same code as my test project, where this worked just fine. What could be causing this mysterious and stupid behaviour? And yes, the TileEntity is registered... and no, I see no errors in the console.
  14. Sooo, yeah. I have a machine, which has taken an entire day to get to work properly, and I would like to display the machine's "status" as text on the container GUI. Problem is, the text isn't updating. It's being updated in the TileEntity, but when using drawGuiContainerForegroundLayer(), the text does not change. How can I remedy this? Also, how does one properly go about decreasing the text size?
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.