Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding Loottables for item grids #4842

Draft
wants to merge 170 commits into
base: master
Choose a base branch
from
Draft

Conversation

12xx12
Copy link
Member

@12xx12 12xx12 commented Aug 30, 2020

As discussed here we'd like to add loot tables to the server
Minecraft Wiki

Fixes #3803
Fixes #2399

this is work in progress

This is only for item grids. The other ones can be based on this also but are not yet supported

Things i would do

  • add default loot tables
    • add object that distributes them
    • add json parser
    • add function that interprets them
  • add custom loot tables per world

The loot tables are quite powerfull so it takes some time/effort and many enums to actually implement them.

At this point the cosole spamms some error messages because there are some features added in the loot tables that are not in cuberite and this is told to the user

Todo:

  • support other seeds then the world seed
  • parsing a whole table in tests (there is some bug in the item parsing)

Note: this pull request is quite big because it contains the json files

@12xx12 12xx12 marked this pull request as draft August 30, 2020 00:07
@12xx12 12xx12 changed the title Adding Loottables Adding Loottables for chests Aug 30, 2020
@12xx12
Copy link
Member Author

12xx12 commented Aug 30, 2020

@madmaxoft
@bearbin

There are some errors in some travis-ci build caused from ossupport/file.h

It says that it doesn't know what type AString is.

Edit: I didn't change that file - no clue why it only fails here

Edit 2: Now I know... did the wrong order in the headers in the cpp file... facepalm

Copy link
Member

@peterbell10 peterbell10 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some random comments, I know this isn't ready for a full review.

src/LootTableProvider.cpp Outdated Show resolved Hide resolved
src/LootTableProvider.cpp Outdated Show resolved Hide resolved
src/LootTableProvider.cpp Outdated Show resolved Hide resolved
src/LootTableProvider.cpp Outdated Show resolved Hide resolved
src/LootTableProvider.cpp Outdated Show resolved Hide resolved
src/LootTableProvider.h Outdated Show resolved Hide resolved
src/LootTableProvider.h Outdated Show resolved Hide resolved
src/LootTableProvider.h Outdated Show resolved Hide resolved
src/LootTableProvider.h Outdated Show resolved Hide resolved
src/LootTableProvider.cpp Outdated Show resolved Hide resolved
@12xx12
Copy link
Member Author

12xx12 commented Sep 1, 2020

Some random comments, I know this isn't ready for a full review.

Any help is appreciated - thank you

12xx12 added 25 commits September 7, 2020 22:14
…cuberite into 12xx12-Loottable"

This reverts commit 9f3be5e, reversing
changes made to 45501d6.
added loot table json files
removed unwanted types from binary
added loot tables to symlink CMakeLists.txt
added loot tables to WindowsExecutables.list and UnixExecutables.list
added cLootTableProvider to World.cpp
added file reading for loot tables - no parsing at this point
added custom loot tables
start of filling with loot
@12xx12
Copy link
Member Author

12xx12 commented Oct 23, 2020

Ok, so now everything is working again.

Time to finish the last functions and rip it apart

@12xx12
Copy link
Member Author

12xx12 commented Oct 26, 2020

I need a way to check the Entity Type (Monsters, And "Normal" entities) from string... Do you have any Idea?

@12xx12
Copy link
Member Author

12xx12 commented Oct 28, 2020

waiting for #4941 for the string <-> monster enum conversion

@tigerw
Copy link
Member

tigerw commented Oct 28, 2020

I'll look tomorrow if no one else beats me to it

@12xx12
Copy link
Member Author

12xx12 commented Apr 19, 2021

I need some help @cuberite/core-team
The travis build fails due to a missing submodule (jsoncpp). I think i meddeld with submodules. I fixed it on my machine but on the remote it doesn't seem to work

@12xx12
Copy link
Member Author

12xx12 commented Apr 19, 2021

Things that need to be done:

  • convert the json files to c++ code.

  • Add options for a parser in lua

    • reveal the stuff to the API

Things i am waiting for:

)


target_link_libraries(jsoncpp_lib)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this needed? if so, I think it's now jsoncpp_static

@12xx12
Copy link
Member Author

12xx12 commented Apr 20, 2021

There is the problem :o

At this point yes - but it's gonna be removed soon. I just want to make it compile for now

@12xx12 12xx12 marked this pull request as draft July 19, 2021 08:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement loot tables Fix splash potion loading
4 participants