Jump to content

ItsAMysteriousYT

Members
  • Posts

    785
  • Joined

  • Last visited

Posts posted by ItsAMysteriousYT

  1. No its not, i actually think it is superawesome you know why? Cuz you can ANIMATE IT!! But nevertheless, i can't get the loading process done. What excactly belongs into the json files?

    The models/blocks file i did that:

    {
        "forge_marker": 1,
        "defaults": {
            "textures": {
                "texture": "reallifemod:textures/models/blocks/texture_Lantern.png"
                },
            "model": "reallifemod:lantern.b3d"
        },
        "variants": {
            "inventory": [
                {
                    "transform": {
                        "thirdperson": {
                            "scale": 0.02
                        },
                        "gui": {
                            "scale": 0.02
                        },
                        "firstperson": {
                            "scale": 0.02
                        }
                    }
                }
            ]
        }
    }
    

     

    The same in the blockstate

    and in the itemfile this:

    {
        "parent": "reallifemod:blockLantern",
        "textures": {
            "all": "reallifemod:textures/models/block/texture_Lantern.png"
        }
    }
    

  2. Also, that is the class with my keybindings:

     

    package itsamysterious.mods.reallifemod.core.handlers;
    
    import org.lwjgl.input.Keyboard;
    
    import net.minecraft.client.settings.KeyBinding;
    import net.minecraftforge.fml.client.registry.ClientRegistry;
    
    public class Keybindings {
    public static KeyBinding EnterVehicleKey = new KeyBinding("Enter Vehicle", Keyboard.KEY_RETURN, "key.categories.reallifemod");
    public static KeyBinding CharacterKey = new KeyBinding("Character Menu", Keyboard.KEY_C, "key.categories.reallifemod");
    
    public static void init(){
    	ClientRegistry.registerKeyBinding(EnterVehicleKey);
    	ClientRegistry.registerKeyBinding(CharacterKey);
    }
    }
    
    

     

    I call the init-Method from my MainClass's Init method(Hope thats alright). Also, then why does the first keybinding work with isPressed and the other one isn't?

     

    EDIT: I register the keybindings from my clientproxy now. But the ClientTick Event has to be in the commonhandler cuz it registered to FMLCommanHandler.bus()

     

  3. #isKeyDown (previously #getKeyIsPressed) is the one to use for continuous querying - #isPressed will return false after calling it the first time.

     

    Also, you should not register KeyBindings in your CommonHandler - they are client side only and should be registered in your ClientProxy or its equivalent.

     

    Show your registration code.

     

    Wow, why do they have that keyPressed thingemy then, when it only returns the propper value the first time lol :P

  4. I registered two keybindings for my mod in a Method in my CommonHandler. The first keybinding works, but the other one does not even print out a string when i press it. This is my code:

    @SubscribeEvent
    public void onKeyPressed(ClientTickEvent e) {
    	if (Keybindings.EnterVehicleKey.isPressed()) {
    		if (getClosestEntity() != null) {
    			EntityVehicle v = getClosestEntity();
    			RealLifeMod.network.sendToServer(new MountVehicleMessage(v.getEntityId()));
    		}
    	}
    	if (Keybindings.CharacterKey.isPressed()) {
    		System.out.println("Test");
    	}
    
    }
    

  5. You will need packethandling for this. You will have to decode your image to bytes and send it to the client where you put all the bytes back together to an image again. Diesieben07 has a supergood tutorial on that. For the filetransfer on the client, just use java's FileUtil .

     

    And in my opinion sending such big files (considering .png can take MBs) via normal packet pipeline would be retarded, jut saying.

     

    Open new thread and use standard java downloading. (What player skins do, or did when I last checked).

     

    Honestly this is the resourcefriendlier method :D

  6. With my TileEntity, i wanna change the y positon of all of the entities on it to a dynamicly set position. Now i struggle in the way i track this entity. I set it in the blockcode like this:

    @Override
    public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, Entity entityIn) {
    	if (worldIn.getTileEntity(pos) != null && worldIn.getTileEntity(pos) instanceof TileEntityTarmac) {
    		TileEntityTarmac t = (TileEntityTarmac) worldIn.getTileEntity(pos);
    		t.entities.add(entityIn.getEntityId());
    	} else {
    	}
    }
    

    Now i try this in my tileentity:

     

    @Override
    public void update() {
    	if (!this.hasWorldObj())
    		return;
    	if (!entities.isEmpty()) {
    		Entity e = null;
    		for (int i = 0; i < entities.size() - 1; i++) {
    			e = worldObj.getEntityByID(i);
    			if (e != null && !e.isDead && heightfile != null) {
    				{
    					e.setPosition(e.posX, this.getPosForEntity(e, heightfile), e.posZ);
    				}
    				if (!worldObj.isRemote)
    					if (e.posX < pos.getX() || e.posZ < pos.getZ() || e.isDead || e.isCollided) {
    						entities.remove(i);
    					}
    			}
    		}
    	}
    }
    

     

    Now what is happening is really strange. It just crashes, saying something about lastTwoElementsOfStackTrace but not where the error is. What am i doing wrong in my method?

  7. Is that the right way of doing it?

     

    public void onRenderPlayer(RenderPlayerEvent e){
    	e.renderer.addLayer(new LayerRenderer() {
    
    		@Override
    		public boolean shouldCombineTextures() {
    			return true;
    		}
    
    		@Override
    		public void doRenderLayer(EntityLivingBase e, float x, float y, float z,
    				float p_177141_5_, float p_177141_6_, float p_177141_7_, float p_177141_8_) {
    
    		}
    	});
    }
    

×
×
  • Create New...

Important Information

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