Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-150635

EntityCatSplitFix does not properly retain newly set Trusting tag during datafixing

    XMLWordPrintable

Details

    • Bug
    • Status: Open
    • Resolution: Unresolved
    • Minecraft 1.14, 1.15 Pre-release 6
    • None
    • None
    • Confirmed
    • (Unassigned)

    Description

      EntityCatSplitFix does not properly retain the newly set Trusting tag when datafixing minecraft:ocelot - the Dynamic is not re-assigned after setting Trusted, and Dynamic instances are not mutable:

       protected Pair<String, Dynamic<?>> getNewNameAndTag(final String lvt_1_0_, Dynamic<?> lvt_2_0_) {
          if(Objects.equals("minecraft:ocelot", lvt_1_0_)) {
            final int i = lvt_2_0_.get("CatType").asInt(0);
            if(i == 0) {
              final String s = lvt_2_0_.get("Owner").asString("");
              final String s1 = lvt_2_0_.get("OwnerUUID").asString("");
              if(s.length() > 0 || s1.length() > 0) {
                lvt_2_0_.set("Trusting", lvt_2_0_.createBoolean(true));
              }
            } else if(i > 0 && i < 4) {
              lvt_2_0_ = lvt_2_0_.set("CatType", lvt_2_0_.createInt(i));
              lvt_2_0_ = lvt_2_0_.set("OwnerUUID", lvt_2_0_.createString(lvt_2_0_.get("OwnerUUID").asString("")));
              return Pair.of("minecraft:cat", lvt_2_0_);
            }
          }
      
          return Pair.of(lvt_1_0_, lvt_2_0_);
        }
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              kashike [Mod] Riley Park
              Votes:
              1 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                CHK: