GithubHelp home page GithubHelp logo

ftb-gamepedia / oredict Goto Github PK

View Code? Open in Web Editor NEW
4.0 4.0 5.0 254 KB

An extension that mimics the ore dictionary in Minecraft.

Home Page: https://www.mediawiki.org/wiki/Extension:OreDict

License: MIT License

PHP 99.61% CSS 0.19% JavaScript 0.19%
ftb-wiki mediawiki mediawiki-extension minecraft ore-dictionary

oredict's People

Contributors

alexia avatar applehat avatar chaud avatar elifoster avatar jinbobo avatar noahm avatar tomodachi94 avatar xbony2 avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

oredict's Issues

Licensing and Repository Ownership [OreDict]

There are two legal issues need to be taken care of by the end of next week.

1.) Licensing
There was discussion on the #gamepedia IRC channel previously about this. I forget what the final open source license was decided on and if it was for OreDict or Tilesheets.

The company(Curse Inc.) is requesting to be able to use OreDict under the MIT license. However, if not MIT then GPLv2 would be acceptable.

Preferably the license would be included in the repository in the root folder titled similar to "LICENSE" in all capital letters.

2.) Repository Ownership
Even though OreDict is used primarily on a Gamepedia wiki the primary maintainers of the OreDict project are not Curse employees or contractors. As such legal has informed us that it would be best that the repository ownership be officially transfer to either the personal Github account of a primary maintainer or a an organization account controlled by the primary maintainers. I will facilitate transferring the repository to the location decided.

Oredict shuffling doesn't work

At the moment what happens is that if the first call to the oredict for a given tag is set to be shuffled, it retrieves the things from the database in random order (https://github.com/CurseStaff/OreDict/blob/7c42b80236fa2419b98aad3a1d8ec64ceb03a621/OreDict.body.php#L130). It then caches the result and it is never randomized again on further calls, thus defeating the purpose of shuffling.

Ideally what this should do is instead after it gets the array from the cache or database, it should shuffle that each time if CTRL_RAND is set. Somewhere around here perhaps: https://github.com/CurseStaff/OreDict/blob/7c42b80236fa2419b98aad3a1d8ec64ceb03a621/OreDict.body.php#L166

Also rotation, like shuffling, should also be done to $this->mRawArray, and not to the cache itself.

API needed

The extension needs an API. Here's what is needed:

  • Find entries; specify [mod], [name], [tag]; returns list of {id, tag, name, mod, grid params, flags}
  • Get entries; specify list of {id}; returns list of {id, tag, name, mod, grid params, flags}
  • Add entries; specify list of {mod, name, tag, [grid params], [flags]}; returns list of {[id], successful}
  • Delete entries; specify list of {id}; returns list of {id, successful}
  • Edit entries; specify list of {id, [mod], [name], [tag], [grid params], [flags]}; returns list of {id, successful}

[] = optional
Do all work on the API branch until fully working.

Remove flags

Flags should safely be able to be removed now. All of their functionality which I can find has been achieved through other means.

IRC web service

Could an IRC web service be added with the following settings:

Server: irc.esper.net
Port: 6667
Room: #FTB-Wiki-Dev
Nick: OreDict
Branches:
NickServ Password:
SSL: false
Message Without Join: true
No colors: false
Long URL: false
Notice: true

Improve readme

The readme needs to be improved, primarily by install instructions

Flag to not emit error icon

Sometimes it is useful to have the oredict extension not output the error icon when it does not find any valid entries.

Basically replace this line with setting that to an empty array instead of adding an error entry to the array:

self::$mQueries[$this->mItemName][$this->mItemMod][] = new OreDictItem($this->mItemName, '', $this->mItemMod,'',0xcf);

Then after this line, check if the result is an empty array. If it is an empty array, check whether a brand new flag is set. If the flag is set, the array should remain empty, otherwise the results should be an array of new OreDictItem($this->mItemName, '', $this->mItemMod,'',0xcf).

$this->mRawArray = self::$mQueries[$this->mItemName][$this->mItemMod];

And of course thread that new flag in somehow and make sure nothing breaks when an empty array goes through the system.

Log entry target

The log entry should link to Special:OreDictEntryManager/$id, not Special:Entry/$id.

Terrible deletion logs

The deletion logs that I made in #17 are apparently terrible, and I never noticed.

This will be resolved after #1. Just give me some time 😉

Example:

08:08, 2 February 2016 Admin (Talk | contribs | block) deleted entry Admin (Talk | contribs | block)5 (TAG from as Tag)

<TIMESTAMP> <USER> deleted entry <USER><ENTRY ID> (<MOD> from <blank> as <ITEM>)

It should be something like:

08:08, 2 February 2016 Admin (Talk | contribs | block) deleted entry 5 (tag from TAG as Tag)

<TIMESTAMP> <USER> deleted entry <ENTRY ID> (<TAG> from <MOD> as <ITEM>)

Default grid parameters and link targets

Every entry has the option "Default grid parameters", but it's always empty. What does it does/does it do anything?

It would be useful if links could be predefined using it, as it could avoid the need for using redirects due to it automatically disambiguating the links into Item Name (Mod).

Entry Manager showing old version after edit

When changing the name of an entry using the Entry Manager, after saving the results the old name is shown. Upon refreshing the page however the new name is shown. This leads me to believe that the name to display is fetched before the edit is actually written to the database.

RC entry doesn't look right

      21:45 ‎(OreDict log) ‎    ‎KnightMiner (talk | contribs | block) edited entry #KnightMiner (talk | contribs | block)5 (Unfired Porcelain (Item) from CRCM). Changes: item [Unfired Porcelain (Item) -> Unfired Porcelain (item)] ; ‎

Database query error

For some reason, viewing the OreDictList returns a database query error. Currently looking into this.

Be able to actually delete entries

Currently "deleting" an entry just assigns a flag to it that disables it. Ideally deleting an entry would actually delete the row from the database.

Naming consistency

It's called "Ore Dict" as well as "OreDict" in many places. We should decide on a single term. Personally, I prefer "OreDict" because it's closer to what people call the Minecraft oreDictionary.

editoredict API should not wipe unspecified parameters

If a user calls editoredict and only specifies odmod for example, it should only update the mod. It should not set the tag, item name, and parameters to blank. The recent change entries look like everything is fine:
01:58, 13 August 2020 PonyButt talk contribs block points edited entry #10519 (Quintuple Chrome Plate from GregTech 5). Changes: mod [GT -> GT5] ;
But a quick look at the oredictlist shows everything is awful:
image

Grids do not display properly

Take a look at http://ftb.gamepedia.com/Carving_Table#Recipe to see what I mean. It looks like some SQL querying in the parser function doesn't work properly. However, the only difference I found in #20 was that we use 'ext_oredict_items' rather than $dbr->tableName('ext_oredict_items');, and $sLim is now purely the output limit, rather than "LIMIT 0,".outputLimit. I'm not really sure how either of these would actually cause the issue, though.

Search API limit issue

Using the oredictsearch list, the odlimit seems to actually add that number to 50, returning 50 + the limit results.

Lua/Scribunto wrapper

Since {{O}} will be in lua once the module I made is pushed, it would make sense to have a lua wrapper to shave off the extra millisecond or whatever that callParserFunction() causes.

I would consider doing this myself, but last time I tried to touch PHP I... you know.

Better localization

  • Localized API documentation (supported by MediaWiki directly, this'll probably end up removing quite a bit of code from the api classes)
  • Localized errors and warnings
  • Localized API errors (not yet supported by MW)

OreDict log still has flags

For example: 10:35, 6 August 2017 SatanicBot (talk | contribs | block | points) created entry #43095 (Uranium Ingot from Artifice) and assigned it to the ingotUran tag and set the bits $9. (Importing entries.)

Flags were removed a while ago. I guess I forgot to update the log format.

Prefix is misleading

In the actual OreDictionary in Minecraft Forge, a prefix refers to a value that can be found using startsWith, essentially.

However, here, it means "all tags between the prefix and ZZZZZZZZ". For example:

OreDictList filter with prefix set to "item", only showing a single entry "itemName":
OreDictList filter with prefix set to "item", only showing a single entry "itemName"

OreDictList filter with prefix set to "butt", showing "buttButt" and "itemName"
OreDictList filter with prefix set to "butt", showing "buttButt" and "itemName"

I'm not really sure if we should mimic that part of the oredict, but to me that would make more sense.

Improvements to filtering in Special:OreDictList

  • Replace Filter by prefix with Filter by item name which will do a regex search for entries matching that item name.

  • Modify Filter by tag so that it does a regex search instead of only looking for exact matches.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.