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

1.21 #25

Merged
merged 5 commits into from
Oct 27, 2024
Merged

1.21 #25

merged 5 commits into from
Oct 27, 2024

Conversation

extremeheat
Copy link
Member

> Task :1.21:compileJava FAILED
/workspaces/minecraft-data-generator-server/1.21/src/main/java/dev/u9g/minecraftdatagenerator/generators/InstrumentsDataGenerator.java:6: error: cannot find symbol
import net.minecraft.block.enums.Instrument;
                                ^
  symbol:   class Instrument
  location: package net.minecraft.block.enums
/workspaces/minecraft-data-generator-server/1.21/src/main/java/dev/u9g/minecraftdatagenerator/generators/TintsDataGenerator.java:11: error: cannot find symbol
import net.minecraft.client.color.world.FoliageColors;
                                       ^
  symbol:   class FoliageColors
  location: package net.minecraft.client.color.world
/workspaces/minecraft-data-generator-server/1.21/src/main/java/dev/u9g/minecraftdatagenerator/mixin/ReadyMixin.java:19: error: cannot find symbol
                DGU.getCurrentlyRunningServer().getRunDirectory().toPath()
                                                                 ^
  symbol:   method toPath()
  location: interface Path
/workspaces/minecraft-data-generator-server/1.21/src/main/java/dev/u9g/minecraftdatagenerator/generators/InstrumentsDataGenerator.java:17: error: cannot find symbol
        for (Instrument instrument : Instrument.values()) {
                                     ^
  symbol:   variable Instrument
  location: class InstrumentsDataGenerator
/workspaces/minecraft-data-generator-server/1.21/src/main/java/dev/u9g/minecraftdatagenerator/generators/InstrumentsDataGenerator.java:17: error: cannot find symbol
        for (Instrument instrument : Instrument.values()) {
             ^
  symbol:   class Instrument
  location: class InstrumentsDataGenerator
/workspaces/minecraft-data-generator-server/1.21/src/main/java/dev/u9g/minecraftdatagenerator/generators/ItemsDataGenerator.java:35: error: incompatible types: List<RegistryEntryList<Item>> cannot be converted to List<TagKey<Item>>
                .toList();
                       ^
/workspaces/minecraft-data-generator-server/1.21/src/main/java/dev/u9g/minecraftdatagenerator/generators/TintsDataGenerator.java:54: error: cannot find symbol
        resultColors.put(Blocks.BIRCH_LEAVES, FoliageColors.getBirchColor());
                                              ^
  symbol:   variable FoliageColors
  location: class TintsDataGenerator
/workspaces/minecraft-data-generator-server/1.21/src/main/java/dev/u9g/minecraftdatagenerator/generators/TintsDataGenerator.java:55: error: cannot find symbol
        resultColors.put(Blocks.SPRUCE_LEAVES, FoliageColors.getSpruceColor());
                                               ^
  symbol:   variable FoliageColors
  location: class TintsDataGenerator
/workspaces/minecraft-data-generator-server/1.21/src/main/java/dev/u9g/minecraftdatagenerator/generators/EnchantmentsDataGenerator.java:47: error: cannot find symbol
        enchantmentDesc.addProperty("displayName", DGU.translateText(enchantment.getTranslationKey()));
                                                                                ^
  symbol:   method getTranslationKey()
  location: variable enchantment of type Enchantment
/workspaces/minecraft-data-generator-server/1.21/src/main/java/dev/u9g/minecraftdatagenerator/generators/EnchantmentsDataGenerator.java:53: error: cannot find symbol
        enchantmentDesc.addProperty("treasureOnly", enchantment.isTreasure());
                                                               ^
  symbol:   method isTreasure()
  location: variable enchantment of type Enchantment
/workspaces/minecraft-data-generator-server/1.21/src/main/java/dev/u9g/minecraftdatagenerator/generators/EnchantmentsDataGenerator.java:54: error: cannot find symbol
        enchantmentDesc.addProperty("curse", enchantment.isCursed());
                                                        ^
  symbol:   method isCursed()
  location: variable enchantment of type Enchantment
/workspaces/minecraft-data-generator-server/1.21/src/main/java/dev/u9g/minecraftdatagenerator/generators/EnchantmentsDataGenerator.java:57: error: cannot find symbol
                .filter(other -> !enchantment.canCombine(other))
                                             ^
  symbol:   method canCombine(Enchantment)
  location: variable enchantment of type Enchantment
/workspaces/minecraft-data-generator-server/1.21/src/main/java/dev/u9g/minecraftdatagenerator/generators/EnchantmentsDataGenerator.java:68: error: incompatible types: RegistryEntryList<Item> cannot be converted to TagKey<Item>
        enchantmentDesc.addProperty("category", getEnchantmentTargetName(enchantment.getApplicableItems()));
                                                                                                       ^
/workspaces/minecraft-data-generator-server/1.21/src/main/java/dev/u9g/minecraftdatagenerator/generators/EnchantmentsDataGenerator.java:70: error: cannot find symbol
        enchantmentDesc.addProperty("tradeable", enchantment.isAvailableForEnchantedBookOffer());
                                                            ^
  symbol:   method isAvailableForEnchantedBookOffer()
  location: variable enchantment of type Enchantment
/workspaces/minecraft-data-generator-server/1.21/src/main/java/dev/u9g/minecraftdatagenerator/generators/EnchantmentsDataGenerator.java:71: error: cannot find symbol
        enchantmentDesc.addProperty("discoverable", enchantment.isAvailableForRandomSelection());
                                                               ^
  symbol:   method isAvailableForRandomSelection()
  location: variable enchantment of type Enchantment
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
15 errors

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':1.21:compileJava'.
> Compilation failed; see the compiler error output for details.

* Try:
> Run with --info option to get more log output.
> Run with --scan to get full insights.

BUILD FAILED in 42s
8 actionable tasks: 3 executed, 5 up-to-date

@BlockyBlockling
Copy link

Whats still missing here? Id like to help!

@Madlykeanu
Copy link
Contributor

Madlykeanu commented Oct 14, 2024

image

/workspaces/minecraft-data-generator-server/1.21/src/main/java/dev/u9g/minecraftdatagenerator/generators/EnchantmentsDataGenerator.java:47: error: cannot find symbol
        enchantmentDesc.addProperty("displayName", DGU.translateText(enchantment.getTranslationKey()));
                                                                                ^
  symbol:   method getTranslationKey()
  location: variable enchantment of type Enchantment

old displayname code:

image

maybe we can use getName instead? im not sure of the purpose of translation keys but its been removed and getName added, but it accepts a level argument so im not really sure how we should handle this, wouldnt it return like "Unbreaking III"? we just want the displayname without a level for this right?

ill test to see exactly what it returns later

@Madlykeanu
Copy link
Contributor

it looks like the isCursed() is completely removed, i couldnt find an equivelant in the mappings maybe we will just have to have a list and add known cursed enchantments and new ones manually in the data generator idk
image
im assuming its the same with isTreasure aswell
alot of enchantment stuff is changed

@Madlykeanu
Copy link
Contributor

ive just done the list solution for now for getting the "treasure only" and "cursed" field.
i dont like this but im not sure what else we can do since there dosnt seem to be an equivelent method.
image

image

@Madlykeanu
Copy link
Contributor

maybe we could do smth to determine if its treasure with the weight since apparently enchantments that cant be obtained from enchantment tables have a weight of 0
idk about cursed yet tho

@Madlykeanu
Copy link
Contributor

Madlykeanu commented Oct 15, 2024

i looked at the enchantment weights of treasure enchants in 1.20.6 data and none of them are 0, most of them are 1 and some of them even have weights of 2 so sadly we cant use this to determine whether its treasure or not since some non treasure enchants have weights of 1 and 2.

some treasure enchants from 1.20.6:
image
image
image

non treasure enchants from 1.20.6
image
image
image

we might just have to add them manually to a list from now on unless theres some other way

@Madlykeanu
Copy link
Contributor

Madlykeanu commented Oct 15, 2024

it dosnt look like the curse and isTreasure properties arent even used for anything in mineflayer so ig we could either remove that property since its not in the code anymore, or just manually update a list with new treasure enchants for each new version, for projects other then mineflayer that might use it

* update classname

* update moved class

* updated to equivelant method since gettranslatekey removed

* added isCursed list as bandaid alternative for now since isCursed() removed

* added isTreasure list as bandaid alternative for now since isTreasure() removed

* found alternative method to canCombine() since removed

* modified getEnchantmentTarget name to handle registryEntryList since getApplicableItems dosnt return tagKey anymore

* bandaid list solution for "tradeable" property since isTradeable removed and no alternative in mappings

* bandaid solution for discoverable property since removed and no alternative to isAvailiableForRandomSelection in 1.21 mappings

* removed .toPath since apparently it dosnt exist

* no longer outputs in tagkey format

* fixed not adding enchantcategories for items properly

* added SuperGamerTron tag solution
@rom1504
Copy link
Member

rom1504 commented Oct 27, 2024

Are there still useful changes here? If yes can you please rebase on master ?

@rom1504 rom1504 marked this pull request as ready for review October 27, 2024 10:16
@AlexProgrammerDE
Copy link
Collaborator

@rom1504
Copy link
Member

rom1504 commented Oct 27, 2024

Added, runs, merging

@rom1504 rom1504 merged commit 2c423f7 into main Oct 27, 2024
21 checks passed
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.

5 participants