[Log] Programming StormCraft as a Single Developer

Discussion in 'Spigot Plugin Development' started by Igasi, Apr 20, 2017.

Thread Status:
Not open for further replies.
  1. I think this is where it goes...

    Anyways, I started working on a server as a single dev(And builder, but I guess that isn't as important), and the plan is to have it 100% custom coded. And then I thought, hey! Why dont a make a log just for kicks?

    Concept so things make sense: Map = A valley and a tower. You go into the tower to fight mobs, level up, build items with drops, and what not.

    So yeah... I'm making a log.

    2017/04/20: https://www.spigotmc.org/threads/lo...ft-as-a-single-developer.234719/#post-2370246
     
    #1 Igasi, Apr 20, 2017
    Last edited: Apr 20, 2017
  2. 2017/04/20
    Alright so I just made a few packages for testing purposes, and made a small/simple API for my items(It's format is terrible because me+json=nightmares.
    Code (Text):

    public class item extends JavaPlugin implements Listener{
        HashMap<String, Long> DamageValues = new HashMap<String, Long>();
        {
           ItemStack oakbow = new ItemStack(Material.BOW, 1);
            ItemMeta oakbowmeta = oakbow.getItemMeta();
            oakbowmeta.setDisplayName(ChatColor.GREEN + "Oak Bow");
            List<String> oakbowlore = new ArrayList<String>();
            oakbowlore.add(ChatColor.GRAY + "Required Level: 1");
            oakbowlore.add(ChatColor.GOLD + "Damage: " + ChatColor.RED + "2.5");
            oakbowlore.add(ChatColor.GREEN + "" + ChatColor.ITALIC + "Common Item");
            oakbowmeta.setLore(oakbowlore);
            oakbowmeta.spigot().setUnbreakable(true);
            DamageValues.put("Oak Bow", (long) 2.5);
        }
        {
            ItemStack oakstaff = new ItemStack(Material.STICK, 1);
            ItemMeta oakstaffmeta = oakstaff.getItemMeta();
            oakstaffmeta.setDisplayName(ChatColor.GREEN + "Oak Staff");
            List<String> oakstafflore = new ArrayList<String>();
            oakstafflore.add(ChatColor.GRAY + "Required Level: 1");
            oakstafflore.add(ChatColor.GOLD + "Damage: " + ChatColor.RED + "1");
            oakstafflore.add(ChatColor.GREEN + "" + ChatColor.ITALIC + "Common Item");
            oakstaffmeta.setLore(oakstafflore);
            oakstaffmeta.spigot().setUnbreakable(true);
            DamageValues.put("Oak Staff", (long) 1);
        }
        {
            ItemStack oakjavalin = new ItemStack(Material.WOOD_SPADE, 1);
            ItemMeta oakjavalinmeta = oakjavalin.getItemMeta();
            oakjavalinmeta.setDisplayName(ChatColor.GREEN + "Oak Javalin");
            List<String>oakjavalinlore = new ArrayList<String>();
            oakjavalinlore.add(ChatColor.GRAY + "Required Level: 1");
            oakjavalinlore.add(ChatColor.GOLD + "Damage: " + ChatColor.RED + "3.5");
            oakjavalinlore.add(ChatColor.GREEN + "" + ChatColor.ITALIC + "Common Item");
            oakjavalinmeta.setLore(oakjavalinlore);
            oakjavalinmeta.spigot().setUnbreakable(true);
            DamageValues.put("Oak Javalin", (long) 4.5);
        }
        {
            ItemStack oaksword = new ItemStack(Material.WOOD_SWORD, 1);
            ItemMeta oakswordmeta = oaksword.getItemMeta();
            oakswordmeta.setDisplayName(ChatColor.GREEN + "Oak Sword");
            List<String> oakswordlore = new ArrayList<String>();
            oakswordlore.add(ChatColor.GRAY + "Required Level: 1");
            oakswordlore.add(ChatColor.GOLD + "Damage: " + ChatColor.RED + "4.5");
            oakswordlore.add(ChatColor.GREEN + "" + ChatColor.ITALIC + "Common Item");
            oakswordmeta.spigot().setUnbreakable(true);
            DamageValues.put("Oak Sword", (long) 4.5);
         
        }
    }
     
    I'm not gonna lie it isn't effective, but it works, and that's all I care about right now.
    **Once I add levels Ill add a new HashMap for levels so that there actually is a requirement.

    I also added a "crafting" type item where you can use it to make weapons.
    Code (Text):

    if(e.getEntity().getName().equals(Mobs.weakzombiemob)){
                ItemStack k = new ItemStack(Material.ROTTEN_FLESH, 1);
                ItemMeta ki = k.getItemMeta();
                ki.setDisplayName(ChatColor.GRAY + "Rotting Bone");
                List<String> lore = new ArrayList<String>();
                lore.add(ChatColor.GRAY + "Tier 1 Bone");
                lore.add(ChatColor.GRAY + "Used for handles, blades, arrowheads, and spearheads.");
                lore.add(ChatColor.RED + "Crafting Item");
                ki.setLore(lore);
                e.getDrops().set(1, k);
            }
     
    and lastly, a messy way to add mobs.
    Code (Text):

    @EventHandler
    public void kkk(EntitySpawnEvent e){
        if(e.getEntity().getName().equals(Mobs.weakzombiemob)){
            if(e.getEntity() instanceof LivingEntity){
                ((LivingEntity)e.getEntity()).setHealth(5);
                }
        }
    }
     
    and lastly, this:
    Code (Text):

    public static String weakzombiemob = ChatColor.RED + "[" + ChatColor.GOLD + "Lv1" + ChatColor.RED + "] " + ChatColor.GOLD + "Weak Zombie" + ChatColor.RED + "[" + ChatColor.GOLD + "Neutral" + ChatColor.RED + "]";
     
    Right now I use commandblocks to spawn these for testing, but I'll make a command that's like /testmob [arg0]
    with arg0 being weakzombiemob and it basically spawns a weak zombie where you are.
    [​IMG]
    http://imgur.com/a/pkdHD

    The idea is a tower in the center of a valley, and most of the game is in the tower.
     
  3. latiku

    Supporter

    Should read up on java conventions and create a blog/website to host devlogs on, I don't think this is a proper section.
     
    • Agree Agree x 3
  4. I heard someone say this is the section, but I'm just doing this for fun and I dont think it matters too much
     
  5. not sure if the format is just for testing, but even then, you should follow an OOP styled approach to all this.
     
    • Agree Agree x 1
  6. Seems like a cool idea!
     
  7. Well you must have heard wrong. Please don't put logs here, this section is for support.
     
  8. For gods sake, create a method/utility to handle your construction of items. Like an item building factory.

    new ItemFactory#setDisplayname().addLore().build(); or just a method:


    public static ItemStack createItem(String display, String... lore)
     
  9. Wait, are you going to post a log every time there is new progress here? If so, don't. You'll clog up the thread section. Do this on your own website, not here.
     
  10. Stormcraft is a server not a game concept? Am I right?

    Your code looks like it's only written for testing purpose. Try read into proper usage of object oriented programming concept.
     
  11. I would personally make dev log videos instead of a blog. People tend to be interested in the result, not how you got there. Showing off the result doesn't really work just by typing a bunch, so you'd need videos. We plan on doing it soon as well. Give it a shot :p
     
  12. aight
    The command blocks spawn the mobs and what not

    they dont do anything less or more, and right not Im playing with concepts.



    And for everyone else, I was told this is where to throw dev logs but whatever
     
  13. OK i just deleted my post because i dont want any other attention (adn it was kinda big). I just want to say sorry if i did hurt ur feelings; we have to learn from mistakes and gaining knowledge never stops for anybody.

    If you follow the conventions it will be muscle memory, Concepts? Do that in paper
     
  14. @Igasi look at https://liveedu.tv and just live stream there. (Twitch is not as good, not as many interested viewers)
     
  15. Oh, dont worry. I dont feel bad or anything
     
  16. Why not just edit the post like this;

    11/02/17 Update: Added API
    Code (Text):
     
     
Thread Status:
Not open for further replies.