
DarkGuardsman
Forge Modder-
Posts
1479 -
Joined
-
Last visited
Everything posted by DarkGuardsman
-
I use to know how to do this but have long forgotten. How would i sync my tileEntity data from client too server to be used by client for GUIs, block animations, and other things. I know it involves Packets but i'm not sure where to start on coding it. So any help is nice especial tutorial links, code snips, and explanations of the code.
-
Possible to add different models to each meta data?
DarkGuardsman replied to happyPenguin's topic in General Discussion
I've seen forestry do this though i don't know how, but off the top of my head you could just have the one model contain all models. Then have the render code render each part of the model by itself. -
Load texture from outside mod_xx.zip
DarkGuardsman replied to DarkGuardsman's topic in General Discussion
Ty that will take some time for me to get it working how i want it, but if it works i can move on to the next step of my mod. Which is actual downloading the textures if they are not found -
Load texture from outside mod_xx.zip
DarkGuardsman replied to DarkGuardsman's topic in General Discussion
Since this doesn't seem to be working does anyone know how to insert file into a zip using java code. -
Load texture from outside mod_xx.zip
DarkGuardsman replied to DarkGuardsman's topic in General Discussion
was the same as renderBiped which i have tested the this on. If loaded from inside my mod it renders just fine,but loaded from outside it doesn't load right.But here is my render class anyways: public class RenderGuard extends RenderLiving { protected ModelBiped modelBipedMain; protected float field_40296_d; public RenderGuard(ModelBiped par1ModelBiped, float par2) { this(par1ModelBiped, par2, 1.0F); this.modelBipedMain = par1ModelBiped; } public RenderGuard(ModelBiped par1ModelBiped, float par2, float par3) { super(par1ModelBiped, par2); this.modelBipedMain = par1ModelBiped; this.field_40296_d = par3; } protected void renderEquippedItems(EntityLiving par1EntityLiving, float par2) { super.renderEquippedItems(par1EntityLiving, par2); ItemStack var3 = par1EntityLiving.getHeldItem(); if (var3 != null) { GL11.glPushMatrix(); this.modelBipedMain.bipedRightArm.postRender(0.0625F); GL11.glTranslatef(-0.0625F, 0.4375F, 0.0625F); float var4; IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(var3, EQUIPPED); boolean is3D = (customRenderer != null && customRenderer.shouldUseRenderHelper(EQUIPPED, var3, BLOCK_3D)); if (var3.itemID < 256 && (is3D || RenderBlocks.renderItemIn3d(Block.blocksList[var3.itemID].getRenderType()))) { var4 = 0.5F; GL11.glTranslatef(0.0F, 0.1875F, -0.3125F); var4 *= 0.75F; GL11.glRotatef(20.0F, 1.0F, 0.0F, 0.0F); GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); GL11.glScalef(var4, -var4, var4); } else if (var3.itemID == Item.bow.shiftedIndex) { var4 = 0.625F; GL11.glTranslatef(0.0F, 0.125F, 0.3125F); GL11.glRotatef(-20.0F, 0.0F, 1.0F, 0.0F); GL11.glScalef(var4, -var4, var4); GL11.glRotatef(-100.0F, 1.0F, 0.0F, 0.0F); GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); } else if (Item.itemsList[var3.itemID].isFull3D()) { var4 = 0.625F; GL11.glTranslatef(0.0F, 0.1875F, 0.0F); GL11.glScalef(var4, -var4, var4); GL11.glRotatef(-100.0F, 1.0F, 0.0F, 0.0F); GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); } else { var4 = 0.375F; GL11.glTranslatef(0.25F, 0.1875F, -0.1875F); GL11.glScalef(var4, var4, var4); GL11.glRotatef(60.0F, 0.0F, 0.0F, 1.0F); GL11.glRotatef(-90.0F, 1.0F, 0.0F, 0.0F); GL11.glRotatef(20.0F, 0.0F, 0.0F, 1.0F); } this.renderManager.itemRenderer.renderItem(par1EntityLiving, var3, 0); if (var3.getItem().requiresMultipleRenderPasses()) { for (int x = 1; x < var3.getItem().getRenderPasses(var3.getItemDamage()); x++) { this.renderManager.itemRenderer.renderItem(par1EntityLiving, var3, x); } } GL11.glPopMatrix(); } } protected void renderName(EntityGuardBase par1EntityGuard, double par2, double par4, double par6) { if (Minecraft.isGuiEnabled() && par1EntityGuard != this.renderManager.livingPlayer) { float var8 = 1.6F; float var9 = 0.016666668F * var8; float var10 = par1EntityGuard.getDistanceToEntity(this.renderManager.livingPlayer); float var11 = par1EntityGuard.isSneaking() ? 4.0F : 32.0F; if (var10 < var11) { String var12 = par1EntityGuard.getRenderedName(); if (!par1EntityGuard.isSneaking()) { if (par1EntityGuard.isPlayerSleeping()) { this.renderLivingLabel(par1EntityGuard, var12, par2, par4 - 1.5D, par6, 64); } else { this.renderLivingLabel(par1EntityGuard, var12, par2, par4, par6, 64); } } else { FontRenderer var13 = this.getFontRendererFromRenderManager(); GL11.glPushMatrix(); GL11.glTranslatef((float)par2 + 0.0F, (float)par4 + 2.3F, (float)par6); GL11.glNormal3f(0.0F, 1.0F, 0.0F); GL11.glRotatef(-this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F); GL11.glRotatef(this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F); GL11.glScalef(-var9, -var9, var9); GL11.glDisable(GL11.GL_LIGHTING); GL11.glTranslatef(0.0F, 0.25F / var9, 0.0F); GL11.glDepthMask(false); GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); Tessellator var14 = Tessellator.instance; GL11.glDisable(GL11.GL_TEXTURE_2D); var14.startDrawingQuads(); int var15 = var13.getStringWidth(var12) / 2; var14.setColorRGBA_F(0.0F, 0.0F, 0.0F, 0.25F); var14.addVertex((double)(-var15 - 1), -1.0D, 0.0D); var14.addVertex((double)(-var15 - 1), 8.0D, 0.0D); var14.addVertex((double)(var15 + 1), 8.0D, 0.0D); var14.addVertex((double)(var15 + 1), -1.0D, 0.0D); var14.draw(); GL11.glEnable(GL11.GL_TEXTURE_2D); GL11.glDepthMask(true); var13.drawString(var12, -var13.getStringWidth(var12) / 2, 0, 553648127); GL11.glEnable(GL11.GL_LIGHTING); GL11.glDisable(GL11.GL_BLEND); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glPopMatrix(); } } } } public void renderGuard(EntityGuardBase par1Entity, double par2, double par4, double par6, float par8, float par9) { double var13 = par4 - (double)par1Entity.yOffset; super.doRenderLiving(par1Entity, par2, var13, par6, par8, par9); } public void doRender(Entity par1Entity, double par2, double par4, double par6, float par8, float par9) { this.renderGuard((EntityGuardBase)par1Entity, par2, par4, par6, par8, par9); } protected void passSpecialRender(EntityLiving par1EntityLiving, double par2, double par4, double par6) { this.renderName((EntityGuardBase)par1EntityLiving, par2, par4, par6); } } If you need to look at the rest of the code here is my github repo https://github.com/DarkGuardsman/GSM-Guardsman -
Load texture from outside mod_xx.zip
DarkGuardsman replied to DarkGuardsman's topic in General Discussion
Ty but getting the file path it not the issue. Its seem minecraft knows where it is and loads it. However, it does seem to apply the texture to the NPC. Or maybe its not loading them correctly now that i think of it. -
Load texture from outside mod_xx.zip
DarkGuardsman replied to DarkGuardsman's topic in General Discussion
hmm but texture packs are inside zip files and my textures are not. I will look though. -
For my mod Guardsman i'm trying to allow players too add custom NPC texture to a folder outside of my mod.zip. The problem is the texture is loaded in & given an ID but doesn't show on the NPC. If i load from inside the mod it works just fine and everything renders. From outside i get the white 'texture missing' texture. Anyone know why and how to solve this? Here is the code though i don't think its the issue public String getTexture() { String textureName = Minecraft.getMinecraftDir() + "/Config/Guardsman/NpcTextures/" + getTeam() + getProfessionsName() + ".png"; File textureFile = new File(textureName); if(textureFile.exists()) { return textureName; } else { //Ignore, this is for another part that will download the texture from an SMP server if missing. /** if(worldObj.isRemote) { String url = getServerFile() + "/config/Guardsman/textures/"; String fileName = getTeam() + getProfessionsName() + ".png"; String saveLoc = Minecraft.getMinecraftDir()+"/config/Guardsman/textures/"; FileManager.download(url, fileName, saveLoc); } **/ return "/mob/char.png"; } }
-
I was thinking of making it so the player had to wear protective armor in order to walk around in it. Plus have a limited air supply. Though if you don't mind i can code it myself if you want to work on something else.
-
hmm seems easy enough though if i do add it to my server i might change its look and add special conditions to spread. My idea is too add it only to the nether world that way its no so bad for lag. Maybe just add it to the world generator for the nether to replace air.
-
NullPointerException With all forge mods...
DarkGuardsman replied to Icet44's topic in General Discussion
A) wrong section, there is a bug reporting section B) that looks to be an issue with adding IC2 armor. Have you made sure you have the correct forge version for the IC2 version your using. -
How much extra load does this place on a computer? I really like the idea and want to use it on SMP to make it hard for players to survive. think i can look at your source code and see about making it smp for you?
-
either do a tick count function or Boolean is song done function.
-
done right that code could be used to make cool environmental lighting effects. since the player could think the air is green or red though its still giving off white light. also too suffocate the player or add strange effects too the player like reduced speed, jumping or increase damage taken.
-
I think so but try looking at how minecraft does it might help
-
Send Image using forge packets?
DarkGuardsman replied to DarkGuardsman's topic in General Discussion
Yes but i'm trying to have a folder server side that contains custom Guard texture for each server instance. I can get them to download using a url just fine but i don't want to have servers need to host there images else where. In other word make it simple by having a folder that the mod read the image from and sends it too the client to be saved. Though i'm not sure how to do this now, i though about using forge packet system but how do i tell the client which image i'm sending it? Should i make the client request the image then the server send it to the client. The client expecting it would save it as the correct image? -
Is it possible to send an image using forge packet system. I have managed to download images using buffer streams and such using urls. However the only way i can get files download from my server mod is using ftp connection which need a password and username. problem with this is not every server owner will want to share there ftp password and username with every client. So i had an idea why not just send the image from the server instead of downloading from the server. Since forge has a built in system for passing data to the client why not see if i could use that. Is it even possible or do i have to make my own system for doing it.
-
yes, just inflict damage on tick. I don't think anything different happens when the damage source is suffocation anyways.
-
sending msg to player entering command
DarkGuardsman replied to DarkGuardsman's topic in General Discussion
I use this code in ICBM to send a chat message to a player. "player" is of course EntityPlayer. player.addChatMessage("Defuser out of electricity!"); That would work if i could get the player instance here is all i have to work with public boolean onServerCommand(String command, String sender, ICommandListener listener) { Though if i call right i think i can get the player instance from the name -
I have a team mod i'm working on for My guardsman mod series and it all works find. However, i want the player in game to receive a message after entering each command. I can get messages to show in the server console but not sure where too look on how to send to player SMP in game. I remember there being a forge handler for this but can't remember what it was. so can some one give me a link and maybe explain how to use it. Edit: too not make another thread i'm also looking for a way to find if a player placed a block.
-
I would be happy with player api if it at least had commits written in the code and tuts. I tried to use it the other week to improve my comecloser and team mod but got no where at all.
-
Just don't register them on load and they vanish. Use an if statement with block registers in them to determine if the block should be loaded or ignored. Should work just fine
-
not sure but an interesting idea to use for poison gases and such. Have you looked at player api i know it has a ton load of hooks to work with the player. Though there is no java docs from what i've seen making it hard to use.
-
hmm i have not done GUIs SMP yet but i know you need a gui handler, packet system and a few other changes. Try looking at some SMP mods on github. Here this is the smp src for UE which has working GUI blocks.