Jump to content

Abastro

Forge Modder
  • Posts

    1075
  • Joined

  • Last visited

  • Days Won

    2

Posts posted by Abastro

  1. You should not be using forgedebugmodelloaderregistry as your domain.

    map_Kd forgedebugmodelloaderregistry:tardis
    

    Do not just copy-pasting from the test mod.

    The map location should be (your resource domain):(resource name), like ResourceLocation.

    Also note that the texture gets into "assets/(resourceDomain)/textures/blocks".

     

    And the log you given is unrelated with this issue, it is normal behavior of Forge Obj model loader.

  2. Try providing the location of hopper model through ModelLoader.setCustomModelResourceLocation(...),

    and bind hopper state mapper using

    ModelLoader.setCustomStateMapper((Your Block), (new StateMap.Builder()).ignore(new IProperty[] {BlockHopper.ENABLED}).build());
    

    (Gotten from BlockModelShapes#registerAllBlocks)

     

    This will ensure that the model will be identical to the vanilla hopper model in any case.

     

    If you want to make your model modifiable in resourcepacks, you should copy the model, textures, and blockstates file for the hopper.

     

    EDIT: first parameter of setCustomStateMapper should be your block, sorry for the previous mistake.

  3. 1. You can use Block#getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos) or Block#getExtendedState(IBlockState state, IBlockAccess worldIn, BlockPos pos).

    I can't see any better way in performance, since the block state is not saved into the world itself.

    2. I think the code could be easily cleaned further by using for loops and maps.

     

    EDIT: Gotten from BlockStairs code, the stairs also use this way.

    public void addCollisionBoxToList(IBlockState state, World worldIn, BlockPos pos, AxisAlignedBB entityBox, List<AxisAlignedBB> collidingBoxes, @Nullable Entity entityIn)
        {
            state = this.getActualState(state, worldIn, pos);
    
            for (AxisAlignedBB axisalignedbb : getCollisionBoxList(state))
            {
                addCollisionBoxToList(pos, entityBox, collidingBoxes, axisalignedbb);
            }
        }

  4. I think it is not a bug but a feature in forge configuration system.

    Since it should load properties before any property is initialized, the value loaded from the file couldn't be checked.

    Also it is not checked in getInt(or getValue), since it might be odd to check and give value in bound while the actual value does not change. (Changing the value will result in messy code, in my opinion.)

     

    The minValue / maxValue are only for Gui Configs, currently.

  5. I want to log and save a list: players joined the server

     

    inside log file:

    MC username, and time they joined, and how many have joined

    Note that PlayerLoggedInEvent has the joined player as public field.

    1. MC username: player.getDisplayName()

    2. Time they joined: I'd assume that you know how to get system time.

    To get minecraft time, use World#getWorldTime(). (Player has public field named worldObj)

    Get the Overworld using MinecraftServer#getEntityWorld() to get universal server time.

    3. How many players have joined:

      - length of World#playerEntities for players in the world.

      - MinecraftServer#getCurrentPlayerCount() for all players in the server.

     

    And what do you mean (EDIT) by saving the list?

  6. What about mod compatibility though, how can it properly render machines and such when the packets sent to the client often use Minecraft.theWorld to set things? despite those packets being for a different world.

    It seems that it uses own packet system to give the client world information, and the client stores the world to the ProxyWorldManager.

    Also if one uses proper rendering pipeline, there won't be compatibility issue.

     

    ..Though it also looks like that it might have severe performance issue.

  7. Ah, sorry for not catching the mistake:

    You registered something wrong.

    	ModelLoader.setCustomStateMapper(BlockInit.RAINBOW_SAPLING_BLOCK, rainbowLeafStateMap.build());
    	ModelLoader.setCustomStateMapper(BlockInit.RAINBOW_SAPLING_BLOCK, rainbowSaplingStateMap.build());
    

     

    I see something duplicated.

  8. Here's the thing, I have a gun item that has and ItemStackHandler that hold all that parts for that gun. What I want is to be able to add upgrades to the gun, and those upgrades modify different things. Also I would like the upgrades to have different tiers/modify multiple things such as say an Upgrade that adds 1 damage and 1 reload, or an upgrade that removes 2 damage and adds 1 clip. How would I do this with or without capabilities? Also these upgrades are not craftable in the crafting table.

    If the upgrades belong to the gun, then you should store the capabilities to the itemstack for guns.

    In this case,

    1. Upgrades for the gun: Capabilities for the gun.

        - The implementation may vary up to your purpose and design decision.

    2. Applying the effect: Use events, and check for the capabilities(upgrades).

  9. So, it seems that it does not update because you used 0, which won't do anything.

     

    From the World#setBlockState, it's same for markAndNotifyBlock.

        /**
         * Sets the block state at a given location. Flag 1 will cause a block update. Flag 2 will send the change to
         * clients (you almost always want this). Flag 4 prevents the block from being re-rendered, if this is a client
         * world. Flags can be added together.
         */
    

×
×
  • Create New...

Important Information

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