Filled Custom SignShop

Discussion in 'Plugin Requests' started by Rakinare, Apr 18, 2016.

Thread Status:
Not open for further replies.
  1. Offline

    Rakinare

    Hello!

    Plugin category: Economy

    Suggested name: IPSignShop

    What I want: In school we have 1 PC for the kids to play minecraft on and only one account. That's why @I Al Istannen made an awesome plugin for multiple inventories for me (https://bukkit.org/threads/multiple-inventories-for-1-account.414836/). Unfortunately he doesn't have experience creating sign shop plugins.
    The problem is that normal sign shop plugins won't work with that one as they don't recognize the different profiles. I'd like to have a plugin that is similiar to the QuickMarket plugin.
    In this plugin I like the simple sign design and the visualization of the item above. However, since I want it to be as easy as possible for the kids, I'd like to have it without the GUI and also just the simple shop sign, not the market one.

    possible sign creating solution:
    1. line: [Shop]
    2. line: Buy or Sell quantity
    3. line: Price
    4. line: autofilled with name of the shop owner

    The item is set by left clicking the sign with the item.

    I also really want the visualization of the item above the chest + the name of the item shown.
    It would also be great if you can make a language system so I can translate the Buy/Sell and also if possible the shown item names into my own language (german).
    This plugin has to be compatible with the InventoryProfiles plugin shown above.

    Help by the plugin author:

    "You will need to depend on the plugin via the
    "depend: [InventoryProfiles]".
    Then you will need to get the Main plugin instance via
    "Bukkit.getPluginManager().getPlugin("InventoryProfiles");"
    You are then able to cast it to a "InventoryProfiles" and call the
    "InventoryProfiles#getProfileStorage()" which returns a "ProfileManager". The method is static, you could skip the step above and call "InventoryProfiles.getProfileStorage()" directly, but it may be null if called at the wrong time (= too early). From there you can get the Profiles linked to a certain name with the "ProfileManager#getProfileForName(String)" method. With the resulting "Profile" object you can call the "Profile#getMoney()" to get the money and "Profile#setMoney(double)" to set the money. After that I would recommend calling the "Profile#updateMoney()" method to update the money they have in-game."

    Edit: I also really like QuickShop NotLikeMe so having a plugin similiar to that with chat instructions for the easy setup and the ability to do translations would be even more amazing.

    Ideas for commands: No commands needed as far as I can think of.


    Ideas for permissions: AdminShop OP only, normal shop for everyone. (not using any extra permission plugins)

    When I'd like it by: There's time until at least next monday. Would be great if it's done by then. If you take more time it doesn't matter at all as I'd be extremely happy if someone is taking on this.


    Thanks for taking your time and reading this!
     
    Last edited: Apr 18, 2016
  2. Online

    timtower Administrator Administrator Moderator

    @Rakinare The profile plugin could also integrate an economy plugin that changes the balance when the user logs in, then you can use every plugin that is supported by Vault.
    @I Al Istannen
     
    cococow123 likes this.
  3. Offline

    Rakinare

    @timtower Thanks for the info.

    I don't know if he is able to do that and if it works that "easily". I personally have no clue about writing plugins.

    Since I also need it as simple as possible and having the option to translate the stuff I would still be really happy if I could get a plugin the way I have described it. I think that would be the easiest to handle for the kids (8-10 years old).


    Edit: I just read what you have written again. The pofile plugin is already saving the balance seperately from each profile. It can also add/take/move balance via command, so it kinda has an own economy plugin integrated. The problem is that every other plugin doesn't recognize those profiles and instead always take the real account name to show as owner and also buyer. So for those plugins the player is always the same person.
     
    Last edited: Apr 18, 2016
  4. Online

    timtower Administrator Administrator Moderator

    @Rakinare That is why I suggested the integration, works different, and gives compatibility, the old part needs to stay though due to the profiles.
     
  5. Offline

    Rakinare

    @timtower

    Sorry but I don't really get what exactly you want to be integrated, I don't have much clue about how the plugins interact with eachother.
    So basically the Profile plugin has to to somehow tell vault or another plugin that there's actually another user than the real account.

    Well, I hope that @I Al Istannen does know exactly what you mean.

    I have also just checked out your plugins. QuickShop NotLikeMe looks really interesting. Seems really easy to use and only shows the minimal needed information as well as it's guiding you through the creation and buying/selling process.
    Does it have the option to translate everything? I guess I'd really like to use that if I Al Istannen or someone else can make InventoryProfiles compatible.
     
  6. Online

    timtower Administrator Administrator Moderator

    @Rakinare Dont think that it has language support, only added uuid support.
    If @I Al Istannen has issues with it then I can help with that.
     
    Rakinare likes this.
  7. Offline

    Rakinare

    @timtower Just downloaded it and there's the messages.yml. I guess I can translate it in there?
     
  8. Offline

    I Al Istannen

    @timtower
    I already hook into Vault and change the money they have upon authentication. The amount is read from a file and then set as the current balance. Problem is that I think the Shop plugins credit money to different user profiles based on UUID, which - logically - stays the same. I would need to create a new e.g. IConomy account for each Profile which I don't know is possible.

    Using shops / other plugins that take or give you money is already possible (e.g. buying from admin shop, getting money for playtime,... ). What isn't is crediting money to a user that is not online. This is why I made a custom "money give/take/set" command that writes the money directly into the config. The shop plugin however has no way I am aware of, of changing the money of an offline profile.

    That was terribly explained, but I hope you got what I meant. Would be nice if you know a way to do so!

    EDIT: Actually it doesn't retrieve the money back from Vault upon logging out. Will fix that. Doesn't change the original problem though :/ I actually already implemented that without remembering... :D
     
    Last edited: Apr 18, 2016
  9. Online

    timtower Administrator Administrator Moderator

    Then yes.

    @I Al Istannen I am more looking into the direction of replacing Iconomy in the profile plugin. Then you pretty much get rid of all issues at once.
     
  10. Offline

    I Al Istannen

    @timtower
    I don't use Iconomy. I hook into Vault and set the money upon login. No problem there, you can also use everything involving money. I just don't think that a shop would work, as the plugin would need to credit money to a User. If the User is identified by UUID, all the profiles would be the same for the Shop plugin and it would credit the money for the bought item to the currently online user.
     
  11. Online

    timtower Administrator Administrator Moderator

    @I Al Istannen Good point, adminshop only would be a lot easier for this.
    Then somebody indeeds need to hook in your plugin.
     
  12. Offline

    Rakinare

    @timtower So I have to wait for someone to answer my request, yes? I hope I will find someone :) Really liked how your plugin looks.
     
  13. Offline

    I Al Istannen

    @timtower
    Hey,
    do you think it would be allowed and easier to modify your plugin or to create an entirely new one? It seems to be entirely doable, but you don't always have to reinvent the wheel ;)
     
    Last edited: Apr 20, 2016
  14. Online

    timtower Administrator Administrator Moderator

  15. Offline

    Rakinare

    @I Al Istannen @timtower If that'd be a way, that'd be pretty awesome, as I really like the overall functionality of tim's plugin :)
     
  16. Offline

    I Al Istannen

    @Rakinare
    While that may have been the better idea, I have already started shamelessely recoding @timtower's plugin ;) I don't know how nice it will look and how many features it will have though.
     
    Rakinare likes this.
  17. Online

    timtower Administrator Administrator Moderator

    @I Al Istannen Recoding is probably better anyways, it has gone through 3 people already.
     
  18. Offline

    I Al Istannen

    @timtower
    I highly suspect I will be able to increase the code quality, but I will try nonetheless :p
     
    Rakinare likes this.
  19. Offline

    I Al Istannen

    @Rakinare
    Do I need to protect the chest? Or is there some other plugin for that? It wouldn't be a problem to protect them, so don't worry if you don't have a plugin installed.

    EDIT: Apart from that, do you want a item blacklist, or can I leave that out?
     
    Last edited: Apr 23, 2016
  20. Offline

    Rakinare

    @I Al Istannen Sorry, been busy the past days. The chest would need to be protected. Not using any other permission plugins.

    Item blacklist is not needed, thanks :)
     
  21. Offline

    I Al Istannen

    @Rakinare
    No problem ;)
    • Should the search (/ipss find <material>) search just in this world or in all?
    • The material names are all in English. Is this a problem? If yes, I would need to create a file mapping each Material to a different language. There are a few hundred of them.
    • Should you be able to place other things in the chest than the item the shop sells. E.g. if you have a shop selling iron should you be able to put a diamond sword in there. It won't be evaluated for any shop function, but it would act as a vault, as the others can't get it out. Granted, they can just create a new shop ==> next point.
    • Should there be a shop amount limit?
     
  22. Offline

    Rakinare

    @I Al Istannen

    Can you explain the search a bit more? I don't quite get what/where it should search for something.

    It would be great to have them in german. Is there no way to load them from the german client? If not, the file would be nice, I can do the translations on my own though if it's that much work and if it doesn't require any knowledge of java.

    The chest is only for the items sold.

    No limit on shop amount.

    Thanks for your work! :)
     
  23. Offline

    I Al Istannen

    @Rakinare
    Hey,
    what i mean wirh the search is the following:
    Let's say you habe a world called test. In this world is a shop at the coordinates 100,100,100 selling dirt. If you are in a different world but at the coordinates 100,100,101 should it find the shop from the world test?

    Maybe I can fetch the names Form the minecraft jar, somebody did translate Thema. I will look into it.
     
  24. Offline

    Rakinare

    @I Al Istannen

    I think a search isn't needed as I will have a shopping mall where they can open their shops. If you wanna add it anyways, cross world isn't needed as I will allow them only in one world (checking manually).
     
  25. Offline

    I Al Istannen

    @Rakinare
    Posting this, so that I don't need to rember the item names... .

    I could extract some item names from the "de_DE.lang" file from minecraft. They sadly don't have a 1:1 counterpart in bukkit and bukkit is a bit less detailed. "Monster Egg" is just "Monster Egg", no matter what it spawns. Implementing that would be too much of a hassle in my opinion.

    Currently missing (the Material name and the ID behind it) (I WONT add them, too much of a hassle):
    Items (open)

    Code:
    LEATHER_HELMET 298
    LEATHER_CHESTPLATE 299
    LEATHER_LEGGINGS 300
    LEATHER_BOOTS 301
    PORK 319
    GRILLED_PORK 320
    WOOD_DOOR 324
    CLAY_BRICK 336
    CLAY_BALL 337
    GLOWSTONE_DUST 348
    RAW_FISH 349
    INK_SACK 351
    BREWING_STAND_ITEM 379
    CAULDRON_ITEM 380
    MONSTER_EGG 383
    FLOWER_POT_ITEM 390
    CARROT_ITEM 391
    POTATO_ITEM 392
    SKULL_ITEM 397
    NETHER_BRICK_ITEM 405
    END_CRYSTAL 426
    SPRUCE_DOOR_ITEM 427
    BIRCH_DOOR_ITEM 428
    JUNGLE_DOOR_ITEM 429
    ACACIA_DOOR_ITEM 430
    DARK_OAK_DOOR_ITEM 431
    CHORUS_FRUIT 432
    CHORUS_FRUIT_POPPED 433
    BEETROOT 434
    BEETROOT_SEEDS 435
    BEETROOT_SOUP 436
    DRAGONS_BREATH 437
    SPLASH_POTION 438
    SPECTRAL_ARROW 439
    TIPPED_ARROW 440
    LINGERING_POTION 441
    SHIELD 442
    ELYTRA 443
    BOAT_SPRUCE 444
    BOAT_BIRCH 445
    BOAT_JUNGLE 446
    BOAT_ACACIA 447
    BOAT_DARK_OAK 448
    ======= BLOCKS =======
    AIR 0
    STONE 1
    COBBLESTONE 4
    WOOD 5
    WATER 8
    STATIONARY_WATER 9
    STATIONARY_LAVA 11
    BED_BLOCK 26
    POWERED_RAIL 27
    WEB 30
    LONG_GRASS 31
    PISTON_EXTENSION 34
    PISTON_MOVING_PIECE 36
    BROWN_MUSHROOM 39
    DOUBLE_STEP 43
    STEP 44
    TNT 46
    MOSSY_COBBLESTONE 48
    TORCH 50
    WOOD_STAIRS 53
    WORKBENCH 58
    BURNING_FURNACE 62
    SIGN_POST 63
    COBBLESTONE_STAIRS 67
    WALL_SIGN 68
    IRON_DOOR_BLOCK 71
    GLOWING_REDSTONE_ORE 74
    REDSTONE_TORCH_OFF 75
    SNOW_BLOCK 80
    SUGAR_CANE_BLOCK 83
    CAKE_BLOCK 92
    DIODE_BLOCK_OFF 93
    DIODE_BLOCK_ON 94
    STAINED_GLASS 95
    TRAP_DOOR 96
    SMOOTH_BRICK 98
    HUGE_MUSHROOM_1 99
    HUGE_MUSHROOM_2 100
    THIN_GLASS 102
    MELON_BLOCK 103
    PUMPKIN_STEM 104
    MELON_STEM 105
    VINE 106
    SMOOTH_STAIRS 109
    WATER_LILY 111
    NETHER_BRICK 112
    NETHER_BRICK_STAIRS 114
    NETHER_WARTS 115
    BREWING_STAND 117
    ENDER_PORTAL 119
    ENDER_STONE 121
    REDSTONE_LAMP_OFF 123
    WOOD_DOUBLE_STEP 125
    WOOD_STEP 126
    SANDSTONE_STAIRS 128
    TRIPWIRE_HOOK 131
    TRIPWIRE 132
    SPRUCE_WOOD_STAIRS 134
    BIRCH_WOOD_STAIRS 135
    JUNGLE_WOOD_STAIRS 136
    FLOWER_POT 140
    WOOD_BUTTON 143
    SKULL 144
    GOLD_PLATE 147
    IRON_PLATE 148
    REDSTONE_COMPARATOR_OFF 149
    REDSTONE_COMPARATOR_ON 150
    QUARTZ_STAIRS 156
    STAINED_GLASS_PANE 160
    LEAVES_2 161
    LOG_2 162
    ACACIA_STAIRS 163
    DARK_OAK_STAIRS 164
    CARPET 171
    STANDING_BANNER 176
    WALL_BANNER 177
    DAYLIGHT_DETECTOR_INVERTED 178
    RED_SANDSTONE_STAIRS 180
    DOUBLE_STONE_SLAB2 181
    STONE_SLAB2 182
    SPRUCE_FENCE_GATE 183
    SPRUCE_FENCE 188
    SPRUCE_DOOR 193
    BIRCH_DOOR 194
    JUNGLE_DOOR 195
    ACACIA_DOOR 196
    DARK_OAK_DOOR 197
    END_ROD 198
    CHORUS_PLANT 199
    CHORUS_FLOWER 200
    PURPUR_BLOCK 201
    PURPUR_PILLAR 202
    PURPUR_STAIRS 203
    PURPUR_DOUBLE_SLAB 204
    PURPUR_SLAB 205
    END_BRICKS 206
    BEETROOT_BLOCK 207
    GRASS_PATH 208
    END_GATEWAY 209
    COMMAND_REPEATING 210
    COMMAND_CHAIN 211
    FROSTED_ICE 212
    STRUCTURE_BLOCK 255
    
     
  26. Offline

    Rakinare

    @I Al Istannen Okay, thank you. Hope I will be able to do it^^ As long as I know where to translate all the stuff I should be fine though.

    How far is the plugin done overall? :) Would love to see a sneak peek.
     
  27. Online

    timtower Administrator Administrator Moderator

    @I Al Istannen Why not map the material names in the config? A loop to set them would be fine as you can just move over all of the values in the enum. Data values are different though as there are loads and loads of them.
     
  28. Offline

    I Al Istannen

    @timtower
    Currently I use a ResourceBundle to translate them. I just printed the ID for him to find the item easier. The real config looks something like this:

    For english it currently just maps the name of the enum:
    Code:
    AIR= Air
    STONE= Stone
    GRASS= Grass
    DIRT= Dirt
    COBBLESTONE= Cobblestone
    GOLD_ORE= Gold Ore
    And for german:
    Code:
    APPLE= Apfel
    GOLDEN_APPLE= Goldener Apfel
    ARMOR_STAND= Rüstungsständer
    ARROW= Pfeil
    BANNER= Banner
    BED= Bett
    The encoding is UTF-8 and it seems to handle special chars quite fine.

    Only annoying this that it breaks if i try to export the jar while the server is running... . Totally unrelated to this post, but still ;)

    If you have a better way, feel really free to point it out :)

    @Rakinare
    The plugin is mostly done :)
    • It takes the language settings from InventoryProfiles and updates if you change the language of it (so just the old command, no new one and also not a new config entry).
    • It allows the creation of a shop
    • It allows only the shop item to be inserted in the shop
    • It allows the setting of a price, quantity, shop mode (Buy, Sell, Buy unlimited, Sell unlimited) and item
    • It allows a display item on top of the shop
    • Shop is indestructable and can withstand everything I could think of
    • The display item can be burned with lava, can't seem to prevent that sadly. It will be respawned if any property of the shop changes.
    • The item should be undupable (e.g. you can't pick it up)
    • Commands:
      • Help: Displays the help.
        Usage: /ipsignshop Help
      • Set Owner: Sets the owner.
        Usage: /ipsignshop setOwner <owner>
      • Set Mode: Sets the mode of the shop.
        Usage: /ipsignshop setMode <mode>
      • Set price: Sets the price of a shop.
        Usage: /ipsignshop setPrice <price>
      • Clean: Deletes all shops without stock.
        Usage: /ipsignshop clean
      • Remove: Removes a shop.
        Usage: /ipsignshop remove
      • Find: Finds a shop selling the given material.
        Usage: /ipsignshop find <material>
    • Alias is /ipss
    • Tab completion *should* work
    • Only the owner can open it.
    • It has a chat prompt like QuickShop Not like me
    • Everything except the shop info is customizable (different type of message, will ook into it)
    • German translation, maybe not best quality though :p
    • And probably some other things
    Sneak preview is here.
    Beware, it probably has some bugs AND shops are not persistent through reloads / restarts. They should

    EDIT: Updated, shops should be persistent. Redownload from above. You will need a new version of InventoryProfiles though. The same link as in the post there or here.

    @timtower
    Update folder looks nice,will try it. Thanks for that!
     
    Last edited: Apr 25, 2016
    Rakinare likes this.
  29. Online

    timtower Administrator Administrator Moderator

    @I Al Istannen Looks nice.
    And you can't export while the server is running, can't delete files then either.
    Unless you export to the update folder.
     
  30. Offline

    Rakinare

    @I Al Istannen

    You are amazing man! Thank you so so much!

    One thing though, how exactly do I create the shop? :p


    Edit: What I could find out via commands is, that you can't use "/ipss finde" with the german item names (language mode set to german of course).
     
    Last edited: Apr 25, 2016
Thread Status:
Not open for further replies.

Share This Page