Jump to content

Artsicle

Members
  • Posts

    12
  • Joined

  • Last visited

Everything posted by Artsicle

  1. Oh, thanks
  2. With my new tile entity, my nbt isnt importing when reloading the world, and all of the nbt data is being shared across all the blocks. Also it said something like "Tile Entity is missing a mapping!" before I added the auto inserter register. That makes sense, however the NBT is still not working for the auto inserter but it is for the extractor (Using 1.12.2) GameRegistry.registerTileEntity(TileEntityExtractor.class, Reference.MOD_ID + "TileEntityExtractor"); GameRegistry.registerTileEntity(TileEntityAutoInserter.class, Reference.MOD_ID + "TileEntityAutoInserter"); http://prntscr.com/gqxlsm public class TileEntityAutoInserter extends TileEntity { static int redstoneCount; static int OreCount; @Override public NBTTagCompound writeToNBT(NBTTagCompound compound) { compound.setInteger("OreCount", OreCount); compound.setInteger("Count", redstoneCount); return super.writeToNBT(compound); } @Override public void readFromNBT(NBTTagCompound compound) { super.readFromNBT(compound); OreCount = compound.getInteger("OreCount"); redstoneCount = compound.getInteger("redstoneCount"); } Also, I'm doing @Nullable @Override public TileEntity createNewTileEntity( World worldIn , int meta ) { return new TileEntityAutoInserter(); } From BlockAutoInserter.java
  3. Would I do it sort of like this? container.getCapability(Capability<IItemHandler.class>,EnumFacing.NORTH); EDIT: Found it. itemhandler = container.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, EnumFacing.NORTH);
  4. But what do I do after? TileEntity container = worldIn.getTileEntity(po);
  5. Well that's the container.
  6. I've been trying to add an item to a chest, but I dont know exactly how to do it. if(worldIn.getBlockState(po).getBlock() == Blocks.CHEST) { Block chest = worldIn.getBlockState(po).getBlock(); chest. } That's my code, the chest. is there from me trying to find something from auto complete but I don't know what to do. If anyone knows please reply! Thanks!
  7. Try getting the players look vector so you can then change the velocity of the particles
  8. Fixed it! No need to help anymore
  9. I've been trying to get my block to accept redstone. I already have this @Override public boolean canConnectRedstone(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing side) { return true; } But I don't know how to get if it's actually getting power, and what level of power it is. Tried this @Override public int getWeakPower(IBlockState blockState, IBlockAccess blockAccess, BlockPos pos, EnumFacing side) { if(super.getWeakPower(blockState, blockAccess, pos, side) >=1) { powered = true; } else { powered = false; } return super.getWeakPower(blockState, blockAccess, pos, side); } but it didnt work, and minecraft doesnt have a default "Powered" blockstate property if you were gonna suggest that, unless its named strangely then do suggest it. Thanks!
  10. Thanks, I got it! (For those who want to know, here is the code) @Override public IBlockState getStateForPlacement(World world, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer, EnumHand hand) { return super.getStateForPlacement(world, pos, facing, hitX, hitY, hitZ, meta, placer, hand).withProperty(FACING, placer.getHorizontalFacing()); }
  11. to port over this may help https://shadowfacts.net/tutorials/forge-modding-112/
  12. I know how to do this in 1.10 I think but /*@Override public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack) { super.onBlockPlacedBy(worldIn, pos, state, placer, stack); }*/ I'm not used to that method ^ I'm used to /*@Override public IBlockState onBlockPlaced*/ but that's not in 1.12. I tried doing super.onBlockPlacedBy(worldIn, pos, state.withProperty(FACING, placer.getHorizontalFacing()), placer, stack); But that didnt work. If anyone knows please reply.
×
×
  • Create New...

Important Information

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