
imadnsn
Members-
Posts
186 -
Joined
-
Last visited
Everything posted by imadnsn
-
Look closely, the ModItems.init is called in client proxy, ModItems is not his mod class on another note, use what diesieben07 said.
-
I'm new to models and rendering of items and blocks in Minecraft although I'm familiar with other things. I'm trying to start on doing a custom model for an Item but I'm clueless and I don't know where to start off. I want to make an item that has different textures (specifically rod and cap) depending on materials, and I want it to be flexible (i.e. others can get to add new textures). I'm about to make a registry to add parts, with a client-only method to store the textures of the added parts (after being already registered ingame somehow) but that's another topic. Now what I want is to understand how would I go about making the model in the first place, I don't see valid mod code around (can't find?) because they're all outdated 1.8.9 or lower. I tried to dig through the code but a lot is happening there. What I'm trying to get is how the IBakedModel does the override thing, I saw that the clock implements an anonymous type of IItemPropertyGetter and I don't understand the 0.0-1.0 float usage and the mapping of it, I know it returns something about the time of the clock depending on world ticks, but the way the matching happens in ItemOverride is confusing. I also saw IModel and it's children in forge and it uses it for dynamic buckets, it made me confused to what I should use when. and what to implement to get my thing to work. Where should I start?
-
I haven't worked with AI before but I remember there was part of the AI where the entity would jump in the water you have to disable or exclude. Once there was a bug Minecraft that land mobs wouldn't be able to swim up and it was because this AI was disabled/was not included
-
[1.9.4] Weird graphical error when I load a custom item.
imadnsn replied to T-10a's topic in Modder Support
I remember I once had such a bug with my items where there were like "holes" on the side. I went to the png texture, selected the transparent part, filled it then made it transparent again and this fixed the problem. It may be something related to Minecraft dealing with "alpha" part of the texture when rendering. Not sure if this is the problem with you however. -
updateEntity() hint: on eclipse, you can see what methods you can override by pressing CTRL+SPACE inside the class body.
-
There would be no EntityPlayer instance, but if it is a client thing, I'm sure Minecraft instance would have currentScreen set to GuiMainMenu. If you want to know when a player leaves in multiplayer, you can use PlayerEvent.PlayerLoggedOutEvent.
-
[Solved][1.7.10] Rendering a cube with scale not working
imadnsn replied to Alron's topic in Modder Support
If you're using non-vanilla fields for rendering, you need to implement IEntityAdditionalSpawnData to the entity, as on client-side, it constructs using the constructor that only has a world argument, and won't have any non-vanilla data. -
It is apparently a problem with binding texture I guess it is here: protected void drawGuiContainerBackgroundLayer(float var1, int var2, int var3) { ... drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); mc.getTextureManager().bindTexture(containerTexture); ... } It is drawing before binding
-
[1.7.10]How do I implement soft-dependency recipes?
imadnsn replied to The_Fireplace's topic in Modder Support
I'm pretty sure that wasn't intended... I laughed a lot on this :D :D -
At least you now have a good name
-
[1.7.10] Getting metadata from Block object
imadnsn replied to querpressverband's topic in Modder Support
You are most probably doing it wrong, I insist on using World. If you can give us where exactly you want the metadata, show us some code. Some methods have metadata parameter, but it is not well documented, so the metadata might be in your code without you noticing. If you have an entity or a player or a tile entity, all have a worldObj instance that can be used in getting metadata (and light too). -
Now the name is correct (set up a lang file for a friendly name) Make sure the texture is correct. Its name must all be lowercase (some systems have case-sensitive folders), and depending on your code, it must be assets/mm/myslab.png It must also be 16x16 in size, like all block textures.
-
[1.7.10] Getting metadata from Block object
imadnsn replied to querpressverband's topic in Modder Support
you can't, Minecraft use one instance of Block class for all blocks of the same type, so it is almost static, metadata is not stored in Block, it is stored in World. There is usually one way or another to get the world, what are you trying to do? -
public String getFullSlabName(int par1) { if ((par1 < 0) || (par1 >= woodType.length)) { par1 = 0; } return getUnlocalizedName() + "." + woodType[par1]; } @Override public String func_150002_b(int par1) { return getFullSlabName(par1); }
-
[1.7.10] Weird onBlockActivated behavior vs metadata
imadnsn replied to JeanLucJ's topic in Modder Support
As long as you have the world and coordinates, you don't need metadata passed, world.getBlockMetadata is enough -
[1.7.2]Packets, and responses. I'm not understanding
imadnsn replied to hugo_the_dwarf's topic in Modder Support
IDK for datawatcher as I've never used it, but AFAIK it automatically updates the client (correct me if I'm wrong) The way I do it for when entity joins world is the way coolAlias have done it in his IExtendedEntityProperties tutorial. It took similar approach to what you've done, using EntityJoinWorldEvent. However, when the player dies, he will lose it properties (on server), so you should make some registry in the server that saves properties on death, it will restore in EntityJoinWorldEvent when the player respawns, the way coolAlias has done it doesn't save the properties, but rather resets if the server was shutdown, so the player must respawn before server shutdown for the properties to return, but I'm sure you can save it in a way or another. So pretty much you're doing it the right way, as long as you don't want anything to stay on death. -
The first thing I found is that func_150002_b should return your getFullName function it got ".name" only because you're returning null, another note is that in your getFullName, it shouldn't use super.getUnlocalizedName(), but rather just getUnlocalizedName(), as if you use the former the ItemStack will get Minecraft's slabs name not your mod's ones.
-
Post the code so we can help
-
[1.7.2]Packets, and responses. I'm not understanding
imadnsn replied to hugo_the_dwarf's topic in Modder Support
Exactly, in your case, the request is received server-side and the response is received client-side. Both are totally independent messages AFAIK both ways of sending are the same, but return new ClassResponsePacket(message,className); Is the logical way to do it. -
See SimpleNetworkWrapper tutorials in the Tutorials section of this forum's Modder Support
-
Extending that class would be enough, simply override ordinary methods for getting and registering IIcons for textures, see BlockStoneSlab and BlockWoodSlab for how they're implemented in them.
-
net.minecraft.block package contains every block, including BlockSlab
-
Look at BlockEvent.HarvestDropsEvent it is what you need, you can change the drops list and drop completely different items on different blocks. You can change the chance and everything. If you want the leaves to drop normally with shears, check the harvester's held item before editing drops. Be careful though, the harvester can be null occasionally and you have to do null checks.
-
[1.7.2]Packets, and responses. I'm not understanding
imadnsn replied to hugo_the_dwarf's topic in Modder Support
Make another new IMessage packet and handler and register them, on the onMessage of your ClassPackettHandler return a new packet just like how you do it for the network.sendToXXX methods.