Jump to content

Recommended Posts

Posted

Hey guys!

Recently I started modding with trying to update a mod (from 1.12/1.13 to 1.15)that i like.  

I now have the problem that a lot of stuff changed. I figure out most of them(hopefully) but there are a few that i can't figure out.
Is there documentation that lists all major changes? I'm bored of looking for mods that exist in both versions and using the exact same features and seeing how they did it.

Posted

williewillus has an explanation of the changes in 1.13/1.14 here and 1.15 here.

  • Thanks 1

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

  • 3 weeks later...
  • 5 weeks later...
Posted

Ok so this is from the first library.

This is a library for multible mods. I did not  create any part of it, so I don't know what some parts.

 

 

   public static Field findField(Class<?> clazz, String srg)
    {
        try {
            String remapped = ObfuscationReflectionHelper.remapName(srg);

            Field f = clazz.getDeclaredField(remapped);
            f.setAccessible(true);
            return f;
        }
        catch (Exception e) {
            throw new RuntimeException(e);
        }
    }

The method remapName(INameMappingService.Domain, String) in the type ObfuscationReflectionHelper is not applicable for the arguments (String)

 

 public IvWorldData(CompoundNBT compound, MCRegistry registry)
    {
        compound = compound.copy(); // Copy since ID fix tags are being removed when being applied
        final DataFixer fixer = DataFixesManager.getDataFixer();

        blockCollection = new IvBlockCollection(compound.getCompound("blockCollection"), registry);

        tileEntities = new ArrayList<>();
        tileEntities.addAll(NBTTagLists.compoundsFrom(compound, "tileEntities"));
        tileEntities.forEach(teCompound -> NBTStateInjector.recursivelyApply(teCompound, registry, false));
        tileEntities.replaceAll(teCompound -> NBTUtil.update(fixer, TypeReferences.BLOCK_ENTITY, teCompound, 0));

        entities = new ArrayList<>();
        entities.addAll(NBTTagLists.compoundsFrom(compound, "entities"));
        entities.forEach(entityCompound -> NBTStateInjector.recursivelyApply(entityCompound, registry, false));
        tileEntities.replaceAll(teCompound -> NBTUtil.update(fixer, TypeReferences.ENTITY, teCompound, 0));
    }

The method update(DataFixer, DefaultTypeReferences, CompoundNBT, int) in the type NBTUtil is not applicable for the arguments (DataFixer, DSL.TypeReference, CompoundNBT, int)

 

public static void moveEntityDefault(Entity entity, BlockPos dist)
    {
        if (entity instanceof EntityHanging)
        {
            EntityHanging entityHanging = (EntityHanging) entity;
            BlockPos hangingPosition = entityHanging.getHangingPosition().add(dist);
            entityHanging.setPosition(hangingPosition.getX(), hangingPosition.getY(), hangingPosition.getZ());
        }
        else
        {
            entity.setPosition(entity.getPosX() + dist.getX(), entity.getPosY() + dist.getY(), entity.getPosZ() + dist.getZ());
        }

        if (entity instanceof CreatureEntity)
        {
        	CreatureEntity entityCreature = (CreatureEntity) entity;
            EntityCreatureAccessor.setHomePosition(entityCreature, entityCreature.getHomePosition().add(dist));
        }
    }

EntityHanging cannot be resolved to a type

 

public static List<ServerPlayerEntity> getPlayersWatchingChunk(World world, int chunkX, int chunkZ)
    {
        if (world.isRemote || !(world instanceof ServerWorld))
        {
            return Collections.emptyList();
        }

        ArrayList<ServerPlayerEntity> playersWatching = new ArrayList<>();

        ServerWorld server = (ServerWorld) world;
        PlayerChunkMap playerManager = server.getPlayerChunkMap();

        List<ServerPlayerEntity> mpplayers = server.getPlayers();

        playersWatching.addAll(mpplayers.stream().filter(player -> playerManager.isPlayerWatchingChunk(player, chunkX, chunkZ)).collect(Collectors.toList()));

        return playersWatching;
    }

PlayerChunkMap cannot be resolved to a type

The method getPlayerChunkMap() is undefined for the type ServerWorld

 

    public static Effect[] readNBTPotions(String id, CompoundNBT compound)
    {
        if (compound.contains(id))
        {
        	ListNBT nbtTagList = compound.getList(id, Constants.NBT.TAG_STRING);
            Effect[] potions = new Effect[nbtTagList.size()];

            for (int i = 0; i < potions.length; i++)
                potions[i] = Effect.read(nbtTagList.getCompound(i));

            return potions;
        }

        return null;
    }

    public static void writeNBTPotions(String id, Effect[] potions, CompoundNBT compound)
    {
        if (potions != null)
        {
            ListNBT nbtTagList = new ListNBT();

            for (Effect p : potions)
                nbtTagList.add(p.write(new CompoundNBT()));

            compound.put(id, nbtTagList);
        }
    }

The method read(CompoundNBT) is undefined for the type Effect

The method write(CompoundNBT) is undefined for the type Effect

 

@Override
        public boolean removeEntity(Entity entity)
        {
            world.removeEntity(entity);
            return true;
        }

The method removeEntity(Entity) is undefined for the type World

 

@Override
        public List<Entity> getEntities(AxisAlignedBB bounds, @Nullable Predicate<? super Entity> predicate)
        {
            return worldData.entities.stream()
                    .filter(nbt ->
                    {
                    	ListNBT pos = nbt.getList("Pos", 6);
                        return bounds.contains(new Vec3d(pos.getDouble(0), pos.getDouble(1), pos.getDouble(2)));
                    })
                    .map(nbt -> EntityType.create(nbt, IvTileEntityHelper.getAnyWorld()))
                    .filter(predicate)
                    .collect(Collectors.toList());
        }

Cannot infer type argument(s) for <R> map(Function<? super T,? extends R>)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • I have a custom 3d model which works perfectly. BUT I want it to be held diffrently on the players hand when the item is being used. My JSON file under assets/examplemod/items looks like this: { "model": { "type": "minecraft:condition", "on_false": { "type": "minecraft:model", "model": "examplemod:item/example_item" }, "on_true": { "type": "minecraft:model", "model": "examplemod:item/example_item_using" }, "property": "minecraft:using_item" } }   This works fine until the item is used. The correct model will be displayed but with a full black texture instead of the actuall texture. Any idea why? (I want to use the exact same texture for both items, because their model is the same just diffrent displays on firstperson_righthand and firstperson_lefthand). The models JSON's are fully blockbench files inlcuding the elements, display, textures with texture_size.   Also is this the correct way to do it? Because it feels so dumb to change the exact same model just for a diffrent right- and lefthand view.   (fyi: ItemUseAnimation is BLOCK for this item)
    • I just backed up my world then tried to create new mod with currently equipped mod but with new world still made same error. Sooo I think it's not world error. also It's working fine on singleplayer. + but it made some another weird error with new world
    • Maybe the file is too large - you can upload the log file via Mediafire
    • Create a new instance and start with Embeddium + Oculus Then add new mods one by one or in groups The "IncompatibleClassChangeError: class net.coderbot.iris.gui.option.ShadowDistanceOption" often appears in connection with an incompatible mod
    • I hosted forge modded server using feather client I was able to join without any issues yesterday, but today after I tested my shader on my single world then tried to join the world but it made error meassage. (I also changed server.properties's render settings, but I reverted it as same as yesterday) So I removed my shader and removed optifine on server and on my mod file then it made this error: Internal Exception: io.netty.handler.codec.DecoderException: net.minecraft.ResourceLocationException: Non [a-z0-9/-1 character in path of location: inecraft:ask_server\u0012\u0001\uFFFD\n\u0007targets\u001D\u0001\u0014minecraft:ask_server\u0012\u0002\uFFFD\n\uFFFD\n\u0002id!\u0014minecraft:ask_server\u0002 \u0001\uFFFD\n\u0006target\u0006\u0001\u0002\u0001\uFFFD\n\ttarget My server/client is 1.20.1 forge. And I got 34 mods total, it was working pretty fine yesterday (I did not add/remove any mods before it started happening) I hope it's not about my worlds, it's been quite long since using this world I'm not native english speaker so there may be grammar issue! Thank you for reading!
  • Topics

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.