1. Вы находитесь в сообществе Rubukkit. Мы - администраторы серверов Minecraft, разрабатываем собственные плагины и переводим на различные языки плагины наших коллег из других стран.
    Скрыть объявление
  2. Этот сайт использует файлы cookie. Продолжая пользоваться данным сайтом, Вы соглашаетесь на использование нами Ваших файлов cookie. Узнать больше.
  3. Вы находитесь в сообществе Rubukkit. Мы - администраторы серверов Minecraft, разрабатываем собственные плагины и переводим на различные языки плагины наших коллег из других стран.
    Скрыть объявление
  4. Этот сайт использует файлы cookie. Продолжая пользоваться данным сайтом, Вы соглашаетесь на использование нами Ваших файлов cookie. Узнать больше.
Скрыть объявление
В преддверии глобального обновления, мы проводим исследования, которые помогут нам сделать опыт пользования форумом ещё удобнее. Помогите нам, примите участие!

Плагин [ECON/RPG] Griswold v0.079 – починка и зачарование вещей без команд! [1.6 - 1.12.X]

Тема в разделе "Релизы плагинов", создана пользователем Toxuin, 5 май 2012.

  1. RaMzZzEsII

    RaMzZzEsII Старожил Пользователь

    Баллы:
    103
    Skype:
    sashaipatew
    Имя в Minecraft:
    pawlui
    Не ты пропал а кузнец :(
    Но да ладно поставил командный блок и написал Разбудить Ашота :D
     
  2. LaoTheLizard

    LaoTheLizard Старожил Пользователь

    Баллы:
    103
    Skype:
    sgp_the_controller
    Зверское решение. :)
     
  3. Aqel

    Aqel Старожил Пользователь

    Баллы:
    123
    Имя в Minecraft:
    Aqel
    на 1.4.7 уже не робит! На 1.4.6 ещё робил кое как, а сейчас 0
    Когда обнова будет? Плагин нужный. :(
     
  4. LaoTheLizard

    LaoTheLizard Старожил Пользователь

    Баллы:
    103
    Skype:
    sgp_the_controller
    Я общался с автором плагина пару недель назад - думаю, что он не будет заниматься этим плагином (по крайней мере так, чтоб всегда были hot updates).
    К сожалению, сам я стал жертвой любви к примочкам: накидал себе кучу плагинов и теперь практически нереально переходить на вновь выходящие версии minecraft быстро. Другими словами - по техническим причинам я до сих пор сижу в 1.4.5. В 1.4.6 у меня не желает работать пара плагинов, от которых я не хочу отказываться. Версии - авторские, для 1.4.6, но у меня не работают корректно. Вопросы к разработчикам ничего не дают - они подчас ориентируются на hot-версии. В итоге - убирают баги, но при этом сразу переходят дальше; при этом я попадаю впросак.
    Собственно, к чему я клоню? Я буду переходить с 1.4.5 сразу на 1.5.x - зачем пытаться исправить плагин под 1.4.7, если мне его даже тестировать, по большому счёту, негде?

    Тем не менее, я не предлагаю забыть о плагине. Если кто-то хочет попробовать свои силы (не в перерисовке копирайтов, а в обновлении кода плагина) - я могу выложить последний вариант исходников. У меня получилось. И у вас непременно получится.
     
  5. crazy12345

    crazy12345 Активный участник Пользователь

    Баллы:
    63
    переделай плагин плиз под 1.5
     
  6. crazy12345

    crazy12345 Активный участник Пользователь

    Баллы:
    63
    похоже заглохло тут все :( посоветуйте аналогичный по функциям плагин
     
  7. Aqel

    Aqel Старожил Пользователь

    Баллы:
    123
    Имя в Minecraft:
    Aqel
    ...боюсь что такого по функционалу как этот НЕТУ... :)
    Надо программеров просить что бы им занялись, может кто возьмётся. Плагин то очень полезный!
     
  8. Koyot

    Koyot Активный участник Пользователь

    Баллы:
    68
    Будьте бобры, пожалуйста скажите как называется данный texture pack на скрине
     
  9. LaoTheLizard

    LaoTheLizard Старожил Пользователь

    Баллы:
    103
    Skype:
    sgp_the_controller
    Вот исправленный под crafbukkit 1.5.R2. Русификация должна подойти от предыдущей версии, потому что я ничего не менял, только обновил версию. Это даже не бета.

    Известные баги:
    1. Не чарит книги. Вообще. Уже знаю причину. Чинить эту причину геморройно, да и не вижу особого смысла.
    2. Если команды писать неправильно, выдает в логи ошибки, а в чат пишет что-то про internal plugin error... bla-bla-bla... Ну, я думаю, так было всегда. ;)
     

    Вложения:

    Aqel нравится это.
  10. Aqel

    Aqel Старожил Пользователь

    Баллы:
    123
    Имя в Minecraft:
    Aqel
    Ооо ... щас проверим :)
    Отлично! Робит ;)
     
  11. LaoTheLizard

    LaoTheLizard Старожил Пользователь

    Баллы:
    103
    Skype:
    sgp_the_controller
    Кстати... на каком скрине? На моём скрине - Faithful.
     
  12. LaoTheLizard

    LaoTheLizard Старожил Пользователь

    Баллы:
    103
    Skype:
    sgp_the_controller
    Предлагаю вниманию интересующихся данным плагином версию (1.5) с переработанной формулой вычисления цены ремонта вещей.
    Это оригинальный блок вычисления.
    Код:
    private static double getPrice(Repairer repairman, ItemStack item) {
            if (Griswold.economy == null) return 0.0;
            double price = 0;
            if (repairableTools.contains(item.getTypeId())) price = basicToolsPrice;
            else if (repairableTools.contains(item.getTypeId())) price = basicArmorPrice;
     
            price += item.getDurability();
     
            Map<Enchantment, Integer> enchantments = item.getEnchantments();
     
            if (!enchantments.isEmpty()) {
                for (int i = 0; i<enchantments.size(); i++) {
                    Object[] enchantsLevels = enchantments.values().toArray();
                    price = price + enchantmentPrice * Integer.parseInt(enchantsLevels[i].toString());
                }
            }
            return price * repairman.cost;
        }
    А вот этот придумал я специально для своего сервера (который всё ещё 1.4.5).
    Код:
    private static double getPrice(Repairer repairman, ItemStack item) {
            if (Griswold.economy == null) return 0.0;
            double price = 0;
       
            int stick = 1;
            int wood = 2;
            int stone = 3;
            int thread = 3;
            int gold = 25;
            int leather = 10;
            int iron = 20;
            int flint = 3;
            int fire = 20;
            int diamond = 50;
               
            // ITEM BROKEN * PRICE / ITEM FULL
       
            // scissors
            if (item.getTypeId() == 359)  price += item.getDurability() * (iron+iron) / 240;
            // bow
            if (item.getTypeId() == 261)  price += item.getDurability() * ((stick*3)+(thread*3)) / 385;
            // fishing rod
            if (item.getTypeId() == 346)  price += item.getDurability()* ((stick*3)+(thread*2)) / 65;
            // zippo
            if (item.getTypeId() == 259)  price += item.getDurability() * (stick + flint) / 65;
       
            // wooden sword
            if (item.getTypeId() == 268)  price += item.getDurability() * (stick+wood+wood) / 60;
            // wooden pickaxe
            if (item.getTypeId() == 270)  price += item.getDurability() * ((stick*2)+(wood*3)) / 60;
            // wooden axe
            if (item.getTypeId() == 271)  price += item.getDurability() * ((stick*2)+(wood*3)) / 60;
            // wooden shovel
            if (item.getTypeId() == 269)  price += item.getDurability() * (stick+stick+wood) / 60;
            // wooden hoes
            if (item.getTypeId() == 290)  price += item.getDurability() * ((stick*2)+(wood*2)) / 60;
       
            // stone sword
            if (item.getTypeId() == 272)  price += item.getDurability() * (stick+stone+stone) / 132;
            // stone pickaxe
            if (item.getTypeId() == 274)  price += item.getDurability() * ((stick*2)+(stone*3)) / 132;
            // stone axe
            if (item.getTypeId() == 275)  price += item.getDurability() * ((stick*2)+(stone*3)) / 132;
            // stone shovel
            if (item.getTypeId() == 273)  price += item.getDurability() * (stick+stick+stone) / 132;
            // stone hoes
            if (item.getTypeId() == 291)  price += item.getDurability() * ((stick*2)+(stone*2)) / 132;
       
            // golden sword
            if (item.getTypeId() == 283)  price += item.getDurability() * (stick+gold+gold) / 33;
            // golden pickaxe
            if (item.getTypeId() == 285)  price += item.getDurability() * ((stick*2)+(gold*3)) / 33;
            // golden axe
            if (item.getTypeId() == 286)  price += item.getDurability() * ((stick*2)+(gold*3)) / 33;
            // golden shovel
            if (item.getTypeId() == 284)  price += item.getDurability() * (stick+stick+gold) / 33;
            // golden hoes
            if (item.getTypeId() == 294)  price += item.getDurability() * ((stick*2)+(gold*2)) / 33;
       
            // iron sword
            if (item.getTypeId() == 267)  price += item.getDurability() * (stick+iron+iron) / 251;
            // iron pickaxe
            if (item.getTypeId() == 257)  price += item.getDurability() * ((stick*2)+(iron*3)) / 251;
            // iron axe
            if (item.getTypeId() == 258)  price += item.getDurability() * ((stick*2)+(iron*3)) / 251;
            // iron shovel
            if (item.getTypeId() == 256)  price += item.getDurability() * (stick+stick+iron) / 251;
            // iron hoes
            if (item.getTypeId() == 292)  price += item.getDurability() * ((stick*2)+(iron*2)) / 251;
     
            // diamond sword
            if (item.getTypeId() == 276)  price += item.getDurability() * (stick+diamond+diamond) / 1562;
            // diamond pickaxe
            if (item.getTypeId() == 278)  price += item.getDurability() * ((stick*2)+(diamond*3)) / 1562;
            // diamond axe
            if (item.getTypeId() == 279)  price += item.getDurability() * ((stick*2)+(diamond*3)) / 1562;
            // diamond shovel
            if (item.getTypeId() == 277)  price += item.getDurability() * (stick+stick+diamond) / 1562;
            // diamond hoes
            if (item.getTypeId() == 293)  price += item.getDurability() * ((stick*2)+(diamond*2)) / 1562;
     
            // leather helmet
            if (item.getTypeId() == 298)  price += item.getDurability() * (leather*5) / 55;
            // leather chestplate
            if (item.getTypeId() == 299)  price += item.getDurability() * (leather*8) / 80;
            // leather pants
            if (item.getTypeId() == 300)  price += item.getDurability() * (leather*7) / 75;
            // leather boots
            if (item.getTypeId() == 301)  price += item.getDurability() * (leather*4) / 65;
     
            // golden helmet
            if (item.getTypeId() == 314)  price += item.getDurability() * (gold*5) / 77;
            // golden chestplate
            if (item.getTypeId() == 315)  price += item.getDurability() * (gold*8) / 112;
            // golden pants
            if (item.getTypeId() == 316)  price += item.getDurability() * (gold*7) / 105;
            // golden boots
            if (item.getTypeId() == 317)  price += item.getDurability() * (gold*4) / 91;
     
            // fire helmet
            if (item.getTypeId() == 302)  price += item.getDurability() * (fire*5) / 165;
            // fire chestplate
            if (item.getTypeId() == 303)  price += item.getDurability() * (fire*8) / 240;
            // fire pants
            if (item.getTypeId() == 304)  price += item.getDurability() * (fire*7) / 225;
            // fire boots
            if (item.getTypeId() == 305)  price += item.getDurability() * (fire*4) / 195;
       
            // iron helmet 100
            if (item.getTypeId() == 306)  price += item.getDurability() * (iron*5) / 165;
            // iron chestplate 160
            if (item.getTypeId() == 307)  price += item.getDurability() * (iron*8) / 240;
            // iron pants 140
            if (item.getTypeId() == 308)  price += item.getDurability() * (iron*7) / 225;
            // iron boots 80
            if (item.getTypeId() == 309)  price += item.getDurability() * (iron*4) / 195;
       
            // diamond helmet - 250
            if (item.getTypeId() == 310)  price += item.getDurability() * (diamond*5) / 363;
            // diamond chestplate 400
            if (item.getTypeId() == 311)  price += item.getDurability() * (diamond*8) / 528;
            // diamond pants 350
            if (item.getTypeId() == 312)  price += item.getDurability() * (diamond*7) / 495;
            // diamond boots 200
            if (item.getTypeId() == 313)  price += item.getDurability() * (diamond*4) / 429;
       
            Map<Enchantment, Integer> enchantments = item.getEnchantments();
            if (!enchantments.isEmpty()) {
                price = price * (1+(enchantmentPrice*enchantments.size()));//0.1=10%
            return price + repairman.cost; // cost is a pay, which repairman takes for work as fact
    }
    Вкратце расскажу о своём методе.
    Допустим, ремонтируем алмазные ботинки "Защита III, Невесомость III", поврежденные на 200 единиц.
    Enchantmentprice в конфиге выставлена на 0.25.
    Cost на кузнеца выставлен на 20.

    Цена ремонта = 200(это повреждение)*50(это цена 1 алмаза)*4(это количество алмазов в составе ботинок)/429(это полные хит-пойнты алмазных ботинок)*(1+(0.25*2 (количество чарок)))+20(цена работы базовая) =
    =200*50*4/429*1.5+20=160 (денег).

    Извиняюсь за громоздкий и, возможно, корявый код - я не программист.
    Если что-то непонятно или есть дельные предложения - пишите.
     

    Вложения:

  13. LaoTheLizard

    LaoTheLizard Старожил Пользователь

    Баллы:
    103
    Skype:
    sgp_the_controller
    Более правдоподобный вариант будет выглядеть так (кусок кода, поясняющий принцип):
    Код:
    if (item.getTypeId() == 311)  price += item.getDurability() * (diamond*8) / 528; fd=528;
            // diamond pants 350
            if (item.getTypeId() == 312)  price += item.getDurability() * (diamond*7) / 495; fd=495;
            // diamond boots 200
            if (item.getTypeId() == 313)  price += item.getDurability() * (diamond*4) / 429; fd=429;
           
                   
           Map<Enchantment, Integer> enchantments = item.getEnchantments();
     
            if (!enchantments.isEmpty()) {
               price = price + ((enchantmentPrice*enchantments.size())*item.getDurability())/fd;
    }
    При этом в конфиге параметр BasicEnchantmentPrice, который в предыдущем примере показывал надбавку к единице коэффициента умножения уже насчитанной суммы в зависимости от количества чарок (и равнялся условно 0.25), я установил на 100.
    В итоге получаем, что предмет получает базовую цену +100 "денег" за каждую чарку. И при вычислении суммы ремонта эти +100 участвуют в общем расчёте. Таким образом, если в предыдущем примере цена ремонта убитого в хлам лука стоит 20+11=31, такого же зачаренного на все (их четыре) чарки - 20+11+11=42, то тут полностью зачаренный лук в ремонте обойдётся уже в 20+11+400=431. Что, по моим меркам, вполне оправданно.
     

    Вложения:

    Aqel нравится это.
  14. Aqel

    Aqel Старожил Пользователь

    Баллы:
    123
    Имя в Minecraft:
    Aqel
    Молодец, чего тут сказать ;)
    Подправь под 1.5.2 ... пжл :)
     
  15. LaoTheLizard

    LaoTheLizard Старожил Пользователь

    Баллы:
    103
    Skype:
    sgp_the_controller
  16. Aqel

    Aqel Старожил Пользователь

    Баллы:
    123
    Имя в Minecraft:
    Aqel
    Сникерсни нравится это.
  17. LaoTheLizard

    LaoTheLizard Старожил Пользователь

    Баллы:
    103
    Skype:
    sgp_the_controller
    Оказалось, я захостил старую версию. Если уже успел скачать - скачивай по новой - я исправил ссылку.
     
  18. Aqel

    Aqel Старожил Пользователь

    Баллы:
    123
    Имя в Minecraft:
    Aqel
    Вот что в консоле:
    Код:
    2013-05-11 06:52:34 [WARNING] [Griswold] Task #52 for Griswold v0.06 generated an exception
    java.lang.NoClassDefFoundError: net/minecraft/server/v1_5_R2/EntityLiving
        at com.github.toxuin.Griswold.readConfig(Griswold.java:365)
        at com.github.toxuin.Griswold.reloadPlugin(Griswold.java:221)
        at com.github.toxuin.Griswold.access$0(Griswold.java:219)
        at com.github.toxuin.Griswold$Starter.run(Griswold.java:440)
        at org.bukkit.craftbukkit.v1_5_R3.scheduler.CraftTask.run(CraftTask.java:53)
        at org.bukkit.craftbukkit.v1_5_R3.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:345)
        at net.minecraft.server.v1_5_R3.MinecraftServer.r(MinecraftServer.java:513)
        at net.minecraft.server.v1_5_R3.DedicatedServer.r(DedicatedServer.java:226)
        at net.minecraft.server.v1_5_R3.MinecraftServer.q(MinecraftServer.java:477)
        at net.minecraft.server.v1_5_R3.MinecraftServer.run(MinecraftServer.java:410)
        at net.minecraft.server.v1_5_R3.ThreadServerApplication.run(SourceFile:573)
    Caused by: java.lang.ClassNotFoundException: net.minecraft.server.v1_5_R2.EntityLiving
        at org.bukkit.plugin.java.PluginClassLoader.findClass0(PluginClassLoader.java:70)
        at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:53)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
        ... 11 more

    :D То то я гляжу.... файлик знакомый.....
    А ссылка то где новая?
    Плагин загружается, но его команды не работают...
    Код:
    2013-05-11 07:30:32 [SEVERE] null
    org.bukkit.command.CommandException: Unhandled exception executing command 'blacksmith' in plugin Griswold v0.06
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:46)
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:189)
        at org.bukkit.craftbukkit.v1_5_R3.CraftServer.dispatchCommand(CraftServer.java:523)
        at net.minecraft.server.v1_5_R3.PlayerConnection.handleCommand(PlayerConnection.java:965)
        at net.minecraft.server.v1_5_R3.PlayerConnection.chat(PlayerConnection.java:883)
        at net.minecraft.server.v1_5_R3.PlayerConnection.a(PlayerConnection.java:840)
        at net.minecraft.server.v1_5_R3.Packet3Chat.handle(Packet3Chat.java:44)
        at net.minecraft.server.v1_5_R3.NetworkManager.b(NetworkManager.java:292)
        at net.minecraft.server.v1_5_R3.PlayerConnection.d(PlayerConnection.java:109)
        at net.minecraft.server.v1_5_R3.ServerConnection.b(SourceFile:35)
        at net.minecraft.server.v1_5_R3.DedicatedServerConnection.b(SourceFile:30)
        at net.minecraft.server.v1_5_R3.MinecraftServer.r(MinecraftServer.java:581)
        at net.minecraft.server.v1_5_R3.DedicatedServer.r(DedicatedServer.java:226)
        at net.minecraft.server.v1_5_R3.MinecraftServer.q(MinecraftServer.java:477)
        at net.minecraft.server.v1_5_R3.MinecraftServer.run(MinecraftServer.java:410)
        at net.minecraft.server.v1_5_R3.ThreadServerApplication.run(SourceFile:573)
    Caused by: java.lang.NoClassDefFoundError: net/minecraft/server/v1_5_R2/EntityLiving
        at com.github.toxuin.Griswold.createRepairman(Griswold.java:252)
        at com.github.toxuin.Griswold.createRepairman(Griswold.java:225)
        at com.github.toxuin.Griswold.onCommand(Griswold.java:159)
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44)
        ... 15 more
    Caused by: java.lang.ClassNotFoundException: net.minecraft.server.v1_5_R2.EntityLiving
        at org.bukkit.plugin.java.PluginClassLoader.findClass0(PluginClassLoader.java:70)
        at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:53)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
        ... 19 more
     
  19. LaoTheLizard

    LaoTheLizard Старожил Пользователь

    Баллы:
    103
    Skype:
    sgp_the_controller
    Aqel и Sanchez218 нравится это.
  20. Aqel

    Aqel Старожил Пользователь

    Баллы:
    123
    Имя в Minecraft:
    Aqel
    :D УУУУУУУУУУУУУУУУУУУУУУУУУУУУУУУУУУ .......................................
    РАЗАБОТАЛ!!!!!!!!!!!!!!!!!!!!!!!!!! ;)
    СПАСИБО!
    Блин.... :( вот бы ещё сделать, что бы жители не спавнились где кузнецы/чародеи стоят, а то надоело их выгонять/гонять и убивать.... как коршуны возле кузнецов/чародеев вьются... :D
     

Поделиться этой страницей