Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

My mob is stopping 𝐨𝐧𝐞 𝐛𝐥𝐨𝐜𝐤 before it's target position??


Recommended Posts

My Entity is stopping one block from it's target almost every time. 

 

I added a BreakBlockGoal to my entity (the same goal that zombies have to crush turtle eggs) with the arbitrary target block of Orange Wool. But on my entity it regularly approaches the block and then stops one block before the destination. What might be causing this? My Entity extends Tameable Entity and it's a bipedal model. 

 

Things I think I might be

- The model size?

- The bounding box?

- Something about tameable entity's tick() running slower?

Link to post
Share on other sites
3 minutes ago, poopoodice said:

better post your code as well so people can see if there's anything to do with your code

The issue happens with any MoveToBlockGoal, regardless of my code. Nothing in my entity's code seems to effect the navigator so I think my entity's scale or bounding box.

 

Just in case, here's my entity class code...

package com.shilohthecreator.firsttestmod.entities;

import com.google.common.collect.ImmutableSet;
import com.shilohthecreator.firsttestmod.FirstTestMod;
import com.shilohthecreator.firsttestmod.goals.*;
import com.shilohthecreator.firsttestmod.init.CustomEntityTypes;
import net.minecraft.block.Block;
import net.minecraft.block.Blocks;
import net.minecraft.entity.*;
import net.minecraft.entity.ai.goal.*;
import net.minecraft.entity.item.ItemEntity;
import net.minecraft.entity.merchant.villager.AbstractVillagerEntity;
import net.minecraft.entity.monster.CreeperEntity;
import net.minecraft.entity.monster.GhastEntity;
import net.minecraft.entity.monster.MonsterEntity;
import net.minecraft.entity.passive.TameableEntity;
import net.minecraft.entity.passive.WolfEntity;
import net.minecraft.entity.passive.horse.AbstractHorseEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.projectile.AbstractArrowEntity;
import net.minecraft.entity.projectile.ProjectileHelper;
import net.minecraft.inventory.EquipmentSlotType;
import net.minecraft.inventory.Inventory;
import net.minecraft.item.ArmorItem;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.nbt.ListNBT;
import net.minecraft.network.datasync.DataParameter;
import net.minecraft.network.datasync.DataSerializers;
import net.minecraft.network.datasync.EntityDataManager;
import net.minecraft.potion.EffectInstance;
import net.minecraft.potion.Effects;
import net.minecraft.tags.ItemTags;
import net.minecraft.util.*;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;
import net.minecraft.world.World;
import net.minecraft.world.server.ServerWorld;

import javax.swing.plaf.synth.SynthScrollBarUI;
import java.util.Set;
import java.util.function.Predicate;



public class LavaAnimal extends TameableEntity implements IRangedAttackMob {

    private int exampleTimer;
    int scanningRange = 12;
    int inventorySize = 5;
    
    private final Inventory mainInventory = new Inventory(inventorySize);
    public final NonNullList<ItemStack> armorInventory = NonNullList.withSize(4, ItemStack.EMPTY);
    
    public static final Predicate<LivingEntity> TARGET_ENTITIES = (p_213440_0_) -> {
        EntityType<?> entitytype = p_213440_0_.getType();
        return entitytype == EntityType.SKELETON || entitytype == EntityType.ZOMBIE || entitytype == EntityType.SPIDER;
    };


    //CREATE BITS OF DATA TO STORE OVER TIME
    private static final DataParameter<Integer> ANIMAL_MODE = EntityDataManager.createKey(LavaAnimal.class, DataSerializers.VARINT);
    private static final DataParameter<BlockPos> GUARDING_POSITION = EntityDataManager.createKey(LavaAnimal.class, DataSerializers.BLOCK_POS);

    private final FollowOwnerGoal followOwner = new FollowOwnerGoal(this, 1.0D, 10.0F, 2.0F, false);

    private final MeleeAttackWithSpeedGoal meleeAttackWithSpeedGoal = new MeleeAttackWithSpeedGoal(this, 1.1D, false, 7);
    private final RangedVillagerBowAttackGoal rangedVillagerBowAttackGoal = new RangedVillagerBowAttackGoal(this, 0.1f,10, scanningRange, false);
    private final WaterAvoidingRandomWalkingGoal waterAvoidRandomWalkingGoal =  new WaterAvoidingRandomWalkingGoal(this, 2.00D);
    private final MoveToBlockPosGoal moveToBlockPosGoal=  new MoveToBlockPosGoal(new BlockPos(BlockPos.ZERO), this, 1.0f,3);
    //private final MineNearestBlockGoal mineNearestBlockGoal = new MineNearestBlockGoal(Blocks.STRIPPED_OAK_LOG, this, 1.0f, 8, 4);
    //private final MineNearestBlockGoal mineNearestBlockGoal2 = new MineNearestBlockGoal(Blocks.OAK_LOG, this, 1.0f, 8, 4);
    private final testNavigatorGoal testNavigatorGoal = new testNavigatorGoal(Blocks.ORANGE_WOOL, this,1.0f,3);
    private final NearestAttackableTargetInRangeGoal NATInRangeGoal = new NearestAttackableTargetInRangeGoal<>(this, MonsterEntity.class, false,new BlockPos(BlockPos.ZERO), scanningRange);
    private final HurtByTargetNoReinforcementsGoal hurtByTargetNoReinforcementsGoal = new HurtByTargetNoReinforcementsGoal(this);

    public LavaAnimal(EntityType<? extends TameableEntity> type, World worldIn) {

        super(type, worldIn);
        this.enablePersistence();
        this.getNavigator().setCanSwim(true);
        this.setCanPickUpLoot(true);

    }

    @Override
    public AgeableEntity createChild(AgeableEntity ageable) {

        LavaAnimal animal = new LavaAnimal(CustomEntityTypes.LAVA_ANIMAL.get(), this.world);
        animal.onInitialSpawn(this.world, this.world.getDifficultyForLocation(new BlockPos(animal)), SpawnReason.BREEDING, (ILivingEntityData) null, (CompoundNBT) null);

        //YOU CAN DO STUFF HERE
        animal.setGlowing(true);

        return animal;
    }


    @Override
    protected void registerGoals(){

        super.registerGoals();

        this.goalSelector.addGoal(0, new SwimGoal(this));
       // this.goalSelector.addGoal(7, new LookAtGoal(this, MonsterEntity.class, 30.0f));
        //this.goalSelector.addGoal(7, new LookAtGoal(this, PlayerEntity.class, 10.0f));
        //this.goalSelector.addGoal(8, new LookRandomlyGoal(this));


    }

    @Override
    protected void registerAttributes() {
        super.registerAttributes();
        this.getAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(30.0D);
        this.getAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.33D);
        this.getAttributes().registerAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).setBaseValue(6.0D);
    }



    @Override
    public void livingTick() {

        if (this.world.isRemote){
            this.exampleTimer = Math.max(0, this.exampleTimer - 1);
        }


        if (this.getAttackTarget() != null){
            this.getAttackTarget().addPotionEffect(new EffectInstance(Effects.GLOWING, 15, 255));
        }



        if (isSwingInProgress){

            this.updateArmSwingProgress();

        }

//        if (!this.world.isRemote()){
//
//            System.out.println("ms " + this.moveStrafing);
//            System.out.println("mf " + this.moveForward);
//
//        }
        super.livingTick();
    }

    @Override
    public void setMoveStrafing(float amount) {
        if (getAttackTarget() == null){
            this.moveStrafing = 0;

        } else {
            super.setMoveStrafing(amount);

        }
    }

    /**
     * CALLED BY MOB ENTITY IN LIVING TICK WHEN AN ITEM IS DROPPED NEARBY
     */

    protected void updateEquipmentIfNeeded(ItemEntity droppedItem) {
            
        //The item on the ground
        ItemStack droppedStack = droppedItem.getItem();
        //The Slot that it should go in
        EquipmentSlotType equipmentslottype = getSlotForItemStack(droppedStack);
        //The item we currently have in that slot
        ItemStack currentItem = this.getItemStackFromSlot(equipmentslottype);

        ItemStack currentItem2 = armorInventory.get(equipmentslottype.getIndex());


        //IF THIS  IS A KNOWN PIECE OF EQUIPMENT (TOOLS ARMOUR)
        if (ItemTags.getCollection().get(new ResourceLocation(FirstTestMod.MOD_ID, "villagertools")).contains(droppedItem.getItem().getItem())){

            //Mob Entity has func for this, checks which item does/blocks more damage
            boolean newItemIsBetter = this.shouldExchangeEquipment(droppedStack, currentItem, equipmentslottype);

            if (newItemIsBetter) {

                this.entityDropItem(currentItem, 0.5f);

                this.setItemStackToSlot(equipmentslottype, droppedStack);

                this.onItemPickup(droppedItem, droppedItem.getItem().getCount());

                droppedItem.remove();

                armorInventory.set(equipmentslottype.getIndex(),droppedStack);

                System.out.println("Setting " + droppedStack.getItem().getRegistryName() + " to replace" + currentItem2.getItem().getRegistryName());


            } else {

                //PLAY GRUNT SOUND

            }

        } else {


            int emptySlot = -1;
            if (!isInventoryFull()){
                //LOOK FOR A STACK OF THE SAME ITEM SOMEWHERE
                for(int i = 0; i < this.mainInventory.getSizeInventory(); ++i) {

                    ItemStack itemStackInSlot = mainInventory.getStackInSlot(i);


                    if (itemStackInSlot.getItem() == droppedStack.getItem() && itemStackInSlot.getCount() < itemStackInSlot.getItem().getItemStackLimit(itemStackInSlot)) {


                        this.onItemPickup(droppedItem, droppedItem.getItem().getCount());

                        //INCREASE THE SLOT SIZE BY 1
                        mainInventory.setInventorySlotContents(i,new ItemStack(itemStackInSlot.getItem(), itemStackInSlot.getCount() + droppedStack.getCount()));

                        droppedItem.remove();

                        /*
                        System.out.println("-----");
                        System.out.println("There are " + mainInventory.getStackInSlot(i).getCount() + " " + itemStackInSlot.getItem().getRegistryName() + "s in this slot");
                        System.out.println("is the same item? " + (itemStackInSlot.getItem() == droppedStack.getItem()));
                        System.out.println("Max stack for this item is "+ itemStackInSlot.getItem().getItemStackLimit(itemStackInSlot));
                        */

                        return;

                    } else if (itemStackInSlot.isEmpty()) {
                        emptySlot = i;
                    }



                }
                //IF WE FOUND AN EMPTY SLOT PUT IT THERE
                if (emptySlot != -1){

                    this.onItemPickup(droppedItem, droppedItem.getItem().getCount());

                    //INCREASE THE SLOT SIZE BY 1
                    mainInventory.setInventorySlotContents(emptySlot,droppedStack);

                    droppedItem.remove();

                    return;
                }

            } else {
               //INVENTORY FULL
                // PLAY GRUNT SOUND
            }



        }

    }
    /**
     * Attack the specified entity using a ranged attack.
     */
    public void attackEntityWithRangedAttack(LivingEntity target, float distanceFactor) {
        ItemStack itemstack = this.findAmmo(this.getHeldItem(ProjectileHelper.getHandWith(this, Items.BOW)));
        AbstractArrowEntity abstractarrowentity = this.fireArrow(itemstack, distanceFactor);
        if (this.getHeldItemMainhand().getItem() instanceof net.minecraft.item.BowItem)
            abstractarrowentity = ((net.minecraft.item.BowItem)this.getHeldItemMainhand().getItem()).customeArrow(abstractarrowentity);
        double d0 = target.getPosX() - this.getPosX();
        double d1 = target.getPosYHeight(0.3333333333333333D) - abstractarrowentity.getPosY();
        double d2 = target.getPosZ() - this.getPosZ();
        double d3 = (double) MathHelper.sqrt(d0 * d0 + d2 * d2);
        abstractarrowentity.shoot(d0, d1 + d3 * (double)0.2F, d2, 1.6F, (float)(14 - this.world.getDifficulty().getId() * 4));
        this.playSound(SoundEvents.ENTITY_SKELETON_SHOOT, 1.0F, 1.0F / (this.getRNG().nextFloat() * 0.4F + 0.8F));
        this.world.addEntity(abstractarrowentity);
    }

    /**
     * Fires an arrow
     */
    protected AbstractArrowEntity fireArrow(ItemStack arrowStack, float distanceFactor) {
        return ProjectileHelper.fireArrow(this, arrowStack, distanceFactor);
    }


    @Override
    protected void registerData() {
        super.registerData();
        this.getDataManager().register(ANIMAL_MODE, 0);
        this.getDataManager().register(GUARDING_POSITION, BlockPos.ZERO);
    }


    @Override
    public boolean processInteract(PlayerEntity player, Hand hand) {

        if (hand == Hand.MAIN_HAND){

            this.setTamedBy(player);

            if (getAnimalMode() == 1){

                setAnimalMode(0);

            } else {

                setGuardingPosition(this.getPosition());
                setAnimalMode(1);

                player.world.setBlockState(this.getGuardingPosition().down(), Blocks.RED_WOOL.getDefaultState());

            }
        }

        updateGoalData();
        addProperGoalSet();

        return true;
    }

    @Override
    public void onCollideWithPlayer(PlayerEntity entityIn) {
        super.onCollideWithPlayer(entityIn);

        for(int i = 0; i < this.mainInventory.getSizeInventory(); ++i) {

            if (!this.mainInventory.getStackInSlot(i).isEmpty()){
                this.entityDropItem(this.mainInventory.getStackInSlot(i));
                mainInventory.removeStackFromSlot(i);
            }
        }

    }

    public void addProperGoalSet(){

        if (getAnimalMode() == 0){
            //FOLLOW MODE
            this.goalSelector.removeGoal(moveToBlockPosGoal);
            this.goalSelector.removeGoal(meleeAttackWithSpeedGoal);
            this.goalSelector.removeGoal(rangedVillagerBowAttackGoal);
            this.targetSelector.removeGoal(NATInRangeGoal);
            this.targetSelector.removeGoal(hurtByTargetNoReinforcementsGoal);

            this.goalSelector.addGoal(2, testNavigatorGoal);
            //this.goalSelector.addGoal(2, mineNearestBlockGoal);
            //this.goalSelector.addGoal(3, mineNearestBlockGoal2);
            this.goalSelector.addGoal(4, followOwner);
            //this.goalSelector.addGoal(5, waterAvoidRandomWalkingGoal);

        } else {
            //GUARDING MODE

            this.goalSelector.removeGoal(followOwner);
           // this.goalSelector.removeGoal(mineNearestBlockGoal);
            //this.goalSelector.removeGoal(mineNearestBlockGoal2);
            //this.goalSelector.removeGoal(waterAvoidRandomWalkingGoal);

            this.goalSelector.removeGoal(testNavigatorGoal);
            this.targetSelector.addGoal(1, hurtByTargetNoReinforcementsGoal);
            this.targetSelector.addGoal(2, NATInRangeGoal);
            this.goalSelector.addGoal(2, meleeAttackWithSpeedGoal);
            this.goalSelector.addGoal(2,rangedVillagerBowAttackGoal);
            this.goalSelector.addGoal(3, moveToBlockPosGoal);



        }
    }
    public void updateGoalData(){

        if (getAnimalMode() == 1){

            System.out.println("Telling the goals where guarding position is" + getGuardingPosition());

            this.moveToBlockPosGoal.setDestinationPos(getGuardingPosition());
            this.NATInRangeGoal.setGuardingPos(getGuardingPosition());


        } else {
            //UPDATE ANY DATA NEEDED FOR FOLLOW MODE


        }
    }

    /**
     * Damages armor in each slot by the specified amount.
     */

    public void damageArmor(float damage) {
        System.out.println("Trying to damage armour");
        if (!(damage <= 0.0F)) {
            damage = damage / 4.0F;
            if (damage < 1.0F) {
                damage = 1.0F;
            }

            for(int i = 0; i < this.armorInventory.size(); ++i) {
                ItemStack itemstack = this.armorInventory.get(i);
                if (itemstack.getItem() instanceof ArmorItem) {
                    int j = i;
                    itemstack.damageItem((int)damage, this, (p_214023_1_) -> {
                        p_214023_1_.sendBreakAnimation(EquipmentSlotType.fromSlotTypeAndIndex(EquipmentSlotType.Group.ARMOR, j));
                    });
                }
            }

        }
    }
    public int getAnimalMode(){return this.getDataManager().get(ANIMAL_MODE);}
    public void setAnimalMode(int mode){ this.getDataManager().set(ANIMAL_MODE, mode); }
    public void setGuardingPosition(BlockPos pos){this.getDataManager().set(GUARDING_POSITION, pos); }
    public BlockPos getGuardingPosition(){return this.getDataManager().get(GUARDING_POSITION);}
    public boolean isInventoryFull(){
        boolean inventoryFull = true;

        //CHECK IF OUR INVENTORY IS FULL
        for(int i = 0; i < this.mainInventory.getSizeInventory(); i++) {
            if (mainInventory.getStackInSlot(i).isEmpty()){
                inventoryFull = false;
            }
        }

        return inventoryFull;
    }

    public void readAdditional(CompoundNBT compound) {

        System.out.println("Im READING with " + this.goalSelector.getRunningGoals() + " goals right now");
        super.readAdditional(compound);

        System.out.println("Reading Compounds");

        //GUARDING POSITION
        if (compound.contains("GUARDING_POSITION")){

            int[] gpArrray = compound.getIntArray("GUARDING_POSITION");


            BlockPos constructedGuardingPos = new BlockPos(gpArrray[0],gpArrray[1],gpArrray[2]);
            System.out.println("Found guarding position in here" + constructedGuardingPos);
            setGuardingPosition(constructedGuardingPos);
        }

        //ANIMAL MODE
        int mode = compound.getInt("AnimalMode");
        setAnimalMode(mode);
        System.out.println("We were in mode " + mode);

        //INVENTORY
        if (compound.contains("Inventory", 10) ){
            System.out.println(compound.getList("Inventory", 10).size());
        }
        ListNBT listnbt = compound.getList("Inventory", 10);

        for(int i = 0; i < listnbt.size(); ++i) {
            ItemStack itemstack = ItemStack.read(listnbt.getCompound(i));
            if (!itemstack.isEmpty()) {
                System.out.println("Adding" + itemstack);
                this.mainInventory.addItem(itemstack);
            }
        }

        updateGoalData();
        addProperGoalSet();

    }
    public void writeAdditional(CompoundNBT compound){

        System.out.println("Im writing with " + this.goalSelector.getRunningGoals().count() + " goals right now");
        super.writeAdditional(compound);

        System.out.println("Writing Compounds");

        //SAVE THE MODE
        compound.putInt("AnimalMode", this.getAnimalMode());

        //SAVE THE GUARDING POSITION
        if (getGuardingPosition() != BlockPos.ZERO){
            BlockPos GP = getGuardingPosition();
            int[] guardingPosAsArray = {GP.getX(),GP.getY(),GP.getZ()};
            compound.putIntArray("GUARDING_POSITION",guardingPosAsArray);
        }

        //SAVE INVENTORY
        ListNBT listnbt = new ListNBT();
        for(int i = 0; i < this.mainInventory.getSizeInventory(); ++i) {
            ItemStack itemstack = this.mainInventory.getStackInSlot(i);
            if (!itemstack.isEmpty()) {
                listnbt.add(itemstack.write(new CompoundNBT()));
            }
        }

        compound.put("Inventory", listnbt);

    }

}

 

Edited by Speedy1000
Link to post
Share on other sites
17 hours ago, ChampionAsh5357 said:
Quote

You can check that with the debug hotkeys.

Yes I've looked at my entity through f3+B view to see the bounding box but everything is normal there, it's the same size as the zombie's hitbox.

Quote

If you want to show us the actual goal you written, it would be easier to find the solution.

As I said, this problem happens with ANY call of "tryToMoveToXYZ()" so it's nothing to do with my goal's code. Just wondering if someone can provide insight to how the navigator decides that it has reached its destination, because that's happening 1 block early.

 

Link to post
Share on other sites

Hey,

 

Lets make simple things to test complex things:

 

Create a single player world, customized to be superflat (this way, nothing will hinder you)

Enter creative mode, put your specific block anywhere (write down the block positions)

Put a breakpoint somewhere in the code to stop when the mod gets the goal to that block

Spawn your mob a few blocks near these block

At the breakpoint, watch the variable that have the final destination position, this must be the same coords of the block!  (see if rounding problems is occuring here).

 

Good luck.

 

†GnR† Slash

can one man truly make a difference?

Link to post
Share on other sites

After doing some more testing I've realized that every single time I place the target block (orange wool in this case) on the same Y level as my entity, it stops one block before.

 

However, if I place it above or below the Y level that the entity is currently on, it perfectly walks to it and arrives directly on top of it.

 

*Also if I place the block exactly diagonal to the entity it works, no matter what the Y level. As soon as the entity has to approach the destination from one of it's sides it can't do it.

 

There must be some issue it's having setting a path that is one block away. I've tried changing the entity's width (which would change the navigators "maxDistanceToWaypoint") but that doesn't make a noticeable difference. Any thoughts on why this might be happening? I've made a flat grass world for these tests and have many debug messages which all indicate that the "targetPosition" is indeed the orange wool, however the last point of the current path (getFinalPathPoint()) is actually one block before; where the entity ends up arriving.

Edited by Speedy1000
New discovery
Link to post
Share on other sites

 

On 6/24/2020 at 4:26 PM, poopoodice said:

I'm not so sure but I just have a quick look in PathNavigator func_225464_a line 138, it seems like the destination is extended to an 3x3 area and I think that might be the issue

is this incorrect or not related?

Edited by poopoodice
Link to post
Share on other sites
13 hours ago, poopoodice said:

 

is this incorrect or not related?

I had a look at that line and figured out that it's creating that region around the players position, still I guess it could be the problem but that wouldn't explain why it's working sometimes and not others.

Link to post
Share on other sites

I wonder if this has to do with blocks' position is the lower North West corner (not the center).

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to post
Share on other sites

HUGE UPDATE!😀

 

Okay so it turns out the issue is clearly do with the second argument in "getPathToPosition()". The default value is 1, (which finds a path to one block before the target) but when I set it to 0 it finds a path exactly to the target! 

 

So instead of using 

this.creature.getNavigator().tryMoveToXYZ

 

✔️I'm using                                                                                                                                                                        👇

Path testPath = this.creature.getNavigator().getPathToPos(destinationBlock, 0);
this.creature.getNavigator().setPath(testPath, 1.0f);

 

and it works! As of now this is a working solution, I'll keep this updated if I find a problem with it later on.

Edited by Speedy1000
Incorrect Information
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
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.



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • hey so ive ran into a problem trying to make an server for vampires and vampire hunters when i go to look at mod items i crash  ---- Minecraft Crash Report ---- WARNING: coremods are present:   TheBetweenlandsLoadingPlugin (TheBetweenlands-2.0.4-alpha-universal.jar)   CTMCorePlugin (CTM-MC1.10.2-0.3.2.35.jar)   OpenModsCorePlugin (OpenModsLib-1.10.2-0.11.5.jar)   MalisisCorePlugin (malisiscore-1.10.2-4.4.0.jar) Contact their authors BEFORE contacting forge // You should try our sister game, Minceraft! Time: 6/18/21 6:44 PM Description: Rendering screen java.lang.NullPointerException: Rendering screen     at net.minecraft.client.renderer.RenderItem.func_180453_a(RenderItem.java:418)     at net.minecraft.client.renderer.RenderItem.func_175030_a(RenderItem.java:391)     at net.minecraft.client.gui.inventory.GuiContainerCreative.func_147051_a(GuiContainerCreative.java:868)     at net.minecraft.client.gui.inventory.GuiContainerCreative.func_146976_a(GuiContainerCreative.java:703)     at net.minecraft.client.gui.inventory.GuiContainer.func_73863_a(GuiContainer.java:76)     at net.minecraft.client.renderer.InventoryEffectRenderer.func_73863_a(InventoryEffectRenderer.java:51)     at net.minecraft.client.gui.inventory.GuiContainerCreative.func_73863_a(GuiContainerCreative.java:591)     at net.minecraftforge.client.ForgeHooksClient.drawScreen(ForgeHooksClient.java:382)     at net.minecraft.client.renderer.EntityRenderer.func_181560_a(EntityRenderer.java:1094)     at net.minecraft.client.Minecraft.func_71411_J(Minecraft.java:1076)     at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:371)     at net.minecraft.client.main.Main.main(SourceFile:124)     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)     at java.lang.reflect.Method.invoke(Method.java:497)     at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)     at net.minecraft.launchwrapper.Launch.main(Launch.java:28) A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- Head -- Thread: Client thread Stacktrace:     at net.minecraft.client.renderer.RenderItem.func_180453_a(RenderItem.java:418)     at net.minecraft.client.renderer.RenderItem.func_175030_a(RenderItem.java:391)     at net.minecraft.client.gui.inventory.GuiContainerCreative.func_147051_a(GuiContainerCreative.java:868)     at net.minecraft.client.gui.inventory.GuiContainerCreative.func_146976_a(GuiContainerCreative.java:703)     at net.minecraft.client.gui.inventory.GuiContainer.func_73863_a(GuiContainer.java:76)     at net.minecraft.client.renderer.InventoryEffectRenderer.func_73863_a(InventoryEffectRenderer.java:51)     at net.minecraft.client.gui.inventory.GuiContainerCreative.func_73863_a(GuiContainerCreative.java:591)     at net.minecraftforge.client.ForgeHooksClient.drawScreen(ForgeHooksClient.java:382) -- Screen render details -- Details:     Screen name: net.minecraft.client.gui.inventory.GuiContainerCreative     Mouse location: Scaled: (324, 16). Absolute: (1297, 937)     Screen size: Scaled: (480, 251). Absolute: (1920, 1001). Scale factor of 4 -- Affected level -- Details:     Level name: MpServer     All players: 1 total; [EntityPlayerSP['FirexQueen7988'/222, l='MpServer', x=172.58, y=64.00, z=250.93]]     Chunk stats: MultiplayerChunkCache: 121, 121     Level seed: 0     Level generator: ID 00 - default, ver 1. Features enabled: false     Level generator options:      Level spawn location: World: (192,64,248), Chunk: (at 0,4,8 in 12,15; contains blocks 192,0,240 to 207,255,255), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,0,0 to 511,255,511)     Level time: 47936 game time, 47936 day time     Level dimension: 0     Level storage version: 0x00000 - Unknown?     Level weather: Rain time: 0 (now: false), thunder time: 0 (now: false)     Level game mode: Game mode: survival (ID 0). Hardcore: false. Cheats: false     Forced entities: 86 total; [[EntityConvertedCreature['Vampire Horse'/512, l='MpServer', x=211.90, y=63.00, z=266.17] representing EntityHorse['Horse'/536, l='MpServer', x=211.90, y=63.00, z=266.17]], EntityPlayerSP['FirexQueen7988'/222, l='MpServer', x=168.85, y=64.00, z=250.31], EntityCreeper['Creeper'/776, l='MpServer', x=192.50, y=44.00, z=232.50], EntityCreeper['Creeper'/521, l='MpServer', x=145.50, y=34.00, z=277.50], EntityZombie['Zombie'/650, l='MpServer', x=113.50, y=18.00, z=314.50], EntityBasicVampire['Vampire'/269, l='MpServer', x=156.75, y=64.00, z=254.66], EntityCreeper['Creeper'/781, l='MpServer', x=215.18, y=55.00, z=272.58], EntitySquid['Squid'/530, l='MpServer', x=191.85, y=61.58, z=305.73], EntitySquid['Squid'/532, l='MpServer', x=189.81, y=60.00, z=308.96], EntityCreeper['Creeper'/663, l='MpServer', x=158.50, y=32.00, z=245.50], EntitySkeleton['Skeleton'/279, l='MpServer', x=111.50, y=68.00, z=309.50], EntityBat['Bat'/794, l='MpServer', x=117.52, y=49.07, z=254.65], EntityItem['item.item.leather'/796, l='MpServer', x=208.40, y=62.00, z=280.32], EntityZombie['Zombie'/669, l='MpServer', x=206.50, y=55.00, z=292.50], EntityBat['Bat'/797, l='MpServer', x=223.75, y=32.96, z=278.25], EntityZombie['Zombie'/670, l='MpServer', x=205.50, y=55.00, z=293.50], EntityZombie['Zombie'/671, l='MpServer', x=204.50, y=55.00, z=293.50], EntityBat['Bat'/799, l='MpServer', x=163.25, y=22.03, z=236.75], EntityBat['Bat'/802, l='MpServer', x=121.58, y=57.00, z=284.52], EntityBat['Bat'/547, l='MpServer', x=156.25, y=48.10, z=215.75], EntityBat['Bat'/804, l='MpServer', x=169.25, y=58.10, z=280.75], EntityCreeper['Creeper'/421, l='MpServer', x=162.50, y=25.00, z=277.50], EntityBat['Bat'/559, l='MpServer', x=178.55, y=43.10, z=200.25], EntitySkeleton['Skeleton'/819, l='MpServer', x=174.50, y=47.00, z=222.50], EntityBat['Bat'/692, l='MpServer', x=165.82, y=33.56, z=197.86], EntityBasicVampire['Vampire'/568, l='MpServer', x=132.50, y=29.00, z=251.22], EntityBat['Bat'/696, l='MpServer', x=138.25, y=57.10, z=278.25], EntityPig['Pig'/58, l='MpServer', x=107.87, y=64.00, z=252.45], EntityBasicVampire['Vampire'/445, l='MpServer', x=209.39, y=62.21, z=278.20], EntityPig['Pig'/62, l='MpServer', x=109.49, y=72.00, z=276.22], EntityItem['item.item.seeds'/447, l='MpServer', x=216.30, y=63.00, z=264.13], EntityItem['item.item.arrow'/831, l='MpServer', x=189.20, y=63.00, z=218.96], EntityItem['item.item.bone'/832, l='MpServer', x=188.54, y=63.00, z=220.21], EntityZombie['Zombie'/705, l='MpServer', x=183.20, y=42.00, z=307.48], EntityWitch['Witch'/834, l='MpServer', x=159.26, y=47.00, z=189.47], EntityZombie['Zombie'/835, l='MpServer', x=159.50, y=20.00, z=239.50], EntityCreeper['Creeper'/836, l='MpServer', x=157.50, y=20.00, z=237.50], EntitySpider['Spider'/837, l='MpServer', x=158.50, y=20.00, z=236.50], EntityPig['Pig'/70, l='MpServer', x=120.49, y=64.00, z=189.77], EntityCreeper['Creeper'/838, l='MpServer', x=157.50, y=53.00, z=232.50], EntitySkeleton['Skeleton'/585, l='MpServer', x=138.50, y=52.00, z=266.50], EntitySkeleton['Skeleton'/713, l='MpServer', x=112.50, y=72.00, z=272.50], EntitySkeleton['Skeleton'/714, l='MpServer', x=112.50, y=72.00, z=276.50], EntityZombie['Zombie'/331, l='MpServer', x=183.23, y=64.00, z=241.93], EntityCreeper['Creeper'/843, l='MpServer', x=123.50, y=43.00, z=226.50], EntityItem['item.item.rottenFlesh'/844, l='MpServer', x=191.63, y=64.00, z=237.63], EntityAdvancedVampire['Cultist Courn'/77, l='MpServer', x=169.70, y=37.00, z=239.50], EntityAdvancedVampire['Prince Zin'/78, l='MpServer', x=174.31, y=37.00, z=235.50], EntityAdvancedVampire['Sinister Solace'/79, l='MpServer', x=168.68, y=22.00, z=267.50], EntityHorse['Horse'/80, l='MpServer', x=168.87, y=64.00, z=271.07], EntityItem['item.item.vampirism.blood_bottle'/81, l='MpServer', x=173.57, y=21.00, z=273.21], EntitySpider['Spider'/594, l='MpServer', x=147.50, y=65.00, z=270.50], EntityHorse['Horse'/84, l='MpServer', x=166.90, y=64.00, z=229.00], EntityHorse['Horse'/85, l='MpServer', x=168.51, y=64.00, z=230.75], EntityHorse['Horse'/86, l='MpServer', x=185.46, y=64.00, z=260.61], EntityHorse['Horse'/87, l='MpServer', x=164.13, y=64.00, z=240.14], EntityHorse['Horse'/88, l='MpServer', x=191.04, y=64.00, z=266.11], EntityZombie['Zombie'/344, l='MpServer', x=188.77, y=64.00, z=248.45], EntityBasicVampire['Vampire'/601, l='MpServer', x=181.83, y=63.00, z=192.85], EntityHorse['Horse'/89, l='MpServer', x=191.36, y=62.67, z=279.97], EntityPlayerSP['FirexQueen7988'/222, l='MpServer', x=172.58, y=64.00, z=250.93], EntityPlayerSP['FirexQueen7988'/222, l='MpServer', x=196.70, y=64.00, z=237.70], EntitySkeleton['Skeleton'/604, l='MpServer', x=164.50, y=48.00, z=187.50], EntitySheep['Sheep'/94, l='MpServer', x=207.27, y=65.00, z=187.46], EntityHorse['Horse'/95, l='MpServer', x=184.01, y=64.00, z=240.06], EntitySpider['Spider'/479, l='MpServer', x=211.50, y=66.00, z=189.50], EntityZombie['Zombie'/607, l='MpServer', x=113.50, y=37.00, z=273.50], EntityZombie['Zombie'/736, l='MpServer', x=190.50, y=33.00, z=291.50], EntityChicken['Chicken'/99, l='MpServer', x=222.38, y=65.00, z=188.17], EntityBasicVampire['Vampire'/739, l='MpServer', x=190.50, y=33.00, z=294.50], EntityItem['item.item.seeds'/484, l='MpServer', x=206.18, y=62.00, z=276.70], EntitySkeleton['Skeleton'/228, l='MpServer', x=216.50, y=66.00, z=208.79], EntityBasicVampire['Vampire'/740, l='MpServer', x=188.50, y=33.00, z=297.50], EntityBasicVampire['Vampire'/613, l='MpServer', x=142.50, y=17.00, z=205.50], EntityChicken['Chicken'/101, l='MpServer', x=218.26, y=65.00, z=191.10], EntityBat['Bat'/742, l='MpServer', x=128.08, y=56.00, z=231.33], EntitySkeleton['Skeleton'/619, l='MpServer', x=195.50, y=53.00, z=303.50], EntityZombie['Zombie'/236, l='MpServer', x=187.64, y=64.00, z=256.81], EntityZombie['Zombie'/622, l='MpServer', x=150.65, y=23.00, z=307.65], EntityZombie['Zombie'/623, l='MpServer', x=151.50, y=23.00, z=306.50], EntityBat['Bat'/628, l='MpServer', x=168.01, y=17.32, z=287.36], EntityCreeper['Creeper'/760, l='MpServer', x=210.50, y=50.00, z=287.50], EntityBasicVampire['Vampire'/761, l='MpServer', x=212.50, y=50.00, z=287.50], EntityBasicVampire['Vampire'/762, l='MpServer', x=215.21, y=50.00, z=287.53], EntityBasicVampire['Vampire'/763, l='MpServer', x=149.50, y=42.00, z=292.50], EntityBat['Bat'/507, l='MpServer', x=234.75, y=54.10, z=258.25]]     Retry entities: 0 total; []     Server brand: fml,forge     Server type: Non-integrated multiplayer server Stacktrace:     at net.minecraft.client.multiplayer.WorldClient.func_72914_a(WorldClient.java:415)     at net.minecraft.client.Minecraft.func_71396_d(Minecraft.java:2660)     at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:392)     at net.minecraft.client.main.Main.main(SourceFile:124)     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)     at java.lang.reflect.Method.invoke(Method.java:497)     at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)     at net.minecraft.launchwrapper.Launch.main(Launch.java:28) -- System Details -- Details:     Minecraft Version: 1.10.2     Operating System: Windows 10 (amd64) version 10.0     Java Version: 1.8.0_51, Oracle Corporation     Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation     Memory: 1227847552 bytes (1170 MB) / 2447900672 bytes (2334 MB) up to 3817865216 bytes (3641 MB)     JVM Flags: 4 total; -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump -Xmx4096m -Xms256m -XX:PermSize=256m     IntCache: cache: 0, tcache: 0, allocated: 13, tallocated: 95     FML: MCP 9.32 Powered by Forge 12.18.3.2511 21 mods loaded, 21 mods active     States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored     UCHIJA    mcp{9.19} [Minecraft Coder Pack] (minecraft.jar)      UCHIJA    FML{8.0.99.99} [Forge Mod Loader] (forge-1.10.2-12.18.3.2511.jar)      UCHIJA    Forge{12.18.3.2511} [Minecraft Forge] (forge-1.10.2-12.18.3.2511.jar)      UCHIJA    openmodscore{0.11.5} [OpenModsLib Core] (minecraft.jar)      UCHIJA    BiomesOPlenty{5.0.0.2236} [Biomes O' Plenty] (BiomesOPlenty-1.10.2-5.0.0.2236-universal.jar)      UCHIJA    ctm{MC1.10.2-0.3.2.35} [CTM] (CTM-MC1.10.2-0.3.2.35.jar)      UCHIJA    chisel{MC1.10.2-0.2.1.47} [Chisel] (Chisel-MC1.10.2-0.2.1.47.jar)      UCHIJA    JEI{3.14.7.420} [Just Enough Items] (jei_1.10.2-3.14.7.420.jar)      UCHIJA    chiselsandbits{12.18} [Chisels & Bits] (chiselsandbits-12.18.jar)      UCHIJA    customnpcs{1.10.2} [CustomNPCs] (CustomNPCs_1.10.2(21jul17).jar)      UCHIJA    journeymap{1.10.2-5.5.2} [JourneyMap] (journeymap-1.10.2-5.5.2.jar)      UCHIJA    malisiscore{1.10.2-4.4.0} [MalisisCore] (malisiscore-1.10.2-4.4.0.jar)      UCHIJA    malisisdoors{1.10.2-5.2.0} [MalisisDoors] (malisisdoors-1.10.2-5.2.0.jar)      UCHIJA    minecolonies{@VERSION@} [MineColonies] (minecolonies-universal-1.10.2-0.9.7587.jar)      UCHIJA    openmods{0.11.5} [OpenModsLib] (OpenModsLib-1.10.2-0.11.5.jar)      UCHIJA    openblocks{1.7.6} [OpenBlocks] (OpenBlocks-1.10.2-1.7.6.jar)      UCHIJA    subcommonlib{1.1.3.0} [Subaraki's Common Library] (sublib-1.10.2-1.1.3.0.jar)      UCHIJA    telepads{1.10.2 v1.0.1.3} [Telepads] (telepads-1.10.2-1.0.1.3.jar)      UCHIJA    thebetweenlands{2.0.4-alpha} [The Betweenlands] (TheBetweenlands-2.0.4-alpha-universal.jar)      UCHIJA    vampirism{1.2.5} [Vampirism] (Vampirism-1.10.2-1.2.5.jar)      UCHIJA    teamlapen-lib{1.2.5} [TeamLapen Library] (Vampirism-1.10.2-1.2.5.jar)      Loaded coremods (and transformers):  TheBetweenlandsLoadingPlugin (TheBetweenlands-2.0.4-alpha-universal.jar)   thebetweenlands.core.TheBetweenlandsClassTransformer CTMCorePlugin (CTM-MC1.10.2-0.3.2.35.jar)   team.chisel.ctm.client.asm.CTMTransformer OpenModsCorePlugin (OpenModsLib-1.10.2-0.11.5.jar)   openmods.core.OpenModsClassTransformer MalisisCorePlugin (malisiscore-1.10.2-4.4.0.jar)   net.malisis.core.util.chunkcollision.ChunkCollisionTransformer   net.malisis.core.util.chunkblock.ChunkBlockTransformer   net.malisis.core.renderer.transformer.MalisisRendererTransformer   net.malisis.core.renderer.icon.asm.TextureMapTransformer   net.malisis.core.util.clientnotif.ClientNotifTransformer     GL info: ' Vendor: 'Intel' Version: '4.6.0 - Build 27.20.100.9565' Renderer: 'Intel(R) Iris(R) Xe Graphics'     OpenModsLib class transformers: [pre_world_render_hook:FINISHED],[movement_callback:FINISHED],[player_damage_hook:FINISHED],[map_gen_fix:FINISHED],[player_render_hook:FINISHED],[horse_null_fix:FINISHED]     Launched Version: forge-12.18.3.2511     LWJGL: 2.9.4     OpenGL: Intel(R) Iris(R) Xe Graphics GL version 4.6.0 - Build 27.20.100.9565, Intel     GL Caps: Using GL 1.3 multitexturing. Using GL 1.3 texture combiners. Using framebuffer objects because OpenGL 3.0 is supported and separate blending is supported. Shaders are available because OpenGL 2.1 is supported. VBOs are available because OpenGL 1.5 is supported.     Using VBOs: Yes     Is Modded: Definitely; Client brand changed to 'fml,forge'     Type: Client (map_client.txt)     Resource Packs:      Current Language: English (US)     Profiler Position: N/A (disabled)     CPU: 8x 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz
    • Ethera is Recruiting!   Ethera is a custom coded rpg mmo minecraft server. We are two years into development.  The server includes;  - Custom coded, dynamic, world generation (Our world is constantly & automatically changing) - Custom coded dungeon generator and  - Upgradeable settlement system - A custom coded professions and economy system.  - We can add original, new biomes to the world while players play.   We are looking for volunteers to join our amazing, dedicated, and creative Staff Team!   We are looking for anyone with skills in: - Building ( World Edit is an asset) - Java Development/ Plugin-Development - Plugin Configuration - Discord Bot Development - Web Design and Development - Digital Art - 3D modeling and Blockbench   -We have an age requirement -Having a working microphone is mandatory.   If you are interested you can join our discord: https://discord.gg/H9akt3C Or DM :   Kalinox#0001
    • Javadocs are built off crowdsourced mappings/docs that change depending on the status of the crowdsourced projects. So, no there is no good javadocs project or website because they always change. You're more then free to build the javadocs yourself for your workspace. And/Or use your IDE's built in javadoc reader. The only/best official docs are https://mcforge.readthedocs.io/en/latest/ created by users in this repo: https://github.com/MinecraftForge/Documentation
    • right, well the trouble with creating a copy on the main thread is that the data is going to be modified as the world is running, particularly from the overworld (seeing as this chunk generator is designed to work for a specific dimension). so ideally I need the data to be the most up to date the moment I create a new chunk. That being said if the data changes while the chunk is being generated (or preferably when the region is being generated), the main thread still needs to keep track of that but I don't want the chunk generator to have its copy changed. So getting a hold of the TardisManager is done through a thread safe map atm. Getting a reference to the specific tardis required is currently done from a non-thread safe map so can I just make it a thread safe map and that will be fine. If so then real difficulty seems to be then getting all of the data from the Tardis object that map holds a reference too. As discussed the best way to do that is to try and create a copy of it in a thread safe manor for use by the chunk generator. The question obviously is how. I presume then synchronised won't help me out here as I can't make every function that writes into this data structure so I need to somehow lock the whole datastructure for writing at the start of the copy function and unlock it at the end, how do you think I might do this? If this is the case should I remove synchronised from getThreadedTardisForPos function?  
    • Nope, it definitely unloaded (checked using the debugger). I spawned the entity at -10000 / -10000. I will investigate more tomorrow though.
  • Topics

  • Who's Online (See full list)

×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.