-
Posts
1689 -
Joined
-
Last visited
-
Days Won
1
Everything posted by SanAndreaP
-
Then either use .964 for MC 1.6.4 or use the latest build for MC 1.7.2. They both come with ForgeGradle, which is the way of the future.
-
No, just no. Since I'm nice, this is the proper way to do it: In your block class: setBlockTextureName("myAssetsFolder:myTexture"); where myAssetsFolder is the name of your folder within the assets folder (which you renamed to minecraft) and myTexture is the name of the texture file (w/o extension) within myAssetsFolder/textures/blocks/
-
can you give us the new packet code and possibly your pipeline class (the type class of MHFCMain.pipe)?
-
What is better models or drawing with tesselators?
SanAndreaP replied to Mecblader's topic in Modder Support
I would prefer Tessellators over Models for tile entities (In fact, I'm trying to convert my TE-Models into tessellator renderers), since if you look at the render method within the ModelRenderer class (the class of a cube from the model), it's a bit heavy; here's a snippet of the render code: if (!this.isHidden) then if (this.showModel) then if (!this.compiled) then this.compileDisplayList(par1); GL11.glTranslatef(this.offsetX, this.offsetY, this.offsetZ); if (this.rotateAngleX == 0.0F && this.rotateAngleY == 0.0F && this.rotateAngleZ == 0.0F) then if (this.rotationPointX == 0.0F && this.rotationPointY == 0.0F && this.rotationPointZ == 0.0F) then GL11.glCallList(this.displayList); if (this.childModels != null) then for (i = 0; i < this.childModels.size(); ++i) do ((ModelRenderer)this.childModels.get(i)).render(par1); else ... etc. ... -
You need to have a standard constructor without parameters, like public Packet02Tigrex() {...} It happened to me, too. The constructor can be completely empty.
-
event.entityPlayer.openContainer.getClass().toString().equals("class net.minecraft.inventory.ContainerWorkbench") Use container.getClass().equals(ContainerWorkbench.class) instead of this mess. It checks if the class of the instance is the same as the class you've provided event.entityPlayer.displayGUIWorkbench(0, 0, 0); Use event.entityPlayer.closeScreen(); as this is the proper way to close a GUI. Also are you intending on removing the System.out.println's?
-
[SOLVED][1.7.2]Recommendations for packet payload content/format
SanAndreaP replied to jabelar's topic in Modder Support
1) I always only send a packet if something has changed, and then only the data I need. I tend to use "sub-IDs" where a Packet can set different values (e.g. I have a multi-page GUI, so I just use 1 Packet and send the page-ID and the data the page contains, which is always an int) 2) If you mean the order you put values into the byte stream, I do it logically (like if I send a packet with X/Y/Z coordinates, I put those (together, when there is more data than that) in this order), but you can pretty much do whatever you want. 3) You can use ByteBuf.writeBoolean 4) For Strings use ByteBufUtils.writeUTF8String(bytebuf, "a string"), respective ByteBufUtils.readUTF8String(bytes) You can also write/read ItemStacks and NBTTags with the ByteBufUtils class -
I think it's better to use the tessellator directly instead of the Model thingy, since each time you call render() on each part (cube) of your model, it does this: - check if it's not hidden then - check if it's visible then - check if it's not compiled then - compile display list . else - translate the offset - check if it's rotate angles X, Y and Z are equal to 0.0F then - check if it's rotation points X, Y and Z are equal to 0.0F then - use displayList - check if it has child parts then - render childs . end if . else - translate to rotation points * par1 - use displayList - check if it has child parts then - render childs . end if - counter-translate to rotation points * par1 . end if etc... To look at what exactly it does, look up the render() method in the ModelRenderer class
-
Don't use the LanguageRegistry anymore, use StatCollector.translateToLocal(unlocalizedString) instead
-
You register your array like any other icon, just with multiple textures. Here, have an example from my item: https://github.com/SanAndreasP/EnderStuffPlus/blob/master/java/de/sanandrew/mods/enderstuffplus/item/ItemCustomEnderPearl.java#L96-L103
-
You need to subtract 256 from your itemlolID after getting the config value. It's because item ids below that value were reserved for blocks (before the possible block number increased to 4096). Since 1.7.2 you don't have to worry about that stuff anymore anyways.
-
Try overriding getRecord() in your item and return pixelmoncore:rival as String
-
Are you sure? I'm pretty certain that ItemStack NBT is automatically synced to the client, as I've used NBT to determine item icon before without doing any such thing. Never even heard of that method, to be honest... Oh, you're right, it already returns true as standard. So no need to override it then.
-
Spawning a monster(entity) during full moon.
SanAndreaP replied to KeeperofMee's topic in Modder Support
The method you're looking for is worldObj.getCurrentMoonPhaseFactor() and it returns 1.0F if it's full moon. Also there's no need for an event for a custom entity, just override getCanSpawnHere() and check for the moon phase there -
1) use EntityJoinWorldEvent, check for the corresponding mob and kill it. 2) AFAIK there is a way to force a chunk to stay loaded, but it has limitations (there's a max number of possible loaded forced chunks at the same time defined in the forge.cfg) 3) override those and return false for both: public boolean canBeCollidedWith() public boolean canBePushed()
-
Ok. Well, the Block list no longer exists as it was, but it's much easier since you can access the blocks directly using "Blocks.{block_name}". I suppose you could say that "Blocks" IS "blocksList", just not in array form. however, you can't set them to null, since every field in there is final. The only way I see here is to utilize ASM transformers and hook into RegistrySimple.getObject(Object par1Obj) Block.registerBlocks() and replace the constructor calls with your own ones.
-
You should also override getShareTag() and return true here, if you want to share the NBT data with the client (in this case it's neccessary, since the Icon is clientside only)
-
Is there a way to detect when a player right clicks on an item?
SanAndreaP replied to Mecblader's topic in Modder Support
I doubt this would work, since technically, the EntityItem has no collision bounding box. The only way to do this is to make a new EntityItem class (and register it properly, like any other custom entity(!)), give it a collision box and override the interact(...) method. To utilize the custom EntityItem, use the EntityJoinWorldEvent, check there if you're on the serverside, the entity spawned is an EntityItem, check if it's containing item is the item you want and last but not least check if it's not your custom entity. If all conditions are met, copy the containing ItemStack and the entities data from the original into a new instance of your custom entity, kill the original and finally spawn your new instanciated entity. This is how I did it with the event (it's still 1.6, but it should be the same in 1.7; not meant to be copied blindly, though!) https://github.com/SanAndreasP/EnderStuffPlus/blob/master/java/sanandreasp/mods/EnderStuffPlus/registry/event/EntityJoinWorldEventInst.java -
[lmgtfy]traincraft[/lmgtfy] first result If it's not updated by the creator / maintainer, there's no update and you have to wait.
-
Yes, seems like my ChannelHandler caused it when I initialized it statically like static final Inst var = new Inst(params); Now the only problem persisting is that it seems that I can't use COMPUTE_FRAMES flag for the ClassWriter when I convert the transformed class back into a byte array... And again, only in a non-dev environment, in eclipse, everything works as expected. It just gives me an InvocationTargetException caused by a ClassNotFoundException
-
I solved it by adding @SortingOrder(1001) above my FMLLoadingPlugin (thank you diesieben07) So I've got a strange problem with my current coremod, which I try to update to 1.7.2. I use several ASM transformers and they seem to run fine and do the correct changes (I wrote the classes as files and opened them with JD-GUI, every patch is correctly applied) However when I pack / build my coremod, put it into the mods folder and try to start Minecraft, I get a NullPointerException. The byte array supplied by the transform method is null (I put a println with the byte array and it printed null) Here some details: Forge version used: 10.12.1.1061 Crash report: https://gist.github.com/SanAndreasP/a18ef19f6f5efce65464 whole log file: (seems to be cut off and doesn't show the error, idk why) https://gist.github.com/SanAndreasP/4a6d737d043276f4b50e offending class: https://github.com/SanAndreasP/SAPManagerPack/blob/master/java/de/sanandrew/core/manpack/transformer/TransformPlayerDismountCtrl.java#L23 whole source: https://github.com/SanAndreasP/SAPManagerPack/tree/master/java/de/sanandrew/core/manpack
-
for the sound thing: I scooped around the MC source and the only way to stop a sound from playing is the SoundSystem.stop() method: Minecraft.getMinecraft().sndManager.sndSystem.stop(s); where s is a String representing the currently playing sound name and after that remove the key s from the playingSounds hashset within sndManager, where you would need to use reflection in order to do the latter one since the field is private. The second one, just set the hurtResistantTime variable within the entity instance to 0 before attempting to damage the entity.
-
Suddenly missing textures in the newest forge?
SanAndreaP replied to SureenInk's topic in Modder Support
gemsmod:amethystblock and I already see the problem The name before the colon must be equal to the resource folder: gemsmod:amethystblock main/resources/gemsmod/textures/blocks