Everything posted by Draco18s
-
[1.12.2] Item transfer trouble
That's why I have this class: https://github.com/Draco18s/ReasonableRealism/blob/1.12.1/src/main/java/com/draco18s/hardlib/api/internal/CommonContainer.java I solved it once, never need to mess with it ever again.
-
Removing Vanilla Stuff???
It means that the field or method isn't static.
-
Get Block ID from BlockPos
You can use ==, but yes. Use the constants in Items class.
-
[1.12.2][SOLVED] Double Crop Blockstate Update
All of them except your seed, which unless you add it to those lists in the constructor (terrible idea). No. Probably because its using the default crop inspector, which is mature if the metadata value >= 7. You'll have to write your own inspector is my guess.
-
[1.12.2][SOLVED] Double Crop Blockstate Update
By the way: if(false && !world.isRemote) // Forge: NOP all this. Why do you still have that block it does nothing? Its also a terrible idea to use +10 as your UPPER/LOWER value. Metadata is limited by 16 states, meaning you're limiting your max age to 6, whereas if you used a single bit (+8) you could have max ages up to 8. It also means you can use bitwise logic instead (int age = meta & 7; int halfAsInt = meta & 8). this.seed = new CoreSeedFood(name, 3, this); You can't do this. You are not allowed to create items at this point in the startup process. How do you even register this item? The return value from setBlock is not useful in any capacity that I've ever seen. And after a lot of testing, I've determined the issue. This function is run when you use bonemeal: @Override public void onBlockAdded(World world, BlockPos pos, IBlockState state) { if(getHalf(state) == EnumCropHalf.LOWER) world.setBlockState(pos.up(), getDefaultState().withProperty(HALF, EnumCropHalf.UPPER), 2); } It does not run when the block updates.
-
[1.12.2]Block Variants not Rendering
With 1.13 just around the corner, it is no longer advised to use variants like this.
-
[1.12.2][SOLVED] Double Crop Blockstate Update
Yes, and what I'm saying is, your two-block crop isn't using one block to store its age. Its using two. That method can't deal with that.
-
[1.12.2][SOLVED] Double Crop Blockstate Update
This is not functionally useful. If the chunk the crop is in is not loaded, then the crop won't update. The blocks above the crop are always in the same chunk as the crop itself. if(!world.isAreaLoaded(pos, 1)) return; // Forge: prevent loading unloaded chunks when checking neighbor's light Nice to see you including the crop grow events if(ForgeHooks.onCropsGrowPre(world, pos, state, rand.nextInt((int) (25.0F / f) + 1) == 0)) Dollars to doughnuts this line isn't doing what you want: int i = getAge(state);
-
Why does forge create a custom class in ASMEventHandler
Its a common interface so that event handler methods don't need to be called with Reflection (which is slow).
-
[1.13.2] What's the most reliable up-to-date documentation for a beginner?
Be aware that Forge for 1.13 isn't stable yet.
-
Add NBTTag for Block
Singleton is the name of a pattern whereby there is only one object and it is referenced everywhere as needed. "Per block" is the "everywhere" If a TE won't work for you, you need a custom data studies that holds that information by coordinate. You will need to manage it yourself. It will be hard. You have no other options.
-
(1.13.2) No Such Method Issues
If you want a central mod around which all your other mods are linked, call it "Lib" or "Library" instead of core. (I did this, even as much as it pained me not to call my API bundle for my "hard stuff" collection "HardCore")
-
Add NBTTag for Block
Sounds like you're storing the data in a field of your block class. This will never work (as you've seen) because blocks are singletons. You must use a separate data structure, such as a Tile Entity.
-
Error with block properties in 1.13
You haven't correctly set up your block to have states. You need to override createBlockState.
-
Forge not finding texture+blockstate, but shows the right path?
https://github.com/BigBadE/AdvancedEnchantments/blob/master/src/main/java/bigbade/advancedenchantments/AdvancedEnchantments.java#L40 Why are you not using the ModelRegistryEvent?
-
[1.12.2] Shift clicking items into custom inventory just voids the item.
This is why I have this class: https://github.com/Draco18s/ReasonableRealism/blob/1.12.1/src/main/java/com/draco18s/hardlib/api/internal/CommonContainer.java
-
sky color in biome
It is the integer representation of a 255-255-255 color. 0 is black, 16777215 is white. Or if you prefer, 0xFFFFFF
-
MC 1.12.2 block hardness
Inside the registry event.
-
[1.12] World.getTileEntity returns null allthough TileEntity is loaded
You might also want to look into the Looking Glass mod. I don't know if it has been updated recently (XCompWiz has been pretty busy), but you might be able to examine it to see how it works. The whole point of Looking Glass was to provide a mod-friendly way of being able to render views of any location in Minecraft, including other dimensions.
-
HashMap in TileEntity being cleared?
You don't want to set anything here, what you have to do is query the side. Check if world#isRemote is false.
-
1.12.2 Use 2 blockstates
Either: 4 or fewer enum values Separate blocks
-
HashMap in TileEntity being cleared?
1. The server. Because the server has authority over the world. 2. You don't have to do anything.
-
[1.12] [SOLVED] How do I make a block unstackable?
You need a custom subclass of ItemBlock.
-
1.12.2 Use 2 blockstates
Blockstates aren't magic. They're just a more developer-friendly way of expressing the same information that has always been there: metadata. Metadata is still limited to 16 possible unique states, so with your current code you have a FACING value that has 4 distinct states. This means that your TIER value can only have 4 distinct states that fit within metadata. That said, you shouldn't be using metadata to store "different" blocks at this point. Once you update your mod for 1.13, you'll have to flatten those metadata values back into separate block instances, so you may as well just do that now.
-
[1.12.2] Item textures not loading for items that change texture with nbt data.
Is that IHasModel? Stop using it. It does nothing except make you retype the same lines over and over. All items need models, yes, ALL ITEMS which means that the interface is not special. Now if the interface is because the item has a custom mesh definition, that's fine (that's special). This means that the model you want isn't being registered and baked. This is common for custom mesh definition models. This is the chunk I use: https://github.com/Draco18s/ReasonableRealism/blob/1.12.1/src/main/java/com/draco18s/hardlib/client/ClientEasyRegistry.java#L184-L195 (and a mesh definition: https://github.com/Draco18s/ReasonableRealism/blob/1.12.1/src/main/java/com/draco18s/industry/item/ItemCastingMold.java#L89 ) It looks like the code you posted should perform similar operations on the right data.
IPS spam blocked by CleanTalk.