Jump to content

Conraad

Members
  • Posts

    36
  • Joined

  • Last visited

Posts posted by Conraad

  1. use a combination of the two.

     

    Animation on obj in minecraft can be done, and it's not that hard.

     

    What you need to take into consideration is that the engine is not perfectly suited for obj so if you do start using obj's expect a massive drop in fps so that's why I use a combination certain thing's won't affect fps to much others may.

  2. Yep same problem here.

     

    Decided to update forge today and what a f* nightmare went back to the older version until someone can tell me what the hell went wrong, all I can think of is that before version .1045 the version of gradle is much older than the one forge are using now and just maybe it needs to either remove crap installed by the older version first or over write some settings, which does not happened and now have to be manually deleted or removed.

     

    But knowing absolutely nothing about gradle how it works etc, I would not really know if what i said makes any sense

     

    Also reinstalled version 1.7.2-10.0.1045 without any problems

  3. I want to check if there there isn't a block in specific coodinates

     

    Block block = world.getBlock(x, y, z);

     

    so have i to say

     

    if (block == null).... or if(block == Blocks.air)....  ??

     

    or is it the same?

     

    if(block .isAir(world, x, y, z))

     

    would check for air just remember if you pull the code form a specific block when your checking around that block to increase the coordinates as needed

     

    if(block .isAir(world, x, y + 1, z)) would check if there's an air block above the Block

  4. 64bit as in your .png will be 64x64 large instead of the default 16x16 minecraft uses.

     

    Now I reckon people can give me 1mil reason why not to use it, all valid reasons, but I'm doing something completely different with SImCRaft and this would just be a neat option. As soon as people use resource packs it would basically overwrite the texture i set.

     

    Also remember SimCarft sets a theme completely different from what ppl are use to.

     

    The question however remains why doesn't a couple of the texture not overwrite when I use that method while the others does not to mention the fact about the Biome colors affecting the .png after it's been changed, that's basically all I need to know if someone actually knows why that happens. Apart from that providing reasons as in why not to do it doesn't really answer the question or cry for help or advice.

  5. I already have a resource pack, using the replace textures for a different reason, the mods developed with 64bit graphics and it would simply be nice to have some of the world blocks to also or already be on 65bit when you load it up, without the use of a texturepack. Also keeping a resourcepack updated and the mod is a lot of time spend and wasted when MC updates and we most likely to get loads more updates and probably loads more game breaking updates, so this simply method that actually works is perfect. If it work for everything.

  6. Just started on replacing a couple vanilla texture in 1.6.4, and now again in 1.7.2, got the method for changing Item textures on the forum and applied it to blocks, only 2 problems that I really don't know why it happens.

     

    The method works and replaces mc texture with texture you specify, but when replacing dirt, the color of teh Dirt/Grass block becomes Biome dependant meaning the color of the dirt below the grass on the same block is completely a different color in each Biome.

     

    Then secondly some texture just simply don't overwrite one of which are the following

    ((Block) Block.blockRegistry.getObject("sand")).setBlockTextureName("SimCraft:vanilla/sand")

     

    Sand I can add .setBlockName("dump") behind that method and it will change the block name, but the sand png simply won't load even tried renaming sand.png to something else thinking it clashes with sanstone.

     

    Does anyone have any clarification as to why or perhaps how to fix this

     

  7. Trying to set my wood block so that it catches fire but, there's no static method under block.java allowing me to set that atm.

     

    I looked at the code in 1.6.4 BlockFire called the check using

     

    private void setBurnRate(int par1, int par2, int par3)
        {
            Block.setBurnProperties(par1, par2, par3);
        }
    

     

    in 1.7.2 it would appear that method has been changed or removed to this

     

        @Deprecated // Use setFireInfo
        public void func_149842_a(int p_149842_1_, int p_149842_2_, int p_149842_3_)
        {
            this.setFireInfo((Block)Block.blockRegistry.getObjectById(p_149842_1_), p_149842_2_, p_149842_3_);
        }
    

     

    But there's now way for me to really be able to use that.

     

    The question is now how do I set my block so that it can be destroyed by fire

     

    Edit*

    Blocks.fire.setFireInfo(RegBlocks.BlockFlowers, 8, 30);

     

    This works thanks for pointing that out.

  8. Right now I'm just looking into updating my mod, but for the love of me I simply cannot get the textures to show up on my blocks. I basically dropped everything, started with Block1 which felt like 2 years ago when I started and followed couple tutorials and simply could not get my multi-meta-block to show the textures.

     

    Now I've completely trimmed down the block to only 1 texture and no meta and still don't see any textures also no errors when I break the block I'm placing the particles are like lava so that confuses me cause is this perhaps a registration problem.

     

    I also added a couple of break points and the code never runs thru public void registerBlockIcons which well I guess might explain why there;s no texture, but yeah I'm seriously missing something or overlooking something and any help would be appreciated.

     

    Core File

    http://pastebin.com/wPPQUzSk

     

    RegBlocks

    http://pastebin.com/nFyz1cUL

     

    WorldGenReg

    http://pastebin.com/50XsP96V

     

    blockOre3

    http://pastebin.com/2M77crWU

     

    This is I reckon all the code that you need left out the custom creative tabs but that's working

     

    Block can be placed and break, but no texture,

     

    texture location are under forge folder src/main/resources/assets/simcraft/textures/blocks

     

    Hilarious part is this should be the easy part and I can even get this going.

     

    Edit*

    Ok got this working, and what a noob I was, I was changing from preInit to Init and just did about anything I could think of instead of looking at not only changing to PreInit but in fact change the whole line to

    public void preInit (FMLPreInitializationEvent event) I never changed the FMLPreInitializationEvent  part that was still in FMLInitializationEvent

  9. Working on adding protection for my mod and just want to now if anyone knows if Forge has perhaps a Spawner event that would block a mob spawner from spawning.

     

    using the events I could find, I'm able to block spawning, but For the live of me when I place a mob spawn er next to my protection block it still spawns mobs, so would be nice if the event could turn of mob spawners completely in the designated X area.

  10. Well I see what you mean in the video, not sure exactly what's causing your problem, but what I can tell you is what I know about containers.

     

    You do not need packets to sync items from client to server, whatever is placed inside a slot that's inside a container actually gets sync via the container class you have to create for your block.

     

    So for instance on your block class file you would have a function called onBlockActivated and inside there you call your gui

    you need to setup a guihandler that would switch between server and client and handle the packets for you. Now you most likely got all of this, but the syncing of items in the container takes place via the server side container class.

     

    Secondly on your code you have public ItemStack[] chest; and public ItemStack[] ID = new ItemStack[9];

    you then set your chest to a sizex3 and I have no idea what that size it suppose that depends on some condition.

     

    Now you only still only have 1 container class assuming you are using a guihandler that is used for this and my guess is somewhere in there your container server side class file does not know what to do with all your slots, because it might not be mapped correctly or updated correctly. That woudl explain why once you close your gui and reopen it the gui doesn't display your item, so check inside the server side container file you created for this Tile Entity you will find your answer there.

     

     

  11. OK so finally got this to work, information provided by everyone helped.

     

    Final results, is that yes when you use a static variable it syncs across client/server interesting actually

     

    Easiest way to fix this problem was to use a DataWatcher to monitor the Wheelyaw and then update the DataWatcher whenever the value changes and to get the information across to the model and render properly use a get method, instead of getting the actual value get the current value from the DataWatcher via the get method.

     

    Thanks for all the help and advise

     

  12. Still looks like a normal pig :I

     

     

    http://pastebin.com/xdsCXSmq

     

    If that still looks like a normal pig your problem is elsewhere, because it the rendering part was wrong there's no way it could use the default pig skin and use that, so somewhere inside your other class files you extended something that should maybe not have been extended, or didn't register the entity properly or even forgot to change mc names to your rendering or model names when you did your model, a lot for time we would maybe use mc code as our base and then forget to change something and we end up with something we didn't want.

     

    For it to render the pg skin it has to be linked somewhere in your code

     

    also spotted maybe a problem change the following code

     

             public RenderHog (ModelHog modelTutorial, float f)
             {
              super(modelTutorial, f);
              model = ((ModelHog)mainModel);
             }

     

    to

     

     

             public RenderHog (ModelBase var1, float f)
             {
              super(var1, f);
              this.model = ((ModelHog)var1);
             }

  13. @hydroflame yep

     

    @OP that's really weird because i just tested it on a dedicated server and it wouldn't even get past the "if (Class.forName() && Keyboablablaba)" part. and it shouldn't. if it's working on a dedicated server, where the heck is it getting the keyboard input from?:o it can't be from the clients because the only checks for keyboard input is in pressClientKey() which is called by the server. also, i don't think you need packets. you can probably just use the datawatcher.

     

        @SidedProxy(

                clientSide = "simcraft.core.KeyboardClient",

                serverSide = "simcraft.core.Keyboard"

        )

        public static Keyboard keyboard;

     

    and then that sends packets via

     

        @SidedProxy(

                clientSide = "simcraft.core.network.NetworkManagerClient",

                serverSide = "simcraft.core.network.NetworkManager"

        )

        public static NetworkManager network;

     

    The mod is like mecca huge the vehicles is just a small part I'm working on right now to extend it even more, in fact the total amount of class files this mod has atm is round about 1400+ so although the keys might not be working on your side, you would need the rest of the mod to actually get this to work let alone send info to server and back to client.

     

    Issues is not with the keys, but with that variables information not being send to the renderer or updating it if the value is not static, i will play around see if I can find out what the heck or why the heck that value is not being used correctly, I even tried get and set methods and that didn't work either, will run through the code and track it down, just hoped someone had a keen eye and could save me hours of looking for the problem

  14. Do it like this;

     

    public static final ResourceLocation field_110920_a = new ResourceLocation("simcraft", "textures/entity/oceaanFish.png");

     

       

        protected ResourceLocation func_110919_a(EntityOceaanFish par1EntityOceaanFish)

        {

            return field_110920_a;

        }

       

        protected ResourceLocation func_110775_a(Entity par1Entity)

        {

            return this.func_110919_a((EntityOceaanFish)par1Entity);

        }

     

     

    just add your own data and entity names in

     

     

  15. and just to clarify. onUpdate() is only called server side. so if you call pressKeyClient() in onUpdate() and only there, you're gonna have to change your set up because it won't work on a dedicated server

     

    It works on smp and dedicated servers, that call is for checking whether a key is down and if it is down it sends the packets and runs the public void pressKey(int i) that in turns starts the movement.

     

    Why I do it like that because register a new keybinding  with forge for instance WASD keys is a living nightmare, this way you can drive your vehicle using WASD without having to remap vehicle keys differently.

     

    assuming onUpdate() is only server side then i will have to look into sending a packet to the client with the wheelyaw values, and it still doesn't make any sense really because if you change public float wheelYaw; to public static float wheelYaw;

     

    and change this.wheelModel[j].rotateAngleY = (((EntityBedfordTruck)entity).wheelYaw * 3.141593F) / 60F; to

    this.wheelModel[j].rotateAngleY = (EntityBedfordTruck.wheelYaw * 3.141593F) / 60F;

     

    without having to change any code the wheels turn and also turn on a dedicated server.

     

    So what exactly makes static so special that it works, is my next question.

  16. So how do you go about updating Entity, apart from the keys where packets are use to update, the rest of the entity is run inside onUpdate method, which does everything and then datawatchers.

     

    I even tried a get and set method now, with no avail, so maybe I need to setup a datawatcher to monitor that variable for changes. still clueless of why it works when variable is static but not when it's not static that is like the golden question, answer to that will solve this mystery.

     

    This vehicle code is also heavily based of entityboat, to ensure everything works properly, back in 1.2.5 i used to

    add EntityBedfordTruck to the rendering method, but with 1.6.2 and new rendering that just doesn't wanna work anymore so

       

    public void render(EntityBedfordTruck entity, float f, float f1, float f2, float f3, float f4, float f5) renders an invisible truck

     

     

     

     

     

  17. WheelYaw is changed when left/right key is pressed, that sends the key update thru to server and the keys works and been tested on smp truck drives, just this dam wheelyaw when it's static it works when it's not static it won't work

     

    Used the print code to print directly where it changes AKA when key is pressed and I can see wheelyaw values are changing

    also tested onupdate() and wheelyaw changes when i press the key's but that info is not used by the rendering of the wheel, there value stay on 0.0

     

  18. yeye for sure we dont want it static, makes no sens anyway

    but was i mean is, can you print right before that rotation yaw thing? so you can clearly know what is the value at this moment ?

     

    System.out.println("value of rotation: "+((EntityTrucks)entity).wheelYaw);
    this.wheelModel[j].rotateAngleY = (((EntityTrucks)entity).wheelYaw * 3.141593F) / 60F;
            	this.wheelModel[j].render(f5);

     

    Value stays on 0.0 and yeah need to learn debug 101 rofl

  19. your entity truck extends vehicule right ? then you should be able to add a new field inside truck and just use that variable to get the wheel orientation.

    did you try printing inside your render method to check that the wheel rotation value was correct ?

     

    Weird enough that's what I did the code above have EntityTruck, I've had EntityBedfordTruck which extends to Entitytruck in there just playing around testing.

     

    public float wheelYaw; is set in EntityTrucks and set to 0.0F and on entity update when the wheel should move, wheelyaw is changed. but using what you see there doesn't seem to work if i do it the other way around using static works like a charm.

     

    her's the code

     

    EntityBedfordTruck

    http://pastebin.com/PNguVU8a

     

    EntityTrucks

    http://pastebin.com/m2j42CZ0

     

    ModelBedfordTruck

    http://pastebin.com/991xK0dx

     

     

    On a side note I can see the wheels being rendered, so I know the code is running past that line of code, but that line of code simply does nothing using it the static way would be to add

     

    this.wheelModel[j].rotateAngleY = (EntityTrucks.wheelYaw * 3.141593F) / 60F;

     

    do that but then you need the wheelyaw float static which interferes with wheels of all vehicles

     

  20. Working on 1.6.2, doing a vehicle extension for my existing mod.

     

    My problem, I want to add wheel yaw and wheel turning to the vehicle when it drives, the variable inside the vehicle class file won't work unless I make it static which off course end up in turning the wheels of every single entity of vehicle type so a no go.

     

    eventually I came up with the following but it still does not work.

     

        public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5)
        {
            for (int i = 0; i < this.vehicleModel.length; i++)
            {
            	this.vehicleModel[i].render(f5);
            }
    
            for (int j = 0; j < this.wheelModel.length; j++)
            {
            	this.wheelModel[j].rotateAngleY = (((EntityTrucks)entity).wheelYaw * 3.141593F) / 60F;
            	this.wheelModel[j].render(f5);
            }
        }

     

    (((EntityTrucks)entity) just simply does nothing does anyone have any idea on how i should go about making this work\

     

    if you need any extra class file code I will pastebin

  21. -snip-

    Try, and write back! Good luck with your mod  :)

    I do have my textures in textures/blocks but the model doesn't show up in my inventory...

     

    Ok let me help you out with this quickly because it's easy enough if you know where what goes

     

    Now we are assuming the following;

     

    1) You are using a model ingame

    2) You manage to render the model ingame

    3) You haven't manage to render the model in your hand while holding it.

     

    Now another way to do this one used by many was to create a normal item then register that item and use the item to place the model, this off course is a lot more work for something you can easily obtain by usng the following methods.

     

    Drop your render file as it is atm as in completely and create a new one that should look like this

     

    public class FryerRenderer extends TileEntitySpecialRenderer
    {
        private ModelFryer aModel = new ModelFryer();
    
        public void renderAModel(TileEntityFryer var1, double var2, double var4, double var6, float var8)
        {
        	
            int i1 = 0;
    
            if (var1.worldObj != null)
            {
                i1 = var1.getBlockMetadata();
            }
        	
        	
            int var9;
    
            if (var1.worldObj == null)
            {
                var9 = 0;
            }
            else
            {
                Block var10 = var1.getBlockType();
                var9 = var1.getBlockMetadata();
    
                if (var10 != null && var9 == 0)
                {
                    var9 = var1.getBlockMetadata();
                }
            }
    
            GL11.glPushMatrix();
            GL11.glTranslatef((float)var2 + 0.5F, (float)var4 + 1.5F, (float)var6 + 0.5F);
            short var11 = 0;
    
            if (var9 == 3)
            {
                var11 = 90;
            }
    
            if (var9 == 2)
            {
                var11 = 180;
            }
    
            if (var9 == 1)
            {
                var11 = 270;
            }
    
            GL11.glRotatef((float)var11, 0.0F, 1.0F, 0.0F);
            GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F);
            this.bindTextureByName("/textures/blocks/FryerTexture.png");
            GL11.glPushMatrix();
            this.aModel.renderModel(0.0625F);
            GL11.glPopMatrix();
            GL11.glPopMatrix();
        }
    
        public void renderTileEntityAt(TileEntity var1, double var2, double var4, double var6, float var8)
        {
            this.renderAModel((TileEntityFryer)var1, var2, var4, var6, var8);
        }
        
    
    }
    

     

    So instead of implementing ItemRenderer you implement TileEntitySpecialRenderer, for your tile entity you just need a file that can basically be empty something like this

     

    public class TileEntityFryer extends TileEntity
    {
    }
    

     

    Off course if your model has special function it would be in the tileentity so it will look a bit different.

     

    Your model file is fine no changes needed their, the method that will be rendering your item for you is inside the render file this bit public void renderTileEntityAt, this is also used to render the model in game so the results would be that whatever you place in world would render in your hands and also in the inventory

     

    The last bit of info you need to make sure you have is the registering part;

     

    Now depending on how you go about registering your model the code should be like below I basically call my model registering from another class because i have over 30+ models in game and I use my clientproxy to register the model in cause you mostly need this to be client side only it will look something like this;

     

    RenderingRegistry.registerBlockHandler(FryerID,new RenderInv());
    FryerID = RenderingRegistry.getNextAvailableRenderId();
    
    ClientRegistry.bindTileEntitySpecialRenderer(TileEntityFryer.class, new FryerRenderer());

     

    then the following need to be register inside your proxy i basicly have thsi inside my client proxy and proxy just to make double sure it gets registered

     

    GameRegistry.registerTileEntity(TileEntityFryer.class, "TileEntityFryer");

     

    Now this code can be place anywhere as long as it's executed at runtime or while registering takes place.

     

    just import all your class files you need and then you wil have to create the following class file you can call it anything you like actually I call mine RenderInv and this is where I would tell my model where and how to render the item in hand the code will look like this

     

    public class RenderInv  implements ISimpleBlockRenderingHandler
    {
    
    public void renderInventoryBlock(Block block, int metadata, int modelID,
    		RenderBlocks renderer) {
    
            if (block == BlockFryer)
            {
             TileEntityRenderer.instance.renderTileEntityAt(new TileEntityFryer(), 0.0D, 0.0D, 0.0D, 0.0F);
            }
    
    }
    
    public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z,
    		Block block, int modelId, RenderBlocks renderer) {
    	return false;
    }
    
    public boolean shouldRender3DInInventory() {
    	return true;
    }
    
    public int getRenderId() {
    	return 0;
    }
    
    }
    

     

    That's basically all you need to see your model in your hand, without the need to add an extra item into the game this will take your 3d model and create a 3d model for you that you can hold it in your hand. All you now need to do is take this code and implement it into your project the RenderInv can be expanded later on to include all your models inventory items and off course you need to make sure everything is imported and pointing towards the right class file names.

     

    Happy coding...

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.