Jump to content

Billy Playz

Members
  • Posts

    12
  • Joined

  • Last visited

Posts posted by Billy Playz

  1. 40 minutes ago, Babelincoln1809 said:

    Anyone have or know how to get the current 1.14 textures? Not the textures from the website Mojang offers to you to try out. Like is there any way I can go through the files and copy them? I do a lot of texture work and I would like them to stay true to Minecraft.

     

    By this, I assume you mean the textures in 1.14 and wanting to re-texture them. In order to do this, you must locate your Minecraft folder and then locate your versions folder. Then you must press the 1.14 version you are wanting to use (as of now it is 1.14 pre-1) and open that folder. Then open the jar file with WinRar. Once opened, you then copy (ctrl+c) the "assets" file and paste it into a folder where you want to edit the files (ctrl+v). Alternatively, you can just drag the files into whatever folder you want (though does not always work).

    This post is not in the correct area though as this is not a modding support post, instead of a Minecraft support/texture support. Try the Minecraft Forums for future posts on these matters, or http://www.minecraftforge.net/forum/forum/65-texture-packs/!

  2. 37 minutes ago, V0idWa1k3r said:

    Don't just blindly copy the code others provide. For that matter never blindly copy other's code. In this case you are trying to use 1.12 code in a 1.13 environment. 

    You can always see how this is done in vanilla, something like BlockDispenser for example should be exactly what you need.

     

    I don't really see the point of this assertion. If the placer is null you will crash anyway one line later with a NPE. 

    3

    I do understand, it is just he asked what errors showed up as he could not figure out why it does not work as he could not see any notes saying it has been changed (and I know it has changed, hence why I am wanting to have some help on how to do it). I am aware that copying code blindly is bad, I have learnt. I am asking for rotating code in a java class as the vanilla code does not work and I have no idea what I am doing with it in 1.13.2 as the code has changed. What do I extend if I need to? What do I implement if I need to? What is the code for the placement? What is the code for checking the player? Where do I put the code? Can the code be in a class file, or does it have to be where I have set the properties? Is my code correct? The only answer I know is that I have no idea how to do it, and I cannot find any help on this. This is why I have turned to the forums - for answers.

  3. 13 hours ago, Big_Bad_E said:

    Sorry totally managed to misread that!
    I currently cannot test for 1.13.2 (gradle hates me :/), but the code should not change to my knowledge. If it does not work, what methods are missing/what is the error? 

    I have read through the notes and have not seen any changes to IProperty or any non-deprecated methods.

    Hi! This is what my Eclipse workspace area looks like when I tried your code. TY.

    Xh2Vo7o.png

  4. 17 hours ago, Big_Bad_E said:

    How to do rotation:

     

    1. Store the direction

    Add this to your block class:
     

    
    public static final PropertyDirection FACING = BlockHorizontal.FACING;

    This just stores the direction.

     

    2. Tell forge that direction is part of the state

    You need to tell forge direction is part of the state, so it can load it from the blockstate.

    Add this to your block's code:

    
    setDefaultState(getDefaultState().withProperty(FACING, EnumFacing.NORTH)

    (Add it to the constructor)

     

    3. Set the state when the block is placed.

    You have to set the state when the block is placed. Add this to your block class:

    
    @Override
        @Nonnull
        public IBlockState getStateForPlacement(@Nullable World world, @Nullable BlockPos pos, @Nullable EnumFacing facing, float hitX, float hitY, float hitZ, int meta, @Nullable EntityLivingBase placer, EnumHand hand) {
            assert placer != null;
            return this.getDefaultState().withProperty(FACING, placer.getHorizontalFacing().getOpposite());
        }

    The code

    
    placer.getHorizontalFacing().getOpposite()

    Just gets the horizontal facing direction (where you are looking along the x and z axis) then gets the opposite so the block faces you.

     

    4. Add it to your blockstate

    This is an example of a blockstate with facing (works in 1.12.2):

    
    {
      "variants": {
        "facing=north": { "model": "modid:model" },
        "facing=west": { "model": "modid:model", "y": 90 },
        "facing=south": { "model": "modid:model", "y": 180 },
        "facing=east": { "model": "modid:model", "y": 270 }
      }
    }

    (replace modid with your modid, model with the model resource location)

    6

    Hi, sorry but I am looking for 1.13.2 as it says in the title as I am trying to update my mod from 1.12.2 to 1.13.2. I know from 1.12.2, but 1.13.2 I still need to figure out. Thanks for replying anyway.

    Though if this is for 1.13.2 (though you do say 1.12.2 in the blockstate) please can you tell me how my workspace should look?

  5. On 3/20/2019 at 11:14 PM, DavidM said:

    Do you mean setting the block to face the player when placed down?

    Override Block#getStateForPlacement and return the blockstate of facing in the player's direction.

    Also change the variants in the blockstates json to match your rotation.

     

    For reference, look at how the vanilla furnace handles it.

    Hi! Sorry that it has been a while but do you mind if you could give me an example of 1.13 rotation on placement feature? I have tried messing with my code but I cannot get rotation to work in my block.

    I checked the furnace code and got the rotation code from it but it does not work as some things come out as deprecated or just not working. Sorry to be annoying if I am, but thanks if I get any replies again.

  6. Adfocus can be dangerous as you do not see the file until you download it, it uses ads that can not be relevant (leading to 18+ ads being shown to young children) and many people use this to make money off of other peoples hard work.

  7. Okay so I tried to load up my mod (fresh from gradlew eclipse) and it shows up with the following:

    'Project 'BDM' is missing required library: '<DIRECTORY>\.gradle\daemon\4.9\unresolved dependency - net.minecraftforge forge 1.13.2-25.0.60_mapped_snapshot_20180921-1.13''

    Any way to fix/resolve this? I cannot work without fixing it.

  8. Hi, I took some classes/code from Mr.Crayfish to create his sittable chairs (the EntitySittableBlock & SittableUtil) but when I add the code for onBlockActivated, I get stuck to the chair but the mob gets removed. Please could someone help with this issue? Here is my code for my chair class.. please can someone tell me what is wrong or what to add to resolve this issue?

    Spoiler
    
    package com.billyplayz.billysdecosmod.blocks;
    
    import java.util.List;
    
    import com.billyplayz.billysdecosmod.entity.EntitySittableBlock;
    import com.billyplayz.billysdecosmod.util.CollisionHelper;
    import com.billyplayz.billysdecosmod.util.SittableUtil;
    import com.google.common.collect.Lists;
    
    import net.minecraft.block.SoundType;
    import net.minecraft.block.material.Material;
    import net.minecraft.block.properties.IProperty;
    import net.minecraft.block.properties.PropertyDirection;
    import net.minecraft.block.state.BlockStateContainer;
    import net.minecraft.block.state.IBlockState;
    import net.minecraft.entity.Entity;
    import net.minecraft.entity.EntityLivingBase;
    import net.minecraft.entity.player.EntityPlayer;
    import net.minecraft.util.EnumFacing;
    import net.minecraft.util.EnumHand;
    import net.minecraft.util.math.AxisAlignedBB;
    import net.minecraft.util.math.BlockPos;
    import net.minecraft.world.IBlockAccess;
    import net.minecraft.world.World;
    
    public class ChairBlock extends BlockBase{
    	
    	private boolean red = false;
    	public static final PropertyDirection FACING = PropertyDirection.create("facing", EnumFacing.Plane.HORIZONTAL);
    	
    	public static final AxisAlignedBB BOUNDING_BOX = new AxisAlignedBB(0.125, 0.0, 0.125, 0.875, 1.125, 0.875);
    
        public static final AxisAlignedBB CHAIR_SEAT = new AxisAlignedBB(0.125, 0.0, 0.125, 0.875, 0.5, 0.875);
        public static final AxisAlignedBB CHAIR_BACKREST_NORTH = CollisionHelper.getBlockBounds(EnumFacing.NORTH, 0.0, 0.5, 0.125, 0.125, 1.125, 0.875);
        public static final AxisAlignedBB CHAIR_BACKREST_EAST = CollisionHelper.getBlockBounds(EnumFacing.EAST, 0.0, 0.5, 0.125, 0.125, 1.125, 0.875);
        public static final AxisAlignedBB CHAIR_BACKREST_SOUTH = CollisionHelper.getBlockBounds(EnumFacing.SOUTH, 0.0, 0.5, 0.125, 0.125, 1.125, 0.875);
        public static final AxisAlignedBB CHAIR_BACKREST_WEST = CollisionHelper.getBlockBounds(EnumFacing.WEST, 0.0, 0.5, 0.125, 0.125, 1.125, 0.875);
    
    	public ChairBlock(String name, Material material) {
    		super(name, material.WOOD);
    		setSoundType(SoundType.WOOD);
    	}
    	
    	@Override
        public boolean isFullCube(IBlockState state)
        {
            return false;
        }
    	
    	@Override
        public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos)
        {
            return BOUNDING_BOX;
        }
    	
    	@Override
        public int getComparatorInputOverride(IBlockState blockState, World worldIn, BlockPos pos)
        {
            return SittableUtil.isSomeoneSitting(worldIn, pos.getX(), pos.getY(), pos.getZ()) ? 1 : 0;
        }
    	
    	@Override
        public void addCollisionBoxToList(IBlockState state, World worldIn, BlockPos pos, AxisAlignedBB entityBox, List<AxisAlignedBB> collidingBoxes, Entity entityIn, boolean p_185477_7_)
        {
            if(!(entityIn instanceof EntitySittableBlock))
            {
                List<AxisAlignedBB> list = getCollisionBoxList(this.getActualState(state, worldIn, pos));
                for(AxisAlignedBB box : list)
                {
                    addCollisionBoxToList(pos, entityBox, collidingBoxes, box);
                }
            }
        }
    	
    	private List<AxisAlignedBB> getCollisionBoxList(IBlockState state)
        {
            List<AxisAlignedBB> list = Lists.newArrayList();
            EnumFacing facing = state.getValue(FACING);
            switch(facing)
            {
                case NORTH:
                    list.add(CHAIR_BACKREST_NORTH);
                    break;
                case SOUTH:
                    list.add(CHAIR_BACKREST_SOUTH);
                    break;
                case WEST:
                    list.add(CHAIR_BACKREST_WEST);
                    break;
                default:
                    list.add(CHAIR_BACKREST_EAST);
                    break;
            }
            list.add(CHAIR_SEAT);
            return list;
        }
    	
    	 @Override
    	    public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ)
    	    {
    	        if(!playerIn.isSneaking())
    	        {
    	            if(SittableUtil.sitOnBlock(worldIn, pos.getX(), pos.getY(), pos.getZ(), playerIn, 6 * 0.0625))
    	            {
    	                worldIn.updateComparatorOutputLevel(pos, this);
    	                return true;
    	            }
    	        }
    	        return false;
    	}
    	
    	@Override
    	public IBlockState getStateFromMeta(int meta)
    	{
    	EnumFacing facing = EnumFacing.getFront(meta);
    	if(facing.getAxis()==EnumFacing.Axis.Y) {
    		facing=EnumFacing.NORTH;
    	}
    	return getDefaultState().withProperty(FACING, facing);
    	}
    	
    	@Override
    	public int getMetaFromState(IBlockState state)
    	{
    		return ((EnumFacing) state.getValue(FACING)).getIndex();
    	}
    
    	@Override
    	protected BlockStateContainer createBlockState()
    	{
    		return new BlockStateContainer(this, new IProperty[]{FACING});
    	}
    		
    	@Override
    	public IBlockState getStateForPlacement(World worldIn, BlockPos pos,
    	EnumFacing facing, float hitX, float hitY, float hitZ, int meta,
    	EntityLivingBase placer)
    	{
    		return getDefaultState().withProperty(FACING, placer.getHorizontalFacing().getOpposite());
    	}
    
    }

     

    Thank you to anyone who can help me.

×
×
  • Create New...

Important Information

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