Thread: Gzip

Results 1 to 4 of 4
  1. #1 Gzip 
    Registered Member
    Join Date
    Sep 2018
    Posts
    17
    Thanks given
    2
    Thanks received
    1
    Rep Power
    31
    How do I Gzip models to add into my cache? Im trying to add customs and cant figure out how to turn my .dat files into .gz - i assume i use winrar to rar it but how do i make it a gz
    Reply With Quote  
     

  2. #2  
    ✥Augury RSPS - Soon✥

    TeJay's Avatar
    Join Date
    Jul 2017
    Posts
    608
    Thanks given
    199
    Thanks received
    261
    Discord
    View profile
    Rep Power
    1440
    Quote Originally Posted by ace D View Post
    How do I Gzip models to add into my cache? Im trying to add customs and cant figure out how to turn my .dat files into .gz - i assume i use winrar to rar it but how do i make it a gz
    [Only registered and activated users can see links. ]
    [Only registered and activated users can see links. ]
    Spoiler for Services:
    [Only registered and activated users can see links. ]

    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  3. Thankful user:


  4. #3  
    Registered Member
    Join Date
    Sep 2018
    Posts
    17
    Thanks given
    2
    Thanks received
    1
    Rep Power
    31
    Quote Originally Posted by TeJay View Post
    [Only registered and activated users can see links. ]
    Ive added my custom sword. one problem is it doesnt let me equip it. When i go to equipment.java this is all the code i have.

    Code:
    package ethos.model.players;
    
    import java.util.HashMap;
    import java.util.Map;
    import java.util.stream.Stream;
    
    import ethos.model.items.GameItem;
    import ethos.model.items.ItemNotFoundException;
    
    public class Equipment {
    
    	/**
    	 * A mapping for items worn by a player for their each respective equipment slot.
    	 */
    	private Map<Slot, GameItem> equipment = new HashMap<>();
    
    	/**
    	 * Creates a new {@link Equipment} object with the given information. Currently, this is information created from the player upon initialization.
    	 * 
    	 * @[Only registered and activated users can see links. ] equipment an array of item id values and item amount values.
    	 */
    	public Equipment(GameItem[] equipment) {
    		for (int index = 0; index < equipment.length; index++) {
    			Slot slot = Slot.valueOf(index);
    			if (slot != null) {
    				this.equipment.put(slot, equipment[index]);
    			}
    		}
    	}
    
    	/**
    	 * Updates the equipment slot for the given item. If the mapping does not contain the slot, the new value is inserted. If the key exists, then the item is updated. This is
    	 * principle of the put function.
    	 * 
    	 * @[Only registered and activated users can see links. ] slot the equipment slot for the item.
    	 * @[Only registered and activated users can see links. ] item the new item to be updated.
    	 */
    	public void update(Slot slot, GameItem item) {
    		equipment.put(slot, item);
    	}
    
    	/**
    	 * Retains the item for the given slot.
    	 * 
    	 * @[Only registered and activated users can see links. ] slot the equipment slot we get the game item from.
    	 * @[Only registered and activated users can see links. ] the item for the slot or a NullPointerException if no item exists for that slot.
    	 */
    	public GameItem getItem(Slot slot) {
    		if (!equipment.containsKey(slot)) {
    			throw new ItemNotFoundException();
    		}
    		return equipment.get(slot);
    	}
    
    	/**
    	 * Determines if the player is wearing any items for the given slot.
    	 * 
    	 * @[Only registered and activated users can see links. ] slot the slot where the item should be worn.
    	 * @[Only registered and activated users can see links. ] items an array of items the player must be wearing one of.
    	 * @[Only registered and activated users can see links. ] {@code} true if the player is wearing at least one of the items.
    	 */
    	public boolean wearingAny(Slot slot, GameItem... items) {
    		GameItem item = null;
    
    		try {
    			item = getItem(slot);
    
    			for (GameItem i : items) {
    				if (item.getId() == i.getId()) {
    					return true;
    				}
    			}
    		} catch (ItemNotFoundException e) {
    			return false;
    		}
    		return false;
    	}
    
    	@Override
    	public String toString() {
    		final StringBuilder sb = new StringBuilder();
    		equipment.entrySet().forEach(e -> {
    			GameItem item = e.getValue();
    			if (item != null) {
    				sb.append(item.getId() + ", " + item.getAmount() + "\n");
    			}
    		});
    		return sb.toString();
    	}
    
    	public enum Slot {
    		HELMET(0), CAPE(1), AMULET(2), WEAPON(3), CHEST(4), SHIELD(5), LEGS(7), HANDS(9), FEET(10), RING(12), AMMO(13);
    
    		private final int slot;
    
    		private Slot(int slot) {
    			this.slot = slot;
    		}
    
    		public int getSlot() {
    			return slot;
    		}
    
    		public static final Slot valueOf(int slot) throws NullPointerException {
    			return Stream.of(values()).filter(s -> s.slot == slot).findFirst().orElse(null);
    		}
    	}
    }
    I can't put a case in there to make it go to item slot 3 which is weapon?

    I think it would go into itemassistant? but what should the code be? im usuing the anguish source/client/cache
    Reply With Quote  
     

  5. #4  
    ✥Augury RSPS - Soon✥

    TeJay's Avatar
    Join Date
    Jul 2017
    Posts
    608
    Thanks given
    199
    Thanks received
    261
    Discord
    View profile
    Rep Power
    1440
    I think u need to define it server sided in ur item txt or json file with every other item in order to wear it
    [Only registered and activated users can see links. ]
    Spoiler for Services:
    [Only registered and activated users can see links. ]

    [Only registered and activated users can see links. ]
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. Using GZIP - (Posted here to aid Kevins tut)
    By James in forum Tutorials
    Replies: 12
    Last Post: 03-29-2008, 06:06 PM
  2. Replies: 3
    Last Post: 03-19-2008, 06:34 PM
  3. Gzip :s
    By lootface in forum Models
    Replies: 7
    Last Post: 03-02-2008, 10:09 PM
  4. Replies: 1
    Last Post: 02-29-2008, 08:05 PM
  5. Gzip why use it and how to.
    By Mr Steadfast in forum Website Development
    Replies: 3
    Last Post: 02-26-2008, 07:32 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •