Everything posted by Choonster
-
[1.12] Item texture not working
You can see some examples in my mod's init classes.
-
[SOLVED] [1.12] Prevent Forge looking for block models with vanilla TESR?
Minecraft calls BlockModelShapes#registerBuiltInBlocks for the shulker box Blocks, which means that BlockStateMapper#getBlockstateLocations and BlockStateMapper#getVariants return an empty Set/Map respectively when called with one of the Blocks. You can achieve the same result by implementing IStateMapper#putStateModelLocations to return an empty Map (using Collections.emptyMap) and registering an instance in ModelRegistryEvent using ModelLoader.setCustomStateMapper.
-
How to check if material can be replaced.
You're checking if the Block is both replaceable and is equal to Blocks.GRASS, which will never be true because Blocks.GRASS isn't replaceable. You can use the && (and) operator to combine multiple boolean expressions (like the conditions of the four if statements) into one. Don't call World#getBiomeForCoordsBody directly, call World#getBiomeForCoords instead. This allows the WorldProvider to return the appropriate Biome (this may or may not call World#getBiomeForCoordsBody). Don't compare to Blocks.AIR directly, use Block#isAir to support modded air-like blocks.
-
[1.11.2] Texture Problems
You needed to change the blockstates file and the model, not the registration class. RegUt.registerBlocks and RegUt.regItems are broken since they only register the Blocks/Items on the physical client, but this needs to happen on both physical sides. Model registration must be done in a separate client-only class to avoid crashing the dedicated server. You should be using registry events instead of registering things in preInit. GameRegistry.register is no longer accessible in 1.12, so this will make it easier to update. The log you linked isn't the FML log.
-
[1.12] Modelvariants for facing different directions won't show up [solved]
Items load their models from either an item model file (the normal location) or a variant of a blockstates file (the blockstate location). You need to provide at least one model for every item. That's correct. Display transformations are rotation, translation and scale operations applied to the model when it's rendered as an item in various contexts (e.g. left/right hand, GUI, item entity, etc.).
-
[1.11.2] Texture Problems
You need to include your mod ID as the domain of the model and texture paths, i.e. "<modid>:<model_name>" and "<modid>:<texture_path>". Textures need to in PNG format, not JPEG. Is the block called fooblock or memeblock? Your files are apparently called fooblock, but the blockstates file uses the memeblock.json model and the model uses the memeblock.png texture. In future, the FML log (logs/fml-client-latest.log in the game directory) will tell you why models/textures failed to load. If you don't know how to interpret the errors, post the full log using Gist or Pastebin when asking for help.
-
[SOLVED] Is it possible to save a block tile entity inventory when the block is broken?
Override Block#getDrops to do the following: Write the TileEntity to NBT. Create the ItemStack that will be dropped. Set the "BlockEntityTag" key of the ItemStack's compound tag to the compound tag containing the TileEntity data. Add the ItemStack to the drops list. The TileEntity is normally removed from the world before Block#getDrops is called, so you need to delay its removal by overriding BlockFlowerPot#removedByPlayer and BlockFlowerPot#harvestBlock. See Forge's patch to BlockFlowerPot for an example of this. When an ItemBlock (or ItemBlockSpecial) is placed by a player and the ItemStack has a compound tag at the "BlockEntityTag" key, it will automatically call TileEntity#readFromNBT with the compound tag (unless TileEntity#onlyOpsCanSetNbt returns true and the player isn't an op).
-
[1.12] Removing vanilla Recipes
Which version of Forge are you using? Post your code and the full stacktrace of the exception.
-
[1.12] Removing vanilla Recipes
The recipe registry (unlike other registries) is modifiable, so you can actually remove a recipe using IForgeRegistryModifiable#remove. Any advancement that rewards the recipe will throw a syntax exception (spamming the log) if you do this, though.
-
Custom glass has xray effect
You need to have a solid understanding of Java before making a mod. As it says in this section's description, we're not here to help with basic Java problems. Java has a tutorial on parameters here.
-
Custom glass has xray effect
Do you know what a parameter is? This is a basic Java concept.
-
[1.12] Modelvariants for facing different directions won't show up [solved]
The logging of missing models was broken in Forge 1.12-14.21.0.2363 (commit dc043ac) and fixed in Forge 1.12-14.21.1.2390 (commit ede05a2). After updating Forge, it was easy to identify the issues with the turret blockstates file: You were using strings instead of integers for the x and y rotations. The first variant was misspelled (facung=up rather than facing=up). The first variant has an invalid block/ prefix in its model location. Some other issues I noticed: There's no item model for the turret in the repository. IanusIncHq uses Java's Logger instead of log4j's (which is what Minecraft uses). CustomBlock has a missing semicolon. The turret and small super condensator models extend minecraft:block/cube_all but override its elements and don't specify the all texture. They should extend minecraft:block/block instead, since it provides the standard display transformations without providing any elements. The other non-cube models don't extend any model and don't specify any display transformations, they should extend minecraft:block/block. I've fixed these issues and pushed the changes to GitHub. You can view and/or merge the changes here.
-
1.10.2 How to make your block flammable
It was renamed to Biome in 1.9.
-
[SOLVED] Is it possible for users to mark a thread as solved?
Edit the first post of a thread and you'll be able to edit the thread title, including adding [SOLVED] to it. There's no actual mechanism for marking threads as solved, it's just editing the title.
-
[1.11.2] Items with Metadata missing texture
That's not the case.
-
Custom glass has xray effect
Which Minecraft version are you using? I'm guessing you're using a version where Block#isOpaqueCube has an IBlockState parameter, which your isOpaqueCube method doesn't. Always annotate override methods with @Override so you get a compilation error when they don't actually override a super method. You should also use your IDE to auto-generate override methods with the correct signature and annotation. In future, please post code using a code block (the <> icon) or on Gist/Pastebin.
-
1.12 Override did not have an associated owner object
I've submitted an issue for this here. Being able to override an object from your own mod doesn't make much sense, so it should crash with a more obvious exception when you attempt to do so.
-
Adding a client side only command
Extend CommandBase, implement IClientCommand and register it by calling CommandHandler#registerCommand on ClientCommandHandler.instance.
-
1.10.2 How to make your block flammable
BlockFire.init sets the flammability and spread speed of vanilla Blocks.
-
Call method when block is watched by player
TileEntity#getUpdateTag is called when a Chunk is being sent to players and the returned compound tag is included in the SPacketChunkData. ChunkWatchEvent.Watch is fired when a player starts watching a Chunk, directly after the SPacketChunkData has been sent.
-
1.12 Override did not have an associated owner object
You're overriding expanded:dark_oak_bed_item (i.e. registering a new value with the same name), but the old value doesn't have an OverrideOwner associated with it. If I understand Forge's registry code correctly, this would happen when the new value has the same owner (mod ID) as the old one (because the new OverrideOwner and value replace the old OverrideOwner and value in the ForgeRegistry#owners BiMap). Are you registering this Item in multiple places? As Draco said, we need to see more of your code.
-
1.12 Override did not have an associated owner object
Post your code, specifically where you register an override of a vanilla registry entry. Also post the FML log so we can see exactly what the message is warning about. This is related to the new override system provided by Forge's registries, which replaces the old substitution alias system. It's not related to overriding a method.
-
[1.10.2] Crash on inserting items
ItemStacks can be null in 1.10.2 and earlier, so your ItemStackHandler#insertItem override should be annotated with @Nullable, not @Nonnull. This also applies to the ItemStack parameter. It's only in 1.11 and later that ItemStacks can't be null. This particular crash is triggered by IDEA's automatic runtime null-checking. For methods that you control, fix the annotations or the code so that @Nonnull methods don't return null values. For methods that you don't control, you can disable the null-checking as described here.
-
1.10.2 How to make your block flammable
What do you mean? Do you know how to override a method? If the flammability/spread speed is always the same, you can simply return a constant value and ignore the arguments.
-
[1.12] Modelvariants for facing different directions won't show up [solved]
Please include the files required to build the mod in the repository: build.gradle, gradlew, gradlew.bat and the gradle directory.
IPS spam blocked by CleanTalk.